angular-grab 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +215 -0
- package/examples/angular-19-app/.editorconfig +17 -0
- package/examples/angular-19-app/.vscode/extensions.json +4 -0
- package/examples/angular-19-app/.vscode/launch.json +20 -0
- package/examples/angular-19-app/.vscode/mcp.json +9 -0
- package/examples/angular-19-app/.vscode/tasks.json +42 -0
- package/examples/angular-19-app/README.md +59 -0
- package/examples/angular-19-app/angular.json +74 -0
- package/examples/angular-19-app/package.json +44 -0
- package/examples/angular-19-app/public/favicon.ico +0 -0
- package/examples/angular-19-app/src/app/app.config.ts +13 -0
- package/examples/angular-19-app/src/app/app.css +37 -0
- package/examples/angular-19-app/src/app/app.html +25 -0
- package/examples/angular-19-app/src/app/app.routes.ts +3 -0
- package/examples/angular-19-app/src/app/app.spec.ts +23 -0
- package/examples/angular-19-app/src/app/app.ts +12 -0
- package/examples/angular-19-app/src/app/button/button.component.ts +25 -0
- package/examples/angular-19-app/src/app/card/card.component.ts +33 -0
- package/examples/angular-19-app/src/app/header/header.component.ts +31 -0
- package/examples/angular-19-app/src/app/popover/popover.component.ts +133 -0
- package/examples/angular-19-app/src/index.html +13 -0
- package/examples/angular-19-app/src/main.ts +6 -0
- package/examples/angular-19-app/src/styles.css +1 -0
- package/examples/angular-19-app/tsconfig.app.json +15 -0
- package/examples/angular-19-app/tsconfig.json +33 -0
- package/examples/angular-19-app/tsconfig.spec.json +15 -0
- package/package.json +14 -111
- package/packages/angular-grab/package.json +96 -0
- package/packages/angular-grab/src/angular/__tests__/context-builder.test.ts +216 -0
- package/packages/angular-grab/src/angular/angular-grab.service.ts +62 -0
- package/packages/angular-grab/src/angular/index.ts +13 -0
- package/packages/angular-grab/src/angular/provide-angular-grab.ts +22 -0
- package/packages/angular-grab/src/angular/resolvers/component-resolver.ts +71 -0
- package/packages/angular-grab/src/angular/resolvers/context-builder.ts +86 -0
- package/packages/angular-grab/src/angular/resolvers/ng-utils.ts +14 -0
- package/packages/angular-grab/src/angular/resolvers/source-resolver.ts +61 -0
- package/packages/angular-grab/src/builder/__tests__/builder.test.ts +72 -0
- package/packages/angular-grab/src/builder/builders/application/index.ts +13 -0
- package/packages/angular-grab/src/builder/builders/dev-server/index.ts +9 -0
- package/packages/angular-grab/src/builder/index.ts +3 -0
- package/packages/angular-grab/src/cli/__tests__/cli.test.ts +239 -0
- package/packages/angular-grab/src/cli/commands/init.ts +106 -0
- package/packages/angular-grab/src/cli/index.ts +15 -0
- package/packages/angular-grab/src/cli/utils/detect-project.ts +78 -0
- package/packages/angular-grab/src/cli/utils/modify-angular-json.ts +42 -0
- package/packages/angular-grab/src/cli/utils/modify-app-config.ts +42 -0
- package/packages/angular-grab/src/core/__tests__/generate-snippet.test.ts +149 -0
- package/packages/angular-grab/src/core/__tests__/plugin-registry.test.ts +286 -0
- package/packages/angular-grab/src/core/__tests__/store.test.ts +118 -0
- package/packages/angular-grab/src/core/__tests__/utils.test.ts +85 -0
- package/packages/angular-grab/src/core/clipboard/copy.ts +104 -0
- package/packages/angular-grab/src/core/clipboard/generate-snippet.ts +38 -0
- package/packages/angular-grab/src/core/constants.ts +10 -0
- package/packages/angular-grab/src/core/grab.ts +596 -0
- package/packages/angular-grab/src/core/index.global.ts +13 -0
- package/packages/angular-grab/src/core/index.ts +19 -0
- package/packages/angular-grab/src/core/keyboard/keyboard-handler.ts +163 -0
- package/packages/angular-grab/src/core/overlay/crosshair.ts +107 -0
- package/packages/angular-grab/src/core/overlay/freeze-overlay.ts +239 -0
- package/packages/angular-grab/src/core/overlay/overlay-renderer.ts +180 -0
- package/packages/angular-grab/src/core/overlay/select-feedback.ts +108 -0
- package/packages/angular-grab/src/core/overlay/toast.ts +175 -0
- package/packages/angular-grab/src/core/picker/element-picker.ts +114 -0
- package/packages/angular-grab/src/core/plugins/plugin-registry.ts +83 -0
- package/packages/angular-grab/src/core/store.ts +52 -0
- package/packages/angular-grab/src/core/toolbar/actions-menu.ts +178 -0
- package/packages/angular-grab/src/core/toolbar/comment-popover.ts +235 -0
- package/packages/angular-grab/src/core/toolbar/copy-actions.ts +98 -0
- package/packages/angular-grab/src/core/toolbar/history-popover.ts +245 -0
- package/packages/angular-grab/src/core/toolbar/theme-manager.ts +188 -0
- package/packages/angular-grab/src/core/toolbar/toolbar-icons.ts +29 -0
- package/packages/angular-grab/src/core/toolbar/toolbar-renderer.ts +239 -0
- package/packages/angular-grab/src/core/types.ts +139 -0
- package/packages/angular-grab/src/core/utils.ts +16 -0
- package/packages/angular-grab/src/esbuild-plugin/__tests__/transform.test.ts +174 -0
- package/packages/angular-grab/src/esbuild-plugin/index.ts +3 -0
- package/packages/angular-grab/src/esbuild-plugin/plugin.ts +29 -0
- package/packages/angular-grab/src/esbuild-plugin/scan.ts +105 -0
- package/packages/angular-grab/src/esbuild-plugin/transform.ts +152 -0
- package/packages/angular-grab/src/vite-plugin/__tests__/plugin.test.ts +84 -0
- package/packages/angular-grab/src/vite-plugin/index.ts +19 -0
- package/packages/angular-grab/src/webpack-plugin/__tests__/plugin.test.ts +72 -0
- package/packages/angular-grab/src/webpack-plugin/index.ts +2 -0
- package/packages/angular-grab/src/webpack-plugin/loader.ts +15 -0
- package/packages/angular-grab/src/webpack-plugin/plugin.ts +20 -0
- package/packages/angular-grab/tsconfig.json +15 -0
- package/packages/angular-grab/tsup.config.ts +119 -0
- package/pnpm-workspace.yaml +3 -0
- package/turbo.json +21 -0
- package/dist/angular/index.d.ts +0 -151
- package/dist/angular/index.js +0 -2811
- package/dist/angular/index.js.map +0 -1
- package/dist/builder/builders/application/index.js +0 -143
- package/dist/builder/builders/application/index.js.map +0 -1
- package/dist/builder/builders/dev-server/index.js +0 -139
- package/dist/builder/builders/dev-server/index.js.map +0 -1
- package/dist/builder/index.js +0 -2
- package/dist/builder/index.js.map +0 -1
- package/dist/builder/package.json +0 -1
- package/dist/cli/index.js +0 -223
- package/dist/cli/index.js.map +0 -1
- package/dist/core/index.cjs +0 -2589
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.d.cts +0 -139
- package/dist/core/index.d.ts +0 -139
- package/dist/core/index.global.js +0 -542
- package/dist/core/index.js +0 -2560
- package/dist/core/index.js.map +0 -1
- package/dist/esbuild-plugin/index.cjs +0 -239
- package/dist/esbuild-plugin/index.cjs.map +0 -1
- package/dist/esbuild-plugin/index.d.cts +0 -26
- package/dist/esbuild-plugin/index.d.ts +0 -26
- package/dist/esbuild-plugin/index.js +0 -200
- package/dist/esbuild-plugin/index.js.map +0 -1
- package/dist/vite-plugin/index.d.ts +0 -7
- package/dist/vite-plugin/index.js +0 -128
- package/dist/vite-plugin/index.js.map +0 -1
- package/dist/webpack-plugin/index.cjs +0 -54
- package/dist/webpack-plugin/index.cjs.map +0 -1
- package/dist/webpack-plugin/index.d.cts +0 -5
- package/dist/webpack-plugin/index.d.ts +0 -5
- package/dist/webpack-plugin/index.js +0 -23
- package/dist/webpack-plugin/index.js.map +0 -1
- package/dist/webpack-plugin/loader.cjs +0 -155
- package/dist/webpack-plugin/loader.cjs.map +0 -1
- package/dist/webpack-plugin/loader.d.cts +0 -3
- package/dist/webpack-plugin/loader.d.ts +0 -3
- package/dist/webpack-plugin/loader.js +0 -122
- package/dist/webpack-plugin/loader.js.map +0 -1
- /package/{builders.json → packages/angular-grab/builders.json} +0 -0
- /package/{dist → packages/angular-grab/src}/builder/builders/application/schema.json +0 -0
- /package/{dist → packages/angular-grab/src}/builder/builders/dev-server/schema.json +0 -0
|
@@ -1,542 +0,0 @@
|
|
|
1
|
-
"use strict";var AngularGrab=(()=>{function Ee(e){let o=new Set,n={active:!1,frozen:!1,hoveredElement:null,options:e,toolbar:{visible:e.showToolbar,themeMode:e.themeMode,history:[],pendingAction:null}},t=new Proxy(n,{set(r,c,i){let l=c;return r[l]===i||(Reflect.set(r,l,i),o.forEach(s=>s(t,l))),!0}});return{state:t,subscribe(r){return o.add(r),()=>o.delete(r)}}}var Ce="72px",N="68px";var X="__ag-overlay__",Z="__ag-label__",U="__ag-styles__";function we(){let e=null,o=null,n=null,t=null,r=null,c=null,i=[];function l(){if(document.getElementById(U))return;let p=document.createElement("style");p.id=U,p.textContent=`
|
|
2
|
-
#${X} {
|
|
3
|
-
position: fixed;
|
|
4
|
-
pointer-events: none;
|
|
5
|
-
z-index: ${2147483646};
|
|
6
|
-
border: 2px solid var(--ag-overlay-border, #3b82f6);
|
|
7
|
-
background: var(--ag-overlay-bg, rgba(59, 130, 246, 0.1));
|
|
8
|
-
transition: top 0.05s ease, left 0.05s ease, width 0.05s ease, height 0.05s ease;
|
|
9
|
-
box-sizing: border-box;
|
|
10
|
-
}
|
|
11
|
-
#${Z} {
|
|
12
|
-
position: fixed;
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
z-index: ${2147483647};
|
|
15
|
-
background: var(--ag-label-bg, #3b82f6);
|
|
16
|
-
color: var(--ag-label-text, #fff);
|
|
17
|
-
font: 11px/1.4 monospace;
|
|
18
|
-
padding: 2px 6px;
|
|
19
|
-
border-radius: 3px;
|
|
20
|
-
white-space: nowrap;
|
|
21
|
-
box-sizing: border-box;
|
|
22
|
-
max-width: 100vw;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
text-overflow: ellipsis;
|
|
25
|
-
}
|
|
26
|
-
`,document.head.appendChild(p)}function s(){e||(l(),e=document.createElement("div"),e.id=X,document.body.appendChild(e)),o||(o=document.createElement("div"),o.id=Z,document.body.appendChild(o))}function u(){if(!t||!e||!o)return;let p=t.getBoundingClientRect();if(p.width===0&&p.height===0&&!t.isConnected){e.style.display="none",o.style.display="none";return}e.style.top=`${p.top}px`,e.style.left=`${p.left}px`,e.style.width=`${p.width}px`,e.style.height=`${p.height}px`,e.style.display="block";let g=`<${t.tagName.toLowerCase()}>`;i.length>0&&(g+=` .${i.join(".")}`),r&&(g+=` in ${r}`),c&&(g+=` \u2014 ${c}`),o.textContent=g;let C=20,P=4,A=p.top-C-P;A<0&&(A=p.bottom+P);let f=p.left;o.style.top=`${A}px`,o.style.left=`${f}px`,o.style.display="block";let b=o.getBoundingClientRect(),y=document.documentElement.clientWidth;b.right>y&&(f=Math.max(0,y-b.width),o.style.left=`${f}px`),f<0&&(o.style.left="0px")}function a(){u(),n=requestAnimationFrame(a)}function m(){n!==null&&(cancelAnimationFrame(n),n=null)}return{show(p,v,g,C){s(),t=p,r=v,c=g??null,i=C??[],m(),a()},hide(){m(),t=null,r=null,c=null,i=[],e&&(e.style.display="none"),o&&(o.style.display="none")},isOverlayElement(p){return p===e||p===o||p.id===X||p.id===Z},dispose(){m(),t=null,r=null,c=null,i=[],e?.remove(),o?.remove(),document.getElementById(U)?.remove(),e=null,o=null}}}var Q="__ag-crosshair-styles__",J="__ag-crosshair-h__",ee="__ag-crosshair-v__";function ke(){let e=null,o=null,n=!1;function t(){if(document.getElementById(Q))return;let i=document.createElement("style");i.id=Q,i.textContent=`
|
|
27
|
-
.ag-crosshair-line {
|
|
28
|
-
position: fixed;
|
|
29
|
-
pointer-events: none;
|
|
30
|
-
z-index: ${2147483645};
|
|
31
|
-
background: var(--ag-accent, #3b82f6);
|
|
32
|
-
opacity: 0.25;
|
|
33
|
-
transition: none;
|
|
34
|
-
}
|
|
35
|
-
#${J} {
|
|
36
|
-
left: 0;
|
|
37
|
-
right: 0;
|
|
38
|
-
height: 1px;
|
|
39
|
-
}
|
|
40
|
-
#${ee} {
|
|
41
|
-
top: 0;
|
|
42
|
-
bottom: 0;
|
|
43
|
-
width: 1px;
|
|
44
|
-
}
|
|
45
|
-
body.ag-crosshair-active {
|
|
46
|
-
cursor: crosshair !important;
|
|
47
|
-
}
|
|
48
|
-
`,document.head.appendChild(i)}function r(){e||(t(),e=document.createElement("div"),e.id=J,e.className="ag-crosshair-line",document.body.appendChild(e)),o||(o=document.createElement("div"),o.id=ee,o.className="ag-crosshair-line",document.body.appendChild(o))}function c(i){e&&(e.style.top=`${i.clientY}px`),o&&(o.style.left=`${i.clientX}px`)}return{activate(){n||(n=!0,r(),document.body.classList.add("ag-crosshair-active"),document.addEventListener("mousemove",c,!0))},deactivate(){n&&(n=!1,document.body.classList.remove("ag-crosshair-active"),document.removeEventListener("mousemove",c,!0),e&&(e.style.top="-10px"),o&&(o.style.left="-10px"))},isCrosshairElement(i){return i===e||i===o||i.id===J||i.id===ee},dispose(){this.deactivate(),e?.remove(),o?.remove(),document.getElementById(Q)?.remove(),e=null,o=null}}}function k(e){let o=document.createElement("div");return o.textContent=e,o.innerHTML}function B(e){return Array.from(e).filter(o=>!o.startsWith("ng-")&&!o.startsWith("_ng"))}var it=/\s_ng(host|content)-[a-z0-9-]+="[^"]*"/gi,at=/\s_ng(host|content)-[a-z0-9-]+/gi;function j(e){return e.replace(it,"").replace(at,"")}var _="__ag-toast__",te="__ag-toast-styles__",I=null;function lt(){if(document.getElementById(te))return;let e=document.createElement("style");e.id=te,e.textContent=`
|
|
49
|
-
#${_} {
|
|
50
|
-
position: fixed;
|
|
51
|
-
bottom: var(--ag-toast-bottom, 24px);
|
|
52
|
-
left: 50%;
|
|
53
|
-
transform: translateX(-50%) translateY(100%);
|
|
54
|
-
z-index: ${2147483647};
|
|
55
|
-
background: var(--ag-toast-bg, #0f172a);
|
|
56
|
-
color: var(--ag-toast-text, #e2e8f0);
|
|
57
|
-
font: 500 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
58
|
-
padding: 12px 18px;
|
|
59
|
-
border-radius: 10px;
|
|
60
|
-
box-shadow: 0 8px 24px var(--ag-toast-shadow, rgba(0, 0, 0, 0.4));
|
|
61
|
-
pointer-events: none;
|
|
62
|
-
opacity: 0;
|
|
63
|
-
transition: transform 0.25s ease, opacity 0.25s ease;
|
|
64
|
-
letter-spacing: 0.01em;
|
|
65
|
-
max-width: 480px;
|
|
66
|
-
min-width: 260px;
|
|
67
|
-
}
|
|
68
|
-
#${_}.ag-toast-visible {
|
|
69
|
-
transform: translateX(-50%) translateY(0);
|
|
70
|
-
opacity: 1;
|
|
71
|
-
}
|
|
72
|
-
#${_} .ag-toast-header {
|
|
73
|
-
display: flex;
|
|
74
|
-
align-items: center;
|
|
75
|
-
gap: 8px;
|
|
76
|
-
margin-bottom: 0;
|
|
77
|
-
}
|
|
78
|
-
#${_} .ag-toast-icon {
|
|
79
|
-
flex-shrink: 0;
|
|
80
|
-
width: 16px;
|
|
81
|
-
height: 16px;
|
|
82
|
-
}
|
|
83
|
-
#${_} .ag-toast-title {
|
|
84
|
-
font-weight: 600;
|
|
85
|
-
color: var(--ag-toast-title, #fff);
|
|
86
|
-
}
|
|
87
|
-
#${_} .ag-toast-details {
|
|
88
|
-
margin-top: 8px;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 4px;
|
|
92
|
-
font-size: 12px;
|
|
93
|
-
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
94
|
-
}
|
|
95
|
-
#${_} .ag-toast-row {
|
|
96
|
-
display: flex;
|
|
97
|
-
gap: 8px;
|
|
98
|
-
align-items: baseline;
|
|
99
|
-
}
|
|
100
|
-
#${_} .ag-toast-label {
|
|
101
|
-
color: var(--ag-toast-label, #64748b);
|
|
102
|
-
flex-shrink: 0;
|
|
103
|
-
min-width: 72px;
|
|
104
|
-
}
|
|
105
|
-
#${_} .ag-toast-value {
|
|
106
|
-
color: var(--ag-toast-text, #e2e8f0);
|
|
107
|
-
overflow: hidden;
|
|
108
|
-
text-overflow: ellipsis;
|
|
109
|
-
white-space: nowrap;
|
|
110
|
-
}
|
|
111
|
-
#${_} .ag-toast-file-link {
|
|
112
|
-
color: var(--ag-toast-text, #e2e8f0);
|
|
113
|
-
text-decoration: none;
|
|
114
|
-
overflow: hidden;
|
|
115
|
-
text-overflow: ellipsis;
|
|
116
|
-
white-space: nowrap;
|
|
117
|
-
pointer-events: auto;
|
|
118
|
-
cursor: pointer;
|
|
119
|
-
}
|
|
120
|
-
#${_} .ag-toast-file-link:hover {
|
|
121
|
-
text-decoration: underline;
|
|
122
|
-
color: var(--ag-accent, #3b82f6);
|
|
123
|
-
}
|
|
124
|
-
`,document.head.appendChild(e)}function ct(){let e=document.getElementById(_);return e||(lt(),e=document.createElement("div"),e.id=_,document.body.appendChild(e)),e}var dt='<svg class="ag-toast-icon" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="7" fill="#22c55e"/><path d="M5 8l2 2 4-4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';function D(e,o,n=3500){let t=ct(),r=`<div class="ag-toast-header">${dt}<span class="ag-toast-title">${k(e)}</span></div>`;if(o){if(r+='<div class="ag-toast-details">',o.componentName&&(r+=`<div class="ag-toast-row"><span class="ag-toast-label">Component</span><span class="ag-toast-value">${k(o.componentName)}</span></div>`),o.filePath){let c=o.filePath;o.line!=null&&(c+=`:${o.line}`);let i=`vscode://file/${encodeURI(o.filePath)}`;o.line!=null&&(i+=`:${o.line}`),o.line!=null&&o.column!=null&&(i+=`:${o.column}`),r+='<div class="ag-toast-row"><span class="ag-toast-label">File</span>',r+=`<a class="ag-toast-file-link" href="${k(i)}" title="Open in VS Code">${k(c)}</a>`,r+="</div>"}if(o.cssClasses&&o.cssClasses.length>0){let c=o.cssClasses.map(i=>`.${k(i)}`).join(" ");r+=`<div class="ag-toast-row"><span class="ag-toast-label">Classes</span><span class="ag-toast-value">${c}</span></div>`}r+="</div>"}t.innerHTML=r,I&&(clearTimeout(I),I=null),t.classList.remove("ag-toast-visible"),t.offsetHeight,t.classList.add("ag-toast-visible"),I=setTimeout(()=>{t.classList.remove("ag-toast-visible"),I=null},n)}function _e(){I&&(clearTimeout(I),I=null),document.getElementById(_)?.remove(),document.getElementById(te)?.remove()}function Te(e){let o=null,n=!1;function t(s){let u=e.getComponentResolver();return u?u(s)?.name??null:null}function r(s){let u=e.getSourceResolver();if(!u)return null;let a=u(s);if(!a?.filePath)return null;let m=a.filePath;return a.line!=null&&(m+=`:${a.line}`),m}function c(s,u){let a=e.getFreezeElement?.();a&&(a.style.pointerEvents="none");let m=document.elementFromPoint(s,u);return a&&(a.style.pointerEvents="auto"),m}function i(s){let u=c(s.clientX,s.clientY);if(!u||e.overlay.isOverlayElement(u)||e.crosshair.isCrosshairElement(u)||e.isToolbarElement?.(u)||u===o)return;o=u;let a=t(u),m=r(u),p=B(u.classList);e.overlay.show(u,a,m,p),e.onHover(u)}function l(s){let u=c(s.clientX,s.clientY);u&&(e.isToolbarElement?.(u)||e.crosshair.isCrosshairElement(u))||(s.preventDefault(),s.stopPropagation(),o&&e.onSelect(o))}return{activate(){n||(n=!0,e.crosshair.activate(),document.addEventListener("mousemove",i,!0),document.addEventListener("click",l,!0))},deactivate(){n&&(n=!1,o=null,e.crosshair.deactivate(),document.removeEventListener("mousemove",i,!0),document.removeEventListener("click",l,!0),e.overlay.hide(),e.onHover(null))},getHoveredElement(){return o},dispose(){this.deactivate()}}}function Me(){if(typeof navigator>"u")return!1;let e=navigator.userAgentData;return e?.platform?/mac/i.test(e.platform):/Mac|iPhone|iPad|iPod/i.test(navigator.userAgent)}function Se(e){let o=e.split("+").map(t=>t.trim()),n={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let t of o){let r=t.toLowerCase();r==="meta"||r==="cmd"||r==="command"?n.meta=!0:r==="ctrl"||r==="control"?n.ctrl=!0:r==="shift"?n.shift=!0:r==="alt"||r==="option"?n.alt=!0:n.key=r}return n}function ut(e,o){return o.meta&&!e.metaKey||o.ctrl&&!e.ctrlKey||o.shift&&!e.shiftKey||o.alt&&!e.altKey?!1:e.key.toLowerCase()===o.key}function pt(e){if(!e||!(e instanceof HTMLElement))return!1;let o=e.tagName;return o==="INPUT"||o==="TEXTAREA"||e.isContentEditable}function Le(e){let o=null,n=!1,t=!1;function r(i){if(!e.getEnableInInputs()&&pt(i.target))return;let l=Se(e.getActivationKey());if(!ut(i,l))return;let s=e.getActivationMode(),u=e.getKeyHoldDuration();if(s==="hold"){if(i.preventDefault(),n)return;if(u>0){if(o)return;o=setTimeout(()=>{n=!0,e.onActivate()},u)}else n=!0,e.onActivate()}else i.preventDefault()}function c(i){let l=Se(e.getActivationKey());if(i.key.toLowerCase()!==l.key)return;e.getActivationMode()==="hold"?(o&&(clearTimeout(o),o=null),n&&(n=!1,e.onDeactivate())):e.isActive()?e.onDeactivate():e.onActivate()}return{start(){t||(t=!0,document.addEventListener("keydown",r,!0),document.addEventListener("keyup",c,!0))},stop(){t&&(t=!1,o&&(clearTimeout(o),o=null),n=!1,document.removeEventListener("keydown",r,!0),document.removeEventListener("keyup",c,!0))},dispose(){this.stop()}}}function mt(e,o){let n=e.split(`
|
|
125
|
-
`);return n.length<=o?e:n.slice(0,o).join(`
|
|
126
|
-
`)+`
|
|
127
|
-
...`}function Pe(e,o,n,t){let r="";if(e&&(r+=`in ${e}`),o){let c=o+(n!=null?`:${n}`:"")+(n!=null&&t!=null?`:${t}`:"");r+=r?` at ${c}`:`at ${c}`}return r}function z(e,o){let n=j(e.html),r=[mt(n,o)];if(e.componentStack.length>0)for(let c of e.componentStack)r.push(Pe(c.name,c.filePath,c.line,c.column));else(e.componentName||e.filePath)&&r.push(Pe(e.componentName,e.filePath,e.line,e.column));return r.join(`
|
|
128
|
-
`)}function ft(e){let o=e.tagName.toLowerCase(),n=e.id?`#${e.id}`:"",t=B(e.classList).map(r=>`.${r}`).join("");return`${o}${n}${t}`}function gt(e){return B(e.classList)}function oe(e,o,n){let t=o?.(e),r=n?.(e),c=[];if(t?.stack)for(let i of t.stack){let l=null,s=null,u=null;if(i.hostElement&&n){let a=n(i.hostElement);a&&(l=a.filePath,s=a.line,u=a.column)}c.push({name:i.name,filePath:l,line:s,column:u})}return{element:e,html:e.outerHTML,componentName:t?.name??null,filePath:r?.filePath??null,line:r?.line??null,column:r?.column??null,componentStack:c,selector:ft(e),cssClasses:gt(e)}}async function Ae(e,o){let n=oe(e,o.getComponentResolver(),o.getSourceResolver());o.pluginRegistry.callHook("onElementSelect",n),o.pluginRegistry.callHook("onBeforeCopy",n);let t=z(n,o.getMaxContextLines());t=o.pluginRegistry.callTransformHook(t,n);try{await navigator.clipboard.writeText(t);let r={componentName:n.componentName,filePath:n.filePath,line:n.line,column:n.column,cssClasses:n.cssClasses};return D("Copied to clipboard",r),o.pluginRegistry.callHook("onCopySuccess",t,n,void 0),{context:n,snippet:t}}catch(r){let c=r instanceof Error?r:new Error(String(r));return o.pluginRegistry.callHook("onCopyError",c),null}}function Re(){let e=new Map,o=new Map;return{register(n,t){if(e.has(n.name)&&this.unregister(n.name),e.set(n.name,n),n.setup){let r=n.setup(t);r&&o.set(n.name,r)}},unregister(n){let t=o.get(n);t&&(t(),o.delete(n)),e.delete(n)},callHook(n,...t){for(let r of e.values()){let c=r.hooks?.[n];if(c)try{c(...t)}catch(i){console.warn(`[angular-grab] Plugin "${r.name}" hook "${n}" threw:`,i)}}},callTransformHook(n,t){let r=n;for(let c of e.values()){let i=c.hooks?.transformCopyContent;if(i)try{r=i(r,t)}catch(l){console.warn(`[angular-grab] Plugin "${c.name}" transformCopyContent threw:`,l)}}return r},getPlugins(){return Array.from(e.values())},dispose(){for(let[n]of e){let t=o.get(n);if(t)try{t()}catch{}}o.clear(),e.clear()}}}var ne="__ag-theme-vars__",Oe="__ag-theme-overrides__",vt=`
|
|
129
|
-
:root {
|
|
130
|
-
--ag-bg: #0f172a;
|
|
131
|
-
--ag-text: #e2e8f0;
|
|
132
|
-
--ag-text-muted: #64748b;
|
|
133
|
-
--ag-accent: #3b82f6;
|
|
134
|
-
--ag-accent-hover: #2563eb;
|
|
135
|
-
--ag-surface: #1e293b;
|
|
136
|
-
--ag-border: #334155;
|
|
137
|
-
--ag-overlay-border: #3b82f6;
|
|
138
|
-
--ag-overlay-bg: rgba(59, 130, 246, 0.1);
|
|
139
|
-
--ag-label-bg: #3b82f6;
|
|
140
|
-
--ag-label-text: #fff;
|
|
141
|
-
--ag-toast-bg: #0f172a;
|
|
142
|
-
--ag-toast-text: #e2e8f0;
|
|
143
|
-
--ag-toast-title: #fff;
|
|
144
|
-
--ag-toast-label: #64748b;
|
|
145
|
-
--ag-toast-shadow: rgba(0, 0, 0, 0.4);
|
|
146
|
-
--ag-toolbar-bg: #0f172a;
|
|
147
|
-
--ag-toolbar-text: #94a3b8;
|
|
148
|
-
--ag-toolbar-hover: #1e293b;
|
|
149
|
-
--ag-toolbar-active: #3b82f6;
|
|
150
|
-
--ag-toolbar-border: #1e293b;
|
|
151
|
-
--ag-toolbar-shadow: rgba(0, 0, 0, 0.5);
|
|
152
|
-
--ag-popover-bg: #0f172a;
|
|
153
|
-
--ag-popover-text: #e2e8f0;
|
|
154
|
-
--ag-popover-border: #1e293b;
|
|
155
|
-
--ag-popover-hover: #1e293b;
|
|
156
|
-
--ag-popover-shadow: rgba(0, 0, 0, 0.5);
|
|
157
|
-
}
|
|
158
|
-
`,ht=`
|
|
159
|
-
:root {
|
|
160
|
-
--ag-bg: #ffffff;
|
|
161
|
-
--ag-text: #334155;
|
|
162
|
-
--ag-text-muted: #94a3b8;
|
|
163
|
-
--ag-accent: #2563eb;
|
|
164
|
-
--ag-accent-hover: #1d4ed8;
|
|
165
|
-
--ag-surface: #f1f5f9;
|
|
166
|
-
--ag-border: #e2e8f0;
|
|
167
|
-
--ag-overlay-border: #2563eb;
|
|
168
|
-
--ag-overlay-bg: rgba(37, 99, 235, 0.08);
|
|
169
|
-
--ag-label-bg: #2563eb;
|
|
170
|
-
--ag-label-text: #fff;
|
|
171
|
-
--ag-toast-bg: #ffffff;
|
|
172
|
-
--ag-toast-text: #334155;
|
|
173
|
-
--ag-toast-title: #0f172a;
|
|
174
|
-
--ag-toast-label: #94a3b8;
|
|
175
|
-
--ag-toast-shadow: rgba(0, 0, 0, 0.12);
|
|
176
|
-
--ag-toolbar-bg: #ffffff;
|
|
177
|
-
--ag-toolbar-text: #64748b;
|
|
178
|
-
--ag-toolbar-hover: #f1f5f9;
|
|
179
|
-
--ag-toolbar-active: #2563eb;
|
|
180
|
-
--ag-toolbar-border: #e2e8f0;
|
|
181
|
-
--ag-toolbar-shadow: rgba(0, 0, 0, 0.12);
|
|
182
|
-
--ag-popover-bg: #ffffff;
|
|
183
|
-
--ag-popover-text: #334155;
|
|
184
|
-
--ag-popover-border: #e2e8f0;
|
|
185
|
-
--ag-popover-hover: #f1f5f9;
|
|
186
|
-
--ag-popover-shadow: rgba(0, 0, 0, 0.12);
|
|
187
|
-
}
|
|
188
|
-
`,bt={overlayBorderColor:"--ag-overlay-border",overlayBgColor:"--ag-overlay-bg",labelBgColor:"--ag-label-bg",labelTextColor:"--ag-label-text",toastBgColor:"--ag-toast-bg",toastTextColor:"--ag-toast-text",toolbarBgColor:"--ag-toolbar-bg",toolbarTextColor:"--ag-toolbar-text",toolbarAccentColor:"--ag-toolbar-active",popoverBgColor:"--ag-popover-bg",popoverTextColor:"--ag-popover-text",popoverBorderColor:"--ag-popover-border"};function He(){let e=null,o=null,n="dark",t=null,r=null;function c(){if(e)return e;let a=document.getElementById(ne);return a?(e=a,e):(e=document.createElement("style"),e.id=ne,document.head.appendChild(e),e)}function i(){return o||(o=document.createElement("style"),o.id=Oe,document.head.appendChild(o),o)}function l(a){return a!=="system"?a:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function s(a){let m=c();m.textContent=a==="dark"?vt:ht}function u(){t&&r&&t.removeEventListener("change",r),t=null,r=null}return{apply(a){n=a,u(),s(l(a)),a==="system"&&(t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>s(l("system")),t.addEventListener("change",r))},applyOverrides(a){let m=[];for(let[v,g]of Object.entries(bt)){let C=a[v];C&&m.push(` ${g}: ${C};`)}if(m.length===0){this.clearOverrides();return}let p=i();p.textContent=` :root {
|
|
189
|
-
${m.join(`
|
|
190
|
-
`)}
|
|
191
|
-
}`},clearOverrides(){o?.remove(),document.getElementById(Oe)?.remove(),o=null},dispose(){u(),e?.remove(),document.getElementById(ne)?.remove(),e=null,this.clearOverrides()}}}var Ie='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M5.5 7V3.5a1 1 0 0 1 2 0V7"/><path d="M7.5 6.5V2.5a1 1 0 0 1 2 0v4"/><path d="M9.5 7V3.5a1 1 0 0 1 2 0V8"/><path d="M5.5 7V5.5a1 1 0 0 0-2 0V9a4 4 0 0 0 4 4h1.5a4 4 0 0 0 4-4V6a1 1 0 0 0-2 0"/></svg>',$e='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="6"/><path d="M8 4.5V8l2.5 1.5"/></svg>',De='<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><circle cx="4" cy="8" r="1.25"/><circle cx="8" cy="8" r="1.25"/><circle cx="12" cy="8" r="1.25"/></svg>',re='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="3"/><path d="M8 1.5v1M8 13.5v1M1.5 8h1M13.5 8h1M3.4 3.4l.7.7M11.9 11.9l.7.7M3.4 12.6l.7-.7M11.9 4.1l.7-.7"/></svg>',Ne='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M13.5 8.5a5.5 5.5 0 0 1-7-7 5.5 5.5 0 1 0 7 7z"/></svg>',Be='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="12" height="9" rx="1"/><path d="M5.5 14h5"/><path d="M8 11v3"/></svg>',ze='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8 2v5"/><path d="M4.5 4a5.5 5.5 0 1 0 7 0"/></svg>',Fe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" xmlns="http://www.w3.org/2000/svg"><path d="M4 4l8 8M12 4l-8 8"/></svg>',Ve='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><rect x="5.5" y="5.5" width="7" height="8" rx="1"/><path d="M3.5 10.5v-7a1 1 0 0 1 1-1h5"/></svg>',Ke='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M13 1.5l-1.3 4.3a1 1 0 0 1-.7.7L6.7 7.8a1 1 0 0 0-.7.7L4.7 12.8a1 1 0 0 1-.7.7L1.5 14"/><path d="M7.5 5.5l3 3"/></svg>',je='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.5L1.5 8 5 11.5"/><path d="M11 4.5l3.5 3.5-3.5 3.5"/><path d="M9.5 2.5l-3 11"/></svg>',Ge='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M2 3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H5l-3 3V3z"/></svg>',Ye='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M2.5 4.5h11"/><path d="M5.5 4.5V3a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1.5"/><path d="M4 4.5l.5 8.5a1 1 0 0 0 1 1h5a1 1 0 0 0 1-1l.5-8.5"/></svg>',Xe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><path d="M8 1v14"/><path d="M1 8h14"/><path d="M8 1l2 2M8 1L6 3"/><path d="M8 15l2-2M8 15l-2-2"/><path d="M1 8l2 2M1 8l2-2"/><path d="M15 8l-2 2M15 8l-2-2"/></svg>';var M="__ag-toolbar__",ie="__ag-toolbar-styles__";function Ze(e){let o=null,n=null,t={},r=new Set;function c(){if(document.getElementById(ie))return;let s=document.createElement("style");s.id=ie,s.textContent=`
|
|
192
|
-
#${M} {
|
|
193
|
-
position: fixed;
|
|
194
|
-
bottom: 20px;
|
|
195
|
-
left: 50%;
|
|
196
|
-
transform: translateX(-50%);
|
|
197
|
-
z-index: ${2147483646};
|
|
198
|
-
display: flex;
|
|
199
|
-
align-items: center;
|
|
200
|
-
gap: 2px;
|
|
201
|
-
padding: 4px 6px;
|
|
202
|
-
background: var(--ag-toolbar-bg, #0f172a);
|
|
203
|
-
border: 1px solid var(--ag-toolbar-border, #1e293b);
|
|
204
|
-
border-radius: 24px;
|
|
205
|
-
box-shadow: 0 4px 16px var(--ag-toolbar-shadow, rgba(0, 0, 0, 0.5));
|
|
206
|
-
pointer-events: auto;
|
|
207
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
208
|
-
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
209
|
-
}
|
|
210
|
-
#${M}.ag-toolbar-hidden {
|
|
211
|
-
opacity: 0;
|
|
212
|
-
transform: translateX(-50%) translateY(20px);
|
|
213
|
-
pointer-events: none;
|
|
214
|
-
}
|
|
215
|
-
#${M} button {
|
|
216
|
-
display: flex;
|
|
217
|
-
align-items: center;
|
|
218
|
-
justify-content: center;
|
|
219
|
-
width: 32px;
|
|
220
|
-
height: 32px;
|
|
221
|
-
border: none;
|
|
222
|
-
border-radius: 8px;
|
|
223
|
-
background: transparent;
|
|
224
|
-
color: var(--ag-toolbar-text, #94a3b8);
|
|
225
|
-
cursor: pointer;
|
|
226
|
-
padding: 0;
|
|
227
|
-
transition: background 0.15s ease, color 0.15s ease;
|
|
228
|
-
}
|
|
229
|
-
#${M} button:hover {
|
|
230
|
-
background: var(--ag-toolbar-hover, #1e293b);
|
|
231
|
-
color: var(--ag-accent, #3b82f6);
|
|
232
|
-
}
|
|
233
|
-
#${M} button.ag-btn-active {
|
|
234
|
-
color: var(--ag-toolbar-active, #3b82f6);
|
|
235
|
-
}
|
|
236
|
-
#${M} button.ag-btn-disabled {
|
|
237
|
-
opacity: 0.4;
|
|
238
|
-
color: var(--ag-toolbar-text, #94a3b8);
|
|
239
|
-
}
|
|
240
|
-
#${M} .ag-toolbar-divider {
|
|
241
|
-
width: 1px;
|
|
242
|
-
height: 20px;
|
|
243
|
-
background: var(--ag-toolbar-border, #1e293b);
|
|
244
|
-
margin: 0 4px;
|
|
245
|
-
flex-shrink: 0;
|
|
246
|
-
}
|
|
247
|
-
#${M} .ag-toolbar-left {
|
|
248
|
-
display: flex;
|
|
249
|
-
align-items: center;
|
|
250
|
-
gap: 2px;
|
|
251
|
-
overflow: hidden;
|
|
252
|
-
max-width: 240px;
|
|
253
|
-
opacity: 1;
|
|
254
|
-
transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
|
|
255
|
-
}
|
|
256
|
-
#${M} .ag-toolbar-left.ag-toolbar-left-hidden {
|
|
257
|
-
max-width: 0;
|
|
258
|
-
opacity: 0;
|
|
259
|
-
pointer-events: none;
|
|
260
|
-
}
|
|
261
|
-
`,document.head.appendChild(s)}function i(s,u,a,m){let p=document.createElement("button");return p.innerHTML=u,p.title=a,p.setAttribute("aria-label",a),p.setAttribute("data-ag-btn",s),p.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),m()}),p}function l(){if(o)return;c(),o=document.createElement("div"),o.id=M,o.setAttribute("role","toolbar"),o.setAttribute("aria-label","Angular Grab toolbar"),t.selection=i("selection",Ie,"Selection mode",e.onSelectionMode),t.history=i("history",$e,"History",e.onHistory),t.actions=i("actions",De,"Actions",e.onActions),t.freeze=i("freeze",Xe,"Freeze page (F)",e.onFreeze),t.theme=i("theme",re,"Toggle theme",e.onThemeToggle),t.enable=i("enable",ze,"Enable/Disable",e.onEnableToggle),t.dismiss=i("dismiss",Fe,"Dismiss toolbar",e.onDismiss);let s=document.createElement("span");s.className="ag-toolbar-divider",n=document.createElement("div"),n.className="ag-toolbar-left",n.appendChild(t.selection),n.appendChild(t.history),n.appendChild(t.actions),n.appendChild(t.freeze),n.appendChild(s),o.appendChild(n),o.appendChild(t.theme),o.appendChild(t.enable),o.appendChild(t.dismiss),document.body.appendChild(o),r.clear(),r.add(o),r.add(n),r.add(s);for(let u of Object.values(t))r.add(u)}return{show(){l(),o.classList.remove("ag-toolbar-hidden")},hide(){o&&o.classList.add("ag-toolbar-hidden")},update(s){if(!o)return;s.active?t.selection.classList.add("ag-btn-active"):t.selection.classList.remove("ag-btn-active");let u=s.toolbar.themeMode,a=u==="dark"?re:u==="light"?Ne:Be,m=u==="dark"?"Switch to light mode":u==="light"?"Switch to system theme":"Switch to dark mode";t.theme.innerHTML=a,t.theme.title=m,t.theme.setAttribute("aria-label",m),s.frozen?t.freeze.classList.add("ag-btn-active"):t.freeze.classList.remove("ag-btn-active"),s.options.enabled?(t.enable.classList.add("ag-btn-active"),n?.classList.remove("ag-toolbar-left-hidden")):(t.enable.classList.remove("ag-btn-active"),n?.classList.add("ag-toolbar-left-hidden"))},isToolbarElement(s){if(r.has(s))return!0;let u=s;for(;u;){if(u===o||u.id===M)return!0;u=u.parentElement}return!1},dispose(){o?.remove(),document.getElementById(ie)?.remove(),o=null,n=null,t={},r.clear()}}}var E="__ag-history-popover__",ae="__ag-history-styles__";function xt(e){let o=Date.now()-e,n=Math.floor(o/1e3);if(n<60)return"just now";let t=Math.floor(n/60);if(t<60)return`${t}m ago`;let r=Math.floor(t/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Et(e){let o=e.split("/");return o[o.length-1]}function Ct(e,o,n){let t=`vscode://file/${encodeURI(e)}`;return o!=null&&(t+=`:${o}`),o!=null&&n!=null&&(t+=`:${n}`),t}function Ue(e){let o=null,n=!1;function t(){if(document.getElementById(ae))return;let i=document.createElement("style");i.id=ae,i.textContent=`
|
|
262
|
-
#${E} {
|
|
263
|
-
position: fixed;
|
|
264
|
-
bottom: ${N};
|
|
265
|
-
left: 50%;
|
|
266
|
-
transform: translateX(-50%);
|
|
267
|
-
z-index: ${2147483647};
|
|
268
|
-
background: var(--ag-popover-bg, #0f172a);
|
|
269
|
-
border: 1px solid var(--ag-popover-border, #1e293b);
|
|
270
|
-
border-radius: 12px;
|
|
271
|
-
box-shadow: 0 8px 24px var(--ag-popover-shadow, rgba(0, 0, 0, 0.5));
|
|
272
|
-
min-width: 320px;
|
|
273
|
-
max-width: 420px;
|
|
274
|
-
max-height: 360px;
|
|
275
|
-
overflow-y: auto;
|
|
276
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
277
|
-
opacity: 0;
|
|
278
|
-
visibility: hidden;
|
|
279
|
-
transition: opacity 0.15s ease, visibility 0.15s ease;
|
|
280
|
-
pointer-events: auto;
|
|
281
|
-
}
|
|
282
|
-
#${E}.ag-popover-visible {
|
|
283
|
-
opacity: 1;
|
|
284
|
-
visibility: visible;
|
|
285
|
-
}
|
|
286
|
-
#${E} .ag-history-header {
|
|
287
|
-
padding: 10px 14px 8px;
|
|
288
|
-
font-size: 11px;
|
|
289
|
-
font-weight: 600;
|
|
290
|
-
text-transform: uppercase;
|
|
291
|
-
letter-spacing: 0.05em;
|
|
292
|
-
color: var(--ag-text-muted, #64748b);
|
|
293
|
-
border-bottom: 1px solid var(--ag-popover-border, #1e293b);
|
|
294
|
-
}
|
|
295
|
-
#${E} .ag-history-empty {
|
|
296
|
-
padding: 24px 14px;
|
|
297
|
-
text-align: center;
|
|
298
|
-
color: var(--ag-text-muted, #64748b);
|
|
299
|
-
font-size: 13px;
|
|
300
|
-
}
|
|
301
|
-
#${E} .ag-history-item {
|
|
302
|
-
display: flex;
|
|
303
|
-
align-items: center;
|
|
304
|
-
justify-content: space-between;
|
|
305
|
-
gap: 12px;
|
|
306
|
-
padding: 8px 14px;
|
|
307
|
-
cursor: pointer;
|
|
308
|
-
border: none;
|
|
309
|
-
border-bottom: 1px solid var(--ag-popover-border, #1e293b);
|
|
310
|
-
background: transparent;
|
|
311
|
-
width: 100%;
|
|
312
|
-
text-align: left;
|
|
313
|
-
font: inherit;
|
|
314
|
-
color: inherit;
|
|
315
|
-
transition: background 0.1s ease;
|
|
316
|
-
}
|
|
317
|
-
#${E} .ag-history-item:last-child {
|
|
318
|
-
border-bottom: none;
|
|
319
|
-
}
|
|
320
|
-
#${E} .ag-history-item:hover {
|
|
321
|
-
background: var(--ag-popover-hover, #1e293b);
|
|
322
|
-
}
|
|
323
|
-
#${E} .ag-history-info {
|
|
324
|
-
flex: 1;
|
|
325
|
-
min-width: 0;
|
|
326
|
-
}
|
|
327
|
-
#${E} .ag-history-selector {
|
|
328
|
-
font: 12px/1.3 ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
329
|
-
color: var(--ag-popover-text, #e2e8f0);
|
|
330
|
-
overflow: hidden;
|
|
331
|
-
text-overflow: ellipsis;
|
|
332
|
-
white-space: nowrap;
|
|
333
|
-
}
|
|
334
|
-
#${E} .ag-history-meta {
|
|
335
|
-
font-size: 11px;
|
|
336
|
-
color: var(--ag-text-muted, #64748b);
|
|
337
|
-
margin-top: 2px;
|
|
338
|
-
overflow: hidden;
|
|
339
|
-
text-overflow: ellipsis;
|
|
340
|
-
white-space: nowrap;
|
|
341
|
-
}
|
|
342
|
-
#${E} .ag-history-time {
|
|
343
|
-
font-size: 11px;
|
|
344
|
-
color: var(--ag-text-muted, #64748b);
|
|
345
|
-
flex-shrink: 0;
|
|
346
|
-
}
|
|
347
|
-
#${E} .ag-history-file-link {
|
|
348
|
-
color: var(--ag-text-muted, #64748b);
|
|
349
|
-
text-decoration: none;
|
|
350
|
-
}
|
|
351
|
-
#${E} .ag-history-file-link:hover {
|
|
352
|
-
text-decoration: underline;
|
|
353
|
-
color: var(--ag-accent, #3b82f6);
|
|
354
|
-
}
|
|
355
|
-
`,document.head.appendChild(i)}function r(){return o||(t(),o=document.createElement("div"),o.id=E,o.setAttribute("role","dialog"),o.setAttribute("aria-label","Grab history"),document.body.appendChild(o),o)}function c(i){let l=r(),s='<div class="ag-history-header">History</div>';if(i.length===0)s+='<div class="ag-history-empty">No elements grabbed yet</div>';else for(let a of i){let m=k(a.context.selector),p=a.context.componentName?k(a.context.componentName):"",v=xt(a.timestamp),g=p?`in ${p}`:"";if(a.context.filePath){let C=Ct(a.context.filePath,a.context.line,a.context.column),P=k(Et(a.context.filePath));g+=`${g?" \u2014 ":""}<a class="ag-history-file-link" href="${k(C)}" title="Open in VS Code">${P}</a>`}s+=`<button class="ag-history-item" data-ag-history-id="${k(a.id)}" aria-label="Re-copy ${m}">`,s+='<div class="ag-history-info">',s+=`<div class="ag-history-selector">${m}</div>`,g&&(s+=`<div class="ag-history-meta">${g}</div>`),s+="</div>",s+=`<span class="ag-history-time">${v}</span>`,s+="</button>"}l.innerHTML=s,l.querySelectorAll(".ag-history-item").forEach(a=>{a.addEventListener("click",m=>{m.stopPropagation();let p=a.dataset.agHistoryId,v=i.find(g=>g.id===p);v&&e.onEntryClick(v)})})}return{show(i){c(i),n=!0,r().offsetHeight,r().classList.add("ag-popover-visible")},hide(){n=!1,o?.classList.remove("ag-popover-visible")},isVisible(){return n},isPopoverElement(i){if(!o)return!1;let l=i;for(;l;){if(l===o||l.id===E)return!0;l=l.parentElement}return!1},dispose(){o?.remove(),document.getElementById(ae)?.remove(),o=null,n=!1}}}var $="__ag-actions-menu__",se="__ag-actions-styles__";function We(e){let o=null,n=!1,t=[{icon:Ve,label:"Copy Element",action:e.onCopyElement},{icon:Ke,label:"Copy Styles",action:e.onCopyStyles},{icon:je,label:"Copy HTML",action:e.onCopyHtml},{icon:Ge,label:"Comment",action:e.onComment},{separator:!0},{icon:Ye,label:"Clear History",action:e.onClearHistory}];function r(){if(document.getElementById(se))return;let i=document.createElement("style");i.id=se,i.textContent=`
|
|
356
|
-
#${$} {
|
|
357
|
-
position: fixed;
|
|
358
|
-
bottom: ${N};
|
|
359
|
-
left: 50%;
|
|
360
|
-
transform: translateX(-50%);
|
|
361
|
-
z-index: ${2147483647};
|
|
362
|
-
background: var(--ag-popover-bg, #0f172a);
|
|
363
|
-
border: 1px solid var(--ag-popover-border, #1e293b);
|
|
364
|
-
border-radius: 10px;
|
|
365
|
-
box-shadow: 0 8px 24px var(--ag-popover-shadow, rgba(0, 0, 0, 0.5));
|
|
366
|
-
min-width: 200px;
|
|
367
|
-
padding: 4px;
|
|
368
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
369
|
-
opacity: 0;
|
|
370
|
-
visibility: hidden;
|
|
371
|
-
transition: opacity 0.15s ease, visibility 0.15s ease;
|
|
372
|
-
pointer-events: auto;
|
|
373
|
-
}
|
|
374
|
-
#${$}.ag-menu-visible {
|
|
375
|
-
opacity: 1;
|
|
376
|
-
visibility: visible;
|
|
377
|
-
}
|
|
378
|
-
#${$} .ag-menu-item {
|
|
379
|
-
display: flex;
|
|
380
|
-
align-items: center;
|
|
381
|
-
gap: 10px;
|
|
382
|
-
padding: 8px 12px;
|
|
383
|
-
border: none;
|
|
384
|
-
border-radius: 6px;
|
|
385
|
-
background: transparent;
|
|
386
|
-
color: var(--ag-popover-text, #e2e8f0);
|
|
387
|
-
font-size: 13px;
|
|
388
|
-
cursor: pointer;
|
|
389
|
-
width: 100%;
|
|
390
|
-
text-align: left;
|
|
391
|
-
transition: background 0.1s ease;
|
|
392
|
-
}
|
|
393
|
-
#${$} .ag-menu-item:hover {
|
|
394
|
-
background: var(--ag-popover-hover, #1e293b);
|
|
395
|
-
}
|
|
396
|
-
#${$} .ag-menu-item svg {
|
|
397
|
-
flex-shrink: 0;
|
|
398
|
-
opacity: 0.7;
|
|
399
|
-
}
|
|
400
|
-
#${$} .ag-menu-sep {
|
|
401
|
-
height: 1px;
|
|
402
|
-
background: var(--ag-popover-border, #1e293b);
|
|
403
|
-
margin: 4px 8px;
|
|
404
|
-
}
|
|
405
|
-
`,document.head.appendChild(i)}function c(){if(o)return o;r(),o=document.createElement("div"),o.id=$,o.setAttribute("role","menu"),o.setAttribute("aria-label","Actions");for(let i of t){if(i.separator){let s=document.createElement("div");s.className="ag-menu-sep",o.appendChild(s);continue}let l=document.createElement("button");l.className="ag-menu-item",l.setAttribute("role","menuitem"),l.innerHTML=`${i.icon}<span>${k(i.label)}</span>`,l.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),n=!1,o?.classList.remove("ag-menu-visible"),i.action()}),o.appendChild(l)}return document.body.appendChild(o),o}return{show(){let i=c();n=!0,i.offsetHeight,i.classList.add("ag-menu-visible")},hide(){n=!1,o?.classList.remove("ag-menu-visible")},isVisible(){return n},isMenuElement(i){if(!o)return!1;let l=i;for(;l;){if(l===o||l.id===$)return!0;l=l.parentElement}return!1},dispose(){o?.remove(),document.getElementById(se)?.remove(),o=null,n=!1}}}var T="__ag-comment-popover__",le="__ag-comment-styles__";function qe(e){let o=null,n=null,t=!1,r=null;function c(){if(document.getElementById(le))return;let a=document.createElement("style");a.id=le,a.textContent=`
|
|
406
|
-
#${T} {
|
|
407
|
-
position: fixed;
|
|
408
|
-
bottom: ${N};
|
|
409
|
-
left: 50%;
|
|
410
|
-
transform: translateX(-50%);
|
|
411
|
-
z-index: ${2147483647};
|
|
412
|
-
background: var(--ag-popover-bg, #0f172a);
|
|
413
|
-
border: 1px solid var(--ag-popover-border, #1e293b);
|
|
414
|
-
border-radius: 12px;
|
|
415
|
-
box-shadow: 0 8px 24px var(--ag-popover-shadow, rgba(0, 0, 0, 0.5));
|
|
416
|
-
width: 340px;
|
|
417
|
-
padding: 14px;
|
|
418
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
419
|
-
opacity: 0;
|
|
420
|
-
visibility: hidden;
|
|
421
|
-
transition: opacity 0.15s ease, visibility 0.15s ease;
|
|
422
|
-
pointer-events: auto;
|
|
423
|
-
}
|
|
424
|
-
#${T}.ag-comment-visible {
|
|
425
|
-
opacity: 1;
|
|
426
|
-
visibility: visible;
|
|
427
|
-
}
|
|
428
|
-
#${T} textarea {
|
|
429
|
-
width: 100%;
|
|
430
|
-
min-height: 80px;
|
|
431
|
-
padding: 8px 10px;
|
|
432
|
-
border: 1px solid var(--ag-popover-border, #1e293b);
|
|
433
|
-
border-radius: 8px;
|
|
434
|
-
background: var(--ag-surface, #1e293b);
|
|
435
|
-
color: var(--ag-popover-text, #e2e8f0);
|
|
436
|
-
font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
437
|
-
resize: vertical;
|
|
438
|
-
outline: none;
|
|
439
|
-
box-sizing: border-box;
|
|
440
|
-
}
|
|
441
|
-
#${T} textarea:focus {
|
|
442
|
-
border-color: var(--ag-accent, #3b82f6);
|
|
443
|
-
}
|
|
444
|
-
#${T} textarea::placeholder {
|
|
445
|
-
color: var(--ag-text-muted, #64748b);
|
|
446
|
-
}
|
|
447
|
-
#${T} .ag-comment-footer {
|
|
448
|
-
display: flex;
|
|
449
|
-
justify-content: flex-end;
|
|
450
|
-
gap: 8px;
|
|
451
|
-
margin-top: 10px;
|
|
452
|
-
}
|
|
453
|
-
#${T} .ag-comment-btn {
|
|
454
|
-
padding: 6px 14px;
|
|
455
|
-
border: none;
|
|
456
|
-
border-radius: 6px;
|
|
457
|
-
font-size: 13px;
|
|
458
|
-
font-weight: 500;
|
|
459
|
-
cursor: pointer;
|
|
460
|
-
transition: background 0.15s ease;
|
|
461
|
-
}
|
|
462
|
-
#${T} .ag-comment-cancel {
|
|
463
|
-
background: transparent;
|
|
464
|
-
color: var(--ag-text-muted, #64748b);
|
|
465
|
-
}
|
|
466
|
-
#${T} .ag-comment-cancel:hover {
|
|
467
|
-
background: var(--ag-popover-hover, #1e293b);
|
|
468
|
-
color: var(--ag-popover-text, #e2e8f0);
|
|
469
|
-
}
|
|
470
|
-
#${T} .ag-comment-submit {
|
|
471
|
-
background: var(--ag-accent, #3b82f6);
|
|
472
|
-
color: #fff;
|
|
473
|
-
}
|
|
474
|
-
#${T} .ag-comment-submit:hover {
|
|
475
|
-
background: var(--ag-accent-hover, #2563eb);
|
|
476
|
-
}
|
|
477
|
-
`,document.head.appendChild(a)}function i(){if(o)return o;c(),o=document.createElement("div"),o.id=T,o.setAttribute("role","dialog"),o.setAttribute("aria-label","Add comment"),n=document.createElement("textarea"),n.placeholder="Add a comment...",n.rows=3;let a=document.createElement("div");a.className="ag-comment-footer";let m=document.createElement("button");m.className="ag-comment-btn ag-comment-cancel",m.textContent="Cancel",m.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation(),u(),e.onCancel()});let p=document.createElement("button");return p.className="ag-comment-btn ag-comment-submit",p.textContent="Copy with Comment",p.addEventListener("click",v=>{v.preventDefault(),v.stopPropagation();let g=n.value.trim();g?(u(),e.onSubmit(g)):(n.style.borderColor="var(--ag-accent, #3b82f6)",n.setAttribute("placeholder","Please enter a comment..."),n.focus(),setTimeout(()=>{n&&(n.style.borderColor="",n.setAttribute("placeholder","Add a comment..."))},2e3))}),a.appendChild(m),a.appendChild(p),o.appendChild(n),o.appendChild(a),document.body.appendChild(o),o}function l(){r||(r=a=>{n&&document.activeElement===n&&(a.stopImmediatePropagation(),a.key==="Escape"&&(u(),e.onCancel()))},document.addEventListener("keydown",r,!0))}function s(){r&&(document.removeEventListener("keydown",r,!0),r=null)}function u(){t=!1,o?.classList.remove("ag-comment-visible"),s()}return{show(){let a=i();n.value="",t=!0,a.offsetHeight,a.classList.add("ag-comment-visible"),l(),requestAnimationFrame(()=>n?.focus())},hide(){u()},isVisible(){return t},isPopoverElement(a){if(!o)return!1;let m=a;for(;m;){if(m===o||m.id===T)return!0;m=m.parentElement}return!1},dispose(){s(),o?.remove(),document.getElementById(le)?.remove(),o=null,n=null,t=!1}}}async function ce(e,o,n){let t=z(e,o);n&&(t=n.callTransformHook(t,e));let r=await G(t,"Copied to clipboard",e);return r&&n?.callHook("onCopySuccess",t,e,void 0),r}async function de(e,o){let n=j(e.html),t=await G(n,"HTML copied to clipboard",e);return t&&o?.callHook("onCopySuccess",n,e,void 0),t}async function ue(e){if(!e.isConnected)return D("Element is no longer on the page"),!1;let o=window.getComputedStyle(e),n=e.tagName.toLowerCase(),t=[`/* Computed styles for <${n}> */`,`${n} {`],r=["display","position","top","right","bottom","left","width","height","min-width","min-height","max-width","max-height","margin","padding","border","border-radius","background","background-color","color","font","font-size","font-weight","font-family","line-height","text-align","text-decoration","text-transform","opacity","overflow","z-index","flex-direction","justify-content","align-items","gap","grid-template-columns","grid-template-rows","box-shadow","cursor","transition","transform"];for(let i of r){let l=o.getPropertyValue(i);l&&l!=="none"&&l!=="normal"&&l!=="auto"&&l!=="0px"&&l!=="visible"&&t.push(` ${i}: ${l};`)}t.push("}");let c=t.join(`
|
|
478
|
-
`);return G(c,"Styles copied to clipboard")}async function Qe(e,o,n,t){let r=z(e,n);t&&(r=t.callTransformHook(r,e));let c=`${r}
|
|
479
|
-
|
|
480
|
-
/* Comment: ${o} */`,i=await G(c,"Copied with comment",e);return i&&t?.callHook("onCopySuccess",c,e,o),i}async function G(e,o,n){try{return await navigator.clipboard.writeText(e),D(o,n?{componentName:n.componentName,filePath:n.filePath,line:n.line,column:n.column,cssClasses:n.cssClasses}:void 0),!0}catch{return!1}}var pe="__ag-freeze-overlay__",me="__ag-freeze-styles__",kt="__ag-freeze-hover-styles__",_t="__ag-freeze-anim-styles__",fe="data-ag-hover",Je=["mouseenter","mouseleave","mouseover","mouseout","pointerenter","pointerleave","pointerover","pointerout"],et=["focus","blur","focusin","focusout"];function tt(){let e=null,o=!1,n=null,t=null,r=[];function c(){if(document.getElementById(me))return;let f=document.createElement("style");f.id=me,f.textContent=`
|
|
481
|
-
#${pe} {
|
|
482
|
-
position: fixed;
|
|
483
|
-
top: 0;
|
|
484
|
-
left: 0;
|
|
485
|
-
width: 100vw;
|
|
486
|
-
height: 100vh;
|
|
487
|
-
z-index: ${2147483644};
|
|
488
|
-
pointer-events: auto;
|
|
489
|
-
background: transparent;
|
|
490
|
-
}
|
|
491
|
-
`,document.head.appendChild(f)}function i(){return e||(c(),e=document.createElement("div"),e.id=pe,e.style.display="none",document.body.appendChild(e),e)}let l=f=>{f.stopImmediatePropagation()},s=f=>{f.preventDefault(),f.stopImmediatePropagation()};function u(){for(let f of Je)document.addEventListener(f,l,!0);for(let f of et)document.addEventListener(f,s,!0)}function a(){for(let f of Je)document.removeEventListener(f,l,!0);for(let f of et)document.removeEventListener(f,s,!0)}function m(f){let b=f;for(;b&&b!==document.documentElement;)b.setAttribute(fe,""),r.push(b),b=b.parentElement}function p(){for(let f of r)f.removeAttribute(fe);r=[]}function v(){if(n)return;let f=[];for(let b of Array.from(document.styleSheets)){let y;try{y=b.cssRules}catch{continue}g(y,f)}f.length!==0&&(n=document.createElement("style"),n.id=kt,n.textContent=f.join(`
|
|
492
|
-
`),document.head.appendChild(n))}function g(f,b){for(let y of Array.from(f))if(y instanceof CSSStyleRule){if(y.selectorText.includes(":hover")){let x=y.selectorText.replace(/:hover/g,`[${fe}]`);b.push(`${x} { ${y.style.cssText} }`)}}else if(y instanceof CSSMediaRule){let x=[];g(y.cssRules,x),x.length>0&&b.push(`@media ${y.conditionText} { ${x.join(`
|
|
493
|
-
`)} }`)}}function C(){n?.remove(),n=null}function P(){t||(t=document.createElement("style"),t.id=_t,t.textContent=`
|
|
494
|
-
*, *::before, *::after {
|
|
495
|
-
animation-play-state: paused !important;
|
|
496
|
-
transition: none !important;
|
|
497
|
-
}
|
|
498
|
-
`,document.head.appendChild(t))}function A(){t?.remove(),t=null}return{show(f){u(),f&&(m(f),v()),P();let b=i();b.style.display="block",o=!0},hide(){e&&(e.style.display="none"),o=!1,p(),C(),A(),a()},isVisible(){return o},isFreezeElement(f){return f===e||f.id===pe},getElement(){return e},dispose(){p(),C(),A(),a(),e?.remove(),document.getElementById(me)?.remove(),e=null,o=!1}}}var ge="__ag-feedback-styles__";function Tt(){if(document.getElementById(ge))return;let e=document.createElement("style");e.id=ge,e.textContent=`
|
|
499
|
-
@keyframes ag-flash {
|
|
500
|
-
0% { opacity: 1; }
|
|
501
|
-
100% { opacity: 0; transform: scale(1.02); }
|
|
502
|
-
}
|
|
503
|
-
@keyframes ag-pill-in {
|
|
504
|
-
0% { opacity: 0; transform: translateY(4px) scale(0.9); }
|
|
505
|
-
30% { opacity: 1; transform: translateY(0) scale(1); }
|
|
506
|
-
70% { opacity: 1; transform: translateY(0) scale(1); }
|
|
507
|
-
100% { opacity: 0; transform: translateY(-8px) scale(0.95); }
|
|
508
|
-
}
|
|
509
|
-
.ag-select-flash {
|
|
510
|
-
position: fixed;
|
|
511
|
-
pointer-events: none;
|
|
512
|
-
z-index: ${2147483646};
|
|
513
|
-
border: 2px solid #22c55e;
|
|
514
|
-
background: rgba(34, 197, 94, 0.12);
|
|
515
|
-
border-radius: 3px;
|
|
516
|
-
box-sizing: border-box;
|
|
517
|
-
animation: ag-flash 0.45s ease-out forwards;
|
|
518
|
-
}
|
|
519
|
-
.ag-select-pill {
|
|
520
|
-
position: fixed;
|
|
521
|
-
pointer-events: none;
|
|
522
|
-
z-index: ${2147483647};
|
|
523
|
-
display: flex;
|
|
524
|
-
align-items: center;
|
|
525
|
-
gap: 4px;
|
|
526
|
-
background: #22c55e;
|
|
527
|
-
color: #fff;
|
|
528
|
-
font: 600 10px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
529
|
-
padding: 3px 8px;
|
|
530
|
-
border-radius: 10px;
|
|
531
|
-
white-space: nowrap;
|
|
532
|
-
letter-spacing: 0.03em;
|
|
533
|
-
text-transform: uppercase;
|
|
534
|
-
box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
|
|
535
|
-
animation: ag-pill-in 0.9s ease-out forwards;
|
|
536
|
-
}
|
|
537
|
-
.ag-select-pill svg {
|
|
538
|
-
width: 10px;
|
|
539
|
-
height: 10px;
|
|
540
|
-
flex-shrink: 0;
|
|
541
|
-
}
|
|
542
|
-
`,document.head.appendChild(e)}var St='<svg viewBox="0 0 10 10" fill="none"><path d="M2 5.5l2 2 4-4" stroke="#fff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>';function ve(e){Tt();let o=e.getBoundingClientRect(),n=document.createElement("div");n.className="ag-select-flash",n.style.top=`${o.top}px`,n.style.left=`${o.left}px`,n.style.width=`${o.width}px`,n.style.height=`${o.height}px`,document.body.appendChild(n);let t=document.createElement("div");t.className="ag-select-pill",t.innerHTML=`${St} Copied`,document.body.appendChild(t);let r=70,c=o.left+o.width/2-r/2,i=o.top-24;i<4&&(i=o.bottom+6);let l=document.documentElement.clientWidth;c+r>l-4&&(c=l-r-4),c<4&&(c=4),t.style.top=`${i}px`,t.style.left=`${c}px`;let s=()=>{n.remove(),t.remove()};t.addEventListener("animationend",s),setTimeout(s,1200)}function ot(){document.getElementById(ge)?.remove()}var Mt=50;function Lt(e){return{html:e.html,componentName:e.componentName,filePath:e.filePath,line:e.line,column:e.column,componentStack:e.componentStack,selector:e.selector,cssClasses:e.cssClasses}}function Pt(){return{activationKey:Me()?"Meta+C":"Ctrl+C",activationMode:"hold",keyHoldDuration:0,maxContextLines:20,enabled:!0,enableInInputs:!1,devOnly:!0,showToolbar:!0,themeMode:"dark"}}function nt(e){return Ot(e)}function At(){try{let e=globalThis.ngDevMode;return typeof e>"u"||!!e}catch{return!0}}function Rt(){let e=()=>{};return{activate:e,deactivate:e,toggle:e,isActive:()=>!1,setOptions:e,registerPlugin:e,unregisterPlugin:e,setComponentResolver:e,setSourceResolver:e,showToolbar:e,hideToolbar:e,setThemeMode:e,getHistory:()=>[],clearHistory:e,dispose:e}}function Ot(e){let n={...Pt(),...e};if(n.devOnly&&!At())return Rt();let t=Ee(n),r=we(),c=ke(),i=tt(),l=Re(),s=He(),u=null,a=null,m=null,p=null,v=0;function g(){return`ag-${++v}-${Date.now()}`}s.apply(t.state.toolbar.themeMode),V();function C(d){return w.isToolbarElement(d)||R.isPopoverElement(d)||O.isMenuElement(d)||H.isPopoverElement(d)||i.isFreezeElement(d)}function P(d,h){let L={id:g(),context:Lt(d),snippet:h,timestamp:Date.now()};m=new WeakRef(d.element),p=d;let Y=[L,...t.state.toolbar.history].slice(0,Mt);t.state.toolbar={...t.state.toolbar,history:Y}}function A(){let d=m?.deref()??null;return d&&!d.isConnected?(m=null,p=null,null):d}function f(){R.hide(),O.hide(),H.hide()}async function b(d,h){let L=oe(h,u,a),Y=t.state.options.maxContextLines;switch(m=new WeakRef(h),p=L,t.state.toolbar={...t.state.toolbar,pendingAction:null},d.type){case"copy-element":{await ce(L,Y,l)&&(ve(h),P(L,""));break}case"copy-styles":await ue(h);break;case"copy-html":await de(L,l);break;case"comment":H.show();return}}let y=Te({overlay:r,crosshair:c,getComponentResolver:()=>u,getSourceResolver:()=>a,isToolbarElement:C,getFreezeElement:()=>i.getElement(),onHover(d){t.state.hoveredElement=d,d&&l.callHook("onElementHover",d)},async onSelect(d){let h=t.state.toolbar.pendingAction;if(h){await b(h,d),h.type!=="comment"&&S();return}let L=await Ae(d,{getComponentResolver:()=>u,getSourceResolver:()=>a,getMaxContextLines:()=>t.state.options.maxContextLines,pluginRegistry:l});L&&(ve(d),P(L.context,L.snippet))}});function x(){t.state.options.enabled&&(t.state.active||(t.state.toolbar.visible===!1&&t.state.options.showToolbar&&(t.state.toolbar={...t.state.toolbar,visible:!0},w.show(),w.update(t.state)),t.state.active=!0,y.activate(),l.callHook("onActivate"),w.update(t.state)))}function S(){t.state.active&&(t.state.active=!1,t.state.frozen=!1,i.hide(),t.state.toolbar={...t.state.toolbar,pendingAction:null},y.deactivate(),l.callHook("onDeactivate"),w.update(t.state))}function he(){t.state.frozen=!t.state.frozen,t.state.frozen?i.show(t.state.hoveredElement):i.hide(),w.update(t.state)}let w=Ze({onSelectionMode(){f(),t.state.active?S():x()},onHistory(){O.hide(),H.hide(),R.isVisible()?R.hide():R.show([...t.state.toolbar.history])},onActions(){R.hide(),H.hide(),O.isVisible()?O.hide():O.show()},onFreeze(){f(),t.state.active||x(),he()},onThemeToggle(){let d=t.state.toolbar.themeMode,h=d==="dark"?"light":d==="light"?"system":"dark";t.state.toolbar={...t.state.toolbar,themeMode:h},s.apply(h),w.update(t.state)},onEnableToggle(){f();let d=!t.state.options.enabled;t.state.options={...t.state.options,enabled:d},d||S(),w.update(t.state)},onDismiss(){f(),S(),t.state.toolbar={...t.state.toolbar,visible:!1},w.hide()}}),R=Ue({async onEntryClick(d){R.hide();try{await navigator.clipboard.writeText(d.snippet),D("Re-copied to clipboard",{componentName:d.context.componentName,filePath:d.context.filePath,line:d.context.line,column:d.context.column,cssClasses:d.context.cssClasses})}catch{}}}),O=We({onCopyElement(){p?ce(p,t.state.options.maxContextLines,l):(t.state.toolbar={...t.state.toolbar,pendingAction:{type:"copy-element"}},x())},onCopyStyles(){let d=A();d?ue(d):(t.state.toolbar={...t.state.toolbar,pendingAction:{type:"copy-styles"}},x())},onCopyHtml(){p?de(p,l):(t.state.toolbar={...t.state.toolbar,pendingAction:{type:"copy-html"}},x())},onComment(){p?H.show():(t.state.toolbar={...t.state.toolbar,pendingAction:{type:"comment"}},x())},onClearHistory(){p=null,m=null,t.state.toolbar={...t.state.toolbar,history:[]}}}),H=qe({async onSubmit(d){p&&await Qe(p,d,t.state.options.maxContextLines,l),t.state.active&&S()},onCancel(){t.state.active&&S()}});function be(d){let h=d.target;h&&(C(h)||(R.isVisible()||O.isVisible()||H.isVisible())&&f())}document.addEventListener("click",be);function V(){t.state.toolbar.visible?document.documentElement.style.setProperty("--ag-toast-bottom",Ce):document.documentElement.style.removeProperty("--ag-toast-bottom")}function ye(d){if(!t.state.active||d.key.toLowerCase()!=="f")return;let h=d.target?.tagName;h==="INPUT"||h==="TEXTAREA"||d.target?.isContentEditable||(d.preventDefault(),he())}document.addEventListener("keydown",ye,!0);let K=Le({getActivationKey:()=>t.state.options.activationKey,getActivationMode:()=>t.state.options.activationMode,getKeyHoldDuration:()=>t.state.options.keyHoldDuration,getEnableInInputs:()=>t.state.options.enableInInputs,onActivate:x,onDeactivate:S,isActive:()=>t.state.active}),xe={activate:x,deactivate:S,toggle(){t.state.active?S():x()},isActive(){return t.state.active},setOptions(d){t.state.options={...t.state.options,...d}},registerPlugin(d){d.options&&(t.state.options={...t.state.options,...d.options}),d.theme&&s.applyOverrides(d.theme),l.register(d,xe)},unregisterPlugin(d){l.unregister(d)},setComponentResolver(d){u=d},setSourceResolver(d){a=d},showToolbar(){t.state.toolbar={...t.state.toolbar,visible:!0},w.show(),w.update(t.state),V()},hideToolbar(){f(),t.state.toolbar={...t.state.toolbar,visible:!1},w.hide(),V()},setThemeMode(d){t.state.toolbar={...t.state.toolbar,themeMode:d},s.apply(d),w.update(t.state)},getHistory(){return[...t.state.toolbar.history]},clearHistory(){p=null,m=null,t.state.toolbar={...t.state.toolbar,history:[]}},dispose(){S(),document.removeEventListener("click",be),document.removeEventListener("keydown",ye,!0),K.dispose(),y.dispose(),r.dispose(),c.dispose(),i.dispose(),_e(),ot(),l.dispose(),f(),w.dispose(),R.dispose(),O.dispose(),H.dispose(),s.dispose(),document.documentElement.style.removeProperty("--ag-toast-bottom")}};return t.state.options.enabled&&K.start(),t.state.toolbar={...t.state.toolbar,visible:!1},t.subscribe((d,h)=>{h==="options"&&(d.options.enabled?K.start():(K.stop(),S())),h==="toolbar"&&V()}),xe}var Ht=typeof ngDevMode>"u"||!!ngDevMode;if(Ht){let e=nt();window.__ANGULAR_GRAB__=e}})();
|