From a00963d1d5c207e484f5eb21bbcaa76be5656e4e Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Tue, 18 Mar 2025 07:23:02 -0700 Subject: [PATCH] Update debugger-frontend from 97e9912...46feed4 (#50094) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50094 Changelog: [Internal] - Update `react-native/debugger-frontend` from 97e9912...46feed4 Resyncs `react-native/debugger-frontend` from GitHub - see `rn-chrome-devtools-frontend` [changelog](https://github.com/facebook/react-native-devtools-frontend/compare/97e9912605ce73b06f67fc607c1a5c434a67d6de...46feed41c15bcaafa086c1397562fa2af7cc503b). Reviewed By: hoxyq Differential Revision: D71391122 fbshipit-source-id: f7c201c407d417ec84509ae05a881bfc770009a0 --- packages/debugger-frontend/BUILD_INFO | 6 +++--- .../dist/third-party/front_end/core/common/common.js | 2 +- .../dist/third-party/front_end/panels/network/network.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/debugger-frontend/BUILD_INFO b/packages/debugger-frontend/BUILD_INFO index 683a8a05343..f33ae91963a 100644 --- a/packages/debugger-frontend/BUILD_INFO +++ b/packages/debugger-frontend/BUILD_INFO @@ -1,8 +1,8 @@ -@generated SignedSource<<347069bf171def94f2e48bf1e82bb02d>> -Git revision: 97e9912605ce73b06f67fc607c1a5c434a67d6de +@generated SignedSource<> +Git revision: 46feed41c15bcaafa086c1397562fa2af7cc503b Built with --nohooks: false Is local checkout: false -Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend +Remote URL: https://github.com/facebook/react-native-devtools-frontend Remote branch: main GN build args (overrides only): is_official_build = true diff --git a/packages/debugger-frontend/dist/third-party/front_end/core/common/common.js b/packages/debugger-frontend/dist/third-party/front_end/core/common/common.js index 754cda7acc7..5f1e1af50cc 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/core/common/common.js +++ b/packages/debugger-frontend/dist/third-party/front_end/core/common/common.js @@ -1 +1 @@ -import*as t from"../root/root.js";import*as e from"../platform/platform.js";export{UIString}from"../platform/platform.js";import*as r from"../i18n/i18n.js";var s=Object.freeze({__proto__:null});const n=[];var i=Object.freeze({__proto__:null,registerAppProvider:function(t){n.push(t)},getRegisteredAppProviders:function(){return n.filter((e=>t.Runtime.Runtime.isDescriptorEnabled({experiment:void 0,condition:e.condition}))).sort(((t,e)=>(t.order||0)-(e.order||0)))}});const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(123);for(let t=0;t<64;++t)o[a.charCodeAt(t)]=t;var l=Object.freeze({__proto__:null,BASE64_CHARS:a,BASE64_CODES:o,decode:function(t){let e=3*t.length/4>>>0;61===t.charCodeAt(t.length-2)?e-=2:61===t.charCodeAt(t.length-1)&&(e-=1);const r=new Uint8Array(e);for(let e=0,s=0;e>4,r[s++]=(15&i)<<4|a>>2,r[s++]=(3&a)<<6|63&l}return r.buffer},encode:function(t){return new Promise(((e,r)=>{const s=new FileReader;s.onerror=()=>r(new Error("failed to convert to base64")),s.onload=()=>{const t=s.result,[,r]=t.split(",",2);e(r)},s.readAsDataURL(new Blob([t]))}))}});var h=Object.freeze({__proto__:null,CharacterIdMap:class{#t;#e;#r;constructor(){this.#t=new Map,this.#e=new Map,this.#r=33}toChar(t){let e=this.#t.get(t);if(!e){if(this.#r>=65535)throw new Error("CharacterIdMap ran out of capacity!");e=String.fromCharCode(this.#r++),this.#t.set(t,e),this.#e.set(e,t)}return e}fromChar(t){const e=this.#e.get(t);return void 0===e?null:e}}});const c=.9642,u=.8251;class g{values=[0,0,0];constructor(t){t&&(this.values=t)}}class d{values=[[0,0,0],[0,0,0],[0,0,0]];constructor(t){t&&(this.values=t)}multiply(t){const e=new g;for(let r=0;r<3;++r)e.values[r]=this.values[r][0]*t.values[0]+this.values[r][1]*t.values[1]+this.values[r][2]*t.values[2];return e}}class p{g;a;b;c;d;e;f;constructor(t,e,r=0,s=0,n=0,i=0,a=0){this.g=t,this.a=e,this.b=r,this.c=s,this.d=n,this.e=i,this.f=a}eval(t){const e=t<0?-1:1,r=t*e;return rF?t:t+Math.pow(F-t,D)}function J(t,e){if(t=K(t),e=K(e),Math.abs(t-e)t?(r=(Math.pow(e,G)-Math.pow(t,M))*U,r=r-H?0:r+$),100*r}function Q(t,e,r){function s(){return r?Math.pow(Math.abs(Math.pow(t,W)-(-e-$)/j),1/X):Math.pow(Math.abs(Math.pow(t,G)-(e+$)/U),1/M)}t=K(t),e/=100;let n=s();return(n<0||n>1)&&(r=!r,n=s()),n}const tt=[[12,-1,-1,-1,-1,100,90,80,-1,-1],[14,-1,-1,-1,100,90,80,60,60,-1],[16,-1,-1,100,90,80,60,55,50,50],[18,-1,-1,90,80,60,55,50,40,40],[24,-1,100,80,60,55,50,40,38,35],[30,-1,90,70,55,50,40,38,35,40],[36,-1,80,60,50,40,38,35,30,25],[48,100,70,55,40,38,35,30,25,20],[60,90,60,50,38,35,30,25,20,20],[72,80,55,40,35,30,25,20,20,20],[96,70,50,35,30,25,20,20,20,20],[120,60,40,30,25,20,20,20,20,20]];function et(t,e){const r=72*parseFloat(t.replace("px",""))/96;return(isNaN(Number(e))?["bold","bolder"].includes(e):Number(e)>=600)?r>=14:r>=18}tt.reverse();const rt={aa:3,aaa:4.5},st={aa:4.5,aaa:7};var nt=Object.freeze({__proto__:null,blendColors:k,rgbToHsl:L,rgbaToHsla:_,rgbToHwb:O,rgbaToHwba:B,luminance:N,contrastRatio:function(t,e){const r=N(k(t,e)),s=N(e);return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)},luminanceAPCA:Z,contrastRatioAPCA:Y,contrastRatioByLuminanceAPCA:J,desiredLuminanceAPCA:Q,getAPCAThreshold:function(t,e){const r=parseFloat(t.replace("px","")),s=parseFloat(e);for(const[t,...e]of tt)if(r>=t)for(const[t,r]of[900,800,700,600,500,400,300,200,100].entries())if(s>=r){const r=e[e.length-1-t];return-1===r?null:r}return null},isLargeFont:et,getContrastThreshold:function(t,e){return et(t,e)?rt:st}});function it(t){return(t%360+360)%360}function at(t){const e=t.replace(/(deg|g?rad|turn)$/,"");if(isNaN(e)||t.match(/\s+(deg|g?rad|turn)/))return null;const r=parseFloat(e);return t.includes("turn")?360*r:t.includes("grad")?9*r/10:t.includes("rad")?180*r/Math.PI:r}function ot(t){switch(t){case"srgb":return"srgb";case"srgb-linear":return"srgb-linear";case"display-p3":return"display-p3";case"a98-rgb":return"a98-rgb";case"prophoto-rgb":return"prophoto-rgb";case"rec2020":return"rec2020";case"xyz":return"xyz";case"xyz-d50":return"xyz-d50";case"xyz-d65":return"xyz-d65"}return null}function lt(t,e){const r=Math.sign(t),s=Math.abs(t),[n,i]=e;return r*(s*(i-n)/100+n)}function ht(t,{min:e,max:r}){return null===t||(void 0!==e&&(t=Math.max(t,e)),void 0!==r&&(t=Math.min(t,r))),t}function ct(t,e){if(!t.endsWith("%"))return null;const r=parseFloat(t.substr(0,t.length-1));return isNaN(r)?null:lt(r,e)}function ut(t){const e=parseFloat(t);return isNaN(e)?null:e}function gt(t){return void 0===t?null:ht(ct(t,[0,1])??ut(t),{min:0,max:1})}function dt(t,e=[0,1]){if(isNaN(t.replace("%","")))return null;const r=parseFloat(t);return-1!==t.indexOf("%")?t.indexOf("%")!==t.length-1?null:lt(r,e):r}function pt(t){const e=dt(t);return null===e?null:-1!==t.indexOf("%")?e:e/255}function mt(t){const e=t.replace(/(deg|g?rad|turn)$/,"");if(isNaN(e)||t.match(/\s+(deg|g?rad|turn)/))return null;const r=parseFloat(e);return-1!==t.indexOf("turn")?r%1:-1!==t.indexOf("grad")?r/400%1:-1!==t.indexOf("rad")?r/(2*Math.PI)%1:r/360%1}function yt(t){if(t.indexOf("%")!==t.length-1||isNaN(t.replace("%","")))return null;return parseFloat(t)/100}function ft(t){const e=t[0];let r=t[1];const s=t[2];function n(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}let i;r<0&&(r=0),i=s<=.5?s*(1+r):s+r-s*r;const a=2*s-i,o=e,l=e-1/3;return[n(a,i,e+1/3),n(a,i,o),n(a,i,l),t[3]]}function bt(t){return ft(function(t){const e=t[0];let r=t[1];const s=t[2],n=(2-r)*s;return 0===s||0===r?r=0:r*=s/(n<1?n:2-n),[e,r,n/2,t[3]]}(t))}function wt(t,e,r){function s(){return r?(t+.05)*e-.05:(t+.05)/e-.05}let n=s();return(n<0||n>1)&&(r=!r,n=s()),n}function St(t,e,r,s,n){let i=t[r],a=1,o=n(t)-s,l=Math.sign(o);for(let e=100;e;e--){if(Math.abs(o)<2e-4)return t[r]=i,i;const e=Math.sign(o);if(e!==l)a/=2,l=e;else if(i<0||i>1)return null;i+=a*(2===r?-o:o),t[r]=i,o=n(t)-s}return null}function xt(t,e,r=.01){if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(const r in t)if(!xt(t[r],e[r]))return!1;return!0}return!Array.isArray(t)&&!Array.isArray(e)&&(null===t||null===e?t===e:Math.abs(t-e)new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new zt(...A.labToLch(t.l,t.a,t.b),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>t,oklab:t=>new Rt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.labToXyzd50(this.l,this.a,this.b)}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:100}),(xt(this.l,0,1)||xt(this.l,100,1))&&(e=r=0),this.a=e,this.b=r,this.alpha=ht(s,{min:0,max:1}),this.#s=n}is(t){return t===this.format()}as(t){return Tt.#i[t](this)}asLegacyColor(){return this.as("rgba")}equal(t){const e=t.as("lab");return xt(e.l,this.l,1)&&xt(e.a,this.a)&&xt(e.b,this.b)&&xt(e.alpha,this.alpha)}format(){return"lab"}setAlpha(t){return new Tt(this.l,this.a,this.b,t,void 0)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.a,this.b)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`lab(${e.StringUtilities.stringifyWithPrecision(t,0)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}static fromSpec(t,e){const r=ct(t[0],[0,100])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,125])??ut(t[1]);if(null===s)return null;const n=ct(t[2],[0,125])??ut(t[2]);if(null===n)return null;const i=gt(t[3]);return new Tt(r,s,n,i,e)}}class zt{#n;l;c;h;alpha;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>t,oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.lchToLab(t.l,t.c,t.h),t.alpha),oklab:t=>new Rt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.labToXyzd50(...A.lchToLab(this.l,this.c,this.h))}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:100}),e=xt(this.l,0,1)||xt(this.l,100,1)?0:e,this.c=ht(e,{min:0}),r=xt(e,0)?0:r,this.h=it(r),this.alpha=ht(s,{min:0,max:1}),this.#s=n}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return zt.#i[t](this)}equal(t){const e=t.as("lch");return xt(e.l,this.l,1)&&xt(e.c,this.c)&&xt(e.h,this.h)&&xt(e.alpha,this.alpha)}format(){return"lch"}setAlpha(t){return new zt(this.l,this.c,this.h,t)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.c,this.h)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`lch(${e.StringUtilities.stringifyWithPrecision(t,0)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}isHuePowerless(){return xt(this.c,0)}static fromSpec(t,e){const r=ct(t[0],[0,100])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,150])??ut(t[1]);if(null===s)return null;const n=at(t[2]);if(null===n)return null;const i=gt(t[3]);return new zt(r,s,n,i,e)}}class Rt{#n;l;a;b;alpha;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new zt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>t,srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.xyzd65ToD50(...A.oklabToXyzd65(this.l,this.a,this.b))}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:1}),(xt(this.l,0)||xt(this.l,1))&&(e=r=0),this.a=e,this.b=r,this.alpha=ht(s,{min:0,max:1}),this.#s=n}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return Rt.#i[t](this)}equal(t){const e=t.as("oklab");return xt(e.l,this.l)&&xt(e.a,this.a)&&xt(e.b,this.b)&&xt(e.alpha,this.alpha)}format(){return"oklab"}setAlpha(t){return new Rt(this.l,this.a,this.b,t)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.a,this.b)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`oklab(${e.StringUtilities.stringifyWithPrecision(t)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}static fromSpec(t,e){const r=ct(t[0],[0,1])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,.4])??ut(t[1]);if(null===s)return null;const n=ct(t[2],[0,.4])??ut(t[2]);if(null===n)return null;const i=gt(t[3]);return new Rt(r,s,n,i,e)}}class It{#n;l;c;h;alpha;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new zt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>t,lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new Rt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.oklchToXyzd50(this.l,this.c,this.h)}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:1}),e=xt(this.l,0)||xt(this.l,1)?0:e,this.c=ht(e,{min:0}),r=xt(e,0)?0:r,this.h=it(r),this.alpha=ht(s,{min:0,max:1}),this.#s=n}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return It.#i[t](this)}equal(t){const e=t.as("oklch");return xt(e.l,this.l)&&xt(e.c,this.c)&&xt(e.h,this.h)&&xt(e.alpha,this.alpha)}format(){return"oklch"}setAlpha(t){return new It(this.l,this.c,this.h,t)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.c,this.h)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`oklch(${e.StringUtilities.stringifyWithPrecision(t)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}static fromSpec(t,e){const r=ct(t[0],[0,1])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,.4])??ut(t[1]);if(null===s)return null;const n=at(t[2]);if(null===n)return null;const i=gt(t[3]);return new It(r,s,n,i,e)}}class Pt{#n;p0;p1;p2;alpha;colorSpace;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new zt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new Rt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){const[t,e,r]=this.#n;switch(this.colorSpace){case"srgb":return A.srgbToXyzd50(t,e,r);case"srgb-linear":return A.srgbLinearToXyzd50(t,e,r);case"display-p3":return A.displayP3ToXyzd50(t,e,r);case"a98-rgb":return A.adobeRGBToXyzd50(t,e,r);case"prophoto-rgb":return A.proPhotoToXyzd50(t,e,r);case"rec2020":return A.rec2020ToXyzd50(t,e,r);case"xyz-d50":return[t,e,r];case"xyz":case"xyz-d65":return A.xyzd65ToD50(t,e,r)}throw new Error("Invalid color space")}#a(t=!0){const[e,r,s]=this.#n,n="srgb"===this.colorSpace?[e,r,s]:[...A.xyzd50ToSrgb(...this.#o())];return t?[...n,this.alpha??void 0]:n}constructor(t,e,r,s,n,i){this.#n=[e,r,s],this.colorSpace=t,this.#s=i,"xyz-d50"!==this.colorSpace&&"xyz-d65"!==this.colorSpace&&"xyz"!==this.colorSpace&&(e=ht(e,{min:0,max:1}),r=ht(r,{min:0,max:1}),s=ht(s,{min:0,max:1})),this.p0=e,this.p1=r,this.p2=s,this.alpha=ht(n,{min:0,max:1})}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return this.colorSpace===t?this:Pt.#i[t](this)}equal(t){const e=t.as(this.colorSpace);return xt(this.p0,e.p0)&&xt(this.p1,e.p1)&&xt(this.p2,e.p2)&&xt(this.alpha,e.alpha)}format(){return this.colorSpace}setAlpha(t){return new Pt(this.colorSpace,this.p0,this.p1,this.p2,t)}asString(t){return t?this.as(t).asString():this.#l(this.p0,this.p1,this.p2)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`color(${this.colorSpace} ${e.StringUtilities.stringifyWithPrecision(t)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return"xyz-d50"!==this.colorSpace&&"xyz-d65"!==this.colorSpace&&"xyz"!==this.colorSpace&&!xt(this.#n,[this.p0,this.p1,this.p2])}static fromSpec(t,e){const[r,s]=e.split("/",2),n=r.trim().split(/\s+/),[i,...a]=n,o=ot(i);if(!o)return null;if(0===a.length&&void 0===s)return new Pt(o,0,0,0,null,t);if(0===a.length&&void 0!==s&&s.trim().split(/\s+/).length>1)return null;if(a.length>3)return null;const l=a.map((t=>"none"===t?"0":t)).map((t=>dt(t,[0,1])));if(l.includes(null))return null;const h=s?dt(s,[0,1])??1:1,c=[l[0]??0,l[1]??0,l[2]??0,h];return new Pt(o,...c,t)}}class At{h;s;l;alpha;#n;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>t,hsla:t=>t,hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new zt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new Rt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#a(t=!0){const e=ft([this.h,this.s,this.l,0]);return t?[e[0],e[1],e[2],this.alpha??void 0]:[e[0],e[1],e[2]]}#o(){const t=this.#a(!1);return A.srgbToXyzd50(t[0],t[1],t[2])}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(r,{min:0,max:1}),e=xt(this.l,0)||xt(this.l,1)?0:e,this.s=ht(e,{min:0,max:1}),t=xt(this.s,0)?0:t,this.h=it(360*t)/360,this.alpha=ht(s??null,{min:0,max:1}),this.#s=n}equal(t){const e=t.as("hsl");return xt(this.h,e.h)&&xt(this.s,e.s)&&xt(this.l,e.l)&&xt(this.alpha,e.alpha)}asString(t){return t?this.as(t).asString():this.#l(this.h,this.s,this.l)}#l(t,r,s){const n=e.StringUtilities.sprintf("hsl(%sdeg %s% %s%",e.StringUtilities.stringifyWithPrecision(360*t),e.StringUtilities.stringifyWithPrecision(100*r),e.StringUtilities.stringifyWithPrecision(100*s));return null!==this.alpha&&1!==this.alpha?n+e.StringUtilities.sprintf(" / %s%)",e.StringUtilities.stringifyWithPrecision(100*this.alpha)):n+")"}setAlpha(t){return new At(this.h,this.s,this.l,t)}format(){return null===this.alpha||1===this.alpha?"hsl":"hsla"}is(t){return t===this.format()}as(t){return t===this.format()?this:At.#i[t](this)}asLegacyColor(){return this.as("rgba")}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!vt(this.#n[1],1)||!vt(0,this.#n[1])}static fromSpec(t,e){const r=mt(t[0]);if(null===r)return null;const s=yt(t[1]);if(null===s)return null;const n=yt(t[2]);if(null===n)return null;const i=gt(t[3]);return new At(r,s,n,i,e)}hsva(){const t=this.s*(this.l<.5?this.l:1-this.l);return[this.h,0!==t?2*t/(this.l+t):0,this.l+t,this.alpha??1]}canonicalHSLA(){return[Math.round(360*this.h),Math.round(100*this.s),Math.round(100*this.l),this.alpha??1]}}class Et{h;w;b;alpha;#n;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>t,hwba:t=>t,lch:t=>new zt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new Rt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#a(t=!0){const e=function(t){const e=t[0],r=t[1],s=t[2],n=r/(r+s);let i=[n,n,n,t[3]];if(r+s<1){i=ft([e,1,.5,t[3]]);for(let t=0;t<3;++t)i[t]+=r-(r+s)*i[t]}return i}([this.h,this.w,this.b,0]);return t?[e[0],e[1],e[2],this.alpha??void 0]:[e[0],e[1],e[2]]}#o(){const t=this.#a(!1);return A.srgbToXyzd50(t[0],t[1],t[2])}constructor(t,e,r,s,n){if(this.#n=[t,e,r],this.w=ht(e,{min:0,max:1}),this.b=ht(r,{min:0,max:1}),t=vt(1,this.w+this.b)?0:t,this.h=it(360*t)/360,this.alpha=ht(s,{min:0,max:1}),vt(1,this.w+this.b)){const t=this.w/this.b;this.b=1/(1+t),this.w=1-this.b}this.#s=n}equal(t){const e=t.as("hwb");return xt(this.h,e.h)&&xt(this.w,e.w)&&xt(this.b,e.b)&&xt(this.alpha,e.alpha)}asString(t){return t?this.as(t).asString():this.#l(this.h,this.w,this.b)}#l(t,r,s){const n=e.StringUtilities.sprintf("hwb(%sdeg %s% %s%",e.StringUtilities.stringifyWithPrecision(360*t),e.StringUtilities.stringifyWithPrecision(100*r),e.StringUtilities.stringifyWithPrecision(100*s));return null!==this.alpha&&1!==this.alpha?n+e.StringUtilities.sprintf(" / %s%)",e.StringUtilities.stringifyWithPrecision(100*this.alpha)):n+")"}setAlpha(t){return new Et(this.h,this.w,this.b,t,this.#s)}format(){return null===this.alpha||xt(this.alpha,1)?"hwb":"hwba"}is(t){return t===this.format()}as(t){return t===this.format()?this:Et.#i[t](this)}asLegacyColor(){return this.as("rgba")}getAuthoredText(){return this.#s??null}canonicalHWBA(){return[Math.round(360*this.h),Math.round(100*this.w),Math.round(100*this.b),this.alpha??1]}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!(vt(this.#n[1],1)&&vt(0,this.#n[1])&&vt(this.#n[2],1)&&vt(0,this.#n[2]))}static fromSpec(t,e){const r=mt(t[0]);if(null===r)return null;const s=yt(t[1]);if(null===s)return null;const n=yt(t[2]);if(null===n)return null;const i=gt(t[3]);return new Et(r,s,n,i,e)}}function kt(t){return Math.round(255*t)}class Ct{color;constructor(t){this.color=t}get alpha(){return this.color.alpha}equal(t){return this.color.equal(t)}setAlpha(t){return this.color.setAlpha(t)}format(){return 1!==(this.alpha??1)?"hexa":"hex"}as(t){return this.color.as(t)}is(t){return this.color.is(t)}asLegacyColor(){return this.color.asLegacyColor()}getAuthoredText(){return this.color.getAuthoredText()}getRawParameters(){return this.color.getRawParameters()}isGamutClipped(){return this.color.isGamutClipped()}asString(t){if(t)return this.as(t).asString();const[e,r,s]=this.color.rgba();return this.stringify(e,r,s)}getAsRawString(t){if(t)return this.as(t).getAsRawString();const[e,r,s]=this.getRawParameters();return this.stringify(e,r,s)}}class Lt extends Ct{setAlpha(t){return new Lt(this.color.setAlpha(t))}asString(t){return t&&t!==this.format()?super.as(t).asString():super.asString()}stringify(t,r,s){function n(t){return(Math.round(255*t)/17).toString(16)}return this.color.hasAlpha()?e.StringUtilities.sprintf("#%s%s%s%s",n(t),n(r),n(s),n(this.alpha??1)).toLowerCase():e.StringUtilities.sprintf("#%s%s%s",n(t),n(r),n(s)).toLowerCase()}}class _t extends Ct{nickname;constructor(t,e){super(e),this.nickname=t}static fromName(t,e){const r=t.toLowerCase(),s=Nt.get(r);return void 0!==s?new _t(r,Ot.fromRGBA(s,e)):null}stringify(){return this.nickname}getAsRawString(t){return this.color.getAsRawString(t)}}class Ot{#n;#h;#s;#c;static#i={hex:t=>new Ot(t.#h,"hex"),hexa:t=>new Ot(t.#h,"hexa"),rgb:t=>new Ot(t.#h,"rgb"),rgba:t=>new Ot(t.#h,"rgba"),hsl:t=>new At(...L([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),hsla:t=>new At(...L([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),hwb:t=>new Et(...O([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),hwba:t=>new Et(...O([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),lch:t=>new zt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new Rt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){const[t,e,r]=this.#h;return A.srgbToXyzd50(t,e,r)}get alpha(){switch(this.format()){case"hexa":case"rgba":return this.#h[3];default:return null}}asLegacyColor(){return this}nickname(){const t=Vt.get(String(this.canonicalRGBA()));return t?new _t(t,this):null}shortHex(){for(let t=0;t<4;++t){if(Math.round(255*this.#h[t])%17)return null}return new Lt(this)}constructor(t,e,r){this.#s=r||null,this.#c=e,this.#n=[t[0],t[1],t[2]],this.#h=[ht(t[0],{min:0,max:1}),ht(t[1],{min:0,max:1}),ht(t[2],{min:0,max:1}),ht(t[3]??1,{min:0,max:1})]}static fromHex(t,e){const r=4===(t=t.toLowerCase()).length||8===t.length?"hexa":"hex",s=t.length<=4;s&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3));const n=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),a=parseInt(t.substring(4,6),16);let o=1;8===t.length&&(o=parseInt(t.substring(6,8),16)/255);const l=new Ot([n/255,i/255,a/255,o],r,e);return s?new Lt(l):l}static fromRGBAFunction(t,r,s,n,i){const a=[pt(t),pt(r),pt(s),n?(o=n,dt(o)):1];var o;return e.ArrayUtilities.arrayDoesNotContainNullOrUndefined(a)?new Ot(a,n?"rgba":"rgb",i):null}static fromRGBA(t,e){return new Ot([t[0]/255,t[1]/255,t[2]/255,t[3]],"rgba",e)}static fromHSVA(t){const e=bt(t);return new Ot(e,"rgba")}is(t){return t===this.format()}as(t){return t===this.format()?this:Ot.#i[t](this)}format(){return this.#c}hasAlpha(){return 1!==this.#h[3]}detectHEXFormat(){return this.hasAlpha()?"hexa":"hex"}asString(t){return t?this.as(t).asString():this.#l(t,this.#h[0],this.#h[1],this.#h[2])}#l(t,r,s,n){function i(t){const e=Math.round(255*t).toString(16);return 1===e.length?"0"+e:e}switch(t||(t=this.#c),t){case"rgb":case"rgba":{const t=e.StringUtilities.sprintf("rgb(%d %d %d",kt(r),kt(s),kt(n));return this.hasAlpha()?t+e.StringUtilities.sprintf(" / %d%)",Math.round(100*this.#h[3])):t+")"}case"hex":case"hexa":return this.hasAlpha()?e.StringUtilities.sprintf("#%s%s%s%s",i(r),i(s),i(n),i(this.#h[3])).toLowerCase():e.StringUtilities.sprintf("#%s%s%s",i(r),i(s),i(n)).toLowerCase()}}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(t,...this.#n)}isGamutClipped(){return!xt(this.#n.map(kt),[this.#h[0],this.#h[1],this.#h[2]].map(kt),1)}rgba(){return[...this.#h]}canonicalRGBA(){const t=new Array(4);for(let e=0;e<3;++e)t[e]=Math.round(255*this.#h[e]);return t[3]=this.#h[3],t}toProtocolRGBA(){const t=this.canonicalRGBA(),e={r:t[0],g:t[1],b:t[2],a:void 0};return 1!==t[3]&&(e.a=t[3]),e}invert(){const t=[0,0,0,0];return t[0]=1-this.#h[0],t[1]=1-this.#h[1],t[2]=1-this.#h[2],t[3]=this.#h[3],new Ot(t,"rgba")}setAlpha(t){const e=[...this.#h];return e[3]=t,new Ot(e,"rgba")}blendWith(t){const e=k(t.#h,this.#h);return new Ot(e,"rgba")}blendWithAlpha(t){const e=[...this.#h];return e[3]*=t,new Ot(e,"rgba")}setFormat(t){this.#c=t}equal(t){const e=t.as(this.#c);return xt(kt(this.#h[0]),kt(e.#h[0]),1)&&xt(kt(this.#h[1]),kt(e.#h[1]),1)&&xt(kt(this.#h[2]),kt(e.#h[2]),1)&&xt(this.#h[3],e.#h[3])}}const Bt=[["aliceblue",[240,248,255]],["antiquewhite",[250,235,215]],["aqua",[0,255,255]],["aquamarine",[127,255,212]],["azure",[240,255,255]],["beige",[245,245,220]],["bisque",[255,228,196]],["black",[0,0,0]],["blanchedalmond",[255,235,205]],["blue",[0,0,255]],["blueviolet",[138,43,226]],["brown",[165,42,42]],["burlywood",[222,184,135]],["cadetblue",[95,158,160]],["chartreuse",[127,255,0]],["chocolate",[210,105,30]],["coral",[255,127,80]],["cornflowerblue",[100,149,237]],["cornsilk",[255,248,220]],["crimson",[237,20,61]],["cyan",[0,255,255]],["darkblue",[0,0,139]],["darkcyan",[0,139,139]],["darkgoldenrod",[184,134,11]],["darkgray",[169,169,169]],["darkgrey",[169,169,169]],["darkgreen",[0,100,0]],["darkkhaki",[189,183,107]],["darkmagenta",[139,0,139]],["darkolivegreen",[85,107,47]],["darkorange",[255,140,0]],["darkorchid",[153,50,204]],["darkred",[139,0,0]],["darksalmon",[233,150,122]],["darkseagreen",[143,188,143]],["darkslateblue",[72,61,139]],["darkslategray",[47,79,79]],["darkslategrey",[47,79,79]],["darkturquoise",[0,206,209]],["darkviolet",[148,0,211]],["deeppink",[255,20,147]],["deepskyblue",[0,191,255]],["dimgray",[105,105,105]],["dimgrey",[105,105,105]],["dodgerblue",[30,144,255]],["firebrick",[178,34,34]],["floralwhite",[255,250,240]],["forestgreen",[34,139,34]],["fuchsia",[255,0,255]],["gainsboro",[220,220,220]],["ghostwhite",[248,248,255]],["gold",[255,215,0]],["goldenrod",[218,165,32]],["gray",[128,128,128]],["grey",[128,128,128]],["green",[0,128,0]],["greenyellow",[173,255,47]],["honeydew",[240,255,240]],["hotpink",[255,105,180]],["indianred",[205,92,92]],["indigo",[75,0,130]],["ivory",[255,255,240]],["khaki",[240,230,140]],["lavender",[230,230,250]],["lavenderblush",[255,240,245]],["lawngreen",[124,252,0]],["lemonchiffon",[255,250,205]],["lightblue",[173,216,230]],["lightcoral",[240,128,128]],["lightcyan",[224,255,255]],["lightgoldenrodyellow",[250,250,210]],["lightgreen",[144,238,144]],["lightgray",[211,211,211]],["lightgrey",[211,211,211]],["lightpink",[255,182,193]],["lightsalmon",[255,160,122]],["lightseagreen",[32,178,170]],["lightskyblue",[135,206,250]],["lightslategray",[119,136,153]],["lightslategrey",[119,136,153]],["lightsteelblue",[176,196,222]],["lightyellow",[255,255,224]],["lime",[0,255,0]],["limegreen",[50,205,50]],["linen",[250,240,230]],["magenta",[255,0,255]],["maroon",[128,0,0]],["mediumaquamarine",[102,205,170]],["mediumblue",[0,0,205]],["mediumorchid",[186,85,211]],["mediumpurple",[147,112,219]],["mediumseagreen",[60,179,113]],["mediumslateblue",[123,104,238]],["mediumspringgreen",[0,250,154]],["mediumturquoise",[72,209,204]],["mediumvioletred",[199,21,133]],["midnightblue",[25,25,112]],["mintcream",[245,255,250]],["mistyrose",[255,228,225]],["moccasin",[255,228,181]],["navajowhite",[255,222,173]],["navy",[0,0,128]],["oldlace",[253,245,230]],["olive",[128,128,0]],["olivedrab",[107,142,35]],["orange",[255,165,0]],["orangered",[255,69,0]],["orchid",[218,112,214]],["palegoldenrod",[238,232,170]],["palegreen",[152,251,152]],["paleturquoise",[175,238,238]],["palevioletred",[219,112,147]],["papayawhip",[255,239,213]],["peachpuff",[255,218,185]],["peru",[205,133,63]],["pink",[255,192,203]],["plum",[221,160,221]],["powderblue",[176,224,230]],["purple",[128,0,128]],["rebeccapurple",[102,51,153]],["red",[255,0,0]],["rosybrown",[188,143,143]],["royalblue",[65,105,225]],["saddlebrown",[139,69,19]],["salmon",[250,128,114]],["sandybrown",[244,164,96]],["seagreen",[46,139,87]],["seashell",[255,245,238]],["sienna",[160,82,45]],["silver",[192,192,192]],["skyblue",[135,206,235]],["slateblue",[106,90,205]],["slategray",[112,128,144]],["slategrey",[112,128,144]],["snow",[255,250,250]],["springgreen",[0,255,127]],["steelblue",[70,130,180]],["tan",[210,180,140]],["teal",[0,128,128]],["thistle",[216,191,216]],["tomato",[255,99,71]],["turquoise",[64,224,208]],["violet",[238,130,238]],["wheat",[245,222,179]],["white",[255,255,255]],["whitesmoke",[245,245,245]],["yellow",[255,255,0]],["yellowgreen",[154,205,50]],["transparent",[0,0,0,0]]];console.assert(Bt.every((([t])=>t.toLowerCase()===t)),"All color nicknames must be lowercase.");const Nt=new Map(Bt),Vt=new Map(Bt.map((([t,[e,r,s,n=1]])=>[String([e,r,s,n]),t]))),Gt=[127,32,210],Mt={Content:Ot.fromRGBA([111,168,220,.66]),ContentLight:Ot.fromRGBA([111,168,220,.5]),ContentOutline:Ot.fromRGBA([9,83,148]),Padding:Ot.fromRGBA([147,196,125,.55]),PaddingLight:Ot.fromRGBA([147,196,125,.4]),Border:Ot.fromRGBA([255,229,153,.66]),BorderLight:Ot.fromRGBA([255,229,153,.5]),Margin:Ot.fromRGBA([246,178,107,.66]),MarginLight:Ot.fromRGBA([246,178,107,.5]),EventTarget:Ot.fromRGBA([255,196,196,.66]),Shape:Ot.fromRGBA([96,82,177,.8]),ShapeMargin:Ot.fromRGBA([96,82,127,.6]),CssGrid:Ot.fromRGBA([75,0,130,1]),LayoutLine:Ot.fromRGBA([...Gt,1]),GridBorder:Ot.fromRGBA([...Gt,1]),GapBackground:Ot.fromRGBA([...Gt,.3]),GapHatch:Ot.fromRGBA([...Gt,.8]),GridAreaBorder:Ot.fromRGBA([26,115,232,1])},Wt={ParentOutline:Ot.fromRGBA([224,90,183,1]),ChildOutline:Ot.fromRGBA([0,120,212,1])},Xt={Resizer:Ot.fromRGBA([222,225,230,1]),ResizerHandle:Ot.fromRGBA([166,166,166,1]),Mask:Ot.fromRGBA([248,249,249,1])};var Ft=Object.freeze({__proto__:null,getFormat:function(t){switch(t){case"hex":return"hex";case"hexa":return"hexa";case"rgb":return"rgb";case"rgba":return"rgba";case"hsl":return"hsl";case"hsla":return"hsla";case"hwb":return"hwb";case"hwba":return"hwba";case"lch":return"lch";case"oklch":return"oklch";case"lab":return"lab";case"oklab":return"oklab"}return ot(t)},parse:function(t){if(!t.match(/\s/)){const e=t.toLowerCase().match(/^(?:#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(\w+))$/i);if(e)return e[1]?Ot.fromHex(e[1],t):e[2]?_t.fromName(e[2],t):null}const e=t.toLowerCase().match(/^\s*(?:(rgba?)|(hsla?)|(hwba?)|(lch)|(oklch)|(lab)|(oklab)|(color))\((.*)\)\s*$/);if(e){const r=Boolean(e[1]),s=Boolean(e[2]),n=Boolean(e[3]),i=Boolean(e[4]),a=Boolean(e[5]),o=Boolean(e[6]),l=Boolean(e[7]),h=Boolean(e[8]),c=e[9];if(h)return Pt.fromSpec(t,c);const u=function(t,{allowCommas:e,convertNoneToZero:r}){const s=t.trim();let n=[];e&&(n=s.split(/\s*,\s*/));if(!e||1===n.length)if(n=s.split(/\s+/),"/"===n[3]){if(n.splice(3,1),4!==n.length)return null}else if(n.length>2&&-1!==n[2].indexOf("/")||n.length>3&&-1!==n[3].indexOf("/")){const t=n.slice(2,4).join("");n=n.slice(0,2).concat(t.split(/\//)).concat(n.slice(4))}else if(n.length>=4)return null;if(3!==n.length&&4!==n.length||n.indexOf("")>-1)return null;if(r)return n.map((t=>"none"===t?"0":t));return n}(c,{allowCommas:r||s,convertNoneToZero:!(r||s||n)});if(!u)return null;const g=[u[0],u[1],u[2],u[3]];if(r)return Ot.fromRGBAFunction(u[0],u[1],u[2],u[3],t);if(s)return At.fromSpec(g,t);if(n)return Et.fromSpec(g,t);if(i)return zt.fromSpec(g,t);if(a)return It.fromSpec(g,t);if(o)return Tt.fromSpec(g,t);if(l)return Rt.fromSpec(g,t)}return null},parseHueNumeric:mt,hsl2rgb:ft,hsva2rgba:bt,rgb2hsv:function(t){const e=L(t),r=e[0];let s=e[1];const n=e[2];return s*=n<.5?n:1-n,[r,0!==s?2*s/(n+s):0,n+s]},desiredLuminance:wt,approachColorValue:St,findFgColorForContrast:function(t,e,r){const s=t.as("hsl").hsva(),n=e.rgba(),i=t=>N(k(Ot.fromHSVA(t).rgba(),n)),a=N(e.rgba()),o=wt(a,r,i(s)>a);return St(s,0,2,o,i)?Ot.fromHSVA(s):(s[2]=1,St(s,0,1,o,i)?Ot.fromHSVA(s):null)},findFgColorForContrastAPCA:function(t,e,r){const s=t.as("hsl").hsva(),n=(e.rgba(),t=>Z(Ot.fromHSVA(t).rgba())),i=Z(e.rgba()),a=Q(i,r,n(s)>=i);if(St(s,0,2,a,n)){const t=Ot.fromHSVA(s);if(Math.abs(Y(e.rgba(),t.rgba()))>=r)return t}if(s[2]=1,St(s,0,1,a,n)){const t=Ot.fromHSVA(s);if(Math.abs(Y(e.rgba(),t.rgba()))>=r)return t}return null},Lab:Tt,LCH:zt,Oklab:Rt,Oklch:It,ColorFunction:Pt,HSL:At,HWB:Et,ShortHex:Lt,Nickname:_t,Legacy:Ot,Regex:/((?:rgba?|hsla?|hwba?|lab|lch|oklab|oklch|color)\([^)]+\)|#[0-9a-fA-F]{8}|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3,4}|\b[a-zA-Z]+\b(?!-))/g,ColorMixRegex:/color-mix\(.*,\s*(?.+)\s*,\s*(?.+)\s*\)/g,Nicknames:Nt,PageHighlight:Mt,SourceOrderHighlight:Wt,IsolationModeHighlight:Xt,Generator:class{#u;#g;#d;#p;#m;constructor(t,e,r,s){this.#u=t||{min:0,max:360,count:void 0},this.#g=e||67,this.#d=r||80,this.#p=s||1,this.#m=new Map}setColorForID(t,e){this.#m.set(t,e)}colorForID(t){let e=this.#m.get(t);return e||(e=this.generateColorForID(t),this.#m.set(t,e)),e}generateColorForID(t){const r=e.StringUtilities.hashCode(t),s=this.indexToValueInSpace(r,this.#u),n=this.indexToValueInSpace(r>>8,this.#g),i=this.indexToValueInSpace(r>>16,this.#d),a=this.indexToValueInSpace(r>>24,this.#p),o=`hsl(${s}deg ${n}% ${i}%`;return 1!==a?`${o} / ${Math.floor(100*a)}%)`:`${o})`}indexToValueInSpace(t,e){if("number"==typeof e)return e;const r=e.count||e.max-e.min;return t%=r,e.min+Math.floor(t/(r-1)*(e.max-e.min))}}});class Dt{listeners;addEventListener(t,e,r){this.listeners||(this.listeners=new Map);let s=this.listeners.get(t);return s||(s=new Set,this.listeners.set(t,s)),s.add({thisObject:r,listener:e}),{eventTarget:this,eventType:t,thisObject:r,listener:e}}once(t){return new Promise((e=>{const r=this.addEventListener(t,(s=>{this.removeEventListener(t,r.listener),e(s.data)}))}))}removeEventListener(t,e,r){const s=this.listeners?.get(t);if(s){for(const t of s)t.listener===e&&t.thisObject===r&&(t.disposed=!0,s.delete(t));s.size||this.listeners?.delete(t)}}hasEventListeners(t){return Boolean(this.listeners&&this.listeners.has(t))}dispatchEventToListeners(t,...[e]){const r=this.listeners?.get(t);if(!r)return;const s={data:e,source:this};for(const t of[...r])t.disposed||t.listener.call(t.thisObject,s)}}var Ut=Object.freeze({__proto__:null,ObjectWrapper:Dt,eventMixin:function(t){return class extends t{#y=new Dt;addEventListener(t,e,r){return this.#y.addEventListener(t,e,r)}once(t){return this.#y.once(t)}removeEventListener(t,e,r){this.#y.removeEventListener(t,e,r)}hasEventListeners(t){return this.#y.hasEventListeners(t)}dispatchEventToListeners(t,...e){this.#y.dispatchEventToListeners(t,...e)}}}});const jt={elementsPanel:"Elements panel",stylesSidebar:"styles sidebar",changesDrawer:"Changes drawer",issuesView:"Issues view",networkPanel:"Network panel",applicationPanel:"Application panel",sourcesPanel:"Sources panel",memoryInspectorPanel:"Memory inspector panel",developerResourcesPanel:"Developer Resources panel"},$t=r.i18n.registerUIStrings("core/common/Revealer.ts",jt),Ht=r.i18n.getLazilyComputedLocalizedString.bind(void 0,$t);let qt;class Zt{registeredRevealers=[];static instance(){return void 0===qt&&(qt=new Zt),qt}static removeInstance(){qt=void 0}register(t){this.registeredRevealers.push(t)}async reveal(t,e){const r=await Promise.all(this.getApplicableRegisteredRevealers(t).map((t=>t.loadRevealer())));if(r.length<1)throw new Error(`No revealers found for ${t}`);if(r.length>1)throw new Error(`Conflicting reveals found for ${t}`);return await r[0].reveal(t,e)}getApplicableRegisteredRevealers(t){return this.registeredRevealers.filter((e=>{for(const r of e.contextTypes())if(t instanceof r)return!0;return!1}))}}async function Yt(t,e=!1){await Zt.instance().reveal(t,e)}const Kt={DEVELOPER_RESOURCES_PANEL:Ht(jt.developerResourcesPanel),ELEMENTS_PANEL:Ht(jt.elementsPanel),STYLES_SIDEBAR:Ht(jt.stylesSidebar),CHANGES_DRAWER:Ht(jt.changesDrawer),ISSUES_VIEW:Ht(jt.issuesView),NETWORK_PANEL:Ht(jt.networkPanel),APPLICATION_PANEL:Ht(jt.applicationPanel),SOURCES_PANEL:Ht(jt.sourcesPanel),MEMORY_INSPECTOR_PANEL:Ht(jt.memoryInspectorPanel)};var Jt=Object.freeze({__proto__:null,RevealerRegistry:Zt,revealDestination:function(t){const e=Zt.instance().getApplicableRegisteredRevealers(t);for(const{destination:t}of e)if(t)return t();return null},registerRevealer:function(t){Zt.instance().register(t)},reveal:Yt,RevealerDestination:Kt});let Qt;class te extends Dt{#f;constructor(){super(),this.#f=[]}static instance(t){return Qt&&!t?.forceNew||(Qt=new te),Qt}static removeInstance(){Qt=void 0}addMessage(t,e,r,s){const n=new re(t,e||"info",Date.now(),r||!1,s);this.#f.push(n),this.dispatchEventToListeners("messageAdded",n)}log(t){this.addMessage(t,"info")}warn(t,e){this.addMessage(t,"warning",void 0,e)}error(t){this.addMessage(t,"error",!0)}messages(){return this.#f}show(){this.showPromise()}showPromise(){return Yt(this)}}var ee;!function(t){t.CSS="css",t.ConsoleAPI="console-api",t.IssuePanel="issue-panel",t.SelfXss="self-xss"}(ee||(ee={}));class re{text;level;timestamp;show;source;constructor(t,e,r,s,n){this.text=t,this.level=e,this.timestamp="number"==typeof r?r:Date.now(),this.show=s,n&&(this.source=n)}}var se=Object.freeze({__proto__:null,Console:te,get FrontendMessageSource(){return ee},Message:re});var ne=Object.freeze({__proto__:null,debounce:function(t,e){let r=0;return()=>{clearTimeout(r),r=window.setTimeout((()=>t()),e)}}});var ie=Object.freeze({__proto__:null,removeEventListeners:function(t){for(const e of t)e.eventTarget.removeEventListener(e.eventType,e.listener,e.thisObject);t.splice(0)},fireEvent:function(t,e={},r=window){const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});r.dispatchEvent(s)}}),ae=Object.freeze({__proto__:null});const oe=Symbol("uninitialized"),le=Symbol("error");var he=Object.freeze({__proto__:null,lazy:function(t){let e=oe,r=null;return()=>{if(e===le)throw r;if(e!==oe)return e;try{return e=t(),e}catch(t){throw r=t,e=le,r}}}});const ce=[];function ue(t){return ce.filter((function(e){if(!e.contextTypes)return!0;for(const r of e.contextTypes())if(t instanceof r)return!0;return!1}))}var ge=Object.freeze({__proto__:null,Linkifier:class{static async linkify(t,e){if(!t)throw new Error("Can't linkify "+t);const r=ue(t)[0];if(!r)throw new Error("No linkifiers registered for object "+t);return(await r.loadLinkifier()).linkify(t,e)}},registerLinkifier:function(t){ce.push(t)},getApplicableRegisteredlinkifiers:ue});var de=Object.freeze({__proto__:null,Mutex:class{#b=!1;#w=[];acquire(){const t={resolved:!1};return this.#b?new Promise((e=>{this.#w.push((()=>e(this.#S.bind(this,t))))})):(this.#b=!0,Promise.resolve(this.#S.bind(this,t)))}#S(t){if(t.resolved)throw new Error("Cannot release more than once.");t.resolved=!0;const e=this.#w.shift();e?e():this.#b=!1}async run(t){const e=await this.acquire();try{return await t()}finally{e()}}}});function pe(t){if(-1===t.indexOf("..")&&-1===t.indexOf("."))return t;const e=("/"===t[0]?t.substring(1):t).split("/"),r=[];for(const t of e)"."!==t&&(".."===t?r.pop():r.push(t));let s=r.join("/");return"/"===t[0]&&s&&(s="/"+s),"/"===s[s.length-1]||"/"!==t[t.length-1]&&"."!==e[e.length-1]&&".."!==e[e.length-1]||(s+="/"),s}class me{isValid;url;scheme;user;host;port;path;queryParams;fragment;folderPathComponents;lastPathComponent;blobInnerScheme;#x;#v;constructor(t){this.isValid=!1,this.url=t,this.scheme="",this.user="",this.host="",this.port="",this.path="",this.queryParams="",this.fragment="",this.folderPathComponents="",this.lastPathComponent="";const e=this.url.startsWith("blob:"),r=(e?t.substring(5):t).match(me.urlRegex());if(r)this.isValid=!0,e?(this.blobInnerScheme=r[2].toLowerCase(),this.scheme="blob"):this.scheme=r[2].toLowerCase(),this.user=r[3]??"",this.host=r[4]??"",this.port=r[5]??"",this.path=r[6]??"/",this.queryParams=r[7]??"",this.fragment=r[8]??"";else{if(this.url.startsWith("data:"))return void(this.scheme="data");if(this.url.startsWith("blob:"))return void(this.scheme="blob");if("about:blank"===this.url)return void(this.scheme="about");this.path=this.url}const s=this.path.lastIndexOf("/",this.path.length-2);this.lastPathComponent=-1!==s?this.path.substring(s+1):this.path;const n=this.path.lastIndexOf("/");-1!==n&&(this.folderPathComponents=this.path.substring(0,n))}static fromString(t){const e=new me(t.toString());return e.isValid?e:null}static preEncodeSpecialCharactersInPath(t){for(const e of["%",";","#","?"," "])t=t.replaceAll(e,encodeURIComponent(e));return t}static rawPathToEncodedPathString(t){const e=me.preEncodeSpecialCharactersInPath(t);return t.startsWith("/")?new URL(e,"file:///").pathname:new URL("/"+e,"file:///").pathname.substr(1)}static encodedFromParentPathAndName(t,e){return me.concatenate(t,"/",me.preEncodeSpecialCharactersInPath(e))}static urlFromParentUrlAndName(t,e){return me.concatenate(t,"/",me.preEncodeSpecialCharactersInPath(e))}static encodedPathToRawPathString(t){return decodeURIComponent(t)}static rawPathToUrlString(t){let e=me.preEncodeSpecialCharactersInPath(t.replace(/\\/g,"/"));return e=e.replace(/\\/g,"/"),e.startsWith("file://")||(e=e.startsWith("/")?"file://"+e:"file:///"+e),new URL(e).toString()}static relativePathToUrlString(t,e){const r=me.preEncodeSpecialCharactersInPath(t.replace(/\\/g,"/"));return new URL(r,e).toString()}static urlToRawPathString(t,e){console.assert(t.startsWith("file://"),"This must be a file URL.");const r=decodeURIComponent(t);return e?r.substr(8).replace(/\//g,"\\"):r.substr(7)}static sliceUrlToEncodedPathString(t,e){return t.substring(e)}static substr(t,e,r){return t.substr(e,r)}static substring(t,e,r){return t.substring(e,r)}static prepend(t,e){return t+e}static concatenate(t,...e){return t.concat(...e)}static trim(t){return t.trim()}static slice(t,e,r){return t.slice(e,r)}static join(t,e){return t.join(e)}static split(t,e,r){return t.split(e,r)}static toLowerCase(t){return t.toLowerCase()}static isValidUrlString(t){return new me(t).isValid}static urlWithoutHash(t){const e=t.indexOf("#");return-1!==e?t.substr(0,e):t}static urlRegex(){if(me.urlRegexInstance)return me.urlRegexInstance;return me.urlRegexInstance=new RegExp("^("+/([A-Za-z][A-Za-z0-9+.-]*):\/\//.source+/(?:([A-Za-z0-9\-._~%!$&'()*+,;=:]*)@)?/.source+/((?:\[::\d?\])|(?:[^\s\/:]*))/.source+/(?::([\d]+))?/.source+")"+/(\/[^#?]*)?/.source+/(?:\?([^#]*))?/.source+/(?:#(.*))?/.source+"$"),me.urlRegexInstance}static extractPath(t){const e=this.fromString(t);return e?e.path:""}static extractOrigin(t){const r=this.fromString(t);return r?r.securityOrigin():e.DevToolsPath.EmptyUrlString}static extractExtension(t){const e=(t=me.urlWithoutHash(t)).indexOf("?");-1!==e&&(t=t.substr(0,e));const r=t.lastIndexOf("/");-1!==r&&(t=t.substr(r+1));const s=t.lastIndexOf(".");if(-1!==s){const e=(t=t.substr(s+1)).indexOf("%");return-1!==e?t.substr(0,e):t}return""}static extractName(t){let e=t.lastIndexOf("/");const r=-1!==e?t.substr(e+1):t;return e=r.indexOf("?"),e<0?r:r.substr(0,e)}static completeURL(t,e){const r=e.trim();if(r.startsWith("data:")||r.startsWith("blob:")||r.startsWith("javascript:")||r.startsWith("mailto:"))return e;const s=this.fromString(r);if(s&&s.scheme){return s.securityOrigin()+pe(s.path)+(s.queryParams&&`?${s.queryParams}`)+(s.fragment&&`#${s.fragment}`)}const n=this.fromString(t);if(!n)return null;if(n.isDataURL())return e;if(e.length>1&&"/"===e.charAt(0)&&"/"===e.charAt(1))return n.scheme+":"+e;const i=n.securityOrigin(),a=n.path,o=n.queryParams?"?"+n.queryParams:"";if(!e.length)return i+a+o;if("#"===e.charAt(0))return i+a+o+e;if("?"===e.charAt(0))return i+a+e;const l=e.match(/^[^#?]*/);if(!l||!e.length)throw new Error("Invalid href");let h=l[0];const c=e.substring(h.length);return"/"!==h.charAt(0)&&(h=n.folderPathComponents+"/"+h),i+pe(h)+c}static splitLineAndColumn(t){const e=t.match(me.urlRegex());let r="",s=t;e&&(r=e[1],s=t.substring(e[1].length));const n=/(?::(\d+))?(?::(\d+))?$/.exec(s);let i,a;if(console.assert(Boolean(n)),!n)return{url:t,lineNumber:0,columnNumber:0};"string"==typeof n[1]&&(i=parseInt(n[1],10),i=isNaN(i)?void 0:i-1),"string"==typeof n[2]&&(a=parseInt(n[2],10),a=isNaN(a)?void 0:a-1);let o=r+s.substring(0,s.length-n[0].length);if(void 0===n[1]&&void 0===n[2]){const t=/wasm-function\[\d+\]:0x([a-z0-9]+)$/g.exec(s);t&&"string"==typeof t[1]&&(o=me.removeWasmFunctionInfoFromURL(o),a=parseInt(t[1],16),a=isNaN(a)?void 0:a)}return{url:o,lineNumber:i,columnNumber:a}}static removeWasmFunctionInfoFromURL(t){const e=t.search(/:wasm-function\[\d+\]/);return-1===e?t:me.substring(t,0,e)}static beginsWithWindowsDriveLetter(t){return/^[A-Za-z]:/.test(t)}static beginsWithScheme(t){return/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)}static isRelativeURL(t){return!this.beginsWithScheme(t)||this.beginsWithWindowsDriveLetter(t)}get displayName(){return this.#x?this.#x:this.isDataURL()?this.dataURLDisplayName():this.isBlobURL()||this.isAboutBlank()?this.url:(this.#x=this.lastPathComponent,this.#x||(this.#x=(this.host||"")+"/"),"/"===this.#x&&(this.#x=this.url),this.#x)}dataURLDisplayName(){return this.#v?this.#v:this.isDataURL()?(this.#v=e.StringUtilities.trimEndWithMaxLength(this.url,20),this.#v):""}isAboutBlank(){return"about:blank"===this.url}isDataURL(){return"data"===this.scheme}isHttpOrHttps(){return"http"===this.scheme||"https"===this.scheme}isBlobURL(){return this.url.startsWith("blob:")}lastPathComponentWithFragment(){return this.lastPathComponent+(this.fragment?"#"+this.fragment:"")}domain(){return this.isDataURL()?"data:":this.host+(this.port?":"+this.port:"")}securityOrigin(){if(this.isDataURL())return"data:";return(this.isBlobURL()?this.blobInnerScheme:this.scheme)+"://"+this.domain()}urlWithoutScheme(){return this.scheme&&this.url.startsWith(this.scheme+"://")?this.url.substring(this.scheme.length+3):this.url}static urlRegexInstance=null}var ye=Object.freeze({__proto__:null,normalizePath:pe,schemeIs:function(t,e){try{return new URL(t).protocol===e}catch(t){return!1}},ParsedURL:me});class fe{#T;#z;#R;#I;constructor(t,e){this.#T=t,this.#z=e||1,this.#R=0,this.#I=0}isCanceled(){return this.#T.parent.isCanceled()}setTitle(t){this.#T.parent.setTitle(t)}done(){this.setWorked(this.#I),this.#T.childDone()}setTotalWork(t){this.#I=t,this.#T.update()}setWorked(t,e){this.#R=t,void 0!==e&&this.setTitle(e),this.#T.update()}incrementWorked(t){this.setWorked(this.#R+(t||1))}getWeight(){return this.#z}getWorked(){return this.#R}getTotalWork(){return this.#I}}var be=Object.freeze({__proto__:null,Progress:class{setTotalWork(t){}setTitle(t){}setWorked(t,e){}incrementWorked(t){}done(){}isCanceled(){return!1}},CompositeProgress:class{parent;#P;#A;constructor(t){this.parent=t,this.#P=[],this.#A=0,this.parent.setTotalWork(1),this.parent.setWorked(0)}childDone(){++this.#A===this.#P.length&&this.parent.done()}createSubProgress(t){const e=new fe(this,t);return this.#P.push(e),e}update(){let t=0,e=0;for(let r=0;r{};return this.getOrCreatePromise(t).catch(r).then((t=>{t&&e(t)})),null}return r}clear(){this.stopListening();for(const[t,{reject:e}]of this.#C.entries())e(new Error(`Object with ${t} never resolved.`));this.#C.clear()}getOrCreatePromise(t){const e=this.#C.get(t);if(e)return e.promise;let r=()=>{},s=()=>{};const n=new Promise(((t,e)=>{r=t,s=e}));return this.#C.set(t,{promise:n,resolve:r,reject:s}),this.startListening(),n}onResolve(t,e){const r=this.#C.get(t);this.#C.delete(t),0===this.#C.size&&this.stopListening(),r?.resolve(e)}}});const xe={fetchAndXHR:"`Fetch` and `XHR`",javascript:"JavaScript",js:"JS",css:"CSS",img:"Img",media:"Media",font:"Font",doc:"Doc",ws:"WS",webassembly:"WebAssembly",wasm:"Wasm",manifest:"Manifest",other:"Other",document:"Document",stylesheet:"Stylesheet",image:"Image",script:"Script",texttrack:"TextTrack",fetch:"Fetch",eventsource:"EventSource",websocket:"WebSocket",webtransport:"WebTransport",signedexchange:"SignedExchange",ping:"Ping",cspviolationreport:"CSPViolationReport",preflight:"Preflight",webbundle:"WebBundle"},ve=r.i18n.registerUIStrings("core/common/ResourceType.ts",xe),Te=r.i18n.getLazilyComputedLocalizedString.bind(void 0,ve);class ze{#L;#_;#O;#B;constructor(t,e,r,s){this.#L=t,this.#_=e,this.#O=r,this.#B=s}static fromMimeType(t){return t?t.startsWith("text/html")?Pe.Document:t.startsWith("text/css")?Pe.Stylesheet:t.startsWith("image/")?Pe.Image:t.startsWith("text/")?Pe.Script:t.includes("font")?Pe.Font:t.includes("script")?Pe.Script:t.includes("octet")?Pe.Other:t.includes("application")?Pe.Script:Pe.Other:Pe.Other}static fromMimeTypeOverride(t){return"application/manifest+json"===t?Pe.Manifest:"application/wasm"===t?Pe.Wasm:"application/webbundle"===t?Pe.WebBundle:null}static fromURL(t){return Ee.get(me.extractExtension(t))||null}static fromName(t){for(const e in Pe){const r=Pe[e];if(r.name()===t)return r}return null}static mimeFromURL(t){const e=me.extractName(t);if(Ae.has(e))return Ae.get(e);let r=me.extractExtension(t).toLowerCase();return"html"===r&&e.endsWith(".component.html")&&(r="component.html"),ke.get(r)}static mimeFromExtension(t){return ke.get(t)}static simplifyContentType(t){return new RegExp("^application(.*json$|/json+.*)").test(t)?"application/json":t}static mediaTypeForMetrics(t,e,r){return"text/javascript"!==t?t:e?"text/javascript+sourcemapped":r?"text/javascript+minified":"text/javascript+plain"}name(){return this.#L}title(){return this.#_()}category(){return this.#O}isTextType(){return this.#B}isScript(){return"script"===this.#L||"sm-script"===this.#L}hasScripts(){return this.isScript()||this.isDocument()}isStyleSheet(){return"stylesheet"===this.#L||"sm-stylesheet"===this.#L}hasStyleSheets(){return this.isStyleSheet()||this.isDocument()}isDocument(){return"document"===this.#L}isDocumentOrScriptOrStyleSheet(){return this.isDocument()||this.isScript()||this.isStyleSheet()}isFont(){return"font"===this.#L}isImage(){return"image"===this.#L}isFromSourceMap(){return this.#L.startsWith("sm-")}isWebbundle(){return"webbundle"===this.#L}toString(){return this.#L}canonicalMimeType(){return this.isDocument()?"text/html":this.isScript()?"text/javascript":this.isStyleSheet()?"text/css":""}}class Re{title;shortTitle;constructor(t,e){this.title=t,this.shortTitle=e}static categoryByTitle(t){return Object.values(Ie).find((e=>e.title()===t))||null}}const Ie={XHR:new Re(Te(xe.fetchAndXHR),r.i18n.lockedLazyString("Fetch/XHR")),Document:new Re(Te(xe.document),Te(xe.doc)),Stylesheet:new Re(Te(xe.css),Te(xe.css)),Script:new Re(Te(xe.javascript),Te(xe.js)),Font:new Re(Te(xe.font),Te(xe.font)),Image:new Re(Te(xe.image),Te(xe.img)),Media:new Re(Te(xe.media),Te(xe.media)),Manifest:new Re(Te(xe.manifest),Te(xe.manifest)),WebSocket:new Re(Te(xe.websocket),Te(xe.ws)),Wasm:new Re(Te(xe.webassembly),Te(xe.wasm)),Other:new Re(Te(xe.other),Te(xe.other))},Pe={Document:new ze("document",Te(xe.document),Ie.Document,!0),Stylesheet:new ze("stylesheet",Te(xe.stylesheet),Ie.Stylesheet,!0),Image:new ze("image",Te(xe.image),Ie.Image,!1),Media:new ze("media",Te(xe.media),Ie.Media,!1),Font:new ze("font",Te(xe.font),Ie.Font,!1),Script:new ze("script",Te(xe.script),Ie.Script,!0),TextTrack:new ze("texttrack",Te(xe.texttrack),Ie.Other,!0),XHR:new ze("xhr",r.i18n.lockedLazyString("XHR"),Ie.XHR,!0),Fetch:new ze("fetch",Te(xe.fetch),Ie.XHR,!0),Prefetch:new ze("prefetch",r.i18n.lockedLazyString("Prefetch"),Ie.Document,!0),EventSource:new ze("eventsource",Te(xe.eventsource),Ie.XHR,!0),WebSocket:new ze("websocket",Te(xe.websocket),Ie.WebSocket,!1),WebTransport:new ze("webtransport",Te(xe.webtransport),Ie.WebSocket,!1),Wasm:new ze("wasm",Te(xe.wasm),Ie.Wasm,!1),Manifest:new ze("manifest",Te(xe.manifest),Ie.Manifest,!0),SignedExchange:new ze("signed-exchange",Te(xe.signedexchange),Ie.Other,!1),Ping:new ze("ping",Te(xe.ping),Ie.Other,!1),CSPViolationReport:new ze("csp-violation-report",Te(xe.cspviolationreport),Ie.Other,!1),Other:new ze("other",Te(xe.other),Ie.Other,!1),Preflight:new ze("preflight",Te(xe.preflight),Ie.Other,!0),SourceMapScript:new ze("sm-script",Te(xe.script),Ie.Script,!0),SourceMapStyleSheet:new ze("sm-stylesheet",Te(xe.stylesheet),Ie.Stylesheet,!0),WebBundle:new ze("webbundle",Te(xe.webbundle),Ie.Other,!1)},Ae=new Map([["Cakefile","text/x-coffeescript"]]),Ee=new Map([["js",Pe.Script],["mjs",Pe.Script],["css",Pe.Stylesheet],["xsl",Pe.Stylesheet],["avif",Pe.Image],["bmp",Pe.Image],["gif",Pe.Image],["ico",Pe.Image],["jpeg",Pe.Image],["jpg",Pe.Image],["jxl",Pe.Image],["png",Pe.Image],["svg",Pe.Image],["tif",Pe.Image],["tiff",Pe.Image],["vue",Pe.Document],["webmanifest",Pe.Manifest],["webp",Pe.Media],["otf",Pe.Font],["ttc",Pe.Font],["ttf",Pe.Font],["woff",Pe.Font],["woff2",Pe.Font],["wasm",Pe.Wasm]]),ke=new Map([["js","text/javascript"],["mjs","text/javascript"],["css","text/css"],["html","text/html"],["htm","text/html"],["xml","application/xml"],["xsl","application/xml"],["wasm","application/wasm"],["webmanifest","application/manifest+json"],["asp","application/x-aspx"],["aspx","application/x-aspx"],["jsp","application/x-jsp"],["c","text/x-c++src"],["cc","text/x-c++src"],["cpp","text/x-c++src"],["h","text/x-c++src"],["m","text/x-c++src"],["mm","text/x-c++src"],["coffee","text/x-coffeescript"],["dart","application/vnd.dart"],["ts","text/typescript"],["tsx","text/typescript-jsx"],["json","application/json"],["gyp","application/json"],["gypi","application/json"],["map","application/json"],["cs","text/x-csharp"],["go","text/x-go"],["java","text/x-java"],["kt","text/x-kotlin"],["scala","text/x-scala"],["less","text/x-less"],["php","application/x-httpd-php"],["phtml","application/x-httpd-php"],["py","text/x-python"],["sh","text/x-sh"],["gss","text/x-gss"],["sass","text/x-sass"],["scss","text/x-scss"],["vtt","text/vtt"],["ls","text/x-livescript"],["md","text/markdown"],["cljs","text/x-clojure"],["cljc","text/x-clojure"],["cljx","text/x-clojure"],["styl","text/x-styl"],["jsx","text/jsx"],["avif","image/avif"],["bmp","image/bmp"],["gif","image/gif"],["ico","image/ico"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["jxl","image/jxl"],["png","image/png"],["svg","image/svg+xml"],["tif","image/tif"],["tiff","image/tiff"],["webp","image/webp"],["otf","font/otf"],["ttc","font/collection"],["ttf","font/ttf"],["woff","font/woff"],["woff2","font/woff2"],["component.html","text/x.angular"],["svelte","text/x.svelte"],["vue","text/x.vue"]]);var Ce=Object.freeze({__proto__:null,ResourceType:ze,ResourceCategory:Re,resourceCategories:Ie,resourceTypes:Pe,resourceTypeByExtension:Ee,mimeTypeByExtension:ke});const Le=new Map;const _e=[];var Oe=Object.freeze({__proto__:null,registerLateInitializationRunnable:function(t){const{id:e,loadRunnable:r}=t;if(Le.has(e))throw new Error(`Duplicate late Initializable runnable id '${e}'`);Le.set(e,r)},maybeRemoveLateInitializationRunnable:function(t){return Le.delete(t)},lateInitializationRunnables:function(){return[...Le.values()]},registerEarlyInitializationRunnable:function(t){_e.push(t)},earlyInitializationRunnables:function(){return _e}});class Be{begin;end;data;constructor(t,e,r){if(t>e)throw new Error("Invalid segment");this.begin=t,this.end=e,this.data=r}intersects(t){return this.begint.begin-e.begin)),s=r,n=null;if(r>0){const e=this.#N[r-1];n=this.tryMerge(e,t),n?(--r,t=n):this.#N[r-1].end>=t.begin&&(t.endthis.append(t)))}segments(){return this.#N}tryMerge(t,e){const r=this.#V&&this.#V(t,e);return r?(r.begin=t.begin,r.end=Math.max(t.end,e.end),r):null}}});const Ve={elements:"Elements",appearance:"Appearance",sources:"Sources",network:"Network",performance:"Performance",console:"Console",persistence:"Persistence",debugger:"Debugger",global:"Global",rendering:"Rendering",grid:"Grid",mobile:"Mobile",memory:"Memory",extension:"Extension",adorner:"Adorner",sync:"Sync"},Ge=r.i18n.registerUIStrings("core/common/SettingRegistration.ts",Ve),Me=r.i18n.getLocalizedString.bind(void 0,Ge);let We=[];const Xe=new Set;function Fe(t){const e=t.settingName;if(Xe.has(e))throw new Error(`Duplicate setting name '${e}'`);Xe.add(e),We.push(t)}function De(e){return We.filter((r=>t.Runtime.Runtime.isDescriptorEnabled({experiment:r.experiment,condition:r.condition},e)))}function Ue(t,e=!1){if(0===We.length||e){We=t,Xe.clear();for(const e of t){const t=e.settingName;if(Xe.has(t))throw new Error(`Duplicate setting name '${t}'`);Xe.add(t)}}}function je(){We=[],Xe.clear()}function $e(t){const e=We.findIndex((e=>e.settingName===t));return!(e<0||!Xe.delete(t))&&(We.splice(e,1),!0)}function He(t){switch(t){case"ELEMENTS":return Me(Ve.elements);case"APPEARANCE":return Me(Ve.appearance);case"SOURCES":return Me(Ve.sources);case"NETWORK":return Me(Ve.network);case"PERFORMANCE":return Me(Ve.performance);case"CONSOLE":case"EMULATION":return Me(Ve.console);case"PERSISTENCE":return Me(Ve.persistence);case"DEBUGGER":return Me(Ve.debugger);case"GLOBAL":return Me(Ve.global);case"RENDERING":return Me(Ve.rendering);case"GRID":return Me(Ve.grid);case"MOBILE":return Me(Ve.mobile);case"MEMORY":return Me(Ve.memory);case"EXTENSIONS":return Me(Ve.extension);case"ADORNER":return Me(Ve.adorner);case"":return r.i18n.lockedString("");case"SYNC":return Me(Ve.sync)}}var qe=Object.freeze({__proto__:null,registerSettingExtension:Fe,getRegisteredSettings:De,registerSettingsForTest:Ue,resetSettings:je,maybeRemoveSettingExtension:$e,getLocalizedSettingsCategory:He});let Ze;class Ye{syncedStorage;globalStorage;localStorage;#G;settingNameSet;orderValuesBySettingCategory;#M;#W;moduleSettings;#X;constructor(e,r,s,n){this.syncedStorage=e,this.globalStorage=r,this.localStorage=s,this.#G=new Je({}),this.settingNameSet=new Set,this.orderValuesBySettingCategory=new Map,this.#M=new Dt,this.#W=new Map,this.moduleSettings=new Map,this.#X=n;for(const e of this.getRegisteredSettings()){const{settingName:r,defaultValue:s,storageType:n}=e,i="regex"===e.settingType,a="function"==typeof s?s(this.#X):s,o=i&&"string"==typeof a?this.createRegExpSetting(r,a,void 0,n):this.createSetting(r,a,n);o.setTitleFunction(e.title),e.userActionCondition&&o.setRequiresUserAction(Boolean(t.Runtime.Runtime.queryParam(e.userActionCondition))),o.setRegistration(e),this.registerModuleSetting(o)}}getRegisteredSettings(){return De(this.#X)}static hasInstance(){return void 0!==Ze}static instance(t={forceNew:null,syncedStorage:null,globalStorage:null,localStorage:null}){const{forceNew:e,syncedStorage:r,globalStorage:s,localStorage:n,config:i}=t;if(!Ze||e){if(!r||!s||!n)throw new Error(`Unable to create settings: global and local storage must be provided: ${(new Error).stack}`);Ze=new Ye(r,s,n,i)}return Ze}static removeInstance(){Ze=void 0}getHostConfig(){return this.#X}registerModuleSetting(t){const e=t.name,r=t.category(),s=t.order();if(this.settingNameSet.has(e))throw new Error(`Duplicate Setting name '${e}'`);if(r&&s){const t=this.orderValuesBySettingCategory.get(r)||new Set;if(t.has(s))throw new Error(`Duplicate order value '${s}' for settings category '${r}'`);t.add(s),this.orderValuesBySettingCategory.set(r,t)}this.settingNameSet.add(e),this.moduleSettings.set(t.name,t)}static normalizeSettingName(t){return[sr.GLOBAL_VERSION_SETTING_NAME,sr.SYNCED_VERSION_SETTING_NAME,sr.LOCAL_VERSION_SETTING_NAME,"currentDockState","isUnderTest"].includes(t)?t:e.StringUtilities.toKebabCase(t)}moduleSetting(t){const e=this.moduleSettings.get(t);if(!e)throw new Error("No setting registered: "+t);return e}settingForTest(t){const e=this.#W.get(t);if(!e)throw new Error("No setting registered: "+t);return e}createSetting(t,e,r){const s=this.storageFromType(r);let n=this.#W.get(t);return n||(n=new er(t,e,this.#M,s),this.#W.set(t,n)),n}createLocalSetting(t,e){return this.createSetting(t,e,"Local")}createRegExpSetting(t,e,r,s){return this.#W.get(t)||this.#W.set(t,new rr(t,e,this.#M,this.storageFromType(s),r)),this.#W.get(t)}clearAll(){this.globalStorage.removeAll(),this.syncedStorage.removeAll(),this.localStorage.removeAll(),(new sr).resetToCurrent()}storageFromType(t){switch(t){case"Local":return this.localStorage;case"Session":return this.#G;case"Global":return this.globalStorage;case"Synced":return this.syncedStorage}return this.globalStorage}getRegistry(){return this.#W}}const Ke={register:()=>{},set:()=>{},get:()=>Promise.resolve(""),remove:()=>{},clear:()=>{}};class Je{object;backingStore;storagePrefix;constructor(t,e=Ke,r=""){this.object=t,this.backingStore=e,this.storagePrefix=r}register(t){t=this.storagePrefix+t,this.backingStore.register(t)}set(t,e){t=this.storagePrefix+t,this.object[t]=e,this.backingStore.set(t,e)}has(t){return(t=this.storagePrefix+t)in this.object}get(t){return t=this.storagePrefix+t,this.object[t]}async forceGet(t){const e=this.storagePrefix+t,r=await this.backingStore.get(e);return r&&r!==this.object[e]?this.set(t,r):r||this.remove(t),r}remove(t){t=this.storagePrefix+t,delete this.object[t],this.backingStore.remove(t)}removeAll(){this.object={},this.backingStore.clear()}keys(){return Object.keys(this.object)}dumpSizes(){te.instance().log("Ten largest settings: ");const t={__proto__:null};for(const e in this.object)t[e]=this.object[e].length;const e=Object.keys(t);e.sort((function(e,r){return t[r]-t[e]}));for(let r=0;r<10&&rt.name===e.experiment)):void 0}}class er{name;defaultValue;eventSupport;storage;#F;#_;#D=null;#U;#j;#$=JSON;#H;#q;#Z=null;constructor(t,e,r,s){this.name=t,this.defaultValue=e,this.eventSupport=r,this.storage=s,s.register(this.name)}setSerializer(t){this.#$=t}addChangeListener(t,e){return this.eventSupport.addEventListener(this.name,t,e)}removeChangeListener(t,e){this.eventSupport.removeEventListener(this.name,t,e)}title(){return this.#_?this.#_:this.#F?this.#F():""}setTitleFunction(t){t&&(this.#F=t)}setTitle(t){this.#_=t}setRequiresUserAction(t){this.#U=t}disabled(){if(this.#D?.disabledCondition){const{disabled:t}=this.#D.disabledCondition(Ye.instance().getHostConfig());if(t)return!0}return this.#q||!1}disabledReason(){if(this.#D?.disabledCondition){const t=this.#D.disabledCondition(Ye.instance().getHostConfig());if(t.disabled)return t.reason}}setDisabled(t){this.#q=t,this.eventSupport.dispatchEventToListeners(this.name)}get(){if(this.#U&&!this.#H)return this.defaultValue;if(void 0!==this.#j)return this.#j;if(this.#j=this.defaultValue,this.storage.has(this.name))try{this.#j=this.#$.parse(this.storage.get(this.name))}catch(t){this.storage.remove(this.name)}return this.#j}async forceGet(){const t=this.name,e=this.storage.get(t),r=await this.storage.forceGet(t);if(this.#j=this.defaultValue,r)try{this.#j=this.#$.parse(r)}catch(t){this.storage.remove(this.name)}return e!==r&&this.eventSupport.dispatchEventToListeners(this.name,this.#j),this.#j}set(t){this.#H=!0,this.#j=t;try{const e=this.#$.stringify(t);try{this.storage.set(this.name,e)}catch(t){this.printSettingsSavingError(t.message,this.name,e)}}catch(t){te.instance().error("Cannot stringify setting with name: "+this.name+", error: "+t.message)}this.eventSupport.dispatchEventToListeners(this.name,t)}setRegistration(e){this.#D=e;const{deprecationNotice:r}=e;if(r?.disabled){const e=r.experiment?t.Runtime.experiments.allConfigurableExperiments().find((t=>t.name===r.experiment)):void 0;e&&!e.isEnabled()||(this.set(this.defaultValue),this.setDisabled(!0))}}type(){return this.#D?this.#D.settingType:null}options(){return this.#D&&this.#D.options?this.#D.options.map((t=>{const{value:e,title:r,text:s,raw:n}=t;return{value:e,title:r(),text:"function"==typeof s?s():s,raw:n}})):[]}reloadRequired(){return this.#D&&this.#D.reloadRequired||null}category(){return this.#D&&this.#D.category||null}tags(){return this.#D&&this.#D.tags?this.#D.tags.map((t=>t())).join("\0"):null}order(){return this.#D&&this.#D.order||null}get deprecation(){return this.#D&&this.#D.deprecationNotice?(this.#Z||(this.#Z=new tr(this.#D)),this.#Z):null}printSettingsSavingError(t,e,r){const s="Error saving setting with name: "+this.name+", value length: "+r.length+". Error: "+t;console.error(s),te.instance().error(s),this.storage.dumpSizes()}}class rr extends er{#Y;#K;constructor(t,e,r,s,n){super(t,e?[{pattern:e}]:[],r,s),this.#Y=n}get(){const t=[],e=this.getAsArray();for(let r=0;r`-url:${t}`)).join(" ");if(e){const t=Ye.instance().createSetting("console.textFilter",""),r=t.get()?` ${t.get()}`:"";t.set(`${e}${r}`)}Qe(t)}updateVersionFrom26To27(){function t(t,e,r){const s=Ye.instance().createSetting(t,{}),n=s.get();e in n&&(n[r]=n[e],delete n[e],s.set(n))}t("panel-tabOrder","audits2","audits"),t("panel-closeableTabs","audits2","audits"),function(t,e,r){const s=Ye.instance().createSetting(t,"");s.get()===e&&s.set(r)}("panel-selectedTab","audits2","audits")}updateVersionFrom27To28(){const t=Ye.instance().createSetting("uiTheme","systemPreferred");"default"===t.get()&&t.set("systemPreferred")}updateVersionFrom28To29(){function t(t,e,r){const s=Ye.instance().createSetting(t,{}),n=s.get();e in n&&(n[r]=n[e],delete n[e],s.set(n))}t("panel-tabOrder","audits","lighthouse"),t("panel-closeableTabs","audits","lighthouse"),function(t,e,r){const s=Ye.instance().createSetting(t,"");s.get()===e&&s.set(r)}("panel-selectedTab","audits","lighthouse")}updateVersionFrom29To30(){const t=Ye.instance().createSetting("closeableTabs",{}),e=Ye.instance().createSetting("panel-closeableTabs",{}),r=Ye.instance().createSetting("drawer-view-closeableTabs",{}),s=e.get(),n=e.get(),i=Object.assign(n,s);t.set(i),Qe(e),Qe(r)}updateVersionFrom30To31(){Qe(Ye.instance().createSetting("recorder_recordings",[]))}updateVersionFrom31To32(){const t=Ye.instance().createLocalSetting("breakpoints",[]),e=t.get();for(const t of e)t.resourceTypeName="script";t.set(e)}updateVersionFrom32To33(){const t=Ye.instance().createLocalSetting("previouslyViewedFiles",[]);let e=t.get();e=e.filter((t=>"url"in t));for(const t of e)t.resourceTypeName="script";t.set(e)}updateVersionFrom33To34(){const t=Ye.instance().createLocalSetting("breakpoints",[]),e=t.get();for(const t of e){const e=t.condition.startsWith("/** DEVTOOLS_LOGPOINT */ console.log(")&&t.condition.endsWith(")");t.isLogpoint=e}t.set(e)}updateVersionFrom34To35(){const t=Ye.instance().createLocalSetting("breakpoints",[]),e=t.get();for(const t of e){const{condition:e,isLogpoint:r}=t;r&&(t.condition=e.slice(37,e.length-1))}t.set(e)}updateVersionFrom35To36(){Ye.instance().createSetting("showThirdPartyIssues",!0).set(!0)}updateVersionFrom36To37(){const t=t=>{for(const e of t.keys()){const r=Ye.normalizeSettingName(e);if(r!==e){const s=t.get(e);Qe({name:e,storage:t}),t.set(r,s)}}};t(Ye.instance().globalStorage),t(Ye.instance().syncedStorage),t(Ye.instance().localStorage);for(const t of Ye.instance().globalStorage.keys()){if(t.startsWith("data-grid-")&&t.endsWith("-column-weights")||t.endsWith("-tab-order")||"views-location-override"===t||"closeable-tabs"===t){const r=Ye.instance().createSetting(t,{});r.set(e.StringUtilities.toKebabCaseKeys(r.get()))}if(t.endsWith("-selected-tab")){const r=Ye.instance().createSetting(t,"");r.set(e.StringUtilities.toKebabCase(r.get()))}}}migrateSettingsFromLocalStorage(){const t=new Set(["advancedSearchConfig","breakpoints","consoleHistory","domBreakpoints","eventListenerBreakpoints","fileSystemMapping","lastSelectedSourcesSidebarPaneTab","previouslyViewedFiles","savedURLs","watchExpressions","workspaceExcludedFolders","xhrBreakpoints"]);if(window.localStorage)for(const e in window.localStorage){if(t.has(e))continue;const r=window.localStorage[e];window.localStorage.removeItem(e),Ye.instance().globalStorage.set(e,r)}}clearBreakpointsWhenTooMany(t,e){t.get().length>e&&t.set([])}}function nr(t){return Ye.instance().moduleSetting(t)}var ir=Object.freeze({__proto__:null,Settings:Ye,NOOP_STORAGE:Ke,SettingsStorage:Je,Deprecation:tr,Setting:er,RegExpSetting:rr,VersionController:sr,moduleSetting:nr,settingForTest:function(t){return Ye.instance().settingForTest(t)},getLocalizedSettingsCategory:He,maybeRemoveSettingExtension:$e,registerSettingExtension:Fe,registerSettingsForTest:Ue,resetSettings:je});var ar=Object.freeze({__proto__:null,SimpleHistoryManager:class{#et;#rt;#st;#nt;constructor(t){this.#et=[],this.#rt=-1,this.#st=0,this.#nt=t}readOnlyLock(){++this.#st}releaseReadOnlyLock(){--this.#st}getPreviousValidIndex(){if(this.empty())return-1;let t=this.#rt-1;for(;t>=0&&!this.#et[t].valid();)--t;return t<0?-1:t}getNextValidIndex(){let t=this.#rt+1;for(;t=this.#et.length?-1:t}readOnly(){return Boolean(this.#st)}filterOut(t){if(this.readOnly())return;const e=[];let r=0;for(let s=0;sthis.#nt&&this.#et.shift(),this.#rt=this.#et.length-1)}canRollback(){return this.getPreviousValidIndex()>=0}canRollover(){return this.getNextValidIndex()>=0}rollback(){const t=this.getPreviousValidIndex();return-1!==t&&(this.readOnlyLock(),this.#rt=t,this.#et[t].reveal(),this.releaseReadOnlyLock(),!0)}rollover(){const t=this.getNextValidIndex();return-1!==t&&(this.readOnlyLock(),this.#rt=t,this.#et[t].reveal(),this.releaseReadOnlyLock(),!0)}}});var or=Object.freeze({__proto__:null,StringOutputStream:class{#it;constructor(){this.#it=""}async write(t){this.#it+=t}async close(){}data(){return this.#it}}});class lr{#at;#ot;#lt;#ht;#ct;#ut;#gt;constructor(t){this.#ot=0,this.#gt=t,this.clear()}static newStringTrie(){return new lr({empty:()=>"",append:(t,e)=>t+e,slice:(t,e,r)=>t.slice(e,r)})}static newArrayTrie(){return new lr({empty:()=>[],append:(t,e)=>t.concat([e]),slice:(t,e,r)=>t.slice(e,r)})}add(t){let e=this.#ot;++this.#ct[this.#ot];for(let r=0;r{this.#wt=t}))}#xt(){this.#ft=this.getTime(),this.#pt=!1,this.#yt&&this.innerSchedule(!1),this.processCompletedForTests()}processCompletedForTests(){}get process(){return this.#yt}get processCompleted(){return this.#yt?this.#bt:null}onTimeout(){this.#St=void 0,this.#mt=!1,this.#pt=!0,Promise.resolve().then(this.#yt).catch(console.error.bind(console)).then(this.#xt.bind(this)).then(this.#wt),this.#bt=new Promise((t=>{this.#wt=t})),this.#yt=null}schedule(t,e="Default"){this.#yt=t;const r=Boolean(this.#St)||this.#pt,s=this.getTime()-this.#ft>this.#dt,n="AsSoonAsPossible"===e||"Default"===e&&!r&&s,i=n&&!this.#mt;return this.#mt=this.#mt||n,this.innerSchedule(i),this.#bt}innerSchedule(t){if(this.#pt)return;if(this.#St&&!t)return;this.#St&&this.clearTimeout(this.#St);const e=this.#mt?0:this.#dt;this.#St=this.setTimeout(this.onTimeout.bind(this),e)}clearTimeout(t){clearTimeout(t)}setTimeout(t,e){return window.setTimeout(t,e)}getTime(){return window.performance.now()}}});class gr{#vt;#Tt;constructor(t){this.#vt=new Promise((e=>{const r=new Worker(t,{type:"module"});r.onmessage=t=>{console.assert("workerReady"===t.data),r.onmessage=null,e(r)}}))}static fromURL(t){return new gr(t)}postMessage(t){this.#vt.then((e=>{this.#Tt||e.postMessage(t)}))}dispose(){this.#Tt=!0,this.#vt.then((t=>t.terminate()))}terminate(){this.dispose()}set onmessage(t){this.#vt.then((e=>{e.onmessage=t}))}set onerror(t){this.#vt.then((e=>{e.onerror=t}))}}var dr=Object.freeze({__proto__:null,WorkerWrapper:gr});export{s as App,i as AppProvider,l as Base64,h as CharacterIdMap,Ft as Color,E as ColorConverter,nt as ColorUtils,se as Console,ne as Debouncer,ie as EventTarget,ae as JavaScriptMetaData,he as Lazy,ge as Linkifier,de as Mutex,Ut as ObjectWrapper,ye as ParsedURL,be as Progress,we as QueryParamHandler,Se as ResolverBase,Ce as ResourceType,Jt as Revealer,Oe as Runnable,Ne as SegmentedRange,qe as SettingRegistration,ir as Settings,ar as SimpleHistoryManager,or as StringOutputStream,cr as TextDictionary,ur as Throttler,hr as Trie,dr as Worker}; +import*as t from"../root/root.js";import*as e from"../platform/platform.js";export{UIString}from"../platform/platform.js";import*as r from"../i18n/i18n.js";var s=Object.freeze({__proto__:null});const n=[];var i=Object.freeze({__proto__:null,registerAppProvider:function(t){n.push(t)},getRegisteredAppProviders:function(){return n.filter((e=>t.Runtime.Runtime.isDescriptorEnabled({experiment:void 0,condition:e.condition}))).sort(((t,e)=>(t.order||0)-(e.order||0)))}});const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=new Uint8Array(123);for(let t=0;t<64;++t)o[a.charCodeAt(t)]=t;var l=Object.freeze({__proto__:null,BASE64_CHARS:a,BASE64_CODES:o,decode:function(t){let e=3*t.length/4>>>0;61===t.charCodeAt(t.length-2)?e-=2:61===t.charCodeAt(t.length-1)&&(e-=1);const r=new Uint8Array(e);for(let e=0,s=0;e>4,r[s++]=(15&i)<<4|a>>2,r[s++]=(3&a)<<6|63&l}return r.buffer},encode:function(t){return new Promise(((e,r)=>{const s=new FileReader;s.onerror=()=>r(new Error("failed to convert to base64")),s.onload=()=>{const t=s.result,[,r]=t.split(",",2);e(r)},s.readAsDataURL(new Blob([t]))}))}});var h=Object.freeze({__proto__:null,CharacterIdMap:class{#t;#e;#r;constructor(){this.#t=new Map,this.#e=new Map,this.#r=33}toChar(t){let e=this.#t.get(t);if(!e){if(this.#r>=65535)throw new Error("CharacterIdMap ran out of capacity!");e=String.fromCharCode(this.#r++),this.#t.set(t,e),this.#e.set(e,t)}return e}fromChar(t){const e=this.#e.get(t);return void 0===e?null:e}}});const c=.9642,u=.8251;class g{values=[0,0,0];constructor(t){t&&(this.values=t)}}class d{values=[[0,0,0],[0,0,0],[0,0,0]];constructor(t){t&&(this.values=t)}multiply(t){const e=new g;for(let r=0;r<3;++r)e.values[r]=this.values[r][0]*t.values[0]+this.values[r][1]*t.values[1]+this.values[r][2]*t.values[2];return e}}class p{g;a;b;c;d;e;f;constructor(t,e,r=0,s=0,n=0,i=0,a=0){this.g=t,this.a=e,this.b=r,this.c=s,this.d=n,this.e=i,this.f=a}eval(t){const e=t<0?-1:1,r=t*e;return rF?t:t+Math.pow(F-t,D)}function J(t,e){if(t=K(t),e=K(e),Math.abs(t-e)t?(r=(Math.pow(e,G)-Math.pow(t,M))*j,r=r<$?0:r-H):(r=(Math.pow(e,W)-Math.pow(t,X))*U,r=r>-$?0:r+H),100*r}function Q(t,e,r){function s(){return r?Math.pow(Math.abs(Math.pow(t,W)-(-e-H)/U),1/X):Math.pow(Math.abs(Math.pow(t,G)-(e+H)/j),1/M)}t=K(t),e/=100;let n=s();return(n<0||n>1)&&(r=!r,n=s()),n}const tt=[[12,-1,-1,-1,-1,100,90,80,-1,-1],[14,-1,-1,-1,100,90,80,60,60,-1],[16,-1,-1,100,90,80,60,55,50,50],[18,-1,-1,90,80,60,55,50,40,40],[24,-1,100,80,60,55,50,40,38,35],[30,-1,90,70,55,50,40,38,35,40],[36,-1,80,60,50,40,38,35,30,25],[48,100,70,55,40,38,35,30,25,20],[60,90,60,50,38,35,30,25,20,20],[72,80,55,40,35,30,25,20,20,20],[96,70,50,35,30,25,20,20,20,20],[120,60,40,30,25,20,20,20,20,20]];function et(t,e){const r=72*parseFloat(t.replace("px",""))/96;return(isNaN(Number(e))?["bold","bolder"].includes(e):Number(e)>=600)?r>=14:r>=18}tt.reverse();const rt={aa:3,aaa:4.5},st={aa:4.5,aaa:7};var nt=Object.freeze({__proto__:null,blendColors:k,rgbToHsl:L,rgbaToHsla:_,rgbToHwb:O,rgbaToHwba:B,luminance:N,contrastRatio:function(t,e){const r=N(k(t,e)),s=N(e);return(Math.max(r,s)+.05)/(Math.min(r,s)+.05)},luminanceAPCA:Z,contrastRatioAPCA:Y,contrastRatioByLuminanceAPCA:J,desiredLuminanceAPCA:Q,getAPCAThreshold:function(t,e){const r=parseFloat(t.replace("px","")),s=parseFloat(e);for(const[t,...e]of tt)if(r>=t)for(const[t,r]of[900,800,700,600,500,400,300,200,100].entries())if(s>=r){const r=e[e.length-1-t];return-1===r?null:r}return null},isLargeFont:et,getContrastThreshold:function(t,e){return et(t,e)?rt:st}});function it(t){return(t%360+360)%360}function at(t){const e=t.replace(/(deg|g?rad|turn)$/,"");if(isNaN(e)||t.match(/\s+(deg|g?rad|turn)/))return null;const r=parseFloat(e);return t.includes("turn")?360*r:t.includes("grad")?9*r/10:t.includes("rad")?180*r/Math.PI:r}function ot(t){switch(t){case"srgb":return"srgb";case"srgb-linear":return"srgb-linear";case"display-p3":return"display-p3";case"a98-rgb":return"a98-rgb";case"prophoto-rgb":return"prophoto-rgb";case"rec2020":return"rec2020";case"xyz":return"xyz";case"xyz-d50":return"xyz-d50";case"xyz-d65":return"xyz-d65"}return null}function lt(t,e){const r=Math.sign(t),s=Math.abs(t),[n,i]=e;return r*(s*(i-n)/100+n)}function ht(t,{min:e,max:r}){return null===t||(void 0!==e&&(t=Math.max(t,e)),void 0!==r&&(t=Math.min(t,r))),t}function ct(t,e){if(!t.endsWith("%"))return null;const r=parseFloat(t.substr(0,t.length-1));return isNaN(r)?null:lt(r,e)}function ut(t){const e=parseFloat(t);return isNaN(e)?null:e}function gt(t){return void 0===t?null:ht(ct(t,[0,1])??ut(t),{min:0,max:1})}function dt(t,e=[0,1]){if(isNaN(t.replace("%","")))return null;const r=parseFloat(t);return-1!==t.indexOf("%")?t.indexOf("%")!==t.length-1?null:lt(r,e):r}function pt(t){const e=dt(t);return null===e?null:-1!==t.indexOf("%")?e:e/255}function mt(t){const e=t.replace(/(deg|g?rad|turn)$/,"");if(isNaN(e)||t.match(/\s+(deg|g?rad|turn)/))return null;const r=parseFloat(e);return-1!==t.indexOf("turn")?r%1:-1!==t.indexOf("grad")?r/400%1:-1!==t.indexOf("rad")?r/(2*Math.PI)%1:r/360%1}function yt(t){if(t.indexOf("%")!==t.length-1||isNaN(t.replace("%","")))return null;return parseFloat(t)/100}function ft(t){const e=t[0];let r=t[1];const s=t[2];function n(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}let i;r<0&&(r=0),i=s<=.5?s*(1+r):s+r-s*r;const a=2*s-i,o=e,l=e-1/3;return[n(a,i,e+1/3),n(a,i,o),n(a,i,l),t[3]]}function wt(t){return ft(function(t){const e=t[0];let r=t[1];const s=t[2],n=(2-r)*s;return 0===s||0===r?r=0:r*=s/(n<1?n:2-n),[e,r,n/2,t[3]]}(t))}function bt(t,e,r){function s(){return r?(t+.05)*e-.05:(t+.05)/e-.05}let n=s();return(n<0||n>1)&&(r=!r,n=s()),n}function St(t,e,r,s,n){let i=t[r],a=1,o=n(t)-s,l=Math.sign(o);for(let e=100;e;e--){if(Math.abs(o)<2e-4)return t[r]=i,i;const e=Math.sign(o);if(e!==l)a/=2,l=e;else if(i<0||i>1)return null;i+=a*(2===r?-o:o),t[r]=i,o=n(t)-s}return null}function xt(t,e,r=.01){if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(const r in t)if(!xt(t[r],e[r]))return!1;return!0}return!Array.isArray(t)&&!Array.isArray(e)&&(null===t||null===e?t===e:Math.abs(t-e)new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new Rt(...A.labToLch(t.l,t.a,t.b),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>t,oklab:t=>new zt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.labToXyzd50(this.l,this.a,this.b)}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:100}),(xt(this.l,0,1)||xt(this.l,100,1))&&(e=r=0),this.a=e,this.b=r,this.alpha=ht(s,{min:0,max:1}),this.#s=n}is(t){return t===this.format()}as(t){return Tt.#i[t](this)}asLegacyColor(){return this.as("rgba")}equal(t){const e=t.as("lab");return xt(e.l,this.l,1)&&xt(e.a,this.a)&&xt(e.b,this.b)&&xt(e.alpha,this.alpha)}format(){return"lab"}setAlpha(t){return new Tt(this.l,this.a,this.b,t,void 0)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.a,this.b)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`lab(${e.StringUtilities.stringifyWithPrecision(t,0)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}static fromSpec(t,e){const r=ct(t[0],[0,100])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,125])??ut(t[1]);if(null===s)return null;const n=ct(t[2],[0,125])??ut(t[2]);if(null===n)return null;const i=gt(t[3]);return new Tt(r,s,n,i,e)}}class Rt{#n;l;c;h;alpha;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>t,oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.lchToLab(t.l,t.c,t.h),t.alpha),oklab:t=>new zt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.labToXyzd50(...A.lchToLab(this.l,this.c,this.h))}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:100}),e=xt(this.l,0,1)||xt(this.l,100,1)?0:e,this.c=ht(e,{min:0}),r=xt(e,0)?0:r,this.h=it(r),this.alpha=ht(s,{min:0,max:1}),this.#s=n}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return Rt.#i[t](this)}equal(t){const e=t.as("lch");return xt(e.l,this.l,1)&&xt(e.c,this.c)&&xt(e.h,this.h)&&xt(e.alpha,this.alpha)}format(){return"lch"}setAlpha(t){return new Rt(this.l,this.c,this.h,t)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.c,this.h)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`lch(${e.StringUtilities.stringifyWithPrecision(t,0)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}isHuePowerless(){return xt(this.c,0)}static fromSpec(t,e){const r=ct(t[0],[0,100])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,150])??ut(t[1]);if(null===s)return null;const n=at(t[2]);if(null===n)return null;const i=gt(t[3]);return new Rt(r,s,n,i,e)}}class zt{#n;l;a;b;alpha;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new Rt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>t,srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.xyzd65ToD50(...A.oklabToXyzd65(this.l,this.a,this.b))}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:1}),(xt(this.l,0)||xt(this.l,1))&&(e=r=0),this.a=e,this.b=r,this.alpha=ht(s,{min:0,max:1}),this.#s=n}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return zt.#i[t](this)}equal(t){const e=t.as("oklab");return xt(e.l,this.l)&&xt(e.a,this.a)&&xt(e.b,this.b)&&xt(e.alpha,this.alpha)}format(){return"oklab"}setAlpha(t){return new zt(this.l,this.a,this.b,t)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.a,this.b)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`oklab(${e.StringUtilities.stringifyWithPrecision(t)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}static fromSpec(t,e){const r=ct(t[0],[0,1])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,.4])??ut(t[1]);if(null===s)return null;const n=ct(t[2],[0,.4])??ut(t[2]);if(null===n)return null;const i=gt(t[3]);return new zt(r,s,n,i,e)}}class It{#n;l;c;h;alpha;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new Rt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>t,lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new zt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){return A.oklchToXyzd50(this.l,this.c,this.h)}#a(t=!0){const e=A.xyzd50ToSrgb(...this.#o());return t?[...e,this.alpha??void 0]:e}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(t,{min:0,max:1}),e=xt(this.l,0)||xt(this.l,1)?0:e,this.c=ht(e,{min:0}),r=xt(e,0)?0:r,this.h=it(r),this.alpha=ht(s,{min:0,max:1}),this.#s=n}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return It.#i[t](this)}equal(t){const e=t.as("oklch");return xt(e.l,this.l)&&xt(e.c,this.c)&&xt(e.h,this.h)&&xt(e.alpha,this.alpha)}format(){return"oklch"}setAlpha(t){return new It(this.l,this.c,this.h,t)}asString(t){return t?this.as(t).asString():this.#l(this.l,this.c,this.h)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`oklch(${e.StringUtilities.stringifyWithPrecision(t)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!1}static fromSpec(t,e){const r=ct(t[0],[0,1])??ut(t[0]);if(null===r)return null;const s=ct(t[1],[0,.4])??ut(t[1]);if(null===s)return null;const n=at(t[2]);if(null===n)return null;const i=gt(t[3]);return new It(r,s,n,i,e)}}class Pt{#n;p0;p1;p2;alpha;colorSpace;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new Rt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new zt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){const[t,e,r]=this.#n;switch(this.colorSpace){case"srgb":return A.srgbToXyzd50(t,e,r);case"srgb-linear":return A.srgbLinearToXyzd50(t,e,r);case"display-p3":return A.displayP3ToXyzd50(t,e,r);case"a98-rgb":return A.adobeRGBToXyzd50(t,e,r);case"prophoto-rgb":return A.proPhotoToXyzd50(t,e,r);case"rec2020":return A.rec2020ToXyzd50(t,e,r);case"xyz-d50":return[t,e,r];case"xyz":case"xyz-d65":return A.xyzd65ToD50(t,e,r)}throw new Error("Invalid color space")}#a(t=!0){const[e,r,s]=this.#n,n="srgb"===this.colorSpace?[e,r,s]:[...A.xyzd50ToSrgb(...this.#o())];return t?[...n,this.alpha??void 0]:n}constructor(t,e,r,s,n,i){this.#n=[e,r,s],this.colorSpace=t,this.#s=i,"xyz-d50"!==this.colorSpace&&"xyz-d65"!==this.colorSpace&&"xyz"!==this.colorSpace&&(e=ht(e,{min:0,max:1}),r=ht(r,{min:0,max:1}),s=ht(s,{min:0,max:1})),this.p0=e,this.p1=r,this.p2=s,this.alpha=ht(n,{min:0,max:1})}asLegacyColor(){return this.as("rgba")}is(t){return t===this.format()}as(t){return this.colorSpace===t?this:Pt.#i[t](this)}equal(t){const e=t.as(this.colorSpace);return xt(this.p0,e.p0)&&xt(this.p1,e.p1)&&xt(this.p2,e.p2)&&xt(this.alpha,e.alpha)}format(){return this.colorSpace}setAlpha(t){return new Pt(this.colorSpace,this.p0,this.p1,this.p2,t)}asString(t){return t?this.as(t).asString():this.#l(this.p0,this.p1,this.p2)}#l(t,r,s){const n=null===this.alpha||xt(this.alpha,1)?"":` / ${e.StringUtilities.stringifyWithPrecision(this.alpha)}`;return`color(${this.colorSpace} ${e.StringUtilities.stringifyWithPrecision(t)} ${e.StringUtilities.stringifyWithPrecision(r)} ${e.StringUtilities.stringifyWithPrecision(s)}${n})`}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return"xyz-d50"!==this.colorSpace&&"xyz-d65"!==this.colorSpace&&"xyz"!==this.colorSpace&&!xt(this.#n,[this.p0,this.p1,this.p2])}static fromSpec(t,e){const[r,s]=e.split("/",2),n=r.trim().split(/\s+/),[i,...a]=n,o=ot(i);if(!o)return null;if(0===a.length&&void 0===s)return new Pt(o,0,0,0,null,t);if(0===a.length&&void 0!==s&&s.trim().split(/\s+/).length>1)return null;if(a.length>3)return null;const l=a.map((t=>"none"===t?"0":t)).map((t=>dt(t,[0,1])));if(l.includes(null))return null;const h=s?dt(s,[0,1])??1:1,c=[l[0]??0,l[1]??0,l[2]??0,h];return new Pt(o,...c,t)}}class At{h;s;l;alpha;#n;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>t,hsla:t=>t,hwb:t=>new Et(...O(t.#a(!1)),t.alpha),hwba:t=>new Et(...O(t.#a(!1)),t.alpha),lch:t=>new Rt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new zt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#a(t=!0){const e=ft([this.h,this.s,this.l,0]);return t?[e[0],e[1],e[2],this.alpha??void 0]:[e[0],e[1],e[2]]}#o(){const t=this.#a(!1);return A.srgbToXyzd50(t[0],t[1],t[2])}constructor(t,e,r,s,n){this.#n=[t,e,r],this.l=ht(r,{min:0,max:1}),e=xt(this.l,0)||xt(this.l,1)?0:e,this.s=ht(e,{min:0,max:1}),t=xt(this.s,0)?0:t,this.h=it(360*t)/360,this.alpha=ht(s??null,{min:0,max:1}),this.#s=n}equal(t){const e=t.as("hsl");return xt(this.h,e.h)&&xt(this.s,e.s)&&xt(this.l,e.l)&&xt(this.alpha,e.alpha)}asString(t){return t?this.as(t).asString():this.#l(this.h,this.s,this.l)}#l(t,r,s){const n=e.StringUtilities.sprintf("hsl(%sdeg %s% %s%",e.StringUtilities.stringifyWithPrecision(360*t),e.StringUtilities.stringifyWithPrecision(100*r),e.StringUtilities.stringifyWithPrecision(100*s));return null!==this.alpha&&1!==this.alpha?n+e.StringUtilities.sprintf(" / %s%)",e.StringUtilities.stringifyWithPrecision(100*this.alpha)):n+")"}setAlpha(t){return new At(this.h,this.s,this.l,t)}format(){return null===this.alpha||1===this.alpha?"hsl":"hsla"}is(t){return t===this.format()}as(t){return t===this.format()?this:At.#i[t](this)}asLegacyColor(){return this.as("rgba")}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!vt(this.#n[1],1)||!vt(0,this.#n[1])}static fromSpec(t,e){const r=mt(t[0]);if(null===r)return null;const s=yt(t[1]);if(null===s)return null;const n=yt(t[2]);if(null===n)return null;const i=gt(t[3]);return new At(r,s,n,i,e)}hsva(){const t=this.s*(this.l<.5?this.l:1-this.l);return[this.h,0!==t?2*t/(this.l+t):0,this.l+t,this.alpha??1]}canonicalHSLA(){return[Math.round(360*this.h),Math.round(100*this.s),Math.round(100*this.l),this.alpha??1]}}class Et{h;w;b;alpha;#n;#s;static#i={hex:t=>new Ot(t.#a(!1),"hex"),hexa:t=>new Ot(t.#a(!0),"hexa"),rgb:t=>new Ot(t.#a(!1),"rgb"),rgba:t=>new Ot(t.#a(!0),"rgba"),hsl:t=>new At(...L(t.#a(!1)),t.alpha),hsla:t=>new At(...L(t.#a(!1)),t.alpha),hwb:t=>t,hwba:t=>t,lch:t=>new Rt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new zt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#a(t=!0){const e=function(t){const e=t[0],r=t[1],s=t[2],n=r/(r+s);let i=[n,n,n,t[3]];if(r+s<1){i=ft([e,1,.5,t[3]]);for(let t=0;t<3;++t)i[t]+=r-(r+s)*i[t]}return i}([this.h,this.w,this.b,0]);return t?[e[0],e[1],e[2],this.alpha??void 0]:[e[0],e[1],e[2]]}#o(){const t=this.#a(!1);return A.srgbToXyzd50(t[0],t[1],t[2])}constructor(t,e,r,s,n){if(this.#n=[t,e,r],this.w=ht(e,{min:0,max:1}),this.b=ht(r,{min:0,max:1}),t=vt(1,this.w+this.b)?0:t,this.h=it(360*t)/360,this.alpha=ht(s,{min:0,max:1}),vt(1,this.w+this.b)){const t=this.w/this.b;this.b=1/(1+t),this.w=1-this.b}this.#s=n}equal(t){const e=t.as("hwb");return xt(this.h,e.h)&&xt(this.w,e.w)&&xt(this.b,e.b)&&xt(this.alpha,e.alpha)}asString(t){return t?this.as(t).asString():this.#l(this.h,this.w,this.b)}#l(t,r,s){const n=e.StringUtilities.sprintf("hwb(%sdeg %s% %s%",e.StringUtilities.stringifyWithPrecision(360*t),e.StringUtilities.stringifyWithPrecision(100*r),e.StringUtilities.stringifyWithPrecision(100*s));return null!==this.alpha&&1!==this.alpha?n+e.StringUtilities.sprintf(" / %s%)",e.StringUtilities.stringifyWithPrecision(100*this.alpha)):n+")"}setAlpha(t){return new Et(this.h,this.w,this.b,t,this.#s)}format(){return null===this.alpha||xt(this.alpha,1)?"hwb":"hwba"}is(t){return t===this.format()}as(t){return t===this.format()?this:Et.#i[t](this)}asLegacyColor(){return this.as("rgba")}getAuthoredText(){return this.#s??null}canonicalHWBA(){return[Math.round(360*this.h),Math.round(100*this.w),Math.round(100*this.b),this.alpha??1]}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(...this.#n)}isGamutClipped(){return!(vt(this.#n[1],1)&&vt(0,this.#n[1])&&vt(this.#n[2],1)&&vt(0,this.#n[2]))}static fromSpec(t,e){const r=mt(t[0]);if(null===r)return null;const s=yt(t[1]);if(null===s)return null;const n=yt(t[2]);if(null===n)return null;const i=gt(t[3]);return new Et(r,s,n,i,e)}}function kt(t){return Math.round(255*t)}class Ct{color;constructor(t){this.color=t}get alpha(){return this.color.alpha}equal(t){return this.color.equal(t)}setAlpha(t){return this.color.setAlpha(t)}format(){return 1!==(this.alpha??1)?"hexa":"hex"}as(t){return this.color.as(t)}is(t){return this.color.is(t)}asLegacyColor(){return this.color.asLegacyColor()}getAuthoredText(){return this.color.getAuthoredText()}getRawParameters(){return this.color.getRawParameters()}isGamutClipped(){return this.color.isGamutClipped()}asString(t){if(t)return this.as(t).asString();const[e,r,s]=this.color.rgba();return this.stringify(e,r,s)}getAsRawString(t){if(t)return this.as(t).getAsRawString();const[e,r,s]=this.getRawParameters();return this.stringify(e,r,s)}}class Lt extends Ct{setAlpha(t){return new Lt(this.color.setAlpha(t))}asString(t){return t&&t!==this.format()?super.as(t).asString():super.asString()}stringify(t,r,s){function n(t){return(Math.round(255*t)/17).toString(16)}return this.color.hasAlpha()?e.StringUtilities.sprintf("#%s%s%s%s",n(t),n(r),n(s),n(this.alpha??1)).toLowerCase():e.StringUtilities.sprintf("#%s%s%s",n(t),n(r),n(s)).toLowerCase()}}class _t extends Ct{nickname;constructor(t,e){super(e),this.nickname=t}static fromName(t,e){const r=t.toLowerCase(),s=Nt.get(r);return void 0!==s?new _t(r,Ot.fromRGBA(s,e)):null}stringify(){return this.nickname}getAsRawString(t){return this.color.getAsRawString(t)}}class Ot{#n;#h;#s;#c;static#i={hex:t=>new Ot(t.#h,"hex"),hexa:t=>new Ot(t.#h,"hexa"),rgb:t=>new Ot(t.#h,"rgb"),rgba:t=>new Ot(t.#h,"rgba"),hsl:t=>new At(...L([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),hsla:t=>new At(...L([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),hwb:t=>new Et(...O([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),hwba:t=>new Et(...O([t.#h[0],t.#h[1],t.#h[2]]),t.alpha),lch:t=>new Rt(...A.labToLch(...A.xyzd50ToLab(...t.#o())),t.alpha),oklch:t=>new It(...A.xyzd50ToOklch(...t.#o()),t.alpha),lab:t=>new Tt(...A.xyzd50ToLab(...t.#o()),t.alpha),oklab:t=>new zt(...A.xyzd65ToOklab(...A.xyzd50ToD65(...t.#o())),t.alpha),srgb:t=>new Pt("srgb",...A.xyzd50ToSrgb(...t.#o()),t.alpha),"srgb-linear":t=>new Pt("srgb-linear",...A.xyzd50TosRGBLinear(...t.#o()),t.alpha),"display-p3":t=>new Pt("display-p3",...A.xyzd50ToDisplayP3(...t.#o()),t.alpha),"a98-rgb":t=>new Pt("a98-rgb",...A.xyzd50ToAdobeRGB(...t.#o()),t.alpha),"prophoto-rgb":t=>new Pt("prophoto-rgb",...A.xyzd50ToProPhoto(...t.#o()),t.alpha),rec2020:t=>new Pt("rec2020",...A.xyzd50ToRec2020(...t.#o()),t.alpha),xyz:t=>new Pt("xyz",...A.xyzd50ToD65(...t.#o()),t.alpha),"xyz-d50":t=>new Pt("xyz-d50",...t.#o(),t.alpha),"xyz-d65":t=>new Pt("xyz-d65",...A.xyzd50ToD65(...t.#o()),t.alpha)};#o(){const[t,e,r]=this.#h;return A.srgbToXyzd50(t,e,r)}get alpha(){switch(this.format()){case"hexa":case"rgba":return this.#h[3];default:return null}}asLegacyColor(){return this}nickname(){const t=Vt.get(String(this.canonicalRGBA()));return t?new _t(t,this):null}shortHex(){for(let t=0;t<4;++t){if(Math.round(255*this.#h[t])%17)return null}return new Lt(this)}constructor(t,e,r){this.#s=r||null,this.#c=e,this.#n=[t[0],t[1],t[2]],this.#h=[ht(t[0],{min:0,max:1}),ht(t[1],{min:0,max:1}),ht(t[2],{min:0,max:1}),ht(t[3]??1,{min:0,max:1})]}static fromHex(t,e){const r=4===(t=t.toLowerCase()).length||8===t.length?"hexa":"hex",s=t.length<=4;s&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)+t.charAt(3)+t.charAt(3));const n=parseInt(t.substring(0,2),16),i=parseInt(t.substring(2,4),16),a=parseInt(t.substring(4,6),16);let o=1;8===t.length&&(o=parseInt(t.substring(6,8),16)/255);const l=new Ot([n/255,i/255,a/255,o],r,e);return s?new Lt(l):l}static fromRGBAFunction(t,r,s,n,i){const a=[pt(t),pt(r),pt(s),n?(o=n,dt(o)):1];var o;return e.ArrayUtilities.arrayDoesNotContainNullOrUndefined(a)?new Ot(a,n?"rgba":"rgb",i):null}static fromRGBA(t,e){return new Ot([t[0]/255,t[1]/255,t[2]/255,t[3]],"rgba",e)}static fromHSVA(t){const e=wt(t);return new Ot(e,"rgba")}is(t){return t===this.format()}as(t){return t===this.format()?this:Ot.#i[t](this)}format(){return this.#c}hasAlpha(){return 1!==this.#h[3]}detectHEXFormat(){return this.hasAlpha()?"hexa":"hex"}asString(t){return t?this.as(t).asString():this.#l(t,this.#h[0],this.#h[1],this.#h[2])}#l(t,r,s,n){function i(t){const e=Math.round(255*t).toString(16);return 1===e.length?"0"+e:e}switch(t||(t=this.#c),t){case"rgb":case"rgba":{const t=e.StringUtilities.sprintf("rgb(%d %d %d",kt(r),kt(s),kt(n));return this.hasAlpha()?t+e.StringUtilities.sprintf(" / %d%)",Math.round(100*this.#h[3])):t+")"}case"hex":case"hexa":return this.hasAlpha()?e.StringUtilities.sprintf("#%s%s%s%s",i(r),i(s),i(n),i(this.#h[3])).toLowerCase():e.StringUtilities.sprintf("#%s%s%s",i(r),i(s),i(n)).toLowerCase()}}getAuthoredText(){return this.#s??null}getRawParameters(){return[...this.#n]}getAsRawString(t){return t?this.as(t).getAsRawString():this.#l(t,...this.#n)}isGamutClipped(){return!xt(this.#n.map(kt),[this.#h[0],this.#h[1],this.#h[2]].map(kt),1)}rgba(){return[...this.#h]}canonicalRGBA(){const t=new Array(4);for(let e=0;e<3;++e)t[e]=Math.round(255*this.#h[e]);return t[3]=this.#h[3],t}toProtocolRGBA(){const t=this.canonicalRGBA(),e={r:t[0],g:t[1],b:t[2],a:void 0};return 1!==t[3]&&(e.a=t[3]),e}invert(){const t=[0,0,0,0];return t[0]=1-this.#h[0],t[1]=1-this.#h[1],t[2]=1-this.#h[2],t[3]=this.#h[3],new Ot(t,"rgba")}setAlpha(t){const e=[...this.#h];return e[3]=t,new Ot(e,"rgba")}blendWith(t){const e=k(t.#h,this.#h);return new Ot(e,"rgba")}blendWithAlpha(t){const e=[...this.#h];return e[3]*=t,new Ot(e,"rgba")}setFormat(t){this.#c=t}equal(t){const e=t.as(this.#c);return xt(kt(this.#h[0]),kt(e.#h[0]),1)&&xt(kt(this.#h[1]),kt(e.#h[1]),1)&&xt(kt(this.#h[2]),kt(e.#h[2]),1)&&xt(this.#h[3],e.#h[3])}}const Bt=[["aliceblue",[240,248,255]],["antiquewhite",[250,235,215]],["aqua",[0,255,255]],["aquamarine",[127,255,212]],["azure",[240,255,255]],["beige",[245,245,220]],["bisque",[255,228,196]],["black",[0,0,0]],["blanchedalmond",[255,235,205]],["blue",[0,0,255]],["blueviolet",[138,43,226]],["brown",[165,42,42]],["burlywood",[222,184,135]],["cadetblue",[95,158,160]],["chartreuse",[127,255,0]],["chocolate",[210,105,30]],["coral",[255,127,80]],["cornflowerblue",[100,149,237]],["cornsilk",[255,248,220]],["crimson",[237,20,61]],["cyan",[0,255,255]],["darkblue",[0,0,139]],["darkcyan",[0,139,139]],["darkgoldenrod",[184,134,11]],["darkgray",[169,169,169]],["darkgrey",[169,169,169]],["darkgreen",[0,100,0]],["darkkhaki",[189,183,107]],["darkmagenta",[139,0,139]],["darkolivegreen",[85,107,47]],["darkorange",[255,140,0]],["darkorchid",[153,50,204]],["darkred",[139,0,0]],["darksalmon",[233,150,122]],["darkseagreen",[143,188,143]],["darkslateblue",[72,61,139]],["darkslategray",[47,79,79]],["darkslategrey",[47,79,79]],["darkturquoise",[0,206,209]],["darkviolet",[148,0,211]],["deeppink",[255,20,147]],["deepskyblue",[0,191,255]],["dimgray",[105,105,105]],["dimgrey",[105,105,105]],["dodgerblue",[30,144,255]],["firebrick",[178,34,34]],["floralwhite",[255,250,240]],["forestgreen",[34,139,34]],["fuchsia",[255,0,255]],["gainsboro",[220,220,220]],["ghostwhite",[248,248,255]],["gold",[255,215,0]],["goldenrod",[218,165,32]],["gray",[128,128,128]],["grey",[128,128,128]],["green",[0,128,0]],["greenyellow",[173,255,47]],["honeydew",[240,255,240]],["hotpink",[255,105,180]],["indianred",[205,92,92]],["indigo",[75,0,130]],["ivory",[255,255,240]],["khaki",[240,230,140]],["lavender",[230,230,250]],["lavenderblush",[255,240,245]],["lawngreen",[124,252,0]],["lemonchiffon",[255,250,205]],["lightblue",[173,216,230]],["lightcoral",[240,128,128]],["lightcyan",[224,255,255]],["lightgoldenrodyellow",[250,250,210]],["lightgreen",[144,238,144]],["lightgray",[211,211,211]],["lightgrey",[211,211,211]],["lightpink",[255,182,193]],["lightsalmon",[255,160,122]],["lightseagreen",[32,178,170]],["lightskyblue",[135,206,250]],["lightslategray",[119,136,153]],["lightslategrey",[119,136,153]],["lightsteelblue",[176,196,222]],["lightyellow",[255,255,224]],["lime",[0,255,0]],["limegreen",[50,205,50]],["linen",[250,240,230]],["magenta",[255,0,255]],["maroon",[128,0,0]],["mediumaquamarine",[102,205,170]],["mediumblue",[0,0,205]],["mediumorchid",[186,85,211]],["mediumpurple",[147,112,219]],["mediumseagreen",[60,179,113]],["mediumslateblue",[123,104,238]],["mediumspringgreen",[0,250,154]],["mediumturquoise",[72,209,204]],["mediumvioletred",[199,21,133]],["midnightblue",[25,25,112]],["mintcream",[245,255,250]],["mistyrose",[255,228,225]],["moccasin",[255,228,181]],["navajowhite",[255,222,173]],["navy",[0,0,128]],["oldlace",[253,245,230]],["olive",[128,128,0]],["olivedrab",[107,142,35]],["orange",[255,165,0]],["orangered",[255,69,0]],["orchid",[218,112,214]],["palegoldenrod",[238,232,170]],["palegreen",[152,251,152]],["paleturquoise",[175,238,238]],["palevioletred",[219,112,147]],["papayawhip",[255,239,213]],["peachpuff",[255,218,185]],["peru",[205,133,63]],["pink",[255,192,203]],["plum",[221,160,221]],["powderblue",[176,224,230]],["purple",[128,0,128]],["rebeccapurple",[102,51,153]],["red",[255,0,0]],["rosybrown",[188,143,143]],["royalblue",[65,105,225]],["saddlebrown",[139,69,19]],["salmon",[250,128,114]],["sandybrown",[244,164,96]],["seagreen",[46,139,87]],["seashell",[255,245,238]],["sienna",[160,82,45]],["silver",[192,192,192]],["skyblue",[135,206,235]],["slateblue",[106,90,205]],["slategray",[112,128,144]],["slategrey",[112,128,144]],["snow",[255,250,250]],["springgreen",[0,255,127]],["steelblue",[70,130,180]],["tan",[210,180,140]],["teal",[0,128,128]],["thistle",[216,191,216]],["tomato",[255,99,71]],["turquoise",[64,224,208]],["violet",[238,130,238]],["wheat",[245,222,179]],["white",[255,255,255]],["whitesmoke",[245,245,245]],["yellow",[255,255,0]],["yellowgreen",[154,205,50]],["transparent",[0,0,0,0]]];console.assert(Bt.every((([t])=>t.toLowerCase()===t)),"All color nicknames must be lowercase.");const Nt=new Map(Bt),Vt=new Map(Bt.map((([t,[e,r,s,n=1]])=>[String([e,r,s,n]),t]))),Gt=[127,32,210],Mt={Content:Ot.fromRGBA([111,168,220,.66]),ContentLight:Ot.fromRGBA([111,168,220,.5]),ContentOutline:Ot.fromRGBA([9,83,148]),Padding:Ot.fromRGBA([147,196,125,.55]),PaddingLight:Ot.fromRGBA([147,196,125,.4]),Border:Ot.fromRGBA([255,229,153,.66]),BorderLight:Ot.fromRGBA([255,229,153,.5]),Margin:Ot.fromRGBA([246,178,107,.66]),MarginLight:Ot.fromRGBA([246,178,107,.5]),EventTarget:Ot.fromRGBA([255,196,196,.66]),Shape:Ot.fromRGBA([96,82,177,.8]),ShapeMargin:Ot.fromRGBA([96,82,127,.6]),CssGrid:Ot.fromRGBA([75,0,130,1]),LayoutLine:Ot.fromRGBA([...Gt,1]),GridBorder:Ot.fromRGBA([...Gt,1]),GapBackground:Ot.fromRGBA([...Gt,.3]),GapHatch:Ot.fromRGBA([...Gt,.8]),GridAreaBorder:Ot.fromRGBA([26,115,232,1])},Wt={ParentOutline:Ot.fromRGBA([224,90,183,1]),ChildOutline:Ot.fromRGBA([0,120,212,1])},Xt={Resizer:Ot.fromRGBA([222,225,230,1]),ResizerHandle:Ot.fromRGBA([166,166,166,1]),Mask:Ot.fromRGBA([248,249,249,1])};var Ft=Object.freeze({__proto__:null,getFormat:function(t){switch(t){case"hex":return"hex";case"hexa":return"hexa";case"rgb":return"rgb";case"rgba":return"rgba";case"hsl":return"hsl";case"hsla":return"hsla";case"hwb":return"hwb";case"hwba":return"hwba";case"lch":return"lch";case"oklch":return"oklch";case"lab":return"lab";case"oklab":return"oklab"}return ot(t)},parse:function(t){if(!t.match(/\s/)){const e=t.toLowerCase().match(/^(?:#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(\w+))$/i);if(e)return e[1]?Ot.fromHex(e[1],t):e[2]?_t.fromName(e[2],t):null}const e=t.toLowerCase().match(/^\s*(?:(rgba?)|(hsla?)|(hwba?)|(lch)|(oklch)|(lab)|(oklab)|(color))\((.*)\)\s*$/);if(e){const r=Boolean(e[1]),s=Boolean(e[2]),n=Boolean(e[3]),i=Boolean(e[4]),a=Boolean(e[5]),o=Boolean(e[6]),l=Boolean(e[7]),h=Boolean(e[8]),c=e[9];if(h)return Pt.fromSpec(t,c);const u=function(t,{allowCommas:e,convertNoneToZero:r}){const s=t.trim();let n=[];e&&(n=s.split(/\s*,\s*/));if(!e||1===n.length)if(n=s.split(/\s+/),"/"===n[3]){if(n.splice(3,1),4!==n.length)return null}else if(n.length>2&&-1!==n[2].indexOf("/")||n.length>3&&-1!==n[3].indexOf("/")){const t=n.slice(2,4).join("");n=n.slice(0,2).concat(t.split(/\//)).concat(n.slice(4))}else if(n.length>=4)return null;if(3!==n.length&&4!==n.length||n.indexOf("")>-1)return null;if(r)return n.map((t=>"none"===t?"0":t));return n}(c,{allowCommas:r||s,convertNoneToZero:!(r||s||n)});if(!u)return null;const g=[u[0],u[1],u[2],u[3]];if(r)return Ot.fromRGBAFunction(u[0],u[1],u[2],u[3],t);if(s)return At.fromSpec(g,t);if(n)return Et.fromSpec(g,t);if(i)return Rt.fromSpec(g,t);if(a)return It.fromSpec(g,t);if(o)return Tt.fromSpec(g,t);if(l)return zt.fromSpec(g,t)}return null},parseHueNumeric:mt,hsl2rgb:ft,hsva2rgba:wt,rgb2hsv:function(t){const e=L(t),r=e[0];let s=e[1];const n=e[2];return s*=n<.5?n:1-n,[r,0!==s?2*s/(n+s):0,n+s]},desiredLuminance:bt,approachColorValue:St,findFgColorForContrast:function(t,e,r){const s=t.as("hsl").hsva(),n=e.rgba(),i=t=>N(k(Ot.fromHSVA(t).rgba(),n)),a=N(e.rgba()),o=bt(a,r,i(s)>a);return St(s,0,2,o,i)?Ot.fromHSVA(s):(s[2]=1,St(s,0,1,o,i)?Ot.fromHSVA(s):null)},findFgColorForContrastAPCA:function(t,e,r){const s=t.as("hsl").hsva(),n=(e.rgba(),t=>Z(Ot.fromHSVA(t).rgba())),i=Z(e.rgba()),a=Q(i,r,n(s)>=i);if(St(s,0,2,a,n)){const t=Ot.fromHSVA(s);if(Math.abs(Y(e.rgba(),t.rgba()))>=r)return t}if(s[2]=1,St(s,0,1,a,n)){const t=Ot.fromHSVA(s);if(Math.abs(Y(e.rgba(),t.rgba()))>=r)return t}return null},Lab:Tt,LCH:Rt,Oklab:zt,Oklch:It,ColorFunction:Pt,HSL:At,HWB:Et,ShortHex:Lt,Nickname:_t,Legacy:Ot,Regex:/((?:rgba?|hsla?|hwba?|lab|lch|oklab|oklch|color)\([^)]+\)|#[0-9a-fA-F]{8}|#[0-9a-fA-F]{6}|#[0-9a-fA-F]{3,4}|\b[a-zA-Z]+\b(?!-))/g,ColorMixRegex:/color-mix\(.*,\s*(?.+)\s*,\s*(?.+)\s*\)/g,Nicknames:Nt,PageHighlight:Mt,SourceOrderHighlight:Wt,IsolationModeHighlight:Xt,Generator:class{#u;#g;#d;#p;#m;constructor(t,e,r,s){this.#u=t||{min:0,max:360,count:void 0},this.#g=e||67,this.#d=r||80,this.#p=s||1,this.#m=new Map}setColorForID(t,e){this.#m.set(t,e)}colorForID(t){let e=this.#m.get(t);return e||(e=this.generateColorForID(t),this.#m.set(t,e)),e}generateColorForID(t){const r=e.StringUtilities.hashCode(t),s=this.indexToValueInSpace(r,this.#u),n=this.indexToValueInSpace(r>>8,this.#g),i=this.indexToValueInSpace(r>>16,this.#d),a=this.indexToValueInSpace(r>>24,this.#p),o=`hsl(${s}deg ${n}% ${i}%`;return 1!==a?`${o} / ${Math.floor(100*a)}%)`:`${o})`}indexToValueInSpace(t,e){if("number"==typeof e)return e;const r=e.count||e.max-e.min;return t%=r,e.min+Math.floor(t/(r-1)*(e.max-e.min))}}});class Dt{listeners;addEventListener(t,e,r){this.listeners||(this.listeners=new Map);let s=this.listeners.get(t);return s||(s=new Set,this.listeners.set(t,s)),s.add({thisObject:r,listener:e}),{eventTarget:this,eventType:t,thisObject:r,listener:e}}once(t){return new Promise((e=>{const r=this.addEventListener(t,(s=>{this.removeEventListener(t,r.listener),e(s.data)}))}))}removeEventListener(t,e,r){const s=this.listeners?.get(t);if(s){for(const t of s)t.listener===e&&t.thisObject===r&&(t.disposed=!0,s.delete(t));s.size||this.listeners?.delete(t)}}hasEventListeners(t){return Boolean(this.listeners&&this.listeners.has(t))}dispatchEventToListeners(t,...[e]){const r=this.listeners?.get(t);if(!r)return;const s={data:e,source:this};for(const t of[...r])t.disposed||t.listener.call(t.thisObject,s)}}var jt=Object.freeze({__proto__:null,ObjectWrapper:Dt,eventMixin:function(t){return class extends t{#y=new Dt;addEventListener(t,e,r){return this.#y.addEventListener(t,e,r)}once(t){return this.#y.once(t)}removeEventListener(t,e,r){this.#y.removeEventListener(t,e,r)}hasEventListeners(t){return this.#y.hasEventListeners(t)}dispatchEventToListeners(t,...e){this.#y.dispatchEventToListeners(t,...e)}}}});const Ut={elementsPanel:"Elements panel",stylesSidebar:"styles sidebar",changesDrawer:"Changes drawer",issuesView:"Issues view",networkPanel:"Network panel",applicationPanel:"Application panel",sourcesPanel:"Sources panel",memoryInspectorPanel:"Memory inspector panel",developerResourcesPanel:"Developer Resources panel"},Ht=r.i18n.registerUIStrings("core/common/Revealer.ts",Ut),$t=r.i18n.getLazilyComputedLocalizedString.bind(void 0,Ht);let qt;class Zt{registeredRevealers=[];static instance(){return void 0===qt&&(qt=new Zt),qt}static removeInstance(){qt=void 0}register(t){this.registeredRevealers.push(t)}async reveal(t,e){const r=await Promise.all(this.getApplicableRegisteredRevealers(t).map((t=>t.loadRevealer())));if(r.length<1)throw new Error(`No revealers found for ${t}`);if(r.length>1)throw new Error(`Conflicting reveals found for ${t}`);return await r[0].reveal(t,e)}getApplicableRegisteredRevealers(t){return this.registeredRevealers.filter((e=>{for(const r of e.contextTypes())if(t instanceof r)return!0;return!1}))}}async function Yt(t,e=!1){await Zt.instance().reveal(t,e)}const Kt={DEVELOPER_RESOURCES_PANEL:$t(Ut.developerResourcesPanel),ELEMENTS_PANEL:$t(Ut.elementsPanel),STYLES_SIDEBAR:$t(Ut.stylesSidebar),CHANGES_DRAWER:$t(Ut.changesDrawer),ISSUES_VIEW:$t(Ut.issuesView),NETWORK_PANEL:$t(Ut.networkPanel),APPLICATION_PANEL:$t(Ut.applicationPanel),SOURCES_PANEL:$t(Ut.sourcesPanel),MEMORY_INSPECTOR_PANEL:$t(Ut.memoryInspectorPanel)};var Jt=Object.freeze({__proto__:null,RevealerRegistry:Zt,revealDestination:function(t){const e=Zt.instance().getApplicableRegisteredRevealers(t);for(const{destination:t}of e)if(t)return t();return null},registerRevealer:function(t){Zt.instance().register(t)},reveal:Yt,RevealerDestination:Kt});let Qt;class te extends Dt{#f;constructor(){super(),this.#f=[]}static instance(t){return Qt&&!t?.forceNew||(Qt=new te),Qt}static removeInstance(){Qt=void 0}addMessage(t,e,r,s){const n=new re(t,e||"info",Date.now(),r||!1,s);this.#f.push(n),this.dispatchEventToListeners("messageAdded",n)}log(t){this.addMessage(t,"info")}warn(t,e){this.addMessage(t,"warning",void 0,e)}error(t){this.addMessage(t,"error",!0)}messages(){return this.#f}show(){this.showPromise()}showPromise(){return Yt(this)}}var ee;!function(t){t.CSS="css",t.ConsoleAPI="console-api",t.IssuePanel="issue-panel",t.SelfXss="self-xss"}(ee||(ee={}));class re{text;level;timestamp;show;source;constructor(t,e,r,s,n){this.text=t,this.level=e,this.timestamp="number"==typeof r?r:Date.now(),this.show=s,n&&(this.source=n)}}var se=Object.freeze({__proto__:null,Console:te,get FrontendMessageSource(){return ee},Message:re});var ne=Object.freeze({__proto__:null,debounce:function(t,e){let r=0;return()=>{clearTimeout(r),r=window.setTimeout((()=>t()),e)}}});var ie=Object.freeze({__proto__:null,removeEventListeners:function(t){for(const e of t)e.eventTarget.removeEventListener(e.eventType,e.listener,e.thisObject);t.splice(0)},fireEvent:function(t,e={},r=window){const s=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:e});r.dispatchEvent(s)}}),ae=Object.freeze({__proto__:null});const oe=Symbol("uninitialized"),le=Symbol("error");var he=Object.freeze({__proto__:null,lazy:function(t){let e=oe,r=null;return()=>{if(e===le)throw r;if(e!==oe)return e;try{return e=t(),e}catch(t){throw r=t,e=le,r}}}});const ce=[];function ue(t){return ce.filter((function(e){if(!e.contextTypes)return!0;for(const r of e.contextTypes())if(t instanceof r)return!0;return!1}))}var ge=Object.freeze({__proto__:null,Linkifier:class{static async linkify(t,e){if(!t)throw new Error("Can't linkify "+t);const r=ue(t)[0];if(!r)throw new Error("No linkifiers registered for object "+t);return(await r.loadLinkifier()).linkify(t,e)}},registerLinkifier:function(t){ce.push(t)},getApplicableRegisteredlinkifiers:ue});var de=Object.freeze({__proto__:null,Mutex:class{#w=!1;#b=[];acquire(){const t={resolved:!1};return this.#w?new Promise((e=>{this.#b.push((()=>e(this.#S.bind(this,t))))})):(this.#w=!0,Promise.resolve(this.#S.bind(this,t)))}#S(t){if(t.resolved)throw new Error("Cannot release more than once.");t.resolved=!0;const e=this.#b.shift();e?e():this.#w=!1}async run(t){const e=await this.acquire();try{return await t()}finally{e()}}}});function pe(t){if(-1===t.indexOf("..")&&-1===t.indexOf("."))return t;const e=("/"===t[0]?t.substring(1):t).split("/"),r=[];for(const t of e)"."!==t&&(".."===t?r.pop():r.push(t));let s=r.join("/");return"/"===t[0]&&s&&(s="/"+s),"/"===s[s.length-1]||"/"!==t[t.length-1]&&"."!==e[e.length-1]&&".."!==e[e.length-1]||(s+="/"),s}class me{isValid;url;scheme;user;host;port;path;queryParams;fragment;folderPathComponents;lastPathComponent;blobInnerScheme;#x;#v;constructor(t){this.isValid=!1,this.url=t,this.scheme="",this.user="",this.host="",this.port="",this.path="",this.queryParams="",this.fragment="",this.folderPathComponents="",this.lastPathComponent="";const e=this.url.startsWith("blob:"),r=(e?t.substring(5):t).match(me.urlRegex());if(r)this.isValid=!0,e?(this.blobInnerScheme=r[2].toLowerCase(),this.scheme="blob"):this.scheme=r[2].toLowerCase(),this.user=r[3]??"",this.host=r[4]??"",this.port=r[5]??"",this.path=r[6]??"/",this.queryParams=r[7]??"",this.fragment=r[8]??"";else{if(this.url.startsWith("data:"))return void(this.scheme="data");if(this.url.startsWith("blob:"))return void(this.scheme="blob");if("about:blank"===this.url)return void(this.scheme="about");this.path=this.url}const s=this.path.lastIndexOf("/",this.path.length-2);this.lastPathComponent=-1!==s?this.path.substring(s+1):this.path;const n=this.path.lastIndexOf("/");-1!==n&&(this.folderPathComponents=this.path.substring(0,n))}static fromString(t){const e=new me(t.toString());return e.isValid?e:null}static preEncodeSpecialCharactersInPath(t){for(const e of["%",";","#","?"," "])t=t.replaceAll(e,encodeURIComponent(e));return t}static rawPathToEncodedPathString(t){const e=me.preEncodeSpecialCharactersInPath(t);return t.startsWith("/")?new URL(e,"file:///").pathname:new URL("/"+e,"file:///").pathname.substr(1)}static encodedFromParentPathAndName(t,e){return me.concatenate(t,"/",me.preEncodeSpecialCharactersInPath(e))}static urlFromParentUrlAndName(t,e){return me.concatenate(t,"/",me.preEncodeSpecialCharactersInPath(e))}static encodedPathToRawPathString(t){return decodeURIComponent(t)}static rawPathToUrlString(t){let e=me.preEncodeSpecialCharactersInPath(t.replace(/\\/g,"/"));return e=e.replace(/\\/g,"/"),e.startsWith("file://")||(e=e.startsWith("/")?"file://"+e:"file:///"+e),new URL(e).toString()}static relativePathToUrlString(t,e){const r=me.preEncodeSpecialCharactersInPath(t.replace(/\\/g,"/"));return new URL(r,e).toString()}static urlToRawPathString(t,e){console.assert(t.startsWith("file://"),"This must be a file URL.");const r=decodeURIComponent(t);return e?r.substr(8).replace(/\//g,"\\"):r.substr(7)}static sliceUrlToEncodedPathString(t,e){return t.substring(e)}static substr(t,e,r){return t.substr(e,r)}static substring(t,e,r){return t.substring(e,r)}static prepend(t,e){return t+e}static concatenate(t,...e){return t.concat(...e)}static trim(t){return t.trim()}static slice(t,e,r){return t.slice(e,r)}static join(t,e){return t.join(e)}static split(t,e,r){return t.split(e,r)}static toLowerCase(t){return t.toLowerCase()}static isValidUrlString(t){return new me(t).isValid}static urlWithoutHash(t){const e=t.indexOf("#");return-1!==e?t.substr(0,e):t}static urlRegex(){if(me.urlRegexInstance)return me.urlRegexInstance;return me.urlRegexInstance=new RegExp("^("+/([A-Za-z][A-Za-z0-9+.-]*):\/\//.source+/(?:([A-Za-z0-9\-._~%!$&'()*+,;=:]*)@)?/.source+/((?:\[::\d?\])|(?:[^\s\/:]*))/.source+/(?::([\d]+))?/.source+")"+/(\/[^#?]*)?/.source+/(?:\?([^#]*))?/.source+/(?:#(.*))?/.source+"$"),me.urlRegexInstance}static extractPath(t){const e=this.fromString(t);return e?e.path:""}static extractOrigin(t){const r=this.fromString(t);return r?r.securityOrigin():e.DevToolsPath.EmptyUrlString}static extractExtension(t){const e=(t=me.urlWithoutHash(t)).indexOf("?");-1!==e&&(t=t.substr(0,e));const r=t.lastIndexOf("/");-1!==r&&(t=t.substr(r+1));const s=t.lastIndexOf(".");if(-1!==s){const e=(t=t.substr(s+1)).indexOf("%");return-1!==e?t.substr(0,e):t}return""}static extractName(t){let e=t.lastIndexOf("/");const r=-1!==e?t.substr(e+1):t;return e=r.indexOf("?"),e<0?r:r.substr(0,e)}static completeURL(t,e){const r=e.trim();if(r.startsWith("data:")||r.startsWith("blob:")||r.startsWith("javascript:")||r.startsWith("mailto:"))return e;const s=this.fromString(r);if(s&&s.scheme){return s.securityOrigin()+pe(s.path)+(s.queryParams&&`?${s.queryParams}`)+(s.fragment&&`#${s.fragment}`)}const n=this.fromString(t);if(!n)return null;if(n.isDataURL())return e;if(e.length>1&&"/"===e.charAt(0)&&"/"===e.charAt(1))return n.scheme+":"+e;const i=n.securityOrigin(),a=n.path,o=n.queryParams?"?"+n.queryParams:"";if(!e.length)return i+a+o;if("#"===e.charAt(0))return i+a+o+e;if("?"===e.charAt(0))return i+a+e;const l=e.match(/^[^#?]*/);if(!l||!e.length)throw new Error("Invalid href");let h=l[0];const c=e.substring(h.length);return"/"!==h.charAt(0)&&(h=n.folderPathComponents+"/"+h),i+pe(h)+c}static splitLineAndColumn(t){const e=t.match(me.urlRegex());let r="",s=t;e&&(r=e[1],s=t.substring(e[1].length));const n=/(?::(\d+))?(?::(\d+))?$/.exec(s);let i,a;if(console.assert(Boolean(n)),!n)return{url:t,lineNumber:0,columnNumber:0};"string"==typeof n[1]&&(i=parseInt(n[1],10),i=isNaN(i)?void 0:i-1),"string"==typeof n[2]&&(a=parseInt(n[2],10),a=isNaN(a)?void 0:a-1);let o=r+s.substring(0,s.length-n[0].length);if(void 0===n[1]&&void 0===n[2]){const t=/wasm-function\[\d+\]:0x([a-z0-9]+)$/g.exec(s);t&&"string"==typeof t[1]&&(o=me.removeWasmFunctionInfoFromURL(o),a=parseInt(t[1],16),a=isNaN(a)?void 0:a)}return{url:o,lineNumber:i,columnNumber:a}}static removeWasmFunctionInfoFromURL(t){const e=t.search(/:wasm-function\[\d+\]/);return-1===e?t:me.substring(t,0,e)}static beginsWithWindowsDriveLetter(t){return/^[A-Za-z]:/.test(t)}static beginsWithScheme(t){return/^[A-Za-z][A-Za-z0-9+.-]*:/.test(t)}static isRelativeURL(t){return!this.beginsWithScheme(t)||this.beginsWithWindowsDriveLetter(t)}get displayName(){return this.#x?this.#x:this.isDataURL()?this.dataURLDisplayName():this.isBlobURL()||this.isAboutBlank()?this.url:(this.#x=this.lastPathComponent,this.#x||(this.#x=(this.host||"")+"/"),"/"===this.#x&&(this.#x=this.url),this.#x)}dataURLDisplayName(){return this.#v?this.#v:this.isDataURL()?(this.#v=e.StringUtilities.trimEndWithMaxLength(this.url,20),this.#v):""}isAboutBlank(){return"about:blank"===this.url}isDataURL(){return"data"===this.scheme}isHttpOrHttps(){return"http"===this.scheme||"https"===this.scheme}isBlobURL(){return this.url.startsWith("blob:")}lastPathComponentWithFragment(){return this.lastPathComponent+(this.fragment?"#"+this.fragment:"")}domain(){return this.isDataURL()?"data:":this.host+(this.port?":"+this.port:"")}securityOrigin(){if(this.isDataURL())return"data:";return(this.isBlobURL()?this.blobInnerScheme:this.scheme)+"://"+this.domain()}urlWithoutScheme(){return this.scheme&&this.url.startsWith(this.scheme+"://")?this.url.substring(this.scheme.length+3):this.url}static urlRegexInstance=null}var ye=Object.freeze({__proto__:null,normalizePath:pe,schemeIs:function(t,e){try{return new URL(t).protocol===e}catch(t){return!1}},ParsedURL:me});class fe{#T;#R;#z;#I;constructor(t,e){this.#T=t,this.#R=e||1,this.#z=0,this.#I=0}isCanceled(){return this.#T.parent.isCanceled()}setTitle(t){this.#T.parent.setTitle(t)}done(){this.setWorked(this.#I),this.#T.childDone()}setTotalWork(t){this.#I=t,this.#T.update()}setWorked(t,e){this.#z=t,void 0!==e&&this.setTitle(e),this.#T.update()}incrementWorked(t){this.setWorked(this.#z+(t||1))}getWeight(){return this.#R}getWorked(){return this.#z}getTotalWork(){return this.#I}}var we=Object.freeze({__proto__:null,Progress:class{setTotalWork(t){}setTitle(t){}setWorked(t,e){}incrementWorked(t){}done(){}isCanceled(){return!1}},CompositeProgress:class{parent;#P;#A;constructor(t){this.parent=t,this.#P=[],this.#A=0,this.parent.setTotalWork(1),this.parent.setWorked(0)}childDone(){++this.#A===this.#P.length&&this.parent.done()}createSubProgress(t){const e=new fe(this,t);return this.#P.push(e),e}update(){let t=0,e=0;for(let r=0;r{};return this.getOrCreatePromise(t).catch(r).then((t=>{t&&e(t)})),null}return r}clear(){this.stopListening();for(const[t,{reject:e}]of this.#C.entries())e(new Error(`Object with ${t} never resolved.`));this.#C.clear()}getOrCreatePromise(t){const e=this.#C.get(t);if(e)return e.promise;let r=()=>{},s=()=>{};const n=new Promise(((t,e)=>{r=t,s=e}));return this.#C.set(t,{promise:n,resolve:r,reject:s}),this.startListening(),n}onResolve(t,e){const r=this.#C.get(t);this.#C.delete(t),0===this.#C.size&&this.stopListening(),r?.resolve(e)}}});const xe={fetchAndXHR:"`Fetch` and `XHR`",javascript:"JavaScript",js:"JS",css:"CSS",img:"Img",media:"Media",font:"Font",doc:"Doc",ws:"WS",webassembly:"WebAssembly",wasm:"Wasm",manifest:"Manifest",other:"Other",document:"Document",stylesheet:"Stylesheet",image:"Image",script:"Script",texttrack:"TextTrack",fetch:"Fetch",eventsource:"EventSource",websocket:"WebSocket",webtransport:"WebTransport",signedexchange:"SignedExchange",ping:"Ping",cspviolationreport:"CSPViolationReport",preflight:"Preflight",webbundle:"WebBundle"},ve=r.i18n.registerUIStrings("core/common/ResourceType.ts",xe),Te=r.i18n.getLazilyComputedLocalizedString.bind(void 0,ve);class Re{#L;#_;#O;#B;constructor(t,e,r,s){this.#L=t,this.#_=e,this.#O=r,this.#B=s}static fromMimeType(t){return t?t.startsWith("text/html")?Ae.Document:t.startsWith("text/css")?Ae.Stylesheet:t.startsWith("image/")?Ae.Image:t.startsWith("text/")?Ae.Script:t.includes("font")?Ae.Font:t.includes("script")?Ae.Script:t.includes("octet")?Ae.Other:t.includes("application")?Ae.Script:Ae.Other:Ae.Other}static fromMimeTypeOverride(t){return"application/manifest+json"===t?Ae.Manifest:"application/wasm"===t?Ae.Wasm:"application/webbundle"===t?Ae.WebBundle:null}static fromURL(t){return ke.get(me.extractExtension(t))||null}static fromName(t){for(const e in Ae){const r=Ae[e];if(r.name()===t)return r}return null}static mimeFromURL(t){const e=me.extractName(t);if(Ee.has(e))return Ee.get(e);let r=me.extractExtension(t).toLowerCase();return"html"===r&&e.endsWith(".component.html")&&(r="component.html"),Ce.get(r)}static mimeFromExtension(t){return Ce.get(t)}static simplifyContentType(t){return new RegExp("^application(.*json$|/json+.*)").test(t)?"application/json":t}static mediaTypeForMetrics(t,e,r){return"text/javascript"!==t?t:e?"text/javascript+sourcemapped":r?"text/javascript+minified":"text/javascript+plain"}name(){return this.#L}title(){return this.#_()}category(){return this.#O}isTextType(){return this.#B}isScript(){return"script"===this.#L||"sm-script"===this.#L}hasScripts(){return this.isScript()||this.isDocument()}isStyleSheet(){return"stylesheet"===this.#L||"sm-stylesheet"===this.#L}hasStyleSheets(){return this.isStyleSheet()||this.isDocument()}isDocument(){return"document"===this.#L}isDocumentOrScriptOrStyleSheet(){return this.isDocument()||this.isScript()||this.isStyleSheet()}isFont(){return"font"===this.#L}isImage(){return"image"===this.#L}isFromSourceMap(){return this.#L.startsWith("sm-")}isWebbundle(){return"webbundle"===this.#L}toString(){return this.#L}canonicalMimeType(){return this.isDocument()?"text/html":this.isScript()?"text/javascript":this.isStyleSheet()?"text/css":""}}class ze{title;shortTitle;constructor(t,e){this.title=t,this.shortTitle=e}static categoryByTitle(t){return Object.values(Ie).find((e=>e.title()===t))||null}}const Ie={XHR:new ze(Te(xe.fetchAndXHR),r.i18n.lockedLazyString("Fetch/XHR")),Document:new ze(Te(xe.document),Te(xe.doc)),Stylesheet:new ze(Te(xe.css),Te(xe.css)),Script:new ze(Te(xe.javascript),Te(xe.js)),Font:new ze(Te(xe.font),Te(xe.font)),Image:new ze(Te(xe.image),Te(xe.img)),Media:new ze(Te(xe.media),Te(xe.media)),Manifest:new ze(Te(xe.manifest),Te(xe.manifest)),WebSocket:new ze(Te(xe.websocket),Te(xe.ws)),Wasm:new ze(Te(xe.webassembly),Te(xe.wasm)),Other:new ze(Te(xe.other),Te(xe.other))},Pe={XHR:new ze(Te(xe.fetchAndXHR),r.i18n.lockedLazyString("Fetch/XHR")),Script:new ze(Te(xe.javascript),Te(xe.js)),Image:new ze(Te(xe.image),Te(xe.img)),Media:new ze(Te(xe.media),Te(xe.media)),Other:new ze(Te(xe.other),Te(xe.other))},Ae={Document:new Re("document",Te(xe.document),Ie.Document,!0),Stylesheet:new Re("stylesheet",Te(xe.stylesheet),Ie.Stylesheet,!0),Image:new Re("image",Te(xe.image),Ie.Image,!1),Media:new Re("media",Te(xe.media),Ie.Media,!1),Font:new Re("font",Te(xe.font),Ie.Font,!1),Script:new Re("script",Te(xe.script),Ie.Script,!0),TextTrack:new Re("texttrack",Te(xe.texttrack),Ie.Other,!0),XHR:new Re("xhr",r.i18n.lockedLazyString("XHR"),Ie.XHR,!0),Fetch:new Re("fetch",Te(xe.fetch),Ie.XHR,!0),Prefetch:new Re("prefetch",r.i18n.lockedLazyString("Prefetch"),Ie.Document,!0),EventSource:new Re("eventsource",Te(xe.eventsource),Ie.XHR,!0),WebSocket:new Re("websocket",Te(xe.websocket),Ie.WebSocket,!1),WebTransport:new Re("webtransport",Te(xe.webtransport),Ie.WebSocket,!1),Wasm:new Re("wasm",Te(xe.wasm),Ie.Wasm,!1),Manifest:new Re("manifest",Te(xe.manifest),Ie.Manifest,!0),SignedExchange:new Re("signed-exchange",Te(xe.signedexchange),Ie.Other,!1),Ping:new Re("ping",Te(xe.ping),Ie.Other,!1),CSPViolationReport:new Re("csp-violation-report",Te(xe.cspviolationreport),Ie.Other,!1),Other:new Re("other",Te(xe.other),Ie.Other,!1),Preflight:new Re("preflight",Te(xe.preflight),Ie.Other,!0),SourceMapScript:new Re("sm-script",Te(xe.script),Ie.Script,!0),SourceMapStyleSheet:new Re("sm-stylesheet",Te(xe.stylesheet),Ie.Stylesheet,!0),WebBundle:new Re("webbundle",Te(xe.webbundle),Ie.Other,!1)},Ee=new Map([["Cakefile","text/x-coffeescript"]]),ke=new Map([["js",Ae.Script],["mjs",Ae.Script],["css",Ae.Stylesheet],["xsl",Ae.Stylesheet],["avif",Ae.Image],["bmp",Ae.Image],["gif",Ae.Image],["ico",Ae.Image],["jpeg",Ae.Image],["jpg",Ae.Image],["jxl",Ae.Image],["png",Ae.Image],["svg",Ae.Image],["tif",Ae.Image],["tiff",Ae.Image],["vue",Ae.Document],["webmanifest",Ae.Manifest],["webp",Ae.Media],["otf",Ae.Font],["ttc",Ae.Font],["ttf",Ae.Font],["woff",Ae.Font],["woff2",Ae.Font],["wasm",Ae.Wasm]]),Ce=new Map([["js","text/javascript"],["mjs","text/javascript"],["css","text/css"],["html","text/html"],["htm","text/html"],["xml","application/xml"],["xsl","application/xml"],["wasm","application/wasm"],["webmanifest","application/manifest+json"],["asp","application/x-aspx"],["aspx","application/x-aspx"],["jsp","application/x-jsp"],["c","text/x-c++src"],["cc","text/x-c++src"],["cpp","text/x-c++src"],["h","text/x-c++src"],["m","text/x-c++src"],["mm","text/x-c++src"],["coffee","text/x-coffeescript"],["dart","application/vnd.dart"],["ts","text/typescript"],["tsx","text/typescript-jsx"],["json","application/json"],["gyp","application/json"],["gypi","application/json"],["map","application/json"],["cs","text/x-csharp"],["go","text/x-go"],["java","text/x-java"],["kt","text/x-kotlin"],["scala","text/x-scala"],["less","text/x-less"],["php","application/x-httpd-php"],["phtml","application/x-httpd-php"],["py","text/x-python"],["sh","text/x-sh"],["gss","text/x-gss"],["sass","text/x-sass"],["scss","text/x-scss"],["vtt","text/vtt"],["ls","text/x-livescript"],["md","text/markdown"],["cljs","text/x-clojure"],["cljc","text/x-clojure"],["cljx","text/x-clojure"],["styl","text/x-styl"],["jsx","text/jsx"],["avif","image/avif"],["bmp","image/bmp"],["gif","image/gif"],["ico","image/ico"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["jxl","image/jxl"],["png","image/png"],["svg","image/svg+xml"],["tif","image/tif"],["tiff","image/tiff"],["webp","image/webp"],["otf","font/otf"],["ttc","font/collection"],["ttf","font/ttf"],["woff","font/woff"],["woff2","font/woff2"],["component.html","text/x.angular"],["svelte","text/x.svelte"],["vue","text/x.vue"]]);var Le=Object.freeze({__proto__:null,ResourceType:Re,ResourceCategory:ze,resourceCategories:Ie,resourceCategoriesReactNative:Pe,resourceTypes:Ae,resourceTypeByExtension:ke,mimeTypeByExtension:Ce});const _e=new Map;const Oe=[];var Be=Object.freeze({__proto__:null,registerLateInitializationRunnable:function(t){const{id:e,loadRunnable:r}=t;if(_e.has(e))throw new Error(`Duplicate late Initializable runnable id '${e}'`);_e.set(e,r)},maybeRemoveLateInitializationRunnable:function(t){return _e.delete(t)},lateInitializationRunnables:function(){return[..._e.values()]},registerEarlyInitializationRunnable:function(t){Oe.push(t)},earlyInitializationRunnables:function(){return Oe}});class Ne{begin;end;data;constructor(t,e,r){if(t>e)throw new Error("Invalid segment");this.begin=t,this.end=e,this.data=r}intersects(t){return this.begint.begin-e.begin)),s=r,n=null;if(r>0){const e=this.#N[r-1];n=this.tryMerge(e,t),n?(--r,t=n):this.#N[r-1].end>=t.begin&&(t.endthis.append(t)))}segments(){return this.#N}tryMerge(t,e){const r=this.#V&&this.#V(t,e);return r?(r.begin=t.begin,r.end=Math.max(t.end,e.end),r):null}}});const Ge={elements:"Elements",appearance:"Appearance",sources:"Sources",network:"Network",performance:"Performance",console:"Console",persistence:"Persistence",debugger:"Debugger",global:"Global",rendering:"Rendering",grid:"Grid",mobile:"Mobile",memory:"Memory",extension:"Extension",adorner:"Adorner",sync:"Sync"},Me=r.i18n.registerUIStrings("core/common/SettingRegistration.ts",Ge),We=r.i18n.getLocalizedString.bind(void 0,Me);let Xe=[];const Fe=new Set;function De(t){const e=t.settingName;if(Fe.has(e))throw new Error(`Duplicate setting name '${e}'`);Fe.add(e),Xe.push(t)}function je(e){return Xe.filter((r=>t.Runtime.Runtime.isDescriptorEnabled({experiment:r.experiment,condition:r.condition},e)))}function Ue(t,e=!1){if(0===Xe.length||e){Xe=t,Fe.clear();for(const e of t){const t=e.settingName;if(Fe.has(t))throw new Error(`Duplicate setting name '${t}'`);Fe.add(t)}}}function He(){Xe=[],Fe.clear()}function $e(t){const e=Xe.findIndex((e=>e.settingName===t));return!(e<0||!Fe.delete(t))&&(Xe.splice(e,1),!0)}function qe(t){switch(t){case"ELEMENTS":return We(Ge.elements);case"APPEARANCE":return We(Ge.appearance);case"SOURCES":return We(Ge.sources);case"NETWORK":return We(Ge.network);case"PERFORMANCE":return We(Ge.performance);case"CONSOLE":case"EMULATION":return We(Ge.console);case"PERSISTENCE":return We(Ge.persistence);case"DEBUGGER":return We(Ge.debugger);case"GLOBAL":return We(Ge.global);case"RENDERING":return We(Ge.rendering);case"GRID":return We(Ge.grid);case"MOBILE":return We(Ge.mobile);case"MEMORY":return We(Ge.memory);case"EXTENSIONS":return We(Ge.extension);case"ADORNER":return We(Ge.adorner);case"":return r.i18n.lockedString("");case"SYNC":return We(Ge.sync)}}var Ze=Object.freeze({__proto__:null,registerSettingExtension:De,getRegisteredSettings:je,registerSettingsForTest:Ue,resetSettings:He,maybeRemoveSettingExtension:$e,getLocalizedSettingsCategory:qe});let Ye;class Ke{syncedStorage;globalStorage;localStorage;#G;settingNameSet;orderValuesBySettingCategory;#M;#W;moduleSettings;#X;constructor(e,r,s,n){this.syncedStorage=e,this.globalStorage=r,this.localStorage=s,this.#G=new Qe({}),this.settingNameSet=new Set,this.orderValuesBySettingCategory=new Map,this.#M=new Dt,this.#W=new Map,this.moduleSettings=new Map,this.#X=n;for(const e of this.getRegisteredSettings()){const{settingName:r,defaultValue:s,storageType:n}=e,i="regex"===e.settingType,a="function"==typeof s?s(this.#X):s,o=i&&"string"==typeof a?this.createRegExpSetting(r,a,void 0,n):this.createSetting(r,a,n);o.setTitleFunction(e.title),e.userActionCondition&&o.setRequiresUserAction(Boolean(t.Runtime.Runtime.queryParam(e.userActionCondition))),o.setRegistration(e),this.registerModuleSetting(o)}}getRegisteredSettings(){return je(this.#X)}static hasInstance(){return void 0!==Ye}static instance(t={forceNew:null,syncedStorage:null,globalStorage:null,localStorage:null}){const{forceNew:e,syncedStorage:r,globalStorage:s,localStorage:n,config:i}=t;if(!Ye||e){if(!r||!s||!n)throw new Error(`Unable to create settings: global and local storage must be provided: ${(new Error).stack}`);Ye=new Ke(r,s,n,i)}return Ye}static removeInstance(){Ye=void 0}getHostConfig(){return this.#X}registerModuleSetting(t){const e=t.name,r=t.category(),s=t.order();if(this.settingNameSet.has(e))throw new Error(`Duplicate Setting name '${e}'`);if(r&&s){const t=this.orderValuesBySettingCategory.get(r)||new Set;if(t.has(s))throw new Error(`Duplicate order value '${s}' for settings category '${r}'`);t.add(s),this.orderValuesBySettingCategory.set(r,t)}this.settingNameSet.add(e),this.moduleSettings.set(t.name,t)}static normalizeSettingName(t){return[nr.GLOBAL_VERSION_SETTING_NAME,nr.SYNCED_VERSION_SETTING_NAME,nr.LOCAL_VERSION_SETTING_NAME,"currentDockState","isUnderTest"].includes(t)?t:e.StringUtilities.toKebabCase(t)}moduleSetting(t){const e=this.moduleSettings.get(t);if(!e)throw new Error("No setting registered: "+t);return e}settingForTest(t){const e=this.#W.get(t);if(!e)throw new Error("No setting registered: "+t);return e}createSetting(t,e,r){const s=this.storageFromType(r);let n=this.#W.get(t);return n||(n=new rr(t,e,this.#M,s),this.#W.set(t,n)),n}createLocalSetting(t,e){return this.createSetting(t,e,"Local")}createRegExpSetting(t,e,r,s){return this.#W.get(t)||this.#W.set(t,new sr(t,e,this.#M,this.storageFromType(s),r)),this.#W.get(t)}clearAll(){this.globalStorage.removeAll(),this.syncedStorage.removeAll(),this.localStorage.removeAll(),(new nr).resetToCurrent()}storageFromType(t){switch(t){case"Local":return this.localStorage;case"Session":return this.#G;case"Global":return this.globalStorage;case"Synced":return this.syncedStorage}return this.globalStorage}getRegistry(){return this.#W}}const Je={register:()=>{},set:()=>{},get:()=>Promise.resolve(""),remove:()=>{},clear:()=>{}};class Qe{object;backingStore;storagePrefix;constructor(t,e=Je,r=""){this.object=t,this.backingStore=e,this.storagePrefix=r}register(t){t=this.storagePrefix+t,this.backingStore.register(t)}set(t,e){t=this.storagePrefix+t,this.object[t]=e,this.backingStore.set(t,e)}has(t){return(t=this.storagePrefix+t)in this.object}get(t){return t=this.storagePrefix+t,this.object[t]}async forceGet(t){const e=this.storagePrefix+t,r=await this.backingStore.get(e);return r&&r!==this.object[e]?this.set(t,r):r||this.remove(t),r}remove(t){t=this.storagePrefix+t,delete this.object[t],this.backingStore.remove(t)}removeAll(){this.object={},this.backingStore.clear()}keys(){return Object.keys(this.object)}dumpSizes(){te.instance().log("Ten largest settings: ");const t={__proto__:null};for(const e in this.object)t[e]=this.object[e].length;const e=Object.keys(t);e.sort((function(e,r){return t[r]-t[e]}));for(let r=0;r<10&&rt.name===e.experiment)):void 0}}class rr{name;defaultValue;eventSupport;storage;#F;#_;#D=null;#j;#U;#H=JSON;#$;#q;#Z=null;constructor(t,e,r,s){this.name=t,this.defaultValue=e,this.eventSupport=r,this.storage=s,s.register(this.name)}setSerializer(t){this.#H=t}addChangeListener(t,e){return this.eventSupport.addEventListener(this.name,t,e)}removeChangeListener(t,e){this.eventSupport.removeEventListener(this.name,t,e)}title(){return this.#_?this.#_:this.#F?this.#F():""}setTitleFunction(t){t&&(this.#F=t)}setTitle(t){this.#_=t}setRequiresUserAction(t){this.#j=t}disabled(){if(this.#D?.disabledCondition){const{disabled:t}=this.#D.disabledCondition(Ke.instance().getHostConfig());if(t)return!0}return this.#q||!1}disabledReason(){if(this.#D?.disabledCondition){const t=this.#D.disabledCondition(Ke.instance().getHostConfig());if(t.disabled)return t.reason}}setDisabled(t){this.#q=t,this.eventSupport.dispatchEventToListeners(this.name)}get(){if(this.#j&&!this.#$)return this.defaultValue;if(void 0!==this.#U)return this.#U;if(this.#U=this.defaultValue,this.storage.has(this.name))try{this.#U=this.#H.parse(this.storage.get(this.name))}catch(t){this.storage.remove(this.name)}return this.#U}async forceGet(){const t=this.name,e=this.storage.get(t),r=await this.storage.forceGet(t);if(this.#U=this.defaultValue,r)try{this.#U=this.#H.parse(r)}catch(t){this.storage.remove(this.name)}return e!==r&&this.eventSupport.dispatchEventToListeners(this.name,this.#U),this.#U}set(t){this.#$=!0,this.#U=t;try{const e=this.#H.stringify(t);try{this.storage.set(this.name,e)}catch(t){this.printSettingsSavingError(t.message,this.name,e)}}catch(t){te.instance().error("Cannot stringify setting with name: "+this.name+", error: "+t.message)}this.eventSupport.dispatchEventToListeners(this.name,t)}setRegistration(e){this.#D=e;const{deprecationNotice:r}=e;if(r?.disabled){const e=r.experiment?t.Runtime.experiments.allConfigurableExperiments().find((t=>t.name===r.experiment)):void 0;e&&!e.isEnabled()||(this.set(this.defaultValue),this.setDisabled(!0))}}type(){return this.#D?this.#D.settingType:null}options(){return this.#D&&this.#D.options?this.#D.options.map((t=>{const{value:e,title:r,text:s,raw:n}=t;return{value:e,title:r(),text:"function"==typeof s?s():s,raw:n}})):[]}reloadRequired(){return this.#D&&this.#D.reloadRequired||null}category(){return this.#D&&this.#D.category||null}tags(){return this.#D&&this.#D.tags?this.#D.tags.map((t=>t())).join("\0"):null}order(){return this.#D&&this.#D.order||null}get deprecation(){return this.#D&&this.#D.deprecationNotice?(this.#Z||(this.#Z=new er(this.#D)),this.#Z):null}printSettingsSavingError(t,e,r){const s="Error saving setting with name: "+this.name+", value length: "+r.length+". Error: "+t;console.error(s),te.instance().error(s),this.storage.dumpSizes()}}class sr extends rr{#Y;#K;constructor(t,e,r,s,n){super(t,e?[{pattern:e}]:[],r,s),this.#Y=n}get(){const t=[],e=this.getAsArray();for(let r=0;r`-url:${t}`)).join(" ");if(e){const t=Ke.instance().createSetting("console.textFilter",""),r=t.get()?` ${t.get()}`:"";t.set(`${e}${r}`)}tr(t)}updateVersionFrom26To27(){function t(t,e,r){const s=Ke.instance().createSetting(t,{}),n=s.get();e in n&&(n[r]=n[e],delete n[e],s.set(n))}t("panel-tabOrder","audits2","audits"),t("panel-closeableTabs","audits2","audits"),function(t,e,r){const s=Ke.instance().createSetting(t,"");s.get()===e&&s.set(r)}("panel-selectedTab","audits2","audits")}updateVersionFrom27To28(){const t=Ke.instance().createSetting("uiTheme","systemPreferred");"default"===t.get()&&t.set("systemPreferred")}updateVersionFrom28To29(){function t(t,e,r){const s=Ke.instance().createSetting(t,{}),n=s.get();e in n&&(n[r]=n[e],delete n[e],s.set(n))}t("panel-tabOrder","audits","lighthouse"),t("panel-closeableTabs","audits","lighthouse"),function(t,e,r){const s=Ke.instance().createSetting(t,"");s.get()===e&&s.set(r)}("panel-selectedTab","audits","lighthouse")}updateVersionFrom29To30(){const t=Ke.instance().createSetting("closeableTabs",{}),e=Ke.instance().createSetting("panel-closeableTabs",{}),r=Ke.instance().createSetting("drawer-view-closeableTabs",{}),s=e.get(),n=e.get(),i=Object.assign(n,s);t.set(i),tr(e),tr(r)}updateVersionFrom30To31(){tr(Ke.instance().createSetting("recorder_recordings",[]))}updateVersionFrom31To32(){const t=Ke.instance().createLocalSetting("breakpoints",[]),e=t.get();for(const t of e)t.resourceTypeName="script";t.set(e)}updateVersionFrom32To33(){const t=Ke.instance().createLocalSetting("previouslyViewedFiles",[]);let e=t.get();e=e.filter((t=>"url"in t));for(const t of e)t.resourceTypeName="script";t.set(e)}updateVersionFrom33To34(){const t=Ke.instance().createLocalSetting("breakpoints",[]),e=t.get();for(const t of e){const e=t.condition.startsWith("/** DEVTOOLS_LOGPOINT */ console.log(")&&t.condition.endsWith(")");t.isLogpoint=e}t.set(e)}updateVersionFrom34To35(){const t=Ke.instance().createLocalSetting("breakpoints",[]),e=t.get();for(const t of e){const{condition:e,isLogpoint:r}=t;r&&(t.condition=e.slice(37,e.length-1))}t.set(e)}updateVersionFrom35To36(){Ke.instance().createSetting("showThirdPartyIssues",!0).set(!0)}updateVersionFrom36To37(){const t=t=>{for(const e of t.keys()){const r=Ke.normalizeSettingName(e);if(r!==e){const s=t.get(e);tr({name:e,storage:t}),t.set(r,s)}}};t(Ke.instance().globalStorage),t(Ke.instance().syncedStorage),t(Ke.instance().localStorage);for(const t of Ke.instance().globalStorage.keys()){if(t.startsWith("data-grid-")&&t.endsWith("-column-weights")||t.endsWith("-tab-order")||"views-location-override"===t||"closeable-tabs"===t){const r=Ke.instance().createSetting(t,{});r.set(e.StringUtilities.toKebabCaseKeys(r.get()))}if(t.endsWith("-selected-tab")){const r=Ke.instance().createSetting(t,"");r.set(e.StringUtilities.toKebabCase(r.get()))}}}migrateSettingsFromLocalStorage(){const t=new Set(["advancedSearchConfig","breakpoints","consoleHistory","domBreakpoints","eventListenerBreakpoints","fileSystemMapping","lastSelectedSourcesSidebarPaneTab","previouslyViewedFiles","savedURLs","watchExpressions","workspaceExcludedFolders","xhrBreakpoints"]);if(window.localStorage)for(const e in window.localStorage){if(t.has(e))continue;const r=window.localStorage[e];window.localStorage.removeItem(e),Ke.instance().globalStorage.set(e,r)}}clearBreakpointsWhenTooMany(t,e){t.get().length>e&&t.set([])}}function ir(t){return Ke.instance().moduleSetting(t)}var ar=Object.freeze({__proto__:null,Settings:Ke,NOOP_STORAGE:Je,SettingsStorage:Qe,Deprecation:er,Setting:rr,RegExpSetting:sr,VersionController:nr,moduleSetting:ir,settingForTest:function(t){return Ke.instance().settingForTest(t)},getLocalizedSettingsCategory:qe,maybeRemoveSettingExtension:$e,registerSettingExtension:De,registerSettingsForTest:Ue,resetSettings:He});var or=Object.freeze({__proto__:null,SimpleHistoryManager:class{#et;#rt;#st;#nt;constructor(t){this.#et=[],this.#rt=-1,this.#st=0,this.#nt=t}readOnlyLock(){++this.#st}releaseReadOnlyLock(){--this.#st}getPreviousValidIndex(){if(this.empty())return-1;let t=this.#rt-1;for(;t>=0&&!this.#et[t].valid();)--t;return t<0?-1:t}getNextValidIndex(){let t=this.#rt+1;for(;t=this.#et.length?-1:t}readOnly(){return Boolean(this.#st)}filterOut(t){if(this.readOnly())return;const e=[];let r=0;for(let s=0;sthis.#nt&&this.#et.shift(),this.#rt=this.#et.length-1)}canRollback(){return this.getPreviousValidIndex()>=0}canRollover(){return this.getNextValidIndex()>=0}rollback(){const t=this.getPreviousValidIndex();return-1!==t&&(this.readOnlyLock(),this.#rt=t,this.#et[t].reveal(),this.releaseReadOnlyLock(),!0)}rollover(){const t=this.getNextValidIndex();return-1!==t&&(this.readOnlyLock(),this.#rt=t,this.#et[t].reveal(),this.releaseReadOnlyLock(),!0)}}});var lr=Object.freeze({__proto__:null,StringOutputStream:class{#it;constructor(){this.#it=""}async write(t){this.#it+=t}async close(){}data(){return this.#it}}});class hr{#at;#ot;#lt;#ht;#ct;#ut;#gt;constructor(t){this.#ot=0,this.#gt=t,this.clear()}static newStringTrie(){return new hr({empty:()=>"",append:(t,e)=>t+e,slice:(t,e,r)=>t.slice(e,r)})}static newArrayTrie(){return new hr({empty:()=>[],append:(t,e)=>t.concat([e]),slice:(t,e,r)=>t.slice(e,r)})}add(t){let e=this.#ot;++this.#ct[this.#ot];for(let r=0;r{this.#bt=t}))}#xt(){this.#ft=this.getTime(),this.#pt=!1,this.#yt&&this.innerSchedule(!1),this.processCompletedForTests()}processCompletedForTests(){}get process(){return this.#yt}get processCompleted(){return this.#yt?this.#wt:null}onTimeout(){this.#St=void 0,this.#mt=!1,this.#pt=!0,Promise.resolve().then(this.#yt).catch(console.error.bind(console)).then(this.#xt.bind(this)).then(this.#bt),this.#wt=new Promise((t=>{this.#bt=t})),this.#yt=null}schedule(t,e="Default"){this.#yt=t;const r=Boolean(this.#St)||this.#pt,s=this.getTime()-this.#ft>this.#dt,n="AsSoonAsPossible"===e||"Default"===e&&!r&&s,i=n&&!this.#mt;return this.#mt=this.#mt||n,this.innerSchedule(i),this.#wt}innerSchedule(t){if(this.#pt)return;if(this.#St&&!t)return;this.#St&&this.clearTimeout(this.#St);const e=this.#mt?0:this.#dt;this.#St=this.setTimeout(this.onTimeout.bind(this),e)}clearTimeout(t){clearTimeout(t)}setTimeout(t,e){return window.setTimeout(t,e)}getTime(){return window.performance.now()}}});class dr{#vt;#Tt;constructor(t){this.#vt=new Promise((e=>{const r=new Worker(t,{type:"module"});r.onmessage=t=>{console.assert("workerReady"===t.data),r.onmessage=null,e(r)}}))}static fromURL(t){return new dr(t)}postMessage(t){this.#vt.then((e=>{this.#Tt||e.postMessage(t)}))}dispose(){this.#Tt=!0,this.#vt.then((t=>t.terminate()))}terminate(){this.dispose()}set onmessage(t){this.#vt.then((e=>{e.onmessage=t}))}set onerror(t){this.#vt.then((e=>{e.onerror=t}))}}var pr=Object.freeze({__proto__:null,WorkerWrapper:dr});export{s as App,i as AppProvider,l as Base64,h as CharacterIdMap,Ft as Color,E as ColorConverter,nt as ColorUtils,se as Console,ne as Debouncer,ie as EventTarget,ae as JavaScriptMetaData,he as Lazy,ge as Linkifier,de as Mutex,jt as ObjectWrapper,ye as ParsedURL,we as Progress,be as QueryParamHandler,Se as ResolverBase,Le as ResourceType,Jt as Revealer,Be as Runnable,Ve as SegmentedRange,Ze as SettingRegistration,ar as Settings,or as SimpleHistoryManager,lr as StringOutputStream,ur as TextDictionary,gr as Throttler,cr as Trie,pr as Worker}; diff --git a/packages/debugger-frontend/dist/third-party/front_end/panels/network/network.js b/packages/debugger-frontend/dist/third-party/front_end/panels/network/network.js index b985fcaa764..1bab671b634 100644 --- a/packages/debugger-frontend/dist/third-party/front_end/panels/network/network.js +++ b/packages/debugger-frontend/dist/third-party/front_end/panels/network/network.js @@ -1 +1 @@ -import*as e from"../../core/common/common.js";import*as t from"../../core/host/host.js";import*as i from"../../core/i18n/i18n.js";import*as r from"../../ui/legacy/components/source_frame/source_frame.js";import*as o from"../../ui/legacy/legacy.js";import*as s from"../../core/platform/platform.js";import*as n from"../../core/sdk/sdk.js";import*as a from"../../models/logs/logs.js";import"../../ui/components/buttons/buttons.js";import*as l from"../../ui/visual_logging/visual_logging.js";import*as d from"../../ui/legacy/components/data_grid/data_grid.js";import*as c from"../mobile_throttling/mobile_throttling.js";import*as h from"../settings/emulation/components/components.js";import*as u from"../../models/bindings/bindings.js";import*as p from"../../models/workspace/workspace.js";import*as g from"./forward/forward.js";import*as m from"../../ui/components/icon_button/icon_button.js";import*as w from"../../ui/legacy/components/perf_ui/perf_ui.js";import*as k from"../../ui/legacy/components/utils/utils.js";import{PanelUtils as b}from"../utils/utils.js";import*as v from"../../ui/components/legacy_wrapper/legacy_wrapper.js";import*as f from"./components/components.js";import*as C from"../../ui/legacy/components/cookie_table/cookie_table.js";import*as S from"../../ui/legacy/components/object_ui/object_ui.js";import*as y from"../../models/text_utils/text_utils.js";import*as T from"../../core/root/root.js";import*as x from"../../models/har/har.js";import*as R from"../../models/persistence/persistence.js";import*as I from"../sources/sources.js";import*as q from"../../ui/components/adorners/adorners.js";import*as L from"../../ui/components/render_coordinator/render_coordinator.js";import*as F from"../../ui/legacy/theme_support/theme_support.js";import*as P from"../../models/trace/trace.js";import*as H from"../search/search.js";import*as M from"../timeline/utils/utils.js";const E=new CSSStyleSheet;E.replaceSync(".panel.network .toolbar.binary-view-toolbar{border-top:1px solid var(--sys-color-divider);border-bottom:0;padding-left:5px}.binary-view-copied-text{opacity:100%}.binary-view-copied-text.fadeout{opacity:0%;transition:opacity 1s}\n/*# sourceURL=binaryResourceView.css */\n");const A={copiedAsBase:"Copied as `Base64`",hexViewer:"`Hex` Viewer",copiedAsHex:"Copied as `Hex`",copiedAsUtf:"Copied as `UTF-8`",binaryViewType:"Binary view type",copyToClipboard:"Copy to clipboard",copyAsBase:"Copy as `Base64`",copyAsHex:"Copy as `Hex`",copyAsUtf:"Copy as `UTF-8`"},B=i.i18n.registerUIStrings("panels/network/BinaryResourceView.ts",A),U=i.i18n.getLocalizedString.bind(void 0,B);class N extends o.Widget.VBox{binaryResourceViewFactory;toolbar;binaryViewObjects;binaryViewTypeSetting;binaryViewTypeCombobox;copiedText;addFadeoutSettimeoutId;lastView;constructor(t,s,n){super(),this.binaryResourceViewFactory=new r.BinaryResourceViewFactory.BinaryResourceViewFactory(t,s,n),this.toolbar=new o.Toolbar.Toolbar("binary-view-toolbar",this.element),this.binaryViewObjects=[new V("base64",i.i18n.lockedString("Base64"),U(A.copiedAsBase),this.binaryResourceViewFactory.createBase64View.bind(this.binaryResourceViewFactory),(()=>Promise.resolve(this.binaryResourceViewFactory.base64()))),new V("hex",U(A.hexViewer),U(A.copiedAsHex),this.binaryResourceViewFactory.createHexView.bind(this.binaryResourceViewFactory),this.binaryResourceViewFactory.hex.bind(this.binaryResourceViewFactory)),new V("utf8",i.i18n.lockedString("UTF-8"),U(A.copiedAsUtf),this.binaryResourceViewFactory.createUtf8View.bind(this.binaryResourceViewFactory),this.binaryResourceViewFactory.utf8.bind(this.binaryResourceViewFactory))],this.binaryViewTypeSetting=e.Settings.Settings.instance().createSetting("binary-view-type","hex"),this.binaryViewTypeCombobox=new o.Toolbar.ToolbarComboBox(this.binaryViewTypeChanged.bind(this),U(A.binaryViewType));for(const e of this.binaryViewObjects)this.binaryViewTypeCombobox.addOption(this.binaryViewTypeCombobox.createOption(e.label,e.type));this.toolbar.appendToolbarItem(this.binaryViewTypeCombobox);const a=new o.Toolbar.ToolbarButton(U(A.copyToClipboard),"copy");a.addEventListener("Click",(e=>{this.copySelectedViewToClipboard()}),this),this.toolbar.appendToolbarItem(a),this.copiedText=new o.Toolbar.ToolbarText,this.copiedText.element.classList.add("binary-view-copied-text"),this.toolbar.element.appendChild(this.copiedText.element),this.addFadeoutSettimeoutId=null,this.lastView=null,this.updateView()}getCurrentViewObject(){const e=this.binaryViewObjects.find((e=>e.type===this.binaryViewTypeSetting.get()));return console.assert(Boolean(e),`No binary view found for binary view type found in setting 'binary-view-type': ${this.binaryViewTypeSetting.get()}`),e||null}async copySelectedViewToClipboard(){const e=this.getCurrentViewObject();e&&(t.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(await e.content()),this.copiedText.setText(e.copiedMessage),this.copiedText.element.classList.remove("fadeout"),this.addFadeoutSettimeoutId&&(clearTimeout(this.addFadeoutSettimeoutId),this.addFadeoutSettimeoutId=null),this.addFadeoutSettimeoutId=window.setTimeout(function(){this.copiedText.element.classList.add("fadeout")}.bind(this),2e3))}wasShown(){this.updateView(),this.registerCSSFiles([E])}updateView(){const e=this.getCurrentViewObject();if(!e)return;const t=e.getView();t!==this.lastView&&(this.lastView&&this.lastView.detach(),this.lastView=t,t.show(this.element,this.toolbar.element),this.binaryViewTypeCombobox.selectElement().value=this.binaryViewTypeSetting.get())}binaryViewTypeChanged(){const e=this.binaryViewTypeCombobox.selectedOption();if(!e)return;const t=e.value;this.binaryViewTypeSetting.get()!==t&&(this.binaryViewTypeSetting.set(t),this.updateView())}addCopyToContextMenu(e,i){const r=e.clipboardSection().appendSubMenuItem(i,!1,"copy").footerSection();r.appendItem(U(A.copyAsBase),(async()=>{const e=this.binaryResourceViewFactory.base64();t.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e)}),{jslogContext:"copy-as-base"}),r.appendItem(U(A.copyAsHex),(async()=>{const e=await this.binaryResourceViewFactory.hex();t.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e)}),{jslogContext:"copy-as-hex"}),r.appendItem(U(A.copyAsUtf),(async()=>{const e=await this.binaryResourceViewFactory.utf8();t.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(e)}),{jslogContext:"copy-as-utf"})}}class V{type;label;copiedMessage;content;createViewFn;view;constructor(e,t,i,r,o){this.type=e,this.label=t,this.copiedMessage=i,this.content=o,this.createViewFn=r,this.view=null}getView(){return this.view||(this.view=this.createViewFn()),this.view}}var O=Object.freeze({__proto__:null,BinaryResourceView:N,BinaryViewObject:V});const W=new CSSStyleSheet;W.replaceSync(".list{border:none!important;border-top:1px solid var(--sys-color-divider)!important}.blocking-disabled{opacity:80%}.editor-container{padding:0 4px}.no-blocked-urls,\n.blocked-urls{overflow-x:hidden;overflow-y:auto}.no-blocked-urls{display:flex;justify-content:center;padding:10px;& devtools-button{display:flex;justify-content:center;margin-top:var(--sys-size-8)}}.no-blocked-urls > span{white-space:pre}.blocked-url{display:flex;flex-direction:row;align-items:center;flex:auto}.blocked-url-count{flex:none;padding-right:9px}.blocked-url-checkbox{margin-left:8px;flex:none}.blocked-url-checkbox:focus{outline:auto 5px -webkit-focus-ring-color}.blocked-url-label{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:auto;padding:0 3px}.blocked-url-edit-row{flex:none;display:flex;flex-direction:row;margin:7px 5px 0;align-items:center}.blocked-url-edit-value{user-select:none;flex:1 1 0}.blocked-url-edit-row input{width:100%;text-align:inherit;height:22px}\n/*# sourceURL=blockedURLsPane.css */\n");const D={enableNetworkRequestBlocking:"Enable network request blocking",addPattern:"Add pattern",addNetworkRequestBlockingPattern:"Add network request blocking pattern",networkRequestsAreNotBlockedS:"Network requests are not blocked. {PH1}",dBlocked:"{PH1} blocked",textPatternToBlockMatching:"Text pattern to block matching requests; use * for wildcard",patternInputCannotBeEmpty:"Pattern input cannot be empty.",patternAlreadyExists:"Pattern already exists.",itemDeleted:"Item successfully deleted"},j=i.i18n.registerUIStrings("panels/network/BlockedURLsPane.ts",D),G=i.i18n.getLocalizedString.bind(void 0,j);class z extends o.Widget.VBox{manager;toolbar;enabledCheckbox;list;editor;blockedCountForUrl;constructor(){super(!0),this.element.setAttribute("jslog",`${l.panel("network.blocked-urls").track({resize:!0})}`),this.manager=n.NetworkManager.MultitargetNetworkManager.instance(),this.manager.addEventListener("BlockedPatternsChanged",this.update,this),this.toolbar=new o.Toolbar.Toolbar("",this.contentElement),this.enabledCheckbox=new o.Toolbar.ToolbarCheckbox(G(D.enableNetworkRequestBlocking),void 0,this.toggleEnabled.bind(this),"network.enable-request-blocking"),this.toolbar.appendToolbarItem(this.enabledCheckbox),this.toolbar.appendSeparator(),this.toolbar.appendToolbarItem(o.Toolbar.Toolbar.createActionButtonForId("network.add-network-request-blocking-pattern")),this.toolbar.appendToolbarItem(o.Toolbar.Toolbar.createActionButtonForId("network.remove-all-network-request-blocking-patterns")),this.toolbar.element.setAttribute("jslog",`${l.toolbar()}`),this.list=new o.ListWidget.ListWidget(this),this.list.element.classList.add("blocked-urls"),this.list.setEmptyPlaceholder(this.createEmptyPlaceholder()),this.list.show(this.contentElement),this.editor=null,this.blockedCountForUrl=new Map,n.TargetManager.TargetManager.instance().addModelListener(n.NetworkManager.NetworkManager,n.NetworkManager.Events.RequestFinished,this.onRequestFinished,this,{scoped:!0}),this.update(),a.NetworkLog.NetworkLog.instance().addEventListener(a.NetworkLog.Events.Reset,this.onNetworkLogReset,this)}createEmptyPlaceholder(){const e=this.contentElement.createChild("div","no-blocked-urls"),t=o.UIUtils.createTextButton(G(D.addPattern),this.addPattern.bind(this),{className:"add-button",jslogContext:"network.add-network-request-blocking-pattern",variant:"primary"});return o.ARIAUtils.setLabel(t,G(D.addNetworkRequestBlockingPattern)),e.appendChild(i.i18n.getFormatLocalizedString(j,D.networkRequestsAreNotBlockedS,{PH1:t})),e}addPattern(){this.manager.setBlockingEnabled(!0),this.list.addNewItem(0,{url:s.DevToolsPath.EmptyUrlString,enabled:!0})}removeAllPatterns(){this.manager.setBlockedPatterns([])}renderItem(e,t){const i=this.blockedRequestsCount(e.url),r=document.createElement("div");r.classList.add("blocked-url");const o=r.createChild("input","blocked-url-checkbox");return o.type="checkbox",o.checked=e.enabled,o.disabled=!t,o.setAttribute("jslog",`${l.toggle().track({change:!0})}`),r.createChild("div","blocked-url-label").textContent=e.url,r.createChild("div","blocked-url-count").textContent=G(D.dBlocked,{PH1:i}),t&&(r.addEventListener("click",(t=>this.togglePattern(e,t))),o.addEventListener("click",(t=>this.togglePattern(e,t)))),r}togglePattern(e,t){t.consume(!0);const i=this.manager.blockedPatterns();i.splice(i.indexOf(e),1,{enabled:!e.enabled,url:e.url}),this.manager.setBlockedPatterns(i)}toggleEnabled(){this.manager.setBlockingEnabled(!this.manager.blockingEnabled()),this.update()}removeItemRequested(e,t){const i=this.manager.blockedPatterns();i.splice(t,1),this.manager.setBlockedPatterns(i),o.ARIAUtils.alert(D.itemDeleted)}beginEdit(e){return this.editor=this.createEditor(),this.editor.control("url").value=e.url,this.editor}commitEdit(e,t,i){const r=t.control("url").value,o=this.manager.blockedPatterns();i?o.push({enabled:!0,url:r}):o.splice(o.indexOf(e),1,{enabled:!0,url:r}),this.manager.setBlockedPatterns(o)}createEditor(){if(this.editor)return this.editor;const e=new o.ListWidget.Editor,t=e.contentElement();t.createChild("div","blocked-url-edit-row").createChild("div").textContent=G(D.textPatternToBlockMatching);const i=t.createChild("div","blocked-url-edit-row"),r=e.createInput("url","text","",((e,t,i)=>{let r,o=!0;return i.value?this.manager.blockedPatterns().find((e=>e.url===i.value))&&(r=G(D.patternAlreadyExists),o=!1):(r=G(D.patternInputCannotBeEmpty),o=!1),{valid:o,errorMessage:r}}));return i.createChild("div","blocked-url-edit-value").appendChild(r),e}update(){const e=this.manager.blockingEnabled();this.list.element.classList.toggle("blocking-disabled",!e&&Boolean(this.manager.blockedPatterns().length)),this.enabledCheckbox.setChecked(e),this.list.clear();for(const t of this.manager.blockedPatterns())this.list.appendItem(t,e)}blockedRequestsCount(e){if(!e)return 0;let t=0;for(const i of this.blockedCountForUrl.keys())this.matches(e,i)&&(t+=this.blockedCountForUrl.get(i));return t}matches(e,t){let i=0;const r=e.split("*");for(let e=0;ethis.dataGrid.insertChild(new Z(e))))}}class Z extends d.SortableDataGrid.SortableDataGridNode{message;constructor(e){const t=new Date(1e3*e.time),i=("0"+t.getHours()).substr(-2)+":"+("0"+t.getMinutes()).substr(-2)+":"+("0"+t.getSeconds()).substr(-2)+"."+("00"+t.getMilliseconds()).substr(-3),r=document.createElement("div");o.UIUtils.createTextChild(r,i),o.Tooltip.Tooltip.install(r,t.toLocaleString()),super({id:e.eventId,type:e.eventName,data:e.data,time:r}),this.message=e}}function Q(e,t,i){const r=e(t.message),o=e(i.message);return ro?1:0}const ee={id:Q.bind(null,(e=>e.eventId)),type:Q.bind(null,(e=>e.eventName)),time:Q.bind(null,(e=>e.time))},te=new WeakMap;var ie=Object.freeze({__proto__:null,EventSourceMessagesView:J,EventSourceMessageNode:Z,Comparators:ee});const re=new CSSStyleSheet;re.replaceSync('.network-config{padding:12px;display:block}.network-config-group{display:flex;padding-bottom:10px;flex-wrap:wrap;flex:0 0 auto;min-height:30px}.network-config-title{margin-right:16px;width:130px}.network-config-fields{flex:2 0 200px}.network-config-fields span:first-of-type,\n.network-config-fields .network-config-accepted-encoding-custom{padding:3px 0}.panel-section-separator{height:1px;margin-bottom:10px;background:var(--sys-color-divider)}.network-config-disable-cache{line-height:28px;border-top:none;padding-top:0}.network-config-input-validation-error{color:var(--sys-color-error);margin:5px 0}.network-config-input-validation-error:empty{display:none}.network-config-throttling .chrome-select{width:100%;max-width:250px}.network-config-throttling > .network-config-title{line-height:24px}.network-config-ua > .network-config-title{line-height:20px}.network-config-ua span[is="dt-radio"].checked > *{display:none}.network-config-ua input{display:block;width:calc(100% - 20px)}.network-config-ua input[type="text"],\n.network-config-ua .chrome-select{margin-top:8px}.network-config-ua .chrome-select{width:calc(100% - 20px);max-width:250px}.network-config-ua span[is="dt-radio"]{display:block}.network-config-ua-custom{opacity:50%;padding-bottom:8px}.network-config-ua-custom.checked{opacity:100%}.client-hints-form{margin-top:14px;width:min(100%,400px)}.status-text{padding:10px;color:var(--sys-color-tertiary)}\n/*# sourceURL=networkConfigView.css */\n');const oe={custom:"Custom...",enterACustomUserAgent:"Enter a custom user agent",customUserAgentFieldIsRequired:"Custom user agent field is required",caching:"Caching",disableCache:"Disable cache",networkThrottling:"Network throttling",userAgent:"User agent",selectAutomatically:"Use browser default",acceptedEncoding:"Accepted `Content-Encoding`s",clientHintsStatusText:"User agent updated.",networkConditionsPanelShown:"Network conditions shown"},se=i.i18n.registerUIStrings("panels/network/NetworkConfigView.ts",oe),ne=i.i18n.getLocalizedString.bind(void 0,se);let ae;class le extends o.Widget.VBox{constructor(){super(!0),this.element.setAttribute("jslog",`${l.panel("network-conditions").track({resize:!0})}`),this.contentElement.classList.add("network-config"),this.createCacheSection(),this.contentElement.createChild("div").classList.add("panel-section-separator"),this.createNetworkThrottlingSection(),this.contentElement.createChild("div").classList.add("panel-section-separator"),this.createUserAgentSection(),this.contentElement.createChild("div").classList.add("panel-section-separator"),this.createAcceptedEncodingSection()}static instance(e={forceNew:null}){const{forceNew:t}=e;return ae&&!t||(ae=new le),ae}static createUserAgentSelectAndInput(t){const i=e.Settings.Settings.instance().createSetting("custom-user-agent",""),r=e.Settings.Settings.instance().createSetting("custom-user-agent-metadata",null),a=document.createElement("select");a.setAttribute("jslog",`${l.dropDown().track({change:!0}).context(i.name)}`),o.ARIAUtils.setLabel(a,t);const d={title:ne(oe.custom),value:"custom"};a.appendChild(o.UIUtils.createOption(d.title,d.value,"custom"));for(const e of ce){const t=a.createChild("optgroup");t.label=e.title;for(const i of e.values){const e=n.NetworkManager.MultitargetNetworkManager.patchUserAgentWithChromeVersion(i.value);t.appendChild(o.UIUtils.createOption(i.title,e,s.StringUtilities.toKebabCase(i.title)))}}a.selectedIndex=0;const c=o.UIUtils.createInput("","text");c.setAttribute("jslog",`${l.textField().track({change:!0}).context(i.name)}`),c.value=i.get(),o.Tooltip.Tooltip.install(c,i.get()),c.placeholder=ne(oe.enterACustomUserAgent),c.required=!0,o.ARIAUtils.setLabel(c,c.placeholder);const h=document.createElement("div");function u(){const e=i.get(),t=a.options;let r=!1;for(let i=0;i{if(l.checked)return;const e=i.get(),t=de(e);n.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(e,t)}));const d=s.createChild("div","network-config-ua-custom");l.addEventListener("change",k);const c=le.createUserAgentSelectAndInput(r);c.select.classList.add("chrome-select"),d.appendChild(c.select),d.appendChild(c.input),d.appendChild(c.error);const u=d.createChild("div","client-hints-form"),p=new h.UserAgentClientHintsForm.UserAgentClientHintsForm,g=t.get(),m=de(c.select.value);p.value={showMobileCheckbox:!0,showSubmitButton:!0,metaData:g||m||void 0},u.appendChild(p),c.select.addEventListener("user-agent-change",(e=>{const t=e.detail.value,i=t?de(t):null;p.value={metaData:i||void 0,showMobileCheckbox:!0,showSubmitButton:!0},w.textContent=""})),p.addEventListener("clienthintschange",(()=>{c.select.value="custom",w.textContent=""})),p.addEventListener("clienthintssubmit",(e=>{const r=e.detail.value,o=i.get();t.set(r),n.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(o,r),w.textContent=ne(oe.clientHintsStatusText)}));const w=s.createChild("span","status-text");function k(){const e=!l.checked;d.classList.toggle("checked",e),c.select.disabled=!e,c.input.disabled=!e,c.error.hidden=!e,p.disabled=!e;const t=e?i.get():"",r=e?de(t):null;n.NetworkManager.MultitargetNetworkManager.instance().setCustomUserAgentOverride(t,r)}w.textContent="",k()}createAcceptedEncodingSection(){const t=e.Settings.Settings.instance().createSetting("use-custom-accepted-encodings",!1),i=e.Settings.Settings.instance().createSetting("custom-accepted-encodings","gzip,br,deflate"),r=ne(oe.acceptedEncoding),s=this.createSection(r,"network-config-accepted-encoding"),a=o.UIUtils.CheckboxLabel.create(ne(oe.selectAutomatically),!0,void 0,t.name);s.appendChild(a);const d=a.checkboxElement;function c(){t.get()?n.NetworkManager.MultitargetNetworkManager.instance().setCustomAcceptedEncodingsOverride(""===i.get()?[]:i.get().split(",")):n.NetworkManager.MultitargetNetworkManager.instance().clearCustomAcceptedEncodingsOverride()}i.addChangeListener(c),t.addChangeListener(c);const h=s.createChild("div","network-config-accepted-encoding-custom");h.setAttribute("jslog",`${l.section().context(i.name)}`),d.checked=!t.get(),d.addEventListener("change",g);const u=new Map,p={Deflate:"deflate",Gzip:"gzip",Br:"br",Zstd:"zstd"};for(const e of Object.values(p)){const t=o.UIUtils.CheckboxLabel.create(e,!0,void 0,e);h.appendChild(t),u.set(e,t.checkboxElement)}for(const[e,t]of u)t.checked=i.get().includes(e),t.addEventListener("change",g);function g(){t.set(!d.checked);const e=[];for(const[t,i]of u)i.disabled=d.checked,i.checked&&e.push(t);i.set(e.join(","))}g()}wasShown(){super.wasShown(),this.registerCSSFiles([re]),o.ARIAUtils.alert(ne(oe.networkConditionsPanelShown))}}function de(e){for(const t of ce)for(const i of t.values)if(e===n.NetworkManager.MultitargetNetworkManager.patchUserAgentWithChromeVersion(i.value))return i.metadata?(n.NetworkManager.MultitargetNetworkManager.patchUserAgentMetadataWithChromeVersion(i.metadata),i.metadata):null;return null}const ce=[{title:"Android",values:[{title:"Android (4.0.2) Browser — Galaxy Nexus",value:"Mozilla/5.0 (Linux; U; Android 4.0.2; en-us; Galaxy Nexus Build/ICL53F) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"4.0.2",architecture:"",model:"Galaxy Nexus",mobile:!0}},{title:"Android (2.3) Browser — Nexus S",value:"Mozilla/5.0 (Linux; U; Android 2.3.6; en-us; Nexus S Build/GRK39F) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"2.3.6",architecture:"",model:"Nexus S",mobile:!0}}]},{title:"BlackBerry",values:[{title:"BlackBerry — BB10",value:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.1+ (KHTML, like Gecko) Version/10.0.0.1337 Mobile Safari/537.1+",metadata:null},{title:"BlackBerry — PlayBook 2.1",value:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML, like Gecko) Version/7.2.1.0 Safari/536.2+",metadata:null},{title:"BlackBerry — 9900",value:"Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/7.0.0.187 Mobile Safari/534.11+",metadata:null}]},{title:"Chrome",values:[{title:"Chrome — Android Mobile",value:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"6.0",architecture:"",model:"Nexus 5",mobile:!0}},{title:"Chrome — Android Mobile (high-end)",value:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"10",architecture:"",model:"Pixel 4",mobile:!0}},{title:"Chrome — Android Tablet",value:"Mozilla/5.0 (Linux; Android 4.3; Nexus 7 Build/JSS15Q) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"4.3",architecture:"",model:"Nexus 7",mobile:!0}},{title:"Chrome — iPhone",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/%s Mobile/15E148 Safari/604.1",metadata:null},{title:"Chrome — iPad",value:"Mozilla/5.0 (iPad; CPU OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/%s Mobile/15E148 Safari/604.1",metadata:null},{title:"Chrome — Chrome OS",value:"Mozilla/5.0 (X11; CrOS x86_64 10066.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Chrome OS",platformVersion:"10066.0.0",architecture:"x86",model:"",mobile:!1}},{title:"Chrome — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"macOS",platformVersion:"10_14_6",architecture:"x86",model:"",mobile:!1}},{title:"Chrome — Windows",value:"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Google Chrome",version:"%s"}],fullVersion:"%s",platform:"Windows",platformVersion:"10.0",architecture:"x86",model:"",mobile:!1}}]},{title:"Firefox",values:[{title:"Firefox — Android Mobile",value:"Mozilla/5.0 (Android 4.4; Mobile; rv:70.0) Gecko/70.0 Firefox/70.0",metadata:null},{title:"Firefox — Android Tablet",value:"Mozilla/5.0 (Android 4.4; Tablet; rv:70.0) Gecko/70.0 Firefox/70.0",metadata:null},{title:"Firefox — iPhone",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",metadata:null},{title:"Firefox — iPad",value:"Mozilla/5.0 (iPad; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) FxiOS/1.0 Mobile/12F69 Safari/600.1.4",metadata:null},{title:"Firefox — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:70.0) Gecko/20100101 Firefox/70.0",metadata:null},{title:"Firefox — Windows",value:"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:70.0) Gecko/20100101 Firefox/70.0",metadata:null}]},{title:"Googlebot",values:[{title:"Googlebot",value:"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",metadata:null},{title:"Googlebot Desktop",value:"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/%s Safari/537.36",metadata:null},{title:"Googlebot Smartphone",value:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",metadata:null}]},{title:"Internet Explorer",values:[{title:"Internet Explorer 11",value:"Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko",metadata:null},{title:"Internet Explorer 10",value:"Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)",metadata:null},{title:"Internet Explorer 9",value:"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)",metadata:null},{title:"Internet Explorer 8",value:"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)",metadata:null},{title:"Internet Explorer 7",value:"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)",metadata:null}]},{title:"Microsoft Edge",values:[{title:"Microsoft Edge (Chromium) — Windows",value:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/%s Safari/537.36 Edg/%s",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"Windows",platformVersion:"10.0",architecture:"x86",model:"",mobile:!1}},{title:"Microsoft Edge (Chromium) — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Chrome/%s Safari/604.1 Edg/%s",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"macOS",platformVersion:"10_14_6",architecture:"x86",model:"",mobile:!1}},{title:"Microsoft Edge — iPhone",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 EdgiOS/44.5.0.10 Mobile/15E148 Safari/604.1",metadata:null},{title:"Microsoft Edge — iPad",value:"Mozilla/5.0 (iPad; CPU OS 12_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 EdgiOS/44.5.2 Mobile/15E148 Safari/605.1.15",metadata:null},{title:"Microsoft Edge — Android Mobile",value:"Mozilla/5.0 (Linux; Android 8.1.0; Pixel Build/OPM4.171019.021.D1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36 EdgA/42.0.0.2057",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"8.1.0",architecture:"",model:"Pixel",mobile:!0}},{title:"Microsoft Edge — Android Tablet",value:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Safari/537.36 EdgA/42.0.0.2057",metadata:{brands:[{brand:"Not A;Brand",version:"99"},{brand:"Chromium",version:"%s"},{brand:"Microsoft Edge",version:"%s"}],fullVersion:"%s",platform:"Android",platformVersion:"6.0.1",architecture:"",model:"Nexus 7",mobile:!0}},{title:"Microsoft Edge (EdgeHTML) — Windows",value:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19042",metadata:null},{title:"Microsoft Edge (EdgeHTML) — XBox",value:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; Xbox; Xbox One) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19041",metadata:null}]},{title:"Opera",values:[{title:"Opera — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36 OPR/65.0.3467.48",metadata:null},{title:"Opera — Windows",value:"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36 OPR/65.0.3467.48",metadata:null},{title:"Opera (Presto) — Mac",value:"Opera/9.80 (Macintosh; Intel Mac OS X 10.9.1) Presto/2.12.388 Version/12.16",metadata:null},{title:"Opera (Presto) — Windows",value:"Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16",metadata:null},{title:"Opera Mobile — Android Mobile",value:"Opera/12.02 (Android 4.1; Linux; Opera Mobi/ADR-1111101157; U; en-US) Presto/2.9.201 Version/12.02",metadata:null},{title:"Opera Mini — iOS",value:"Opera/9.80 (iPhone; Opera Mini/8.0.0/34.2336; U; en) Presto/2.8.119 Version/11.10",metadata:null}]},{title:"Safari",values:[{title:"Safari — iPad iOS 13.2",value:"Mozilla/5.0 (iPad; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",metadata:null},{title:"Safari — iPhone iOS 13.2",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",metadata:null},{title:"Safari — Mac",value:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Safari/605.1.15",metadata:null}]},{title:"UC Browser",values:[{title:"UC Browser — Android Mobile",value:"Mozilla/5.0 (Linux; U; Android 8.1.0; en-US; Nexus 6P Build/OPM7.181205.001) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/12.11.1.1197 Mobile Safari/537.36",metadata:null},{title:"UC Browser — iOS",value:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/16B92 UCBrowser/12.1.7.1109 Mobile AliApp(TUnionSDK/0.1.20.3)",metadata:null},{title:"UC Browser — Windows Phone",value:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 920) UCBrowser/10.1.0.563 Mobile",metadata:null}]}];var he=Object.freeze({__proto__:null,NetworkConfigView:le,userAgentGroups:ce});const ue={redirect:"Redirect",sPreflight:"{PH1} + Preflight",preflight:"Preflight",selectPreflightRequest:"Select preflight request",failed:"(failed)",data:"(data)",canceled:"(canceled)",other:"other",csp:"csp",origin:"origin",devtools:"devtools",blockeds:"(blocked:{PH1})",blockedTooltip:"This request was blocked due to misconfigured response headers, click to view the headers",corsError:"CORS error",crossoriginResourceSharingErrorS:"Cross-Origin Resource Sharing error: {PH1}",finished:"Finished",pendingq:"(pending)",unknown:"(unknown)",unknownExplanation:"The request status cannot be shown here because the page that issued it unloaded while the request was in flight. You can use chrome://net-export to capture a network log and see all request details.",push:"Push / ",parser:"Parser",script:"Script",preload:"Preload",earlyHints:"early-hints",signedexchange:"signed-exchange",selectTheRequestThatTriggered:"Select the request that triggered this preflight",otherC:"Other",memoryCache:"(memory cache)",servedFromMemoryCacheResource:"Served from memory cache, resource size: {PH1}",serviceWorker:"(`ServiceWorker`)",servedFromServiceWorkerResource:"Served from `ServiceWorker`, resource size: {PH1}",servedFromSignedHttpExchange:"Served from Signed HTTP Exchange, resource size: {PH1}",servedFromWebBundle:"Served from Web Bundle, resource size: {PH1}",prefetchCache:"(prefetch cache)",servedFromPrefetchCacheResource:"Served from prefetch cache, resource size: {PH1}",diskCache:"(disk cache)",servedFromDiskCacheResourceSizeS:"Served from disk cache, resource size: {PH1}",matchedToServiceWorkerRouter:"Matched to `ServiceWorker router`#{PH1}, resource size: {PH2}",matchedToServiceWorkerRouterWithNetworkSource:"Matched to `ServiceWorker router`#{PH1}, {PH2} transferred over network, resource size: {PH3}",pending:"Pending",level:"level 1",webBundleError:"Web Bundle error",webBundleInnerRequest:"Served from Web Bundle",webBundle:"(Web Bundle)",timeSubtitleTooltipText:"Latency (response received time - start time)",alternativeJobWonWithoutRace:"`Chrome` used a `HTTP/3` connection induced by an '`Alt-Svc`' header without racing against establishing a connection using a different `HTTP` version.",alternativeJobWonRace:"`Chrome` used a `HTTP/3` connection induced by an '`Alt-Svc`' header because it won a race against establishing a connection using a different `HTTP` version.",mainJobWonRace:"`Chrome` used this protocol because it won a race against establishing a `HTTP/3` connection.",mappingMissing:"`Chrome` did not use an alternative `HTTP` version because no alternative protocol information was available when the request was issued, but an '`Alt-Svc`' header was present in the response.",broken:"`Chrome` did not try to establish a `HTTP/3` connection because it was marked as broken.",dnsAlpnH3JobWonWithoutRace:"`Chrome` used a `HTTP/3` connection due to the `DNS record` indicating `HTTP/3` support. There was no race against establishing a connection using a different `HTTP` version.",dnsAlpnH3JobWonRace:"`Chrome` used a `HTTP/3` connection due to the `DNS record` indicating `HTTP/3` support, which won a race against establishing a connection using a different `HTTP` version.",requestContentHeadersOverridden:"Both request content and headers are overridden",requestContentOverridden:"Request content is overridden",requestHeadersOverridden:"Request headers are overridden",initialPriorityToolTip:"{PH1}, Initial priority: {PH2}",thirdPartyPhaseout:"Cookies for this request are blocked due to third-party cookie phaseout. Learn more in the Issues tab."},pe=i.i18n.registerUIStrings("panels/network/NetworkDataGridNode.ts",ue),ge=i.i18n.getLocalizedString.bind(void 0,pe);class me extends d.SortableDataGrid.SortableDataGridNode{parentViewInternal;isHovered;showingInitiatorChainInternal;requestOrFirstKnownChildRequestInternal;constructor(e){super({}),this.parentViewInternal=e,this.isHovered=!1,this.showingInitiatorChainInternal=!1,this.requestOrFirstKnownChildRequestInternal=null}displayName(){return""}displayType(){return""}createCell(e){const t=this.createTD(e);return this.renderCell(t,e),t}renderCell(e,t){}isFailed(){return!1}backgroundColor(){const e=we,t=document.hasFocus(),i=this.dataGrid&&this.dataGrid.element===document.activeElement,r=this.isFailed();return this.selected&&t&&i&&r?e.FocusSelectedHasError:this.selected&&t&&i?e.FocusSelected:this.selected?e.Selected:this.hovered()?e.Hovered:this.isOnInitiatorPath()?e.InitiatorPath:this.isOnInitiatedPath()?e.InitiatedPath:this.isStriped()?e.Stripe:e.Default}updateBackgroundColor(){const e=this.existingElement();e&&(e.style.backgroundColor=`var(${this.backgroundColor()})`,this.parentViewInternal.stylesChanged())}setStriped(e){super.setStriped(e),this.updateBackgroundColor()}select(e){super.select(e),this.updateBackgroundColor(),this.parentViewInternal.updateNodeSelectedClass(!0)}deselect(e){super.deselect(e),this.updateBackgroundColor(),this.parentViewInternal.updateNodeSelectedClass(!1)}parentView(){return this.parentViewInternal}hovered(){return this.isHovered}showingInitiatorChain(){return this.showingInitiatorChainInternal}nodeSelfHeight(){return this.parentViewInternal.rowHeight()}setHovered(e,t){this.isHovered===e&&this.showingInitiatorChainInternal===t||(this.isHovered!==e&&(this.isHovered=e,this.attached()&&this.element().classList.toggle("hover",e)),this.showingInitiatorChainInternal!==t&&(this.showingInitiatorChainInternal=t,this.showingInitiatorChainChanged()),this.parentViewInternal.stylesChanged(),this.updateBackgroundColor())}showingInitiatorChainChanged(){}isOnInitiatorPath(){return!1}isOnInitiatedPath(){return!1}request(){return null}isNavigationRequest(){return!1}clearFlatNodes(){super.clearFlatNodes(),this.requestOrFirstKnownChildRequestInternal=null}requestOrFirstKnownChildRequest(){if(this.requestOrFirstKnownChildRequestInternal)return this.requestOrFirstKnownChildRequestInternal;let e=this.request();if(e||!this.hasChildren())return this.requestOrFirstKnownChildRequestInternal=e,this.requestOrFirstKnownChildRequestInternal;let t=null;const i=this.flatChildren();for(let r=0;rs?1:s>o?-1:i.identityCompare(r)}static SizeComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();return i&&r?r.cached()&&!i.cached()?1:i.cached()&&!r.cached()?-1:i.transferSize-r.transferSize||i.resourceSize-r.resourceSize||i.identityCompare(r):i?1:-1}static TypeComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=e.displayType(),s=t.displayType();return o>s?1:s>o?-1:i.identityCompare(r)}static InitiatorComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=e instanceof ke&&e.initiatorCell,s=t instanceof ke&&t.initiatorCell;if(!o||!s)return o?1:-1;const n=e,a=t,l=n.linkifiedInitiatorAnchor?n.linkifiedInitiatorAnchor.textContent||"":n.initiatorCell.title,d=a.linkifiedInitiatorAnchor?a.linkifiedInitiatorAnchor.textContent||"":a.initiatorCell.title;return l.localeCompare(d)}static InitiatorAddressSpaceComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=i.clientSecurityState(),s=r.clientSecurityState();return o&&s?o.initiatorIPAddressSpace.localeCompare(s.initiatorIPAddressSpace):o?1:-1}static RemoteAddressSpaceComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();return i&&r?i.remoteAddressSpace().localeCompare(r.remoteAddressSpace()):i?1:-1}static RequestCookiesCountComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;return i.includedRequestCookies().length-r.includedRequestCookies().length||i.identityCompare(r)}static ResponseCookiesCountComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;return(i.responseCookies?i.responseCookies.length:0)-(r.responseCookies?r.responseCookies.length:0)||i.identityCompare(r)}static PriorityComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=i.priority();let s=o?w.NetworkPriorities.networkPriorityWeight(o):0;s=s||0;const n=r.priority();let a=n?w.NetworkPriorities.networkPriorityWeight(n):0;return a=a||0,s-a||i.identityCompare(r)}static RequestPropertyComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=r[e],n=o[e];return s===n?r.identityCompare(o):s>n?1:-1}static RequestURLComparator(e,t){const i=e.requestOrFirstKnownChildRequest(),r=t.requestOrFirstKnownChildRequest();if(!i||!r)return i?1:-1;const o=i.url(),s=r.url();return o===s?i.identityCompare(r):o>s?1:-1}static ResponseHeaderStringComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=String(r.responseHeaderValue(e)||""),n=String(o.responseHeaderValue(e)||"");return s.localeCompare(n)||r.identityCompare(o)}static ResponseHeaderNumberComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=r.responseHeaderValue(e),n=void 0!==s?parseFloat(s):-1/0,a=o.responseHeaderValue(e),l=void 0!==a?parseFloat(a):-1/0;return n===l?r.identityCompare(o):n>l?1:-1}static ResponseHeaderDateComparator(e,t,i){const r=t.requestOrFirstKnownChildRequest(),o=i.requestOrFirstKnownChildRequest();if(!r||!o)return r?1:-1;const s=r.responseHeaderValue(e),n=o.responseHeaderValue(e),a=s?new Date(s).getTime():-1/0,l=n?new Date(n).getTime():-1/0;return a===l?r.identityCompare(o):a>l?1:-1}showingInitiatorChainChanged(){const e=this.showingInitiatorChain(),t=a.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(this.requestInternal);for(const i of t.initiators){if(i===this.requestInternal)continue;const t=this.parentView().nodeForRequest(i);t&&t.setIsOnInitiatorPath(e)}for(const i of t.initiated.keys()){if(i===this.requestInternal)continue;const t=this.parentView().nodeForRequest(i);t&&t.setIsOnInitiatedPath(e)}}setIsOnInitiatorPath(e){this.isOnInitiatorPathInternal!==e&&this.attached()&&(this.isOnInitiatorPathInternal=e,this.updateBackgroundColor())}isOnInitiatorPath(){return this.isOnInitiatorPathInternal}setIsOnInitiatedPath(e){this.isOnInitiatedPathInternal!==e&&this.attached()&&(this.isOnInitiatedPathInternal=e,this.updateBackgroundColor())}isOnInitiatedPath(){return this.isOnInitiatedPathInternal}displayType(){const t=this.requestInternal.mimeType||this.requestInternal.requestContentType()||"",i=this.requestInternal.resourceType();let r=i.name();return this.requestInternal.fromEarlyHints()?ge(ue.earlyHints):(i!==e.ResourceType.resourceTypes.Other&&i!==e.ResourceType.resourceTypes.Image||(r=t.replace(/^(application|image)\//,"")),this.requestInternal.isRedirect()&&(r+=" / "+ge(ue.redirect)),r)}displayName(){return this.requestInternal.name()}request(){return this.requestInternal}isNavigationRequest(){const e=n.PageLoad.PageLoad.forRequest(this.requestInternal);return!!e&&e.mainRequest===this.requestInternal}nodeSelfHeight(){return this.parentView().rowHeight()}createCells(e){this.nameCell=null,this.initiatorCell=null,e.classList.toggle("network-error-row",this.isFailed()),e.classList.toggle("network-navigation-row",this.isNavigationRequestInternal),super.createCells(e),this.updateBackgroundColor()}setTextAndTitle(e,t,i){o.UIUtils.createTextChild(e,t),o.Tooltip.Tooltip.install(e,i||t)}setTextAndTitleAsLink(e,t,i,r){const s=document.createElement("span");s.classList.add("devtools-link"),s.textContent=t,s.addEventListener("click",r),e.appendChild(s),o.Tooltip.Tooltip.install(e,i)}renderCell(e,t){const i=e;switch(t){case"name":this.renderPrimaryCell(i,t);break;case"path":this.renderPrimaryCell(i,t,this.requestInternal.pathname);break;case"url":this.renderPrimaryCell(i,t,this.requestInternal.url());break;case"method":{const e=this.requestInternal.preflightRequest();e?(this.setTextAndTitle(i,`${this.requestInternal.requestMethod} + `,ge(ue.sPreflight,{PH1:this.requestInternal.requestMethod})),i.appendChild(k.Linkifier.Linkifier.linkifyRevealable(e,ge(ue.preflight),void 0,ge(ue.selectPreflightRequest),void 0,"preflight-request"))):this.setTextAndTitle(i,this.requestInternal.requestMethod);break}case"status":this.renderStatusCell(i);break;case"protocol":this.renderProtocolCell(i);break;case"scheme":this.setTextAndTitle(i,this.requestInternal.scheme);break;case"domain":this.setTextAndTitle(i,this.requestInternal.domain);break;case"remote-address":this.setTextAndTitle(i,this.requestInternal.remoteAddress());break;case"remote-address-space":this.renderAddressSpaceCell(i,this.requestInternal.remoteAddressSpace());break;case"cookies":this.setTextAndTitle(i,this.arrayLength(this.requestInternal.includedRequestCookies()));break;case"set-cookies":this.setTextAndTitle(i,this.arrayLength(this.requestInternal.nonBlockedResponseCookies()));break;case"priority":{const e=this.requestInternal.priority(),t=this.requestInternal.initialPriority();e&&t?this.setTextAndTitle(i,w.NetworkPriorities.uiLabelForNetworkPriority(e),ge(ue.initialPriorityToolTip,{PH1:w.NetworkPriorities.uiLabelForNetworkPriority(e),PH2:w.NetworkPriorities.uiLabelForNetworkPriority(t)})):this.setTextAndTitle(i,e?w.NetworkPriorities.uiLabelForNetworkPriority(e):""),this.appendSubtitle(i,t?w.NetworkPriorities.uiLabelForNetworkPriority(t):"");break}case"connection-id":this.setTextAndTitle(i,"0"===this.requestInternal.connectionId?"":this.requestInternal.connectionId);break;case"type":this.setTextAndTitle(i,this.displayType());break;case"initiator":this.renderInitiatorCell(i);break;case"initiator-address-space":{const e=this.requestInternal.clientSecurityState();this.renderAddressSpaceCell(i,e?e.initiatorIPAddressSpace:"Unknown");break}case"size":this.renderSizeCell(i);break;case"time":this.renderTimeCell(i);break;case"timeline":this.setTextAndTitle(i,"");break;case"has-overrides":this.setTextAndTitle(i,this.requestInternal.overrideTypes.join(", "));break;default:this.setTextAndTitle(i,this.requestInternal.responseHeaderValue(t)||"")}}arrayLength(e){return e?String(e.length):""}select(e){super.select(e),this.parentView().dispatchEventToListeners("RequestSelected",this.requestInternal)}highlightMatchedSubstring(e){if(!e||!this.nameCell||null===this.nameCell.textContent)return[];this.element();const t=[],i=this.nameCell.textContent.match(e);return i&&o.UIUtils.highlightSearchResult(this.nameCell,i.index||0,i[0].length,t),t}openInNewTab(){t.InspectorFrontendHost.InspectorFrontendHostInstance.openInNewTab(this.requestInternal.url())}isFailed(){if(this.requestInternal.failed&&!this.requestInternal.statusCode)return!0;if(this.requestInternal.statusCode>=400)return!0;const e=this.requestInternal.signedExchangeInfo();return!(null===e||!Boolean(e.errors))||(!(!this.requestInternal.webBundleInfo()?.errorMessage&&!this.requestInternal.webBundleInnerRequestInfo()?.errorMessage)||!!this.requestInternal.corsErrorStatus())}renderPrimaryCell(e,t,i){if(0===(0|this.dataGrid?.indexOfVisibleColumn(t))){const t=this.leftPadding?this.leftPadding+"px":"";e.style.setProperty("padding-left",t),e.tabIndex=-1,this.nameCell=e,e.addEventListener("dblclick",this.openInNewTab.bind(this),!1),e.addEventListener("mousedown",(()=>{this.select(),this.parentView().dispatchEventToListeners("RequestActivated",{showPanel:!0})})),e.addEventListener("focus",(()=>this.parentView().resetFocus()));const i=this.getIcon(this.requestInternal);e.appendChild(i)}if("name"===t){const t=this.requestInternal.webBundleInnerRequestInfo();if(t){const i={iconName:"bundle",color:"var(--icon-info)"},r=this.createIconElement(i,ge(ue.webBundleInnerRequest));r.classList.add("icon");const o=n.NetworkManager.NetworkManager.forRequest(this.requestInternal);t.bundleRequestId&&o?e.appendChild(k.Linkifier.Linkifier.linkifyRevealable(new g.NetworkRequestId.NetworkRequestId(t.bundleRequestId,o),r,void 0,void 0,void 0,"webbundle-request")):e.appendChild(r)}const i=s.StringUtilities.trimMiddle(this.requestInternal.name(),100),r=n.NetworkManager.NetworkManager.forRequest(this.requestInternal);o.UIUtils.createTextChild(e,r?r.target().decorateLabel(i):i),this.appendSubtitle(e,this.requestInternal.path()),this.requestInternal.url().startsWith("data")||o.Tooltip.Tooltip.install(e,this.requestInternal.url())}else i&&o.UIUtils.createTextChild(e,i)}createIconElement(e,t){const i=document.createElement("div");return i.title=t,i.style.setProperty("mask",`url('${new URL(`../../Images/${e.iconName}.svg`,import.meta.url).toString()}') no-repeat center /99%`),i.style.setProperty("background-color",e.color),i}getIcon(t){let i,r=t.resourceType();if(this.isFailed()){const e={iconName:"cross-circle-filled",color:"var(--icon-error)"};return i=this.createIconElement(e,r.title()),i.classList.add("icon"),i}if(t.hasThirdPartyCookiePhaseoutIssue()){const e={iconName:"warning-filled",color:"var(--icon-warning)"};return i=this.createIconElement(e,ge(ue.thirdPartyPhaseout)),i.classList.add("icon"),i}const o=t.hasOverriddenHeaders(),s=t.hasOverriddenContent;if(o||s){const e={iconName:"document",color:"var(--icon-default)"};let t;t=ge(o&&s?ue.requestContentHeadersOverridden:s?ue.requestContentOverridden:ue.requestHeadersOverridden);const r=this.createIconElement(e,t);return r.classList.add("icon"),i=document.createElement("div"),i.classList.add("network-override-marker"),i.appendChild(r),i}const n=e.ResourceType.ResourceType.fromMimeType(t.mimeType);if(n!==r&&n!==e.ResourceType.resourceTypes.Other&&(r===e.ResourceType.resourceTypes.Fetch||n===e.ResourceType.resourceTypes.Image||r===e.ResourceType.resourceTypes.Other&&n===e.ResourceType.resourceTypes.Script)&&(r=n),r===e.ResourceType.resourceTypes.Image){const e=document.createElement("img");return e.classList.add("image-network-icon-preview"),e.alt=t.resourceType().title(),t.populateImageSource(e),i=document.createElement("div"),i.classList.add("image","icon"),i.appendChild(e),i}if(r!==e.ResourceType.resourceTypes.Manifest&&"application/json"===e.ResourceType.ResourceType.simplifyContentType(t.mimeType)){const e={iconName:"file-json",color:"var(--icon-file-script)"};return i=this.createIconElement(e,t.resourceType().title()),i.classList.add("icon"),i}const a=b.iconDataForResourceType(r);return i=this.createIconElement(a,t.resourceType().title()),i.classList.add("icon"),i}renderStatusCell(e){e.classList.toggle("network-dim-cell",!this.isFailed()&&(this.requestInternal.cached()||!this.requestInternal.statusCode));const t=this.requestInternal.corsErrorStatus(),r=this.requestInternal.webBundleInfo()?.errorMessage||this.requestInternal.webBundleInnerRequestInfo()?.errorMessage;if(r)this.setTextAndTitle(e,ge(ue.webBundleError),r);else if(!this.requestInternal.failed||this.requestInternal.canceled||this.requestInternal.wasBlocked()||t)if(this.requestInternal.statusCode&&this.requestInternal.statusCode>=400){const t=this.requestInternal.getInferredStatusText();o.UIUtils.createTextChild(e,String(this.requestInternal.statusCode)),this.appendSubtitle(e,t),o.Tooltip.Tooltip.install(e,this.requestInternal.statusCode+" "+t)}else if(!this.requestInternal.statusCode&&this.requestInternal.parsedURL.isDataURL())this.setTextAndTitle(e,ge(ue.data));else if(!this.requestInternal.statusCode&&this.requestInternal.canceled)this.setTextAndTitle(e,ge(ue.canceled));else if(this.requestInternal.wasBlocked()){let t=ge(ue.other),r=!1;switch(this.requestInternal.blockedReason()){case"other":t=ge(ue.other);break;case"csp":t=ge(ue.csp);break;case"mixed-content":t=i.i18n.lockedString("mixed-content");break;case"origin":t=ge(ue.origin);break;case"inspector":t=ge(ue.devtools);break;case"subresource-filter":t=i.i18n.lockedString("subresource-filter");break;case"content-type":t=i.i18n.lockedString("content-type");break;case"coep-frame-resource-needs-coep-header":r=!0,t=i.i18n.lockedString("CoepFrameResourceNeedsCoepHeader");break;case"coop-sandboxed-iframe-cannot-navigate-to-coop-page":r=!0,t=i.i18n.lockedString("CoopSandboxedIframeCannotNavigateToCoopPage");break;case"corp-not-same-origin":r=!0,t=i.i18n.lockedString("NotSameOrigin");break;case"corp-not-same-site":r=!0,t=i.i18n.lockedString("NotSameSite");break;case"corp-not-same-origin-after-defaulted-to-same-origin-by-coep":r=!0,t=i.i18n.lockedString("NotSameOriginAfterDefaultedToSameOriginByCoep")}r?this.setTextAndTitleAsLink(e,ge(ue.blockeds,{PH1:t}),ge(ue.blockedTooltip),(()=>{this.parentView().dispatchEventToListeners("RequestActivated",{showPanel:!0,tab:"headers-component"})})):this.setTextAndTitle(e,ge(ue.blockeds,{PH1:t}))}else if(t)this.setTextAndTitle(e,ge(ue.corsError),ge(ue.crossoriginResourceSharingErrorS,{PH1:t.corsError}));else if(this.requestInternal.statusCode){o.UIUtils.createTextChild(e,String(this.requestInternal.statusCode));const t=this.requestInternal.getInferredStatusText();this.appendSubtitle(e,t),o.Tooltip.Tooltip.install(e,this.requestInternal.statusCode+" "+t)}else this.requestInternal.finished?this.setTextAndTitle(e,ge(ue.finished)):this.requestInternal.preserved?this.setTextAndTitle(e,ge(ue.unknown),ge(ue.unknownExplanation)):this.setTextAndTitle(e,ge(ue.pendingq));else{const t=ge(ue.failed);this.requestInternal.localizedFailDescription?(o.UIUtils.createTextChild(e,t),this.appendSubtitle(e,this.requestInternal.localizedFailDescription,!0),o.Tooltip.Tooltip.install(e,t+" "+this.requestInternal.localizedFailDescription)):this.setTextAndTitle(e,t)}}renderProtocolCell(e){switch(o.UIUtils.createTextChild(e,this.requestInternal.protocol),this.requestInternal.alternateProtocolUsage){case"alternativeJobWonWithoutRace":o.Tooltip.Tooltip.install(e,ue.alternativeJobWonWithoutRace);break;case"alternativeJobWonRace":o.Tooltip.Tooltip.install(e,ue.alternativeJobWonRace);break;case"mainJobWonRace":o.Tooltip.Tooltip.install(e,ue.mainJobWonRace);break;case"mappingMissing":o.Tooltip.Tooltip.install(e,ue.mappingMissing);break;case"broken":o.Tooltip.Tooltip.install(e,ue.broken);break;case"dnsAlpnH3JobWonWithoutRace":o.Tooltip.Tooltip.install(e,ue.dnsAlpnH3JobWonWithoutRace);break;case"dnsAlpnH3JobWonRace":o.Tooltip.Tooltip.install(e,ue.dnsAlpnH3JobWonRace);break;default:o.Tooltip.Tooltip.install(e,this.requestInternal.protocol)}}#e(){if(this.requestInternal.resourceType().isStyleSheet())return t.UserMetrics.Action.StyleSheetInitiatorLinkClicked}renderInitiatorCell(e){this.initiatorCell=e;const t=this.requestInternal,i=a.NetworkLog.NetworkLog.instance().initiatorInfoForRequest(t),r=t.timing;switch(r&&r.pushStart&&e.appendChild(document.createTextNode(ge(ue.push))),i.type){case"parser":{const t=p.Workspace.WorkspaceImpl.instance().uiSourceCodeForURL(i.url),r=t?.displayName(),o=void 0!==r&&void 0!==i.lineNumber?`${r}:${i.lineNumber}`:void 0;e.appendChild(k.Linkifier.Linkifier.linkifyURL(i.url,{text:o,lineNumber:i.lineNumber,columnNumber:i.columnNumber,userMetric:this.#e()})),this.appendSubtitle(e,ge(ue.parser));break}case"redirect":{o.Tooltip.Tooltip.install(e,i.url);const r=t.redirectSource();console.assert(null!==r),this.parentView().nodeForRequest(r)?e.appendChild(k.Linkifier.Linkifier.linkifyRevealable(r,u.ResourceUtils.displayNameForURL(r.url()),void 0,void 0,void 0,"redirect-source-request")):e.appendChild(k.Linkifier.Linkifier.linkifyURL(r.url(),{jslogContext:"redirect-source-request-url"})),this.appendSubtitle(e,ge(ue.redirect));break}case"script":{const r=n.NetworkManager.NetworkManager.forRequest(t)?.target()||null,s=this.parentView().linkifier();i.stack?this.linkifiedInitiatorAnchor=s.linkifyStackTraceTopFrame(r,i.stack):this.linkifiedInitiatorAnchor=s.linkifyScriptLocation(r,i.scriptId,i.url,i.lineNumber,{columnNumber:i.columnNumber,inlineFrameIndex:0}),o.Tooltip.Tooltip.install(this.linkifiedInitiatorAnchor,""),e.appendChild(this.linkifiedInitiatorAnchor),this.appendSubtitle(e,ge(ue.script)),e.classList.add("network-script-initiated");break}case"preload":o.Tooltip.Tooltip.install(e,ge(ue.preload)),e.classList.add("network-dim-cell"),e.appendChild(document.createTextNode(ge(ue.preload)));break;case"signedExchange":e.appendChild(k.Linkifier.Linkifier.linkifyURL(i.url)),this.appendSubtitle(e,ge(ue.signedexchange));break;case"preflight":if(e.appendChild(document.createTextNode(ge(ue.preflight))),i.initiatorRequest){const t=m.Icon.create("arrow-up-down-circle"),r=k.Linkifier.Linkifier.linkifyRevealable(i.initiatorRequest,t,void 0,ge(ue.selectTheRequestThatTriggered),"trailing-link-icon","initator-request");o.ARIAUtils.setLabel(r,ge(ue.selectTheRequestThatTriggered)),e.appendChild(r)}break;default:o.Tooltip.Tooltip.install(e,ge(ue.otherC)),e.classList.add("network-dim-cell"),e.appendChild(document.createTextNode(ge(ue.otherC)))}}renderAddressSpaceCell(e,t){"Unknown"!==t&&o.UIUtils.createTextChild(e,t)}renderSizeCell(e){const t=s.NumberUtilities.bytesToString(this.requestInternal.resourceSize);if(this.requestInternal.cachedInMemory())o.UIUtils.createTextChild(e,ge(ue.memoryCache)),o.Tooltip.Tooltip.install(e,ge(ue.servedFromMemoryCacheResource,{PH1:t})),e.classList.add("network-dim-cell");else if(this.requestInternal.serviceWorkerRouterInfo){const{serviceWorkerRouterInfo:r}=this.requestInternal,n=r.ruleIdMatched??0;let a;if(o.UIUtils.createTextChild(e,i.i18n.lockedString("(ServiceWorker router)")),"network"===r.matchedSourceType){const e=s.NumberUtilities.bytesToString(this.requestInternal.transferSize);a=ge(ue.matchedToServiceWorkerRouterWithNetworkSource,{PH1:n,PH2:e,PH3:t})}else a=ge(ue.matchedToServiceWorkerRouter,{PH1:n,PH2:t});o.Tooltip.Tooltip.install(e,a),e.classList.add("network-dim-cell")}else if(this.requestInternal.fetchedViaServiceWorker)o.UIUtils.createTextChild(e,ge(ue.serviceWorker)),o.Tooltip.Tooltip.install(e,ge(ue.servedFromServiceWorkerResource,{PH1:t})),e.classList.add("network-dim-cell");else if(this.requestInternal.redirectSourceSignedExchangeInfoHasNoErrors())o.UIUtils.createTextChild(e,i.i18n.lockedString("(signed-exchange)")),o.Tooltip.Tooltip.install(e,ge(ue.servedFromSignedHttpExchange,{PH1:t})),e.classList.add("network-dim-cell");else if(this.requestInternal.webBundleInnerRequestInfo())o.UIUtils.createTextChild(e,ge(ue.webBundle)),o.Tooltip.Tooltip.install(e,ge(ue.servedFromWebBundle,{PH1:t})),e.classList.add("network-dim-cell");else if(this.requestInternal.fromPrefetchCache())o.UIUtils.createTextChild(e,ge(ue.prefetchCache)),o.Tooltip.Tooltip.install(e,ge(ue.servedFromPrefetchCacheResource,{PH1:t})),e.classList.add("network-dim-cell");else if(this.requestInternal.cached())o.UIUtils.createTextChild(e,ge(ue.diskCache)),o.Tooltip.Tooltip.install(e,ge(ue.servedFromDiskCacheResourceSizeS,{PH1:t})),e.classList.add("network-dim-cell");else{const i=s.NumberUtilities.bytesToString(this.requestInternal.transferSize);o.UIUtils.createTextChild(e,i),o.Tooltip.Tooltip.install(e,`${i} transferred over network, resource size: ${t}`)}this.appendSubtitle(e,t)}renderTimeCell(e){this.requestInternal.duration>0?(this.setTextAndTitle(e,i.TimeUtilities.secondsToString(this.requestInternal.duration)),this.appendSubtitle(e,i.TimeUtilities.secondsToString(this.requestInternal.latency),!1,ge(ue.timeSubtitleTooltipText))):this.requestInternal.preserved?this.setTextAndTitle(e,ge(ue.unknown),ge(ue.unknownExplanation)):(e.classList.add("network-dim-cell"),this.setTextAndTitle(e,ge(ue.pending)))}appendSubtitle(e,t,i=!1,r=""){const s=document.createElement("div");s.classList.add("network-cell-subtitle"),i&&s.classList.add("always-visible"),s.textContent=t,r&&o.Tooltip.Tooltip.install(s,r),e.appendChild(s)}}class be extends me{createCells(e){super.createCells(e);const t=this.dataGrid.visibleColumnsArray[0],i=`${t.title}`,r=ge(ue.level);this.nodeAccessibleText=`${r} ${i}: ${this.cellAccessibleTextMap.get(t.id)}`}renderCell(e,t){if(0===this.dataGrid.indexOfVisibleColumn(t)){const i=e,r=this.leftPadding?this.leftPadding+"px":"";i.style.setProperty("padding-left",r),i.classList.add("disclosure"),this.setCellAccessibleName(i.textContent||"",i,t)}}select(e){super.select(e);const t=this.traverseNextNode(!1,void 0,!0),i=t?.request();i&&this.parentView().dispatchEventToListeners("RequestSelected",i)}}var ve=Object.freeze({__proto__:null,NetworkNode:me,_backgroundColors:we,NetworkRequestNode:ke,NetworkGroupNode:be});const fe=new CSSStyleSheet;fe.replaceSync(".request-cookies-view{overflow:auto;padding:12px;height:100%;background-color:var(--sys-color-cdt-base-container)}.request-cookies-view .request-cookies-title{font-size:12px;font-weight:bold;margin-right:30px;color:var(--sys-color-on-surface)}.request-cookies-view .cookie-line{margin-top:6px;display:flex}.request-cookies-view .cookies-panel-item{margin-top:6px;margin-bottom:16px;flex:none}@media (forced-colors: active){td.flagged-cookie-attribute-cell .cookie-warning-icon{forced-color-adjust:none;filter:grayscale()}}\n/*# sourceURL=requestCookiesView.css */\n");const Ce={thisRequestHasNoCookies:"This request has no cookies.",requestCookies:"Request Cookies",cookiesThatWereSentToTheServerIn:"Cookies that were sent to the server in the 'cookie' header of the request",showFilteredOutRequestCookies:"show filtered out request cookies",noRequestCookiesWereSent:"No request cookies were sent.",responseCookies:"Response Cookies",cookiesThatWereReceivedFromThe:"Cookies that were received from the server in the '`set-cookie`' header of the response",malformedResponseCookies:"Malformed Response Cookies",cookiesThatWereReceivedFromTheServer:"Cookies that were received from the server in the '`set-cookie`' header of the response but were malformed",siteHasCookieInOtherPartition:"This site has cookies in another partition, that were not sent with this request. {PH1}",learnMore:"Learn more"},Se=i.i18n.registerUIStrings("panels/network/RequestCookiesView.ts",Ce),ye=i.i18n.getLocalizedString.bind(void 0,Se);class Te extends o.Widget.Widget{request;showFilteredOutCookiesSetting;emptyWidget;requestCookiesTitle;requestCookiesEmpty;requestCookiesTable;responseCookiesTitle;responseCookiesTable;siteHasCookieInOtherPartition;malformedResponseCookiesTitle;malformedResponseCookiesList;constructor(t){super(),this.element.classList.add("request-cookies-view"),this.element.setAttribute("jslog",`${l.pane("cookies").track({resize:!0})}`),this.request=t,this.showFilteredOutCookiesSetting=e.Settings.Settings.instance().createSetting("show-filtered-out-request-cookies",!1),this.emptyWidget=new o.EmptyWidget.EmptyWidget(ye(Ce.thisRequestHasNoCookies)),this.emptyWidget.show(this.element),this.requestCookiesTitle=this.element.createChild("div");const r=this.requestCookiesTitle.createChild("span","request-cookies-title");r.textContent=ye(Ce.requestCookies),o.Tooltip.Tooltip.install(r,ye(Ce.cookiesThatWereSentToTheServerIn));const s=o.SettingsUI.createSettingCheckbox(ye(Ce.showFilteredOutRequestCookies),this.showFilteredOutCookiesSetting,!0);s.checkboxElement.addEventListener("change",(()=>{this.refreshRequestCookiesView()})),this.requestCookiesTitle.appendChild(s),this.requestCookiesEmpty=this.element.createChild("div","cookies-panel-item"),this.requestCookiesEmpty.textContent=ye(Ce.noRequestCookiesWereSent),this.requestCookiesTable=new C.CookiesTable.CookiesTable(!0),this.requestCookiesTable.contentElement.classList.add("cookie-table","cookies-panel-item"),this.requestCookiesTable.show(this.element),this.siteHasCookieInOtherPartition=this.element.createChild("div","cookies-panel-item site-has-cookies-in-other-partition"),this.siteHasCookieInOtherPartition.appendChild(i.i18n.getFormatLocalizedString(Se,Ce.siteHasCookieInOtherPartition,{PH1:o.XLink.XLink.create("https://developer.chrome.com/en/docs/privacy-sandbox/chips/",ye(Ce.learnMore),void 0,void 0,"learn-more")})),this.responseCookiesTitle=this.element.createChild("div","request-cookies-title"),this.responseCookiesTitle.textContent=ye(Ce.responseCookies),this.responseCookiesTitle.title=ye(Ce.cookiesThatWereReceivedFromThe),this.responseCookiesTable=new C.CookiesTable.CookiesTable(!0),this.responseCookiesTable.contentElement.classList.add("cookie-table","cookies-panel-item"),this.responseCookiesTable.show(this.element),this.malformedResponseCookiesTitle=this.element.createChild("div","request-cookies-title"),this.malformedResponseCookiesTitle.textContent=ye(Ce.malformedResponseCookies),o.Tooltip.Tooltip.install(this.malformedResponseCookiesTitle,ye(Ce.cookiesThatWereReceivedFromTheServer)),this.malformedResponseCookiesList=this.element.createChild("div")}getRequestCookies(){const e=new Map,t=new Map,i=this.request.includedRequestCookies().map((e=>e.cookie));if(this.showFilteredOutCookiesSetting.get())for(const t of this.request.blockedRequestCookies())e.set(t.cookie,t.blockedReasons.map((e=>({attribute:n.NetworkRequest.cookieBlockedReasonToAttribute(e),uiString:n.NetworkRequest.cookieBlockedReasonToUiString(e)})))),i.push(t.cookie);for(const e of this.request.includedRequestCookies())e.exemptionReason&&t.set(e.cookie,{uiString:n.NetworkRequest.cookieExemptionReasonToUiString(e.exemptionReason)});return{requestCookies:i,requestCookieToBlockedReasons:e,requestCookieToExemptionReason:t}}getResponseCookies(){let e=[];const t=new Map,i=new Map,r=[];if(this.request.responseCookies.length){e=this.request.nonBlockedResponseCookies();for(const i of this.request.blockedResponseCookies()){const o=n.CookieParser.CookieParser.parseSetCookie(i.cookieLine);if(o&&!o.length||i.blockedReasons.includes("SyntaxError")||i.blockedReasons.includes("NameValuePairExceedsMaxSize")){r.push(i);continue}let s=i.cookie;!s&&o&&(s=o[0]),s&&(t.set(s,i.blockedReasons.map((e=>({attribute:n.NetworkRequest.setCookieBlockedReasonToAttribute(e),uiString:n.NetworkRequest.setCookieBlockedReasonToUiString(e)})))),e.push(s))}for(const t of this.request.exemptedResponseCookies()){const r=e.find((e=>t.cookieLine===e.getCookieLine()));r&&i.set(r,{uiString:n.NetworkRequest.cookieExemptionReasonToUiString(t.exemptionReason)})}}return{responseCookies:e,responseCookieToBlockedReasons:t,responseCookieToExemptionReason:i,malformedResponseCookies:r}}refreshRequestCookiesView(){if(!this.isShowing())return;this.request.hasRequestCookies()||this.request.responseCookies.length?this.emptyWidget.hideWidget():this.emptyWidget.showWidget();const{requestCookies:e,requestCookieToBlockedReasons:t,requestCookieToExemptionReason:i}=this.getRequestCookies(),{responseCookies:r,responseCookieToBlockedReasons:s,responseCookieToExemptionReason:a,malformedResponseCookies:l}=this.getResponseCookies();if(e.length?(this.requestCookiesTitle.classList.remove("hidden"),this.requestCookiesEmpty.classList.add("hidden"),this.requestCookiesTable.showWidget(),this.requestCookiesTable.setCookies(e,t,i)):this.request.blockedRequestCookies().length?(this.requestCookiesTitle.classList.remove("hidden"),this.requestCookiesEmpty.classList.remove("hidden"),this.requestCookiesTable.hideWidget()):(this.requestCookiesTitle.classList.add("hidden"),this.requestCookiesEmpty.classList.add("hidden"),this.requestCookiesTable.hideWidget()),r.length?(this.responseCookiesTitle.classList.remove("hidden"),this.responseCookiesTable.showWidget(),this.responseCookiesTable.setCookies(r,s,a)):(this.responseCookiesTitle.classList.add("hidden"),this.responseCookiesTable.hideWidget()),l.length){this.malformedResponseCookiesTitle.classList.remove("hidden"),this.malformedResponseCookiesList.classList.remove("hidden"),this.malformedResponseCookiesList.removeChildren();for(const e of l){const t=this.malformedResponseCookiesList.createChild("span","cookie-line source-code"),i=new m.Icon.Icon;i.data={iconName:"cross-circle-filled",color:"var(--icon-error)",width:"14px",height:"14px"},i.classList.add("cookie-warning-icon"),t.appendChild(i),o.UIUtils.createTextChild(t,e.cookieLine),e.blockedReasons.includes("NameValuePairExceedsMaxSize")?t.title=n.NetworkRequest.setCookieBlockedReasonToUiString("NameValuePairExceedsMaxSize"):t.title=n.NetworkRequest.setCookieBlockedReasonToUiString("SyntaxError")}}else this.malformedResponseCookiesTitle.classList.add("hidden"),this.malformedResponseCookiesList.classList.add("hidden");this.request.siteHasCookieInOtherPartition()?this.siteHasCookieInOtherPartition.classList.remove("hidden"):this.siteHasCookieInOtherPartition.classList.add("hidden")}wasShown(){super.wasShown(),this.registerCSSFiles([fe]),this.request.addEventListener(n.NetworkRequest.Events.RequestHeadersChanged,this.refreshRequestCookiesView,this),this.request.addEventListener(n.NetworkRequest.Events.ResponseHeadersChanged,this.refreshRequestCookiesView,this),this.refreshRequestCookiesView()}willHide(){this.request.removeEventListener(n.NetworkRequest.Events.RequestHeadersChanged,this.refreshRequestCookiesView,this),this.request.removeEventListener(n.NetworkRequest.Events.ResponseHeadersChanged,this.refreshRequestCookiesView,this)}}var xe=Object.freeze({__proto__:null,RequestCookiesView:Te});const Re=new CSSStyleSheet;Re.replaceSync(".request-initiator-view{display:block;margin:6px}\n/*# sourceURL=requestInitiatorView.css */\n");const Ie=new CSSStyleSheet;Ie.replaceSync(".request-initiator-view-tree .fill{right:-6px}.request-initiator-view-section-title{font-weight:bold;padding:4px}.request-initiator-view-section-title:focus-visible{background-color:var(--sys-color-state-focus-highlight)}@media (forced-colors: active){.request-initiator-view-section-title:focus-visible{forced-color-adjust:none;background-color:Highlight;color:HighlightText}}\n/*# sourceURL=requestInitiatorViewTree.css */\n");const qe={thisRequestHasNoInitiatorData:"This request has no initiator data.",requestCallStack:"Request call stack",requestInitiatorChain:"Request initiator chain"},Le=i.i18n.registerUIStrings("panels/network/RequestInitiatorView.ts",qe),Fe=i.i18n.getLocalizedString.bind(void 0,Le);class Pe extends o.Widget.VBox{linkifier;request;emptyWidget;hasShown;constructor(e){super(),this.element.classList.add("request-initiator-view"),this.element.setAttribute("jslog",`${l.pane("initiator").track({resize:!0})}`),this.linkifier=new k.Linkifier.Linkifier,this.request=e,this.emptyWidget=new o.EmptyWidget.EmptyWidget(Fe(qe.thisRequestHasNoInitiatorData)),this.emptyWidget.show(this.element),this.hasShown=!1}static createStackTracePreview(e,t,i){const r=e.initiator();if(!r||!r.stack)return null;const o=n.NetworkManager.NetworkManager.forRequest(e),s=o?o.target():null;return k.JSPresentationUtils.buildStackTracePreviewContents(s,t,{stackTrace:r.stack,tabStops:i})}createTree(){const e=new o.TreeOutline.TreeOutlineInShadow;return e.registerCSSFiles([Ie]),e.contentElement.classList.add("request-initiator-view-tree"),e.contentElement.setAttribute("jslog",`${l.tree("initiator-tree")}`),e}buildRequestChainTree(e,t,i){const r=new o.TreeOutline.TreeElement(t);i.appendChild(r),r.titleElement instanceof HTMLElement&&r.titleElement.classList.add("request-initiator-view-section-title");const s=e.initiators;let n=r;for(const e of Array.from(s).reverse()){const t=new o.TreeOutline.TreeElement(e.url());n.appendChild(t),n.expand(),n=t}r.expand(),n.select();const a=n.titleElement;a instanceof HTMLElement&&(a.style.fontWeight="bold");const l=e.initiated;return this.depthFirstSearchTreeBuilder(l,n,this.request),r}depthFirstSearchTreeBuilder(e,t,i){const r=new Set;r.add(this.request);for(const s of e.keys())if(e.get(s)===i){const i=new o.TreeOutline.TreeElement(s.url());t.appendChild(i),t.expand(),r.has(s)||(r.add(s),this.depthFirstSearchTreeBuilder(e,i,s))}}buildStackTraceSection(e,t,i){const r=new o.TreeOutline.TreeElement(t);i.appendChild(r),r.titleElement instanceof HTMLElement&&r.titleElement.classList.add("request-initiator-view-section-title");const s=new o.TreeOutline.TreeElement(e,!1);s.selectable=!1,r.appendChild(s),r.expand()}wasShown(){if(this.hasShown)return;this.registerCSSFiles([Re]);let e=!1;const t=this.createTree(),i=Pe.createStackTracePreview(this.request,this.linkifier,!0);i&&(e=!0,this.buildStackTraceSection(i.element,Fe(qe.requestCallStack),t));const r=a.NetworkLog.NetworkLog.instance().initiatorGraphForRequest(this.request);(r.initiators.size>1||r.initiated.size>1)&&(e=!0,this.buildRequestChainTree(r,Fe(qe.requestInitiatorChain),t));const o=t.firstChild();o&&o.select(!0),e&&(this.element.appendChild(t.element),this.emptyWidget.hideWidget()),this.hasShown=!0}}var He=Object.freeze({__proto__:null,RequestInitiatorView:Pe});const Me=new CSSStyleSheet;Me.replaceSync('.object-properties-section-dimmed{opacity:60%}.object-properties-section{padding:0;color:var(--sys-color-on-surface);display:flex;flex-direction:column}.object-properties-section li{user-select:text}.object-properties-section li::before{top:-1px;margin-right:2px}.object-properties-section li.editing-sub-part{padding:3px 12px 8px 6px;margin:-1px -6px -8px;text-overflow:clip}.object-properties-section li.editing{margin-left:10px;text-overflow:clip}.tree-outline ol.title-less-mode{padding-left:0}.object-properties-section .own-property{font-weight:bold}.object-properties-section .synthetic-property{color:var(--sys-color-token-subtle)}.object-properties-section .private-property-hash{color:var(--sys-color-on-surface)}.object-properties-section-root-element{display:flex;flex-direction:row}.object-properties-section .editable-div{overflow:hidden}.object-properties-section [data-webidl="true"] > .name-and-value > .adorner{flex-shrink:0;width:16px;height:16px;margin-right:2px}.object-properties-section [data-webidl="true"] > .name-and-value > .name{font-weight:bold}.name-and-value{overflow:hidden;line-height:16px;display:flex;white-space:nowrap}.name-and-value .separator{white-space:pre;flex-shrink:0}.editing-sub-part .name-and-value{overflow:visible;display:inline-flex}.property-prompt{margin-left:4px}.tree-outline.hide-selection-when-blurred .selected:focus-visible{background:none}.tree-outline.hide-selection-when-blurred .selected:focus-visible ::slotted(*),\n.tree-outline.hide-selection-when-blurred .selected:focus-visible .tree-element-title,\n.tree-outline.hide-selection-when-blurred .selected:focus-visible .name-and-value,\n.tree-outline.hide-selection-when-blurred .selected:focus-visible .gray-info-message{background:var(--sys-color-state-focus-highlight);border-radius:2px}@media (forced-colors: active){.object-properties-section-dimmed{opacity:100%}.tree-outline.hide-selection-when-blurred .selected:focus-visible{background:Highlight}.tree-outline li:hover .tree-element-title,\n .tree-outline li.selected .tree-element-title{color:ButtonText}.tree-outline.hide-selection-when-blurred .selected:focus-visible .tree-element-title,\n .tree-outline.hide-selection-when-blurred .selected:focus-visible .name-and-value{background:transparent;box-shadow:none}.tree-outline.hide-selection-when-blurred .selected:focus-visible span,\n .tree-outline.hide-selection-when-blurred .selected:focus-visible .gray-info-message{color:HighlightText}.tree-outline-disclosure:hover li.parent::before{background-color:ButtonText}}\n/*# sourceURL=objectPropertiesSection.css */\n');const Ee=new CSSStyleSheet;Ee.replaceSync(".value.object-value-node:hover{background-color:var(--sys-color-state-hover-on-subtle)}.object-value-function-prefix,\n.object-value-boolean{color:var(--sys-color-token-attribute-value)}.object-value-function{font-style:italic}.object-value-function.linkified:hover{--override-linkified-hover-background:rgb(0 0 0/10%);background-color:var(--override-linkified-hover-background);cursor:pointer}.theme-with-dark-background .object-value-function.linkified:hover,\n:host-context(.theme-with-dark-background) .object-value-function.linkified:hover{--override-linkified-hover-background:rgb(230 230 230/10%)}.object-value-number{color:var(--sys-color-token-attribute-value)}.object-value-bigint{color:var(--sys-color-token-comment)}.object-value-string,\n.object-value-regexp,\n.object-value-symbol{white-space:pre;unicode-bidi:-webkit-isolate;color:var(--sys-color-token-property-special)}.object-value-node{position:relative;vertical-align:baseline;color:var(--sys-color-token-variable);white-space:nowrap}.object-value-null,\n.object-value-undefined{color:var(--sys-color-state-disabled)}.object-value-unavailable{color:var(--sys-color-token-tag)}.object-value-calculate-value-button:hover{text-decoration:underline}.object-properties-section-custom-section{display:inline-flex;flex-direction:column}.theme-with-dark-background .object-value-number,\n:host-context(.theme-with-dark-background) .object-value-number,\n.theme-with-dark-background .object-value-boolean,\n:host-context(.theme-with-dark-background) .object-value-boolean{--override-primitive-dark-mode-color:hsl(252deg 100% 75%);color:var(--override-primitive-dark-mode-color)}.object-properties-section .object-description{color:var(--sys-color-token-subtle)}.value .object-properties-preview{white-space:nowrap}.name{color:var(--sys-color-token-tag);flex-shrink:0}.object-properties-preview .name{color:var(--sys-color-token-subtle)}@media (forced-colors: active){.object-value-calculate-value-button:hover{forced-color-adjust:none;color:Highlight}}\n/*# sourceURL=objectValue.css */\n");const Ae=new CSSStyleSheet;Ae.replaceSync(".tree-outline{padding-left:0}.tree-outline > ol{padding-bottom:5px;border-bottom:solid 1px var(--sys-color-divider)}.tree-outline > .parent{user-select:none;font-weight:bold;color:var(--sys-color-on-surface);margin-top:-1px;display:flex;align-items:center;height:26px}.tree-outline li{padding-left:5px;line-height:20px}.tree-outline li:not(.parent){margin-left:10px;display:block}.tree-outline li:not(.parent)::before{display:none}.tree-outline li.expanded .payload-count{display:none}.tree-outline li .payload-toggle{display:none}.tree-outline li.expanded .payload-toggle{display:inline;margin-left:30px;font-weight:normal;color:var(--sys-color-on-surface);background:none;border:none}.tree-outline li.expanded .payload-toggle:focus-visible{border:2px solid var(--sys-color-state-focus-ring);border-radius:5px}.tree-outline li .header-toggle:hover{color:var(--sys-color-token-subtle)}.tree-outline .payload-name{color:var(--sys-color-token-subtle);display:inline-flex;margin-right:0.25em;font-weight:bold;vertical-align:top;white-space:pre-wrap}.tree-outline .payload-separator{user-select:none}.tree-outline .payload-value{display:inline;margin-right:1em;white-space:pre-wrap;word-break:break-all;margin-top:1px}.tree-outline .empty-request-payload{color:var(--sys-color-state-disabled)}.request-payload-show-more-button{border:none;border-radius:3px;display:inline-block;font-size:12px;font-family:sans-serif;margin:0 4px;padding:2px 4px}@media (forced-colors: active){:host-context(.request-payload-tree) ol.tree-outline:not(.hide-selection-when-blurred) li.selected:focus{background:Highlight}:host-context(.request-payload-tree) ol.tree-outline:not(.hide-selection-when-blurred) li::before{background-color:ButtonText}:host-context(.request-payload-tree) ol.tree-outline:not(.hide-selection-when-blurred) li.selected.parent::before{background-color:HighlightText}:host-context(.request-payload-tree) ol.tree-outline:not(.hide-selection-when-blurred) li.selected *,\n :host-context(.request-payload-tree) ol.tree-outline:not(.hide-selection-when-blurred) li.selected.parent,\n :host-context(.request-payload-tree) ol.tree-outline:not(.hide-selection-when-blurred) li.selected.parent span{color:HighlightText}}.payload-decode-error{color:var(--sys-color-error)}\n/*# sourceURL=requestPayloadTree.css */\n");const Be=new CSSStyleSheet;Be.replaceSync(".request-payload-view{user-select:text;overflow:auto}.request-payload-tree{flex-grow:1;overflow-y:auto;margin:0}\n/*# sourceURL=requestPayloadView.css */\n");const Ue={copyValue:"Copy value",requestPayload:"Request Payload",unableToDecodeValue:"(unable to decode value)",queryStringParameters:"Query String Parameters",formData:"Form Data",showMore:"Show more",viewParsed:"View parsed",empty:"(empty)",viewSource:"View source",viewUrlEncoded:"View URL-encoded",viewDecoded:"View decoded",viewUrlEncodedL:"view URL-encoded",viewDecodedL:"view decoded",viewParsedL:"view parsed",viewSourceL:"view source"},Ne=i.i18n.registerUIStrings("panels/network/RequestPayloadView.ts",Ue),Ve=i.i18n.getLocalizedString.bind(void 0,Ne);class Oe extends o.Widget.VBox{request;decodeRequestParameters;queryStringCategory;formDataCategory;requestPayloadCategory;constructor(e){super(),this.element.classList.add("request-payload-view"),this.element.setAttribute("jslog",`${l.pane("payload").track({resize:!0})}`),this.request=e,this.decodeRequestParameters=!0;const t=e.requestContentType();t&&(this.decodeRequestParameters=Boolean(t.match(/^application\/x-www-form-urlencoded\s*(;.*)?$/i)));const i=new o.TreeOutline.TreeOutlineInShadow;i.registerCSSFiles([Ee,Me,Ae]),i.element.classList.add("request-payload-tree"),i.makeDense(),this.element.appendChild(i.element),this.queryStringCategory=new De(i,"query-string"),this.formDataCategory=new De(i,"form-data"),this.requestPayloadCategory=new De(i,"request-payload",Ve(Ue.requestPayload))}wasShown(){this.registerCSSFiles([Be]),this.request.addEventListener(n.NetworkRequest.Events.RequestHeadersChanged,this.refreshFormData,this),this.refreshQueryString(),this.refreshFormData()}willHide(){this.request.removeEventListener(n.NetworkRequest.Events.RequestHeadersChanged,this.refreshFormData,this)}addEntryContextMenuHandler(e,i){e.listItemElement.addEventListener("contextmenu",(e=>{e.consume(!0);const r=new o.ContextMenu.ContextMenu(e),s=decodeURIComponent(i);r.clipboardSection().appendItem(Ve(Ue.copyValue),(()=>{t.userMetrics.actionTaken(t.UserMetrics.Action.NetworkPanelCopyValue),t.InspectorFrontendHost.InspectorFrontendHostInstance.copyText(s)}),{jslogContext:"copy-value"}),r.show()}))}static formatParameter(e,t,i){let r=!1;if(i&&(e=e.replace(/\+/g," ")).indexOf("%")>=0)try{e=decodeURIComponent(e)}catch(e){r=!0}const o=document.createElement("div");return t&&(o.className=t),""===e&&o.classList.add("empty-value"),r?o.createChild("span","payload-decode-error").textContent=Ve(Ue.unableToDecodeValue):o.textContent=e,o}refreshQueryString(){const e=this.request.queryString(),t=this.request.queryParameters;this.queryStringCategory.hidden=!t,t&&this.refreshParams(Ve(Ue.queryStringParameters),t,e,this.queryStringCategory)}async refreshFormData(){const e=await this.request.requestFormData();if(!e)return this.formDataCategory.hidden=!0,void(this.requestPayloadCategory.hidden=!0);const t=await this.request.formParameters();if(t)this.formDataCategory.hidden=!1,this.requestPayloadCategory.hidden=!0,this.refreshParams(Ve(Ue.formData),t,e,this.formDataCategory);else{this.requestPayloadCategory.hidden=!1,this.formDataCategory.hidden=!0;try{const t=JSON.parse(e);this.refreshRequestJSONPayload(t,e)}catch(t){this.populateTreeElementWithSourceText(this.requestPayloadCategory,e)}}}populateTreeElementWithSourceText(e,t){const i=(t||"").trim(),r=i.length>3e3,s=document.createElement("span");s.classList.add("payload-value"),s.classList.add("source-code"),s.textContent=r?i.substr(0,3e3):i;const n=new o.TreeOutline.TreeElement(s);if(e.removeChildren(),e.appendChild(n),!r)return;const a=document.createElement("button");function d(){a.remove(),s.textContent=i,n.listItemElement.removeEventListener("contextmenu",c)}function c(e){const t=new o.ContextMenu.ContextMenu(e);t.newSection().appendItem(Ve(Ue.showMore),d,{jslogContext:"show-more"}),t.show()}a.classList.add("request-payload-show-more-button"),a.textContent=Ve(Ue.showMore),a.setAttribute("jslog",`${l.action("show-more").track({click:!0})}`),a.addEventListener("click",d),n.listItemElement.addEventListener("contextmenu",c),s.appendChild(a)}refreshParams(e,t,i,r){r.removeChildren(),r.listItemElement.removeChildren(),r.listItemElement.createChild("div","selection fill"),o.UIUtils.createTextChild(r.listItemElement,e);const s=document.createElement("span");s.classList.add("payload-count");const n=t?t.length:0;s.textContent=` (${n})`,r.listItemElement.appendChild(s);We.has(r)?this.appendParamsSource(e,t,i,r):this.appendParamsParsed(e,t,i,r)}appendParamsSource(e,t,i,r){this.populateTreeElementWithSourceText(r,i);const s=r.listItemElement,n=function(o){s.removeEventListener("contextmenu",a),We.delete(r),this.refreshParams(e,t,i,r),o.consume()},a=e=>{if(!r.expanded)return;const t=new o.ContextMenu.ContextMenu(e);t.newSection().appendItem(Ve(Ue.viewParsed),n.bind(this,e),{jslogContext:"view-parsed"}),t.show()},l=this.createViewSourceToggle(!0,n.bind(this));s.appendChild(l),s.addEventListener("contextmenu",a)}appendParamsParsed(e,t,i,r){for(const e of t||[]){const t=document.createDocumentFragment();if(""!==e.name){const i=Oe.formatParameter(e.name+": ","payload-name",this.decodeRequestParameters),r=Oe.formatParameter(e.value,"payload-value source-code",this.decodeRequestParameters);t.appendChild(i),t.createChild("span","payload-separator"),t.appendChild(r)}else t.appendChild(Oe.formatParameter(Ve(Ue.empty),"empty-request-payload",this.decodeRequestParameters));const i=new o.TreeOutline.TreeElement(t);this.addEntryContextMenuHandler(i,e.value),r.appendChild(i)}const s=r.listItemElement,n=function(o){s.removeEventListener("contextmenu",d),We.add(r),this.refreshParams(e,t,i,r),o.consume()},a=function(e){s.removeEventListener("contextmenu",d),this.toggleURLDecoding(e)},d=e=>{if(!r.expanded)return;const t=new o.ContextMenu.ContextMenu(e),i=t.newSection();i.appendItem(Ve(Ue.viewSource),n.bind(this,e),{jslogContext:"view-source"});const s=this.decodeRequestParameters?Ve(Ue.viewUrlEncoded):Ve(Ue.viewDecoded);i.appendItem(s,a.bind(this,e),{jslogContext:"toggle-url-decoding"}),t.show()},c=this.createViewSourceToggle(!1,n.bind(this));s.appendChild(c);const h=this.decodeRequestParameters?Ve(Ue.viewUrlEncodedL):Ve(Ue.viewDecodedL),u=this.createToggleButton(h);u.setAttribute("jslog",`${l.toggle("decode-encode").track({click:!0})}`),u.addEventListener("click",a.bind(this),!1),s.appendChild(u),s.addEventListener("contextmenu",d)}refreshRequestJSONPayload(e,t){const i=this.requestPayloadCategory;i.removeChildren();const r=i.listItemElement;r.removeChildren(),r.createChild("div","selection fill"),o.UIUtils.createTextChild(r,this.requestPayloadCategory.title.toString()),We.has(i)?this.appendJSONPayloadSource(i,e,t):this.appendJSONPayloadParsed(i,e,t)}appendJSONPayloadSource(e,t,i){const r=e.listItemElement;this.populateTreeElementWithSourceText(e,i);const s=function(o){r.removeEventListener("contextmenu",a),We.delete(e),this.refreshRequestJSONPayload(t,i),o.consume()},n=this.createViewSourceToggle(!0,s.bind(this));r.appendChild(n);const a=t=>{if(!e.expanded)return;const i=new o.ContextMenu.ContextMenu(t);i.newSection().appendItem(Ve(Ue.viewParsed),s.bind(this,t),{jslogContext:"view-parsed"}),i.show()};r.addEventListener("contextmenu",a)}appendJSONPayloadParsed(e,t,i){const r=n.RemoteObject.RemoteObject.fromLocalObject(t),s=new S.ObjectPropertiesSection.RootElement(r);s.title=r.description,s.expand(),s.editable=!1,e.childrenListElement.classList.add("source-code","object-properties-section"),e.appendChild(s);const a=e.listItemElement,l=function(r){a.removeEventListener("contextmenu",d),We.add(e),this.refreshRequestJSONPayload(t,i),r.consume()},d=t=>{if(!e.expanded)return;const i=new o.ContextMenu.ContextMenu(t);i.newSection().appendItem(Ve(Ue.viewSource),l.bind(this,t),{jslogContext:"view-source"}),i.show()},c=this.createViewSourceToggle(!1,l.bind(this));a.appendChild(c),a.addEventListener("contextmenu",d)}createViewSourceToggle(e,t){const i=Ve(e?Ue.viewParsedL:Ue.viewSourceL),r=this.createToggleButton(i);return r.setAttribute("jslog",`${l.toggle("source-parse").track({click:!0})}`),r.addEventListener("click",t,!1),r}toggleURLDecoding(e){this.decodeRequestParameters=!this.decodeRequestParameters,this.refreshQueryString(),this.refreshFormData(),e.consume()}createToggleButton(e){const t=document.createElement("button");return t.classList.add("payload-toggle"),t.tabIndex=0,t.textContent=e,t}}const We=new WeakSet;class De extends o.TreeOutline.TreeElement{toggleOnClick;expandedSetting;expanded;constructor(t,i,r){super(r||"",!0),this.toggleOnClick=!0,this.hidden=!0,this.expandedSetting=e.Settings.Settings.instance().createSetting("request-info-"+i+"-category-expanded",!0),this.expanded=this.expandedSetting.get(),this.listItemElement.setAttribute("jslog",`${l.section().context(i)}`),t.appendChild(this)}createLeaf(){const e=new o.TreeOutline.TreeElement;return this.appendChild(e),e}onexpand(){this.expandedSetting.set(!0)}oncollapse(){this.expandedSetting.set(!1)}}var je=Object.freeze({__proto__:null,RequestPayloadView:Oe,Category:De});const Ge=new CSSStyleSheet;Ge.replaceSync(".html-preview-frame{box-shadow:var(--drop-shadow);background:var(--ref-palette-neutral100);flex-grow:1;margin:20px}\n/*# sourceURL=requestHTMLView.css */\n");class ze extends o.Widget.VBox{dataURL;constructor(e){super(!0),this.dataURL=e,this.contentElement.classList.add("html","request-view")}static create(e){const t=e.asDataUrl();return t?new ze(t):null}wasShown(){this.createIFrame(),this.registerCSSFiles([Ge])}willHide(){this.contentElement.removeChildren()}createIFrame(){this.contentElement.removeChildren();const e=document.createElement("iframe");e.className="html-preview-frame",e.setAttribute("sandbox",""),e.setAttribute("csp","default-src 'none';img-src data:;style-src 'unsafe-inline'"),e.setAttribute("src",this.dataURL),e.tabIndex=-1,o.ARIAUtils.markAsPresentation(e),this.contentElement.appendChild(e)}}var _e=Object.freeze({__proto__:null,RequestHTMLView:ze});const Ke={thisRequestHasNoResponseData:"This request has no response data available.",failedToLoadResponseData:"Failed to load response data"},$e=i.i18n.registerUIStrings("panels/network/RequestResponseView.ts",Ke),Xe=i.i18n.getLocalizedString.bind(void 0,$e);class Ye extends o.Widget.VBox{request;contentViewPromise;constructor(e){super(),this.element.classList.add("request-view"),this.element.setAttribute("jslog",`${l.pane("response").track({resize:!0})}`),this.request=e,this.contentViewPromise=null}static async sourceViewForRequest(i){let o=Je.get(i);if(void 0!==o)return o;const s=await i.requestStreamingContent();if(y.StreamingContentData.isError(s)||!s.isTextContent&&"application/wasm"!==s.mimeType)return Je.delete(i),null;let n;n="application/json"===e.ResourceType.ResourceType.simplifyContentType(i.mimeType)?i.mimeType:i.resourceType().canonicalMimeType()||i.mimeType;const a="application/wasm"!==s.mimeType&&y.TextUtils.isMinified(s.content().text),l=e.ResourceType.ResourceType.mediaTypeForMetrics(n,i.resourceType().isFromSourceMap(),a);return t.userMetrics.networkPanelResponsePreviewOpened(l),o=r.ResourceSourceFrame.ResourceSourceFrame.createSearchableView(i,n),Je.set(i,o),o}wasShown(){this.doShowPreview()}doShowPreview(){return this.contentViewPromise||(this.contentViewPromise=this.showPreview()),this.contentViewPromise}async showPreview(){const e=await this.createPreview();return e.show(this.element),e}async createPreview(){const e=await this.request.requestStreamingContent();if(y.StreamingContentData.isError(e))return new o.EmptyWidget.EmptyWidget(Xe(Ke.failedToLoadResponseData)+": "+e.error);const t=await Ye.sourceViewForRequest(this.request);return t&&204!==this.request.statusCode?t:new o.EmptyWidget.EmptyWidget(Xe(Ke.thisRequestHasNoResponseData))}async revealPosition(e){const t=await this.doShowPreview();t instanceof r.ResourceSourceFrame.SearchableContainer&&t.revealPosition(e)}}const Je=new WeakMap;var Ze=Object.freeze({__proto__:null,RequestResponseView:Ye});const Qe=new CSSStyleSheet;Qe.replaceSync(".tree-outline{padding-left:0}.tree-outline > ol{padding-bottom:5px;border-bottom:solid 1px var(--sys-color-divider)}.tree-outline > .parent{user-select:none;font-weight:bold;color:var(--sys-color-on-surface);margin-top:-1px;display:flex;align-items:center;height:26px}.tree-outline li{padding-left:5px;line-height:20px}.tree-outline li:not(.parent){display:block;margin-left:10px}.tree-outline li:not(.parent)::before{display:none}.tree-outline .header-name{color:var(--sys-color-token-subtle);display:inline-block;margin-right:0.25em;font-weight:bold;vertical-align:top;white-space:pre-wrap}.tree-outline .header-separator{user-select:none}.tree-outline .header-value{display:inline;margin-right:1em;white-space:pre-wrap;word-break:break-all;margin-top:1px}.tree-outline .header-toggle{display:inline;margin-left:30px;font-weight:normal;color:var(--sys-color-state-disabled)}.tree-outline .header-toggle:hover{color:var(--sys-color-state-hover-on-subtle)}.tree-outline .error-log{color:var(--sys-color-error);display:inline-block;margin-right:0.25em;margin-left:0.25em;font-weight:bold;vertical-align:top;white-space:pre-wrap}.tree-outline .hex-data{display:block;word-break:break-word;margin-left:20px}.tree-outline .error-field{color:var(--sys-color-error)}.prompt-icon{margin-top:2px}\n/*# sourceURL=signedExchangeInfoTree.css */\n");const et=new CSSStyleSheet;et.replaceSync(".signed-exchange-info-view{user-select:text;overflow:auto}.signed-exchange-info-tree{flex-grow:1;overflow-y:auto;margin:0}\n/*# sourceURL=signedExchangeInfoView.css */\n");const tt={errors:"Errors",signedHttpExchange:"Signed HTTP exchange",learnmore:"Learn more",requestUrl:"Request URL",responseCode:"Response code",headerIntegrityHash:"Header integrity hash",responseHeaders:"Response headers",signature:"Signature",label:"Label",certificateUrl:"Certificate URL",viewCertificate:"View certificate",integrity:"Integrity",certificateSha:"Certificate SHA256",validityUrl:"Validity URL",date:"Date",expires:"Expires",certificate:"Certificate",subject:"Subject",validFrom:"Valid from",validUntil:"Valid until",issuer:"Issuer"},it=i.i18n.registerUIStrings("panels/network/SignedExchangeInfoView.ts",tt),rt=i.i18n.getLocalizedString.bind(void 0,it);class ot extends o.Widget.VBox{responseHeadersItem;constructor(e){super(),console.assert(null!==e.signedExchangeInfo());const i=e.signedExchangeInfo();this.element.classList.add("signed-exchange-info-view");const r=new o.TreeOutline.TreeOutlineInShadow;r.registerCSSFiles([Qe]),r.element.classList.add("signed-exchange-info-tree"),r.setFocusable(!1),r.makeDense(),r.expandTreeElementsWhenArrowing=!0,this.element.appendChild(r.element);const s=new Map;if(i.errors&&i.errors.length){const e=new st(r,rt(tt.errors));for(const t of i.errors){const i=document.createDocumentFragment(),r=new m.Icon.Icon;if(r.data={iconName:"cross-circle-filled",color:"var(--icon-error)",width:"14px",height:"14px"},r.classList.add("prompt-icon"),i.appendChild(r),i.createChild("div","error-log").textContent=t.message,e.createLeaf(i),t.errorField){let e=s.get(t.signatureIndex);e||(e=new Set,s.set(t.signatureIndex,e)),e.add(t.errorField)}}}const n=document.createDocumentFragment();n.createChild("div","header-name").textContent=rt(tt.signedHttpExchange);const a=o.XLink.XLink.create("https://github.com/WICG/webpackage",rt(tt.learnmore),"header-toggle",void 0,"learn-more");n.appendChild(a);const l=new st(r,n);if(i.header){const n=i.header,a=e.redirectDestination(),d=this.formatHeader(rt(tt.requestUrl),n.requestUrl);if(a){const e=k.Linkifier.Linkifier.linkifyRevealable(a,"View request",void 0,void 0,void 0,"redirect-destination-request");e.classList.add("header-toggle"),d.appendChild(e)}l.createLeaf(d),l.createLeaf(this.formatHeader(rt(tt.responseCode),String(n.responseCode))),l.createLeaf(this.formatHeader(rt(tt.headerIntegrityHash),n.headerIntegrity)),this.responseHeadersItem=l.createLeaf(this.formatHeader(rt(tt.responseHeaders),""));const c=n.responseHeaders;for(const e in c){const t=new o.TreeOutline.TreeElement(this.formatHeader(e,c[e]));t.selectable=!1,this.responseHeadersItem.appendChild(t)}this.responseHeadersItem.expand();for(let e=0;e{e.map((e=>t.appendToolbarItem(e)))})),e}async htmlPreview(){const e=await this.request.requestContentData();if(y.ContentData.ContentData.isError(e))return new o.EmptyWidget.EmptyWidget(dt(at.failedToLoadResponseData)+": "+e.error);if(!new Set(["text/html","text/plain","application/xhtml+xml"]).has(this.request.mimeType))return null;const t=await r.JSONView.JSONView.createView(e.text);return t||ze.create(e)}async createPreview(){if(this.request.signedExchangeInfo())return new ot(this.request);if(this.request.webBundleInfo())return v.LegacyWrapper.legacyWrapper(o.Widget.VBox,new f.WebBundleInfoView.WebBundleInfoView(this.request));const e=await this.htmlPreview();if(e)return e;const t=await r.PreviewFactory.PreviewFactory.createPreview(this.request,this.request.mimeType);return t||new o.EmptyWidget.EmptyWidget(dt(at.previewNotAvailable))}}var ht=Object.freeze({__proto__:null,RequestPreviewView:ct});const ut=new CSSStyleSheet;ut.replaceSync('.network-timing-table{width:380px;border-spacing:0;padding-left:10px;padding-right:10px;line-height:initial;table-layout:fixed}.network-timing-start{border-top:5px solid transparent}.network-timing-start th span.network-timing-hidden-header{height:1px;width:1px;position:absolute;overflow:hidden}.network-timing-table-header td,\n.network-timing-footer td{border-top:10px solid transparent}.network-timing-table-header td{color:var(--sys-color-token-subtle)}.network-timing-table td{padding:4px 0}.network-timing-table-header td:last-child{text-align:right}.network-timing-footer td:last-child{font-weight:bold;text-align:right}table.network-timing-table > tr:not(.network-timing-table-header):not(.network-timing-footer) > td:first-child{padding-left:12px}.network-timing-table col.labels{width:156px}.network-timing-table col.duration{width:80px}.network-timing-table td.caution{font-weight:bold;color:var(--issue-color-yellow);padding:2px 0}.network-timing-table hr.break{background-color:var(--sys-color-divider);border:none;height:1px}.network-timing-row{position:relative;height:15px}.network-timing-bar{position:absolute;min-width:1px;top:0;bottom:0}.network-timing-bar-title{color:var(--sys-color-on-surface);white-space:nowrap;text-align:right}.network-timing-bar.queueing,\n.network-timing-bar.total{border:1px solid var(--sys-color-token-subtle)}.network-timing-bar.blocking,\n.-theme-preserve{background-color:var(--network-overview-blocking)}.network-timing-bar.proxy,\n.-theme-preserve{background-color:var(--override-network-overview-proxy)}.network-timing-bar.dns,\n.-theme-preserve{background-color:var(--sys-color-cyan)}.network-timing-bar.connecting,\n.network-timing-bar.serviceworker,\n.network-timing-bar.serviceworker-preparation,\n.network-timing-bar.serviceworker-routerevaluation,\n.network-timing-bar.serviceworker-cachelookup,\n.-theme-preserve{background-color:var(--network-overview-service-worker)}.network-timing-bar.ssl,\n.-theme-preserve{background-color:var(--network-overview-ssl)}.network-timing-bar.serviceworker-respondwith,\n.-theme-preserve{background-color:var(--network-overview-service-worker-respond-with)}.network-fetch-timing-bar-clickable::before{user-select:none;mask-image:var(--image-file-triangle-right);float:left;width:14px;height:14px;margin-right:2px;content:"";position:relative;background-color:var(--icon-default);transition:transform 200ms}.network-fetch-timing-bar-clickable{position:relative;left:-12px}.network-fetch-timing-bar-clickable:focus-visible{background-color:var(--sys-color-state-focus-highlight)}.network-fetch-timing-bar-clickable[aria-checked="true"]::before{transform:rotate(90deg)}.network-fetch-timing-bar-details-collapsed{display:none}.network-fetch-timing-bar-details-expanded{display:block}.network-fetch-timing-bar-details{padding-left:11px;width:fit-content}.network-fetch-details-treeitem{width:max-content}.network-timing-bar.sending,\n.-theme-preserve{background-color:var(--override-network-overview-sending)}.network-timing-bar.waiting,\n.-theme-preserve{background-color:var(--network-overview-waiting)}.network-timing-bar.receiving,\n.network-timing-bar.receiving-push,\n.-theme-preserve{background-color:var(--network-overview-receiving)}.network-timing-bar.push,\n.-theme-preserve{background-color:var(--network-overview-push)}.server-timing-row:nth-child(even){background:var(--sys-color-surface1)}.network-timing-bar.server-timing,\n.-theme-preserve{background-color:var(--sys-color-neutral-container)}.network-timing-table td.network-timing-metric{white-space:nowrap;max-width:150px;overflow-x:hidden;text-overflow:ellipsis}.network-timing-bar.proxy,\n.network-timing-bar.dns,\n.network-timing-bar.ssl,\n.network-timing-bar.connecting,\n.network-timing-bar.blocking{height:10px;margin:auto}@media (forced-colors: active){.network-timing-bar.blocking,\n .network-timing-bar.proxy,\n .network-timing-bar.dns,\n .network-timing-bar.connecting,\n .network-timing-bar.serviceworker,\n .network-timing-bar.serviceworker-preparation,\n .network-timing-bar.ssl,\n .network-timing-bar.sending,\n .network-timing-bar.waiting,\n .network-timing-bar.receiving,\n .network-timing-bar.receiving-push,\n .network-timing-bar.push,\n .network-timing-bar.server-timing,\n .-theme-preserve{forced-color-adjust:none}.network-timing-table-header td,\n .network-timing-footer td{forced-color-adjust:none;color:ButtonText}}\n/*# sourceURL=networkTimingTable.css */\n');const pt={receivingPush:"Receiving `Push`",queueing:"Queueing",stalled:"Stalled",initialConnection:"Initial connection",dnsLookup:"DNS Lookup",proxyNegotiation:"Proxy negotiation",readingPush:"Reading `Push`",contentDownload:"Content Download",requestSent:"Request sent",requestToServiceworker:"Request to `ServiceWorker`",startup:"Startup",respondwith:"respondWith",ssl:"SSL",total:"Total",waitingTtfb:"Waiting for server response",label:"Label",waterfall:"Waterfall",duration:"Duration",queuedAtS:"Queued at {PH1}",startedAtS:"Started at {PH1}",serverPush:"Server Push",resourceScheduling:"Resource Scheduling",connectionStart:"Connection Start",requestresponse:"Request/Response",cautionRequestIsNotFinishedYet:"CAUTION: request is not finished yet!",explanation:"Explanation",serverTiming:"Server Timing",time:"TIME",theServerTimingApi:"the Server Timing API",duringDevelopmentYouCanUseSToAdd:"During development, you can use {PH1} to add insights into the server-side timing of this request.",durationC:"DURATION",originalRequest:"Original Request",responseReceived:"Response Received",unknown:"Unknown",sourceOfResponseS:"Source of response: {PH1}",cacheStorageCacheNameS:"Cache storage cache name: {PH1}",cacheStorageCacheNameUnknown:"Cache storage cache name: Unknown",retrievalTimeS:"Retrieval Time: {PH1}",serviceworkerCacheStorage:"`ServiceWorker` cache storage",fromHttpCache:"From HTTP cache",networkFetch:"Network fetch",fallbackCode:"Fallback code"},gt=i.i18n.registerUIStrings("panels/network/RequestTimingView.ts",pt),mt=i.i18n.getLocalizedString.bind(void 0,gt);class wt extends o.Widget.VBox{request;calculator;lastMinimumBoundary;tableElement;constructor(e,t){super(),this.element.classList.add("resource-timing-view"),this.request=e,this.calculator=t,this.lastMinimumBoundary=-1}static timeRangeTitle(e){switch(e){case"push":return mt(pt.receivingPush);case"queueing":return mt(pt.queueing);case"blocking":return mt(pt.stalled);case"connecting":return mt(pt.initialConnection);case"dns":return mt(pt.dnsLookup);case"proxy":return mt(pt.proxyNegotiation);case"receiving-push":return mt(pt.readingPush);case"receiving":return mt(pt.contentDownload);case"sending":return mt(pt.requestSent);case"serviceworker":return mt(pt.requestToServiceworker);case"serviceworker-preparation":return mt(pt.startup);case"serviceworker-respondwith":return mt(pt.respondwith);case"ssl":return mt(pt.ssl);case"total":return mt(pt.total);case"waiting":return mt(pt.waitingTtfb);default:return e}}static calculateRequestTimeRanges(e,t){const i=[];function r(e,t,r){t0)return e[t]}function s(e,t,i){t>=0&&i>=0&&r(e,d+t/1e3,d+i/1e3)}function n(e,t,i){r(e,d+t/1e3,d+i/1e3)}const a=e.timing;if(!a){const t=-1!==e.issueTime()?e.issueTime():-1!==e.startTime?e.startTime:0,o=-1!==e.issueTime()&&-1!==e.startTime&&e.issueTime()!==e.startTime,s=-1===e.responseReceivedTime?o?e.startTime:Number.MAX_VALUE:e.responseReceivedTime,n=-1===e.endTime?Number.MAX_VALUE:e.endTime;r("total",t,n),r("blocking",t,s);return r(-1===e.responseReceivedTime?"connecting":"receiving",s,n),i}const l=e.issueTime(),d=a.requestTime,c=o([e.endTime,e.responseReceivedTime])||d;if(r("total",lt&&r("push",Math.max(a.pushStart,t),e)}le.start)).reduce(((e,t)=>Math.min(e,t))),c=a.map((e=>e.end)).reduce(((e,t)=>Math.max(e,t))),h=100/(c-d);let u,p,g,m,w=0;const k=s.createChild("thead","network-timing-start"),b=k.createChild("tr"),v=b.createChild("th");v.createChild("span","network-timing-hidden-header").textContent=mt(pt.label),v.scope="col";const f=b.createChild("th");f.createChild("span","network-timing-hidden-header").textContent=mt(pt.waterfall),f.scope="col";const C=b.createChild("th");C.createChild("span","network-timing-hidden-header").textContent=mt(pt.duration),C.scope="col";const S=k.createChild("tr").createChild("td"),y=k.createChild("tr").createChild("td");let T;S.colSpan=y.colSpan=3,o.UIUtils.createTextChild(S,mt(pt.queuedAtS,{PH1:r.formatValue(t.issueTime(),2)})),o.UIUtils.createTextChild(y,mt(pt.startedAtS,{PH1:r.formatValue(t.startTime,2)}));for(let e=0;e"total"!==e.metric.toLowerCase())).forEach((e=>H(e,L))),q.filter((e=>"total"===e.metric.toLowerCase())).forEach((e=>H(e,L))),s;function H(t,r){const n=new e.Color.Generator({min:0,max:360,count:36},{min:50,max:80,count:void 0},80),a="total"===t.metric.toLowerCase(),l=s.createChild("tr",a?"network-timing-footer":"server-timing-row"),u=l.createChild("td","network-timing-metric"),p=t.description||t.metric;o.UIUtils.createTextChild(u,p),o.Tooltip.Tooltip.install(u,p);const g=l.createChild("td").createChild("div","network-timing-row");if(null===t.value)return;const m=h*(c-d-t.value/1e3);if(m>=0){const e=g.createChild("span","network-timing-bar server-timing");e.style.left=m+"%",e.style.right=r+"%",e.textContent="​",a||(e.style.backgroundColor=n.colorForID(t.metric))}l.createChild("td").createChild("div","network-timing-bar-title").textContent=i.TimeUtilities.millisToString(t.value,!0)}function M(e){const t=s.createChild("tr","network-timing-table-header"),i=t.createChild("td");return o.UIUtils.createTextChild(i,e),o.ARIAUtils.markAsHeading(i,2),o.UIUtils.createTextChild(t.createChild("td"),""),o.UIUtils.createTextChild(t.createChild("td"),mt(pt.durationC)),t}}constructFetchDetailsView(){if(!this.tableElement)return;const e=this.tableElement.ownerDocument,t=e.querySelector(".network-fetch-timing-bar-details");if(!t)return;t.classList.add("network-fetch-timing-bar-details-collapsed"),self.onInvokeElement(this.tableElement,this.onToggleFetchDetails.bind(this,t));const i=new o.TreeOutline.TreeOutlineInShadow;t.appendChild(i.element);const r=a.NetworkLog.NetworkLog.instance().originalRequestForURL(this.request.url());if(r){const e=n.RemoteObject.RemoteObject.fromLocalObject(r),t=new S.ObjectPropertiesSection.RootElement(e);t.title=mt(pt.originalRequest),i.appendChild(t)}const s=a.NetworkLog.NetworkLog.instance().originalResponseForURL(this.request.url());if(s){const e=n.RemoteObject.RemoteObject.fromLocalObject(s),t=new S.ObjectPropertiesSection.RootElement(e);t.title=mt(pt.responseReceived),i.appendChild(t)}const l=e.createElement("div");l.classList.add("network-fetch-details-treeitem");let d=mt(pt.unknown);const c=this.request.serviceWorkerResponseSource();c&&(d=this.getLocalizedResponseSourceForCode(c)),l.textContent=mt(pt.sourceOfResponseS,{PH1:d});const h=new o.TreeOutline.TreeElement(l);i.appendChild(h);const u=e.createElement("div");u.classList.add("network-fetch-details-treeitem");const p=this.request.getResponseCacheStorageCacheName();u.textContent=p?mt(pt.cacheStorageCacheNameS,{PH1:p}):mt(pt.cacheStorageCacheNameUnknown);const g=new o.TreeOutline.TreeElement(u);i.appendChild(g);const m=this.request.getResponseRetrievalTime();if(m){const t=e.createElement("div");t.classList.add("network-fetch-details-treeitem"),t.textContent=mt(pt.retrievalTimeS,{PH1:m.toString()});const r=new o.TreeOutline.TreeElement(t);i.appendChild(r)}}getLocalizedResponseSourceForCode(e){switch(e){case"cache-storage":return mt(pt.serviceworkerCacheStorage);case"http-cache":return mt(pt.fromHttpCache);case"network":return mt(pt.networkFetch);default:return mt(pt.fallbackCode)}}onToggleFetchDetails(e,i){if(!i.target)return;const r=i.target;if(r.classList.contains("network-fetch-timing-bar-clickable")){e.classList.contains("network-fetch-timing-bar-details-collapsed")&&t.userMetrics.actionTaken(t.UserMetrics.Action.NetworkPanelServiceWorkerRespondWith);const i="true"===r.getAttribute("aria-checked");r.setAttribute("aria-checked",String(!i)),e.classList.toggle("network-fetch-timing-bar-details-collapsed"),e.classList.toggle("network-fetch-timing-bar-details-expanded")}}wasShown(){this.request.addEventListener(n.NetworkRequest.Events.TimingChanged,this.refresh,this),this.request.addEventListener(n.NetworkRequest.Events.FinishedLoading,this.refresh,this),this.calculator.addEventListener("BoundariesChanged",this.boundaryChanged,this),this.registerCSSFiles([ut]),this.refresh()}willHide(){this.request.removeEventListener(n.NetworkRequest.Events.TimingChanged,this.refresh,this),this.request.removeEventListener(n.NetworkRequest.Events.FinishedLoading,this.refresh,this),this.calculator.removeEventListener("BoundariesChanged",this.boundaryChanged,this)}refresh(){this.tableElement&&this.tableElement.remove(),this.tableElement=wt.createTimingTable(this.request,this.calculator),this.tableElement.classList.add("resource-timing-table"),this.element.appendChild(this.tableElement),this.request.fetchedViaServiceWorker&&this.constructFetchDetailsView()}boundaryChanged(){const e=this.calculator.minimumBoundary();e!==this.lastMinimumBoundary&&(this.lastMinimumBoundary=e,this.refresh())}}const kt=new Set(["serviceworker","serviceworker-preparation","serviceworker-respondwith","serviceworker-routerevaluation","serviceworker-cachelookup"]),bt=new Set(["queueing","blocking","connecting","dns","proxy","ssl"]);var vt=Object.freeze({__proto__:null,RequestTimingView:wt,ServiceWorkerRangeNames:kt,ConnectionSetupRangeNames:bt});const ft=new CSSStyleSheet;ft.replaceSync('.websocket-frame-view{user-select:text}.websocket-frame-view .data-grid{flex:auto;border:none}.websocket-frame-view .data-grid .data{background-image:none}.websocket-frame-view-td{border-bottom:1px solid var(--sys-color-divider)}.websocket-frame-view .data-grid td,\n.websocket-frame-view .data-grid th{border-left-color:1px solid var(--sys-color-divider)}.websocket-frame-view-row-send td:first-child::before{content:"\\2B06";color:var(--sys-color-tertiary);padding-right:4px}.websocket-frame-view-row-receive td:first-child::before{content:"\\2B07";color:var(--sys-color-error);padding-right:4px}.websocket-frame-view-row-send{background-color:color-mix(in sRGB,var(--sys-color-tertiary-container),transparent 50%)}.websocket-frame-view-row-error{background-color:var(--sys-color-surface-error);color:var(--sys-color-on-surface-error)}.websocket-frame-view .toolbar{border-bottom:1px solid var(--sys-color-divider)}\n/*# sourceURL=webSocketFrameView.css */\n');const Ct={data:"Data",length:"Length",time:"Time",webSocketFrame:"Web Socket Frame",clearAll:"Clear All",filter:"Filter",selectMessageToBrowseItsContent:"Select message to browse its content.",copyMessageD:"Copy message...",copyMessage:"Copy message",clearAllL:"Clear all",sOpcodeSMask:"{PH1} (Opcode {PH2}, mask)",sOpcodeS:"{PH1} (Opcode {PH2})",continuationFrame:"Continuation Frame",textMessage:"Text Message",binaryMessage:"Binary Message",connectionCloseMessage:"Connection Close Message",pingMessage:"Ping Message",pongMessage:"Pong Message",all:"All",send:"Send",receive:"Receive",na:"N/A",filterUsingRegex:"Filter using regex (example: (web)?socket)"},St=i.i18n.registerUIStrings("panels/network/ResourceWebSocketFrameView.ts",Ct),yt=i.i18n.getLocalizedString.bind(void 0,St),Tt=i.i18n.getLazilyComputedLocalizedString.bind(void 0,St);class xt extends o.Widget.VBox{request;splitWidget;dataGrid;timeComparator;mainToolbar;clearAllButton;filterTypeCombobox;filterType;filterTextInput;filterRegex;frameEmptyWidget;selectedNode;currentSelectedNode;messageFilterSetting=e.Settings.Settings.instance().createSetting("network-web-socket-message-filter","");constructor(e){super(),this.element.classList.add("websocket-frame-view"),this.element.setAttribute("jslog",`${l.pane("web-socket-messages").track({resize:!0})}`),this.request=e,this.splitWidget=new o.SplitWidget.SplitWidget(!1,!0,"resource-web-socket-frame-split-view-state"),this.splitWidget.show(this.element);const i=[{id:"data",title:yt(Ct.data),sortable:!1,weight:88},{id:"length",title:yt(Ct.length),sortable:!1,align:"right",weight:5},{id:"time",title:yt(Ct.time),sortable:!0,weight:7}];this.dataGrid=new d.SortableDataGrid.SortableDataGrid({displayName:yt(Ct.webSocketFrame),columns:i,editCallback:void 0,deleteCallback:void 0,refreshCallback:void 0}),this.dataGrid.setRowContextMenuCallback(function(e,i){const r=i,o=r.binaryView();o?o.addCopyToContextMenu(e,yt(Ct.copyMessageD)):e.clipboardSection().appendItem(yt(Ct.copyMessage),t.InspectorFrontendHost.InspectorFrontendHostInstance.copyText.bind(t.InspectorFrontendHost.InspectorFrontendHostInstance,r.data.data),{jslogContext:"copy"});e.footerSection().appendItem(yt(Ct.clearAllL),this.clearFrames.bind(this),{jslogContext:"clear-all"})}.bind(this)),this.dataGrid.setStickToBottom(!0),this.dataGrid.setCellClass("websocket-frame-view-td"),this.timeComparator=Lt,this.dataGrid.sortNodes(this.timeComparator,!1),this.dataGrid.markColumnAsSortedBy("time",d.DataGrid.Order.Ascending),this.dataGrid.addEventListener("SortingChanged",this.sortItems,this),this.dataGrid.setName("resource-web-socket-frame-view"),this.dataGrid.addEventListener("SelectedNode",(e=>{this.onFrameSelected(e)}),this),this.dataGrid.addEventListener("DeselectedNode",this.onFrameDeselected,this),this.mainToolbar=new o.Toolbar.Toolbar(""),this.clearAllButton=new o.Toolbar.ToolbarButton(yt(Ct.clearAll),"clear"),this.clearAllButton.addEventListener("Click",this.clearFrames,this),this.mainToolbar.appendToolbarItem(this.clearAllButton),this.filterTypeCombobox=new o.Toolbar.ToolbarComboBox(this.updateFilterSetting.bind(this),yt(Ct.filter));for(const e of It){const t=this.filterTypeCombobox.createOption(e.label(),e.name);this.filterTypeCombobox.addOption(t)}this.mainToolbar.appendToolbarItem(this.filterTypeCombobox),this.filterType=null;const r=yt(Ct.filterUsingRegex);this.filterTextInput=new o.Toolbar.ToolbarFilter(r,.4),this.filterTextInput.addEventListener("TextChanged",this.updateFilterSetting,this);const s=this.messageFilterSetting.get();s&&this.filterTextInput.setValue(s),this.filterRegex=null,this.mainToolbar.appendToolbarItem(this.filterTextInput);const n=new o.Widget.VBox;n.element.appendChild(this.mainToolbar.element),this.dataGrid.asWidget().show(n.element),n.setMinimumSize(0,72),this.splitWidget.setMainWidget(n),this.frameEmptyWidget=new o.EmptyWidget.EmptyWidget(yt(Ct.selectMessageToBrowseItsContent)),this.splitWidget.setSidebarWidget(this.frameEmptyWidget),this.selectedNode=null,s&&this.applyFilter(s)}static opCodeDescription(e,t){const i=Rt[e]||(()=>"");return yt(t?Ct.sOpcodeSMask:Ct.sOpcodeS,{PH1:i(),PH2:e})}wasShown(){this.refresh(),this.registerCSSFiles([ft]),this.request.addEventListener(n.NetworkRequest.Events.WebsocketFrameAdded,this.frameAdded,this)}willHide(){this.request.removeEventListener(n.NetworkRequest.Events.WebsocketFrameAdded,this.frameAdded,this)}frameAdded(e){const t=e.data;this.frameFilter(t)&&this.dataGrid.insertChild(new qt(this.request.url(),t))}frameFilter(e){return(!this.filterType||e.type===this.filterType)&&(!this.filterRegex||this.filterRegex.test(e.text))}clearFrames(){Ft.set(this.request,this.request.frames().length),this.refresh()}updateFilterSetting(){const e=this.filterTextInput.value();this.messageFilterSetting.set(e),this.applyFilter(e)}applyFilter(e){const t=this.filterTypeCombobox.selectedOption().value;if(e)try{this.filterRegex=new RegExp(e,"i")}catch(t){this.filterRegex=new RegExp(s.StringUtilities.escapeForRegExp(e),"i")}else this.filterRegex=null;this.filterType="all"===t?null:t,this.refresh()}async onFrameSelected(t){this.currentSelectedNode=t.data;const i=this.currentSelectedNode.dataText(),o=this.currentSelectedNode.binaryView();if(o)return void this.splitWidget.setSidebarWidget(o);const s=await r.JSONView.JSONView.createView(i);s?this.splitWidget.setSidebarWidget(s):this.splitWidget.setSidebarWidget(new r.ResourceSourceFrame.ResourceSourceFrame(y.StaticContentProvider.StaticContentProvider.fromString(this.request.url(),e.ResourceType.resourceTypes.WebSocket,i),""))}onFrameDeselected(){this.currentSelectedNode=null,this.splitWidget.setSidebarWidget(this.frameEmptyWidget)}refresh(){this.dataGrid.rootNode().removeChildren();const e=this.request.url();let t=this.request.frames();const i=Ft.get(this.request)||0;t=t.slice(i),t=t.filter(this.frameFilter.bind(this)),t.forEach((t=>this.dataGrid.insertChild(new qt(e,t))))}sortItems(){this.dataGrid.sortNodes(this.timeComparator,!this.dataGrid.isSortOrderAscending())}}const Rt=function(){const e=[];return e[0]=Tt(Ct.continuationFrame),e[1]=Tt(Ct.textMessage),e[2]=Tt(Ct.binaryMessage),e[8]=Tt(Ct.connectionCloseMessage),e[9]=Tt(Ct.pingMessage),e[10]=Tt(Ct.pongMessage),e}(),It=[{name:"all",label:Tt(Ct.all),jslogContext:"all"},{name:"send",label:Tt(Ct.send),jslogContext:"send"},{name:"receive",label:Tt(Ct.receive),jslogContext:"receive"}];class qt extends d.SortableDataGrid.SortableDataGridNode{url;frame;isTextFrame;dataTextInternal;binaryViewInternal;constructor(e,t){let i=String(t.text.length);const r=new Date(1e3*t.time),a=("0"+r.getHours()).substr(-2)+":"+("0"+r.getMinutes()).substr(-2)+":"+("0"+r.getSeconds()).substr(-2)+"."+("00"+r.getMilliseconds()).substr(-3),l=document.createElement("div");o.UIUtils.createTextChild(l,a),o.Tooltip.Tooltip.install(l,r.toLocaleString());let d=t.text,c=xt.opCodeDescription(t.opCode,t.mask);const h=1===t.opCode;t.type===n.NetworkRequest.WebSocketFrameType.Error?(c=d,i=yt(Ct.na)):h?c=d:2===t.opCode?(i=s.NumberUtilities.bytesToString(s.StringUtilities.base64ToSize(t.text)),c=Rt[t.opCode]()):d=c,super({data:c,length:i,time:l}),this.url=e,this.frame=t,this.isTextFrame=h,this.dataTextInternal=d,this.binaryViewInternal=null}createCells(e){e.classList.toggle("websocket-frame-view-row-error",this.frame.type===n.NetworkRequest.WebSocketFrameType.Error),e.classList.toggle("websocket-frame-view-row-send",this.frame.type===n.NetworkRequest.WebSocketFrameType.Send),e.classList.toggle("websocket-frame-view-row-receive",this.frame.type===n.NetworkRequest.WebSocketFrameType.Receive),super.createCells(e)}nodeSelfHeight(){return 21}dataText(){return this.dataTextInternal}opCode(){return this.frame.opCode}binaryView(){return this.isTextFrame||this.frame.type===n.NetworkRequest.WebSocketFrameType.Error?null:(this.binaryViewInternal||this.dataTextInternal.length>0&&(this.binaryViewInternal=new N(this.dataTextInternal,s.DevToolsPath.EmptyUrlString,e.ResourceType.resourceTypes.WebSocket)),this.binaryViewInternal)}}function Lt(e,t){return e.frame.time-t.frame.time}const Ft=new WeakMap;var Pt=Object.freeze({__proto__:null,ResourceWebSocketFrameView:xt,opCodeDescriptions:Rt,ResourceWebSocketFrameNode:qt});const Ht={headers:"Headers",payload:"Payload",messages:"Messages",websocketMessages:"WebSocket messages",eventstream:"EventStream",preview:"Preview",responsePreview:"Response preview",signedexchangeError:"SignedExchange error",response:"Response",rawResponseData:"Raw response data",initiator:"Initiator",requestInitiatorCallStack:"Request initiator call stack",timing:"Timing",requestAndResponseTimeline:"Request and response timeline",thirdPartyPhaseout:"Cookies blocked due to third-party cookie phaseout.",trustTokens:"Private state tokens",trustTokenOperationDetails:"Private State Token operation details",cookies:"Cookies",requestAndResponseCookies:"Request and response cookies",containsOverriddenHeaders:"This response contains headers which are overridden by DevTools",responseIsOverridden:"This response is overridden by DevTools"},Mt=i.i18n.registerUIStrings("panels/network/NetworkItemView.ts",Ht),Et=i.i18n.getLocalizedString.bind(void 0,Mt);class At extends o.TabbedPane.TabbedPane{requestInternal;resourceViewTabSetting;headersViewComponent;payloadView;responseView;cookiesView;initialTab;constructor(t,i,r){super(),this.requestInternal=t,this.element.classList.add("network-item-view"),this.headerElement().setAttribute("jslog",`${l.toolbar("request-details").track({keydown:"ArrowUp|ArrowLeft|ArrowDown|ArrowRight|Enter|Space"})}`);if(this.resourceViewTabSetting=e.Settings.Settings.instance().createSetting("resource-view-tab","headers-component"),this.headersViewComponent=new f.RequestHeadersView.RequestHeadersView(t),this.appendTab("headers-component",Et(Ht.headers),v.LegacyWrapper.legacyWrapper(o.Widget.VBox,this.headersViewComponent),Et(Ht.headers)),this.requestInternal.hasOverriddenHeaders()){const e=new m.Icon.Icon;e.data={iconName:"small-status-dot",color:"var(--sys-color-purple-bright)",width:"16px",height:"16px"},e.title=Et(Ht.containsOverriddenHeaders),this.setTabIcon("headers-component",e)}if(this.payloadView=null,this.maybeAppendPayloadPanel(),this.addEventListener(o.TabbedPane.Events.TabSelected,this.tabSelected,this),t.resourceType()===e.ResourceType.resourceTypes.WebSocket){const e=new xt(t);this.appendTab("web-socket-frames",Et(Ht.messages),e,Et(Ht.websocketMessages))}else if("text/event-stream"===t.mimeType)this.appendTab("eventSource",Et(Ht.eventstream),new J(t)),this.responseView=new Ye(t),this.appendTab("response",Et(Ht.response),this.responseView,Et(Ht.rawResponseData));else{this.responseView=new Ye(t);const e=new ct(t);this.appendTab("preview",Et(Ht.preview),e,Et(Ht.responsePreview));const i=t.signedExchangeInfo();if(i&&i.errors&&i.errors.length){const e=new m.Icon.Icon;e.data={iconName:"cross-circle-filled",color:"var(--icon-error)",width:"14px",height:"14px"},o.Tooltip.Tooltip.install(e,Et(Ht.signedexchangeError)),this.setTabIcon("preview",e)}if(this.appendTab("response",Et(Ht.response),this.responseView,Et(Ht.rawResponseData)),this.requestInternal.hasOverriddenContent){const e=new m.Icon.Icon;e.title=Et(Ht.responseIsOverridden),e.data={iconName:"small-status-dot",color:"var(--sys-color-purple-bright)",width:"16px",height:"16px"},this.setTabIcon("response",e)}}this.appendTab("initiator",Et(Ht.initiator),new Pe(t),Et(Ht.requestInitiatorCallStack)),this.appendTab("timing",Et(Ht.timing),new wt(t,i),Et(Ht.requestAndResponseTimeline)),t.trustTokenParams()&&this.appendTab("trust-tokens",Et(Ht.trustTokens),v.LegacyWrapper.legacyWrapper(o.Widget.VBox,new f.RequestTrustTokensView.RequestTrustTokensView(t)),Et(Ht.trustTokenOperationDetails)),this.cookiesView=null,this.initialTab=r||this.resourceViewTabSetting.get(),this.setAutoSelectFirstItemOnShow(!1)}wasShown(){super.wasShown(),this.requestInternal.addEventListener(n.NetworkRequest.Events.RequestHeadersChanged,this.requestHeadersChanged,this),this.requestInternal.addEventListener(n.NetworkRequest.Events.ResponseHeadersChanged,this.maybeAppendCookiesPanel,this),this.requestInternal.addEventListener(n.NetworkRequest.Events.TrustTokenResultAdded,this.maybeShowErrorIconInTrustTokenTabHeader,this),this.maybeAppendCookiesPanel(),this.maybeShowErrorIconInTrustTokenTabHeader(),this.initialTab&&(this.selectTabInternal(this.initialTab),this.initialTab=void 0)}willHide(){this.requestInternal.removeEventListener(n.NetworkRequest.Events.RequestHeadersChanged,this.requestHeadersChanged,this),this.requestInternal.removeEventListener(n.NetworkRequest.Events.ResponseHeadersChanged,this.maybeAppendCookiesPanel,this),this.requestInternal.removeEventListener(n.NetworkRequest.Events.TrustTokenResultAdded,this.maybeShowErrorIconInTrustTokenTabHeader,this)}async requestHeadersChanged(){this.maybeAppendCookiesPanel(),this.maybeAppendPayloadPanel()}maybeAppendCookiesPanel(){const e=this.requestInternal.hasRequestCookies()||this.requestInternal.responseCookies.length>0;if(console.assert(e||!this.cookiesView,"Cookies were introduced in headers and then removed!"),e&&!this.cookiesView&&(this.cookiesView=new Te(this.requestInternal),this.appendTab("cookies",Et(Ht.cookies),this.cookiesView,Et(Ht.requestAndResponseCookies))),this.requestInternal.hasThirdPartyCookiePhaseoutIssue()){const e=new m.Icon.Icon;e.data={iconName:"warning-filled",color:"var(--icon-warning)",width:"14px",height:"14px"},e.title=Et(Ht.thirdPartyPhaseout),this.setTabIcon("cookies",e)}}async maybeAppendPayloadPanel(){this.hasTab("payload")||(this.requestInternal.queryParameters||await this.requestInternal.requestFormData())&&(this.payloadView=new Oe(this.requestInternal),this.appendTab("payload",Et(Ht.payload),this.payloadView,Et(Ht.payload),void 0,void 0,void 0,1))}maybeShowErrorIconInTrustTokenTabHeader(){const e=this.requestInternal.trustTokenOperationDoneEvent();if(e&&!f.RequestTrustTokensView.statusConsideredSuccess(e.status)){const e=new m.Icon.Icon;e.data={iconName:"cross-circle-filled",color:"var(--icon-error)",width:"14px",height:"14px"},this.setTabIcon("trust-tokens",e)}}selectTabInternal(e){this.selectTab(e)||window.setTimeout((()=>{this.selectTab(e)||this.selectTab("headers-component")}),0)}tabSelected(e){e.data.isUserGesture&&this.resourceViewTabSetting.set(e.data.tabId)}request(){return this.requestInternal}async revealResponseBody(e){this.selectTabInternal("response"),await(this.responseView?.revealPosition(e))}revealHeader(e,t){this.selectTabInternal("headers-component"),this.headersViewComponent.revealHeader(e,t)}getHeadersViewComponent(){return this.headersViewComponent}}var Bt=Object.freeze({__proto__:null,NetworkItemView:At});const Ut={sLatencySDownloadSTotal:"{PH1} latency, {PH2} download ({PH3} total)",sLatency:"{PH1} latency",sDownload:"{PH1} download",sFromServiceworker:"{PH1} (from `ServiceWorker`)",sFromCache:"{PH1} (from cache)"},Nt=i.i18n.registerUIStrings("panels/network/NetworkTimeCalculator.ts",Ut),Vt=i.i18n.getLocalizedString.bind(void 0,Nt);class Ot{minimum;maximum;constructor(e,t){this.minimum=e,this.maximum=t}equals(e){return this.minimum===e.minimum&&this.maximum===e.maximum}}class Wt extends e.ObjectWrapper.ObjectWrapper{startAtZero;minimumBoundaryInternal;maximumBoundaryInternal;boundryChangedEventThrottler;window;workingArea;constructor(t){super(),this.startAtZero=t,this.minimumBoundaryInternal=-1,this.maximumBoundaryInternal=-1,this.boundryChangedEventThrottler=new e.Throttler.Throttler(0),this.window=null}setWindow(e){this.window=e,this.boundaryChanged()}setInitialUserFriendlyBoundaries(){this.minimumBoundaryInternal=0,this.maximumBoundaryInternal=1}computePosition(e){return(e-this.minimumBoundary())/this.boundarySpan()*(this.workingArea||0)}formatValue(e,t){return i.TimeUtilities.secondsToString(e,Boolean(t))}minimumBoundary(){return this.window?this.window.minimum:this.minimumBoundaryInternal}zeroTime(){return this.minimumBoundaryInternal}maximumBoundary(){return this.window?this.window.maximum:this.maximumBoundaryInternal}boundary(){return new Ot(this.minimumBoundary(),this.maximumBoundary())}boundarySpan(){return this.maximumBoundary()-this.minimumBoundary()}reset(){this.minimumBoundaryInternal=-1,this.maximumBoundaryInternal=-1,this.boundaryChanged()}value(){return 0}setDisplayWidth(e){this.workingArea=e}computeBarGraphPercentages(e){let t,i,r;return t=-1!==e.startTime?(e.startTime-this.minimumBoundary())/this.boundarySpan()*100:0,i=-1!==e.responseReceivedTime?(e.responseReceivedTime-this.minimumBoundary())/this.boundarySpan()*100:this.startAtZero?t:100,r=-1!==e.endTime?(e.endTime-this.minimumBoundary())/this.boundarySpan()*100:this.startAtZero?i:100,this.startAtZero&&(r-=t,i-=t,t=0),{start:t,middle:i,end:r}}computePercentageFromEventTime(e){return-1===e||this.startAtZero?0:(e-this.minimumBoundary())/this.boundarySpan()*100}percentageToTime(e){return e*this.boundarySpan()/100+this.minimumBoundary()}boundaryChanged(){this.boundryChangedEventThrottler.schedule((async()=>{this.dispatchEventToListeners("BoundariesChanged")}))}updateBoundariesForEventTime(e){-1===e||this.startAtZero||(void 0===this.maximumBoundaryInternal||e>this.maximumBoundaryInternal)&&(this.maximumBoundaryInternal=e,this.boundaryChanged())}computeBarGraphLabels(e){let t="";-1!==e.responseReceivedTime&&-1!==e.endTime&&(t=i.TimeUtilities.secondsToString(e.endTime-e.responseReceivedTime));const r=e.latency>0,o=r?i.TimeUtilities.secondsToString(e.latency):t;if(e.timing)return{left:o,right:t,tooltip:void 0};let s;if(r&&t){const r=i.TimeUtilities.secondsToString(e.duration);s=Vt(Ut.sLatencySDownloadSTotal,{PH1:o,PH2:t,PH3:r})}else r?s=Vt(Ut.sLatency,{PH1:o}):t&&(s=Vt(Ut.sDownload,{PH1:t}));return e.fetchedViaServiceWorker?s=Vt(Ut.sFromServiceworker,{PH1:String(s)}):e.cached()&&(s=Vt(Ut.sFromCache,{PH1:String(s)})),{left:o,right:t,tooltip:s}}updateBoundaries(e){const t=this.lowerBound(e),i=this.upperBound(e);let r=!1;(-1!==t||this.startAtZero)&&(r=this.extendBoundariesToIncludeTimestamp(this.startAtZero?0:t)),-1!==i&&(r=this.extendBoundariesToIncludeTimestamp(i)||r),r&&this.boundaryChanged()}extendBoundariesToIncludeTimestamp(e){const t=this.minimumBoundaryInternal,i=this.maximumBoundaryInternal,r=Dt;return-1===this.minimumBoundaryInternal||-1===this.maximumBoundaryInternal?(this.minimumBoundaryInternal=e,this.maximumBoundaryInternal=e+r):(this.minimumBoundaryInternal=Math.min(e,this.minimumBoundaryInternal),this.maximumBoundaryInternal=Math.max(e,this.minimumBoundaryInternal+r,this.maximumBoundaryInternal)),t!==this.minimumBoundaryInternal||i!==this.maximumBoundaryInternal}lowerBound(e){return 0}upperBound(e){return 0}}const Dt=.1;class jt extends Wt{constructor(){super(!1)}formatValue(e,t){return i.TimeUtilities.secondsToString(e-this.zeroTime(),Boolean(t))}lowerBound(e){return e.issueTime()}upperBound(e){return e.endTime}}class Gt extends Wt{constructor(){super(!0)}formatValue(e,t){return i.TimeUtilities.secondsToString(e,Boolean(t))}upperBound(e){return e.duration}}var zt=Object.freeze({__proto__:null,NetworkTimeBoundary:Ot,NetworkTimeCalculator:Wt,NetworkTransferTimeCalculator:jt,NetworkTransferDurationCalculator:Gt});class _t{parentView;activeGroups;constructor(e){this.parentView=e,this.activeGroups=new Map}groupNodeForRequest(e){const t=n.ResourceTreeModel.ResourceTreeModel.frameForRequest(e);if(!t||t.isOutermostFrame())return null;let i=this.activeGroups.get(t);return i||(i=new Kt(this.parentView,t),this.activeGroups.set(t,i),i)}reset(){this.activeGroups.clear()}}class Kt extends be{frame;constructor(e,t){super(e),this.frame=t}displayName(){return new e.ParsedURL.ParsedURL(this.frame.url).domain()||this.frame.name||"