diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87a9df4efa..2c5433e65b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,3 +98,4 @@ jobs: phpunit: ${{ matrix.config.phpunit }} coverage: ${{ matrix.config.coverage }} codecov-token: ${{ secrets.CODECOV_TOKEN }} + timeout-minutes: 15 diff --git a/.github/workflows/core-tests.yml b/.github/workflows/core-tests.yml index 7e0d3bb9d4..2d955b59f5 100644 --- a/.github/workflows/core-tests.yml +++ b/.github/workflows/core-tests.yml @@ -64,7 +64,7 @@ jobs: echo "GITHUB_EVENT_NAME=pull_request" >> "wordpress/.env" - name: Set up Node.js - uses: actions/setup-node@v6.3.0 + uses: actions/setup-node@v6.4.0 with: node-version-file: 'wordpress/.nvmrc' cache: npm @@ -111,16 +111,20 @@ jobs: --verbose -c phpunit.xml.dist --filter "^\(?!.*test_wp_generate_attachment_metadata_png_thumbnail_smaller_than_original\).*\$" working-directory: wordpress + timeout-minutes: 15 - name: Run AJAX tests run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group ajax working-directory: wordpress + timeout-minutes: 15 - name: Run ms-files tests as a multisite install run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c tests/phpunit/multisite.xml --group ms-files working-directory: wordpress + timeout-minutes: 15 - name: Run external HTTP tests run: | node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c phpunit.xml.dist --group external-http working-directory: wordpress + timeout-minutes: 15 diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index fa73684dfc..bcc1fdf73b 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -12,7 +12,7 @@ jobs: name: Review Dependencies steps: - name: Harden Runner - uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 with: egress-policy: block allowed-endpoints: > diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fc916db921..7a441ec2db 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -38,7 +38,7 @@ jobs: contents: read steps: - name: Harden Runner - uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 with: egress-policy: block allowed-endpoints: @@ -88,7 +88,7 @@ jobs: uses: ./.github/actions/prepare-source - name: Setup Node - uses: actions/setup-node@v6.3.0 + uses: actions/setup-node@v6.4.0 with: node-version: 'lts/*' cache: npm @@ -140,7 +140,7 @@ jobs: contents: read steps: - name: Harden Runner - uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 with: egress-policy: audit @@ -148,7 +148,7 @@ jobs: uses: actions/checkout@v6.0.2 - name: Setup Node - uses: actions/setup-node@v6.3.0 + uses: actions/setup-node@v6.4.0 with: node-version: 'lts/*' cache: npm diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4dc56555c0..f8a0a54824 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -37,7 +37,7 @@ jobs: fail-fast: 'true' - name: Setup Node - uses: actions/setup-node@v6.3.0 + uses: actions/setup-node@v6.4.0 with: node-version: 'lts/*' cache: npm @@ -58,7 +58,7 @@ jobs: uses: actions/checkout@v6.0.2 - name: Setup Node - uses: actions/setup-node@v6.3.0 + uses: actions/setup-node@v6.4.0 with: node-version: 'lts/*' cache: npm diff --git a/.github/workflows/parsely.yml b/.github/workflows/parsely.yml index eb5416ad67..74e4608db0 100644 --- a/.github/workflows/parsely.yml +++ b/.github/workflows/parsely.yml @@ -59,3 +59,4 @@ jobs: with: wordpress: ${{ matrix.config.wp }} php: ${{ matrix.config.php }} + timeout-minutes: 15 diff --git a/.github/workflows/release-prod.yml b/.github/workflows/release-prod.yml index 56cc741156..47cabe515d 100644 --- a/.github/workflows/release-prod.yml +++ b/.github/workflows/release-prod.yml @@ -19,7 +19,7 @@ jobs: id: ${{ steps.id-generator.outputs.id }} steps: - name: Harden Runner - uses: step-security/harden-runner@f808768d1510423e83855289c910610ca9b43176 # v2.17.0 + uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0 with: egress-policy: audit diff --git a/.github/workflows/search-dev-tools.yml b/.github/workflows/search-dev-tools.yml index 72564b905a..18415acafb 100644 --- a/.github/workflows/search-dev-tools.yml +++ b/.github/workflows/search-dev-tools.yml @@ -27,7 +27,7 @@ jobs: token: ${{ secrets.WPCOM_VIP_BOT_TOKEN }} - name: Setup Node - uses: actions/setup-node@v6.3.0 + uses: actions/setup-node@v6.4.0 with: node-version: 'lts/*' cache: npm diff --git a/__tests__/e2e/package-lock.json b/__tests__/e2e/package-lock.json index 6ba23b5513..b94652bafb 100644 --- a/__tests__/e2e/package-lock.json +++ b/__tests__/e2e/package-lock.json @@ -18,9 +18,9 @@ } }, "node_modules/@automattic/eslint-plugin-wpvip": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@automattic/eslint-plugin-wpvip/-/eslint-plugin-wpvip-1.2.0.tgz", - "integrity": "sha512-pW94RykjqZfU/W/HHjf/RIZcUZLxtoVAk48F6tgY+Wz5W4i/R3mYmquuSTeJ8fBPSxHrnxb00VWxyK0akyd+Fw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@automattic/eslint-plugin-wpvip/-/eslint-plugin-wpvip-1.2.1.tgz", + "integrity": "sha512-WjudJ+ZBFfTND7Jo+v/CC4zWX/X4gVVvbTb6oBAjNXLf0tpaExfV6cgh+HBX/U0qT8juxr/30IyIJyklIzQKgg==", "dev": true, "license": "GPL-2.0+", "dependencies": { @@ -2945,9 +2945,9 @@ } }, "node_modules/eslint-plugin-playwright": { - "version": "2.10.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-2.10.1.tgz", - "integrity": "sha512-qea3UxBOb8fTwJ77FMApZKvRye5DOluDHcev0LDJwID3RELeun0JlqzrNIXAB/SXCyB/AesCW/6sZfcT9q3Edg==", + "version": "2.10.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-2.10.2.tgz", + "integrity": "sha512-0N+2OWc3NZbOZ0gK8mp2TK6Qu3UWcJTQ9rqU0UM2yRJXgT758pvpY0lsOLIySfbyFrLqn3TcXjixbmcK90VnuQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/query-monitor/assets/build/query-monitor.css b/query-monitor/assets/build/query-monitor.css index c4e8e8746f..67c402f36a 100644 --- a/query-monitor/assets/build/query-monitor.css +++ b/query-monitor/assets/build/query-monitor.css @@ -1 +1 @@ -.qm-container{color-scheme:light dark;--qm-wp-fresh: #2271b1;--qm-wp-modern: #3858e9;--qm-container-fg: light-dark( #1e1e1e, #eaeef2 );--qm-container-bg: light-dark( #f0f0f0, #32373c );--qm-container-overflow: light-dark( #ececec, #3e444a );--qm-panel-border: light-dark( #c3c4c7, #50626f );--qm-panel-fg: light-dark( #1e1e1e, #eaeef2 );--qm-panel-bg: light-dark( #fff, #23282d );--qm-panel-separator: light-dark( #dcdcde, #50626f );--qm-panel-menu-fg: light-dark( #3c434a, #eaeef2 );--qm-panel-menu-bg: light-dark( #ececec, #3e444a );--qm-panel-menu-fg-hover: light-dark( #fff, #fff );--qm-panel-menu-bg-selected: light-dark( var( --qm-wp-color ), var( --qm-wp-color ) );--qm-panel-menu-bg-hover: var( --qm-panel-menu-bg-selected );--qm-panel-menu-shadow: var( --qm-panel-menu-bg-selected );--qm-panel-menu-fg-current: light-dark( #1e1e1e, #eaeef2 );--qm-panel-menu-bg-current: light-dark( #e2e4e7, #32373c );--qm-panel-menu-bg-current-focus: light-dark( #f0f3f7, #3e444a );--qm-panel-menu-fg-selected: light-dark( #fff, #fff );--qm-cell-border: light-dark( #e9e9eb, #23282d );--qm-cell-bg-hover: light-dark( #f0f6fc, #373c42 );--qm-cell-fg-highlight: light-dark( #1e1e1e, #eaeef2 );--qm-cell-bg-highlight: light-dark( #ffd, #57572a );--qm-cell-bg-highlight-alt: light-dark( #ffffc9, #4a4a24 );--qm-cell-bg-highlight-dark: light-dark( #ffffaa, #353519 );--qm-cell-bg-stripe: light-dark( #f9f9f9, #32373c );--qm-table-header-bg: light-dark( #ececec, #3e444a );--qm-table-footer-bg: light-dark( #f6f7f7, #32373c );--qm-link-fg: light-dark( var( --qm-wp-color ), #30ceff );--qm-link-fg-hover: oklch(from var( --qm-link-fg ) calc(l - .2) c h);--qm-link-fg-active: light-dark( #0a4b78, #69aadc );--qm-button-fg: light-dark( #fff, #fff );--qm-button-bg: light-dark( var( --qm-wp-color ), var( --qm-wp-color ) );--qm-button-fg-hover: var( --qm-button-fg );--qm-button-bg-hover: oklch(from var( --qm-button-bg ) calc(l - .2) c h);--qm-button-fg-active: light-dark( #fff, #fff );--qm-button-bg-active: light-dark( #0a4b78, #0a4b78 );--qm-title-button-fg: light-dark( #444, #bbc8d4 );--qm-title-button-bg: light-dark( transparent, transparent );--qm-title-button-fg-hover: light-dark( #1e1e1e, #32373c );--qm-title-button-bg-hover: light-dark( #dcdcde, #bbc8d4 );--qm-title-button-bg-active: light-dark( #c8c8ca, #a3b0bc );--qm-info-fg: light-dark( #50575e, #aaa );--qm-warn-fg: light-dark( #8a2424, #fff0f0 );--qm-warn-bg: light-dark( #fcf0f1, #622 );--qm-warn-bg-dark: light-dark( #fceced, #6c2424 );--qm-warn-bg-hover: light-dark( #fdeced, #7a2a2a );--qm-warn-border: light-dark( #facfd2, #ffd6d6 );--qm-nonselect-fg: light-dark( #a0a, #a6a );--qm-title-bg: light-dark( #ececec, #3e444a );--qm-selection-fg: light-dark( #1e1e1e, #32373c );--qm-selection-bg: light-dark( #B9D6FB, #B9D6FB );--qm-badge-fg: light-dark( #50575e, #c3c4c7 );--qm-badge-bg: light-dark( #dcdcde, #50626f );--qm-badge-warn-fg: light-dark( #8a2424, #f0c0c0 );--qm-badge-warn-bg: light-dark( #facfd2, #6c2424 );--qm-sql-keyword-fg: light-dark( var( --qm-wp-color ), #30ceff );--qm-sql-value-fg: light-dark( #a44, #ce9178 );--qm-timeline-db: #3858e9;--qm-timeline-http: #888888;--qm-timeline-php-error: #d63638;--qm-timeline-timing: #2e7d32;--qm-timeline-action: #9c27b0;--qm-timeline-log: #ff9800;--qm-font-default-face: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;--qm-font-default-size: 12.5px;--qm-font-default-line-height: 19px;--qm-font-code-face: Menlo, Monaco, Consolas, monospace;--qm-font-code-size: 11px;--qm-font-code-line-height: 20px;--qm-admin-toolbar-height: 32px;--qm-fabulous-gradient: repeating-linear-gradient( 135deg, #FFFFFF 0px, #FFFFFF 20px, #F5A9B8 20px, #F5A9B8 40px, #5BCEFA 40px, #5BCEFA 60px, #613915 60px, #613915 80px, #000000 80px, #000000 100px, #E40303 100px, #E40303 120px, #FF8D00 120px, #FF8D00 140px, #FFED00 140px, #FFED00 160px, #008026 160px, #008026 180px, #004DFF 180px, #004DFF 200px, #750787 200px, #750787 220px );background:var( --qm-panel-bg );box-sizing:border-box;color:var( --qm-container-fg );direction:ltr;font-family:var( --qm-font-default-face );font-size:var( --qm-font-default-size );font-style:normal;font-weight:400;line-height:var( --qm-font-default-line-height );text-align:left;&[data-color-scheme=fresh]{--qm-wp-color: var( --qm-wp-fresh )}&[data-color-scheme=modern]{--qm-wp-color: var( --qm-wp-modern )}&[data-theme=light]{color-scheme:light}&[data-theme=dark]{color-scheme:dark}}#query-monitor-main{border-top:1px solid var( --qm-panel-border );border-radius:8px 8px 0 0;bottom:0;contain:layout paint;left:0;position:fixed;right:0;box-shadow:0 -4px 20px #00000014;z-index:9989;&:not(.qm-show-right){width:100%!important;&.wp-admin{left:unset;width:calc(100% - 160px)!important}&.wp-admin.rtl{left:0;right:unset}&.wp-admin.folded{width:calc(100% - 36px)!important}@media(width<=960px){&.wp-admin.auto-fold{width:calc(100% - 36px)!important}}@media(width<=782px){&.wp-admin.auto-fold{left:0;right:0;width:100%!important}}&.wp-admin.fullscreen-mode{left:0;width:100%!important}}&.qm-show-right{height:calc(100vh - var( --qm-admin-toolbar-height ))!important;top:var( --qm-admin-toolbar-height );left:unset;bottom:unset;border-top:0;border-left:1px solid var( --qm-panel-border );#qm-title h1.qm-title-heading{display:none}#qm-title div.qm-title-heading{display:block;cursor:default}}}*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0}button,select{background:transparent;border:none;border-radius:0;font:inherit;color:inherit}a{color:inherit}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}th,caption{font-weight:inherit;text-align:inherit}td,th{vertical-align:baseline}::selection{background-color:var( --qm-selection-bg );color:var( --qm-selection-fg )}strong,b{font-weight:700}em,i{font-style:italic}.qm-cell-sql b{color:var( --qm-sql-keyword-fg )}.qm-cell-sql .qm-sql-value{color:var( --qm-sql-value-fg )}.qm-show{display:flex;flex-direction:column;height:60%}.qm-show-right.qm-show{width:40%}#qm-panels-wrapper{display:flex;flex-grow:1;min-height:0}#qm-title{align-items:center;background:var( --qm-title-bg );border-bottom:1px solid var( --qm-panel-border );display:flex;flex-shrink:0;height:30px;padding-left:12px;-webkit-user-select:none;user-select:none;.qm-title-heading{align-content:center;align-self:stretch;cursor:ns-resize;flex-grow:1;margin-right:6px;font-size:11px;font-weight:500}&.qm-fabulous .qm-title-heading{&:before{content:"";display:block;width:100%;height:8px;clip-path:polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%);animation:qm-fabulous-swipe .5s ease-out;background:var( --qm-fabulous-gradient )}span{display:none}}div.qm-title-heading{display:none}.qm-icon{display:inline-block;height:20px;width:20px;fill:var( --qm-title-button-fg )}.qm-button-container-close{margin-right:10px;.qm-icon{width:18px;height:18px}}.qm-button-container-position{.qm-icon{width:12px;height:12px;transform:scaleX(-1) rotate(90deg)}}.qm-button-container-settings{.qm-icon{width:14px;height:14px}}@media(width<=960px){.qm-button-container-position{display:none}}button{flex-shrink:0;align-self:stretch;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;width:28px;&:focus *,&:hover *,&:focus,&:hover{background:var( --qm-title-button-bg-hover );.qm-icon{fill:var( --qm-title-button-fg-hover )}}&:active *,&:active{background:var( --qm-title-button-bg-active )}}}.qm-show-right #qm-title .qm-button-container-position .qm-icon{margin:1px 1px 0;transform:none}#qm-panel-menu{background:var( --qm-container-overflow );flex-shrink:0;overflow-y:scroll;overscroll-behavior:contain;min-width:180px;ul{display:block;list-style:none;margin:0;padding:0}li{display:list-item;margin:0;padding:0;ul{display:none}button{align-items:center;background:var( --qm-panel-menu-bg );color:var( --qm-panel-menu-fg );cursor:pointer;display:flex;gap:4px;padding:7px 12px;position:relative;text-align:start;width:100%;&:focus-visible,&:hover{background:var( --qm-panel-menu-bg-hover );color:var( --qm-panel-menu-fg-hover )}&:focus-visible{text-decoration:underline}&:active{text-decoration:none;background:var( --qm-panel-menu-bg-selected );color:var( --qm-panel-menu-fg-selected )}}&.qm-current-menu{ul{display:block}button{background:var( --qm-panel-menu-bg-current );color:var( --qm-panel-menu-fg-current );&:focus-visible{background:var( --qm-panel-menu-bg-current-focus );color:var( --qm-panel-menu-fg-current )}&:hover{background:var( --qm-panel-menu-bg-hover );color:var( --qm-panel-menu-fg-hover )}}}li button{&:before{content:"└";display:inline-block;margin-right:8px;opacity:.3}}button[aria-selected=true]{background:var( --qm-panel-menu-bg-selected );color:var( --qm-panel-menu-fg-selected );font-weight:500;text-shadow:0 -1px 1px var( --qm-panel-menu-shadow ),1px 0 1px var( --qm-panel-menu-shadow ),0 1px 1px var( --qm-panel-menu-shadow ),-1px 0 1px var( --qm-panel-menu-shadow );&:after{border:solid 8px transparent;border-right-color:var( --qm-panel-bg );content:" ";display:inline-block;height:0;margin-top:-8px;pointer-events:none;position:absolute;right:-1px;top:50%;width:0}.qm-menu-badge{background:#ffffff40;color:#fff}.qm-menu-badge-warning{background:var( --qm-badge-warn-bg );color:var( --qm-badge-warn-fg )}}.qm-menu-badge{background:var( --qm-badge-bg );border-radius:99px;color:var( --qm-badge-fg );font-size:10.5px;font-weight:600;line-height:1;margin-left:auto;min-width:18px;padding:3px 7px;text-align:center;text-shadow:none}.qm-menu-badge-warning{background:var( --qm-badge-warn-bg );color:var( --qm-badge-warn-fg );margin-left:auto}.qm-menu-badge-new{background:var( --qm-panel-menu-bg-hover );color:var( --qm-panel-menu-fg-hover )}.qm-menu-badge+.qm-menu-badge-warning{margin-left:0}}}#qm-panels{flex-grow:1;overflow-y:scroll;overscroll-behavior:contain;border:6px solid var( --qm-panel-bg );border-bottom:none}.qm-boxed{display:flex;flex-wrap:wrap;gap:10px;+.qm-grid,+.qm-boxed{padding-top:10px}}.qm-grid{display:flex;flex-wrap:wrap;gap:10px;section{width:22em}}.qm{.qm-none{margin:2em}.qm-none p{font-style:italic;text-align:center}table{border:none;border-collapse:collapse;box-shadow:0 1px 0 0 var( --qm-panel-border );color:var( --qm-panel-fg );margin:0;table-layout:auto;width:100%}table+table{border-top:1px solid var( --qm-cell-border );margin-top:5px}thead,tbody,tfoot,tr{border:none;background-color:inherit}tbody th,tbody td,tfoot th,tfoot td{border:1px solid var( --qm-cell-border );padding:7px 8px 6px;vertical-align:top}tbody th,tbody td{border-bottom:none;border-top:none}thead th{background:var( --qm-table-header-bg );box-shadow:0 2px 4px #0000000f;font-weight:600;letter-spacing:.01em;padding:7px 7px 7px 8px;position:sticky;top:0;z-index:1}.qm-table-header th{padding:0;box-shadow:none}thead th,thead td{vertical-align:top}thead .qm-th{display:flex}tfoot tr td,tfoot tr th{background:var( --qm-table-footer-bg );border:none;bottom:0;box-shadow:inset 0 1px 0 var( --qm-cell-border );position:sticky}th:first-child,td:first-child{border-left:none}th:last-child,td:last-child{border-right:none}tfoot td.qm-num,tfoot th.qm-num,thead td.qm-num,thead th.qm-num{width:5.5em}th.qm-num,td.qm-num{text-align:right}td.qm-num{font-family:var( --qm-font-code-face );font-size:var( --qm-font-code-size );line-height:var( --qm-font-code-line-height )}th.qm-col-sql{min-width:25em}th.qm-col-attrs,th.qm-col-context,th.qm-col-html{max-width:40em}th.qm-col-attrs,th.qm-col-context,th.qm-col-html,tr.qm-warn td.qm-cell-status,th.qm-col-url,th.qm-col-message,th.qm-col-component{min-width:15em}td.qm-has-toggle{padding-right:28px;position:relative}.qm-inner-toggle{padding:4px 6px}.qm-has-inner .qm-toggled>table{border-bottom:none;border-top:1px solid var( --qm-cell-border )}td.qm-has-inner .qm-toggler,td.qm-has-inner{padding:0}caption h2{font-size:14px;margin:20px}}.qm-concerns table{border-top:1px solid var( --qm-cell-border );margin-bottom:20px}.qm-table-children,.qm-non-tabular{padding:10px;h3{font-size:14px;margin:0 0 15px}h4{font-size:12px;margin:20px 0 10px}p{margin-bottom:10px}dl{display:flex;flex-wrap:wrap;max-width:60em}dt{border-top:1px solid var( --qm-panel-separator );flex-grow:0;flex:1 0 16em;padding:10px 10px 10px 0}dd{border-top:1px solid var( --qm-panel-separator );flex:1 0 calc(100% - 10px - 16em);padding:10px 0}section,.qm-section{margin:0 0 30px}table{box-shadow:none}}.qm-grid section,.qm-boxed section,.qm-boxed .qm-section{border:1px solid var( --qm-panel-border );border-radius:6px;padding:14px 18px;margin:0}#qm-conditionals li{display:inline-block;margin:0 20px 5px 0}.qm{ol,ul{list-style:none}li{display:list-item;list-style:none;line-height:20px}code,pre{font-family:var( --qm-font-code-face );font-size:var( --qm-font-code-size );line-height:var( --qm-font-code-line-height )}pre{background:transparent;height:auto;margin:0;padding:0;width:auto}.qm-true code,p.qm-true,span.qm-true,td.qm-true{color:#282}.qm-false code,span.qm-false,td.qm-false{color:#767676}.qm-num,code,.qm-nowrap{white-space:nowrap}.qm-wrap code,.qm-wrap{white-space:normal;word-break:break-all;word-wrap:break-word}.qm-pre-wrap code{white-space:pre-wrap;word-break:break-all;word-wrap:break-word}.qm-sticky{position:sticky;top:36px}.qm-current,td.qm-has-toggle p,.qm-nonselectsql code,.qm-nonselectsql{color:var( --qm-nonselect-fg )}.qm-info{color:var( --qm-info-fg )}.qm-supplemental{margin-left:.75em;margin-right:.75em}button.qm-button,.qm-toggle{background:var( --qm-button-bg );border:1px solid var( --qm-button-bg );border-radius:4px;color:var( --qm-button-fg );cursor:pointer;font-weight:400;text-shadow:none}.qm-toggle{font-family:var( --qm-font-code-face );height:18px;inset:7px 7px auto auto;line-height:16px;padding:0;position:absolute;text-align:center;-webkit-user-select:none;user-select:none;width:18px}button{cursor:pointer}button.qm-button{padding:4px 10px}.qm-has-inner .qm-toggle{right:7px;top:7px}button.qm-button:hover,.qm-toggle:hover{background:var( --qm-button-bg-hover );border-color:var( --qm-button-bg-hover );color:var( --qm-button-fg-hover );text-decoration:none}button.qm-button:focus-visible,.qm-toggle:focus-visible{background:var( --qm-button-bg-hover );border-color:var( --qm-button-bg-hover );color:var( --qm-button-fg-hover );box-shadow:0 0 0 1px #fff,0 0 0 3px var( --qm-button-bg-hover )}button.qm-button:active,.qm-toggle:active{background:var( --qm-button-bg-active );border-color:var( --qm-button-bg-active );color:var( --qm-button-fg-active );box-shadow:none}input[type=radio].qm-radio,input[type=radio].qm-radio:checked,input[type=radio].qm-radio:focus-visible,input[type=radio].qm-radio:checked:focus-visible,input[type=radio].qm-radio:hover,input[type=radio].qm-radio:checked:hover,input[type=checkbox].qm-checkbox,input[type=checkbox].qm-checkbox:checked,input[type=checkbox].qm-checkbox:focus-visible,input[type=checkbox].qm-checkbox:checked:focus-visible,input[type=checkbox].qm-checkbox:hover,input[type=checkbox].qm-checkbox:checked:hover{all:revert;accent-color:var( --qm-button-bg );vertical-align:-2px;margin-right:5px;&:before,&:after{display:none}}.qm-fabulous-toggle{margin-top:10px}tbody tr td,tbody tr th{background:var( --qm-panel-bg )}tbody tr:nth-child(2n) td,tbody tr:nth-child(2n) th{background:var( --qm-cell-bg-stripe )}}.qm-warning-wrapper{display:flex;align-items:start;>.qm-icon{flex-shrink:0}}.qm-non-tabular .qm-warn,.qm thead tr .qm-warn,.qm tbody tr:not(.qm-warn) .qm-warn{background-color:var( --qm-warn-bg );color:var( --qm-warn-fg );.qm-icon{fill:var( --qm-warn-fg )}}.qm{tbody tr th.qm-warn,tbody tr td.qm-warn,tbody tr.qm-warn td,tbody tr.qm-warn th{background-color:var( --qm-warn-bg );color:var( --qm-warn-fg );.qm-icon{fill:var( --qm-warn-fg )}}tbody tr:nth-child(odd) .qm-warn,tbody tr:nth-child(odd) th.qm-warn,tbody tr:nth-child(odd) td.qm-warn,tbody tr:nth-child(odd).qm-warn td,tbody tr:nth-child(odd).qm-warn th{background-color:var( --qm-warn-bg-dark )}tbody tr.qm-warn .qm-warn{background-color:transparent}}.qm-non-tabular .qm-warn code,.qm tbody .qm-warn li,.qm tbody .qm-warn .qm-info,.qm tbody .qm-warn code{background-color:transparent;color:var( --qm-warn-fg );.qm-icon{fill:var( --qm-warn-fg )}}.qm{.qm-empty{background:var( --qm-panel-bg );border:1px solid var( --qm-panel-menu-bg-hover );margin:0 0 10px;max-width:40em;padding:20px 30px 10px}.qm-error{background:var( --qm-warn-bg );border:1px solid var( --qm-warn-border );color:var( --qm-warn-fg );margin:0 0 10px;padding:10px 20px}.qm-icon{margin-top:.1em;margin-right:.3em;display:inline-block;height:16px;width:16px;fill:var( --qm-container-fg );vertical-align:top}.qm-icon-yes-alt{fill:#0a0}tbody tr td.qm-highlight,tbody tr.qm-highlight th,tbody tr.qm-highlight td:not(.qm-cell-hook){background-color:var( --qm-cell-bg-highlight );color:var( --qm-cell-fg-highlight )}tbody tr:nth-child(odd) td.qm-highlight,tbody tr:nth-child(odd).qm-highlight th,tbody tr:nth-child(odd).qm-highlight td:not(.qm-cell-hook){background-color:var( --qm-cell-bg-highlight-alt );color:var( --qm-cell-fg-highlight )}tbody tr:not(.qm-warn-notice):nth-child(odd):hover th,tbody tr:not(.qm-warn-notice):nth-child(odd):hover td,tbody tr:not(.qm-warn-notice):hover th,tbody tr:not(.qm-warn-notice):hover td{background:var( --qm-cell-bg-hover )}tbody tr.qm-warn:not(.qm-warn-notice):hover th,tbody tr.qm-warn:not(.qm-warn-notice):hover td{background:var( --qm-warn-bg-hover )}tbody tr.qm-highlight:hover th,tbody tr.qm-highlight:hover td:not(.qm-cell-hook){background:var( --qm-cell-bg-highlight-dark )}tbody tr.qm-jump-highlight th,tbody tr.qm-jump-highlight td{animation:qm-jump-fade 4s ease-out}thead th.qm-filtered select.qm-filter{background-color:var( --qm-cell-bg-highlight );color:var( --qm-cell-fg-highlight )}button.qm-filter-trigger,button.qm-filter-trigger code,tbody .qm-warn a code,a code,a{color:var( --qm-link-fg );cursor:pointer;&:after,&:focus-visible,&:hover{color:var( --qm-link-fg-hover )}&:active{color:var( --qm-link-fg-active )}}a.qm-external-link,a.qm-link,a.qm-edit-link,button.qm-filter-trigger{white-space:nowrap;text-decoration:none;.qm-icon{fill:var( --qm-link-fg-hover )!important;width:16px;height:16px;left:2px;position:relative;text-decoration:none;top:2px;visibility:hidden}}a.qm-external-link{text-decoration:underline}a.qm-external-link,a.qm-link:hover,a.qm-link:focus-visible,a.qm-edit-link:hover,a.qm-edit-link:focus-visible,button.qm-filter-trigger:hover,button.qm-filter-trigger:focus-visible{.qm-icon{visibility:visible}}}button,select{background:none;cursor:pointer}.qm{label{color:var( --qm-panel-fg );cursor:pointer;font-size:12px}.qm-filter-container{display:flex}.qm-filter-container label{cursor:default;white-space:nowrap}}.qm-title-heading select,.qm-select,.qm-filter{appearance:menulist;background:var( --qm-panel-bg );border:none;border-radius:4px;color:var( --qm-panel-fg );cursor:pointer;display:block;margin:0 0 0 5px;outline:1px solid var( --qm-panel-border );padding:0}.qm-select,.qm-filter{max-width:12em}.qm-select:hover,.qm-filter:hover{background:var( --qm-cell-bg-hover )}.qm-screen-reader-text,.screen-reader-text{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}@media(width<=782px){#qm-panel-menu,#qm-title h1.qm-title-heading{display:none}#qm-title div.qm-title-heading{display:block}}.qm.qm-debug-bar{textarea,pre{border:1px solid var( --qm-panel-separator );margin:4px 0;padding:10px}textarea{resize:vertical}.left{float:left}.right{float:right}h2{font-size:14px;margin:4px 6px 15px}h3{border-left:1px solid var( --qm-panel-separator );clear:none;float:left;font-size:14px;margin:3px 0 15px;min-width:150px;padding:5px 15px 15px;text-align:center;&:first-child{border-left:none}small{font-size:14px}span{display:block;margin-bottom:8px;white-space:nowrap}}h4{font-size:13px;margin:15px 6px 5px}.qm-debug-bar-output{position:relative;table{margin-bottom:4px;margin-top:4px}}}#debug-menu-target-Debug_Bar_Console{min-height:400px}#debug-menu-target-Debug_Bar_Cache_Lookup,#debug-menu-target-Debug_Bar_Rewrite_Rules,#debug-menu-target-Debug_Bar_Widgets{margin:4px 6px}#debug-menu-target-Debug_Bar_Rewrite_Rules_Panel .filterui,#debug-menu-target-Debug_Bar_Rewrite_Rules_Panel .dbrr{margin:0}#debug-menu-target-Debug_Bar_Rewrite_Testing_Panel{padding:10px 0}#debug-menu-target-EP_Debug_Bar_ElasticPress{li{border-top:1px solid var( --qm-panel-separator );line-height:20px;padding:20px 0;.dashicons:hover{background-color:var( --qm-panel-menu-bg-hover )}}}#qm-logger tr pre{-webkit-user-select:all;user-select:all}#qm-timeline table{width:100%;td{background:var(--qm-panel-bg);padding:0}tr:hover td{background:var( --qm-cell-bg-hover )}}.timeline-header{display:flex;align-items:center;justify-content:space-between;margin:0;padding:10px 20px;border-bottom:5px solid var( --qm-panel-bg )}.timeline-header h3{margin:0}.timeline-filters{display:flex;gap:12px}.timeline-filter{display:flex;align-items:center;gap:4px;font-size:12px;cursor:pointer;color:var( --qm-container-fg )}.timeline-filter input{margin:0}.timeline-axis{position:relative;height:18px;pointer-events:none;background-color:var( --qm-button-bg );color:var( --qm-button-fg );border-radius:4px}.timeline-tick{position:absolute;bottom:0;transform:translate(-50%);font-size:11px;padding:3px;line-height:1;white-space:nowrap}.timeline-tick:first-child{transform:none}.timeline-tick:last-child{transform:translate(-100%)}.qm-cell-timeline{height:28px;position:relative;padding:0}.timeline-bar{position:absolute;top:6px;height:16px;border-radius:4px;min-width:2px;cursor:default}.timeline-point{width:3px!important;border-radius:3px}.timeline-bar-label{position:absolute;top:5px;padding:0 5px;white-space:nowrap;right:0;max-width:30%;display:flex;gap:4px}.timeline-bar-label-text{overflow:hidden;text-overflow:ellipsis;min-width:0}.timeline-bar-label-text .qm-filter-trigger{max-width:100%;overflow:hidden;text-overflow:ellipsis}.timeline-bar-label-time{flex-shrink:0}@keyframes qm-jump-fade{0%,50%{background:var( --qm-cell-bg-highlight-dark )}}@keyframes qm-fabulous-swipe{0%{clip-path:polygon(6px 0,6px 0,0 100%,0 100%)}to{clip-path:polygon(6px 0,100% 0,calc(100% - 6px) 100%,0 100%)}}@media(prefers-reduced-motion:reduce){.qm-fabulous .qm-title-heading:before{animation:none}tbody tr.qm-jump-highlight th,tbody tr.qm-jump-highlight td{animation:none;background:var( --qm-cell-bg-highlight-dark )}} +.qm-container{color-scheme:light dark;--qm-wp-fresh: #2271b1;--qm-wp-modern: #3858e9;--qm-container-fg: light-dark( #1e1e1e, #eaeef2 );--qm-container-bg: light-dark( #f0f0f0, #32373c );--qm-container-overflow: light-dark( #ececec, #3e444a );--qm-panel-border: light-dark( #c3c4c7, #50626f );--qm-panel-fg: light-dark( #1e1e1e, #eaeef2 );--qm-panel-bg: light-dark( #fff, #23282d );--qm-panel-separator: light-dark( #dcdcde, #50626f );--qm-panel-menu-fg: light-dark( #3c434a, #eaeef2 );--qm-panel-menu-bg: light-dark( #ececec, #3e444a );--qm-panel-menu-fg-hover: light-dark( #fff, #fff );--qm-panel-menu-bg-selected: light-dark( var( --qm-wp-color ), var( --qm-wp-color ) );--qm-panel-menu-bg-hover: var( --qm-panel-menu-bg-selected );--qm-panel-menu-shadow: var( --qm-panel-menu-bg-selected );--qm-panel-menu-fg-current: light-dark( #1e1e1e, #eaeef2 );--qm-panel-menu-bg-current: light-dark( #e2e4e7, #32373c );--qm-panel-menu-bg-current-focus: light-dark( #f0f3f7, #3e444a );--qm-panel-menu-fg-selected: light-dark( #fff, #fff );--qm-cell-border: light-dark( #e9e9eb, #23282d );--qm-cell-bg-hover: light-dark( #f0f6fc, #373c42 );--qm-cell-fg-highlight: light-dark( #1e1e1e, #eaeef2 );--qm-cell-bg-highlight: light-dark( #ffd, #57572a );--qm-cell-bg-highlight-alt: light-dark( #ffffc9, #4a4a24 );--qm-cell-bg-highlight-dark: light-dark( #ffffaa, #353519 );--qm-cell-bg-stripe: light-dark( #f9f9f9, #32373c );--qm-table-header-bg: light-dark( #ececec, #3e444a );--qm-table-footer-bg: light-dark( #f6f7f7, #32373c );--qm-link-fg: light-dark( var( --qm-wp-color ), #30ceff );--qm-link-fg-hover: oklch(from var( --qm-link-fg ) calc(l - .2) c h);--qm-link-fg-active: light-dark( #0a4b78, #69aadc );--qm-button-fg: light-dark( #fff, #fff );--qm-button-bg: light-dark( var( --qm-wp-color ), var( --qm-wp-color ) );--qm-button-fg-hover: var( --qm-button-fg );--qm-button-bg-hover: oklch(from var( --qm-button-bg ) calc(l - .2) c h);--qm-button-fg-active: light-dark( #fff, #fff );--qm-button-bg-active: light-dark( #0a4b78, #0a4b78 );--qm-title-button-fg: light-dark( #444, #bbc8d4 );--qm-title-button-bg: light-dark( transparent, transparent );--qm-title-button-fg-hover: light-dark( #1e1e1e, #32373c );--qm-title-button-bg-hover: light-dark( #dcdcde, #bbc8d4 );--qm-title-button-bg-active: light-dark( #c8c8ca, #a3b0bc );--qm-info-fg: light-dark( #50575e, #aaa );--qm-warn-fg: light-dark( #8a2424, #fff0f0 );--qm-warn-bg: light-dark( #fcf0f1, #622 );--qm-warn-bg-dark: light-dark( #fceced, #6c2424 );--qm-warn-bg-hover: light-dark( #fdeced, #7a2a2a );--qm-warn-border: light-dark( #facfd2, #ffd6d6 );--qm-nonselect-fg: light-dark( #a0a, #a6a );--qm-title-bg: light-dark( #ececec, #3e444a );--qm-selection-fg: light-dark( #1e1e1e, #32373c );--qm-selection-bg: light-dark( #B9D6FB, #B9D6FB );--qm-badge-fg: light-dark( #50575e, #c3c4c7 );--qm-badge-bg: light-dark( #dcdcde, #50626f );--qm-badge-warn-fg: light-dark( #8a2424, #f0c0c0 );--qm-badge-warn-bg: light-dark( #facfd2, #6c2424 );--qm-sql-keyword-fg: light-dark( var( --qm-wp-color ), #30ceff );--qm-sql-value-fg: light-dark( #a44, #ce9178 );--qm-timeline-db: #3858e9;--qm-timeline-http: #888888;--qm-timeline-php-error: #d63638;--qm-timeline-timing: #2e7d32;--qm-timeline-action: #9c27b0;--qm-timeline-log: #ff9800;--qm-timeline-transient: #00897b;--qm-timeline-doing-it-wrong: #b84a6a;--qm-font-default-face: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;--qm-font-default-size: 12px;--qm-font-default-line-height: 19px;--qm-font-code-face: Menlo, Monaco, Consolas, monospace;--qm-font-code-size: 11px;--qm-font-code-line-height: 20px;--qm-admin-toolbar-height: 32px;--qm-fabulous-gradient: repeating-linear-gradient( 135deg, #FFFFFF 0px, #FFFFFF 20px, #F5A9B8 20px, #F5A9B8 40px, #5BCEFA 40px, #5BCEFA 60px, #613915 60px, #613915 80px, #000000 80px, #000000 100px, #E40303 100px, #E40303 120px, #FF8D00 120px, #FF8D00 140px, #FFED00 140px, #FFED00 160px, #008026 160px, #008026 180px, #004DFF 180px, #004DFF 200px, #750787 200px, #750787 220px );background:var( --qm-panel-bg );box-sizing:border-box;color:var( --qm-container-fg );direction:ltr;font-family:var( --qm-font-default-face );font-size:var( --qm-font-default-size );font-style:normal;font-weight:400;line-height:var( --qm-font-default-line-height );text-align:left;&[data-color-scheme=fresh]{--qm-wp-color: var( --qm-wp-fresh )}&[data-color-scheme=modern]{--qm-wp-color: var( --qm-wp-modern )}&[data-theme=light]{color-scheme:light}&[data-theme=dark]{color-scheme:dark}}#query-monitor-main{border-top:1px solid var( --qm-panel-border );bottom:0;contain:layout paint;left:0;position:fixed;right:0;box-shadow:0 -4px 20px #00000014;z-index:9989;&:not(.qm-show-right){width:100%!important;&.wp-admin{left:unset;width:calc(100% - 160px)!important}&.wp-admin.rtl{left:0;right:unset}&.wp-admin.folded{width:calc(100% - 36px)!important}@media(width<=960px){&.wp-admin.auto-fold{width:calc(100% - 36px)!important}}@media(width<=782px){&.wp-admin.auto-fold{left:0;right:0;width:100%!important}}&.wp-admin.fullscreen-mode{left:0;width:100%!important}}&.qm-show-right{height:calc(100vh - var( --qm-admin-toolbar-height ))!important;top:var( --qm-admin-toolbar-height );left:unset;bottom:unset;border-top:0;border-left:1px solid var( --qm-panel-border );#qm-title h1.qm-title-heading{display:none}#qm-title div.qm-title-heading{display:block;cursor:default}}}*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0}button,select{background:transparent;border:none;border-radius:0;font:inherit;color:inherit}a{color:inherit}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}th,caption{font-weight:inherit;text-align:inherit}td,th{vertical-align:baseline}::selection{background-color:var( --qm-selection-bg );color:var( --qm-selection-fg )}strong,b{font-weight:700}em,i{font-style:italic}.qm-cell-sql b{color:var( --qm-sql-keyword-fg )}.qm-cell-sql .qm-sql-value{color:var( --qm-sql-value-fg )}.qm-show{display:flex;flex-direction:column;height:60%}.qm-show-right.qm-show{width:40%}#qm-panels-wrapper{display:flex;flex-grow:1;min-height:0}#qm-title{align-items:center;background:var( --qm-title-bg );border-bottom:1px solid var( --qm-panel-border );display:flex;flex-shrink:0;height:30px;padding-left:12px;-webkit-user-select:none;user-select:none;.qm-title-heading{align-content:center;align-self:stretch;cursor:ns-resize;flex-grow:1;margin-right:6px;font-size:11px;font-weight:500}&.qm-fabulous .qm-title-heading{&:before{content:"";display:block;width:100%;height:8px;clip-path:polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%);animation:qm-fabulous-swipe .5s ease-out;background:var( --qm-fabulous-gradient )}span{display:none}}div.qm-title-heading{display:none}.qm-icon{display:inline-block;height:20px;width:20px;fill:var( --qm-title-button-fg )}.qm-button-container-close{margin-right:10px;.qm-icon{width:18px;height:18px}}.qm-button-container-position{.qm-icon{width:12px;height:12px;transform:scaleX(-1) rotate(90deg)}}.qm-button-container-settings{.qm-icon{width:14px;height:14px}}@media(width<=960px){.qm-button-container-position{display:none}}button{flex-shrink:0;align-self:stretch;background:transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;margin:0;padding:0;width:28px;&:focus *,&:hover *,&:focus,&:hover{background:var( --qm-title-button-bg-hover );.qm-icon{fill:var( --qm-title-button-fg-hover )}}&:active *,&:active{background:var( --qm-title-button-bg-active )}}}.qm-show-right #qm-title .qm-button-container-position .qm-icon{margin:1px 1px 0;transform:none}#qm-panel-menu{background:var( --qm-container-overflow );flex-shrink:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;min-width:180px;ul{display:block;list-style:none;margin:0;padding:0}li{display:list-item;margin:0;padding:0;ul{display:none}button{align-items:center;background:var( --qm-panel-menu-bg );color:var( --qm-panel-menu-fg );cursor:pointer;display:flex;gap:4px;padding:7px 12px;position:relative;text-align:start;width:100%;&:focus-visible,&:hover{background:var( --qm-panel-menu-bg-hover );color:var( --qm-panel-menu-fg-hover )}&:focus-visible{text-decoration:underline}&:active{text-decoration:none;background:var( --qm-panel-menu-bg-selected );color:var( --qm-panel-menu-fg-selected )}}&.qm-current-menu{ul{display:block}button{background:var( --qm-panel-menu-bg-current );color:var( --qm-panel-menu-fg-current );&:focus-visible{background:var( --qm-panel-menu-bg-current-focus );color:var( --qm-panel-menu-fg-current )}&:hover{background:var( --qm-panel-menu-bg-hover );color:var( --qm-panel-menu-fg-hover )}}}li button{&:before{content:"└";display:inline-block;margin-right:8px;opacity:.3}}button[aria-selected=true]{background:var( --qm-panel-menu-bg-selected );color:var( --qm-panel-menu-fg-selected );font-weight:500;text-shadow:0 -1px 1px var( --qm-panel-menu-shadow ),1px 0 1px var( --qm-panel-menu-shadow ),0 1px 1px var( --qm-panel-menu-shadow ),-1px 0 1px var( --qm-panel-menu-shadow );&:after{border:solid 8px transparent;border-right-color:var( --qm-panel-bg );content:" ";display:inline-block;height:0;margin-top:-8px;pointer-events:none;position:absolute;right:-1px;top:50%;width:0}.qm-menu-badge{background:#ffffff40;color:#fff}.qm-menu-badge-warning{background:var( --qm-badge-warn-bg );color:var( --qm-badge-warn-fg )}}.qm-menu-badge{background:var( --qm-badge-bg );border-radius:99px;color:var( --qm-badge-fg );font-size:10.5px;font-weight:600;line-height:1;margin-left:auto;min-width:18px;padding:3px 7px;text-align:center;text-shadow:none}.qm-menu-badge-warning{background:var( --qm-badge-warn-bg );color:var( --qm-badge-warn-fg );margin-left:auto}.qm-menu-badge-new{background:var( --qm-panel-menu-bg-hover );color:var( --qm-panel-menu-fg-hover )}.qm-menu-badge+.qm-menu-badge-warning{margin-left:0}}}#qm-panels{flex-grow:1;overflow-x:auto;overflow-y:auto;overscroll-behavior:contain;border:6px solid var( --qm-panel-bg );border-bottom:none}.qm-boxed{display:flex;flex-wrap:wrap;gap:10px;+.qm-grid,+.qm-boxed{padding-top:10px}}.qm-grid{display:flex;flex-wrap:wrap;gap:10px;section{width:22em}}.qm{.qm-none{margin:2em}.qm-none p{font-style:italic;text-align:center}table{border:none;border-collapse:collapse;box-shadow:0 1px 0 0 var( --qm-panel-border );color:var( --qm-panel-fg );margin:0;table-layout:auto;width:100%}table+table{border-top:1px solid var( --qm-cell-border );margin-top:5px}thead,tbody,tfoot,tr{border:none;background-color:inherit}tbody th,tbody td,tfoot th,tfoot td{border:1px solid var( --qm-cell-border );padding:7px 8px 6px;vertical-align:top}tbody th,tbody td{border-bottom:none;border-top:none}thead th{background:var( --qm-table-header-bg );font-weight:600;padding:5px 7px 5px 8px;position:sticky;top:0;z-index:1}.qm-table-header th{padding:0;box-shadow:none}thead th,thead td{vertical-align:top}thead .qm-th{display:flex}tfoot tr td,tfoot tr th{background:var( --qm-table-footer-bg );border:none;bottom:0;box-shadow:inset 0 1px 0 var( --qm-cell-border );position:sticky}th:first-child,td:first-child{border-left:none}th:last-child,td:last-child{border-right:none}tfoot td.qm-num,tfoot th.qm-num,thead td.qm-num,thead th.qm-num{width:5.5em}th.qm-num,td.qm-num{text-align:right}td.qm-num{font-family:var( --qm-font-code-face );font-size:var( --qm-font-code-size );line-height:var( --qm-font-code-line-height )}th.qm-col-sql{min-width:25em}th.qm-col-attrs,th.qm-col-context,th.qm-col-html{max-width:40em}th.qm-col-attrs,th.qm-col-context,th.qm-col-html,tr.qm-warn td.qm-cell-status,th.qm-col-url,th.qm-col-message,th.qm-col-component{min-width:15em}td.qm-has-toggle{padding-right:28px;position:relative}.qm-inner-toggle{padding:4px 6px}.qm-toggled{display:none}.qm-has-inner .qm-toggled>table{border-bottom:none;border-top:1px solid var( --qm-cell-border )}td.qm-has-inner .qm-toggler,td.qm-has-inner{padding:0}caption h2{font-size:14px;margin:20px}}.qm-concerns table{border-top:1px solid var( --qm-cell-border );margin-bottom:20px}.qm-table-children,.qm-non-tabular{padding:10px;h3{font-size:14px;margin:0 0 15px}h4{font-size:12px;margin:20px 0 10px}p{margin-bottom:10px}dl{display:flex;flex-wrap:wrap;max-width:60em}dt{border-top:1px solid var( --qm-panel-separator );flex-grow:0;flex:1 0 16em;padding:10px 10px 10px 0}dd{border-top:1px solid var( --qm-panel-separator );flex:1 0 calc(100% - 10px - 16em);padding:10px 0}section,.qm-section{margin:0 0 30px}table{box-shadow:none}}.qm-grid section,.qm-boxed section,.qm-boxed .qm-section{border:1px solid var( --qm-panel-border );border-radius:6px;padding:14px 18px;margin:0}#qm-conditionals li{display:inline-block;margin:0 20px 5px 0}.qm{ol,ul{list-style:none}li{display:list-item;list-style:none;line-height:20px}code,pre{font-family:var( --qm-font-code-face );font-size:var( --qm-font-code-size );line-height:var( --qm-font-code-line-height )}pre{background:transparent;height:auto;margin:0;padding:0;width:auto}.qm-true code,p.qm-true,span.qm-true,td.qm-true{color:#282}.qm-false code,span.qm-false,td.qm-false{color:#767676}.qm-num,code,.qm-nowrap{white-space:nowrap}.qm-wrap code,.qm-wrap{white-space:normal;word-break:break-all;word-wrap:break-word}.qm-pre-wrap code{white-space:pre-wrap;word-break:break-all;word-wrap:break-word}.qm-sticky{position:sticky;top:36px}.qm-current,td.qm-has-toggle p,.qm-nonselectsql code,.qm-nonselectsql{color:var( --qm-nonselect-fg )}.qm-info{color:var( --qm-info-fg )}.qm-supplemental{margin-left:.75em;margin-right:.75em}button.qm-button,.qm-toggle{background:var( --qm-button-bg );border:1px solid var( --qm-button-bg );border-radius:4px;color:var( --qm-button-fg );cursor:pointer;font-weight:400;text-shadow:none}.qm-toggle{font-family:var( --qm-font-code-face );height:18px;inset:7px 7px auto auto;line-height:16px;padding:0;position:absolute;text-align:center;-webkit-user-select:none;user-select:none;width:18px}button{cursor:pointer}button.qm-button{padding:4px 10px}.qm-has-inner .qm-toggle{right:7px;top:7px}button.qm-button:hover,.qm-toggle:hover{background:var( --qm-button-bg-hover );border-color:var( --qm-button-bg-hover );color:var( --qm-button-fg-hover );text-decoration:none}button.qm-button:focus-visible,.qm-toggle:focus-visible{background:var( --qm-button-bg-hover );border-color:var( --qm-button-bg-hover );color:var( --qm-button-fg-hover );box-shadow:0 0 0 1px #fff,0 0 0 3px var( --qm-button-bg-hover )}button.qm-button:active,.qm-toggle:active{background:var( --qm-button-bg-active );border-color:var( --qm-button-bg-active );color:var( --qm-button-fg-active );box-shadow:none}input[type=radio].qm-radio,input[type=radio].qm-radio:checked,input[type=radio].qm-radio:focus-visible,input[type=radio].qm-radio:checked:focus-visible,input[type=radio].qm-radio:hover,input[type=radio].qm-radio:checked:hover,input[type=checkbox].qm-checkbox,input[type=checkbox].qm-checkbox:checked,input[type=checkbox].qm-checkbox:focus-visible,input[type=checkbox].qm-checkbox:checked:focus-visible,input[type=checkbox].qm-checkbox:hover,input[type=checkbox].qm-checkbox:checked:hover{all:revert;accent-color:var( --qm-button-bg );vertical-align:-2px;margin-right:5px;&:before,&:after{display:none}}.qm-fabulous-toggle{margin-top:10px}tbody tr td,tbody tr th{background:var( --qm-panel-bg )}tbody tr:nth-child(2n) td,tbody tr:nth-child(2n) th{background:var( --qm-cell-bg-stripe )}}.qm-warning-wrapper{display:flex;align-items:start;>.qm-icon{flex-shrink:0}}.qm-non-tabular .qm-warn,.qm thead tr .qm-warn,.qm tbody tr:not(.qm-warn) .qm-warn{background-color:var( --qm-warn-bg );color:var( --qm-warn-fg );.qm-icon{fill:var( --qm-warn-fg )}}.qm{tbody tr th.qm-warn,tbody tr td.qm-warn,tbody tr.qm-warn td,tbody tr.qm-warn th{background-color:var( --qm-warn-bg );color:var( --qm-warn-fg );.qm-icon{fill:var( --qm-warn-fg )}}tbody tr:nth-child(odd) .qm-warn,tbody tr:nth-child(odd) th.qm-warn,tbody tr:nth-child(odd) td.qm-warn,tbody tr:nth-child(odd).qm-warn td,tbody tr:nth-child(odd).qm-warn th{background-color:var( --qm-warn-bg-dark )}tbody tr.qm-warn .qm-warn{background-color:transparent}}.qm-non-tabular .qm-warn code,.qm tbody .qm-warn li,.qm tbody .qm-warn .qm-info,.qm tbody .qm-warn code{background-color:transparent;color:var( --qm-warn-fg );.qm-icon{fill:var( --qm-warn-fg )}}.qm{.qm-empty{background:var( --qm-panel-bg );border:1px solid var( --qm-panel-menu-bg-hover );margin:0 0 10px;max-width:40em;padding:20px 30px 10px}.qm-error{background:var( --qm-warn-bg );border:1px solid var( --qm-warn-border );color:var( --qm-warn-fg );margin:0 0 10px;padding:10px 20px}.qm-icon{margin-top:.1em;margin-right:.3em;display:inline-block;height:16px;width:16px;fill:var( --qm-container-fg );vertical-align:top}.qm-icon-yes-alt{fill:#0a0}tbody tr td.qm-highlight,tbody tr.qm-highlight th,tbody tr.qm-highlight td:not(.qm-cell-hook){background-color:var( --qm-cell-bg-highlight );color:var( --qm-cell-fg-highlight )}tbody tr:nth-child(odd) td.qm-highlight,tbody tr:nth-child(odd).qm-highlight th,tbody tr:nth-child(odd).qm-highlight td:not(.qm-cell-hook){background-color:var( --qm-cell-bg-highlight-alt );color:var( --qm-cell-fg-highlight )}tbody tr:not(.qm-warn-notice):nth-child(odd):hover th,tbody tr:not(.qm-warn-notice):nth-child(odd):hover td,tbody tr:not(.qm-warn-notice):hover th,tbody tr:not(.qm-warn-notice):hover td{background:var( --qm-cell-bg-hover )}tbody tr.qm-warn:not(.qm-warn-notice):hover th,tbody tr.qm-warn:not(.qm-warn-notice):hover td{background:var( --qm-warn-bg-hover )}tbody tr.qm-highlight:hover th,tbody tr.qm-highlight:hover td:not(.qm-cell-hook){background:var( --qm-cell-bg-highlight-dark )}tbody tr.qm-jump-highlight th,tbody tr.qm-jump-highlight td{animation:qm-jump-fade 4s ease-out}thead th.qm-filtered select.qm-filter{background-color:var( --qm-cell-bg-highlight );color:var( --qm-cell-fg-highlight )}button.qm-filter-trigger,button.qm-filter-trigger code,tbody .qm-warn a code,a code,a{color:var( --qm-link-fg );cursor:pointer;&:after,&:focus-visible,&:hover{color:var( --qm-link-fg-hover )}&:active{color:var( --qm-link-fg-active )}}a.qm-external-link,a.qm-link,a.qm-edit-link,button.qm-filter-trigger{white-space:nowrap;text-decoration:none;.qm-icon{fill:var( --qm-link-fg-hover )!important;width:16px;height:16px;left:2px;position:relative;text-decoration:none;top:2px;visibility:hidden}}a.qm-external-link{text-decoration:underline}a.qm-external-link,a.qm-link:hover,a.qm-link:focus-visible,a.qm-edit-link:hover,a.qm-edit-link:focus-visible,button.qm-filter-trigger:hover,button.qm-filter-trigger:focus-visible{.qm-icon{visibility:visible}}.timeline-bar-label-overlay{a,button.qm-filter-trigger{color:#fff;&:hover,&:focus-visible{color:#ddd}}}}button,select{background:none;cursor:pointer}.qm{label{color:var( --qm-panel-fg );cursor:pointer;font-size:12px}.qm-filter-container{display:flex}.qm-filter-container label{cursor:default;white-space:nowrap}}.qm-title-heading select,.qm-select,.qm-filter{appearance:menulist;background:var( --qm-panel-bg );border:none;border-radius:4px;color:var( --qm-panel-fg );cursor:pointer;display:block;margin:0 0 0 5px;outline:1px solid var( --qm-panel-border );padding:0}.qm-select,.qm-filter{max-width:12em}.qm-select:hover,.qm-filter:hover{background:var( --qm-cell-bg-hover )}.qm-screen-reader-text,.screen-reader-text{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}@media(width<=782px){#qm-panel-menu,#qm-title h1.qm-title-heading{display:none}#qm-title div.qm-title-heading{display:block}}.qm.qm-debug-bar{textarea,pre{border:1px solid var( --qm-panel-separator );margin:4px 0;padding:10px}textarea{resize:vertical}.left{float:left}.right{float:right}h2{font-size:14px;margin:4px 6px 15px}h3{border-left:1px solid var( --qm-panel-separator );clear:none;float:left;font-size:14px;margin:3px 0 15px;min-width:150px;padding:5px 15px 15px;text-align:center;&:first-child{border-left:none}small{font-size:14px}span{display:block;margin-bottom:8px;white-space:nowrap}}h4{font-size:13px;margin:15px 6px 5px}.qm-debug-bar-output{position:relative;table{margin-bottom:4px;margin-top:4px}}}#debug-menu-target-Debug_Bar_Console{min-height:400px}#debug-menu-target-Debug_Bar_Cache_Lookup,#debug-menu-target-Debug_Bar_Rewrite_Rules,#debug-menu-target-Debug_Bar_Widgets{margin:4px 6px}#debug-menu-target-Debug_Bar_Rewrite_Rules_Panel .filterui,#debug-menu-target-Debug_Bar_Rewrite_Rules_Panel .dbrr{margin:0}#debug-menu-target-Debug_Bar_Rewrite_Testing_Panel{padding:10px 0}#debug-menu-target-EP_Debug_Bar_ElasticPress{li{border-top:1px solid var( --qm-panel-separator );line-height:20px;padding:20px 0;.dashicons:hover{background-color:var( --qm-panel-menu-bg-hover )}}}#qm-logger tr pre{-webkit-user-select:all;user-select:all}#qm-timeline table{width:100%;td{background:var(--qm-panel-bg);padding:0}tr:hover td{background:var( --qm-cell-bg-hover )}}.timeline-header{display:flex;align-items:center;justify-content:space-between;margin:0;padding:10px 20px}.timeline-header h3{margin:0}.timeline-filters{display:flex;gap:12px}.timeline-filter{display:flex;align-items:center;gap:4px;font-size:12px;cursor:pointer;color:var( --qm-container-fg )}.timeline-filter input{margin:0}.timeline-axis{position:relative;height:26px;pointer-events:none;background-color:var(--qm-panel-bg)}.timeline-tick{position:absolute;top:0;bottom:0;font-size:11px;padding:10px 3px 3px;line-height:1;white-space:nowrap;border-left:1px solid var(--qm-panel-border)}.qm-cell-timeline{height:28px;position:relative;padding:0}.timeline-bar{position:absolute;top:6px;height:16px;border-radius:3px;min-width:2px;cursor:default}.timeline-point{width:3px!important;border-radius:3px}.timeline-bar-label{position:absolute;top:5px;padding:0 5px;white-space:nowrap;right:0;max-width:30%;display:flex;gap:4px}.timeline-bar-label-overlay{max-width:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff}.timeline-bar-label-text{overflow:hidden;text-overflow:ellipsis;min-width:0}.timeline-bar-label-text .qm-filter-trigger{max-width:100%;overflow:hidden;text-overflow:ellipsis}.timeline-bar-label-time{flex-shrink:0}@keyframes qm-jump-fade{0%,50%{background:var( --qm-cell-bg-highlight-dark )}}@keyframes qm-fabulous-swipe{0%{clip-path:polygon(6px 0,6px 0,0 100%,0 100%)}to{clip-path:polygon(6px 0,100% 0,calc(100% - 6px) 100%,0 100%)}}@media(prefers-reduced-motion:reduce){.qm-fabulous .qm-title-heading:before{animation:none}tbody tr.qm-jump-highlight th,tbody tr.qm-jump-highlight td{animation:none;background:var( --qm-cell-bg-highlight-dark )}} diff --git a/query-monitor/assets/build/query-monitor.js b/query-monitor/assets/build/query-monitor.js index 24fd12d894..a235693582 100644 --- a/query-monitor/assets/build/query-monitor.js +++ b/query-monitor/assets/build/query-monitor.js @@ -1,64 +1,62 @@ /* This is the built version of the Preact app for Query Monitor. The source code is available here: https://github.com/johnbillion/query-monitor */ -var e,n,t,r,i,o,l,a,s,c,d,u,m={},h=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=Array.isArray;function _(e,n){for(var t in n)e[t]=n[t];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function g(e,r,i,o,l){var a={type:e,props:r,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==l?++t:l,__i:-1,__u:0};return null==l&&null!=n.vnode&&n.vnode(a),a}function b(e){return e.children}function q(e,n){this.props=e,this.context=n}function v(e,n){if(null==n)return e.__?v(e.__,e.__i+1):null;for(var t;nn&&r.sort(l),e=r.shift(),n=r.length,w(e);x.__r=0}function S(e,n,t,r,i,o,l,a,s,c,d){var u,p,_,y,q,w,k,N=r&&r.__k||h,x=n.length;for(s=function(e,n,t,r,i){var o,l,a,s,c,d=t.length,u=d,m=0;for(e.__k=new Array(i),o=0;o0?l=e.__k[o]=g(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[o]=l,s=o+m,l.__=e,l.__b=e.__b+1,a=null,-1!=(c=l.__i=C(l,t,s,u))&&(u--,(a=t[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(i>d?m--:is?m--:m++,l.__u|=4))):e.__k[o]=null;if(u)for(o=0;o(d?1:0))for(i=t-1,o=t+1;i>=0||o=0?i--:o++])&&!(2&c.__u)&&a==c.key&&s==c.type)return l;return-1}function $(e,n,t){"-"==n[0]?e.setProperty(n,null==t?"":t):e[n]=null==t?"":"number"!=typeof t||p.test(n)?t:t+"px"}function E(e,n,t,r,i){var o,l;e:if("style"==n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(n in r)t&&n in t||$(e.style,n,"");if(t)for(n in t)r&&t[n]==r[n]||$(e.style,n,t[n])}else if("o"==n[0]&&"n"==n[1])o=n!=(n=n.replace(a,"$1")),l=n.toLowerCase(),n=l in e||"onFocusOut"==n||"onFocusIn"==n?l.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=t,t?r?t.u=r.u:(t.u=s,e.addEventListener(n,o?d:c,o)):e.removeEventListener(n,o?d:c,o);else{if("http://www.w3.org/2000/svg"==i)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=n&&"height"!=n&&"href"!=n&&"list"!=n&&"form"!=n&&"tabIndex"!=n&&"download"!=n&&"rowSpan"!=n&&"colSpan"!=n&&"role"!=n&&"popover"!=n&&n in e)try{e[n]=null==t?"":t;break e}catch(u){}"function"==typeof t||(null==t||!1===t&&"-"!=n[4]?e.removeAttribute(n):e.setAttribute(n,"popover"==n&&1==t?"":t))}}function O(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=s++;else if(t.t0?e:f(e)?e.map(A):_({},e)}function I(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(o){n.__e(o,r)}}function F(e,t,r){var i,o;if(n.unmount&&n.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||I(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(l){n.__e(l,t)}i.base=i.__P=null}if(i=e.__k)for(o=0;o2&&(a.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof n&&null!=n.defaultProps)for(l in n.defaultProps)void 0===a[l]&&(a[l]=n.defaultProps[l]);return g(n,a,i,o,null)}(b,null,[t]),o||m,m,r.namespaceURI,o?null:r.firstChild?e.call(r.childNodes):null,l,o?o.__e:r.firstChild,false,a),j(l,t,a)}function D(e){function n(e){var t,r;return this.getChildContext||(t=new Set,(r={})[n.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){t=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&t.forEach(function(e){e.__e=!0,N(e)})},this.sub=function(e){t.add(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t&&t.delete(e),n&&n.call(e)}}),e.children}return n.__c="__cC"+u++,n.__=e,n.Provider=n.__l=(n.Consumer=function(e,n){return e.children(n)}).contextType=n,n}e=h.slice,n={__e:function(e,n,t,r){for(var i,o,l;n=n.__;)if((i=n.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),l=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),l=i.__d),l)return i.__E=i}catch(a){e=a}throw e}},t=0,q.prototype.setState=function(e,n){var t;t=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=_({},this.state),"function"==typeof e&&(e=e(_({},t),this.props)),e&&_(t,e),null!=e&&this.__v&&(n&&this._sb.push(n),N(this))},q.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},q.prototype.render=b,r=[],o="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,n){return e.__v.__b-n.__v.__b},x.__r=0,a=/(PointerCapture)$|Capture$/i,s=0,c=O(!1),d=O(!0),u=0;var R,U,z=0;function Q(e,t,r,i,o,l){t||(t={});var a,s,c=t;if("ref"in c)for(s in c={},t)"ref"==s?a=t[s]:c[s]=t[s];var d={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--z,__i:-1,__u:0,__source:o,__self:l};if("function"==typeof e&&(a=e.defaultProps))for(s in a)void 0===c[s]&&(c[s]=a[s]);return n.vnode&&n.vnode(d),d}function B(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var W=function(){if(U)return R;else return U=1,R=function(e,n){var t,r,i=0;function o(){var o,l,a=t,s=arguments.length;e:for(;a;)if(a.args.length===arguments.length){for(l=0;l=0;switch(a.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,a.width?parseInt(a.width):0);break;case"e":i=a.precision?parseFloat(i).toExponential(a.precision):parseFloat(i).toExponential();break;case"f":i=a.precision?parseFloat(i).toFixed(a.precision):parseFloat(i);break;case"g":i=a.precision?String(Number(i.toPrecision(a.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=a.precision?i.substring(0,a.precision):i;break;case"t":i=String(!!i),i=a.precision?i.substring(0,a.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=a.precision?i.substring(0,a.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=a.precision?i.substring(0,a.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}if(n.json.test(a.type))f+=i;else{if(n.number.test(a.type)&&(!u||a.sign))m=u?"+":"-",i=i.toString().replace(n.sign,"");else m="";c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",d=a.width-(m+i).length,s=a.width?d>0?c.repeat(d):"":"",f+=a.align?m+i+s:"0"===c?m+s+i:s+m+i}}return f}(function(e){if(i[e])return i[e];for(var t,r=e,o=[],l=0;r;){if(null!==(t=n.text.exec(r)))o.push(t[0]);else if(null!==(t=n.modulo.exec(r)))o.push("%");else if(null!==(t=n.placeholder.exec(r))){if(t[2]){l|=1;var a=[],s=t[2],c=[];if(null!==(c=n.key.exec(s)))for(a.push(c[1]);""!==(s=s.substring(c[0].length));)if(null!==(c=n.key_access.exec(s)))a.push(c[1]);else if(null!==(c=n.index_access.exec(s)))a.push(c[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");t[2]=a}else l|=2;if(3===l)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");o.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");r=r.substring(t[0].length)}return i[e]=o}(e),arguments)}function r(e,n){return t.apply(null,[e].concat(n||[]))}var i=Object.create(null);if(e.sprintf=t,e.vsprintf=r,"undefined"!=typeof window)window.sprintf=t,window.vsprintf=r}(),K;var e}());var Y,X,Z,ee,ne=V(console.error);function sprintf(e){try{for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},X=["(","?"],Z={")":["("],":":["?","?:"]},ee=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var ie={"!":function(e){return!e},"*":function(e,n){return e*n},"/":function(e,n){return e/n},"%":function(e,n){return e%n},"+":function(e,n){return e+n},"-":function(e,n){return e-n},"<":function(e,n){return e":function(e,n){return e>n},">=":function(e,n){return e>=n},"==":function(e,n){return e===n},"!=":function(e,n){return e!==n},"&&":function(e,n){return e&&n},"||":function(e,n){return e||n},"?:":function(e,n,t){if(e)throw n;return t}};function oe(e){var n=function(e){for(var n,t,r,i,o=[],l=[];n=e.match(ee);){if(t=n[0],r=e.substr(0,n.index).trim())o.push(r);for(;i=l.pop();){if(Z[t]){if(Z[t][0]===i){t=Z[t][1]||t;break}}else if(X.indexOf(i)>=0||Y[i]3&&void 0!==arguments[3]?arguments[3]:10,l=e[n];if(he(t))if(me(r))if("function"==typeof i)if("number"==typeof o){var a={callback:i,priority:o,namespace:r};if(l[t]){var s,c=l[t].handlers;for(s=c.length;s>0&&!(o>=c[s-1].priority);s--);if(s===c.length)c[s]=a;else c.splice(s,0,a);l.__current.forEach(function(e){if(e.name===t&&e.currentIndex>=s)e.currentIndex++})}else l[t]={handlers:[a],runs:0};if("hookAdded"!==t)e.doAction("hookAdded",t,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}}function fe(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!1;return function(r,i){var o=e[n];if(he(r))if(t||me(i)){if(!o[r])return 0;var l=0;if(t)l=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var a=o[r].handlers,s=function(e){if(a[e].namespace===i)a.splice(e,1),l++,o.__current.forEach(function(n){if(n.name===r&&n.currentIndex>=e)n.currentIndex--})},c=a.length-1;c>=0;c--)s(c);if("hookRemoved"!==r)e.doAction("hookRemoved",r,i);return l}}}function _e(e,n){return function(t,r){var i=e[n];if(void 0!==r)return t in i&&i[t].handlers.some(function(e){return e.namespace===r});else return t in i}}function ye(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!1;return function(r){var i=e[n];if(!i[r])i[r]={handlers:[],runs:0};i[r].runs++;for(var o=i[r].handlers,l=arguments.length,a=new Array(l>1?l-1:0),s=1;s1&&void 0!==arguments[1]?arguments[1]:"default";r.data[n]=ce(ce(ce({},de),r.data[n]),e),r.data[n][""]=ce(ce({},de[""]),r.data[n][""])},a=function(e,n){l(e,n),o()},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",n=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!r.data[e])l(void 0,e);return r.dcnpgettext(e,n,t,i,o)},c=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},d=function(e,n,r){var i=s(r,n,e);if(!t)return i;else return i=t.applyFilters("i18n.gettext_with_context",i,e,n,r),t.applyFilters("i18n.gettext_with_context_"+c(r),i,e,n,r)};if(t){var u=function(e){if(ue.test(e))o()};t.addAction("hookAdded","core/i18n",u),t.addAction("hookRemoved","core/i18n",u)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:a,resetLocaleData:function(e,n){r.data={},r.pluralForms={},a(e,n)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,n){var r=s(n,void 0,e);if(!t)return r;else return r=t.applyFilters("i18n.gettext",r,e,n),t.applyFilters("i18n.gettext_"+c(n),r,e,n)},_x:d,_n:function(e,n,r,i){var o=s(i,void 0,e,n,r);if(!t)return o;else return o=t.applyFilters("i18n.ngettext",o,e,n,r,i),t.applyFilters("i18n.ngettext_"+c(i),o,e,n,r,i)},_nx:function(e,n,r,i,o){var l=s(o,i,e,n,r);if(!t)return l;else return l=t.applyFilters("i18n.ngettext_with_context",l,e,n,r,i,o),t.applyFilters("i18n.ngettext_with_context_"+c(o),l,e,n,r,i,o)},isRTL:function(){return"rtl"===d("ltr","text direction")},hasTranslation:function(e,n,i){var o,l,a=n?n+""+e:e,s=!(null===(o=r.data)||void 0===o||null===(l=o[null!=i?i:"default"])||void 0===l||!l[a]);if(t)s=t.applyFilters("i18n.has_translation",s,e,n,i),s=t.applyFilters("i18n.has_translation_"+c(i),s,e,n,i);return s}}}(0,0,ve);we.getLocaleData.bind(we);var ke=we.setLocaleData.bind(we);we.resetLocaleData.bind(we),we.subscribe.bind(we);var __=we.__.bind(we),_x=we._x.bind(we),_n=we._n.bind(we),_nx=we._nx.bind(we);function Ne(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(n=0;nQ("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},children:Q("defs",{children:Object.entries(Se).map(([e,n])=>Q("symbol",{id:`qm-icon-${e}`,viewBox:"0 0 20 20",children:Q("path",{d:n})},e))})}),Ce=({name:e})=>{if("blank"===e)return Q("span",{className:"qm-icon qm-icon-blank"});if(!Se[e])return null;else return Q("svg",{"aria-hidden":"true",className:`qm-icon qm-icon-${e}`,height:"20",viewBox:"0 0 20 20",width:"20",children:Q("use",{href:`#qm-icon-${e}`})})},$e=D({editor:"",setEditor:e=>{},theme:"auto",setTheme:e=>{},fabulous:!1,setFabulous:e=>{},filters:{},setFilters:e=>{},switchToPanel:(e,n,t)=>{},jumpToRow:null,timelineHiddenCategories:[],setTimelineHiddenCategories:e=>{},durationUnit:"s",setDurationUnit:e=>{},settings:{extended_query_prompt_reason:null,file_path_map:{},file_link_format:!1,abspath:"",contentpath:""}});var Ee,Oe,Pe,Me,je=0,Ae=[],Ie=n,Fe=Ie.__b,He=Ie.__r,Le=Ie.diffed,De=Ie.__c,Re=Ie.unmount,Ue=Ie.__;function ze(e,n){Ie.__h&&Ie.__h(Oe,e,je||n),je=0;var t=Oe.__H||(Oe.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({}),t.__[e]}function Qe(e){return je=1,function(e,n){var t=ze(Ee++,2);if(t.t=e,!t.__c&&(t.__=[tn(void 0,n),function(e){var n=t.__N?t.__N[0]:t.__[0],r=t.t(n,e);n!==r&&(t.__N=[r,t.__[1]],t.__c.setState({}))}],t.__c=Oe,!Oe.__f)){var r=function(e,n,r){if(!t.__c.__H)return!0;var o=t.__c.__H.__.filter(function(e){return e.__c});if(o.every(function(e){return!e.__N}))return!i||i.call(this,e,n,r);var l=t.__c.props!==e;return o.some(function(e){if(e.__N){var n=e.__[0];e.__=e.__N,e.__N=void 0,n!==e.__[0]&&(l=!0)}}),i&&i.call(this,e,n,r)||l};Oe.__f=!0;var i=Oe.shouldComponentUpdate,o=Oe.componentWillUpdate;Oe.componentWillUpdate=function(e,n,t){if(this.__e){var l=i;i=void 0,r(e,n,t),i=l}o&&o.call(this,e,n,t)},Oe.shouldComponentUpdate=r}return t.__N||t.__}(tn,e)}function Be(e,n){var t=ze(Ee++,3);!Ie.__s&&nn(t.__H,n)&&(t.__=e,t.u=n,Oe.__H.__h.push(t))}function We(e,n){var t=ze(Ee++,4);!Ie.__s&&nn(t.__H,n)&&(t.__=e,t.u=n,Oe.__h.push(t))}function Ve(e){return je=5,Je(function(){return{current:e}},[])}function Je(e,n){var t=ze(Ee++,7);return nn(t.__H,n)&&(t.__=e(),t.__H=n,t.__h=e),t.__}function Ke(e){var n=Oe.context[e.__c],t=ze(Ee++,9);return t.c=e,n?(null==t.__&&(t.__=!0,n.sub(Oe)),n.props.value):e.__}function Ge(){for(var e;e=Ae.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(Ze),n.__h.some(en),n.__h=[]}catch(t){n.__h=[],Ie.__e(t,e.__v)}}}Ie.__b=function(e){Oe=null,Fe&&Fe(e)},Ie.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),Ue&&Ue(e,n)},Ie.__r=function(e){He&&He(e),Ee=0;var n=(Oe=e.__c).__H;n&&(Pe===Oe?(n.__h=[],Oe.__h=[],n.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(n.__h.some(Ze),n.__h.some(en),n.__h=[],Ee=0)),Pe=Oe},Ie.diffed=function(e){Le&&Le(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==Ae.push(n)&&Me===Ie.requestAnimationFrame||((Me=Ie.requestAnimationFrame)||Xe)(Ge)),n.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Pe=Oe=null},Ie.__c=function(e,n){n.some(function(e){try{e.__h.some(Ze),e.__h=e.__h.filter(function(e){return!e.__||en(e)})}catch(t){n.some(function(e){e.__h&&(e.__h=[])}),n=[],Ie.__e(t,e.__v)}}),De&&De(e,n)},Ie.unmount=function(e){Re&&Re(e);var n,t=e.__c;t&&t.__H&&(t.__H.__.some(function(e){try{Ze(e)}catch(t){n=t}}),t.__H=void 0,n&&Ie.__e(n,t.__v))};var Ye="function"==typeof requestAnimationFrame;function Xe(e){var n,t=function(){clearTimeout(r),Ye&&cancelAnimationFrame(n),setTimeout(e)},r=setTimeout(t,35);Ye&&(n=requestAnimationFrame(t))}function Ze(e){var n=Oe,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),Oe=n}function en(e){var n=Oe;e.__c=e.__(),Oe=n}function nn(e,n){return!e||e.length!==n.length||n.some(function(n,t){return n!==e[t]})}function tn(e,n){return"function"==typeof n?n(e):n}const rn=QueryMonitorData.l10n;function on(e){return e.split(/('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/).map((e,n)=>n%2==1?Q("span",{className:"qm-sql-value",children:e},n):e)}function ln(e){let n=e.replace(/[\r\n\t]+/g," ").trim(),t="",r="";const i=n.match(/^(\/\*.*?\*\/)\s*/);if(i)t=i[1],n=n.slice(i[0].length);const o=n.match(/\s*(\/\*.*?\*\/)$/);if(o)r=o[1],n=n.slice(0,-o[0].length);const l=" "+n,a=" (ADD|AFTER|ALTER|AND|BEGIN|CASE|COMMIT|CREATE|DELETE|DESCRIBE|DO|DROP|ELSE|END|EXCEPT|EXPLAIN|FROM|GROUP BY|GROUP|HAVING|INNER JOIN|INSERT|INTERSECT|JOIN|LEFT JOIN|LIMIT|ON|OR|ORDER BY|ORDER|OUTER JOIN|RENAME|REPLACE|RIGHT JOIN|ROLLBACK|SELECT|SET|SHOW|START|THEN|TRUNCATE|UNION|UPDATE|USE|USING|VALUES|WHEN|WHERE|XOR) ",s=l.split(new RegExp(a)),c=[];let d=0;if(t)c.push(Q(b,{children:t},"leading-comment"));if(s[0].trim())c.push(Q(b,{children:[c.length>0&&Q("br",{}),on(s[0].trim())]},"preamble"));if(l.replace(new RegExp(a,"g"),(e,n)=>(d+=2,c.push(Q(b,{children:[(d>2||t||s[0].trim())&&Q("br",{}),Q("b",{children:n})," ",on(s[d])]},d)),"")),0===c.length)c.push(Q(b,{children:Q("b",{children:e})},0));if(r)c.push(Q(b,{children:[Q("br",{}),r]},"trailing-comment"));return c}function an(e){const n="(\\?|&)",t=e.split(new RegExp(n));if(t.length<=3)return[Q(b,{children:e})];const r=[Q(b,{children:t[0]},0)];let i=0;return e.replace(new RegExp(n,"g"),(e,n)=>(i+=2,r.push(Q(b,{children:[Q("br",{}),`${n}${t[i]}`]},i)),"")),r}function sn(e){return"object"==typeof e&&null!==e&&"errors"in e}function cn(e){if("object"!=typeof e||null===e||!("errors"in e))return null;const n=e;if(Array.isArray(n.errors))return null;if(n.errors)for(const t in n.errors)for(const e in n.errors[t])return n.errors[t][e];return null}function dn(e){return`${e.id}(${e.args??""})`}function un(e,n){if(n.abspath&&e.startsWith(n.abspath))return e.slice(n.abspath.length);if(n.contentpath&&e.startsWith(n.contentpath))return e.slice(n.contentpath.length);else return e}function mn(e,n=0){if(isNaN(e))return"";if(!n)n=0;const t=e.toFixed(n),r=Math.floor(e).toString(),i=t.substring(t.indexOf(".")+1,t.length);let o="";if(r.length>3){let e=0;for(e=r.length;e>3;e-=3)o=QueryMonitorData.number_format.thousands_sep+r.slice(e-3,e)+o;o=r.slice(0,e)+o}else o=r;if(n)o=o+QueryMonitorData.number_format.decimal_point+i;return o}function hn(e,n){return n?`${e} (${n})`:e}function pn(e,n="wp_template_part"){const t=new URLSearchParams({postType:n,postId:e,canvas:"edit"});return`${rn.admin_url}site-editor.php?${t.toString()}`}function fn(e){let n=e.replace(/^[\s(]+/,"");n=n.replace(/^\/\*[^*]*\*\/\s*/,"");const t=n.match(/^(\w+)/);return t?t[1].toUpperCase():"Unknown"}function yn(e){const n={};for(const t of e){const e=fn(t.sql);n[e]=(n[e]||0)+1}return n}function gn(e){if(null!=e.count)return e;const n=e.title.match(/^(.+)\s\((\d+)\)$/);if(!n)return e;else return{...e,title:n[1],count:parseInt(n[2],10)||null}}function bn(e){const n={};for(const[t,r]of Object.entries(e)){const e=gn(r);n[t]=e.children?{...e,children:bn(e.children)}:e}return n}const qn=({item:e,seen:n})=>Q(b,{children:[e.new&&!n&&Q("span",{"aria-hidden":"true",className:"qm-menu-badge qm-menu-badge-new",children:_x("New","badge","query-monitor")}),!!e.count&&e.count!==e.warning_count&&Q("span",{"aria-hidden":"true",className:"qm-menu-badge",children:mn(e.count)}),!!e.warning_count&&Q("span",{"aria-hidden":"true",className:"qm-menu-badge qm-menu-badge-warning",children:mn(e.warning_count)})]});function vn(e){const n=[e.title];if(e.count||e.warning_count){const t=[];if(e.warning_count)t.push(`${e.warning_count}!`);if(e.count&&e.count!==e.warning_count)t.push(`${e.count}`);n.push(`(${t.join(", ")})`)}return n.join(" ")}const wn=(e,n)=>!e.new||e.panel===n,kn=({menu:e,onSwitch:n,active:t,seen:r=""})=>{const i=bn(e);return Q("nav",{"aria-labelledby":"qm-panel-menu-caption",id:"qm-panel-menu",children:[Q("h2",{className:"qm-screen-reader-text",id:"qm-panel-menu-caption",children:__("Query Monitor Menu","query-monitor")}),Q("ul",{role:"tablist",children:[Q("li",{className:xe({"qm-current-menu":"overview"===t}),role:"presentation",children:Q("button",{"aria-selected":"overview"===t,role:"tab",onClick:()=>{n("overview")},children:__("Overview","query-monitor")})},"overview"),Object.entries(i).map(([e,i])=>{const o=i.children;return Q("li",{className:xe({"qm-current-menu":t===i.panel||o&&Object.keys(o).map(e=>o[e].panel).includes(t)}),role:"presentation",children:[Q("button",{"aria-selected":t===i.panel,role:"tab",onClick:()=>{n(i.panel)},children:[i.title,Q(qn,{item:i,seen:wn(i,r)})]}),o&&Q("ul",{role:"presentation",children:Object.keys(o).map(i=>Q("li",{role:"presentation",children:Q("button",{"aria-selected":t===o[i].panel,role:"tab",onClick:()=>{n(o[i].panel)},children:[o[i].title,Q(qn,{item:o[i],seen:wn(o[i],r)})]})},`${e}-${i}`))})]},e)})]})]})},Nn=({menu:e,onSwitch:n,active:t})=>{const r=bn(e);return Q("select",{"aria-label":__("Select panel","query-monitor"),value:t,onChange:e=>{n(e.currentTarget.value)},children:[Q("option",{value:"overview",children:__("Overview","query-monitor")},"overview"),Object.entries(r).map(([e,n])=>{const t=n.children;return Q(b,{children:[Q("option",{value:n.panel,children:vn(n)}),t&&Q(b,{children:Object.keys(t).map(n=>Q("option",{value:t[n].panel,children:`└ ${vn(t[n])}`},`${e}-${n}`))})]},e)})]})},xn=D({id:"",filters:{},setFilter:(e,n)=>{}}),Sn=({title:e,children:n})=>{const{id:t}=Ke(xn);return Q("div",{"aria-labelledby":"qm-panel-title",className:"qm qm-panel-show qm-non-tabular",id:`qm-${t}`,role:"tabpanel",tabIndex:-1,children:Q("div",{className:"qm-boxed",children:[Q("h2",{className:"qm-screen-reader-text",id:"qm-panel-title",children:e}),n]})})},Tn=({children:e})=>Q(Sn,{title:__("Error","query-monitor"),children:Q("section",{children:Q("div",{className:"qm-error",children:e})})}),Cn=({children:e})=>Q("span",{className:"qm-warn qm-warning-wrapper",children:[Q(Ce,{name:"warning"}),Q("div",{children:e??null})]}),$n=({children:e})=>{const[n]=(r=ze(Ee++,10),i=Qe(),r.__=t,Oe.componentDidCatch||(Oe.componentDidCatch=function(e,n){r.__&&r.__(e,n),i[1](e)}),[i[0],function(){i[1](void 0)}]);var t,r,i;const[o,l]=Qe(!1);if(!n)return Q(b,{children:e});else return Q(Tn,{children:n instanceof Error?Q("div",{style:{position:"relative"},children:[Q("button",{"aria-label":__("Copy error to clipboard","query-monitor"),onClick:()=>{if(n instanceof Error)navigator.clipboard.writeText(n.stack||"").then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},style:{position:"absolute",top:0,right:0},children:o?__("Copied!","query-monitor"):__("Copy","query-monitor")}),Q("p",{children:Q(Cn,{children:__("An error occurred in this panel:","query-monitor")})}),Q("pre",{children:n.stack})]}):Q("p",{children:Q(Cn,{children:__("An unknown error occurred in this panel.","query-monitor")})})})},En={},On=(e,n)=>{En[e]={...n,type:"standard"}},Pn=(e,n)=>{En[e]={...n,type:"overview"}},Mn=({panelId:e})=>{const n=Ve(null),t=Ve(null),[r,i]=Qe(null);if(Be(()=>{const r=document.getElementById(`qm-${e}-container`);if(r){if(i(!0),n.current){if(r.parentNode)t.current={parent:r.parentNode,nextSibling:r.nextSibling};n.current.appendChild(r)}return()=>{if(r&&t.current){const{parent:e,nextSibling:n}=t.current;if(n)e.insertBefore(r,n);else e.appendChild(r)}}}else i(!1)},[e]),!1===r)return Q(Tn,{children:Q("p",{children:Q(Cn,{children:["Panel not found: ",Q("code",{children:e})]})})});else return Q("div",{ref:n,className:"qm-php-panel-container"})},jn=e=>{const{filters:n,setFilters:t}=Ke($e),r=e.active??"",i={id:r,filters:n[r]||{},setFilter:(e,i)=>{const o={...n};if(!(r in o))o[r]={};if(""===i)delete o[r][e];else o[r][e]=i;if(0===Object.keys(o[r]).length)delete o[r];t(o)}},o=En[r]??null;let l=null;if(o)if((e=>"overview"===e?.type)(o))l=o.render(e.data,e.settings);else if((e=>"settings"===e?.type)(o))l=o.render(e.settings);else{const n=e.data[o.data]??null;l=n?o.render(n.data,n.enabled):null}return Q("div",{id:"qm-panels",tabIndex:0,children:Q($n,{children:Q(xn.Provider,{value:i,children:o?l??Q(Tn,{children:Q("p",{children:Q(Cn,{children:["Data not found for panel: ",Q("code",{children:r})]})})}):Q(Mn,{panelId:r})})},r)})},An=e=>{const[n,t]=Qe(e.active),[r,i]=Qe(e.side),[o,l]=Qe(e.theme),[a,s]=Qe(e.fabulous),[c,d]=Qe(e.editor),[u,m]=Qe(e.filters),[h,p]=Qe(e.seen),[f,_]=Qe(e.timelineHiddenCategories),[y,g]=Qe(e.durationUnit),[b,q]=Qe(null),v=Ve(b);v.current=b;const w=Je(()=>{const n=new Set,t=e=>{for(const r of Object.values(e)){if(r.new)n.add(r.panel);if(r.children)t(r.children)}};return t(e.panel_menu),n},[e.panel_menu]),k=n=>{if(t(n),w.has(n)&&n!==h)r=n,e.onSeenChange(r),p(r);var r},N=e.adminMenuElement;let x=o;if(!["light","dark"].includes(x))x=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";const S=xe("qm-container","qm-show",{"qm-show-right":r,"wp-admin":e.isWpAdmin,folded:e.isFolded,"auto-fold":e.isAutoFold,"fullscreen-mode":e.isFullscreenMode,rtl:e.isRtl}),T={theme:o,setTheme:n=>{e.onThemeChange(n),l(n)},fabulous:a,setFabulous:n=>{e.onFabulousChange(n),s(n)},editor:c,setEditor:n=>{e.onEditorChange(n),d(n)},filters:u,setFilters:n=>{e.onFiltersChange(n),m(n)},switchToPanel:(n,t,r)=>{k(n),m(r=>{const i={...r};if(t&&Object.keys(t).length>0)i[n]=t;else delete i[n];return e.onFiltersChange(i),i}),q(void 0!==r?{panel:n,row:r}:null)},jumpToRow:b,timelineHiddenCategories:f,setTimelineHiddenCategories:n=>{e.onTimelineHiddenChange(n),_(n)},durationUnit:y,setDurationUnit:n=>{e.onDurationUnitChange(n),g(n)},settings:{extended_query_prompt_reason:e.settings.extended_query_prompt_reason,file_path_map:e.settings.file_path_map,file_link_format:e.settings.file_link_format,abspath:e.settings.abspath,contentpath:e.settings.contentpath}};Be(()=>{if(N&&e.menu.top.classname){const n=e.menu.top.classname.split(" ").filter(Boolean);return n.forEach(e=>N.classList.add(e)),()=>{n.forEach(e=>N.classList.remove(e))}}},[N,e.menu.top.classname]);const C=Ve(null),{onContainerResize:$,onPanelChange:E,containerHeight:O}=e,P=Ve(!1);Be(()=>{if(E(n),null===v.current)C.current?.querySelector("#qm-panels")?.scrollTo(0,0);else v.current=null},[n,E]),Be(()=>{if(!n)return;let e=!1;const t=C.current;if(!t)return;const r=t.getElementsByClassName("qm-resizer")[0];if(O&&!P.current){const e=window.innerHeight-32;t.style.height=`${Math.min(O,e)}px`,P.current=!0}let i=0,o=0;const l=n=>{if(0===n.button)i=n.clientY,o=t.getBoundingClientRect().height,e=!0,r.setPointerCapture(n.pointerId)},a=n=>{if(!e)return;const r=window.innerHeight;let l=o-(n.clientY-i);l=Math.max(27,l),l=Math.min(r-32,l),t.style.height=`${l}px`},s=n=>{if(e){const e=t.getBoundingClientRect();$(e.height)}e=!1},c=e=>e.preventDefault(),d=()=>{const e=window.innerHeight-32;if(t.getBoundingClientRect().height>e)t.style.height=`${e}px`};return r.addEventListener("pointerdown",l),r.addEventListener("pointermove",a),r.addEventListener("pointerup",s),r.addEventListener("pointercancel",s),r.addEventListener("touchstart",c,{passive:!1}),window.addEventListener("resize",d),()=>{r.removeEventListener("pointerdown",l),r.removeEventListener("pointermove",a),r.removeEventListener("pointerup",s),r.removeEventListener("pointercancel",s),r.removeEventListener("touchstart",c),window.removeEventListener("resize",d)}},[n,O,$]);const[M,j]=Qe(0);Be(()=>{},[]);const A=e.cssUrl;return Q($e.Provider,{value:T,children:[Q(Te,{}),Q("link",{rel:"stylesheet",href:A}),n&&Q("div",{ref:C,className:S,"data-theme":x,"data-color-scheme":e.colorScheme,dir:"ltr",id:"query-monitor-main",children:[Q("div",{id:"qm-title",className:xe({"qm-fabulous":a}),children:[Q("h1",{className:"qm-title-heading qm-resizer",children:Q("span",{children:__("Query Monitor","query-monitor")})}),r&&Q("div",{className:"qm-title-heading",children:Q(Nn,{active:n,menu:e.panel_menu,onSwitch:k})}),Q("button",{"aria-label":__("Settings","query-monitor"),className:"qm-button-container-settings",onClick:()=>{k("settings")},children:Q(Ce,{name:"admin-generic"})}),Q("button",{"aria-label":__("Toggle panel position","query-monitor"),className:"qm-button-container-position",onClick:()=>{i(!r),e.onSideChange(!r)},children:Q(Ce,{name:"image-rotate-left"})}),Q("button",{"aria-label":__("Close Panel","query-monitor"),className:"qm-button-container-close",onClick:()=>{k("")},children:Q(Ce,{name:"no-alt"})})]}),Q("div",{id:"qm-panels-wrapper",children:[!r&&Q(kn,{active:n,menu:e.panel_menu,onSwitch:k,seen:h}),Q(jn,{data:e.data,active:n,settings:e.settings})]})]}),N&&Q(In,{element:N,children:[Q("a",{className:"ab-item",href:"#qm-overview",onClick:e=>{k(n?"":"overview"),N.classList.remove("hover"),e.preventDefault()},children:Q("span",{dangerouslySetInnerHTML:{__html:e.menu.top.title.join("  ")}})}),Q("div",{className:"ab-sub-wrapper",children:Q("ul",{className:"ab-submenu",children:Object.values(e.menu.sub).map(e=>Q("li",{className:xe(e.meta&&e.meta.classname),children:Q("a",{className:"ab-item",href:`#qm-${e.panel}`,onClick:n=>{k(e.panel),N.classList.remove("hover"),n.preventDefault()},children:e.title})},e.id))})})]})]})},In=e=>(Je(()=>(e.element.innerHTML="",e.element.classList.add("menupop"),!0),[e.element]),We(()=>(L(Q(b,{children:e.children}),e.element),()=>L(null,e.element))),null),Fn=e=>{const n=e.adminMenuElement;if(!n)return null;else return Q(Hn,{element:n,children:Q("a",{className:"ab-item",href:"#qm-fatal",children:"PHP Fatal Error"})})},Hn=e=>(Je(()=>(e.element.innerHTML="",e.element.classList.add("qm-error"),!0),[e.element]),We(()=>(L(Q(b,{children:e.children}),e.element),()=>L(null,e.element))),null);let Ln=[];function Dn(e){const[n,t]=e,r=Ln[n];return{id:r.id,args:r.args,file:r.file,line:t}}const Rn=({data:e})=>{if(!e.current_screen)return null;else return Q(Sn,{title:__("Admin Screen","query-monitor"),children:[Q("section",{children:[Q("h3",{children:"get_current_screen()"}),Q("table",{children:[Q("thead",{className:"qm-screen-reader-text",children:Q("tr",{children:[Q("th",{scope:"col",children:__("Property","query-monitor")}),Q("th",{scope:"col",children:__("Value","query-monitor")})]})}),Q("tbody",{children:Object.entries(e.current_screen).map(([e,n])=>Q("tr",{children:[Q("th",{scope:"row",children:e}),Q("td",{children:"string"==typeof n?n:n?"true":"false"})]},e))})]})]}),Q("section",{children:[Q("h3",{children:__("Globals","query-monitor")}),Q("table",{children:[Q("thead",{className:"qm-screen-reader-text",children:Q("tr",{children:[Q("th",{scope:"col",children:__("Global Variable","query-monitor")}),Q("th",{scope:"col",children:__("Value","query-monitor")})]})}),Q("tbody",{children:[Q("tr",{children:[Q("th",{scope:"row",children:"$pagenow"}),Q("td",{children:e.pagenow})]}),Q("tr",{children:[Q("th",{scope:"row",children:"$typenow"}),Q("td",{children:e.typenow})]}),Q("tr",{children:[Q("th",{scope:"row",children:"$taxnow"}),Q("td",{children:e.taxnow})]}),Q("tr",{children:[Q("th",{scope:"row",children:"$hook_suffix"}),Q("td",{children:e.hook_suffix})]})]})]})]}),e.list_table&&Q("section",{children:[Q("h3",{children:__("List Table","query-monitor")}),e.list_table.class_name&&Q(b,{children:[Q("h4",{children:__("Class:","query-monitor")}),Q("p",{children:Q("code",{children:e.list_table.class_name})})]}),Q("h4",{children:__("Column Filters:","query-monitor")}),Q("p",{children:Q("code",{children:e.list_table.columns_filter})}),Q("p",{children:Q("code",{children:e.list_table.sortables_filter})}),Q("h4",{children:__("Column Action:","query-monitor")}),Q("p",{children:Q("code",{children:e.list_table.column_action})})]})]})},Un=({children:e})=>Q(Sn,{title:__("No Data","query-monitor"),children:Q("section",{className:"qm-empty",children:e})}),zn=({text:e,file:n,line:t=0,isFileName:r=!1,expanded:i=!1})=>{const{editor:o,settings:l}=Ke($e),a=r||i?e:function(e){if((e.match(/\\/g)||[]).length<3)return e;else return e.replace(/\\[a-zA-Z0-9_\\]{4,}\\/g,e=>(e.match(/\\([a-zA-Z0-9_])/g)||[]).join("")+"\\")}(e);if(!n)return r?Q(b,{children:a}):Q("code",{children:a});let s=n;for(const[u,m]of Object.entries(l.file_path_map))if(s.startsWith(u)){s=m+s.slice(u.length);break}const c=t||1,d=function(e){const n=[{label:"Atom",name:"atom",format:"atom://open/?url=file://%1$s&line=%2$s"},{label:"Cursor",name:"cursor",format:"cursor://file/%1$s:%2$s"},{label:"Netbeans",name:"netbeans",format:"nbopen://%1$s:%2$s"},{label:"Nova",name:"nova",format:"nova://open?path=%1$s&line=%2$s"},{label:"PhpStorm",name:"phpstorm",format:"phpstorm://open?file=%1$s&line=%2$s"},{label:"Sublime Text",name:"sublime",format:"subl://open/?url=file://%1$s&line=%2$s"},{label:"TextMate",name:"textmate",format:"txmt://open/?url=file://%1$s&line=%2$s"},{label:"Visual Studio Code",name:"vscode",format:"vscode://file/%1$s:%2$s"},{label:"Zed",name:"zed",format:"zed://file/%1$s:%2$s"}];for(const t of n)if(t.name===e)return t.format;return""}(o)||l.file_link_format||"";if(!d)if(r)return Q(b,{children:t?`${a}:${t}`:a});else return Q(b,{children:[Q("code",{children:a}),i&&Q(b,{children:[Q("br",{}),Q("span",{className:"qm-info qm-supplemental",children:`${un(n,l)}:${t}`})]})]});return Q("a",{className:"qm-edit-link",href:sprintf(d,encodeURIComponent(s),c),children:[r?Q(b,{children:a}):Q("code",{children:a}),Q(Ce,{name:"edit"})]})},Qn=e=>Q(zn,{...e,isFileName:!0}),Bn=({expanded:e,onToggle:n,context:t})=>Q("button",{"aria-expanded":e?"true":"false","aria-label":t?sprintf( +var e,n,t,r,i,o,l,a,s,c,u,d,m={},h=[],p=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function f(e,n){for(var t in n)e[t]=n[t];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function g(n,t,r){var i,o,l,a={};for(l in t)"key"==l?i=t[l]:"ref"==l?o=t[l]:a[l]=t[l];if(arguments.length>2&&(a.children=arguments.length>3?e.call(arguments,2):r),"function"==typeof n&&null!=n.defaultProps)for(l in n.defaultProps)void 0===a[l]&&(a[l]=n.defaultProps[l]);return b(n,a,i,o,null)}function b(e,r,i,o,l){var a={type:e,props:r,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==l?++t:l,__i:-1,__u:0};return null==l&&null!=n.vnode&&n.vnode(a),a}function v(e){return e.children}function q(e,n){this.props=e,this.context=n}function w(e,n){if(null==n)return e.__?w(e.__,e.__i+1):null;for(var t;nn&&r.sort(l),e=r.shift(),n=r.length,k(e);S.__r=0}function C(e,n,t,r,i,o,l,a,s,c,u){var d,p,f,y,g,q,k,N=r&&r.__k||h,x=n.length;for(s=function(e,n,t,r,i){var o,l,a,s,c,u=t.length,d=u,m=0;for(e.__k=new Array(i),o=0;o0?l=e.__k[o]=b(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):e.__k[o]=l,s=o+m,l.__=e,l.__b=e.__b+1,a=null,-1!=(c=l.__i=$(l,t,s,d))&&(d--,(a=t[c])&&(a.__u|=2)),null==a||null==a.__v?(-1==c&&(i>u?m--:is?m--:m++,l.__u|=4))):e.__k[o]=null;if(d)for(o=0;o(u?1:0))for(i=t-1,o=t+1;i>=0||o=0?i--:o++])&&!(2&c.__u)&&a==c.key&&s==c.type)return l;return-1}function P(e,n,t){"-"==n[0]?e.setProperty(n,null==t?"":t):e[n]=null==t?"":"number"!=typeof t||p.test(n)?t:t+"px"}function O(e,n,t,r,i){var o,l;e:if("style"==n)if("string"==typeof t)e.style.cssText=t;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(n in r)t&&n in t||P(e.style,n,"");if(t)for(n in t)r&&t[n]==r[n]||P(e.style,n,t[n])}else if("o"==n[0]&&"n"==n[1])o=n!=(n=n.replace(a,"$1")),l=n.toLowerCase(),n=l in e||"onFocusOut"==n||"onFocusIn"==n?l.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+o]=t,t?r?t.u=r.u:(t.u=s,e.addEventListener(n,o?u:c,o)):e.removeEventListener(n,o?u:c,o);else{if("http://www.w3.org/2000/svg"==i)n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=n&&"height"!=n&&"href"!=n&&"list"!=n&&"form"!=n&&"tabIndex"!=n&&"download"!=n&&"rowSpan"!=n&&"colSpan"!=n&&"role"!=n&&"popover"!=n&&n in e)try{e[n]=null==t?"":t;break e}catch(d){}"function"==typeof t||(null==t||!1===t&&"-"!=n[4]?e.removeAttribute(n):e.setAttribute(n,"popover"==n&&1==t?"":t))}}function M(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=s++;else if(t.t0?e:_(e)?e.map(L):f({},e)}function H(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(o){n.__e(o,r)}}function F(e,t,r){var i,o;if(n.unmount&&n.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||H(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(l){n.__e(l,t)}i.base=i.__P=null}if(i=e.__k)for(o=0;o=0;switch(a.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,a.width?parseInt(a.width):0);break;case"e":i=a.precision?parseFloat(i).toExponential(a.precision):parseFloat(i).toExponential();break;case"f":i=a.precision?parseFloat(i).toFixed(a.precision):parseFloat(i);break;case"g":i=a.precision?String(Number(i.toPrecision(a.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=a.precision?i.substring(0,a.precision):i;break;case"t":i=String(!!i),i=a.precision?i.substring(0,a.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=a.precision?i.substring(0,a.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=a.precision?i.substring(0,a.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}if(n.json.test(a.type))_+=i;else{if(n.number.test(a.type)&&(!d||a.sign))m=d?"+":"-",i=i.toString().replace(n.sign,"");else m="";c=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",u=a.width-(m+i).length,s=a.width?u>0?c.repeat(u):"":"",_+=a.align?m+i+s:"0"===c?m+s+i:s+m+i}}return _}(function(e){if(i[e])return i[e];for(var t,r=e,o=[],l=0;r;){if(null!==(t=n.text.exec(r)))o.push(t[0]);else if(null!==(t=n.modulo.exec(r)))o.push("%");else if(null!==(t=n.placeholder.exec(r))){if(t[2]){l|=1;var a=[],s=t[2],c=[];if(null!==(c=n.key.exec(s)))for(a.push(c[1]);""!==(s=s.substring(c[0].length));)if(null!==(c=n.key_access.exec(s)))a.push(c[1]);else if(null!==(c=n.index_access.exec(s)))a.push(c[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");t[2]=a}else l|=2;if(3===l)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");o.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");r=r.substring(t[0].length)}return i[e]=o}(e),arguments)}function r(e,n){return t.apply(null,[e].concat(n||[]))}var i=Object.create(null);if(e.sprintf=t,e.vsprintf=r,"undefined"!=typeof window)window.sprintf=t,window.vsprintf=r}(),Y;var e}());var X,ee,ne,te,re=K(console.error);function sprintf(e){try{for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},ee=["(","?"],ne={")":["("],":":["?","?:"]},te=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var le={"!":function(e){return!e},"*":function(e,n){return e*n},"/":function(e,n){return e/n},"%":function(e,n){return e%n},"+":function(e,n){return e+n},"-":function(e,n){return e-n},"<":function(e,n){return e":function(e,n){return e>n},">=":function(e,n){return e>=n},"==":function(e,n){return e===n},"!=":function(e,n){return e!==n},"&&":function(e,n){return e&&n},"||":function(e,n){return e||n},"?:":function(e,n,t){if(e)throw n;return t}};function ae(e){var n=function(e){for(var n,t,r,i,o=[],l=[];n=e.match(te);){if(t=n[0],r=e.substr(0,n.index).trim())o.push(r);for(;i=l.pop();){if(ne[t]){if(ne[t][0]===i){t=ne[t][1]||t;break}}else if(ee.indexOf(i)>=0||X[i]3&&void 0!==arguments[3]?arguments[3]:10,l=e[n];if(_e(t))if(pe(r))if("function"==typeof i)if("number"==typeof o){var a={callback:i,priority:o,namespace:r};if(l[t]){var s,c=l[t].handlers;for(s=c.length;s>0&&!(o>=c[s-1].priority);s--);if(s===c.length)c[s]=a;else c.splice(s,0,a);l.__current.forEach(function(e){if(e.name===t&&e.currentIndex>=s)e.currentIndex++})}else l[t]={handlers:[a],runs:0};if("hookAdded"!==t)e.doAction("hookAdded",t,r,i,o)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}}function ye(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!1;return function(r,i){var o=e[n];if(_e(r))if(t||pe(i)){if(!o[r])return 0;var l=0;if(t)l=o[r].handlers.length,o[r]={runs:o[r].runs,handlers:[]};else for(var a=o[r].handlers,s=function(e){if(a[e].namespace===i)a.splice(e,1),l++,o.__current.forEach(function(n){if(n.name===r&&n.currentIndex>=e)n.currentIndex--})},c=a.length-1;c>=0;c--)s(c);if("hookRemoved"!==r)e.doAction("hookRemoved",r,i);return l}}}function ge(e,n){return function(t,r){var i=e[n];if(void 0!==r)return t in i&&i[t].handlers.some(function(e){return e.namespace===r});else return t in i}}function be(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:!1;return function(r){var i=e[n];if(!i[r])i[r]={handlers:[],runs:0};i[r].runs++;for(var o=i[r].handlers,l=arguments.length,a=new Array(l>1?l-1:0),s=1;s1&&void 0!==arguments[1]?arguments[1]:"default";r.data[n]=de(de(de({},me),r.data[n]),e),r.data[n][""]=de(de({},me[""]),r.data[n][""])},a=function(e,n){l(e,n),o()},s=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",n=arguments.length>1?arguments[1]:void 0,t=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!r.data[e])l(void 0,e);return r.dcnpgettext(e,n,t,i,o)},c=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},u=function(e,n,r){var i=s(r,n,e);if(!t)return i;else return i=t.applyFilters("i18n.gettext_with_context",i,e,n,r),t.applyFilters("i18n.gettext_with_context_"+c(r),i,e,n,r)};if(t){var d=function(e){if(he.test(e))o()};t.addAction("hookAdded","core/i18n",d),t.addAction("hookRemoved","core/i18n",d)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:a,resetLocaleData:function(e,n){r.data={},r.pluralForms={},a(e,n)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,n){var r=s(n,void 0,e);if(!t)return r;else return r=t.applyFilters("i18n.gettext",r,e,n),t.applyFilters("i18n.gettext_"+c(n),r,e,n)},_x:u,_n:function(e,n,r,i){var o=s(i,void 0,e,n,r);if(!t)return o;else return o=t.applyFilters("i18n.ngettext",o,e,n,r,i),t.applyFilters("i18n.ngettext_"+c(i),o,e,n,r,i)},_nx:function(e,n,r,i,o){var l=s(o,i,e,n,r);if(!t)return l;else return l=t.applyFilters("i18n.ngettext_with_context",l,e,n,r,i,o),t.applyFilters("i18n.ngettext_with_context_"+c(o),l,e,n,r,i,o)},isRTL:function(){return"rtl"===u("ltr","text direction")},hasTranslation:function(e,n,i){var o,l,a=n?n+""+e:e,s=!(null===(o=r.data)||void 0===o||null===(l=o[null!=i?i:"default"])||void 0===l||!l[a]);if(t)s=t.applyFilters("i18n.has_translation",s,e,n,i),s=t.applyFilters("i18n.has_translation_"+c(i),s,e,n,i);return s}}}(0,0,ke);Ne.getLocaleData.bind(Ne);var xe=Ne.setLocaleData.bind(Ne);Ne.resetLocaleData.bind(Ne),Ne.subscribe.bind(Ne);var __=Ne.__.bind(Ne),_x=Ne._x.bind(Ne),_n=Ne._n.bind(Ne),_nx=Ne._nx.bind(Ne);function Se(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(n=0;nW("svg",{xmlns:"http://www.w3.org/2000/svg",style:{display:"none"},children:W("defs",{children:Object.entries(Te).map(([e,n])=>W("symbol",{id:`qm-icon-${e}`,viewBox:"0 0 20 20",children:W("path",{d:n})},e))})}),$e=({name:e})=>{if("blank"===e)return W("span",{className:"qm-icon qm-icon-blank"});if(!Te[e])return null;else return W("svg",{"aria-hidden":"true",className:`qm-icon qm-icon-${e}`,height:"20",viewBox:"0 0 20 20",width:"20",children:W("use",{href:`#qm-icon-${e}`})})},Pe=U({editor:"",setEditor:e=>{},theme:"auto",setTheme:e=>{},fabulous:!1,setFabulous:e=>{},filters:{},setFilters:e=>{},switchToPanel:(e,n,t)=>{},jumpToRow:null,timelineHiddenCategories:[],setTimelineHiddenCategories:e=>{},durationUnit:"s",setDurationUnit:e=>{},settings:{extended_query_prompt_reason:null,file_path_map:{},file_link_format:!1,abspath:"",contentpath:""}});var Oe,Me,Ae,je,Ie=0,Le=[],He=n,Fe=He.__b,De=He.__r,Re=He.diffed,Ue=He.__c,ze=He.unmount,Qe=He.__;function Be(e,n){He.__h&&He.__h(Me,e,Ie||n),Ie=0;var t=Me.__H||(Me.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({}),t.__[e]}function We(e){return Ie=1,function(e,n,t){var r=Be(Oe++,2);if(r.t=e,!r.__c&&(r.__=[t?t(n):rn(void 0,n),function(e){var n=r.__N?r.__N[0]:r.__[0],t=r.t(n,e);n!==t&&(r.__N=[t,r.__[1]],r.__c.setState({}))}],r.__c=Me,!Me.__f)){var i=function(e,n,t){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!o||o.call(this,e,n,t);var l=r.__c.props!==e;return i.some(function(e){if(e.__N){var n=e.__[0];e.__=e.__N,e.__N=void 0,n!==e.__[0]&&(l=!0)}}),o&&o.call(this,e,n,t)||l};Me.__f=!0;var o=Me.shouldComponentUpdate,l=Me.componentWillUpdate;Me.componentWillUpdate=function(e,n,t){if(this.__e){var r=o;o=void 0,i(e,n,t),o=r}l&&l.call(this,e,n,t)},Me.shouldComponentUpdate=i}return r.__N||r.__}(rn,e)}function Ve(e,n){var t=Be(Oe++,3);!He.__s&&tn(t.__H,n)&&(t.__=e,t.u=n,Me.__H.__h.push(t))}function Je(e){return Ie=5,Ke(function(){return{current:e}},[])}function Ke(e,n){var t=Be(Oe++,7);return tn(t.__H,n)&&(t.__=e(),t.__H=n,t.__h=e),t.__}function Ge(e){var n=Me.context[e.__c],t=Be(Oe++,9);return t.c=e,n?(null==t.__&&(t.__=!0,n.sub(Me)),n.props.value):e.__}function Ye(){for(var e;e=Le.shift();){var n=e.__H;if(e.__P&&n)try{n.__h.some(en),n.__h.some(nn),n.__h=[]}catch(t){n.__h=[],He.__e(t,e.__v)}}}He.__b=function(e){Me=null,Fe&&Fe(e)},He.__=function(e,n){e&&n.__k&&n.__k.__m&&(e.__m=n.__k.__m),Qe&&Qe(e,n)},He.__r=function(e){De&&De(e),Oe=0;var n=(Me=e.__c).__H;n&&(Ae===Me?(n.__h=[],Me.__h=[],n.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(n.__h.some(en),n.__h.some(nn),n.__h=[],Oe=0)),Ae=Me},He.diffed=function(e){Re&&Re(e);var n=e.__c;n&&n.__H&&(n.__H.__h.length&&(1!==Le.push(n)&&je===He.requestAnimationFrame||((je=He.requestAnimationFrame)||Xe)(Ye)),n.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Ae=Me=null},He.__c=function(e,n){n.some(function(e){try{e.__h.some(en),e.__h=e.__h.filter(function(e){return!e.__||nn(e)})}catch(t){n.some(function(e){e.__h&&(e.__h=[])}),n=[],He.__e(t,e.__v)}}),Ue&&Ue(e,n)},He.unmount=function(e){ze&&ze(e);var n,t=e.__c;t&&t.__H&&(t.__H.__.some(function(e){try{en(e)}catch(t){n=t}}),t.__H=void 0,n&&He.__e(n,t.__v))};var Ze="function"==typeof requestAnimationFrame;function Xe(e){var n,t=function(){clearTimeout(r),Ze&&cancelAnimationFrame(n),setTimeout(e)},r=setTimeout(t,35);Ze&&(n=requestAnimationFrame(t))}function en(e){var n=Me,t=e.__c;"function"==typeof t&&(e.__c=void 0,t()),Me=n}function nn(e){var n=Me;e.__c=e.__(),Me=n}function tn(e,n){return!e||e.length!==n.length||n.some(function(n,t){return n!==e[t]})}function rn(e,n){return"function"==typeof n?n(e):n}function on(e,n){for(var t in e)if("__source"!==t&&!(t in n))return!0;for(var r in n)if("__source"!==r&&e[r]!==n[r])return!0;return!1}function ln(e,n){this.props=e,this.context=n}(ln.prototype=new q).isPureReactComponent=!0,ln.prototype.shouldComponentUpdate=function(e,n){return on(this.props,e)||on(this.state,n)};var an=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),an&&an(e)};var sn=n.__e;n.__e=function(e,n,t,r){if(e.then)for(var i,o=n;o=o.__;)if((i=o.__c)&&i.__c)return null==n.__e&&(n.__e=t.__e,n.__k=t.__k),i.__c(e,n);sn(e,n,t,r)};var cn=n.unmount;function un(e,n,t){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,n){for(var t in n)e[t]=n[t];return e}({},e)).__c&&(e.__c.__P===t&&(e.__c.__P=n),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return un(e,n,t)})),e}function dn(e,n,t){return e&&t&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return dn(e,n,t)}),e.__c&&e.__c.__P===n&&(e.__e&&t.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=t)),e}function mn(){this.__u=0,this.o=null,this.__b=null}function hn(e){if(!e.__)return null;var n=e.__.__c;return n&&n.__a&&n.__a(e)}function pn(){this.i=null,this.l=null}n.unmount=function(e){var n=e.__c;n&&(n.__z=!0),n&&n.__R&&n.__R(),n&&32&e.__u&&(e.type=null),cn&&cn(e)},(mn.prototype=new q).__c=function(e,n){var t=n.__c,r=this;null==r.o&&(r.o=[]),r.o.push(t);var i=hn(r.__v),o=!1,l=function(){o||r.__z||(o=!0,t.__R=null,i?i(s):s())};t.__R=l;var a=t.__P;t.__P=null;var s=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=dn(e,e.__c.__P,e.__c.__O)}var n;for(r.setState({__a:r.__b=null});n=r.o.pop();)n.__P=a,n.forceUpdate()}};r.__u++||32&n.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(l,l)},mn.prototype.componentWillUnmount=function(){this.o=[]},mn.prototype.render=function(e,n){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=un(this.__b,t,r.__O=r.__P)}this.__b=null}var i=n.__a&&g(v,null,e.fallback);return i&&(i.__u&=-33),[g(v,null,n.__a?null:e.children),i]};var fn=function(e,n,t){if(++t[1]===t[0]&&e.l.delete(n),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(t=e.i;t;){for(;t.length>3;)t.pop()();if(t[1]>>1,1),n.h.removeChild(e)}}}R(g(yn,{context:n.context},e.__v),n.v)}(pn.prototype=new q).__a=function(e){var n=this,t=hn(n.__v),r=n.l.get(e);return r[0]++,function(i){var o=function(){n.props.revealOrder?(r.push(i),fn(n,e,r)):i()};t?t(o):o()}},pn.prototype.render=function(e){this.i=null,this.l=new Map;var n=E(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&n.reverse();for(var t=n.length;t--;)this.l.set(n[t],this.i=[1,0,this.i]);return e.children},pn.prototype.componentDidUpdate=pn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(n,t){fn(e,t,n)})};var bn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,vn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,qn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,wn=/[A-Z0-9]/g,kn="undefined"!=typeof document,Nn=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};q.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(q.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(n){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:n})}})});var xn=n.event;function Sn(){}function Cn(){return this.cancelBubble}function Tn(){return this.defaultPrevented}n.event=function(e){return xn&&(e=xn(e)),e.persist=Sn,e.isPropagationStopped=Cn,e.isDefaultPrevented=Tn,e.nativeEvent=e};var En={enumerable:!1,configurable:!0,get:function(){return this.class}},$n=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var n=e.props,t=e.type,r={},i=-1===t.indexOf("-");for(var o in n){var l=n[o];if(!("value"===o&&"defaultValue"in n&&null==l||kn&&"children"===o&&"noscript"===t||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in n&&null==n.value?o="value":"download"===o&&!0===l?l="":"translate"===a&&"no"===l?l=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==t&&"textarea"!==t||Nn(n.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":qn.test(o)&&(o=a):a=o="oninput":i&&vn.test(o)?o=o.replace(wn,"-$&").toLowerCase():null===l&&(l=void 0),"oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=l}}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=E(n.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==t&&null!=r.defaultValue&&(r.value=E(n.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",En)):n.className&&(r.class=r.className=n.className),e.props=r}(e),e.$$typeof=bn,$n&&$n(e)};var Pn=n.__r;n.__r=function(e){Pn&&Pn(e),e.__c};var On=n.diffed;n.diffed=function(e){On&&On(e);var n=e.props,t=e.__e;null!=t&&"textarea"===e.type&&"value"in n&&n.value!==t.value&&(t.value=null==n.value?"":n.value)};const Mn=QueryMonitorData.l10n;function An(e){return e.split(/('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")/).map((e,n)=>n%2==1?W("span",{className:"qm-sql-value",children:e},n):e)}function jn(e){let n=e.replace(/[\r\n\t]+/g," ").trim(),t="",r="";const i=n.match(/^(\/\*.*?\*\/)\s*/);if(i)t=i[1],n=n.slice(i[0].length);const o=n.match(/\s*(\/\*.*?\*\/)$/);if(o)r=o[1],n=n.slice(0,-o[0].length);const l=" "+n,a=" (ADD|AFTER|ALTER|AND|BEGIN|CASE|COMMIT|CREATE|DELETE|DESCRIBE|DO|DROP|ELSE|END|EXCEPT|EXPLAIN|FROM|GROUP BY|GROUP|HAVING|INNER JOIN|INSERT|INTERSECT|JOIN|LEFT JOIN|LIMIT|ON|OR|ORDER BY|ORDER|OUTER JOIN|RENAME|REPLACE|RIGHT JOIN|ROLLBACK|SELECT|SET|SHOW|START|THEN|TRUNCATE|UNION|UPDATE|USE|USING|VALUES|WHEN|WHERE|XOR) ",s=l.split(new RegExp(a)),c=[];let u=0;if(t)c.push(W(v,{children:t},"leading-comment"));if(s[0].trim())c.push(W(v,{children:[c.length>0&&W("br",{}),An(s[0].trim())]},"preamble"));if(l.replace(new RegExp(a,"g"),(e,n)=>(u+=2,c.push(W(v,{children:[(u>2||t||s[0].trim())&&W("br",{}),W("b",{children:n})," ",An(s[u])]},u)),"")),0===c.length)c.push(W(v,{children:W("b",{children:e})},0));if(r)c.push(W(v,{children:[W("br",{}),r]},"trailing-comment"));return c}function In(e){const n="(\\?|&)",t=e.split(new RegExp(n));if(t.length<=3)return[W(v,{children:e})];const r=[W(v,{children:t[0]},0)];let i=0;return e.replace(new RegExp(n,"g"),(e,n)=>(i+=2,r.push(W(v,{children:[W("br",{}),`${n}${t[i]}`]},i)),"")),r}function Ln(e){return"object"==typeof e&&null!==e&&"errors"in e}function Hn(e){if("object"!=typeof e||null===e||!("errors"in e))return null;const n=e;if(Array.isArray(n.errors))return null;if(n.errors)for(const t in n.errors)for(const e in n.errors[t])return n.errors[t][e];return null}function Fn(e){return`${e.id}(${e.args??""})`}function Dn(e,n){if(e.name)return e.name;if(e.file&&e.line)return`${Rn(e.file,n)}:${e.line}`;if(e.file)return Rn(e.file,n);else return"Closure"}function Rn(e,n){if(n.abspath&&e.startsWith(n.abspath))return e.slice(n.abspath.length);if(n.contentpath&&e.startsWith(n.contentpath))return e.slice(n.contentpath.length);else return e}function Un(e,n=0){if(isNaN(e))return"";if(!n)n=0;const t=e.toFixed(n),r=Math.floor(e).toString(),i=t.substring(t.indexOf(".")+1,t.length);let o="";if(r.length>3){let e=0;for(e=r.length;e>3;e-=3)o=QueryMonitorData.number_format.thousands_sep+r.slice(e-3,e)+o;o=r.slice(0,e)+o}else o=r;if(n)o=o+QueryMonitorData.number_format.decimal_point+i;return o}function zn(e,n){return n?`${e} (${n})`:e}function Qn(e,n="wp_template_part"){const t=new URLSearchParams({postType:n,postId:e,canvas:"edit"});return`${Mn.admin_url}site-editor.php?${t.toString()}`}function Bn(e){let n=e.replace(/^[\s(]+/,"");n=n.replace(/^\/\*[^*]*\*\/\s*/,"");const t=n.match(/^(\w+)/);return t?t[1].toUpperCase():"Unknown"}function Wn(e){const n={};for(const t of e){const e=Bn(t.sql);n[e]=(n[e]||0)+1}return n}function Vn(e){if(null!=e.count)return e;const n=e.title.match(/^(.+)\s\((\d+)\)$/);if(!n)return e;else return{...e,title:n[1],count:parseInt(n[2],10)||null}}function Jn(e){const n={};for(const[t,r]of Object.entries(e)){const e=Vn(r);n[t]=e.children?{...e,children:Jn(e.children)}:e}return n}const Kn=({item:e,seen:n})=>W(v,{children:[e.new&&!n&&W("span",{"aria-hidden":"true",className:"qm-menu-badge qm-menu-badge-new",children:_x("New","badge","query-monitor")}),!!e.count&&e.count!==e.warning_count&&W("span",{"aria-hidden":"true",className:"qm-menu-badge",children:Un(e.count)}),!!e.warning_count&&W("span",{"aria-hidden":"true",className:"qm-menu-badge qm-menu-badge-warning",children:Un(e.warning_count)})]});function Gn(e){const n=[e.title];if(e.count||e.warning_count){const t=[];if(e.warning_count)t.push(`${e.warning_count}!`);if(e.count&&e.count!==e.warning_count)t.push(`${e.count}`);n.push(`(${t.join(", ")})`)}return n.join(" ")}const Yn=(e,n)=>!e.new||e.panel===n,Zn=({menu:e,onSwitch:n,active:t,seen:r=""})=>{const i=Jn(e);return W("nav",{"aria-labelledby":"qm-panel-menu-caption",id:"qm-panel-menu",children:[W("h2",{className:"qm-screen-reader-text",id:"qm-panel-menu-caption",children:__("Query Monitor Menu","query-monitor")}),W("ul",{role:"tablist",children:[W("li",{className:Ce({"qm-current-menu":"overview"===t}),role:"presentation",children:W("button",{"aria-selected":"overview"===t,role:"tab",onClick:()=>{n("overview")},children:__("Overview","query-monitor")})},"overview"),Object.entries(i).map(([e,i])=>{const o=i.children;return W("li",{className:Ce({"qm-current-menu":t===i.panel||o&&Object.keys(o).map(e=>o[e].panel).includes(t)}),role:"presentation",children:[W("button",{"aria-selected":t===i.panel,role:"tab",onClick:()=>{n(i.panel)},children:[i.title,W(Kn,{item:i,seen:Yn(i,r)})]}),o&&W("ul",{role:"presentation",children:Object.keys(o).map(i=>W("li",{role:"presentation",children:W("button",{"aria-selected":t===o[i].panel,role:"tab",onClick:()=>{n(o[i].panel)},children:[o[i].title,W(Kn,{item:o[i],seen:Yn(o[i],r)})]})},`${e}-${i}`))})]},e)})]})]})},Xn=({menu:e,onSwitch:n,active:t})=>{const r=Jn(e);return W("select",{"aria-label":__("Select panel","query-monitor"),value:t,onChange:e=>{n(e.currentTarget.value)},children:[W("option",{value:"overview",children:__("Overview","query-monitor")},"overview"),Object.entries(r).map(([e,n])=>{const t=n.children;return W(v,{children:[W("option",{value:n.panel,children:Gn(n)}),t&&W(v,{children:Object.keys(t).map(n=>W("option",{value:t[n].panel,children:`└ ${Gn(t[n])}`},`${e}-${n}`))})]},e)})]})},et=U({id:"",filters:{},setFilter:(e,n)=>{}}),nt=({title:e,children:n})=>{const{id:t}=Ge(et);return W("div",{"aria-labelledby":"qm-panel-title",className:"qm qm-panel-show qm-non-tabular",id:`qm-${t}`,role:"tabpanel",tabIndex:-1,children:W("div",{className:"qm-boxed",children:[W("h2",{className:"qm-screen-reader-text",id:"qm-panel-title",children:e}),n]})})},tt=({children:e})=>W(nt,{title:__("Error","query-monitor"),children:W("section",{children:W("div",{className:"qm-error",children:e})})}),rt=({children:e})=>W("span",{className:"qm-warn qm-warning-wrapper",children:[W($e,{name:"warning"}),W("div",{children:e??null})]}),it=({children:e})=>{const[n]=(r=Be(Oe++,10),i=We(),r.__=t,Me.componentDidCatch||(Me.componentDidCatch=function(e,n){r.__&&r.__(e,n),i[1](e)}),[i[0],function(){i[1](void 0)}]);var t,r,i;const[o,l]=We(!1);if(!n)return W(v,{children:e});else return W(tt,{children:n instanceof Error?W("div",{style:{position:"relative"},children:[W("button",{"aria-label":__("Copy error to clipboard","query-monitor"),onClick:()=>{if(n instanceof Error)navigator.clipboard.writeText(n.stack||"").then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},style:{position:"absolute",top:0,right:0},children:o?__("Copied!","query-monitor"):__("Copy","query-monitor")}),W("p",{children:W(rt,{children:__("An error occurred in this panel:","query-monitor")})}),W("pre",{children:n.stack})]}):W("p",{children:W(rt,{children:__("An unknown error occurred in this panel.","query-monitor")})})})},ot={},lt=(e,n)=>{ot[e]={...n,type:"standard"}},at=(e,n)=>{ot[e]={...n,type:"overview"}},st=({panelId:e})=>{const n=Je(null),t=Je(null),[r,i]=We(null),{switchToPanel:o}=Ge(Pe),l=Je(o);if(Ve(()=>{l.current=o},[o]),Ve(()=>{const r=document.getElementById(`qm-${e}-container`);if(!r)return void i(!1);if(i(!0),n.current){if(r.parentNode)t.current={parent:r.parentNode,nextSibling:r.nextSibling};n.current.appendChild(r)}const o=e=>{const n=e.target.closest(".qm-toggle");if(!n)return;const t="true"===n.getAttribute("aria-expanded"),r=n.closest(".qm-has-toggle");if(!r)return;r.querySelectorAll(".qm-toggled").forEach(e=>{e.style.display=t?"none":"block"}),n.setAttribute("aria-expanded",t?"false":"true");const i=n.querySelector("span");if(i)i.textContent=t?n.dataset.on??"+":n.dataset.off??"-"},a=e=>{const n=e.target.closest(".qm-filter-trigger");if(!n)return;const t=n.dataset.qmTarget;if(t)e.preventDefault(),l.current(t)};return r.addEventListener("click",o),r.addEventListener("click",a),()=>{if(r.removeEventListener("click",o),r.removeEventListener("click",a),r&&t.current){const{parent:e,nextSibling:n}=t.current;if(n)e.insertBefore(r,n);else e.appendChild(r)}}},[e]),!1===r)return W(tt,{children:W("p",{children:W(rt,{children:["Panel not found: ",W("code",{children:e})]})})});else return W("div",{ref:n,className:"qm-php-panel-container"})},ct=e=>{const{filters:n,setFilters:t}=Ge(Pe),r=e.active??"",i={id:r,filters:n[r]||{},setFilter:(e,i)=>{const o={...n};if(!(r in o))o[r]={};if(""===i)delete o[r][e];else o[r][e]=i;if(0===Object.keys(o[r]).length)delete o[r];t(o)}},o=ot[r]??null;let l=null;if(o)if((e=>"overview"===e?.type)(o))l=o.render(e.data,e.settings);else if((e=>"settings"===e?.type)(o))l=o.render(e.settings);else{const n=e.data[o.data]??null;l=n?o.render(n.data,n.enabled):null}return W("div",{id:"qm-panels",tabIndex:0,children:W(it,{children:W(et.Provider,{value:i,children:o?l??W(tt,{children:W("p",{children:W(rt,{children:["Data not found for panel: ",W("code",{children:r})]})})}):W(st,{panelId:r})})},r)})},ut=e=>{const[n,t]=We(e.active),[r,i]=We(e.side),[o,l]=We(e.theme),[a,s]=We(e.fabulous),[c,u]=We(e.editor),[d,m]=We(e.filters),[h,p]=We(e.seen),[_,f]=We(e.timelineHiddenCategories),[y,g]=We(e.durationUnit),[b,v]=We(null),q=Je(b);q.current=b;const w=Ke(()=>{const n=new Set,t=e=>{for(const r of Object.values(e)){if(r.new)n.add(r.panel);if(r.children)t(r.children)}};return t(e.panel_menu),n},[e.panel_menu]),k=n=>{if(t(n),w.has(n)&&n!==h)r=n,e.onSeenChange(r),p(r);var r},N=e.adminMenuElement;let x=o;if(!["light","dark"].includes(x))x=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";const S=Ce("qm-container","qm-show",{"qm-show-right":r,"wp-admin":e.isWpAdmin,folded:e.isFolded,"auto-fold":e.isAutoFold,"fullscreen-mode":e.isFullscreenMode,rtl:e.isRtl}),C={theme:o,setTheme:n=>{e.onThemeChange(n),l(n)},fabulous:a,setFabulous:n=>{e.onFabulousChange(n),s(n)},editor:c,setEditor:n=>{e.onEditorChange(n),u(n)},filters:d,setFilters:n=>{e.onFiltersChange(n),m(n)},switchToPanel:(n,t,r)=>{k(n),m(r=>{const i={...r};if(t&&Object.keys(t).length>0)i[n]=t;else delete i[n];return e.onFiltersChange(i),i}),v(void 0!==r?{panel:n,row:r}:null)},jumpToRow:b,timelineHiddenCategories:_,setTimelineHiddenCategories:n=>{e.onTimelineHiddenChange(n),f(n)},durationUnit:y,setDurationUnit:n=>{e.onDurationUnitChange(n),g(n)},settings:{extended_query_prompt_reason:e.settings.extended_query_prompt_reason,file_path_map:e.settings.file_path_map,file_link_format:e.settings.file_link_format,abspath:e.settings.abspath,contentpath:e.settings.contentpath}};Ve(()=>{if(N&&e.menu.top.classname){const n=e.menu.top.classname.split(" ").filter(Boolean);return n.forEach(e=>N.classList.add(e)),()=>{n.forEach(e=>N.classList.remove(e))}}},[N,e.menu.top.classname]);const T=Je(null),{onContainerResize:E,onPanelChange:$,containerHeight:P}=e,O=Je(!1);Ve(()=>{if($(n),null===q.current)T.current?.querySelector("#qm-panels")?.scrollTo(0,0);else q.current=null},[n,$]),Ve(()=>{if(!n)return;let e=!1;const t=T.current;if(!t)return;const r=t.getElementsByClassName("qm-resizer")[0];if(P&&!O.current){const e=window.innerHeight-32;t.style.height=`${Math.min(P,e)}px`,O.current=!0}let i=0,o=0;const l=n=>{if(0===n.button)i=n.clientY,o=t.getBoundingClientRect().height,e=!0,r.setPointerCapture(n.pointerId)},a=n=>{if(!e)return;const r=window.innerHeight;let l=o-(n.clientY-i);l=Math.max(27,l),l=Math.min(r-32,l),t.style.height=`${l}px`},s=n=>{if(e){const e=t.getBoundingClientRect();E(e.height)}e=!1},c=e=>e.preventDefault(),u=()=>{const e=window.innerHeight-32;if(t.getBoundingClientRect().height>e)t.style.height=`${e}px`};return r.addEventListener("pointerdown",l),r.addEventListener("pointermove",a),r.addEventListener("pointerup",s),r.addEventListener("pointercancel",s),r.addEventListener("touchstart",c,{passive:!1}),window.addEventListener("resize",u),()=>{r.removeEventListener("pointerdown",l),r.removeEventListener("pointermove",a),r.removeEventListener("pointerup",s),r.removeEventListener("pointercancel",s),r.removeEventListener("touchstart",c),window.removeEventListener("resize",u)}},[n,P,E]);const[M,A]=We(0);Ve(()=>{},[]);const j=e.cssUrl;return W(Pe.Provider,{value:C,children:[W(Ee,{}),W("link",{rel:"stylesheet",href:j}),n&&W("div",{ref:T,className:S,"data-theme":x,"data-color-scheme":e.colorScheme,dir:"ltr",id:"query-monitor-main",children:[W("div",{id:"qm-title",className:Ce({"qm-fabulous":a}),children:[W("h1",{className:"qm-title-heading qm-resizer",children:W("span",{children:__("Query Monitor","query-monitor")})}),r&&W("div",{className:"qm-title-heading",children:W(Xn,{active:n,menu:e.panel_menu,onSwitch:k})}),W("button",{"aria-label":__("Settings","query-monitor"),className:"qm-button-container-settings",onClick:()=>{k("settings")},children:W($e,{name:"admin-generic"})}),W("button",{"aria-label":__("Toggle panel position","query-monitor"),className:"qm-button-container-position",onClick:()=>{i(!r),e.onSideChange(!r)},children:W($e,{name:"image-rotate-left"})}),W("button",{"aria-label":__("Close Panel","query-monitor"),className:"qm-button-container-close",onClick:()=>{k("")},children:W($e,{name:"no-alt"})})]}),W("div",{id:"qm-panels-wrapper",children:[!r&&W(Zn,{active:n,menu:e.panel_menu,onSwitch:k,seen:h}),W(ct,{data:e.data,active:n,settings:e.settings})]})]}),N&&W(dt,{element:N,children:[W("a",{className:"ab-item",href:"#qm-overview",onClick:e=>{k(n?"":"overview"),N.classList.remove("hover"),e.preventDefault()},children:W("span",{dangerouslySetInnerHTML:{__html:e.menu.top.title.join("  ")}})}),W("div",{className:"ab-sub-wrapper",children:W("ul",{className:"ab-submenu",children:Object.values(e.menu.sub).map(e=>W("li",{className:Ce(e.meta&&e.meta.classname),children:W("a",{className:"ab-item",href:`#qm-${e.panel}`,onClick:n=>{k(e.panel),N.classList.remove("hover"),n.preventDefault()},children:e.title})},e.id))})})]})]})},dt=e=>{return Ke(()=>(e.element.innerHTML="",e.element.classList.add("menupop"),!0),[e.element]),n=W(v,{children:e.children}),t=e.element,(r=g(gn,{__v:n,h:t})).containerInfo=t,r;var n,t,r},mt=e=>{const n=e.adminMenuElement;if(!n)return null;else return W(ht,{element:n,children:W("a",{className:"ab-item",href:"#qm-fatal",children:"PHP Fatal Error"})})},ht=e=>{var n,t,r;return Ke(()=>(e.element.innerHTML="",e.element.classList.add("qm-error"),!0),[e.element]),n=()=>(R(W(v,{children:e.children}),e.element),()=>R(null,e.element)),r=Be(Oe++,4),!He.__s&&tn(r.__H,t)&&(r.__=n,r.u=t,Me.__h.push(r)),null};let pt=[];function _t(e){const[n,t]=e,r=pt[n];return{id:r.id,args:r.args,file:r.file,line:t}}const ft=({data:e})=>{if(!e.current_screen)return null;else return W(nt,{title:__("Admin Screen","query-monitor"),children:[W("section",{children:[W("h3",{children:"get_current_screen()"}),W("table",{children:[W("thead",{className:"qm-screen-reader-text",children:W("tr",{children:[W("th",{scope:"col",children:__("Property","query-monitor")}),W("th",{scope:"col",children:__("Value","query-monitor")})]})}),W("tbody",{children:Object.entries(e.current_screen).map(([e,n])=>W("tr",{children:[W("th",{scope:"row",children:e}),W("td",{children:"string"==typeof n?n:n?"true":"false"})]},e))})]})]}),W("section",{children:[W("h3",{children:__("Globals","query-monitor")}),W("table",{children:[W("thead",{className:"qm-screen-reader-text",children:W("tr",{children:[W("th",{scope:"col",children:__("Global Variable","query-monitor")}),W("th",{scope:"col",children:__("Value","query-monitor")})]})}),W("tbody",{children:[W("tr",{children:[W("th",{scope:"row",children:"$pagenow"}),W("td",{children:e.pagenow})]}),W("tr",{children:[W("th",{scope:"row",children:"$typenow"}),W("td",{children:e.typenow})]}),W("tr",{children:[W("th",{scope:"row",children:"$taxnow"}),W("td",{children:e.taxnow})]}),W("tr",{children:[W("th",{scope:"row",children:"$hook_suffix"}),W("td",{children:e.hook_suffix})]})]})]})]}),e.list_table&&W("section",{children:[W("h3",{children:__("List Table","query-monitor")}),e.list_table.class_name&&W(v,{children:[W("h4",{children:__("Class:","query-monitor")}),W("p",{children:W("code",{children:e.list_table.class_name})})]}),W("h4",{children:__("Column Filters:","query-monitor")}),W("p",{children:W("code",{children:e.list_table.columns_filter})}),W("p",{children:W("code",{children:e.list_table.sortables_filter})}),W("h4",{children:__("Column Action:","query-monitor")}),W("p",{children:W("code",{children:e.list_table.column_action})})]})]})},yt=({children:e})=>W(nt,{title:__("No Data","query-monitor"),children:W("section",{className:"qm-empty",children:e})}),gt=({text:e,file:n,line:t=0,isFileName:r=!1,expanded:i=!1})=>{const{editor:o,settings:l}=Ge(Pe),a=r||i?e:function(e){if((e.match(/\\/g)||[]).length<3)return e;else return e.replace(/\\[a-zA-Z0-9_\\]{4,}\\/g,e=>(e.match(/\\([a-zA-Z0-9_])/g)||[]).join("")+"\\")}(e);if(!n)return r?W(v,{children:a}):W("code",{children:a});let s=n;for(const[d,m]of Object.entries(l.file_path_map))if(s.startsWith(d)){s=m+s.slice(d.length);break}const c=t||1,u=function(e){const n=[{label:"Atom",name:"atom",format:"atom://open/?url=file://%1$s&line=%2$s"},{label:"Cursor",name:"cursor",format:"cursor://file/%1$s:%2$s"},{label:"Netbeans",name:"netbeans",format:"nbopen://%1$s:%2$s"},{label:"Nova",name:"nova",format:"nova://open?path=%1$s&line=%2$s"},{label:"PhpStorm",name:"phpstorm",format:"phpstorm://open?file=%1$s&line=%2$s"},{label:"Sublime Text",name:"sublime",format:"subl://open/?url=file://%1$s&line=%2$s"},{label:"TextMate",name:"textmate",format:"txmt://open/?url=file://%1$s&line=%2$s"},{label:"Visual Studio Code",name:"vscode",format:"vscode://file/%1$s:%2$s"},{label:"Zed",name:"zed",format:"zed://file/%1$s:%2$s"}];for(const t of n)if(t.name===e)return t.format;return""}(o)||l.file_link_format||"";if(!u)if(r)return W(v,{children:t?`${a}:${t}`:a});else return W(v,{children:[W("code",{children:a}),i&&W(v,{children:[W("br",{}),W("span",{className:"qm-info qm-supplemental",children:`${Rn(n,l)}:${t}`})]})]});return W("a",{className:"qm-edit-link",href:sprintf(u,encodeURIComponent(s),c),children:[r?W(v,{children:a}):W("code",{children:a}),W($e,{name:"edit"})]})},bt=e=>W(gt,{...e,isFileName:!0}),vt=({expanded:e,onToggle:n,context:t})=>W("button",{"aria-expanded":e?"true":"false","aria-label":t?sprintf( /* translators: %s: Context for the toggle button, e.g. a function name */ -__("Toggle full call stack for %s","query-monitor"),t):__("Toggle full call stack","query-monitor"),className:"qm-toggle",onClick:n,children:Q("span",{"aria-hidden":"true",children:e?"-":"+"})}),Wn=({trace:e,defaultExpanded:n=!1})=>{const t=e?.callsite,{settings:r}=Ke($e),[i,o]=Qe(n),l=e?.frames?function(e){return e.map(Dn)}(e.frames):[],a=l.shift()??null,s=l.length>0;if(!t&&!a)return __("Unknown","query-monitor");else return Q(b,{children:[s&&!n&&Q(Bn,{expanded:i,onToggle:()=>o(!i),context:(t?.file?un(t.file,r):void 0)??(a?dn(a):void 0)}),Q("ol",{children:[t&&Q("li",{children:Q(Qn,{text:t.file?un(t.file,r):"",file:t.file,line:t.line,expanded:i||!s})}),!t&&a&&Q("li",{children:Q(zn,{text:dn(a),file:a.file,line:a.line,expanded:i||!s})}),s&&i&&l.map(e=>Q("li",{children:Q(zn,{text:dn(e),file:e.file,line:e.line,expanded:!0})},e.id))]})]})},Vn=({targetPanel:e,filterName:n,filterValue:t,children:r})=>{const{switchToPanel:i}=Ke($e);return Q("button",{"aria-label":sprintf(__("Filter by %s","query-monitor"),t),className:"qm-filter-trigger",onClick:()=>{i(e,{[n]:t})},children:[r,Q(Ce,{name:"filter"})]})},Jn=({component:e,targetPanel:n})=>{if(!e)return null;if(n)return Q(Vn,{targetPanel:n,filterName:"component",filterValue:`${e.type}-${e.context}`,children:e.name});else return Q(b,{children:e.name})},Kn=({value:e,secondsLabel:n=!1})=>{const{durationUnit:t}=Ke($e);if("ms"===t)return Q(b,{children:[mn(1e3*e,1)," ms"]});const r=mn(e,4);return n?`${r} seconds`:r},Gn=({children:e,cols:n,count:t,total:r=t})=>Q("tfoot",{children:Q("tr",{children:[Q("td",{colSpan:n,children:[__("Total:","query-monitor")," ",Q("span",{className:"qm-items-number",children:r===t?mn(t):sprintf("%1$s / %2$s",mn(t),mn(r))})]}),e]})}),Yn=({stack:e,defaultExpanded:n=!1})=>{const[t,r]=Qe(n);if(!e?.length)return __("Unknown","query-monitor");const[i,...o]=e,l=o.length>0;return Q(b,{children:[l&&!n&&Q(Bn,{expanded:t,onToggle:()=>r(!t),context:i}),Q("ol",{children:[Q("li",{children:Q("code",{children:i})}),l&&t&&o.map((e,n)=>Q("li",{children:Q("code",{children:e})},n))]})]})},Xn=(e,n)=>e.label.localeCompare(n.label),Zn=(e,n)=>{const t=new Set,r=[];for(const i of e){const e=n(i);if(e&&!t.has(e.key))t.add(e.key),r.push(e)}return r.sort(Xn),r},et=(e,n)=>{if(!e)return!1;if("non-core"===n)return"core"!==e.context;if("core"===n)return"core"===e.context;else return`${e.type}-${e.context}`===n},nt=(e,n)=>{let t=!1;const r=Zn(e,e=>{const r=n(e);if(!r)return null;if("core"===r.context)return t=!0,null;else return{key:`${r.type}-${r.context}`,label:r.name}}),i=[];if(r.length>0)if(i.push(r),t)i.push([{key:"non-core",label:__("Non-WordPress Core","query-monitor")},{key:"core",label:__("WordPress Core","query-monitor")}]);return i},tt=e=>{const n=nt(e,e=>e.trace?.component);return{heading:__("Component","query-monitor"),render:e=>Q(Jn,{component:e.trace?.component}),filters:n.length?{options:n,callback:(e,n)=>et(e.trace?.component,n)}:void 0}},rt=(e,n=()=>!1)=>({className:"qm-num",heading:__("Time","query-monitor"),render:e=>Q(Kn,{value:e.ltime??0}),cellHasError:(e,t)=>n&&n(e,t),sorting:{field:"ltime",default:"desc"}}),it=(e,n)=>{const t=Zn(e,e=>{if(e.trace?.callsite?.file)return{key:e.trace.callsite.file,label:un(e.trace.callsite.file,n)};if(!e.trace?.frames?.length)return null;const t=Dn(e.trace.frames[0]);return{key:t.id,label:`${t.id}()`}});return{heading:__("Caller","query-monitor"),render:n=>Q(Wn,{trace:n.trace,defaultExpanded:1===e.length}),className:"qm-has-toggle",filters:t.length?{options:[t],callback:(e,n)=>{if(e.trace?.callsite?.file)return e.trace.callsite.file===n;if(!e.trace?.frames?.length)return!1;else return Dn(e.trace.frames[0]).id===n}}:void 0}},ot=e=>{const n=Zn(e,e=>{if(!e.stack?.length)return null;else return{key:e.stack[0],label:e.stack[0]}});return{heading:__("Caller","query-monitor"),render:n=>Q(Yn,{stack:n.stack,defaultExpanded:1===e.length}),className:"qm-has-toggle",filters:n.length?{options:[n],callback:(e,n)=>{if(!e.stack?.length)return!1;else return e.stack[0]===n}}:void 0}},lt=e=>e.reduce((e,n)=>{if("count"in n)return e+n.count;else return e+1},0),at=({title:e,cols:n,data:t,rowHasError:r,id:i,footer:o,warning:l,orderby:a,order:s="desc",groupKey:c,header:d,children:u})=>{const{id:m,filters:h,setFilter:p}=Ke(xn),{jumpToRow:f}=Ke($e),_=Ve(null),y=lt(t),g=Object.entries(n).filter(e=>e[1]?!0:!1),q=new Set;for(const[b,C]of Object.entries(h)){if(!(b in n))continue;const e=n[b];if(!e||!e.filters)continue;const r=e.filters;if(r.options.flat().filter(e=>e.key===C).length)if(c){const e=new Set;for(const n of t)if(r.callback(n,C))e.add(c(n));if(t=t.filter(n=>e.has(c(n))),"component"===b)for(let n=0;nr.callback(e,C))}const v=null!==f&&f.panel===m,w=t.map((e,n)=>n),k=lt(t),[N,x]=Qe({orderby:a,order:s});if(N.orderby){const e=n[N.orderby],r=e&&e.sorting?.field;if(r){const e=t.map((e,n)=>({row:e,idx:w[n]}));e.sort((e,n)=>{if(e.row[r]n.row[r])return"asc"===N.order?1:-1;else return 0});for(let n=0;n{if(!v||!_.current)return;const e=w.indexOf(f.row);if(-1===e)return;const n=l?1:0,t=_.current.rows[e+n];if(t)t.scrollIntoView({block:"center"})},[v,f,w,l]);const S=o||Gn,T=Q("table",{children:[Q("caption",{className:"qm-screen-reader-text",children:Q("h2",{id:i,children:e})}),Q("thead",{children:d?Q("tr",{className:"qm-table-header",children:Q("th",{colSpan:g.length,children:d})}):Q("tr",{children:g.map(([e,n])=>{const t=n.filters?n.filters.options:[],r=e in h?h[e]:"";return Q("th",{className:xe(`qm-col-${e}`,"string"==typeof n.className?n.className:void 0,{"qm-filterable-column":t.length,"qm-filtered":""!==r}),role:"columnheader",scope:"col",children:t.length&&y>1?Q("div",{className:"qm-filter-container",children:[Q("label",{htmlFor:`qm-filter-${e}`,children:n.heading}),Q("select",{id:`qm-filter-${e}`,className:"qm-filter",value:r,onChange:n=>p(e,n.currentTarget.value),children:[Q("option",{value:"",children:"All"}),t.map((e,n)=>Q(b,{children:[Q("hr",{}),e.map(e=>Q("option",{value:e.key,children:e.label},`${n}-${e.key}`))]}))]})]}):n.heading},e)})})}),Q("tbody",{ref:_,children:[l&&Q("tr",{className:"qm-warn qm-warn-notice",children:Q("td",{colSpan:g.length,children:Q(Cn,{children:l()})})}),t.map((e,n)=>Q("tr",{className:xe({"qm-warn":r&&r(e),"qm-highlight":q.has(n),"qm-jump-highlight":v&&w[n]===f.row}),children:g.map(([r,i])=>{const o=i.rowSpan?i.rowSpan(e,n,t):1;if(0===o)return null;else return Q("td",{className:xe(`qm-cell-${r}`,"function"==typeof i.className?i.className(e,n):i.className,{"qm-warn":i.cellHasError&&i.cellHasError(e,n),"qm-wrap":i.wrap}),rowSpan:o>1?o:void 0,children:i.render(e,n)},r)})},n))]}),S({cols:g.length,count:k,total:y,data:t})]});return Q(b,{children:[u&&Q("div",{className:"qm-table-children",children:Q("div",{className:"qm-boxed",children:u})}),T]})},st=({cols:e,data:n,footer:t,warning:r,orderby:i,order:o="desc",rowHasError:l,title:a,groupKey:s,header:c,children:d})=>{const{id:u}=Ke(xn);return Q("div",{"aria-labelledby":"qm-panel-table",className:"qm qm-panel-show",id:`qm-${u}`,role:"tabpanel",tabIndex:-1,children:Q(at,{cols:e,data:n,id:"qm-panel-table",footer:t,warning:r,rowHasError:l,title:a,orderby:i,order:o,groupKey:s,header:c,children:d})})},ct=({data:e})=>Q("pre",{className:"qm-pre-wrap",children:Q("code",{children:JSON.stringify(e,null,2)})}),dt=(e,n="")=>{const t=[];return e.forEach((e,r)=>{const i=n?`${n}.${r+1}`:(r+1).toString();if(t.push({...e,index:i}),e.innerBlocks&&e.innerBlocks.length>0)t.push(...dt(e.innerBlocks,i))}),t},ut=({data:e})=>{if(!e.post_blocks)return null;if(!e.post_has_blocks)return Q(Un,{children:Q("p",{children:__("This post contains no blocks.","query-monitor")})});const n=dt(e.post_blocks),t=e=>!Array.isArray(e.attrs)||e.attrs.length>0,r={index:{heading:"#",render:e=>e.index},blockName:{heading:__("Block Name","query-monitor"),className:"qm-nowrap",render:e=>e.blockName},attrs:{heading:__("Attributes","query-monitor"),render:e=>t(e)&&Q(ct,{data:e.attrs})}};return r.context={heading:__("Context","query-monitor"),render:e=>e.context&&t(e)&&Q(ct,{data:e.context})},r.callback={heading:__("Render Callback","query-monitor"),render:e=>e.dynamic&&e.callback?.name&&Q(zn,{text:e.callback.name,file:e.callback.file||null,line:e.callback.line||null,expanded:!0})},r.timing={heading:__("Render Time","query-monitor"),className:"qm-num",render:e=>e.dynamic?Q(Kn,{value:e.timing}):null},r.innerHTML={heading:__("Inner HTML","query-monitor"),render:e=>Q("pre",{className:"qm-pre-wrap",children:Q("code",{children:e.innerHTML})})},Q(st,{title:__("Blocks","query-monitor"),cols:r,data:n})},mt=({enabled:e,data:n})=>{const{settings:t}=Ke($e);if(!e)return Q(Un,{children:[Q("p",{children:sprintf( +__("Toggle full call stack for %s","query-monitor"),t):__("Toggle full call stack","query-monitor"),className:"qm-toggle",onClick:n,children:W("span",{"aria-hidden":"true",children:e?"-":"+"})}),qt=({trace:e,defaultExpanded:n=!1})=>{const t=e?.callsite,{settings:r}=Ge(Pe),[i,o]=We(n),l=e?.frames?function(e){return e.map(_t)}(e.frames):[],a=l.shift()??null,s=l.length>0;if(!t&&!a)return __("Unknown","query-monitor");else return W(v,{children:[s&&!n&&W(vt,{expanded:i,onToggle:()=>o(!i),context:(t?.file?Rn(t.file,r):void 0)??(a?Fn(a):void 0)}),W("ol",{children:[t&&W("li",{children:W(bt,{text:t.file?Rn(t.file,r):"",file:t.file,line:t.line,expanded:i||!s})}),!t&&a&&W("li",{children:W(gt,{text:Fn(a),file:a.file,line:a.line,expanded:i||!s})}),s&&i&&l.map(e=>W("li",{children:W(gt,{text:Fn(e),file:e.file,line:e.line,expanded:!0})},Fn(e)))]})]})},wt=({targetPanel:e,filterName:n,filterValue:t,children:r})=>{const{switchToPanel:i}=Ge(Pe);return W("button",{"aria-label":sprintf(__("Filter by %s","query-monitor"),t),className:"qm-filter-trigger",onClick:()=>{i(e,{[n]:t})},children:[r,W($e,{name:"filter"})]})},kt=({component:e,targetPanel:n})=>{if(!e)return null;if(n)return W(wt,{targetPanel:n,filterName:"component",filterValue:`${e.type}-${e.context}`,children:e.name});else return W(v,{children:e.name})},Nt=({value:e,secondsLabel:n=!1})=>{const{durationUnit:t}=Ge(Pe);if("ms"===t)return W(v,{children:[Un(1e3*e,1)," ms"]});const r=Un(e,4);return n?`${r} seconds`:r},xt=({children:e,cols:n,count:t,total:r=t})=>W("tfoot",{children:W("tr",{children:[W("td",{colSpan:n,children:[__("Total:","query-monitor")," ",W("span",{className:"qm-items-number",children:r===t?Un(t):sprintf("%1$s / %2$s",Un(t),Un(r))})]}),e]})}),St=({stack:e,defaultExpanded:n=!1})=>{const[t,r]=We(n);if(!e?.length)return __("Unknown","query-monitor");const[i,...o]=e,l=o.length>0;return W(v,{children:[l&&!n&&W(vt,{expanded:t,onToggle:()=>r(!t),context:i}),W("ol",{children:[W("li",{children:W("code",{children:i})}),l&&t&&o.map((e,n)=>W("li",{children:W("code",{children:e})},n))]})]})},Ct=(e,n)=>e.label.localeCompare(n.label),Tt=(e,n)=>{const t=new Set,r=[];for(const i of e){const e=n(i);if(e&&!t.has(e.key))t.add(e.key),r.push(e)}return r.sort(Ct),r},Et=(e,n)=>{if(!e)return!1;if("non-core"===n)return"core"!==e.context;if("core"===n)return"core"===e.context;else return`${e.type}-${e.context}`===n},$t=(e,n)=>{let t=!1;const r=Tt(e,e=>{const r=n(e);if(!r)return null;if("core"===r.context)return t=!0,null;else return{key:`${r.type}-${r.context}`,label:r.name}}),i=[];if(r.length>0)if(i.push(r),t)i.push([{key:"non-core",label:__("Non-WordPress Core","query-monitor")},{key:"core",label:__("WordPress Core","query-monitor")}]);return i},Pt=e=>{const n=$t(e,e=>e.trace?.component);return{heading:__("Component","query-monitor"),render:e=>W(kt,{component:e.trace?.component}),filters:n.length?{options:n,callback:(e,n)=>Et(e.trace?.component,n)}:void 0}},Ot=(e,n=()=>!1)=>({className:"qm-num",heading:__("Time","query-monitor"),render:e=>W(Nt,{value:e.ltime??0}),cellHasError:(e,t)=>n&&n(e,t),sorting:{field:"ltime",default:"desc"}}),Mt=(e,n)=>{const t=Tt(e,e=>{if(e.trace?.callsite?.file)return{key:e.trace.callsite.file,label:Rn(e.trace.callsite.file,n)};if(!e.trace?.frames?.length)return null;const t=_t(e.trace.frames[0]);return{key:t.id,label:`${t.id}()`}});return{heading:__("Caller","query-monitor"),render:n=>W(qt,{trace:n.trace,defaultExpanded:1===e.length}),className:"qm-has-toggle",filters:t.length?{options:[t],callback:(e,n)=>{if(e.trace?.callsite?.file)return e.trace.callsite.file===n;if(!e.trace?.frames?.length)return!1;else return _t(e.trace.frames[0]).id===n}}:void 0}},At=e=>{const n=Tt(e,e=>{if(!e.stack?.length)return null;else return{key:e.stack[0],label:e.stack[0]}});return{heading:__("Caller","query-monitor"),render:n=>W(St,{stack:n.stack,defaultExpanded:1===e.length}),className:"qm-has-toggle",filters:n.length?{options:[n],callback:(e,n)=>{if(!e.stack?.length)return!1;else return e.stack[0]===n}}:void 0}},jt=e=>e.reduce((e,n)=>{if("count"in n)return e+n.count;else return e+1},0),It=({title:e,cols:n,data:t,rowHasError:r,id:i,footer:o,warning:l,orderby:a,order:s="desc",groupKey:c,header:u,children:d})=>{const{id:m,filters:h,setFilter:p}=Ge(et),{jumpToRow:_}=Ge(Pe),f=Je(null),y=jt(t),g=Object.entries(n).filter(e=>e[1]?!0:!1),b=new Set;for(const[v,T]of Object.entries(h)){if(!(v in n))continue;const e=n[v];if(!e||!e.filters)continue;const r=e.filters;if(r.options.flat().filter(e=>e.key===T).length)if(c){const e=new Set;for(const n of t)if(r.callback(n,T))e.add(c(n));if(t=t.filter(n=>e.has(c(n))),"component"===v)for(let n=0;nr.callback(e,T))}const q=null!==_&&_.panel===m,w=t.map((e,n)=>n),k=jt(t),[N,x]=We({orderby:a,order:s});if(N.orderby){const e=n[N.orderby],r=e&&e.sorting?.field;if(r){const e=t.map((e,n)=>({row:e,idx:w[n]}));e.sort((e,n)=>{if(e.row[r]n.row[r])return"asc"===N.order?1:-1;else return 0});for(let n=0;n{if(!q||!f.current)return;const e=w.indexOf(_.row);if(-1===e)return;const n=l?1:0,t=f.current.rows[e+n];if(t)t.scrollIntoView({block:"center"})},[q,_,w,l]);const S=o||xt,C=W("table",{children:[W("caption",{className:"qm-screen-reader-text",children:W("h2",{id:i,children:e})}),W("thead",{children:u?W("tr",{className:"qm-table-header",children:W("th",{colSpan:g.length,children:u})}):W("tr",{children:g.map(([e,n])=>{const t=n.filters?n.filters.options:[],r=e in h?h[e]:"";return W("th",{className:Ce(`qm-col-${e}`,"string"==typeof n.className?n.className:void 0,{"qm-filterable-column":t.length,"qm-filtered":""!==r}),role:"columnheader",scope:"col",children:t.length&&y>1?W("div",{className:"qm-filter-container",children:[W("label",{htmlFor:`qm-filter-${e}`,children:n.heading}),W("select",{id:`qm-filter-${e}`,className:"qm-filter",value:r,onChange:n=>p(e,n.currentTarget.value),children:[W("option",{value:"",children:"All"}),t.map((e,n)=>W(v,{children:[W("hr",{}),e.map(e=>W("option",{value:e.key,children:e.label},`${n}-${e.key}`))]}))]})]}):n.heading},e)})})}),W("tbody",{ref:f,children:[l&&W("tr",{className:"qm-warn qm-warn-notice",children:W("td",{colSpan:g.length,children:W(rt,{children:l()})})}),t.map((e,n)=>W("tr",{className:Ce({"qm-warn":r&&r(e),"qm-highlight":b.has(n),"qm-jump-highlight":q&&w[n]===_.row}),children:g.map(([r,i])=>{const o=i.rowSpan?i.rowSpan(e,n,t):1;if(0===o)return null;else return W("td",{className:Ce(`qm-cell-${r}`,"function"==typeof i.className?i.className(e,n):i.className,{"qm-warn":i.cellHasError&&i.cellHasError(e,n),"qm-wrap":i.wrap}),rowSpan:o>1?o:void 0,children:i.render(e,n)},r)})},n))]}),S({cols:g.length,count:k,total:y,data:t})]});return W(v,{children:[d&&W("div",{className:"qm-table-children",children:W("div",{className:"qm-boxed",children:d})}),C]})},Lt=({cols:e,data:n,footer:t,warning:r,orderby:i,order:o="desc",rowHasError:l,title:a,groupKey:s,header:c,children:u})=>{const{id:d}=Ge(et);return W("div",{"aria-labelledby":"qm-panel-table",className:"qm qm-panel-show",id:`qm-${d}`,role:"tabpanel",tabIndex:-1,children:W(It,{cols:e,data:n,id:"qm-panel-table",footer:t,warning:r,rowHasError:l,title:a,orderby:i,order:o,groupKey:s,header:c,children:u})})},Ht=({data:e})=>W("pre",{className:"qm-pre-wrap",children:W("code",{children:JSON.stringify(e,null,2)})}),Ft=(e,n="")=>{const t=[];return e.forEach((e,r)=>{const i=n?`${n}.${r+1}`:(r+1).toString();if(t.push({...e,index:i}),e.innerBlocks&&e.innerBlocks.length>0)t.push(...Ft(e.innerBlocks,i))}),t},Dt=({data:e})=>{if(!e.post_blocks)return null;if(!e.post_has_blocks)return W(yt,{children:W("p",{children:__("This post contains no blocks.","query-monitor")})});const n=Ft(e.post_blocks),t=e=>!Array.isArray(e.attrs)||e.attrs.length>0,r={index:{heading:"#",render:e=>e.index},blockName:{heading:__("Block Name","query-monitor"),className:"qm-nowrap",render:e=>e.blockName},attrs:{heading:__("Attributes","query-monitor"),render:e=>t(e)&&W(Ht,{data:e.attrs})}};return r.context={heading:__("Context","query-monitor"),render:e=>e.context&&t(e)&&W(Ht,{data:e.context})},r.callback={heading:__("Render Callback","query-monitor"),render:e=>e.dynamic&&e.callback?.name&&W(gt,{text:e.callback.name,file:e.callback.file||null,line:e.callback.line||null,expanded:!0})},r.timing={heading:__("Render Time","query-monitor"),className:"qm-num",render:e=>e.dynamic?W(Nt,{value:e.timing}):null},r.innerHTML={heading:__("Inner HTML","query-monitor"),render:e=>W("pre",{className:"qm-pre-wrap",children:W("code",{children:e.innerHTML})})},W(Lt,{title:__("Blocks","query-monitor"),cols:r,data:n})},Rt=({enabled:e,data:n})=>{const{settings:t}=Ge(Pe);if(!e)return W(yt,{children:[W("p",{children:sprintf( /* translators: %s: Configuration file name. */ -__("For performance reasons, this panel is not enabled by default. To enable it, add the following code to your %s file:","query-monitor"),"wp-config.php")}),Q("p",{children:Q("code",{children:"define( 'QM_ENABLE_CAPS_PANEL', true );"})})]});if(!n.caps.length)return Q(Un,{children:Q("p",{children:__("No capability checks were recorded.","query-monitor")})});else return Q(st,{title:__("Capability Checks","query-monitor"),cols:{cap:{heading:__("Capability Check","query-monitor"),render:e=>Q("code",{children:[e.name,e.args.map(e=>Q(b,{children:[", ",e]}))]})},user:{heading:__("User","query-monitor"),render:e=>Q(b,{children:[e.user,0===e.user&&Q(b,{children:[Q("br",{}),Q("br",{}),Q(Cn,{children:__("Invalid user ID. WordPress silently converts this to 0 before the capability check runs.","query-monitor")})]})]}),filters:{options:[(()=>{const e=[...new Set(n.caps.map(e=>e.user))];return e.sort(),e.map(e=>({key:String(e),label:String(e)}))})()],callback:(e,n)=>e.user===Number(n)}},result:{heading:__("Result","query-monitor"),render:e=>e.result?Q("span",{className:"qm-true",children:"true ✓"}):"false"},caller:it(n.caps,t),component:tt(n.caps)},data:n.caps})},ht=({data:e})=>{const n=e.conds.true,t=e.conds.false;return Q(Sn,{title:__("Conditionals","query-monitor"),children:[Q("div",{className:"qm-boxed",children:Q("section",{children:[Q("h3",{children:__("True Conditionals","query-monitor")}),Q("ul",{children:n.map(e=>Q("li",{className:"qm-ltr qm-true",children:Q("code",{children:[e,"()"]})},e))})]})}),Q("div",{className:"qm-boxed",children:Q("section",{children:[Q("h3",{children:__("False Conditionals","query-monitor")}),Q("ul",{children:t.map(e=>Q("li",{className:"qm-ltr qm-false",children:Q("code",{children:[e,"()"]})},e))})]})})]})},pt=({rows:e})=>Q(Kn,{value:e.reduce((e,n)=>e+n.ltime,0)}),ft=({data:e})=>{if(!e.rows?.length)return Q(Un,{children:Q("p",{children:__("None","query-monitor")})});const n=(e=>{const n={};for(const t of e){let e;if(t.trace?.frames?.length)e=Dn(t.trace.frames[0]).id;else if(t.stack?.length)e=t.stack[0];if(!e)continue;if(!n[e])n[e]={caller:e,ltime:0,types:{}};const r=fn(t.sql);n[e].ltime+=t.ltime,n[e].types[r]=(n[e].types[r]||0)+1}return Object.values(n)})(e.rows),t=yn(e.rows);return Q(st,{title:__("Queries by Caller","query-monitor"),cols:{caller:{heading:__("Caller","query-monitor"),render:e=>Q(Vn,{targetPanel:"db_queries",filterName:"caller",filterValue:e.caller,children:Q("code",{children:e.caller})})},...Object.keys(t).reduce((e,n)=>({...e,[n]:{heading:n,render:e=>e.types[n]||"",className:"qm-num"}}),{}),time:rt()},orderby:"time",order:"desc",data:n,footer:()=>Q("tfoot",{children:Q("tr",{children:[Q("td",{}),Object.entries(t).map(([e,n])=>Q("td",{className:"qm-num",children:n},e)),Q("td",{className:"qm-num",children:Q(pt,{rows:n})})]})})})},_t=({data:e})=>{if(!e.rows?.length)return Q(Un,{children:Q("p",{children:__("None","query-monitor")})});const n=(e=>{const n={};for(const t of e){if(!t.trace?.component)continue;const e=`${t.trace.component.type}-${t.trace.component.context}`;if(!n[e])n[e]={component:t.trace.component,ltime:0,types:{}};const r=fn(t.sql);n[e].ltime+=t.ltime,n[e].types[r]=(n[e].types[r]||0)+1}return Object.values(n)})(e.rows),t=yn(e.rows);return Q(st,{title:__("Queries by Component","query-monitor"),cols:{component:{heading:__("Component","query-monitor"),render:e=>Q(Jn,{component:e.component,targetPanel:"db_queries"})},...Object.keys(t).reduce((e,n)=>({...e,[n]:{heading:n,render:e=>e.types[n]||"",className:"qm-num"}}),{}),time:rt()},orderby:"time",order:"desc",data:n,footer:()=>Q("tfoot",{children:Q("tr",{children:[Q("td",{}),Object.entries(t).map(([e,n])=>Q("td",{className:"qm-num",children:n},e)),Q("td",{className:"qm-num",children:Q(pt,{rows:n})})]})})})},yt=({data:e})=>{if(!e.dupes.length)return null;else return Q(st,{title:__("Duplicate Queries","query-monitor"),cols:{sql:{heading:__("Query","query-monitor"),render:e=>Q("code",{children:ln(e.query)})},count:{heading:__("Count","query-monitor"),render:e=>e.count},time:{className:"qm-num",heading:__("Time","query-monitor"),render:e=>Q(Kn,{value:e.ltime})},callers:{heading:__("Callers","query-monitor"),render:e=>Object.entries(e.callers).map(([e,n])=>Q(b,{children:[Q(Vn,{targetPanel:"db_queries",filterName:"caller",filterValue:e,children:Q("code",{children:e})}),Q("br",{}),Q("span",{className:"qm-info qm-supplemental",children:sprintf( +__("For performance reasons, this panel is not enabled by default. To enable it, add the following code to your %s file:","query-monitor"),"wp-config.php")}),W("p",{children:W("code",{children:"define( 'QM_ENABLE_CAPS_PANEL', true );"})})]});if(!n.caps.length)return W(yt,{children:W("p",{children:__("No capability checks were recorded.","query-monitor")})});else return W(Lt,{title:__("Capability Checks","query-monitor"),cols:{cap:{heading:__("Capability Check","query-monitor"),render:e=>W("code",{children:[e.name,e.args.map(e=>W(v,{children:[", ",e]}))]})},user:{heading:__("User","query-monitor"),render:e=>W(v,{children:[e.user,0===e.user&&W(v,{children:[W("br",{}),W("br",{}),W(rt,{children:__("Invalid user ID. WordPress silently converts this to 0 before the capability check runs.","query-monitor")})]})]}),filters:{options:[(()=>{const e=[...new Set(n.caps.map(e=>e.user))];return e.sort(),e.map(e=>({key:String(e),label:String(e)}))})()],callback:(e,n)=>e.user===Number(n)}},result:{heading:__("Result","query-monitor"),render:e=>e.result?W("span",{className:"qm-true",children:"true ✓"}):"false"},caller:Mt(n.caps,t),component:Pt(n.caps)},data:n.caps})},Ut=({data:e})=>{const n=e.conds.true,t=e.conds.false;return W(nt,{title:__("Conditionals","query-monitor"),children:[W("div",{className:"qm-boxed",children:W("section",{children:[W("h3",{children:__("True Conditionals","query-monitor")}),W("ul",{children:n.map(e=>W("li",{className:"qm-ltr qm-true",children:W("code",{children:[e,"()"]})},e))})]})}),W("div",{className:"qm-boxed",children:W("section",{children:[W("h3",{children:__("False Conditionals","query-monitor")}),W("ul",{children:t.map(e=>W("li",{className:"qm-ltr qm-false",children:W("code",{children:[e,"()"]})},e))})]})})]})},zt=({rows:e})=>W(Nt,{value:e.reduce((e,n)=>e+n.ltime,0)}),Qt=({data:e})=>{if(!e.rows?.length)return W(yt,{children:W("p",{children:__("None","query-monitor")})});const n=(e=>{const n={};for(const t of e){let e;if(t.trace?.frames?.length)e=_t(t.trace.frames[0]).id;else if(t.stack?.length)e=t.stack[0];if(!e)continue;if(!n[e])n[e]={caller:e,ltime:0,types:{}};const r=Bn(t.sql);n[e].ltime+=t.ltime,n[e].types[r]=(n[e].types[r]||0)+1}return Object.values(n)})(e.rows),t=Wn(e.rows);return W(Lt,{title:__("Queries by Caller","query-monitor"),cols:{caller:{heading:__("Caller","query-monitor"),render:e=>W(wt,{targetPanel:"db_queries",filterName:"caller",filterValue:e.caller,children:W("code",{children:e.caller})})},...Object.keys(t).reduce((e,n)=>({...e,[n]:{heading:n,render:e=>e.types[n]||"",className:"qm-num"}}),{}),time:Ot()},orderby:"time",order:"desc",data:n,footer:()=>W("tfoot",{children:W("tr",{children:[W("td",{}),Object.entries(t).map(([e,n])=>W("td",{className:"qm-num",children:n},e)),W("td",{className:"qm-num",children:W(zt,{rows:n})})]})})})},Bt=({data:e})=>{if(!e.rows?.length)return W(yt,{children:W("p",{children:__("None","query-monitor")})});const n=(e=>{const n={};for(const t of e){if(!t.trace?.component)continue;const e=`${t.trace.component.type}-${t.trace.component.context}`;if(!n[e])n[e]={component:t.trace.component,ltime:0,types:{}};const r=Bn(t.sql);n[e].ltime+=t.ltime,n[e].types[r]=(n[e].types[r]||0)+1}return Object.values(n)})(e.rows),t=Wn(e.rows);return W(Lt,{title:__("Queries by Component","query-monitor"),cols:{component:{heading:__("Component","query-monitor"),render:e=>W(kt,{component:e.component,targetPanel:"db_queries"})},...Object.keys(t).reduce((e,n)=>({...e,[n]:{heading:n,render:e=>e.types[n]||"",className:"qm-num"}}),{}),time:Ot()},orderby:"time",order:"desc",data:n,footer:()=>W("tfoot",{children:W("tr",{children:[W("td",{}),Object.entries(t).map(([e,n])=>W("td",{className:"qm-num",children:n},e)),W("td",{className:"qm-num",children:W(zt,{rows:n})})]})})})},Wt=({data:e})=>{if(!e.dupes.length)return null;else return W(Lt,{title:__("Duplicate Queries","query-monitor"),cols:{sql:{heading:__("Query","query-monitor"),render:e=>W("code",{children:jn(e.query)})},count:{heading:__("Count","query-monitor"),render:e=>e.count},time:{className:"qm-num",heading:__("Time","query-monitor"),render:e=>W(Nt,{value:e.ltime})},callers:{heading:__("Callers","query-monitor"),render:e=>Object.entries(e.callers).map(([e,n])=>W(v,{children:[W(wt,{targetPanel:"db_queries",filterName:"caller",filterValue:e,children:W("code",{children:e})}),W("br",{}),W("span",{className:"qm-info qm-supplemental",children:sprintf( /* translators: %s: Number of function calls */ -_n("%s call","%s calls",n,"query-monitor"),n)}),Q("br",{})]},e))},components:{heading:__("Components","query-monitor"),render:e=>Object.entries(e.components).map(([e,n])=>Q(b,{children:[e,Q("br",{}),Q("span",{className:"qm-info qm-supplemental",children:sprintf( +_n("%s call","%s calls",n,"query-monitor"),n)}),W("br",{})]},e))},components:{heading:__("Components","query-monitor"),render:e=>Object.entries(e.components).map(([e,n])=>W(v,{children:[e,W("br",{}),W("span",{className:"qm-info qm-supplemental",children:sprintf( /* translators: %s: Number of function calls */ -_n("%s call","%s calls",n,"query-monitor"),n)}),Q("br",{})]},e))},sources:{heading:__("Potential Troublemakers","query-monitor"),render:e=>Object.entries(e.sources).map(([e,n])=>Q(b,{children:[Q("code",{children:e}),Q("br",{}),Q("span",{className:"qm-info qm-supplemental",children:sprintf( +_n("%s call","%s calls",n,"query-monitor"),n)}),W("br",{})]},e))},sources:{heading:__("Potential Troublemakers","query-monitor"),render:e=>Object.entries(e.sources).map(([e,n])=>W(v,{children:[W("code",{children:e}),W("br",{}),W("span",{className:"qm-info qm-supplemental",children:sprintf( /* translators: %s: Number of function calls */ -_n("%s call","%s calls",n,"query-monitor"),n)}),Q("br",{})]},e))}},data:e.dupes})},gt=({data:e})=>{const{settings:n}=Ke($e);if(!e.errors?.length)return null;const t=(e.rows??[]).filter((n,t)=>e.errors.includes(t));return Q(st,{title:__("Database Errors","query-monitor"),cols:{sql:{heading:__("Query","query-monitor"),render:e=>Q(b,{children:[Q("code",{children:ln(e.sql)}),Q("br",{}),Q("br",{}),Q(Cn,{children:cn(e.result)})]})},caller:it(t,n),component:tt(t)},data:t,rowHasError:()=>!0})},bt=({data:e})=>{const{settings:n}=Ke($e);if(!e.expensive?.length||!e.rows)return null;const t=e.expensive,r=e.rows.filter((e,n)=>t.includes(n));return Q(st,{title:__("Slow Database Queries","query-monitor"),cols:{sql:{heading:__("Query","query-monitor"),render:e=>Q(b,{children:[Q("code",{children:ln(e.sql)}),sn(e.result)&&Q(b,{children:[Q("br",{}),Q("br",{}),Q(Cn,{children:cn(e.result)})]})]})},caller:it(r,n),component:tt(r),result:{className:"qm-num",heading:__("Rows","query-monitor"),render:e=>sn(e.result)?"":e.result},time:rt(0,()=>!0)},data:r,rowHasError:e=>sn(e.result)})},qt=e=>{switch(e){case"conflict":return sprintf( +_n("%s call","%s calls",n,"query-monitor"),n)}),W("br",{})]},e))}},data:e.dupes})},Vt=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.errors?.length)return null;const t=(e.rows??[]).filter((n,t)=>e.errors.includes(t));return W(Lt,{title:__("Database Errors","query-monitor"),cols:{sql:{heading:__("Query","query-monitor"),render:e=>W(v,{children:[W("code",{children:jn(e.sql)}),W("br",{}),W("br",{}),W(rt,{children:Hn(e.result)})]})},caller:Mt(t,n),component:Pt(t)},data:t,rowHasError:()=>!0})},Jt=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.expensive?.length||!e.rows)return null;const t=e.expensive,r=e.rows.filter((e,n)=>t.includes(n));return W(Lt,{title:__("Slow Database Queries","query-monitor"),cols:{sql:{heading:__("Query","query-monitor"),render:e=>W(v,{children:[W("code",{children:jn(e.sql)}),Ln(e.result)&&W(v,{children:[W("br",{}),W("br",{}),W(rt,{children:Hn(e.result)})]})]})},caller:Mt(r,n),component:Pt(r),result:{className:"qm-num",heading:__("Rows","query-monitor"),render:e=>Ln(e.result)?"":e.result},time:Ot(0,()=>!0)},data:r,rowHasError:e=>Ln(e.result)})},Kt=e=>{switch(e){case"conflict":return sprintf( /* translators: %s: File name */ __("Extended query information such as the component and affected rows is not available. A conflicting %s file is present.","query-monitor"),"db.php");case"disabled":return sprintf( /* translators: 1: File name, 2: Configuration constant name */ __("Extended query information such as the component and affected rows is not available. Query Monitor was prevented from symlinking its %1$s file into place by the %2$s constant.","query-monitor"),"db.php","QM_DB_SYMLINK");case"failed":return sprintf( /* translators: %s: File name */ -__("Extended query information such as the component and affected rows is not available. Query Monitor was unable to symlink its %s file into place.","query-monitor"),"db.php")}},vt=({data:e})=>{const{settings:n}=Ke($e);if(!e.total_qs)return Q(Un,{children:Q("p",{children:__("No queries! Nice work.","query-monitor")})});if(!e.rows?.length)return Q(Un,{children:Q("p",{children:sprintf( +__("Extended query information such as the component and affected rows is not available. Query Monitor was unable to symlink its %s file into place.","query-monitor"),"db.php")}},Gt=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.total_qs)return W(yt,{children:W("p",{children:__("No queries! Nice work.","query-monitor")})});if(!e.rows?.length)return W(yt,{children:W("p",{children:sprintf( /* translators: %s: Number of database queries */ -__("%s database queries were performed, but none were logged.","query-monitor"),mn(e.total_qs))})});const t=yn(e.rows),r=!e.has_trace?n.extended_query_prompt_reason:null;return Q(st,{title:__("Database Queries","query-monitor"),warning:r?()=>Q(b,{children:[qt(r)," ",Q("a",{href:"https://querymonitor.com/help/db-php-symlink/",target:"_blank",rel:"noopener noreferrer",className:"qm-external-link",children:__("See this help page for more information.","query-monitor")})]}):void 0,cols:{i:{className:"qm-num",heading:"#",render:(e,n)=>n+1},sql:{className:e=>"SELECT"!==fn(e.sql)?"qm-nonselectsql":"",heading:__("Query","query-monitor"),render:e=>Q(b,{children:[Q("code",{children:ln(e.sql)}),sn(e.result)&&Q(b,{children:[Q("br",{}),Q("br",{}),Q(Cn,{children:cn(e.result)})]})]}),filters:{options:(()=>{const e=Object.keys(t).map(e=>({key:e,label:e})),n=[];if(e.length>1)n.push(e),n.push([{key:"non-select",label:__("Non-SELECT","query-monitor")}]);return n})(),callback:(e,n)=>{const t=fn(e.sql);if("non-select"===n)return"SELECT"!==t;else return t===n}},wrap:!0},caller:e.has_trace?it(e.rows,n):ot(e.rows),component:e.has_trace?tt(e.rows):null,result:e.has_result?{className:"qm-num",heading:__("Rows","query-monitor"),render:e=>!sn(e.result)&&e.result}:null,time:rt(e.rows,(n,t)=>e.expensive?.includes(t)??!1)},data:e.rows,rowHasError:e=>sn(e.result),footer:({cols:e,count:n,total:t,data:r})=>Q(Gn,{cols:e-1,count:n,total:t,children:Q("td",{className:"qm-num",children:Q(pt,{rows:r})})})})},wt=({data:e})=>{const{settings:n}=Ke($e);if(!e.actions?.length)return Q(Un,{children:Q("p",{children:__("No occurrences.","query-monitor")})});else return Q(st,{title:__("Doing it Wrong","query-monitor"),cols:{message:{heading:__("Message","query-monitor"),render:e=>e.message},caller:it(e.actions,n),component:tt(e.actions)},data:e.actions})},kt=({value:e})=>Q("code",{children:e<1024?sprintf("~%s B",mn(e)):sprintf("~%s kB",mn(e/1024))}),Nt=({db:e})=>{const n={"server-version":__("Server Version","query-monitor"),extension:__("Extension","query-monitor"),"client-version":__("Client Version","query-monitor"),user:__("User","query-monitor"),host:__("Host","query-monitor"),database:__("Database","query-monitor")};return Q("section",{children:[Q("h3",{children:__("Database","query-monitor")}),Q("table",{children:Q("tbody",{children:[Object.keys(n).map(t=>Q("tr",{children:[Q("th",{scope:"row",children:n[t]}),Q("td",{children:e.info[t]||Q(Cn,{children:__("Unknown","query-monitor")})})]},t)),e.variables.map(e=>{const n=Number(e.Value),t=!isNaN(n)&&n>=1048576;return Q("tr",{children:[Q("th",{scope:"row",children:e.Variable_name}),Q("td",{children:[e.Value,t&&Q(b,{children:[" ",Q("span",{className:"qm-info",children:["(",Q(kt,{value:n}),")"]})]})]})]},e.Variable_name)})]})})]})},xt=({summary:e,children:n})=>{const[t,r]=Qe(!1);return Q(b,{children:[Q(Bn,{expanded:t,onToggle:()=>r(!t)}),e,t&&n]})},St=({php:e})=>Q("section",{children:[Q("h3",{children:"PHP"}),Q("table",{children:Q("tbody",{children:[Q("tr",{className:xe({"qm-warn":e.old}),children:[Q("th",{scope:"row",children:__("Version","query-monitor")}),Q("td",{children:e.old?Q(Cn,{children:[e.version," (",Q("a",{className:"qm-external-link",href:"https://wordpress.org/support/update-php/",children:__("Help","query-monitor")}),")"]}):e.version})]}),Q("tr",{children:[Q("th",{scope:"row",children:"SAPI"}),Q("td",{children:e.sapi||__("Unknown","query-monitor")})]}),Q("tr",{children:[Q("th",{scope:"row",children:__("User","query-monitor")}),Q("td",{children:e.user||__("Unknown","query-monitor")})]}),Object.keys(e.variables).map(n=>Q("tr",{children:[Q("th",{scope:"row",children:n}),Q("td",{children:e.variables[n]})]},n)),Q("tr",{children:[Q("th",{scope:"row",children:__("Error Reporting","query-monitor")}),Q("td",{className:"qm-has-toggle qm-ltr",children:Q(xt,{summary:e.error_reporting,children:Q("ul",{children:Object.keys(e.error_levels).map(n=>Q("li",{children:e.error_levels[n]?Q(b,{children:[n," ✓"]}):Q("span",{className:"qm-false",children:n})},n))})})})]}),e.extensions&&Q("tr",{children:[Q("th",{scope:"row",children:__("Extensions","query-monitor")}),Q("td",{className:"qm-has-toggle qm-ltr",children:Q(xt,{summary:Q(b,{children:[Object.keys(e.extensions).length," ",__("extensions","query-monitor")]}),children:Q("ul",{children:Object.keys(e.extensions).map(n=>Q("li",{children:[n," ",e.extensions[n]||""]},n))})})})]})]})})]}),Tt=({server:e})=>{const n={name:__("Software","query-monitor"),version:__("Version","query-monitor"),address:__("IP Address","query-monitor"),host:__("Host","query-monitor"), +__("%s database queries were performed, but none were logged.","query-monitor"),Un(e.total_qs))})});const t=Wn(e.rows),r=!e.has_trace?n.extended_query_prompt_reason:null;return W(Lt,{title:__("Database Queries","query-monitor"),warning:r?()=>W(v,{children:[Kt(r)," ",W("a",{href:"https://querymonitor.com/help/db-php-symlink/",target:"_blank",rel:"noopener noreferrer",className:"qm-external-link",children:__("See this help page for more information.","query-monitor")})]}):void 0,cols:{i:{className:"qm-num",heading:"#",render:(e,n)=>n+1},sql:{className:e=>"SELECT"!==Bn(e.sql)?"qm-nonselectsql":"",heading:__("Query","query-monitor"),render:e=>W(v,{children:[W("code",{children:jn(e.sql)}),Ln(e.result)&&W(v,{children:[W("br",{}),W("br",{}),W(rt,{children:Hn(e.result)})]})]}),filters:{options:(()=>{const e=Object.keys(t).map(e=>({key:e,label:e})),n=[];if(e.length>1)n.push(e),n.push([{key:"non-select",label:__("Non-SELECT","query-monitor")}]);return n})(),callback:(e,n)=>{const t=Bn(e.sql);if("non-select"===n)return"SELECT"!==t;else return t===n}},wrap:!0},caller:e.has_trace?Mt(e.rows,n):At(e.rows),component:e.has_trace?Pt(e.rows):null,result:e.has_result?{className:"qm-num",heading:__("Rows","query-monitor"),render:e=>!Ln(e.result)&&e.result}:null,time:Ot(e.rows,(n,t)=>e.expensive?.includes(t)??!1)},data:e.rows,rowHasError:e=>Ln(e.result),footer:({cols:e,count:n,total:t,data:r})=>W(xt,{cols:e-1,count:n,total:t,children:W("td",{className:"qm-num",children:W(zt,{rows:r})})})})},Yt=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.actions?.length)return W(yt,{children:W("p",{children:__("No occurrences.","query-monitor")})});else return W(Lt,{title:__("Doing it Wrong","query-monitor"),cols:{message:{heading:__("Message","query-monitor"),render:e=>e.message},caller:Mt(e.actions,n),component:Pt(e.actions)},data:e.actions})},Zt=({value:e})=>W("code",{children:e<1024?sprintf("~%s B",Un(e)):sprintf("~%s kB",Un(e/1024))}),Xt=({db:e})=>{const n={"server-version":__("Server Version","query-monitor"),extension:__("Extension","query-monitor"),"client-version":__("Client Version","query-monitor"),user:__("User","query-monitor"),host:__("Host","query-monitor"),database:__("Database","query-monitor")};return W("section",{children:[W("h3",{children:__("Database","query-monitor")}),W("table",{children:W("tbody",{children:[Object.keys(n).map(t=>W("tr",{children:[W("th",{scope:"row",children:n[t]}),W("td",{children:e.info[t]||W(rt,{children:__("Unknown","query-monitor")})})]},t)),e.variables.map(e=>{const n=Number(e.Value),t=!isNaN(n)&&n>=1048576;return W("tr",{children:[W("th",{scope:"row",children:e.Variable_name}),W("td",{children:[e.Value,t&&W(v,{children:[" ",W("span",{className:"qm-info",children:["(",W(Zt,{value:n}),")"]})]})]})]},e.Variable_name)})]})})]})},er=({summary:e,children:n})=>{const[t,r]=We(!1);return W(v,{children:[W(vt,{expanded:t,onToggle:()=>r(!t)}),e,t&&n]})},nr=({php:e})=>W("section",{children:[W("h3",{children:"PHP"}),W("table",{children:W("tbody",{children:[W("tr",{className:Ce({"qm-warn":e.old}),children:[W("th",{scope:"row",children:__("Version","query-monitor")}),W("td",{children:e.old?W(rt,{children:[e.version," (",W("a",{className:"qm-external-link",href:"https://wordpress.org/support/update-php/",children:__("Help","query-monitor")}),")"]}):e.version})]}),W("tr",{children:[W("th",{scope:"row",children:"SAPI"}),W("td",{children:e.sapi||__("Unknown","query-monitor")})]}),W("tr",{children:[W("th",{scope:"row",children:__("User","query-monitor")}),W("td",{children:e.user||__("Unknown","query-monitor")})]}),Object.keys(e.variables).map(n=>W("tr",{children:[W("th",{scope:"row",children:n}),W("td",{children:e.variables[n]})]},n)),W("tr",{children:[W("th",{scope:"row",children:__("Error Reporting","query-monitor")}),W("td",{className:"qm-has-toggle qm-ltr",children:W(er,{summary:e.error_reporting,children:W("ul",{children:Object.keys(e.error_levels).map(n=>W("li",{children:e.error_levels[n]?W(v,{children:["✓ ",n]}):W("span",{className:"qm-false",children:["✗ ",n]})},n))})})})]}),e.extensions&&W("tr",{children:[W("th",{scope:"row",children:__("Extensions","query-monitor")}),W("td",{className:"qm-has-toggle qm-ltr",children:W(er,{summary:W(v,{children:[Object.keys(e.extensions).length," ",__("extensions","query-monitor")]}),children:W("ul",{children:Object.keys(e.extensions).map(n=>W("li",{children:[n," ",e.extensions[n]||""]},n))})})})]})]})})]}),tr=({server:e})=>{const n={name:__("Software","query-monitor"),version:__("Version","query-monitor"),address:__("IP Address","query-monitor"),host:__("Host","query-monitor"), /* translators: OS stands for Operating System */ -OS:__("OS","query-monitor"),arch:__("Architecture","query-monitor"),basicauth:__("Basic Auth","query-monitor")};return Q("section",{children:[Q("h3",{children:__("Server","query-monitor")}),Q("table",{children:Q("tbody",{children:Object.keys(n).map(t=>Q("tr",{children:[Q("th",{scope:"row",children:n[t]}),Q("td",{children:e[t]||Q(Cn,{children:__("Unknown","query-monitor")})})]},t))})})]})},Ct=({wordpress:e})=>Q("section",{children:[Q("h3",{children:"WordPress"}),Q("table",{children:Q("tbody",{children:[Q("tr",{children:[Q("th",{scope:"row",children:__("Version","query-monitor")}),Q("td",{children:e.version})]}),Q("tr",{children:[Q("th",{scope:"row",children:[__("Environment Type","query-monitor")," ",Q("span",{className:"qm-info",children:["(",Q("a",{className:"qm-external-link",href:"https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/",children:__("Help","query-monitor")}),")"]})]}),Q("td",{children:e.environment_type})]}),void 0!==e.development_mode&&Q("tr",{children:[Q("th",{scope:"row",children:[__("Development Mode","query-monitor")," ",Q("span",{className:"qm-info",children:["(",Q("a",{className:"qm-external-link",href:"https://make.wordpress.org/core/2023/07/14/configuring-development-mode-in-6-3/",children:__("Help","query-monitor")}),")"]})]}),Q("td",{children:e.development_mode||__("empty string","query-monitor")})]}),Object.entries(e.constants).map(([e,n])=>Q("tr",{children:[Q("th",{scope:"row",children:e}),Q("td",{children:n})]},e))]})})]}),$t=({data:e})=>Q(Sn,{title:__("Environment","query-monitor"),children:[Q(St,{php:e.php}),Q(Nt,{db:e.db}),Q(Ct,{wordpress:e.wp}),Q(Tt,{server:e.server})]}),Et=({data:e})=>{const{settings:n}=Ke($e);if(!e.hooks?.length)return Q(Un,{children:Q("p",{children:__("No hooks were recorded.","query-monitor")})});const t=(e=>{const n=[];for(const t of e)if(!t.actions.length)n.push({hookName:t.name,priority:null,callback:null,component:null});else for(const e of t.actions)n.push({hookName:t.name,priority:e.priority,callback:e.callback,component:e.callback.component??null});return n})(e.hooks),r=nt(t,e=>e.component),i=new Set,o=[];for(const l of t)for(const e of l.hookName.split(/[-_/.]/))if(e&&!i.has(e))i.add(e),o.push({key:e,label:e});return o.sort((e,n)=>e.label.localeCompare(n.label)),Q(st,{title:__("Hooks","query-monitor"),cols:{hook:{heading:__("Hook","query-monitor"),render:e=>Q("span",{className:"qm-sticky",children:[Q("code",{children:e.hookName}),"all"===e.hookName&&Q(Cn,{children:sprintf( +OS:__("OS","query-monitor"),arch:__("Architecture","query-monitor"),basicauth:__("Basic Auth","query-monitor")};return W("section",{children:[W("h3",{children:__("Server","query-monitor")}),W("table",{children:W("tbody",{children:Object.keys(n).map(t=>W("tr",{children:[W("th",{scope:"row",children:n[t]}),W("td",{children:e[t]||W(rt,{children:__("Unknown","query-monitor")})})]},t))})})]})},rr=({wordpress:e})=>W("section",{children:[W("h3",{children:"WordPress"}),W("table",{children:W("tbody",{children:[W("tr",{children:[W("th",{scope:"row",children:__("Version","query-monitor")}),W("td",{children:e.version})]}),W("tr",{children:[W("th",{scope:"row",children:[__("Environment Type","query-monitor")," ",W("span",{className:"qm-info",children:["(",W("a",{className:"qm-external-link",href:"https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/",children:__("Help","query-monitor")}),")"]})]}),W("td",{children:e.environment_type})]}),void 0!==e.development_mode&&W("tr",{children:[W("th",{scope:"row",children:[__("Development Mode","query-monitor")," ",W("span",{className:"qm-info",children:["(",W("a",{className:"qm-external-link",href:"https://make.wordpress.org/core/2023/07/14/configuring-development-mode-in-6-3/",children:__("Help","query-monitor")}),")"]})]}),W("td",{children:e.development_mode||__("empty string","query-monitor")})]}),Object.entries(e.constants).map(([e,n])=>W("tr",{children:[W("th",{scope:"row",children:e}),W("td",{children:n})]},e))]})})]}),ir=({data:e})=>W(nt,{title:__("Environment","query-monitor"),children:[W(nr,{php:e.php}),W(Xt,{db:e.db}),W(rr,{wordpress:e.wp}),W(tr,{server:e.server})]}),or=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.hooks?.length)return W(yt,{children:W("p",{children:__("No hooks were recorded.","query-monitor")})});const t=(e=>{const n=[];for(const t of e)if(!t.actions.length)n.push({hookName:t.name,priority:null,callback:null,component:null});else for(const e of t.actions)n.push({hookName:t.name,priority:e.priority,callback:e.callback,component:e.callback.component??null});return n})(e.hooks),r=$t(t,e=>e.component),i=new Set,o=[];for(const l of t)for(const e of l.hookName.split(/[-_/.]/))if(e&&!i.has(e))i.add(e),o.push({key:e,label:e});return o.sort((e,n)=>e.label.localeCompare(n.label)),W(Lt,{title:__("Hooks","query-monitor"),cols:{hook:{heading:__("Hook","query-monitor"),render:e=>W("span",{className:"qm-sticky",children:[W("code",{children:e.hookName}),"all"===e.hookName&&W(rt,{children:sprintf( /* translators: %s: Action name */ -__("Warning: The %s action is extremely resource intensive. Try to avoid using it.","query-monitor"),"all")})]}),rowSpan:(e,n,t)=>{if(n>0&&t[n-1].hookName===e.hookName)return 0;let r=1;for(;n+re.hookName.includes(n)}:void 0},priority:{heading:__("Priority","query-monitor"),className:"qm-num",render:n=>{if(null===n.priority)return"";let t=null;if(n.priority===e.php_int_max)t="PHP_INT_MAX";else if(n.priority===e.php_int_min)t="PHP_INT_MIN";else if(n.priority===-e.php_int_max)t="-PHP_INT_MAX";return Q(b,{children:[n.priority,t&&Q(b,{children:[Q("br",{}),Q("span",{className:"qm-info",children:["(",t,")"]})]})]})}},callback:{heading:__("Action","query-monitor"),className:"qm-nowrap",render:e=>{if(!e.callback)return"";let t;if("closure"===e.callback.callback_type)t=sprintf( -/* translators: A closure is an anonymous PHP function. 1: Line number, 2: File name */ -__("Closure on line %1$d of %2$s","query-monitor"),e.callback.line||0,e.callback.file?un(e.callback.file,n):"");else if("unknown_closure"===e.callback.callback_type)t=__("Unknown closure","query-monitor");else t=e.callback.name||"";if(!t)return"";else return Q(zn,{text:t,file:e.callback.file||null,line:e.callback.line||0,expanded:!0})}},component:{heading:__("Component","query-monitor"),render:e=>e.component?Q(Jn,{component:e.component}):null,filters:r.length?{options:r,callback:(e,n)=>et(e.component,n)}:void 0}},data:t,groupKey:e=>e.hookName})},Ot=e=>!e.url.startsWith("https://"),Pt=e=>e.url.startsWith("https://")&&!1===e.args.sslverify,Mt=e=>null!==e.redirected_to,jt=e=>!0===e.intercepted,At=({data:e})=>{const{settings:n}=Ke($e);if(!e.http)return Q(Un,{children:Q("p",{children:__("No HTTP API calls.","query-monitor")})});else return Q(st,{title:__("HTTP API","query-monitor"),cols:{method:{heading:__("Method","query-monitor"),render:e=>e.args.method},url:{heading:__("URL","query-monitor"),render:e=>Q(b,{children:[Ot(e)&&Q("div",{children:Q(Cn,{children:__("Request to a non-HTTPS URL","query-monitor")})}),Pt(e)&&Q("div",{children:Q(Cn,{children:sprintf( +__("Warning: The %s action is extremely resource intensive. Try to avoid using it.","query-monitor"),"all")})]}),rowSpan:(e,n,t)=>{if(n>0&&t[n-1].hookName===e.hookName)return 0;let r=1;for(;n+re.hookName.includes(n)}:void 0},priority:{heading:__("Priority","query-monitor"),className:"qm-num",render:n=>{if(null===n.priority)return"";let t=null;if(n.priority===e.php_int_max)t="PHP_INT_MAX";else if(n.priority===e.php_int_min)t="PHP_INT_MIN";else if(n.priority===-e.php_int_max)t="-PHP_INT_MAX";return W(v,{children:[n.priority,t&&W(v,{children:[W("br",{}),W("span",{className:"qm-info",children:["(",t,")"]})]})]})}},callback:{heading:__("Action","query-monitor"),className:"qm-nowrap",render:e=>{if(!e.callback)return"";const t=Dn(e.callback,n);if(!t)return"";else return W(gt,{text:t,file:e.callback.file||null,line:e.callback.line||0,expanded:!0})}},component:{heading:__("Component","query-monitor"),render:e=>e.component?W(kt,{component:e.component}):null,filters:r.length?{options:r,callback:(e,n)=>Et(e.component,n)}:void 0}},data:t,groupKey:e=>e.hookName})},lr=e=>!e.url.startsWith("https://"),ar=e=>e.url.startsWith("https://")&&!1===e.args.sslverify,sr=e=>null!==e.redirected_to,cr=e=>!0===e.intercepted,ur=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.http)return W(yt,{children:W("p",{children:__("No HTTP API calls.","query-monitor")})});else return W(Lt,{title:__("HTTP API","query-monitor"),cols:{method:{heading:__("Method","query-monitor"),render:e=>e.args.method},url:{heading:__("URL","query-monitor"),render:e=>W(v,{children:[lr(e)&&W("div",{children:W(rt,{children:__("Request to a non-HTTPS URL","query-monitor")})}),ar(e)&&W("div",{children:W(rt,{children:sprintf( /* translators: An HTTP API request has disabled certificate verification. 1: Relevant argument name */ -__("Certificate verification disabled (%s)","query-monitor"),"sslverify=false")})}),jt(e)&&Q("div",{children:Q(Cn,{children:sprintf( +__("Certificate verification disabled (%s)","query-monitor"),"sslverify=false")})}),cr(e)&&W("div",{children:W(rt,{children:sprintf( /* translators: %s: WordPress filter name */ -__("Request was short-circuited by the %s filter and was not sent","query-monitor"),"pre_http_request")})}),"GET"===e.args.method?Q("a",{href:e.url,target:"_blank",rel:"noreferrer",children:an(e.url)}):an(e.url),Mt(e)&&Q("div",{children:Q(Cn,{children:sprintf( +__("Request was short-circuited by the %s filter and was not sent","query-monitor"),"pre_http_request")})}),"GET"===e.args.method?W("a",{href:e.url,target:"_blank",rel:"noreferrer",children:In(e.url)}):In(e.url),sr(e)&&W("div",{children:W(rt,{children:sprintf( /* translators: %s: Redirect target URL */ -__("Redirected to: %s","query-monitor"),e.redirected_to)})})]}),filters:{options:[Array.from(new Set(e.http.map(e=>e.host))).map(e=>({key:e,label:e}))],callback:(e,n)=>e.host===n}},status:{heading:__("Status","query-monitor"),className:"qm-has-toggle",render:e=>{if(sn(e.result))return Q(Cn,{children:sprintf( +__("Redirected to: %s","query-monitor"),e.redirected_to)})})]}),filters:{options:[Array.from(new Set(e.http.map(e=>e.host))).map(e=>({key:e,label:e}))],callback:(e,n)=>e.host===n}},status:{heading:__("Status","query-monitor"),className:"qm-has-toggle",render:e=>{if(Ln(e.result))return W(rt,{children:sprintf( /* translators: %s: Error message text */ -__("Error: %s","query-monitor"),cn(e.result))});if(e.intercepted)return"";const n=!1===e.args.blocking?__("Non-blocking","query-monitor"):`${e.result.code} ${e.result.message}`,t=e.info&&"object"==typeof e.info?e.info:null;if(!(t&&("namelookup_time"in t||"connect_time"in t||"starttransfer_time"in t||"size_download"in t||"content_type"in t||"primary_ip"in t)))return n;const r=[{key:"namelookup_time",label:__("DNS Resolution Time","query-monitor")},{key:"connect_time",label:__("Connection Time","query-monitor")},{key:"starttransfer_time",label:__("Transfer Start Time (TTFB)","query-monitor")}],i=[{key:"content_type",label:__("Response Content Type","query-monitor")}],o="size_download"in t?t.size_download:null;return Q(xt,{summary:n,children:Q("ul",{className:"qm-toggled",children:["primary_ip"in t&&Q("li",{className:"qm-info qm-supplemental",children:[__("IP Address","query-monitor"),": ",t.primary_ip]},"primary_ip"),r.map(({key:e,label:n})=>{if(!(e in t))return null;else return Q("li",{className:"qm-info qm-supplemental",children:[n,": ",Q(Kn,{value:t[e]})]},e)}),null!==o&&Q("li",{className:"qm-info qm-supplemental",children:[__("Response Size","query-monitor"),": ",mn(o/1024,2)," KB"]},"size_download"),i.map(({key:e,label:n})=>{if(!(e in t))return null;else return Q("li",{className:"qm-info qm-supplemental",children:[n,": ",t[e]]},e)})]})})},filters:{options:[Object.keys(e.types).sort().map(e=>({key:e,label:e}))],callback:(e,n)=>{switch(n){case"non-blocking":return!1===e.args.blocking;case"error":return sn(e.result);default:if(sn(e.result))return!1;else return`HTTP ${e.result.code}`===n}}}},caller:it(e.http,n),component:tt(e.http),timeout:{heading:__("Timeout","query-monitor"),className:"qm-num",render:e=>e.intercepted?"":e.args.timeout},time:{heading:__("Time","query-monitor"),className:"qm-num",render:e=>e.intercepted?"":Q(Kn,{value:e.ltime})}},data:e.http,rowHasError:e=>sn(e.result)||!e.intercepted&&e.result.code>=400,footer:({cols:e,count:n,total:t,data:r})=>Q(Gn,{cols:e-1,count:n,total:t,children:Q("td",{className:"qm-num",children:Q(pt,{rows:r.filter(e=>!e.intercepted)})})})})},It=({data:e})=>{const{settings:n}=Ke($e);return Q(st,{title:__("Languages","query-monitor"),cols:{domain:{heading:__("Text Domain","query-monitor"),className:"qm-nowrap",render:e=>e.handle?`${e.domain} (${e.handle})`:e.domain},type:{heading:__("Type","query-monitor"),render:e=>e.type},frame:{heading:__("Caller","query-monitor"),render:e=>e.caller?Q(zn,{text:dn(e.caller),file:e.caller.file,line:e.caller.line}):__("Unknown","query-monitor")},file:{heading:__("Translation File","query-monitor"),render:e=>e.file?e.found?Q(Qn,{text:un(e.file,n),file:e.file}):un(e.file,n):__("None","query-monitor")},found:{heading:__("Size","query-monitor"),className:"qm-nowrap",render:e=>e.found?Q(kt,{value:e.found}):__("Not Found","query-monitor")}},data:e.languages,footer:({cols:e,count:n,total:t,data:r})=>Q(Gn,{cols:e-1,count:n,total:t,children:Q("td",{children:Q(kt,{value:r.reduce((e,n)=>e+(n.found?n.found:0),0)})})}),children:[Q("section",{children:[Q("h3",{children:Q("code",{children:"get_locale()"})}),Q("p",{children:e.locale})]}),Q("section",{children:[Q("h3",{children:Q("code",{children:"get_user_locale()"})}),Q("p",{children:e.user_locale})]}),Q("section",{children:[Q("h3",{children:Q("code",{children:"determine_locale()"})}),Q("p",{children:e.determined_locale})]}),e.mlp_language&&Q("section",{children:[Q("h3",{children:sprintf( +__("Error: %s","query-monitor"),Hn(e.result))});if(e.intercepted)return"";const n=!1===e.args.blocking?__("Non-blocking","query-monitor"):`${e.result.code} ${e.result.message}`,t=e.info&&"object"==typeof e.info?e.info:null;if(!(t&&("namelookup_time"in t||"connect_time"in t||"starttransfer_time"in t||"size_download"in t||"content_type"in t||"primary_ip"in t)))return n;const r=[{key:"namelookup_time",label:__("DNS Resolution Time","query-monitor")},{key:"connect_time",label:__("Connection Time","query-monitor")},{key:"starttransfer_time",label:__("Transfer Start Time (TTFB)","query-monitor")}],i=[{key:"content_type",label:__("Response Content Type","query-monitor")}],o="size_download"in t?t.size_download:null;return W(er,{summary:n,children:W("ul",{className:"qm-toggled",children:["primary_ip"in t&&W("li",{className:"qm-info qm-supplemental",children:[__("IP Address","query-monitor"),": ",t.primary_ip]},"primary_ip"),r.map(({key:e,label:n})=>{if(!(e in t))return null;else return W("li",{className:"qm-info qm-supplemental",children:[n,": ",W(Nt,{value:t[e]})]},e)}),null!==o&&W("li",{className:"qm-info qm-supplemental",children:[__("Response Size","query-monitor"),": ",Un(o/1024,2)," KB"]},"size_download"),i.map(({key:e,label:n})=>{if(!(e in t))return null;else return W("li",{className:"qm-info qm-supplemental",children:[n,": ",t[e]]},e)})]})})},filters:{options:[Object.keys(e.types).sort().map(e=>({key:e,label:e}))],callback:(e,n)=>{switch(n){case"non-blocking":return!1===e.args.blocking;case"error":return Ln(e.result);default:if(Ln(e.result))return!1;else return`HTTP ${e.result.code}`===n}}}},caller:Mt(e.http,n),component:Pt(e.http),timeout:{heading:__("Timeout","query-monitor"),className:"qm-num",render:e=>e.intercepted?"":e.args.timeout},time:{heading:__("Time","query-monitor"),className:"qm-num",render:e=>e.intercepted?"":W(Nt,{value:e.ltime})}},data:e.http,rowHasError:e=>Ln(e.result)||!e.intercepted&&e.result.code>=400,footer:({cols:e,count:n,total:t,data:r})=>W(xt,{cols:e-1,count:n,total:t,children:W("td",{className:"qm-num",children:W(zt,{rows:r.filter(e=>!e.intercepted)})})})})},dr=({data:e})=>{const{settings:n}=Ge(Pe);return W(Lt,{title:__("Languages","query-monitor"),cols:{domain:{heading:__("Text Domain","query-monitor"),className:"qm-nowrap",render:e=>e.handle?`${e.domain} (${e.handle})`:e.domain},type:{heading:__("Type","query-monitor"),render:e=>e.type},frame:{heading:__("Caller","query-monitor"),render:e=>e.caller?W(gt,{text:Fn(e.caller),file:e.caller.file,line:e.caller.line}):__("Unknown","query-monitor")},file:{heading:__("Translation File","query-monitor"),render:e=>e.file?e.found?W(bt,{text:Rn(e.file,n),file:e.file}):Rn(e.file,n):__("None","query-monitor")},found:{heading:__("Size","query-monitor"),className:"qm-nowrap",render:e=>e.found?W(Zt,{value:e.found}):__("Not Found","query-monitor")}},data:e.languages,footer:({cols:e,count:n,total:t,data:r})=>W(xt,{cols:e-1,count:n,total:t,children:W("td",{children:W(Zt,{value:r.reduce((e,n)=>e+(n.found?n.found:0),0)})})}),children:[W("section",{children:[W("h3",{children:W("code",{children:"get_locale()"})}),W("p",{children:e.locale})]}),W("section",{children:[W("h3",{children:W("code",{children:"get_user_locale()"})}),W("p",{children:e.user_locale})]}),W("section",{children:[W("h3",{children:W("code",{children:"determine_locale()"})}),W("p",{children:e.determined_locale})]}),e.mlp_language&&W("section",{children:[W("h3",{children:sprintf( /* translators: %s: Name of a multilingual plugin */ -__("%s Language","query-monitor"),"MultilingualPress")}),Q("p",{children:e.mlp_language})]}),e.pll_language&&Q("section",{children:[Q("h3",{children:sprintf( +__("%s Language","query-monitor"),"MultilingualPress")}),W("p",{children:e.mlp_language})]}),e.pll_language&&W("section",{children:[W("h3",{children:sprintf( /* translators: %s: Name of a multilingual plugin */ -__("%s Language","query-monitor"),"Polylang")}),Q("p",{children:e.pll_language})]}),Q("section",{children:[Q("h3",{children:Q("code",{children:"get_language_attributes()"})}),Q("p",{children:Q("code",{children:e.language_attributes})})]})]})},Ft=["emergency","alert","critical","error","warning"],Ht=({data:e})=>{const{settings:n}=Ke($e);if(!e.logs||!e.logs.length)return Q(Un,{children:[Q("p",{children:__("No data logged.","query-monitor")}),Q("p",{children:Q("a",{href:"https://querymonitor.com/wordpress-debugging/profiling-and-logging/",children:__("Read about profiling and logging in Query Monitor.","query-monitor")})})]});const t=e.logs.reduce((e,n)=>(e[n.level]=(e[n.level]||0)+1,e),{}),r=[{label:hn("Emergency",t.emergency),key:"emergency"},{label:hn("Alert",t.alert),key:"alert"},{label:hn("Critical",t.critical),key:"critical"},{label:hn("Error",t.error),key:"error"},{label:hn("Warning",t.warning),key:"warning"},{label:hn("Notice",t.notice),key:"notice"},{label:hn("Info",t.info),key:"info"},{label:hn("Debug",t.debug),key:"debug"}];return Q(st,{title:__("Logs","query-monitor"),cols:{level:{heading:__("Level","query-monitor"),render:e=>Ft.includes(e.level)?Q(Cn,{children:e.level}):e.level,filters:{options:[r],callback:(e,n)=>e.level===n}},message:{heading:__("Message","query-monitor"),render:e=>Q("pre",{children:e.message})},context:{heading:__("Context","query-monitor"),className:"qm-has-toggle",render:e=>{if(!e.context||0===Object.keys(e.context).length)return"";else return Q(xt,{summary:sprintf( +__("%s Language","query-monitor"),"Polylang")}),W("p",{children:e.pll_language})]}),W("section",{children:[W("h3",{children:W("code",{children:"get_language_attributes()"})}),W("p",{children:W("code",{children:e.language_attributes})})]})]})},mr=["emergency","alert","critical","error","warning"],hr=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.logs||!e.logs.length)return W(yt,{children:[W("p",{children:__("No data logged.","query-monitor")}),W("p",{children:W("a",{href:"https://querymonitor.com/wordpress-debugging/profiling-and-logging/",children:__("Read about profiling and logging in Query Monitor.","query-monitor")})})]});const t=e.logs.reduce((e,n)=>(e[n.level]=(e[n.level]||0)+1,e),{}),r=[{label:zn("Emergency",t.emergency),key:"emergency"},{label:zn("Alert",t.alert),key:"alert"},{label:zn("Critical",t.critical),key:"critical"},{label:zn("Error",t.error),key:"error"},{label:zn("Warning",t.warning),key:"warning"},{label:zn("Notice",t.notice),key:"notice"},{label:zn("Info",t.info),key:"info"},{label:zn("Debug",t.debug),key:"debug"}];return W(Lt,{title:__("Logs","query-monitor"),cols:{level:{heading:__("Level","query-monitor"),render:e=>mr.includes(e.level)?W(rt,{children:e.level}):e.level,filters:{options:[r],callback:(e,n)=>e.level===n}},message:{heading:__("Message","query-monitor"),render:e=>W("pre",{children:e.message})},context:{heading:__("Context","query-monitor"),className:"qm-has-toggle",render:e=>{if(!e.context||0===Object.keys(e.context).length)return"";else return W(er,{summary:sprintf( /* translators: %d: Number of items */ -_n("%d item","%d items",Object.keys(e.context).length,"query-monitor"),Object.keys(e.context).length),children:Q(ct,{data:e.context})})}},caller:it(e.logs,n),component:tt(e.logs)},data:e.logs,rowHasError:e=>Ft.includes(e.level)})},Lt=({data:e})=>{const{settings:n}=Ke($e);if(!e.switches.length)return Q(Un,{children:Q("p",{children:__("No data logged.","query-monitor")})});else return Q(st,{title:__("Multisite","query-monitor"),cols:{i:{className:"qm-num",heading:"#",render:(e,n)=>n+1},function:{heading:__("Function","query-monitor"),render:e=>Q("code",{children:e.to?sprintf("switch_to_blog(%d)",e.new):"restore_current_blog()"})},site:{heading:__("Site Switch","query-monitor"),render:e=>Q("code",{children:[e.prev," → ",e.new]})},caller:it(e.switches,n),component:tt(e.switches)},data:e.switches})},Dt=({data:e,settings:n})=>{const t=e.db_queries?.data,r=t?.rows?yn(t.rows):{},i=e.cache?.data,o=e.http?.data,l=e.raw_request?.data;if(!e.overview)return null;const a=e.overview.data,s=a.time_taken||0,c=a.memory||0,d=a.time_limit||0,u=a.memory_limit||0,m=a.time_usage||0,h=a.memory_usage||0,p=m>=75,f=h>=75;return Q(Sn,{title:__("Overview","query-monitor"),children:[Q("div",{className:"qm-boxed",children:l&&null!=l.response?.status&&Q("section",{id:"qm-overview-raw-request",children:Q("h3",{children:sprintf("%1$s %2$s → %3$s",l.request.method,l.request.url,l.response.status||__("Unknown HTTP Response Code","query-monitor"))})})}),Q("div",{className:"qm-grid",children:[Q("section",{children:[Q("h3",{children:__("Page Generation Time","query-monitor")}),Q("p",{children:[Q(Kn,{value:s,secondsLabel:!0}),d>0?Q(b,{children:[Q("br",{}),Q("span",{className:p?"qm-warn":"qm-info",children:[p&&Q(Ce,{name:"warning"}),sprintf( +_n("%d item","%d items",Object.keys(e.context).length,"query-monitor"),Object.keys(e.context).length),children:W(Ht,{data:e.context})})}},caller:Mt(e.logs,n),component:Pt(e.logs)},data:e.logs,rowHasError:e=>mr.includes(e.level)})},pr=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.switches.length)return W(yt,{children:W("p",{children:__("No data logged.","query-monitor")})});else return W(Lt,{title:__("Multisite","query-monitor"),cols:{i:{className:"qm-num",heading:"#",render:(e,n)=>n+1},function:{heading:__("Function","query-monitor"),render:e=>W("code",{children:e.to?sprintf("switch_to_blog(%d)",e.new):"restore_current_blog()"})},site:{heading:__("Site Switch","query-monitor"),render:e=>W("code",{children:[e.prev," → ",e.new]})},caller:Mt(e.switches,n),component:Pt(e.switches)},data:e.switches})},_r=({data:e,settings:n})=>{const t=e.db_queries?.data,r=t?.rows?Wn(t.rows):{},i=e.cache?.data,o=e.http?.data,l=e.raw_request?.data;if(!e.overview)return null;const a=e.overview.data,s=a.time_taken||0,c=a.memory||0,u=a.time_limit||0,d=a.memory_limit||0,m=a.time_usage||0,h=a.memory_usage||0,p=m>=75,_=h>=75;return W(nt,{title:__("Overview","query-monitor"),children:[W("div",{className:"qm-boxed",children:l&&null!=l.response?.status&&W("section",{id:"qm-overview-raw-request",children:W("h3",{children:sprintf("%1$s %2$s → %3$s",l.request.method,l.request.url,l.response.status||__("Unknown HTTP Response Code","query-monitor"))})})}),W("div",{className:"qm-grid",children:[W("section",{children:[W("h3",{children:__("Page Generation Time","query-monitor")}),W("p",{children:[W(Nt,{value:s,secondsLabel:!0}),u>0?W(v,{children:[W("br",{}),W("span",{className:p?"qm-warn":"qm-info",children:[p&&W($e,{name:"warning"}),sprintf( /* translators: 1: Percentage of time limit used, 2: Time limit in seconds */ -__("%1$s%% of %2$ss limit","query-monitor"),mn(m,1),mn(d))]})]}):Q(b,{children:[Q("br",{}),Q("span",{className:"qm-warn",children:[Q(Ce,{name:"warning"}),sprintf( +__("%1$s%% of %2$ss limit","query-monitor"),Un(m,1),Un(u))]})]}):W(v,{children:[W("br",{}),W("span",{className:"qm-warn",children:[W($e,{name:"warning"}),sprintf( /* translators: 1: Name of the PHP directive, 2: Value of the PHP directive */ -__("No execution time limit. The %1$s PHP configuration directive is set to %2$s.","query-monitor"),"max_execution_time","0")]})]})]})]}),Q("section",{children:[Q("h3",{children:__("Peak Memory Usage","query-monitor")}),Q("p",{children:0===c?__("Unknown","query-monitor"):Q(b,{children:[sprintf( +__("No execution time limit. The %1$s PHP configuration directive is set to %2$s.","query-monitor"),"max_execution_time","0")]})]})]})]}),W("section",{children:[W("h3",{children:__("Peak Memory Usage","query-monitor")}),W("p",{children:0===c?__("Unknown","query-monitor"):W(v,{children:[sprintf( /* translators: 1: Memory used in bytes, 2: Memory used in megabytes */ -__("%1$s bytes (%2$s MB)","query-monitor"),mn(c),mn(c/1024/1024,1)),u>0?Q(b,{children:[Q("br",{}),Q("span",{className:f?"qm-warn":"qm-info",children:[f&&Q(Ce,{name:"warning"}),sprintf( +__("%1$s bytes (%2$s MB)","query-monitor"),Un(c),Un(c/1024/1024,1)),d>0?W(v,{children:[W("br",{}),W("span",{className:_?"qm-warn":"qm-info",children:[_&&W($e,{name:"warning"}),sprintf( /* translators: 1: Percentage of memory limit used, 2: Memory limit in megabytes */ -__("%1$s%% of %2$s MB server limit","query-monitor"),mn(h,1),mn(u/1024/1024))]})]}):Q(b,{children:[Q("br",{}),Q("span",{className:"qm-warn",children:[Q(Ce,{name:"warning"}),sprintf( +__("%1$s%% of %2$s MB server limit","query-monitor"),Un(h,1),Un(d/1024/1024))]})]}):W(v,{children:[W("br",{}),W("span",{className:"qm-warn",children:[W($e,{name:"warning"}),sprintf( /* translators: 1: Name of the PHP directive, 2: Value of the PHP directive */ -__("No memory limit. The %1$s PHP configuration directive is set to %2$s.","query-monitor"),"memory_limit","0")]})]})]})})]}),Q("section",{children:[Q("h3",{children:__("Database Queries","query-monitor")}),t?.rows?.length?Q(b,{children:[Q("p",{children:Q(Kn,{value:t.rows.reduce((e,n)=>e+n.ltime,0),secondsLabel:!0})}),Q("p",{children:[Object.keys(r).length>1&&Object.entries(r).map(([e,n])=>Q(b,{children:[Q(Vn,{targetPanel:"db_queries",filterName:"sql",filterValue:e,children:sprintf("%1$s: %2$s",e,mn(n))}),Q("br",{})]},e)),Q(Vn,{targetPanel:"db_queries",filterName:"type",filterValue:"",children:sprintf("%1$s: %2$s",_x("Total","database queries","query-monitor"),mn(t.total_qs))})]})]}):Q("p",{children:t?.total_qs?sprintf("%1$s: %2$s",_x("Total","database queries","query-monitor"),mn(t.total_qs)):Q("em",{children:__("None","query-monitor")})})]}),o&&Q("section",{children:[Q("h3",{children:__("HTTP API Calls","query-monitor")}),o.http?.length?Q(b,{children:[Q("p",{children:Q(Kn,{value:o.ltime,secondsLabel:!0})}),Q(Vn,{targetPanel:"http",filterName:"type",filterValue:"",children:sprintf("%1$s: %2$s",_x("Total","HTTP API calls","query-monitor"),mn(o.http.length))})]}):Q("p",{children:Q("em",{children:__("None","query-monitor")})})]}),Q("section",{children:[Q("h3",{children:__("Object Cache","query-monitor")}),i?Q(b,{children:[i.stats&&void 0!==i.cache_hit_percentage&&Q("p",{children:sprintf( +__("No memory limit. The %1$s PHP configuration directive is set to %2$s.","query-monitor"),"memory_limit","0")]})]})]})})]}),W("section",{children:[W("h3",{children:__("Database Queries","query-monitor")}),t?.rows?.length?W(v,{children:[W("p",{children:W(Nt,{value:t.rows.reduce((e,n)=>e+n.ltime,0),secondsLabel:!0})}),W("p",{children:[Object.keys(r).length>1&&Object.entries(r).map(([e,n])=>W(v,{children:[W(wt,{targetPanel:"db_queries",filterName:"sql",filterValue:e,children:sprintf("%1$s: %2$s",e,Un(n))}),W("br",{})]},e)),W(wt,{targetPanel:"db_queries",filterName:"type",filterValue:"",children:sprintf("%1$s: %2$s",_x("Total","database queries","query-monitor"),Un(t.total_qs))})]})]}):W("p",{children:t?.total_qs?sprintf("%1$s: %2$s",_x("Total","database queries","query-monitor"),Un(t.total_qs)):W("em",{children:__("None","query-monitor")})})]}),o&&W("section",{children:[W("h3",{children:__("HTTP API Calls","query-monitor")}),o.http?.length?W(v,{children:[W("p",{children:W(Nt,{value:o.ltime,secondsLabel:!0})}),W(wt,{targetPanel:"http",filterName:"type",filterValue:"",children:sprintf("%1$s: %2$s",_x("Total","HTTP API calls","query-monitor"),Un(o.http.length))})]}):W("p",{children:W("em",{children:__("None","query-monitor")})})]}),W("section",{children:[W("h3",{children:__("Object Cache","query-monitor")}),i?W(v,{children:[i.stats&&void 0!==i.cache_hit_percentage&&W("p",{children:sprintf( /* translators: 1: Cache hit rate percentage, 2: number of cache hits, 3: number of cache misses */ -__("%1$s%% hit rate (%2$s hits, %3$s misses)","query-monitor"),mn(i.cache_hit_percentage,1),mn(i.stats.cache_hits,0),mn(i.stats.cache_misses,0))}),i.has_object_cache?Q("p",{children:Q("span",{className:"qm-info",children:Q("a",{href:`${n.admin_url}network/plugins.php?plugin_status=dropins`,target:"_blank",rel:"noopener noreferrer",children:__("Persistent object cache plugin in use","query-monitor")})})}):Q(b,{children:[Q("p",{children:__("Persistent object cache plugin not in use","query-monitor")}),Object.entries(i.object_cache_extensions).some(([,e])=>e)&&Object.entries(i.object_cache_extensions).filter(([,e])=>e).map(([e])=>Q("p",{children:sprintf( +__("%1$s%% hit rate (%2$s hits, %3$s misses)","query-monitor"),Un(i.cache_hit_percentage,1),Un(i.stats.cache_hits,0),Un(i.stats.cache_misses,0))}),i.has_object_cache?W("p",{children:W("span",{className:"qm-info",children:W("a",{href:`${n.admin_url}network/plugins.php?plugin_status=dropins`,target:"_blank",rel:"noopener noreferrer",children:__("Persistent object cache plugin in use","query-monitor")})})}):W(v,{children:[W("p",{children:__("Persistent object cache plugin not in use","query-monitor")}),Object.entries(i.object_cache_extensions).some(([,e])=>e)&&Object.entries(i.object_cache_extensions).filter(([,e])=>e).map(([e])=>W("p",{children:sprintf( /* translators: 1: PHP extension name */ -__("The %1$s object cache extension for PHP is installed but is not in use by WordPress. You should install a %1$s plugin.","query-monitor"),e)},e))]})]}):Q("p",{children:__("Object cache statistics are not available","query-monitor")})]}),i&&Q("section",{children:[Q("h3",{children:__("Opcode Cache","query-monitor")}),i.has_opcode_cache?Object.entries(i.opcode_cache_extensions).filter(([,e])=>e).map(([e])=>Q("p",{children:sprintf( +__("The %1$s object cache extension for PHP is installed but is not in use by WordPress. You should install a %1$s plugin.","query-monitor"),e)},e))]})]}):W("p",{children:__("Object cache statistics are not available","query-monitor")})]}),i&&W("section",{children:[W("h3",{children:__("Opcode Cache","query-monitor")}),i.has_opcode_cache?Object.entries(i.opcode_cache_extensions).filter(([,e])=>e).map(([e])=>W("p",{children:sprintf( /* translators: %s: Name of cache driver */ -__("Opcode cache in use: %s","query-monitor"),e)},e)):Q(b,{children:[Q("p",{children:Q("span",{className:"qm-warn",children:[Q(Ce,{name:"warning"}),__("Opcode cache not in use","query-monitor")]})}),Q("p",{children:__("Speak to your web host about enabling an opcode cache such as OPcache.","query-monitor")})]})]})]})]})},Rt=({data:e})=>{const{settings:n}=Ke($e);if(!e.errors)return Q(Un,{children:Q("p",{children:__("No errors logged.","query-monitor")})});const t=Object.values(e.errors),r=t.reduce((e,n)=>(e[n.level]=(e[n.level]||0)+1,e),{}),i=[{label:hn("Warning",r.warning),key:"warning"},{label:hn("Notice",r.notice),key:"notice"},{label:hn("Strict",r.strict),key:"strict"},{label:hn("Deprecated",r.deprecated),key:"deprecated"}];return Q(st,{title:__("PHP Errors","query-monitor"),cols:{level:{heading:__("Level","query-monitor"),render:e=>{const n=e.suppressed?`${e.level} (${__("suppressed","query-monitor")})`:e.level;return"warning"===e.level?Q(Cn,{children:n}):n},filters:{options:[i],callback:(e,n)=>e.level===n}},message:{heading:__("Message","query-monitor"),render:e=>e.message},caller:it(t,n),count:{className:"qm-num",heading:__("Count","query-monitor"),render:e=>e.count},component:tt(t)},rowHasError:e=>"warning"===e.level,data:t})},Ut=({data:e})=>{const n={request:__("Request","query-monitor"),matched_rule:__("Matched Rule","query-monitor"),matched_query:__("Matched Query","query-monitor"),query_string:__("Query String","query-monitor")},t={request:!1,matched_rule:!1,matched_query:!0,query_string:!0};return Q(Sn,{title:__("Request","query-monitor"),children:[Q("section",{children:Object.keys(n).map(r=>{const i=n[r],o=e.request[r],l=t[r];return Q(b,{children:[Q("h3",{children:i}),o?Q("p",{className:"qm-ltr",children:Q("code",{children:l?an(o):o})}):Q("p",{children:__("None","query-monitor")})]},r)})}),e.matching_rewrites&&Object.keys(e.matching_rewrites).length>0&&Q("section",{children:[Q("h3",{children:__("All Matching Rewrite Rules","query-monitor")}),Q("table",{children:Q("tbody",{children:Object.keys(e.matching_rewrites).map(n=>{const t=e.matching_rewrites[n].replace("index.php?","");return Q("tr",{children:[Q("td",{className:"qm-ltr",children:Q("code",{children:n})}),Q("td",{className:"qm-ltr",children:Q("code",{children:an(t)})})]},n)})})})]}),Q("section",{children:[Q("h3",{children:__("Query Vars","query-monitor")}),e.qvars?Q("table",{children:Q("tbody",{children:Object.keys(e.qvars).map(n=>{const t=e.qvars[n];return Q("tr",{children:[Q("th",{className:"qm-ltr",scope:"row",children:n}),Q("td",{className:"qm-ltr qm-wrap",children:"string"==typeof t?t:Q(ct,{data:t})})]},n)})})}):Q("p",{children:__("None","query-monitor")})]}),Q("section",{children:[Q("h3",{children:__("Queried Object","query-monitor")}),e.queried_object?Q("p",{children:[e.queried_object.title," (",e.queried_object.type,")"]}):Q("p",{children:__("None","query-monitor")}),Q("h3",{children:__("Current User","query-monitor")}),e.user.id?Q("p",{children:sprintf( +__("Opcode cache in use: %s","query-monitor"),e)},e)):W(v,{children:[W("p",{children:W("span",{className:"qm-warn",children:[W($e,{name:"warning"}),__("Opcode cache not in use","query-monitor")]})}),W("p",{children:__("Speak to your web host about enabling an opcode cache such as OPcache.","query-monitor")})]})]})]})]})},fr=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.errors)return W(yt,{children:W("p",{children:__("No errors logged.","query-monitor")})});const t=Object.values(e.errors),r=t.reduce((e,n)=>(e[n.level]=(e[n.level]||0)+1,e),{}),i=[{label:zn("Warning",r.warning),key:"warning"},{label:zn("Notice",r.notice),key:"notice"},{label:zn("Strict",r.strict),key:"strict"},{label:zn("Deprecated",r.deprecated),key:"deprecated"}];return W(Lt,{title:__("PHP Errors","query-monitor"),cols:{level:{heading:__("Level","query-monitor"),render:e=>{const n=e.suppressed?`${e.level} (${__("suppressed","query-monitor")})`:e.level;return"warning"===e.level?W(rt,{children:n}):n},filters:{options:[i],callback:(e,n)=>e.level===n}},message:{heading:__("Message","query-monitor"),render:e=>e.message},caller:Mt(t,n),count:{className:"qm-num",heading:__("Count","query-monitor"),render:e=>e.count},component:Pt(t)},rowHasError:e=>"warning"===e.level,data:t})},yr=({data:e})=>{const n={request:__("Request","query-monitor"),matched_rule:__("Matched Rule","query-monitor"),matched_query:__("Matched Query","query-monitor"),query_string:__("Query String","query-monitor")},t={request:!1,matched_rule:!1,matched_query:!0,query_string:!0};return W(nt,{title:__("Request","query-monitor"),children:[W("section",{children:Object.keys(n).map(r=>{const i=n[r],o=e.request[r],l=t[r];return W(v,{children:[W("h3",{children:i}),o?W("p",{className:"qm-ltr",children:W("code",{children:l?In(o):o})}):W("p",{children:__("None","query-monitor")})]},r)})}),e.matching_rewrites&&Object.keys(e.matching_rewrites).length>0&&W("section",{children:[W("h3",{children:__("All Matching Rewrite Rules","query-monitor")}),W("table",{children:W("tbody",{children:Object.keys(e.matching_rewrites).map(n=>{const t=e.matching_rewrites[n].replace("index.php?","");return W("tr",{children:[W("td",{className:"qm-ltr",children:W("code",{children:n})}),W("td",{className:"qm-ltr",children:W("code",{children:In(t)})})]},n)})})})]}),W("section",{children:[W("h3",{children:__("Query Vars","query-monitor")}),e.qvars?W("table",{children:W("tbody",{children:Object.keys(e.qvars).map(n=>{const t=e.qvars[n];return W("tr",{children:[W("th",{className:"qm-ltr",scope:"row",children:n}),W("td",{className:"qm-ltr qm-wrap",children:"string"==typeof t?t:W(Ht,{data:t})})]},n)})})}):W("p",{children:__("None","query-monitor")})]}),W("section",{children:[W("h3",{children:__("Queried Object","query-monitor")}),e.queried_object?W("p",{children:[e.queried_object.title," (",e.queried_object.type,")"]}):W("p",{children:__("None","query-monitor")}),W("h3",{children:__("Current User","query-monitor")}),e.user.id?W("p",{children:sprintf( /* translators: %d: User ID */ -__("Current User: #%d","query-monitor"),e.user.id)}):Q("p",{children:__("None","query-monitor")})]}),e.multisite?.current_site&&Q("section",{children:[Q("h3",{children:__("Multisite","query-monitor")}),Q("p",{children:sprintf( +__("Current User: #%d","query-monitor"),e.user.id)}):W("p",{children:__("None","query-monitor")})]}),e.multisite?.current_site&&W("section",{children:[W("h3",{children:__("Multisite","query-monitor")}),W("p",{children:sprintf( /* translators: %d: Multisite site ID */ -__("Current Site: #%d","query-monitor"),e.multisite.current_site.data.blog_id)})]})]})},zt=({data:e,type:n})=>{const t=e[n]?.headers;if(!t||0===Object.keys(t).length)return Q(Un,{children:Q("p",{children:"request"===n?__("No request headers found","query-monitor"):__("No response headers found","query-monitor")})});const r=Object.entries(t).map(([e,n])=>({name:e,value:n})),i="request"===n?__("Request Headers","query-monitor"):__("Response Headers","query-monitor"),o="request"===n?__("Request Header Name","query-monitor"):__("Response Header Name","query-monitor");return Q(st,{title:i,cols:{name:{heading:o,render:e=>Q("code",{children:e.name.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("-")})},value:{heading:__("Value","query-monitor"),render:e=>Q("pre",{className:"qm-pre-wrap",children:Q("code",{children:e.value})})}},data:r,footer:()=>Q("tfoot",{children:Q("tr",{children:Q("td",{colSpan:2,children:__("Note that header names are not case-sensitive.","query-monitor")})})})})},Qt=({settings:e})=>{const[n,t]=Qe(e.verified),{editor:r,setEditor:i,theme:o,setTheme:l,fabulous:a,setFabulous:s,durationUnit:c,setDurationUnit:d}=Ke($e),u={auto:_x("Auto","colour scheme","query-monitor"),light:_x("Light","colour scheme","query-monitor"),dark:_x("Dark","colour scheme","query-monitor")};return Q(Sn,{title:__("Settings","query-monitor"),children:Q("div",{className:"qm-grid",children:[Q("section",{children:[Q("h3",{children:__("Authentication","query-monitor")}),Q("p",{children:__("You can set an authentication cookie which allows you to view Query Monitor output when you are not logged in, or when you are logged in as a different user.","query-monitor")}),Q("p",{children:Q("button",{className:"qm-button",onClick:()=>{const r=n?"off":"on",i=new FormData;i.append("action",`qm_auth_${r}`),i.append("nonce",e.auth_nonce[r]),window.fetch(e.ajaxurl,{method:"POST",body:i,credentials:"same-origin"}).then(()=>{t(!n)})},children:n?__("Clear authentication cookie","query-monitor"):__("Set authentication cookie","query-monitor")})}),n&&Q("p",{children:[Q(Ce,{name:"yes-alt"}),__("Authentication cookie is set","query-monitor")]})]}),Q("section",{children:[Q("h3",{children:__("Editor","query-monitor")}),Q("p",{children:__("You can set your editor here, so that when you click on stack trace links the file opens in your editor.","query-monitor")}),Q("p",{children:Q("select",{className:"qm-filter",id:"qm-editor-select",name:"qm-editor-select",value:r??"",onChange:e=>{i(e.currentTarget.value)},children:[Q("option",{value:"",children:e.file_link_format?_x("Default","editor option","query-monitor"):_x("None","editor option","query-monitor")},""),Q("hr",{}),[{label:"Atom",name:"atom",format:"atom://open/?url=file://%1$s&line=%2$s"},{label:"Cursor",name:"cursor",format:"cursor://file/%1$s:%2$s"},{label:"Netbeans",name:"netbeans",format:"nbopen://%1$s:%2$s"},{label:"Nova",name:"nova",format:"nova://open?path=%1$s&line=%2$s"},{label:"PhpStorm",name:"phpstorm",format:"phpstorm://open?file=%1$s&line=%2$s"},{label:"Sublime Text",name:"sublime",format:"subl://open/?url=file://%1$s&line=%2$s"},{label:"TextMate",name:"textmate",format:"txmt://open/?url=file://%1$s&line=%2$s"},{label:"Visual Studio Code",name:"vscode",format:"vscode://file/%1$s:%2$s"},{label:"Zed",name:"zed",format:"zed://file/%1$s:%2$s"}].map(({label:e,name:n})=>Q("option",{value:n,children:e},e))]})}),r&&Q("p",{children:[Q(Ce,{name:"yes-alt"}),__("Editor is set","query-monitor")]})]}),Q("section",{children:[Q("h3",{children:__("Appearance","query-monitor")}),Q("p",{children:__("Your browser color scheme is respected by default. You can override it here.","query-monitor")}),Q("ul",{children:Object.entries(u).map(([e,n])=>Q("li",{children:Q("label",{children:[Q("input",{type:"radio",className:"qm-theme-toggle qm-radio",name:"qm-theme",value:e,defaultChecked:(o||"auto")===e,onChange:e=>{l(e.currentTarget.value)}}),n]})},e))}),Q("p",{className:"qm-fabulous-toggle",children:Q("label",{children:[Q("input",{type:"checkbox",className:"qm-checkbox",name:"qm-fabulous",defaultChecked:a,onChange:e=>{s(e.currentTarget.checked)}}),__("Fabulous","query-monitor")]})})]}),Q("section",{children:[Q("h3",{children:__("Duration units","query-monitor")}),Q("ul",{children:[Q("li",{children:Q("label",{children:[Q("input",{type:"radio",className:"qm-radio",name:"qm-duration-unit",value:"seconds",checked:"s"===c,onChange:()=>d("s")}),__("Seconds","query-monitor")]})}),Q("li",{children:Q("label",{children:[Q("input",{type:"radio",className:"qm-radio",name:"qm-duration-unit",value:"ms",checked:"ms"===c,onChange:()=>d("ms")}),__("Milliseconds","query-monitor")]})})]})]})]})})},Bt=({data:e})=>{const{settings:n}=Ke($e),t=e.concerned_actions,r=e.concerned_filters,i=[],o=e=>{if(e)Object.values(e).forEach(e=>{e.actions.forEach(n=>{i.push({...n,name:e.name,type:e.type})})})};if(o(t),o(r),0===i.length)return Q(Un,{children:Q("p",{children:__("No hooks in use.","query-monitor")})});const l=__("Related Hooks with Filters or Actions Attached","query-monitor");return Q(st,{title:l,cols:{hook:{heading:__("Hook","query-monitor"),render:e=>Q("span",{className:"qm-sticky",children:Q("code",{children:e.name})}),rowSpan:(e,n,t)=>{if(n>0&&t[n-1].name===e.name)return 0;let r=1;for(;n+re.priority},callback:{heading:__("Callback","query-monitor"),render:e=>{const t=e.callback.name||(e.callback.file?un(e.callback.file,n):"");if(!t)return"";else return Q(zn,{text:t,file:e.callback.file||"",line:e.callback.line||0,expanded:!0})}},component:{heading:__("Component","query-monitor"),render:e=>e.callback.component?.name||""}},data:i,groupKey:e=>e.name})},Wt=({asset:e})=>{const n=function(e){if("object"!=typeof e||null===e||!("error_data"in e))return null;const n=e;if(Array.isArray(n.error_data))return null;if(n.error_data)for(const t in n.error_data)return n.error_data[t];return null}(e.source),t=cn(e.source);if("object"==typeof n&&null!==n&&"src"in n){const e=n.src;return Q(b,{children:[Q(Cn,{children:t}),Q("br",{}),Q("a",{href:e,target:"_blank",rel:"noreferrer",children:e})]})}if(t)return Q(Cn,{children:t});const r=function(e){try{const n=new window.URL(e.absolute);return n.searchParams.delete("ver"),(n.pathname+n.search).replace(/^\//,"")}catch{return e.absolute}}(e.url);return r?Q("a",{href:e.url.absolute,target:"_blank",rel:"noreferrer",children:r}):""},Vt=({data:e,labels:n})=>{const t={missing:__("Missing","query-monitor"),broken:__("Missing Dependencies","query-monitor"),modules:__("Module","query-monitor"),header:__("Header","query-monitor"),footer:__("Footer","query-monitor")};if(!e.assets)return Q(Un,{children:Q("p",{children:n.none})});else return Q(st,{title:__("Assets","query-monitor"),cols:{position:{heading:__("Position","query-monitor"),className:"qm-nowrap",render:e=>t[e.position]},handle:{heading:__("Handle","query-monitor"),render:e=>e.handle,className:"qm-nowrap"},hostname:{heading:__("Host","query-monitor"),render:e=>e.url.host,filters:{options:[[{key:"local",label:e.url.host},{key:"other",label:__("Other","query-monitor")}]],callback:(e,n)=>"local"===n?e.url.local:!e.url.local}},source:{heading:__("Source","query-monitor"),render:e=>Q(Wt,{asset:e})},dependencies:{heading:__("Dependencies","query-monitor"),render:n=>Q(b,{children:n.dependencies.map((n,t)=>[t>0&&", ",Q("span",{className:"qm-nowrap",children:e.missing_dependencies[n]?Q(Cn,{children:[" ",sprintf( +__("Current Site: #%d","query-monitor"),e.multisite.current_site.data.blog_id)})]})]})},gr=({data:e,type:n})=>{const t=e[n]?.headers;if(!t||0===Object.keys(t).length)return W(yt,{children:W("p",{children:"request"===n?__("No request headers found","query-monitor"):__("No response headers found","query-monitor")})});const r=Object.entries(t).map(([e,n])=>({name:e,value:n})),i="request"===n?__("Request Headers","query-monitor"):__("Response Headers","query-monitor"),o="request"===n?__("Request Header Name","query-monitor"):__("Response Header Name","query-monitor");return W(Lt,{title:i,cols:{name:{heading:o,render:e=>W("code",{children:e.name.split(/[-_]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join("-")})},value:{heading:__("Value","query-monitor"),render:e=>W("pre",{className:"qm-pre-wrap",children:W("code",{children:e.value})})}},data:r,footer:()=>W("tfoot",{children:W("tr",{children:W("td",{colSpan:2,children:__("Note that header names are not case-sensitive.","query-monitor")})})})})},br=({settings:e})=>{const[n,t]=We(e.verified),{editor:r,setEditor:i,theme:o,setTheme:l,fabulous:a,setFabulous:s,durationUnit:c,setDurationUnit:u}=Ge(Pe),d={auto:_x("Auto","colour scheme","query-monitor"),light:_x("Light","colour scheme","query-monitor"),dark:_x("Dark","colour scheme","query-monitor")};return W(nt,{title:__("Settings","query-monitor"),children:W("div",{className:"qm-grid",children:[W("section",{children:[W("h3",{children:__("Authentication","query-monitor")}),W("p",{children:__("You can set an authentication cookie which allows you to view Query Monitor output when you are not logged in, or when you are logged in as a different user.","query-monitor")}),W("p",{children:W("button",{className:"qm-button",onClick:()=>{const r=n?"off":"on",i=new FormData;i.append("action",`qm_auth_${r}`),i.append("nonce",e.auth_nonce[r]),window.fetch(e.ajaxurl,{method:"POST",body:i,credentials:"same-origin"}).then(()=>{t(!n)})},children:n?__("Clear authentication cookie","query-monitor"):__("Set authentication cookie","query-monitor")})}),n&&W("p",{children:[W($e,{name:"yes-alt"}),__("Authentication cookie is set","query-monitor")]})]}),W("section",{children:[W("h3",{children:__("Editor","query-monitor")}),W("p",{children:__("You can set your editor here, so that when you click on stack trace links the file opens in your editor.","query-monitor")}),W("p",{children:W("select",{className:"qm-filter",id:"qm-editor-select",name:"qm-editor-select",value:r??"",onChange:e=>{i(e.currentTarget.value)},children:[W("option",{value:"",children:e.file_link_format?_x("Default","editor option","query-monitor"):_x("None","editor option","query-monitor")},""),W("hr",{}),[{label:"Atom",name:"atom",format:"atom://open/?url=file://%1$s&line=%2$s"},{label:"Cursor",name:"cursor",format:"cursor://file/%1$s:%2$s"},{label:"Netbeans",name:"netbeans",format:"nbopen://%1$s:%2$s"},{label:"Nova",name:"nova",format:"nova://open?path=%1$s&line=%2$s"},{label:"PhpStorm",name:"phpstorm",format:"phpstorm://open?file=%1$s&line=%2$s"},{label:"Sublime Text",name:"sublime",format:"subl://open/?url=file://%1$s&line=%2$s"},{label:"TextMate",name:"textmate",format:"txmt://open/?url=file://%1$s&line=%2$s"},{label:"Visual Studio Code",name:"vscode",format:"vscode://file/%1$s:%2$s"},{label:"Zed",name:"zed",format:"zed://file/%1$s:%2$s"}].map(({label:e,name:n})=>W("option",{value:n,children:e},e))]})}),r&&W("p",{children:[W($e,{name:"yes-alt"}),__("Editor is set","query-monitor")]})]}),W("section",{children:[W("h3",{children:__("Appearance","query-monitor")}),W("p",{children:__("Your browser color scheme is respected by default. You can override it here.","query-monitor")}),W("ul",{children:Object.entries(d).map(([e,n])=>W("li",{children:W("label",{children:[W("input",{type:"radio",className:"qm-theme-toggle qm-radio",name:"qm-theme",value:e,defaultChecked:(o||"auto")===e,onChange:e=>{l(e.currentTarget.value)}}),n]})},e))}),W("p",{className:"qm-fabulous-toggle",children:W("label",{children:[W("input",{type:"checkbox",className:"qm-checkbox",name:"qm-fabulous",defaultChecked:a,onChange:e=>{s(e.currentTarget.checked)}}),__("Fabulous","query-monitor")]})})]}),W("section",{children:[W("h3",{children:__("Duration units","query-monitor")}),W("ul",{children:[W("li",{children:W("label",{children:[W("input",{type:"radio",className:"qm-radio",name:"qm-duration-unit",value:"seconds",checked:"s"===c,onChange:()=>u("s")}),__("Seconds","query-monitor")]})}),W("li",{children:W("label",{children:[W("input",{type:"radio",className:"qm-radio",name:"qm-duration-unit",value:"ms",checked:"ms"===c,onChange:()=>u("ms")}),__("Milliseconds","query-monitor")]})})]})]})]})})},vr=({data:e})=>{const{settings:n}=Ge(Pe),t=e.concerned_actions,r=e.concerned_filters,i=[],o=e=>{if(e)Object.values(e).forEach(e=>{e.actions.forEach(n=>{i.push({...n,name:e.name,type:e.type})})})};if(o(t),o(r),0===i.length)return W(yt,{children:W("p",{children:__("No hooks in use.","query-monitor")})});const l=__("Related Hooks with Filters or Actions Attached","query-monitor");return W(Lt,{title:l,cols:{hook:{heading:__("Hook","query-monitor"),render:e=>W("span",{className:"qm-sticky",children:W("code",{children:e.name})}),rowSpan:(e,n,t)=>{if(n>0&&t[n-1].name===e.name)return 0;let r=1;for(;n+re.priority},callback:{heading:__("Callback","query-monitor"),render:e=>{const t=Dn(e.callback,n);if(!t)return"";else return W(gt,{text:t,file:e.callback.file||"",line:e.callback.line||0,expanded:!0})}},component:{heading:__("Component","query-monitor"),render:e=>e.callback.component?.name||""}},data:i,groupKey:e=>e.name})},qr=({asset:e})=>{const n=function(e){if("object"!=typeof e||null===e||!("error_data"in e))return null;const n=e;if(Array.isArray(n.error_data))return null;if(n.error_data)for(const t in n.error_data)return n.error_data[t];return null}(e.source),t=Hn(e.source);if("object"==typeof n&&null!==n&&"src"in n){const e=n.src;return W(v,{children:[W(rt,{children:t}),W("br",{}),W("a",{href:e,target:"_blank",rel:"noreferrer",children:e})]})}if(t)return W(rt,{children:t});const r=function(e){try{const n=new window.URL(e.absolute);return n.searchParams.delete("ver"),(n.pathname+n.search).replace(/^\//,"")}catch{return e.absolute}}(e.url);return r?W("a",{href:e.url.absolute,target:"_blank",rel:"noreferrer",children:r}):""},wr=({data:e,labels:n})=>{const t={missing:__("Missing","query-monitor"),broken:__("Missing Dependencies","query-monitor"),modules:__("Module","query-monitor"),header:__("Header","query-monitor"),footer:__("Footer","query-monitor")};if(!e.assets)return W(yt,{children:W("p",{children:n.none})});else return W(Lt,{title:__("Assets","query-monitor"),cols:{position:{heading:__("Position","query-monitor"),className:"qm-nowrap",render:e=>t[e.position]},handle:{heading:__("Handle","query-monitor"),render:e=>e.handle,className:"qm-nowrap"},hostname:{heading:__("Host","query-monitor"),render:e=>e.url.host,filters:{options:[[{key:"local",label:e.url.host},{key:"other",label:__("Other","query-monitor")}]],callback:(e,n)=>"local"===n?e.url.local:!e.url.local}},source:{heading:__("Source","query-monitor"),render:e=>W(qr,{asset:e})},dependencies:{heading:__("Dependencies","query-monitor"),render:n=>W(v,{children:n.dependencies.map((n,t)=>[t>0&&", ",W("span",{className:"qm-nowrap",children:e.missing_dependencies[n]?W(rt,{children:[" ",sprintf( /* translators: %s: Name of missing script or style dependency */ -__("%s (missing)","query-monitor"),n)]}):n},n)])})},dependents:{heading:__("Dependents","query-monitor"),render:e=>Q(b,{children:e.dependents.map((e,n)=>[n>0&&", ",Q("span",{className:"qm-nowrap",children:e},e)])})},version:{heading:__("Version","query-monitor"),render:e=>e.ver}},data:e.assets,rowHasError:e=>e.warning})},Jt=e=>Q(Vt,{...e,labels:{none:__("No JavaScript files were enqueued.","query-monitor")}}),Kt=e=>Q(Vt,{...e,labels:{none:__("No CSS files were enqueued.","query-monitor")}}),Gt=({data:e})=>{let n=null;if(e.template_parts)if(e.is_child_theme)n=e.theme_template_parts;else n=e.template_parts;return Q(Sn,{title:__("Template","query-monitor"),children:[Q("section",{children:[Q("h3",{children:__("Theme","query-monitor")}),Q("p",{children:e.stylesheet}),Q("p",{children:Q(Qn,{text:"style.css",file:`${e.theme_dirs[e.stylesheet]}/style.css`})}),e.stylesheet_theme_json&&Q("p",{children:Q(Qn,{text:"theme.json",file:e.stylesheet_theme_json})}),e.is_child_theme&&Q(b,{children:[Q("h3",{children:__("Parent Theme","query-monitor")}),Q("p",{children:e.template}),Q("p",{children:Q(Qn,{text:"style.css",file:`${e.theme_dirs[e.template]}/style.css`})}),e.template_theme_json&&Q("p",{children:Q(Qn,{text:"theme.json",file:e.template_theme_json})})]})]}),Q("section",{children:[e.block_template?Q(b,{children:[Q("h3",{children:__("Block Template","query-monitor")}),Q("p",{className:"qm-ltr",children:e.block_template.wp_id?Q("a",{href:pn(e.block_template.id,"wp_template"),children:e.block_template.id}):Q(Qn,{text:`${e.theme_folders[e.block_template.type]}/${e.block_template.slug}.html`,file:`${e.theme_dirs[e.block_template.theme]}/${e.theme_folders[e.block_template.type]}/${e.block_template.slug}.html`})})]}):Q(b,{children:[Q("h3",{children:__("Template File","query-monitor")}),e.template_path?Q("p",{className:"qm-ltr",children:Q(Qn,{text:(e.is_child_theme?e.theme_template_file:e.template_file)??"",file:e.template_path})}):Q("p",{children:Q("em",{children:__("Unknown","query-monitor")})})]}),e.template_hierarchy&&Q(b,{children:[Q("h3",{children:__("Template Hierarchy","query-monitor")}),Q("ol",{className:"qm-ltr",children:e.template_hierarchy.map(e=>Q("li",{children:e},e))})]})]}),Q("section",{children:[Q("h3",{children:__("Template Parts","query-monitor")}),n?Q("ul",{className:"qm-ltr",children:Object.keys(n).map(t=>Q("li",{children:["number"==typeof t?Q("a",{href:pn(n[t]),children:n[t]}):Q(Qn,{text:n[t],file:t}),e.count_template_parts[t]>1&&Q("span",{className:"qm-info qm-supplemental",children:[Q("br",{})," - ",sprintf( +__("%s (missing)","query-monitor"),n)]}):n},n)])})},dependents:{heading:__("Dependents","query-monitor"),render:e=>W(v,{children:e.dependents.map((e,n)=>[n>0&&", ",W("span",{className:"qm-nowrap",children:e},e)])})},version:{heading:__("Version","query-monitor"),render:e=>e.ver}},data:e.assets,rowHasError:e=>e.warning})},kr=e=>W(wr,{...e,labels:{none:__("No JavaScript files were enqueued.","query-monitor")}}),Nr=e=>W(wr,{...e,labels:{none:__("No CSS files were enqueued.","query-monitor")}}),xr=({data:e})=>{let n=null;if(e.template_parts)if(e.is_child_theme)n=e.theme_template_parts;else n=e.template_parts;return W(nt,{title:__("Template","query-monitor"),children:[W("section",{children:[W("h3",{children:__("Theme","query-monitor")}),W("p",{children:e.stylesheet}),W("p",{children:W(bt,{text:"style.css",file:`${e.theme_dirs[e.stylesheet]}/style.css`})}),e.stylesheet_theme_json&&W("p",{children:W(bt,{text:"theme.json",file:e.stylesheet_theme_json})}),e.is_child_theme&&W(v,{children:[W("h3",{children:__("Parent Theme","query-monitor")}),W("p",{children:e.template}),W("p",{children:W(bt,{text:"style.css",file:`${e.theme_dirs[e.template]}/style.css`})}),e.template_theme_json&&W("p",{children:W(bt,{text:"theme.json",file:e.template_theme_json})})]})]}),W("section",{children:[e.block_template?W(v,{children:[W("h3",{children:__("Block Template","query-monitor")}),W("p",{className:"qm-ltr",children:e.block_template.wp_id?W("a",{href:Qn(e.block_template.id,"wp_template"),children:e.block_template.id}):W(bt,{text:`${e.theme_folders[e.block_template.type]}/${e.block_template.slug}.html`,file:`${e.theme_dirs[e.block_template.theme]}/${e.theme_folders[e.block_template.type]}/${e.block_template.slug}.html`})})]}):W(v,{children:[W("h3",{children:__("Template File","query-monitor")}),e.template_path?W("p",{className:"qm-ltr",children:W(bt,{text:(e.is_child_theme?e.theme_template_file:e.template_file)??"",file:e.template_path})}):W("p",{children:W("em",{children:__("Unknown","query-monitor")})})]}),e.template_hierarchy&&W(v,{children:[W("h3",{children:__("Template Hierarchy","query-monitor")}),W("ol",{className:"qm-ltr",children:e.template_hierarchy.map(e=>W("li",{children:e},e))})]})]}),W("section",{children:[W("h3",{children:__("Template Parts","query-monitor")}),n?W("ul",{className:"qm-ltr",children:Object.keys(n).map(t=>W("li",{children:["number"==typeof t?W("a",{href:Qn(n[t]),children:n[t]}):W(bt,{text:n[t],file:t}),e.count_template_parts[t]>1&&W("span",{className:"qm-info qm-supplemental",children:[W("br",{})," - ",sprintf( /* translators: %s: The number of times that a template part file was included in the page */ -_nx("Included %s time","Included %s times",e.count_template_parts[t],"template parts","query-monitor"),mn(e.count_template_parts[t]))]})]},t))}):Q("p",{children:Q("em",{children:__("None","query-monitor")})}),e.unsuccessful_template_parts&&e.unsuccessful_template_parts.length>0&&Q(b,{children:[Q("h4",{children:__("Not Loaded","query-monitor")}),Q("ul",{children:e.unsuccessful_template_parts.map((e,n)=>Q(b,{children:[e.name&&Q("li",{children:Q(Qn,{text:`${e.slug}-${e.name}.php`,file:e.caller?.file,line:e.caller?.line})}),Q("li",{children:Q(Qn,{text:`${e.slug}.php`,file:e.caller?.file,line:e.caller?.line})})]},n))})]})]}),e.timber_files&&Q("section",{children:[Q("h3",{children:__("Twig Template Files","query-monitor")}),Q("ul",{className:"qm-ltr",children:e.timber_files.map(e=>Q("li",{children:e},e))})]}),e.body_class&&Q("section",{children:[Q("h3",{children:__("Body Classes","query-monitor")}),Q("ul",{className:"qm-ltr",children:e.body_class.map(e=>Q("li",{children:e},e))})]})]})},Yt=({data:e})=>{const{settings:n}=Ke($e);if(!(e.timing&&0!==e.timing.length||e.warning&&0!==e.warning.length))return Q(Un,{children:[Q("p",{children:__("No data logged.","query-monitor")}),Q("p",{children:Q("a",{href:"https://querymonitor.com/wordpress-debugging/profiling-and-logging/",children:__("Read about profiling and logging in Query Monitor.","query-monitor")})})]});const t=[];if(e.timing)e.timing.forEach(e=>{if(t.push(e),e.laps&&Object.keys(e.laps).length>0)Object.entries(e.laps).forEach(([n,r])=>{t.push({...e,isLap:!0,lapName:n,lapData:r,function:`${e.function}: ${n}`})})});if(e.warning)t.push(...e.warning);return Q(st,{title:__("Timing","query-monitor"),cols:{function:{heading:__("Tracked Function","query-monitor"),render:e=>{if("message"in e)return Q(b,{children:[Q("code",{children:e.function}),Q("br",{}),Q(Cn,{children:e.message})]});if(e.isLap)return Q("code",{children:["— ",e.function]});else return Q("code",{children:e.function})}},start_time:{className:"qm-num",heading:__("Started","query-monitor"),render:e=>{if("isLap"in e&&e.isLap)return"";else return"start_time"in e?Q(Kn,{value:e.start_time}):""}},end_time:{className:"qm-num",heading:__("Stopped","query-monitor"),render:e=>{if("isLap"in e&&e.isLap)return"";else return"end_time"in e?Q(Kn,{value:e.end_time}):""}},function_time:{className:"qm-num",heading:__("Time","query-monitor"),render:e=>{if("isLap"in e&&e.isLap&&e.lapData)return Q(Kn,{value:e.lapData.time_used});else return"function_time"in e?Q(Kn,{value:e.function_time}):""}},function_memory:{className:"qm-num",heading:__("Memory","query-monitor"),render:e=>{if("isLap"in e&&e.isLap&&e.lapData)return Q(kt,{value:e.lapData.memory_used});else return"function_memory"in e?Q(kt,{value:e.function_memory}):""}},caller:{...it(t,n),render:(e,r)=>{if("isLap"in e&&e.isLap)return"";else return it(t,n).render(e,r)}},component:{...tt(t),render:(e,n)=>{if("isLap"in e&&e.isLap)return"";else return tt(t).render(e,n)}}},data:t,rowHasError:e=>"message"in e})},Xt=({data:e})=>{const{settings:n}=Ke($e);if(!e.trans?.length)return Q(Un,{children:Q("p",{children:__("No transients set.","query-monitor")})});else return Q(st,{title:__("Transients","query-monitor"),cols:{name:{heading:__("Updated Transient","query-monitor"),render:e=>Q("code",{children:e.name})},type:e.has_type&&{heading:_x("Type","transient type","query-monitor"),render:e=>e.type},expiration:{heading:__("Expiration","query-monitor"),render:e=>Q(b,{children:e.expiration?Q(b,{children:[e.expiration,Q("span",{className:"qm-info",children:[" (~",e.exp_diff,")"]})]}):Q("em",{children:__("none","query-monitor")})})},size:{className:"qm-num",heading:_x("Size","size of transient value","query-monitor"),render:e=>Q(kt,{value:e.size})},caller:it(e.trans,n),component:tt(e.trans)},data:e.trans})},Zt=({targetPanel:e,rowIndex:n,children:t})=>{const{switchToPanel:r}=Ke($e);return Q("button",{className:"qm-filter-trigger",onClick:()=>{r(e,{},n)},children:t})},er={db:"var(--qm-timeline-db)",http:"var(--qm-timeline-http)","php-error":"var(--qm-timeline-php-error)",timing:"var(--qm-timeline-timing)",action:"var(--qm-timeline-action)",log:"var(--qm-timeline-log)"},nr={db:__("Database Queries","query-monitor"),http:__("HTTP Requests","query-monitor"),"php-error":__("PHP Errors","query-monitor"),timing:__("Timings","query-monitor"),action:__("Notable Actions","query-monitor"),log:__("Logs","query-monitor")},tr={init:__("Initialization","query-monitor"),request:__("Request","query-monitor"),query:__("Query","query-monitor"),template:__("Template","query-monitor"),shutdown:__("Shutdown","query-monitor")},rr=({data:e})=>{const{filters:n,setFilter:t}=Ke(xn),r=n.component??"",{timelineHiddenCategories:i,setTimelineHiddenCategories:o}=Ke($e),l=new Set(i),a=e.db_queries?.data,s=e.http?.data,c=e.php_errors?.data,d=e.timing?.data,u=e.logger?.data;if(!e.overview)return null;const m=e.overview.data,h=m.time_taken||0,p=m.actions,f=m.segments,_=[...((e,n,t,r,i)=>{const o=[];if(e)for(let l=0;le.category))],g=nt(_,e=>e.component);if(!_.length||!h)return null;const q=1e3*h,v=[..._.filter(e=>!l.has(e.category)&&(!r||!e.component||et(e.component,r)))].sort((e,n)=>e.time-n.time),w=[];if(f){for(const[e,n]of Object.entries(f))if(void 0!==n&&tr[e])w.push({time:n,label:tr[e]});w.sort((e,n)=>e.time-n.time)}const k=[];for(let b=0;b<=5;b++)k.push(b/5*q);const N={timeline:{heading:__("Timeline","query-monitor"),render:e=>{const n=e.time/q*99,t=1e3*(e.duration??0),r=t/q*100,i=null===e.duration||r<.3,o=er[e.category],l=n>60||n>100-n-r;return Q(b,{children:[Q("span",{className:"timeline-bar "+(i?"timeline-point":""),style:{left:`${n}%`,width:i?void 0:`${Math.max(r,.3)}%`,backgroundColor:o}}),Q("span",{className:"timeline-bar-label",style:l?{right:100-n+"%",textAlign:"right"}:{left:`${n+(i?.3:Math.max(r,.3))}%`},children:[Q("span",{className:"timeline-bar-label-text",children:void 0!==e.rowIndex?Q(Zt,{targetPanel:e.panel,rowIndex:e.rowIndex,children:e.label}):e.label}),null!==e.duration&&Q("span",{className:"timeline-bar-label-time",children:Q(Kn,{value:t/1e3})})]})]})}}},x=Q(b,{children:[Q("div",{className:"timeline-header",children:Q("div",{className:"timeline-filters",children:[g.length>0&&Q("div",{className:"qm-filter-container",children:[Q("label",{htmlFor:"qm-filter-timeline-component",className:"qm-screen-reader-text",children:__("Component","query-monitor")}),Q("select",{id:"qm-filter-timeline-component",className:"qm-filter",value:r,onChange:e=>t("component",e.currentTarget.value),children:[Q("option",{value:"",children:__("All components","query-monitor")}),g.map((e,n)=>Q(b,{children:[Q("hr",{}),e.map(e=>Q("option",{value:e.key,children:e.label},`${n}-${e.key}`))]}))]})]}),y.map(e=>Q("label",{className:"timeline-filter",children:[Q("input",{type:"checkbox",checked:!l.has(e),onChange:()=>(e=>{const n=new Set(l);if(n.has(e))n.delete(e);else n.add(e);o([...n])})(e),style:{accentColor:er[e]}}),nr[e]]},e))]})}),w.length>0&&Q("div",{className:"timeline-segments",children:w.map((e,n)=>{const t=nQ("span",{className:"timeline-tick",style:{left:e/q*100+"%"},children:Q(Kn,{value:e/1e3})},n))})]});return Q(st,{title:__("Timeline","query-monitor"),cols:N,data:v,footer:()=>null,header:x})};var ir,or;if(ir=QueryMonitorData.frames,Ln=ir,QueryMonitorData.locale_data)ke(QueryMonitorData.locale_data,"query-monitor");Pn("overview",{render:(e,n)=>Q(Dt,{data:e,settings:n})}),Pn("timeline",{render:(e,n)=>Q(rr,{data:e,settings:n})}),On("admin",{render:(e,n)=>Q(Rn,{data:e,enabled:n}),data:"admin"}),On("block_editor",{render:(e,n)=>Q(ut,{data:e,enabled:n}),data:"block_editor"}),On("caps",{render:(e,n)=>Q(mt,{data:e,enabled:n}),data:"caps"}),On("conditionals",{render:(e,n)=>Q(ht,{data:e,enabled:n}),data:"conditionals"}),On("db_callers",{render:(e,n)=>Q(ft,{data:e,enabled:n}),data:"db_queries"}),On("db_components",{render:(e,n)=>Q(_t,{data:e,enabled:n}),data:"db_queries"}),On("db_dupes",{render:(e,n)=>Q(yt,{data:e,enabled:n}),data:"db_queries"}),On("db_errors",{render:(e,n)=>Q(gt,{data:e,enabled:n}),data:"db_queries"}),On("db_expensive",{render:(e,n)=>Q(bt,{data:e,enabled:n}),data:"db_queries"}),On("db_queries",{render:(e,n)=>Q(vt,{data:e,enabled:n}),data:"db_queries"}),On("doing_it_wrong",{render:(e,n)=>Q(wt,{data:e,enabled:n}),data:"doing_it_wrong"}),On("environment",{render:(e,n)=>Q($t,{data:e,enabled:n}),data:"environment"}),On("hooks",{render:(e,n)=>Q(Et,{data:e,enabled:n}),data:"hooks"}),On("http",{render:(e,n)=>Q(At,{data:e,enabled:n}),data:"http"}),On("languages",{render:(e,n)=>Q(It,{data:e,enabled:n}),data:"languages"}),On("logger",{render:(e,n)=>Q(Ht,{data:e,enabled:n}),data:"logger"}),On("multisite",{render:(e,n)=>Q(Lt,{data:e,enabled:n}),data:"multisite"}),On("php_errors",{render:(e,n)=>Q(Rt,{data:e,enabled:n}),data:"php_errors"}),On("request",{render:(e,n)=>Q(Ut,{data:e,enabled:n}),data:"request"}),On("raw_request",{render:(e,n)=>Q(zt,{data:e,enabled:n,type:"request"}),data:"raw_request"}),On("raw_request-response",{render:(e,n)=>Q(zt,{data:e,enabled:n,type:"response"}),data:"raw_request"}),On("assets_scripts",{render:(e,n)=>Q(Jt,{data:e,enabled:n}),data:"assets_scripts"}),On("assets_styles",{render:(e,n)=>Q(Kt,{data:e,enabled:n}),data:"assets_styles"}),On("response",{render:(e,n)=>Q(Gt,{data:e,enabled:n}),data:"response"}),On("timing",{render:(e,n)=>Q(Yt,{data:e,enabled:n}),data:"timing"}),On("transients",{render:(e,n)=>Q(Xt,{data:e,enabled:n}),data:"transients"}),or={render:e=>Q(Qt,{settings:e})},En.settings={...or,type:"settings"};Object.keys({admin:"Admin",assets_scripts:"Scripts",assets_styles:"Styles",block_editor:"Block Editor",caps:"Capability Checks",doing_it_wrong:"Doing It Wrong",http:"HTTP API Calls",languages:"Languages",request:"Request",response:"Template"}).forEach(e=>{On(`${e}-concerned_hooks`,{render:(e,n)=>Q(Bt,{data:e,enabled:n}),data:e})}),document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("qm-fatal"),n=document.getElementById("query-monitor-container"),t=document.getElementById("wp-admin-bar-query-monitor");if(e)return void L(Q(Fn,{adminMenuElement:t??void 0}),e);const r=document.body.classList.contains("wp-admin"),i="rtl"===document.documentElement.dir,o=`qm-${r?"admin":"front"}-panel`,l="qm-container-position",a="qm-theme",s="qm-fabulous",c="qm-editor",d="qm-filters",u="qm-container-height",m="qm-seen",h="qm-timeline-hidden",p="qm-duration-unit",f=e=>{localStorage.setItem(o,e),localStorage.removeItem("qm-admin-container-pinned"),localStorage.removeItem("qm-front-container-pinned")},_=e=>{localStorage.setItem(l,e?"right":"")},y=e=>{localStorage.setItem(a,e)},g=e=>{if(e)localStorage.setItem(s,"1");else localStorage.removeItem(s)},b=e=>{localStorage.setItem(c,e)},q=e=>{sessionStorage.setItem(d,JSON.stringify(e))},v=e=>{localStorage.setItem(u,e.toString())},w=e=>{localStorage.setItem(m,e)},k=e=>{sessionStorage.setItem(h,JSON.stringify(e))},N=e=>{localStorage.setItem(p,e)},x=localStorage.getItem(o)??"",S="right"===localStorage.getItem(l),T=localStorage.getItem(c)??"",C=localStorage.getItem(a)??"auto",$=!!localStorage.getItem(s),E=sessionStorage.getItem(d),O=E?JSON.parse(E):{},P=localStorage.getItem(u),M=P?parseFloat(P):null,j=localStorage.getItem(m)??"",A=sessionStorage.getItem(h),I=A?JSON.parse(A):[],F=localStorage.getItem(p)??"s",H={...QueryMonitorData.settings,ajaxurl:QueryMonitorData.l10n.ajaxurl,admin_url:QueryMonitorData.l10n.admin_url,auth_nonce:QueryMonitorData.l10n.auth_nonce,file_path_map:QueryMonitorData.l10n.file_path_map,file_link_format:QueryMonitorData.l10n.file_link_format,abspath:QueryMonitorData.l10n.abspath,contentpath:QueryMonitorData.l10n.contentpath};if(!n)return;const D=n.attachShadow({mode:"open"}),R=document.createElement("div");D.appendChild(R);const U=()=>{L(Q(An,{isWpAdmin:r,isRtl:i,active:x,adminMenuElement:t??void 0,cssUrl:n.dataset.cssUrl,menu:QueryMonitorData.menu,panel_menu:QueryMonitorData.panel_menu,data:QueryMonitorData.data,settings:H,side:S,colorScheme:H.color_scheme,theme:C,fabulous:$,editor:T,filters:O,containerHeight:M,onPanelChange:f,onContainerResize:v,onSideChange:_,onThemeChange:y,onFabulousChange:g,onEditorChange:b,onFiltersChange:q,seen:j,onSeenChange:w,timelineHiddenCategories:I,onTimelineHiddenChange:k,durationUnit:F,onDurationUnitChange:N,isFolded:document.body.classList.contains("folded"),isAutoFold:document.body.classList.contains("auto-fold"),isFullscreenMode:document.body.classList.contains("is-fullscreen-mode")}),R)};U();new MutationObserver(U).observe(document.body,{attributes:!0,attributeFilter:["class"]})}); +_nx("Included %s time","Included %s times",e.count_template_parts[t],"template parts","query-monitor"),Un(e.count_template_parts[t]))]})]},t))}):W("p",{children:W("em",{children:__("None","query-monitor")})}),e.unsuccessful_template_parts&&e.unsuccessful_template_parts.length>0&&W(v,{children:[W("h4",{children:__("Not Loaded","query-monitor")}),W("ul",{children:e.unsuccessful_template_parts.map((e,n)=>W(v,{children:[e.name&&W("li",{children:W(bt,{text:`${e.slug}-${e.name}.php`,file:e.caller?.file,line:e.caller?.line})}),W("li",{children:W(bt,{text:`${e.slug}.php`,file:e.caller?.file,line:e.caller?.line})})]},n))})]})]}),e.timber_files&&W("section",{children:[W("h3",{children:__("Twig Template Files","query-monitor")}),W("ul",{className:"qm-ltr",children:e.timber_files.map(e=>W("li",{children:e},e))})]}),e.body_class&&W("section",{children:[W("h3",{children:__("Body Classes","query-monitor")}),W("ul",{className:"qm-ltr",children:e.body_class.map(e=>W("li",{children:e},e))})]})]})},Sr=({data:e})=>{const{settings:n}=Ge(Pe);if(!(e.timing&&0!==e.timing.length||e.warning&&0!==e.warning.length))return W(yt,{children:[W("p",{children:__("No data logged.","query-monitor")}),W("p",{children:W("a",{href:"https://querymonitor.com/wordpress-debugging/profiling-and-logging/",children:__("Read about profiling and logging in Query Monitor.","query-monitor")})})]});const t=[];if(e.timing)e.timing.forEach(e=>{if(t.push(e),e.laps&&Object.keys(e.laps).length>0)Object.entries(e.laps).forEach(([n,r])=>{t.push({...e,isLap:!0,lapName:n,lapData:r,function:`${e.function}: ${n}`})})});if(e.warning)t.push(...e.warning);return W(Lt,{title:__("Timing","query-monitor"),cols:{function:{heading:__("Tracked Function","query-monitor"),render:e=>{if("message"in e)return W(v,{children:[W("code",{children:e.function}),W("br",{}),W(rt,{children:e.message})]});if(e.isLap)return W("code",{children:["— ",e.function]});else return W("code",{children:e.function})}},start_time:{className:"qm-num",heading:__("Started","query-monitor"),render:e=>{if("isLap"in e&&e.isLap)return"";else return"start_time"in e?W(Nt,{value:e.start_time}):""}},end_time:{className:"qm-num",heading:__("Stopped","query-monitor"),render:e=>{if("isLap"in e&&e.isLap)return"";else return"end_time"in e?W(Nt,{value:e.end_time}):""}},function_time:{className:"qm-num",heading:__("Time","query-monitor"),render:e=>{if("isLap"in e&&e.isLap&&e.lapData)return W(Nt,{value:e.lapData.time_used});else return"function_time"in e?W(Nt,{value:e.function_time}):""}},function_memory:{className:"qm-num",heading:__("Memory","query-monitor"),render:e=>{if("isLap"in e&&e.isLap&&e.lapData)return W(Zt,{value:e.lapData.memory_used});else return"function_memory"in e?W(Zt,{value:e.function_memory}):""}},caller:{...Mt(t,n),render:(e,r)=>{if("isLap"in e&&e.isLap)return"";else return Mt(t,n).render(e,r)}},component:{...Pt(t),render:(e,n)=>{if("isLap"in e&&e.isLap)return"";else return Pt(t).render(e,n)}}},data:t,rowHasError:e=>"message"in e})},Cr=({data:e})=>{const{settings:n}=Ge(Pe);if(!e.trans?.length)return W(yt,{children:W("p",{children:__("No transients set.","query-monitor")})});else return W(Lt,{title:__("Transients","query-monitor"),cols:{name:{heading:__("Updated Transient","query-monitor"),render:e=>W("code",{children:e.name})},type:e.has_type&&{heading:_x("Type","transient type","query-monitor"),render:e=>e.type},expiration:{heading:__("Expiration","query-monitor"),render:e=>W(v,{children:e.expiration?W(v,{children:[e.expiration,W("span",{className:"qm-info",children:[" (~",e.exp_diff,")"]})]}):W("em",{children:__("none","query-monitor")})})},size:{className:"qm-num",heading:_x("Size","size of transient value","query-monitor"),render:e=>W(Zt,{value:e.size})},caller:Mt(e.trans,n),component:Pt(e.trans)},data:e.trans})},Tr=({targetPanel:e,rowIndex:n,children:t})=>{const{switchToPanel:r}=Ge(Pe);return W("button",{className:"qm-filter-trigger",onClick:()=>{r(e,{},n)},children:t})},Er={db:"var(--qm-timeline-db)",http:"var(--qm-timeline-http)","php-error":"var(--qm-timeline-php-error)",timing:"var(--qm-timeline-timing)",action:"var(--qm-timeline-action)",log:"var(--qm-timeline-log)",transient:"var(--qm-timeline-transient)","doing-it-wrong":"var(--qm-timeline-doing-it-wrong)"},$r={db:__("Database Queries","query-monitor"),http:__("HTTP Requests","query-monitor"),"php-error":__("PHP Errors","query-monitor"),timing:__("Timings","query-monitor"),action:__("Notable Actions","query-monitor"),log:__("Logs","query-monitor"),transient:__("Transient Updates","query-monitor"),"doing-it-wrong":__("Doing It Wrong","query-monitor")},Pr={init:__("Initialization","query-monitor"),request:__("Request","query-monitor"),query:__("Query","query-monitor"),template:__("Template","query-monitor"),shutdown:__("Shutdown","query-monitor")},Or=({data:e})=>{const{filters:n,setFilter:t}=Ge(et),r=n.component??"",{timelineHiddenCategories:i,setTimelineHiddenCategories:o}=Ge(Pe),l=new Set(i),a=e.db_queries?.data,s=e.http?.data,c=e.php_errors?.data,u=e.timing?.data,d=e.logger?.data,m=e.transients?.data,h=e.doing_it_wrong?.data;if(!e.overview)return null;const p=e.overview.data,_=p.time_taken||0,f=p.actions,y=p.segments,g=[...((e,n,t,r,i,o,l)=>{const a=[];if(e)for(let s=0;se.category))],q=$t(g,e=>e.component);if(!g.length||!_)return null;const w=1e3*_,k=[...g.filter(e=>!l.has(e.category)&&(!r||!e.component||Et(e.component,r)))].sort((e,n)=>e.time-n.time),N=[];if(y){for(const[e,n]of Object.entries(y))if(void 0!==n&&Pr[e])N.push({time:n,label:Pr[e]});N.sort((e,n)=>e.time-n.time)}const x=[1,2,5,10,20,25,50,100,200,500,1e3,2e3].find(e=>Math.floor(w/e)<=6)??1e3,S=[];for(let v=0;v<=w;v+=x)S.push(v);const C={timeline:{heading:__("Timeline","query-monitor"),render:e=>{const n=e.time/w*99,t=1e3*(e.duration??0),r=t/w*100,i=null===e.duration||r<.3,o=Er[e.category],l=r>30,a=!l&&(n>60||n>100-n-r);return W(v,{children:[W("span",{className:"timeline-bar "+(i?"timeline-point":""),style:{left:`${n}%`,width:i?void 0:`${Math.max(r,.3)}%`,backgroundColor:o}}),W("span",{className:"timeline-bar-label "+(l?"timeline-bar-label-overlay":""),style:l?{left:`${n}%`,width:`${r}%`}:a?{right:100-n+"%",textAlign:"right"}:{left:`${n+(i?.3:Math.max(r,.3))}%`},children:[W("span",{className:"timeline-bar-label-text",children:void 0!==e.rowIndex?W(Tr,{targetPanel:e.panel,rowIndex:e.rowIndex,children:e.label}):e.label}),null!==e.duration&&W("span",{className:"timeline-bar-label-time",children:W(Nt,{value:t/1e3})})]})]})}}},T=W(v,{children:[W("div",{className:"timeline-header",children:W("div",{className:"timeline-filters",children:[q.length>0&&W("div",{className:"qm-filter-container",children:[W("label",{htmlFor:"qm-filter-timeline-component",className:"qm-screen-reader-text",children:__("Component","query-monitor")}),W("select",{id:"qm-filter-timeline-component",className:"qm-filter",value:r,onChange:e=>t("component",e.currentTarget.value),children:[W("option",{value:"",children:__("All components","query-monitor")}),q.map((e,n)=>W(v,{children:[W("hr",{}),e.map(e=>W("option",{value:e.key,children:e.label},`${n}-${e.key}`))]}))]})]}),b.map(e=>W("label",{className:"timeline-filter",children:[W("input",{type:"checkbox",checked:!l.has(e),onChange:()=>(e=>{const n=new Set(l);if(n.has(e))n.delete(e);else n.add(e);o([...n])})(e),style:{accentColor:Er[e]}}),$r[e]]},e))]})}),W("div",{className:"timeline-axis",children:S.map((e,n)=>W("span",{className:"timeline-tick",style:{left:e/w*100+"%"},children:W(Nt,{value:e/1e3})},n))}),N.length>0&&W("div",{className:"timeline-segments",children:N.map((e,n)=>{const t=nnull,header:T})};if(!1===QueryMonitorData)document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("wp-admin-bar-query-monitor");if(e)e.classList.add("qm-error");console.error("Query Monitor: Failed to encode output data.")});else{if(Ar=QueryMonitorData.frames,pt=Ar,QueryMonitorData.locale_data)xe(QueryMonitorData.locale_data,"query-monitor");at("overview",{render:(e,n)=>W(_r,{data:e,settings:n})}),at("timeline",{render:(e,n)=>W(Or,{data:e,settings:n})}),lt("admin",{render:(e,n)=>W(ft,{data:e,enabled:n}),data:"admin"}),lt("block_editor",{render:(e,n)=>W(Dt,{data:e,enabled:n}),data:"block_editor"}),lt("caps",{render:(e,n)=>W(Rt,{data:e,enabled:n}),data:"caps"}),lt("conditionals",{render:(e,n)=>W(Ut,{data:e,enabled:n}),data:"conditionals"}),lt("db_callers",{render:(e,n)=>W(Qt,{data:e,enabled:n}),data:"db_queries"}),lt("db_components",{render:(e,n)=>W(Bt,{data:e,enabled:n}),data:"db_queries"}),lt("db_dupes",{render:(e,n)=>W(Wt,{data:e,enabled:n}),data:"db_queries"}),lt("db_errors",{render:(e,n)=>W(Vt,{data:e,enabled:n}),data:"db_queries"}),lt("db_expensive",{render:(e,n)=>W(Jt,{data:e,enabled:n}),data:"db_queries"}),lt("db_queries",{render:(e,n)=>W(Gt,{data:e,enabled:n}),data:"db_queries"}),lt("doing_it_wrong",{render:(e,n)=>W(Yt,{data:e,enabled:n}),data:"doing_it_wrong"}),lt("environment",{render:(e,n)=>W(ir,{data:e,enabled:n}),data:"environment"}),lt("hooks",{render:(e,n)=>W(or,{data:e,enabled:n}),data:"hooks"}),lt("http",{render:(e,n)=>W(ur,{data:e,enabled:n}),data:"http"}),lt("languages",{render:(e,n)=>W(dr,{data:e,enabled:n}),data:"languages"}),lt("logger",{render:(e,n)=>W(hr,{data:e,enabled:n}),data:"logger"}),lt("multisite",{render:(e,n)=>W(pr,{data:e,enabled:n}),data:"multisite"}),lt("php_errors",{render:(e,n)=>W(fr,{data:e,enabled:n}),data:"php_errors"}),lt("request",{render:(e,n)=>W(yr,{data:e,enabled:n}),data:"request"}),lt("raw_request",{render:(e,n)=>W(gr,{data:e,enabled:n,type:"request"}),data:"raw_request"}),lt("raw_request-response",{render:(e,n)=>W(gr,{data:e,enabled:n,type:"response"}),data:"raw_request"}),lt("assets_scripts",{render:(e,n)=>W(kr,{data:e,enabled:n}),data:"assets_scripts"}),lt("assets_styles",{render:(e,n)=>W(Nr,{data:e,enabled:n}),data:"assets_styles"}),lt("response",{render:(e,n)=>W(xr,{data:e,enabled:n}),data:"response"}),lt("timing",{render:(e,n)=>W(Sr,{data:e,enabled:n}),data:"timing"}),lt("transients",{render:(e,n)=>W(Cr,{data:e,enabled:n}),data:"transients"}),Mr={render:e=>W(br,{settings:e})},ot.settings={...Mr,type:"settings"};const e={admin:"Admin",assets_scripts:"Scripts",assets_styles:"Styles",block_editor:"Block Editor",caps:"Capability Checks",doing_it_wrong:"Doing It Wrong",http:"HTTP API Calls",languages:"Languages",request:"Request",response:"Template"};Object.keys(e).forEach(e=>{lt(`${e}-concerned_hooks`,{render:(e,n)=>W(vr,{data:e,enabled:n}),data:e})}),document.addEventListener("DOMContentLoaded",function(){const e=document.getElementById("qm-fatal"),n=document.getElementById("query-monitor-container"),t=document.getElementById("wp-admin-bar-query-monitor");if(e)return void R(W(mt,{adminMenuElement:t??void 0}),e);const r=document.body.classList.contains("wp-admin"),i="rtl"===document.documentElement.dir,o=`qm-${r?"admin":"front"}-panel`,l="qm-container-position",a="qm-theme",s="qm-fabulous",c="qm-editor",u="qm-filters",d="qm-container-height",m="qm-seen",h="qm-timeline-hidden",p="qm-duration-unit",_=e=>{localStorage.setItem(o,e),localStorage.removeItem("qm-admin-container-pinned"),localStorage.removeItem("qm-front-container-pinned")},f=e=>{localStorage.setItem(l,e?"right":"")},y=e=>{localStorage.setItem(a,e)},g=e=>{if(e)localStorage.setItem(s,"1");else localStorage.removeItem(s)},b=e=>{localStorage.setItem(c,e)},v=e=>{sessionStorage.setItem(u,JSON.stringify(e))},q=e=>{localStorage.setItem(d,e.toString())},w=e=>{localStorage.setItem(m,e)},k=e=>{sessionStorage.setItem(h,JSON.stringify(e))},N=e=>{localStorage.setItem(p,e)},x=localStorage.getItem(o)??"",S="right"===localStorage.getItem(l),C=localStorage.getItem(c)??"",T=localStorage.getItem(a)??"auto",E=!!localStorage.getItem(s),$=sessionStorage.getItem(u),P=$?JSON.parse($):{},O=localStorage.getItem(d),M=O?parseFloat(O):null,A=localStorage.getItem(m)??"",j=sessionStorage.getItem(h),I=j?JSON.parse(j):[],L=localStorage.getItem(p)??"s",H={...QueryMonitorData.settings,ajaxurl:QueryMonitorData.l10n.ajaxurl,admin_url:QueryMonitorData.l10n.admin_url,auth_nonce:QueryMonitorData.l10n.auth_nonce,file_path_map:QueryMonitorData.l10n.file_path_map,file_link_format:QueryMonitorData.l10n.file_link_format,abspath:QueryMonitorData.l10n.abspath,contentpath:QueryMonitorData.l10n.contentpath};if(!n)return;const F=n.attachShadow({mode:"open"}),D=document.createElement("div");F.appendChild(D);const U=()=>{R(W(ut,{isWpAdmin:r,isRtl:i,active:x,adminMenuElement:t??void 0,cssUrl:n.dataset.cssUrl,menu:QueryMonitorData.menu,panel_menu:QueryMonitorData.panel_menu,data:QueryMonitorData.data,settings:H,side:S,colorScheme:H.color_scheme,theme:T,fabulous:E,editor:C,filters:P,containerHeight:M,onPanelChange:_,onContainerResize:q,onSideChange:f,onThemeChange:y,onFabulousChange:g,onEditorChange:b,onFiltersChange:v,seen:A,onSeenChange:w,timelineHiddenCategories:I,onTimelineHiddenChange:k,durationUnit:L,onDurationUnitChange:N,isFolded:document.body.classList.contains("folded"),isAutoFold:document.body.classList.contains("auto-fold"),isFullscreenMode:document.body.classList.contains("is-fullscreen-mode")}),D)};U();new MutationObserver(U).observe(document.body,{attributes:!0,attributeFilter:["class"]})})}var Mr,Ar; diff --git a/query-monitor/classes/ArrayAccess.php b/query-monitor/classes/ArrayAccess.php new file mode 100644 index 0000000000..b142aeaf24 --- /dev/null +++ b/query-monitor/classes/ArrayAccess.php @@ -0,0 +1,57 @@ + + */ +trait QM_ArrayAccess { + /** + * @param mixed $offset + * @param mixed $value + * @return void + */ + #[ReturnTypeWillChange] + final public function offsetSet( $offset, $value ) { + if ( is_string( $offset ) ) { + $this->$offset = $value; + } + } + + /** + * @param mixed $offset + * @return bool + */ + #[ReturnTypeWillChange] + final public function offsetExists( $offset ) { + return is_string( $offset ) && isset( $this->$offset ); + } + + /** + * @param mixed $offset + * @return void + */ + #[ReturnTypeWillChange] + final public function offsetUnset( $offset ) { + if ( is_string( $offset ) ) { + unset( $this->$offset ); + } + } + + /** + * @param mixed $offset + * @return mixed + */ + #[ReturnTypeWillChange] + final public function &offsetGet( $offset ) { + if ( is_string( $offset ) ) { + return $this->$offset; + } + $null = null; + return $null; + } +} diff --git a/query-monitor/classes/Collector.php b/query-monitor/classes/Collector.php index d905317202..7861dd122a 100644 --- a/query-monitor/classes/Collector.php +++ b/query-monitor/classes/Collector.php @@ -61,7 +61,7 @@ public function set_up() {} * @return string */ final public function id() { - return $this->id; + return "qm-{$this->id}"; } /** diff --git a/query-monitor/classes/Collector_Assets.php b/query-monitor/classes/Collector_Assets.php index 40c64beb05..bbb847255b 100644 --- a/query-monitor/classes/Collector_Assets.php +++ b/query-monitor/classes/Collector_Assets.php @@ -30,9 +30,9 @@ */ abstract class QM_Collector_Assets extends QM_DataCollector { /** - * @var array + * @var ?array */ - protected $header = array(); + protected $header = null; /** * @var array @@ -106,7 +106,7 @@ public function action_head() { * @return void */ public function action_print_footer_scripts() { - if ( empty( $this->header ) ) { + if ( null === $this->header ) { return; } @@ -129,7 +129,7 @@ public function process() { $modules = self::get_script_modules(); } - if ( empty( $this->header ) && empty( $this->footer ) && empty( $modules ) ) { + if ( null === $this->header && empty( $this->footer ) && empty( $modules ) ) { return; } diff --git a/query-monitor/classes/Data.php b/query-monitor/classes/Data.php index b6cccd86e0..2c1259201c 100644 --- a/query-monitor/classes/Data.php +++ b/query-monitor/classes/Data.php @@ -8,6 +8,8 @@ */ #[AllowDynamicProperties] abstract class QM_Data implements \ArrayAccess { + use QM_ArrayAccess; + /** * @var array */ @@ -22,50 +24,4 @@ abstract class QM_Data implements \ArrayAccess { * @var ?array */ public $concerned_actions = null; - - /** - * @param mixed $offset - * @param mixed $value - * @return void - */ - #[ReturnTypeWillChange] - final public function offsetSet( $offset, $value ) { - if ( is_string( $offset ) ) { - $this->$offset = $value; - } - } - - /** - * @param mixed $offset - * @return bool - */ - #[ReturnTypeWillChange] - final public function offsetExists( $offset ) { - return is_string( $offset ) && isset( $this->$offset ); - } - - /** - * @param mixed $offset - * @return void - */ - #[ReturnTypeWillChange] - final public function offsetUnset( $offset ) { - // @TODO might be able to no-op this - if ( is_string( $offset ) ) { - unset( $this->$offset ); - } - } - - /** - * @param mixed $offset - * @return mixed - */ - #[ReturnTypeWillChange] - final public function &offsetGet( $offset ) { - if ( is_string( $offset ) ) { - return $this->$offset; - } - $null = null; - return $null; - } } diff --git a/query-monitor/classes/Util.php b/query-monitor/classes/Util.php index deaae535f9..e46d7ad7e3 100644 --- a/query-monitor/classes/Util.php +++ b/query-monitor/classes/Util.php @@ -645,7 +645,7 @@ public static function shorten_fqn( $fqn ) { /** * Helper function for JSON encoding data and formatting it in a consistent manner. * - * @deprecated Use json_encode() directly with the appropriate options instead. + * @deprecated Use wp_json_encode() directly with the appropriate options instead. * * @param mixed $data The data to be JSON encoded. * @return string The JSON encoded data. @@ -653,7 +653,7 @@ public static function shorten_fqn( $fqn ) { public static function json_format( $data ) { $json_options = JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES; - $json = json_encode( $data, $json_options ); + $json = wp_json_encode( $data, $json_options ); if ( false === $json ) { return ''; diff --git a/query-monitor/data/block_editor/post_block.php b/query-monitor/data/block_editor/post_block.php index 241136d6dd..75152fe338 100644 --- a/query-monitor/data/block_editor/post_block.php +++ b/query-monitor/data/block_editor/post_block.php @@ -10,7 +10,12 @@ * @package query-monitor */ -class QM_Data_Post_Block { +/** + * @implements \ArrayAccess + */ +class QM_Data_Post_Block implements \ArrayAccess { + use QM_ArrayAccess; + /** * @var string|null */ diff --git a/query-monitor/data/callback.php b/query-monitor/data/callback.php index e0434bb0e6..c0e6d9dc80 100644 --- a/query-monitor/data/callback.php +++ b/query-monitor/data/callback.php @@ -10,7 +10,12 @@ * @package query-monitor */ -class QM_Data_Callback { +/** + * @implements \ArrayAccess + */ +class QM_Data_Callback implements \ArrayAccess { + use QM_ArrayAccess; + /** * @var 'function'|'method'|'static_method'|'closure'|'invokable'|'lambda'|'unknown'|'unknown_closure' */ diff --git a/query-monitor/data/callsite.php b/query-monitor/data/callsite.php index 695c6cea17..4f79eba088 100644 --- a/query-monitor/data/callsite.php +++ b/query-monitor/data/callsite.php @@ -10,7 +10,12 @@ * @package query-monitor */ -class QM_Data_Callsite { +/** + * @implements \ArrayAccess + */ +class QM_Data_Callsite implements \ArrayAccess { + use QM_ArrayAccess; + /** * @var string */ diff --git a/query-monitor/data/frame.php b/query-monitor/data/frame.php index eec91374a6..1b6089f2e4 100644 --- a/query-monitor/data/frame.php +++ b/query-monitor/data/frame.php @@ -10,7 +10,12 @@ * @package query-monitor */ -class QM_Data_Stack_Frame { +/** + * @implements \ArrayAccess + */ +class QM_Data_Stack_Frame implements \ArrayAccess { + use QM_ArrayAccess; + /** * @var string */ diff --git a/query-monitor/data/http/http_request.php b/query-monitor/data/http/http_request.php index 592bbe55ac..454ab2307a 100644 --- a/query-monitor/data/http/http_request.php +++ b/query-monitor/data/http/http_request.php @@ -10,7 +10,12 @@ * @package query-monitor */ -class QM_Data_HTTP_Request { +/** + * @implements \ArrayAccess + */ +class QM_Data_HTTP_Request implements \ArrayAccess { + use QM_ArrayAccess; + /** * @phpstan-var array{ * method: string, diff --git a/query-monitor/data/http/http_response.php b/query-monitor/data/http/http_response.php index 40d0309702..b8c9b63299 100644 --- a/query-monitor/data/http/http_response.php +++ b/query-monitor/data/http/http_response.php @@ -10,7 +10,12 @@ * @package query-monitor */ -class QM_Data_HTTP_Response { +/** + * @implements \ArrayAccess + */ +class QM_Data_HTTP_Response implements \ArrayAccess { + use QM_ArrayAccess; + /** * @var int */ diff --git a/query-monitor/data/php_error.php b/query-monitor/data/php_error.php index c5615b48a0..7c4e19f2dd 100644 --- a/query-monitor/data/php_error.php +++ b/query-monitor/data/php_error.php @@ -10,7 +10,12 @@ * @package query-monitor */ -class QM_Data_PHP_Error { +/** + * @implements \ArrayAccess + */ +class QM_Data_PHP_Error implements \ArrayAccess { + use QM_ArrayAccess; + /** * @var int */ diff --git a/query-monitor/dispatchers/AJAX.php b/query-monitor/dispatchers/AJAX.php index e95740b753..642fd9fb32 100644 --- a/query-monitor/dispatchers/AJAX.php +++ b/query-monitor/dispatchers/AJAX.php @@ -128,7 +128,6 @@ public function output_fatal( $message, array $e ): void { header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) ); } - // @TODO echo wp_json_encode( array( 'code' => 'qm_fatal', diff --git a/query-monitor/dispatchers/Html.php b/query-monitor/dispatchers/Html.php index e6a3796349..008c807652 100644 --- a/query-monitor/dispatchers/Html.php +++ b/query-monitor/dispatchers/Html.php @@ -231,10 +231,15 @@ public function dispatch() { $this->before_output(); - // Output non-client-side rendered panels outside the React container + // Output server-side rendered panels outside the React container. + // All outputters get a fallback container so that third-party plugins + // which extend a client-side rendered base class (e.g. QM_Output_Html_Logger) + // still have their PHP output available for the PhpPanelFallback component. echo '
'; foreach ( $this->outputters as $id => $output ) { - if ( ! $output::$client_side_rendered ) { + $html = $output->get_output(); + + if ( '' !== $html ) { printf( "\n" . '' . "\n", esc_html( $id ) @@ -244,7 +249,7 @@ public function dispatch() { "\n" . '
' . "\n", esc_html( $id ) ); - $output->output(); + echo $html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo "\n" . '
' . "\n"; printf( @@ -328,11 +333,11 @@ protected function before_output() { ); } - if ( ( ! empty( $collector->concerned_filters ) || ! empty( $collector->concerned_actions ) ) && isset( $this->panel_menu[ $output_id ] ) ) { + if ( ( ! empty( $collector->concerned_filters ) || ! empty( $collector->concerned_actions ) ) && isset( $this->panel_menu[ $collector->id() ] ) ) { $count = count( $collector->concerned_filters ) + count( $collector->concerned_actions ); - $this->panel_menu[ $output_id ]['children'][ $output_id . '-concerned_hooks' ] = array( - 'id' => $collector->id() . '-concerned_hooks', - 'panel' => $collector->id() . '-concerned_hooks', + $this->panel_menu[ $collector->id() ]['children'][ $collector->id . '-concerned_hooks' ] = array( + 'id' => $collector->id . '-concerned_hooks', + 'panel' => $collector->id . '-concerned_hooks', 'title' => __( 'Hooks in Use', 'query-monitor' ), 'count' => $count, ); @@ -403,16 +408,21 @@ protected function before_output() { 'abspath' => QM_Util::normalize_path( ABSPATH ), 'contentpath' => QM_Util::normalize_path( dirname( WP_CONTENT_DIR ) . '/' ), ], - 'number_format' => $wp_locale->number_format, + 'number_format' => array( + 'thousands_sep' => html_entity_decode( $wp_locale->number_format['thousands_sep'] ), + 'decimal_point' => html_entity_decode( $wp_locale->number_format['decimal_point'] ), + ), 'locale_data' => self::get_script_locale_data(), ); $this->output_assets(); + $encoded = wp_json_encode( $json, JSON_UNESCAPED_SLASHES | JSON_HEX_TAG ); + wp_print_inline_script_tag( sprintf( 'var QueryMonitorData = %s;', - json_encode( $json, JSON_UNESCAPED_SLASHES ) + false !== $encoded ? $encoded : 'false' ), array( 'id' => 'query-monitor-inline-data', @@ -642,7 +652,7 @@ public function output_fatal( $error, array $e ): void { printf( '
  • %s
  • ', - QM_Output_Html::output_filename( $name, $frame['file'], $frame['line'] ) + QM_Output_Html::output_filename( $name, $frame['file'] ?? '', $frame['line'] ?? 0 ) ); // WPCS: XSS ok. } echo ''; diff --git a/query-monitor/dispatchers/REST.php b/query-monitor/dispatchers/REST.php index 10f257ea20..5906dc86f4 100644 --- a/query-monitor/dispatchers/REST.php +++ b/query-monitor/dispatchers/REST.php @@ -94,7 +94,7 @@ public function output_fatal( $message, array $e ): void { header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) ); } - echo json_encode( + echo wp_json_encode( array( 'code' => 'qm_fatal', 'message' => $message, diff --git a/query-monitor/output/Headers.php b/query-monitor/output/Headers.php index 6dbec57516..277f0e7457 100644 --- a/query-monitor/output/Headers.php +++ b/query-monitor/output/Headers.php @@ -16,7 +16,7 @@ public function output() { foreach ( $this->get_output() as $key => $value ) { if ( ! is_scalar( $value ) ) { - $value = json_encode( $value ); + $value = wp_json_encode( $value ); } # Remove illegal characters (Header value may not contain NUL bytes) diff --git a/query-monitor/output/headers/php_errors.php b/query-monitor/output/headers/php_errors.php index 7da30ce915..7e892fa267 100644 --- a/query-monitor/output/headers/php_errors.php +++ b/query-monitor/output/headers/php_errors.php @@ -49,7 +49,7 @@ public function get_output() { ); $key = sprintf( 'error-%d', $count ); - $headers[ $key ] = json_encode( $output_error ); + $headers[ $key ] = wp_json_encode( $output_error ); } return array_merge( diff --git a/query-monitor/output/html/assets.php b/query-monitor/output/html/assets.php index d05381e5b5..0d4e15cdbc 100644 --- a/query-monitor/output/html/assets.php +++ b/query-monitor/output/html/assets.php @@ -53,10 +53,6 @@ public function admin_menu( array $menu ) { /** @var QM_Data_Assets $data */ $data = $this->collector->get_data(); - if ( empty( $data->assets ) ) { - return $menu; - } - $type_label = $this->get_type_labels(); $args = array( diff --git a/query-monitor/output/html/db_callers.php b/query-monitor/output/html/db_callers.php index 14a49b24cf..1b3bd4e398 100644 --- a/query-monitor/output/html/db_callers.php +++ b/query-monitor/output/html/db_callers.php @@ -47,7 +47,7 @@ public function panel_menu( array $menu ) { /** @var QM_Data_DB_Queries $dbq_data */ $dbq_data = $dbq->get_data(); if ( ! empty( $dbq_data->rows ) ) { - $menu['db_queries']['children'][] = $this->menu( array( + $menu['qm-db_queries']['children'][] = $this->menu( array( 'title' => esc_html__( 'Queries by Caller', 'query-monitor' ), ) ); } diff --git a/query-monitor/output/html/db_components.php b/query-monitor/output/html/db_components.php index 968589479e..0633e71d8d 100644 --- a/query-monitor/output/html/db_components.php +++ b/query-monitor/output/html/db_components.php @@ -47,7 +47,7 @@ public function panel_menu( array $menu ) { /** @var QM_Data_DB_Queries $dbq_data */ $dbq_data = $dbq->get_data(); if ( ! empty( $dbq_data->rows ) && ! empty( $dbq_data->has_trace ) ) { - $menu['db_queries']['children'][] = $this->menu( array( + $menu['qm-db_queries']['children'][] = $this->menu( array( 'title' => esc_html__( 'Queries by Component', 'query-monitor' ), ) ); } diff --git a/query-monitor/output/html/db_dupes.php b/query-monitor/output/html/db_dupes.php index 57b67df478..5f67b2242c 100644 --- a/query-monitor/output/html/db_dupes.php +++ b/query-monitor/output/html/db_dupes.php @@ -64,7 +64,7 @@ public function admin_menu( array $menu ) { public function panel_menu( array $menu ) { $id = $this->collector->id(); if ( isset( $menu[ $id ] ) ) { - $menu['db_queries']['children'][] = $menu[ $id ]; + $menu['qm-db_queries']['children'][] = $menu[ $id ]; unset( $menu[ $id ] ); } diff --git a/query-monitor/output/html/db_queries.php b/query-monitor/output/html/db_queries.php index 4380bb6354..4c74181079 100644 --- a/query-monitor/output/html/db_queries.php +++ b/query-monitor/output/html/db_queries.php @@ -127,20 +127,21 @@ public function admin_menu( array $menu ) { ) ); if ( $errors ) { - $id = 'db_errors'; - $menu[ $id ] = $this->menu( array( - 'id' => $id, - 'panel' => $id, + $menu['qm-db_errors'] = $this->menu( array( + 'id' => 'db_errors', + 'panel' => 'db_errors', 'title' => esc_html__( 'Database Errors', 'query-monitor' ), 'warning_count' => count( $errors ), + 'meta' => [ + 'classname' => 'qm-warning', + ], ) ); } if ( $expensive ) { - $id = 'db_expensive'; - $menu[ $id ] = $this->menu( array( - 'id' => $id, - 'panel' => $id, + $menu['qm-db_expensive'] = $this->menu( array( + 'id' => 'db_expensive', + 'panel' => 'db_expensive', 'title' => esc_html__( 'Slow Queries', 'query-monitor' ), 'warning_count' => count( $expensive ), ) ); @@ -156,9 +157,9 @@ public function admin_menu( array $menu ) { */ public function panel_menu( array $menu ) { foreach ( array( 'errors', 'expensive' ) as $sub ) { - $id = 'db_' . $sub; + $id = 'qm-db_' . $sub; if ( isset( $menu[ $id ] ) ) { - $menu['db_queries']['children'][] = $menu[ $id ]; + $menu['qm-db_queries']['children'][] = $menu[ $id ]; unset( $menu[ $id ] ); } } diff --git a/query-monitor/output/html/headers.php b/query-monitor/output/html/headers.php index 8fca35aebb..b18f0b0f6f 100644 --- a/query-monitor/output/html/headers.php +++ b/query-monitor/output/html/headers.php @@ -44,16 +44,16 @@ public function name() { * @return array */ public function panel_menu( array $menu ) { - if ( ! isset( $menu['request'] ) ) { + if ( ! isset( $menu['qm-request'] ) ) { return $menu; } $ids = array( - $this->collector->id() => __( 'Request Headers', 'query-monitor' ), - $this->collector->id() . '-response' => __( 'Response Headers', 'query-monitor' ), + $this->collector->id => __( 'Request Headers', 'query-monitor' ), + $this->collector->id . '-response' => __( 'Response Headers', 'query-monitor' ), ); foreach ( $ids as $id => $title ) { - $menu['request']['children'][] = array( + $menu['qm-request']['children'][] = array( 'id' => $id, 'panel' => $id, 'title' => esc_html( $title ), diff --git a/query-monitor/query-monitor.php b/query-monitor/query-monitor.php index 71a735178b..1aab23c6d6 100644 --- a/query-monitor/query-monitor.php +++ b/query-monitor/query-monitor.php @@ -10,7 +10,7 @@ * * Plugin Name: Query Monitor * Description: The developer tools panel for WordPress and WooCommerce. - * Version: 4.0.0 + * Version: 4.0.6 * Plugin URI: https://querymonitor.com/ * Author: John Blackbourn * Author URI: https://querymonitor.com/ @@ -36,7 +36,7 @@ exit; } -define( 'QM_VERSION', '4.0.0' ); +define( 'QM_VERSION', '4.0.6' ); // This must be required before vendor/autoload.php so QM can serve its own message about PHP compatibility. require_once __DIR__ . '/classes/PHP.php'; diff --git a/query-monitor/readme.txt b/query-monitor/readme.txt index 6c0da1ed12..87eaf00b5d 100644 --- a/query-monitor/readme.txt +++ b/query-monitor/readme.txt @@ -3,7 +3,7 @@ Contributors: johnbillion Tags: debug, debug-bar, development, performance, query monitor Tested up to: 6.9 -Stable tag: 4.0.0 +Stable tag: 4.0.6 License: GPL v2 or later Donate link: https://github.com/sponsors/johnbillion diff --git a/query-monitor/vendor/composer/autoload_static.php b/query-monitor/vendor/composer/autoload_static.php index 221a726f1d..2ea5fd6c2c 100644 --- a/query-monitor/vendor/composer/autoload_static.php +++ b/query-monitor/vendor/composer/autoload_static.php @@ -11,6 +11,7 @@ class ComposerStaticInitbf686e2da57abafb4cdcd93464255242 'Debug_Bar_Panel' => __DIR__ . '/../..' . '/classes/debug_bar_panel.php', 'QM' => __DIR__ . '/../..' . '/classes/QM.php', 'QM_Activation' => __DIR__ . '/../..' . '/classes/Activation.php', + 'QM_ArrayAccess' => __DIR__ . '/../..' . '/classes/ArrayAccess.php', 'QM_Backtrace' => __DIR__ . '/../..' . '/classes/Backtrace.php', 'QM_Backtrace_Frame' => __DIR__ . '/../..' . '/classes/Backtrace_Frame.php', 'QM_CLI' => __DIR__ . '/../..' . '/classes/CLI.php', diff --git a/query-monitor/vendor/composer/installed.php b/query-monitor/vendor/composer/installed.php index b2dc38e59b..b84adbdd68 100644 --- a/query-monitor/vendor/composer/installed.php +++ b/query-monitor/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'johnbillion/query-monitor', 'pretty_version' => 'dev-release', 'version' => 'dev-release', - 'reference' => 'd1a5b908e8b5085d7db341d92be2a86137dd4ec1', + 'reference' => 'fa50847174753b3004d64ec46a17f448581bb6a3', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'johnbillion/query-monitor' => array( 'pretty_version' => 'dev-release', 'version' => 'dev-release', - 'reference' => 'd1a5b908e8b5085d7db341d92be2a86137dd4ec1', + 'reference' => 'fa50847174753b3004d64ec46a17f448581bb6a3', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/query-monitor/wp-content/db.php b/query-monitor/wp-content/db.php index 5ca5a5483c..4f4abdfc56 100644 --- a/query-monitor/wp-content/db.php +++ b/query-monitor/wp-content/db.php @@ -2,7 +2,7 @@ /** * Plugin Name: Query Monitor Database Class (Drop-in) * Description: Database drop-in for Query Monitor, the developer tools panel for WordPress and WooCommerce. - * Version: 4.0.0 + * Version: 4.0.6 * Plugin URI: https://querymonitor.com/ * Author: John Blackbourn * Author URI: https://querymonitor.com/ diff --git a/search/search-dev-tools/package-lock.json b/search/search-dev-tools/package-lock.json index 5b1a2fd6ab..7735011779 100644 --- a/search/search-dev-tools/package-lock.json +++ b/search/search-dev-tools/package-lock.json @@ -47,9 +47,9 @@ } }, "node_modules/@automattic/eslint-plugin-wpvip": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@automattic/eslint-plugin-wpvip/-/eslint-plugin-wpvip-1.2.0.tgz", - "integrity": "sha512-pW94RykjqZfU/W/HHjf/RIZcUZLxtoVAk48F6tgY+Wz5W4i/R3mYmquuSTeJ8fBPSxHrnxb00VWxyK0akyd+Fw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@automattic/eslint-plugin-wpvip/-/eslint-plugin-wpvip-1.2.1.tgz", + "integrity": "sha512-WjudJ+ZBFfTND7Jo+v/CC4zWX/X4gVVvbTb6oBAjNXLf0tpaExfV6cgh+HBX/U0qT8juxr/30IyIJyklIzQKgg==", "dev": true, "license": "GPL-2.0+", "dependencies": {