PluginProbe
Code Engine – PHP Snippets, AI Functions & Automation for WordPress / trunk
Code Engine – PHP Snippets, AI Functions & Automation for WordPress vtrunk
0.5.6 0.5.5 0.5.4 0.5.3 0.5.2 0.5.1 0.5.0 0.4.9 0.4.8 0.4.7 0.4.6 trunk 0.0.1 0.0.2 0.2.8 0.2.9 0.3.0 0.3.1 0.3.2 0.3.3 0.3.4 0.3.5 0.3.6 0.3.7 0.3.8 All 32 releases
code-engine / app / index.js

index.js in Code Engine – PHP Snippets, AI Functions & Automation for WordPress trunk, at app/index.js

2 lines 415.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*! For license information please see index.js.LICENSE.txt */
2 (()=>{"use strict";var e,t={4689:(e,t,n)=>{var r,o,a,i,c,l,s,u,d,f,p,h,m,g,y=n(5072),v=n(7665),b=n(2564),w=n(8069),E=n(7097),x=n(8696),S=n(7039),k=n(4536),R=n(5263),T=n(6913),N=n(2665),O=n(4547),P=n(3676),I=n(9296),L=n(4461),A=n(7213),C=n(6639),j=window.mwcode_snippet_vault.prefix,M=window.mwcode_snippet_vault.domain,D=window.mwcode_snippet_vault.rest_url.replace(/\/+$/,""),G=window.mwcode_snippet_vault.api_url.replace(/\/+$/,""),F=window.mwcode_snippet_vault.plugin_url.replace(/\/+$/,""),z="1"===window.mwcode_snippet_vault.is_pro,U=z&&"1"===window.mwcode_snippet_vault.is_registered,B=window.mwcode_snippet_vault.rest_nonce,H=window.mwcode_snippet_vault.options,W=n(2109),Y=n(197),V=n(1686);function q(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var K=(0,V.i7)(r||(r=q(["\n to { transform: rotate(360deg); }\n"]))),J=V.Ay.div(o||(o=q(['\n position: relative;\n /* No rule above it. The note is quiet enough to sit at the end on its own, and\n a line across the page announced it as another section — so the gap has to\n do that work instead, and has to be big enough to read as one.\n\n Note that StyledViewArea above carries margin: -18px, which bleeds the board\n out to the panel edges and takes 18px off whatever this asks for — so what\n lands on screen is 18px less than the number here. */\n margin: 35px 2px 0;\n padding: 0 34px 2px 0;\n\n p {\n margin: 0;\n /* Long enough to hold the note in three lines at full width, short enough\n that the eye still finds the next line on a wide screen. */\n max-width: 104ch;\n font-size: 12.5px;\n line-height: 1.65;\n color: rgba(255, 255, 255, 0.62);\n }\n\n a {\n color: #7dedff;\n text-decoration: none;\n }\n\n a:hover { text-decoration: underline; }\n\n /* NekoIntro appended this to external links; the plain paragraph that replaced\n it keeps the habit rather than dropping the cue. */\n a[target="_blank"]::after {\n content: \' ↗\';\n font-size: 0.85em;\n opacity: 0.75;\n }\n\n .intro-fold {\n position: absolute;\n top: -4px;\n right: 0;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 17px;\n line-height: 1;\n border-radius: 7px;\n cursor: pointer;\n color: rgba(255, 255, 255, 0.35);\n background: transparent;\n border: 1px solid transparent;\n transition: background 0.15s ease, color 0.15s ease;\n }\n\n .intro-fold:hover {\n color: white;\n background: rgba(255, 255, 255, 0.12);\n }\n\n .intro-fold:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.92);\n outline-offset: 2px;\n }\n\n &.is-folded {\n padding-right: 0;\n padding-bottom: 0;\n }\n\n /* Folded, all that is left is the way back in — a full-width strip with a\n single "?" on it. A pill carrying the whole sentence was still a sentence,\n which is what folding it was meant to get rid of; a bar that spans the board\n reads as a lid on something rather than as another line to read. */\n .intro-peek {\n display: block;\n width: 100%;\n font-family: inherit;\n font-size: 13px;\n font-weight: 600;\n line-height: 1;\n padding: 9px 0;\n border-radius: 10px;\n cursor: pointer;\n color: rgba(255, 255, 255, 0.42);\n background: rgba(255, 255, 255, 0.05);\n border: 1px solid rgba(255, 255, 255, 0.11);\n transition: background 0.15s ease, color 0.15s ease;\n }\n\n .intro-peek:hover { color: white; background: rgba(255, 255, 255, 0.12); }\n\n /* Same ring as focusRing below, written out because that const is declared\n after this one and a template literal is evaluated where it is written. */\n .intro-peek:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.92);\n outline-offset: 2px;\n box-shadow: none;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .intro-fold, .intro-peek { transition: none; }\n }\n']))),$=V.Ay.div(a||(a=q(['\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n\n /* Named, not a bare "span". NekoButton puts its label in a span of its own, so\n a descendant selector reached inside the button and greyed the label — a red\n button with unreadable text on it. */\n .action-note {\n font-size: 12px;\n line-height: 1.5;\n color: var(--neko-gray-60, rgba(0, 0, 0, 0.55));\n }\n']))),X="\n &:focus-visible {\n outline: 2px solid rgba(255, 255, 255, 0.92);\n outline-offset: 2px;\n box-shadow: none;\n }\n",Q="\n display: flex;\n align-items: baseline;\n gap: 10px;\n flex-wrap: wrap;\n padding: 0 2px 7px;\n margin-bottom: 11px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.12);\n\n h3 {\n display: flex;\n align-items: center;\n gap: 7px;\n margin: 0;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.82);\n }\n\n .head-note {\n font-size: 11.5px;\n color: rgba(255, 255, 255, 0.55);\n }\n",Z=V.Ay.div(i||(i=q(["\n display: grid;\n /* 340px is what a card needs for its capabilities to sit two-by-two without\n truncating. At 300px a wide screen squeezed in a fourth column and made\n every card narrower instead of wider — eleven chips ellipsised rather than\n three. The floor keeps the columns honest; 1fr still shares out the slack. */\n grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));\n gap: 12px;\n /* The 2px matches the group heading above, so cards, heading and the header\n strip at the top of the tab all share one left edge. */\n padding: 0 2px;\n"]))),ee=V.Ay.div(c||(c=q(["\n margin-top: 18px;\n\n .plugin-group + .plugin-group { margin-top: 22px; }\n\n .group-head { "," }\n\n .group-head b {\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0;\n padding: 1px 7px;\n border-radius: 999px;\n color: rgba(255, 255, 255, 0.9);\n background: rgba(255, 255, 255, 0.12);\n font-variant-numeric: tabular-nums;\n }\n\n /* The running group is the one that's working; the offer at the bottom gets a\n warmer rule so it reads as an invitation rather than a leftovers bin. */\n .plugin-group.is-active .group-head { border-bottom-color: rgba(43, 212, 125, 0.4); }\n .plugin-group.is-active .group-head b {\n color: #2bd47d;\n background: rgba(43, 212, 125, 0.16);\n }\n\n .plugin-group.is-none .group-head { border-bottom-color: rgba(255, 200, 87, 0.34); }\n .plugin-group.is-none .group-head b {\n color: #ffc857;\n background: rgba(255, 200, 87, 0.16);\n }\n"])),Q),te=V.Ay.div(l||(l=q(["\n ","\n position: relative;\n display: flex;\n flex-direction: column;\n border-radius: 12px;\n background: rgba(6, 18, 42, 0.30);\n border: 1px solid rgba(255, 255, 255, 0.14);\n overflow: hidden;\n transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;\n\n &::before {\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n width: 2px;\n background: var(--accent, transparent);\n opacity: 0.75;\n }\n\n &:hover {\n background: rgba(6, 18, 42, 0.44);\n border-color: rgba(255, 255, 255, 0.3);\n transform: translateY(-1px);\n }\n\n &.is-dormant {\n background: rgba(6, 18, 42, 0.14);\n border-style: dashed;\n border-color: rgba(255, 255, 255, 0.16);\n }\n\n /* The board already goes still when less motion is asked for; everything built\n since owes the same. Colour and border still respond to hover — it's the\n movement that's the problem, not the feedback. */\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n &:hover { transform: none; }\n .card-main img { transition: none; }\n }\n\n &.is-dormant::before { opacity: 0.3; }\n &.is-dormant img { filter: grayscale(1); opacity: 0.5; }\n &.is-dormant:hover img { filter: none; opacity: 1; }\n\n &.is-inactive img { filter: grayscale(0.4); opacity: 0.82; }\n\n .card-main {\n display: flex;\n flex-direction: column;\n padding: 15px 16px 13px 17px;\n text-decoration: none;\n flex: 1 1 auto;\n ","\n }\n\n .card-foot a { "," }\n\n .card-head {\n display: flex;\n align-items: flex-start;\n gap: 13px;\n min-width: 0;\n }\n\n /* Same tinted tile as the board: the icons are fetched from ps.w.org and a\n firewalled site would otherwise show a blank square beside each name. */\n .card-main img {\n flex: 0 0 auto;\n width: 42px;\n height: 42px;\n border-radius: 11px;\n display: block;\n background: color-mix(in srgb, var(--accent, #8fb3d9) 20%, rgba(255, 255, 255, 0.07));\n transition: filter 0.2s ease, opacity 0.2s ease;\n }\n\n .card-body {\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .card-title {\n display: flex;\n align-items: center;\n gap: 7px;\n font-size: 13.5px;\n font-weight: 650;\n line-height: 1.2;\n color: white;\n }\n\n .card-title .dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n flex: 0 0 auto;\n }\n\n .card-title .dot.on { background: #2bd47d; box-shadow: 0 0 6px rgba(43, 212, 125, 0.9); }\n .card-title .dot.off { background: rgba(255, 255, 255, 0.4); }\n\n .card-role {\n font-size: 11.5px;\n line-height: 1.45;\n color: rgba(255, 255, 255, 0.66);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* Two fixed columns, so four capabilities are always a 2x2 and every card in\n the grid ends up exactly the same height. Wrapping freely gave two, three\n or four rows depending on how long the words happened to be. */\n .card-features {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 5px;\n margin-top: 11px;\n }\n\n .card-features > span {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n min-width: 0;\n font-size: 10.5px;\n line-height: 1.2;\n padding: 4px 8px;\n border-radius: 6px;\n white-space: nowrap;\n /* the whole card is a link, so the chips have to opt out of link colour */\n color: rgba(255, 255, 255, 0.82);\n background: rgba(255, 255, 255, 0.07);\n border: 1px solid rgba(255, 255, 255, 0.09);\n }\n\n .card-features svg { flex: 0 0 auto; opacity: 0.7; }\n\n /* The three longest labels don't fit half a card; they ellipsis and the chip\n carries the full text as a tooltip. */\n .card-features em {\n font-style: normal;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n &.is-dormant .card-features span {\n color: rgba(255, 255, 255, 0.55);\n background: rgba(255, 255, 255, 0.04);\n }\n\n .card-foot {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 0 16px 13px 17px;\n }\n\n .card-family {\n flex: 1 1 auto;\n font-size: 9px;\n font-weight: 700;\n letter-spacing: 0.13em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.32);\n }\n\n .card-foot a {\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n text-decoration: none;\n padding: 4px 11px;\n border-radius: 7px;\n color: rgba(255, 255, 255, 0.72);\n border: 1px solid rgba(255, 255, 255, 0.16);\n transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;\n }\n\n .card-foot a:hover {\n background: rgba(255, 255, 255, 0.14);\n color: white;\n }\n\n .card-foot a.pro {\n color: #ffd48a;\n border-color: rgba(255, 186, 66, 0.4);\n }\n\n .card-foot a.pro:hover {\n background: rgba(255, 186, 66, 0.22);\n color: white;\n }\n"])),"\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n }\n",X,X),ne=V.Ay.div(s||(s=q(["\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n gap: 12px;\n /* No bottom margin of its own — the section it sits in sets the space under\n its content, the same for all five. */\n margin: 0 2px;\n"]))),re=V.Ay.div(u||(u=q(["\n display: flex;\n flex-direction: column;\n align-items: center;\n text-align: center;\n padding: 16px 16px 15px;\n border-radius: 12px;\n background: rgba(6, 18, 42, 0.30);\n border: 1px solid rgba(255, 255, 255, 0.14);\n transition: border-color 0.2s ease, background 0.2s ease;\n\n &.is-running {\n border-color: rgba(255, 255, 255, 0.34);\n background: rgba(6, 18, 42, 0.44);\n }\n\n h3 {\n margin: 0 0 10px;\n font-size: 13px;\n font-weight: 650;\n letter-spacing: 0;\n color: white;\n }\n\n .gauge-value {\n display: flex;\n align-items: baseline;\n gap: 3px;\n font-size: 26px;\n font-weight: 600;\n line-height: 1;\n font-variant-numeric: tabular-nums;\n color: white;\n }\n\n .gauge-value i {\n font-style: normal;\n font-size: 12px;\n font-weight: 500;\n color: rgba(255, 255, 255, 0.6);\n }\n\n .gauge-sub {\n margin-top: 5px;\n font-size: 11px;\n color: rgba(255, 255, 255, 0.6);\n }\n\n .verdict {\n margin-top: 10px;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.06em;\n text-transform: uppercase;\n padding: 3px 10px;\n border-radius: 999px;\n /* Before a run this slot states the target instead of sitting empty, so the\n number you're about to get already has something to be measured against. */\n color: rgba(255, 255, 255, 0.6);\n background: rgba(255, 255, 255, 0.07);\n border: 1px solid rgba(255, 255, 255, 0.12);\n }\n\n .verdict.is-fast {\n color: #2bd47d;\n background: rgba(43, 212, 125, 0.14);\n border-color: rgba(43, 212, 125, 0.4);\n }\n\n .verdict.is-fair {\n color: #ffc857;\n background: rgba(255, 200, 87, 0.14);\n border-color: rgba(255, 200, 87, 0.4);\n }\n\n .verdict.is-slow {\n color: #ff8080;\n background: rgba(255, 107, 107, 0.16);\n border-color: rgba(255, 107, 107, 0.45);\n }\n\n /* Distinct from is-slow: a slow answer is a result, no answer is a fault. */\n .verdict.is-failed {\n color: #ffd0a0;\n background: rgba(255, 143, 90, 0.16);\n border-color: rgba(255, 143, 90, 0.5);\n }\n\n .hint {\n margin: 10px 0 12px;\n font-size: 11.5px;\n line-height: 1.5;\n color: rgba(255, 255, 255, 0.62);\n }\n\n /* Pushes the button to the bottom so all three line up even when one hint\n wraps to an extra line. */\n .hint + button { margin-top: auto; }\n\n button { width: 100%; }\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n /* The gauge sweeps its arc on every one of the ten samples. NekoGauge sets\n that transition inline, so !important is the only thing that reaches it. */\n .neko-gauge path { transition: none !important; }\n }\n"]))),oe=V.Ay.div(d||(d=q(["\n /* No side margin of its own. Everything it wraps — the speed bar, the gauges,\n the phpinfo panel, the log console — already carries margin: 0 2px, and the\n section headings get the same 2px from sectionHead's padding. Adding 2px\n here as well double-inset the lot to 4px, and the override that was meant to\n cancel it named .php-body and .logs-bar, which have no side margin to\n cancel. One inset, set in one place, by the pieces themselves. */\n /* Folded, the tab is a list of rows, so it is built like one. Every heading is\n the same height whether or not it carries a button, with the same space above\n and below its text, and the rule sits at the bottom of that box — which puts\n each line exactly halfway between the title above it and the title below.\n Before this the heading kept 7px under it and 26px over the next one, so the\n rules looked stuck to the wrong titles. */\n .section-head {\n ","\n align-items: center;\n min-height: 30px;\n padding: 11px 2px;\n margin-bottom: 0;\n }\n\n .health-section + .health-section {\n margin-top: 0;\n padding-top: 0;\n }\n\n /* Opened, the section needs its content off the rule above it, and off the\n next heading below — the same 11px the headings use, so the rhythm carries\n on rather than restarting. */\n .section-head.is-open { margin-bottom: 14px; }\n .health-section.is-open { padding-bottom: 11px; }\n\n /* The overview: three ratings over six PHP values, one surface, no heading of\n its own. It is the top of the tab and it is the answer — labelling it would\n be labelling the page.\n\n A plain translucent black rather than the tinted gradient it had: it sinks\n into whatever blue is behind it instead of carrying a navy of its own, and\n the cards keep the only colour on the panel. */\n .health-top {\n display: flex;\n flex-direction: column;\n gap: 12px;\n background: #00000029;\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-top-color: rgba(255, 255, 255, 0.18);\n border-radius: 14px;\n padding: 14px;\n margin: 0 2px 12px;\n }\n\n /* The six values are supporting evidence for the three ratings above them, so\n they sit quieter — a hairline separates the two rather than a gap alone,\n which left the panel reading as two unrelated rows of boxes. */\n .health-top .php-facts {\n padding-top: 12px;\n border-top: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n /* The offer keeps a surface of its own — it is a pitch, not a section. The\n analysis body went flat once the overview took the top: two panels stacked,\n one inside the other's shadow, read as a box in a box. */\n .analysis-body { margin: 0 2px; }\n\n .analysis-offer {\n background: rgba(0, 24, 40, 0.42);\n border: 1px solid rgba(255, 255, 255, 0.12);\n border-radius: 12px;\n padding: 16px 18px;\n margin: 0 2px;\n }\n\n .analysis-offer { display: flex; align-items: center; gap: 16px; }\n .analysis-offer svg { flex: 0 0 auto; color: #ffc857; }\n .analysis-offer > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }\n .analysis-offer strong { font-size: 13.5px; font-weight: 650; color: white; }\n .analysis-offer span { font-size: 12px; line-height: 1.55; color: rgba(255, 255, 255, 0.66); }\n\n .analysis-cta {\n flex: 0 0 auto;\n margin-left: auto;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n text-decoration: none;\n padding: 8px 14px;\n border-radius: 9px;\n color: white;\n background: linear-gradient(135deg, #3f7bec, #2f5fbd);\n ","\n }\n\n /* Button first, explanation beside it — the same shape as Speed's and Errors'\n bars, and always visible for the same reason. The disclosure used to sit\n above the button as a bulleted list, which made a two-second action look\n like a form to be agreed to. */\n /* What the section says about itself when it is folded: what was found, and\n when. The count is lit the way the error summary lights its own, so the two\n folded sections read as the same kind of line. */\n .analysis-note {\n margin: 0;\n font-size: 12px;\n line-height: 1.55;\n color: rgba(255, 255, 255, 0.62);\n }\n\n .analysis-note b { color: white; font-variant-numeric: tabular-nums; }\n\n .analysis-steps {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .analysis-steps li {\n display: flex;\n align-items: center;\n gap: 11px;\n font-size: 13px;\n color: rgba(255, 255, 255, 0.36);\n }\n\n /* Each step carries its own state in the marker: waiting is a hollow ring,\n working spins, finished is a tick. Without it the list just sat there and\n the long last step looked like nothing was happening. */\n .analysis-steps i {\n position: relative;\n flex: 0 0 auto;\n width: 16px;\n height: 16px;\n border-radius: 50%;\n border: 2px solid rgba(255, 255, 255, 0.18);\n }\n\n .analysis-steps .is-done { color: rgba(255, 255, 255, 0.72); }\n .analysis-steps .is-done i {\n border-color: #2bd47d;\n background: #2bd47d;\n }\n\n /* The tick, drawn rather than fonted so it lands the same everywhere.\n Centred off the middle rather than nudged in from the corner: the glyph is\n an L rotated 45°, so its own box has to be centred first and turned second,\n or it sits low and left the way hardcoded offsets left it. The -55% lifts it\n by the half-stroke the rotation adds below the join. */\n .analysis-steps .is-done i::after {\n content: '';\n position: absolute;\n left: 50%;\n top: 50%;\n width: 4px;\n height: 8px;\n border: solid #ffffff;\n border-width: 0 2px 2px 0;\n transform: translate(-50%, -55%) rotate(45deg);\n }\n\n .analysis-steps .is-now { color: white; }\n .analysis-steps .is-now i {\n border-color: rgba(255, 200, 87, 0.25);\n border-top-color: #ffc857;\n animation: ",' 0.7s linear infinite;\n }\n\n /* Asked for less motion: the ring stops and simply shows which step is live. */\n @media (prefers-reduced-motion: reduce) {\n .analysis-steps .is-now i {\n animation: none;\n border-color: #ffc857;\n background: rgba(255, 200, 87, 0.35);\n }\n }\n\n .analysis-steps .step-note {\n margin-left: auto;\n font-size: 11px;\n color: rgba(255, 255, 255, 0.42);\n }\n\n .analysis-error {\n font-size: 12.5px;\n line-height: 1.55;\n color: #ffd0a0;\n }\n\n .analysis-error span {\n display: block;\n margin-top: 3px;\n font-size: 11.5px;\n color: rgba(255, 255, 255, 0.5);\n }\n\n .analysis-areas {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n gap: 10px;\n }\n\n /* The rating was five 7px dots and nothing else — the one thing the eye should\n catch from across the room, hidden in 35 pixels. The card now carries its own\n verdict: a tinted wash, a tinted edge, and the icon in the same colour. Read\n at a glance it is green, amber or red; read properly it still says why. */\n .analysis-area {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 11px 13px;\n border-radius: 10px;\n background:\n linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),\n var(--tone-wash, transparent);\n border: 1px solid var(--tone-edge, rgba(255, 255, 255, 0.1));\n }\n\n .analysis-area.is-good {\n --tone-wash: linear-gradient(155deg, rgba(43, 212, 125, 0.16), rgba(43, 212, 125, 0.03));\n --tone-edge: rgba(43, 212, 125, 0.32);\n }\n\n .analysis-area.is-fair {\n --tone-wash: linear-gradient(155deg, rgba(255, 200, 87, 0.16), rgba(255, 200, 87, 0.03));\n --tone-edge: rgba(255, 200, 87, 0.32);\n }\n\n .analysis-area.is-poor {\n --tone-wash: linear-gradient(155deg, rgba(255, 128, 128, 0.18), rgba(255, 128, 128, 0.03));\n --tone-edge: rgba(255, 128, 128, 0.34);\n }\n\n .analysis-area.is-good .area-name svg { color: #2bd47d; }\n .analysis-area.is-fair .area-name svg { color: #ffc857; }\n .analysis-area.is-poor .area-name svg { color: #ff8080; }\n\n /* Unrated, the card still shows its shape — name, five empty dots, and what it\n is waiting for. Dimmed enough to read as "not yet" rather than "nothing". */\n .analysis-area.is-blank {\n background: rgba(255, 255, 255, 0.025);\n border-style: dashed;\n border-color: rgba(255, 255, 255, 0.12);\n }\n .analysis-area.is-blank .area-name { color: rgba(255, 255, 255, 0.34); }\n .analysis-area.is-blank .area-label { color: rgba(255, 255, 255, 0.44); font-weight: 600; }\n .analysis-area.is-blank .area-summary { color: rgba(255, 255, 255, 0.32); }\n .analysis-area.is-blank .area-dots i { background: rgba(255, 255, 255, 0.09); }\n\n /* The same icon the section below wears, so the card that rates Speed and the\n section that measures it are visibly the same subject. */\n .area-name {\n display: flex;\n align-items: center;\n gap: 6px;\n font-size: 9.5px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.5);\n }\n\n .area-name svg { flex: 0 0 auto; opacity: 0.85; }\n\n .area-dots { display: flex; gap: 3px; margin: 2px 0 1px; }\n .area-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.16); }\n .analysis-area.is-good .area-dots i.on { background: #2bd47d; }\n .analysis-area.is-fair .area-dots i.on { background: #ffc857; }\n .analysis-area.is-poor .area-dots i.on { background: #ff8080; }\n\n /* The six values a support conversation turns on, lifted out of a 21,000px\n dump so they can be read rather than hunted for. They live in the overview\n rather than in the Environment section, next to the ratings that judge\n them — the numbers and the verdict on the numbers belong together. */\n .php-facts {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));\n gap: 8px;\n }\n\n .php-fact {\n display: flex;\n flex-direction: column;\n gap: 2px;\n padding: 8px 11px;\n border-radius: 9px;\n background: rgba(255, 255, 255, 0.04);\n border: 1px solid rgba(255, 255, 255, 0.07);\n }\n\n /* Hosts that disable phpinfo() get the labels and a dash: the shape of the\n answer is still worth showing when the answer isn\'t available. */\n .php-fact.is-blank { background: rgba(255, 255, 255, 0.02); }\n .php-fact.is-blank .fact-value { color: rgba(255, 255, 255, 0.3); }\n .php-fact.is-blank .fact-label { color: rgba(255, 255, 255, 0.34); }\n\n .fact-value {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.1;\n color: white;\n overflow-wrap: anywhere;\n }\n\n .fact-label {\n font-size: 9.5px;\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.5);\n }\n\n .area-label { font-size: 13px; font-weight: 650; color: white; }\n /* Dimmer than the verdict above it — the rating and its label are the answer,\n this is the footnote. */\n .area-summary { font-size: 11.5px; line-height: 1.5; color: rgba(255, 255, 255, 0.5); }\n\n /* Given a block of its own rather than left as a loose paragraph with two\n thirds of the panel empty beside it. The measure stays readable; the block\n fills the width, so it reads as the summary it is. */\n /* The headline sentence, so it is the brightest thing in the panel and it\n fills its box. It used to cap the text at 88ch inside a full-width block,\n which left a third of the block empty and read as a layout fault rather\n than as a measure. */\n .analysis-conclusion {\n margin: 0 0 14px;\n padding: 14px 17px;\n border-radius: 10px;\n background: rgba(255, 255, 255, 0.06);\n border-left: 3px solid rgba(255, 255, 255, 0.34);\n font-size: 14px;\n line-height: 1.55;\n color: #ffffff;\n }\n\n .analysis-conclusion span { display: block; }\n\n /* One column of folded rows. Two columns made sense when every finding was a\n block of prose; folded they are single lines, and a list of lines reads\n better stacked — and the reasoning, when opened, gets the full width. */\n .analysis-findings {\n list-style: none; margin: 0; padding: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n }\n\n .analysis-findings li {\n border-radius: 9px;\n background: rgba(255, 255, 255, 0.04);\n border-left: 3px solid rgba(255, 255, 255, 0.2);\n overflow: hidden;\n }\n\n .analysis-findings .is-high { border-left-color: #ff6b6b; }\n .analysis-findings .is-medium { border-left-color: #ffc857; }\n .analysis-findings .is-low { border-left-color: #74c0fc; }\n\n /* The whole row is the control, so the target is the line rather than a\n chevron somebody has to aim at. */\n .finding-head {\n display: flex;\n align-items: center;\n gap: 10px;\n width: 100%;\n padding: 10px 13px;\n font-family: inherit;\n text-align: left;\n background: none;\n border: 0;\n cursor: pointer;\n transition: background 0.15s ease;\n ',"\n }\n\n .finding-head:hover { background: rgba(255, 255, 255, 0.05); }\n\n .finding-head b { flex: 1 1 auto; font-size: 13px; font-weight: 650; color: white; }\n .finding-head em {\n flex: 0 0 auto;\n font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em;\n text-transform: uppercase; color: rgba(255, 255, 255, 0.42);\n }\n\n .finding-chevron {\n flex: 0 0 auto;\n width: 7px;\n height: 7px;\n border: solid rgba(255, 255, 255, 0.5);\n border-width: 0 1.5px 1.5px 0;\n transform: translateY(-2px) rotate(45deg);\n transition: transform 0.18s ease;\n }\n\n /* Anchored to the finding's own li. Left as a bare .is-open it also matched\n the section wrapper once Analysis became foldable, so opening the section\n turned every chevron upward while its finding was still shut. */\n .analysis-findings li.is-open .finding-chevron { transform: translateY(1px) rotate(-135deg); }\n\n .finding-more {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 0 13px 12px;\n }\n\n @media (prefers-reduced-motion: reduce) {\n .finding-head, .finding-chevron { transition: none; }\n }\n\n /* Three levels, not one. Everything used to be the same near-white, so the\n reasoning, the instruction and the title all carried equal weight and the\n eye had nowhere to land. The why recedes; the what-to-do steps forward\n behind an arrow in the finding's own severity colour. */\n .finding-detail {\n font-size: 12px;\n line-height: 1.55;\n color: rgba(255, 255, 255, 0.52);\n }\n\n .finding-action {\n position: relative;\n padding-left: 22px;\n font-size: 12.5px;\n line-height: 1.55;\n font-weight: 500;\n color: #ffffff;\n }\n\n .finding-action::before {\n content: '→';\n position: absolute;\n left: 2px;\n top: 0;\n font-size: 13px;\n color: rgba(255, 255, 255, 0.45);\n }\n\n .is-high .finding-action::before { color: #ff6b6b; }\n .is-medium .finding-action::before { color: #ffc857; }\n .is-low .finding-action::before { color: #74c0fc; }\n\n /* Marked as ours, deliberately. A recommendation from the people who wrote the\n analysis should say so rather than read as neutral advice. */\n .finding-plugin {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n align-self: flex-start;\n margin-top: 4px;\n padding: 5px 11px 5px 6px;\n border-radius: 8px;\n font-size: 12px;\n font-weight: 600;\n text-decoration: none;\n color: white;\n background: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.16);\n ",'\n }\n\n .finding-plugin img { width: 20px; height: 20px; border-radius: 5px; }\n .finding-plugin i {\n font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.06em;\n text-transform: uppercase; color: rgba(255, 255, 255, 0.45);\n }\n\n .analysis-clean { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.62); }\n\n /* Whichever of the disclosure, the steps, the error and the result are on\n screen, they space themselves the same way — and the first of them carries\n no top margin, so it can\'t collapse out through .analysis-body and push the\n whole section away from the rule above it.\n\n That is what made Analysis sit 16px under its rule while every other section\n sat at 14px: a margin on a first child, escaping its parent. */\n .analysis-body > * { margin-top: 0; }\n .analysis-body > * + * { margin-top: 14px; }\n\n /* Four headings each carrying a "Show tests" / "Show all values" / "Show log"\n pill was four different labels for one idea, and they read as actions rather\n than as state. A caret says foldable, says which way it is folded, and needs\n no words. */\n .section-head.is-toggle {\n position: relative;\n cursor: pointer;\n }\n\n /* The action and the caret travel together at the right end, and sit above the\n stretched hit area below — otherwise the row\'s own click handler would\n swallow the button and fold the section instead of running it. */\n .head-right {\n position: relative;\n z-index: 1;\n margin-left: auto;\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n /* NekoButton carries a 5px sibling margin for loose layouts; here the flex gap\n already spaces it, and the margin only pushes it off the right edge. */\n .head-right .neko-button { margin: 0; }\n\n .section-head.is-toggle h3 button {\n font: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n color: inherit;\n background: none;\n border: 0;\n padding: 0;\n margin: 0;\n cursor: pointer;\n transition: color 0.15s ease;\n ',"\n }\n\n /* The whole heading row is the target, without putting an <h3> inside a\n <button> — which is what it would take to make the row itself the control,\n and isn't valid markup. One real button, stretched. */\n .section-head.is-toggle h3 button::after {\n content: '';\n position: absolute;\n inset: 0;\n }\n\n .section-head.is-toggle:hover h3 button { color: white; }\n .section-head.is-toggle:hover .head-caret { border-color: rgba(255, 255, 255, 0.8); }\n\n .head-caret {\n flex: 0 0 auto;\n width: 7px;\n height: 7px;\n margin: -4px 4px 0 0;\n border: solid rgba(255, 255, 255, 0.45);\n border-width: 0 1.5px 1.5px 0;\n transform: rotate(45deg);\n transition: transform 0.2s ease, border-color 0.15s ease;\n }\n\n .head-caret.is-placeholder { visibility: hidden; }\n\n /* Dimmer than the word it introduces — an icon that matches the title's weight\n competes with it, and there are five of them down the tab. */\n .section-head h3 svg {\n flex: 0 0 auto;\n color: rgba(255, 255, 255, 0.42);\n transition: color 0.15s ease;\n }\n\n .section-head.is-toggle:hover h3 svg { color: rgba(255, 255, 255, 0.75); }\n\n @media (prefers-reduced-motion: reduce) {\n .section-head h3 svg { transition: none; }\n }\n\n /* Speed's note is its three timings rather than a sentence, once there are\n any. Same size and colour as the sentence it replaces, so the row of\n headings stays a row of headings — only the numbers are lit. */\n .head-note .speed-summary {\n display: inline-flex;\n align-items: baseline;\n gap: 14px;\n flex-wrap: wrap;\n }\n\n .head-note .speed-summary em {\n display: inline-flex;\n align-items: baseline;\n gap: 6px;\n font-style: normal;\n }\n\n .head-note .speed-summary b {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 12px;\n font-weight: 600;\n color: rgba(255, 255, 255, 0.9);\n font-variant-numeric: tabular-nums;\n }\n\n .head-note .speed-summary .is-fast b { color: #2bd47d; }\n .head-note .speed-summary .is-fair b { color: #ffc857; }\n .head-note .speed-summary .is-slow b { color: #ff8080; }\n\n .section-head.is-open .head-caret { transform: translateY(3px) rotate(-135deg); }\n\n @media (prefers-reduced-motion: reduce) {\n .head-caret,\n .section-head.is-toggle h3 button { transition: none; }\n }\n\n /* Folded, phpinfo is the six facts and nothing else. Kept mounted rather than\n unmounted so the filter effect holds on to its host element. */\n .php-rest.is-hidden { display: none; }\n\n /* Same reason as .php-rest: hidden, not unmounted, so a folded section keeps\n working rather than losing what it knows. */\n .is-hidden { display: none; }\n\n /* .speed-summary and .logs-summary used to live down here as rows of their\n own. Both are heading notes now — see .head-note in StyledHealth. */\n"])),Q,X,K,X,X,X),ae=V.Ay.div(f||(f=q(["\n margin: 0 2px;\n"]))),ie=V.Ay.div(p||(p=q(["\n display: grid;\n /* Four articles, so the column count has to divide four. auto-fill with a\n 320px floor gave three columns at this width, which left the fourth card\n alone on its own row at a third of the width — and shorter than the other\n three, because nothing shared its row to stretch it. */\n grid-template-columns: repeat(2, 1fr);\n gap: 12px;\n padding: 0 2px;\n\n @media (max-width: 860px) {\n grid-template-columns: 1fr;\n }\n"]))),ce=V.Ay.a(h||(h=q(["\n position: relative;\n display: flex;\n align-items: center;\n gap: 14px;\n padding: 14px 16px;\n background: linear-gradient(135deg,\n rgba(255, 255, 255, 0.10) 0%,\n rgba(255, 255, 255, 0.04) 100%);\n backdrop-filter: blur(8px);\n -webkit-backdrop-filter: blur(8px);\n border: 1px solid rgba(255, 255, 255, 0.18);\n border-radius: 12px;\n text-decoration: none;\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);\n ","\n transition: transform 0.2s var(--neko-ease-out, ease-out),\n box-shadow 0.2s var(--neko-ease-out, ease-out),\n background 0.2s var(--neko-ease-out, ease-out),\n border-color 0.2s var(--neko-ease-out, ease-out);\n overflow: hidden;\n\n &:hover {\n transform: translateY(-2px);\n background: linear-gradient(135deg,\n rgba(255, 255, 255, 0.18) 0%,\n rgba(255, 255, 255, 0.08) 100%);\n border-color: rgba(255, 255, 255, 0.32);\n box-shadow: 0 10px 24px rgba(0, 0, 0, 0.20);\n }\n\n .article-emoji {\n flex: 0 0 auto;\n width: 44px;\n height: 44px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 22px;\n border-radius: 12px;\n background: rgba(255, 255, 255, 0.10);\n border: 1px solid rgba(255, 255, 255, 0.14);\n }\n\n .article-body {\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .article-title {\n color: white;\n font-size: 14px;\n font-weight: 600;\n line-height: 1.25;\n letter-spacing: 0;\n }\n\n .article-blurb {\n color: rgba(255, 255, 255, 0.7);\n font-size: 12px;\n line-height: 1.4;\n }\n\n .article-arrow {\n flex: 0 0 auto;\n color: rgba(255, 255, 255, 0.55);\n font-size: 18px;\n transition: transform 0.22s var(--neko-ease-out, ease-out),\n color 0.22s var(--neko-ease-out, ease-out);\n }\n\n &:hover .article-arrow {\n transform: translateX(3px);\n color: white;\n }\n\n @media (prefers-reduced-motion: reduce) {\n transition: none;\n &:hover { transform: none; }\n .article-arrow { transition: none; }\n &:hover .article-arrow { transform: none; }\n }\n"])),X),le=V.Ay.div(m||(m=q(["\n margin: 0 2px;\n\n /* The six-value summary this used to render moved up to the tab's overview —\n see .php-facts in StyledHealth. What's left here is the dump itself. */\n .php-bar {\n display: flex;\n align-items: center;\n gap: 12px;\n flex-wrap: wrap;\n margin-bottom: 10px;\n }\n\n .php-search { width: 300px; }\n\n .php-search input { ",' }\n\n .php-count {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.6);\n font-variant-numeric: tabular-nums;\n }\n\n .php-body {\n background: rgba(0, 24, 40, 0.5);\n border: 1px solid rgba(255, 255, 255, 0.12);\n border-radius: 10px;\n box-sizing: border-box;\n width: 100%;\n padding: 2px 14px 14px;\n max-height: 620px;\n overflow-y: auto;\n /* The old rule was "max-width: 100%" with the semicolon missing, which ate\n the declaration after it and left both doing nothing. */\n overflow-x: hidden;\n }\n\n .php-body .center { max-width: 100%; }\n\n .php-body h1 {\n margin: 16px 0 2px;\n font-size: 15px;\n font-weight: 650;\n color: white;\n }\n\n /* 59 extension sections; as headings they were 26px black-on-white and each\n one shouted as loudly as the PHP version. */\n .php-body h2 {\n margin: 20px 0 6px;\n padding-bottom: 5px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.55);\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n }\n\n .php-body h2 a { color: inherit; text-decoration: none; }\n\n .php-body table {\n width: 100%;\n border-collapse: collapse;\n margin: 0;\n }\n\n .php-body td,\n .php-body th {\n padding: 5px 8px;\n font-size: 11.5px;\n line-height: 1.45;\n text-align: left;\n vertical-align: top;\n overflow-wrap: anywhere;\n }\n\n .php-body th {\n font-size: 9.5px;\n font-weight: 700;\n letter-spacing: 0.07em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.5);\n border-bottom: 1px solid rgba(255, 255, 255, 0.12);\n }\n\n .php-body td.e {\n width: 32%;\n font-weight: 600;\n color: #9fc7ff;\n }\n\n .php-body td.v {\n color: rgba(255, 255, 255, 0.86);\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n }\n\n .php-body tr:hover td { background: rgba(255, 255, 255, 0.045); }\n\n .php-body hr {\n border: 0;\n border-top: 1px solid rgba(255, 255, 255, 0.12);\n margin: 16px 0;\n }\n\n .php-body a { color: #7dedff; }\n\n .php-blank {\n padding: 26px 16px;\n text-align: center;\n font-size: 12.5px;\n color: rgba(255, 255, 255, 0.62);\n }\n\n /* The host-said-no state, laid out like the error log\'s empty states so the\n two read as the same product rather than two different apologies. */\n .php-blank.is-empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n min-height: 180px;\n padding: 32px 24px;\n }\n\n .php-blank.is-empty svg { color: #ff8f5a; }\n\n .php-blank.is-empty strong {\n font-size: 13px;\n font-weight: 600;\n color: rgba(255, 255, 255, 0.9);\n }\n\n .php-blank.is-empty span {\n font-size: 12px;\n line-height: 1.55;\n max-width: 460px;\n color: rgba(255, 255, 255, 0.62);\n }\n\n .php-blank.is-empty code {\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 11.5px;\n padding: 1px 5px;\n border-radius: 4px;\n background: rgba(255, 255, 255, 0.09);\n }\n'])),X),se={fatal:"#ff6b6b",parse:"#ff8f5a",exception:"#ffa94d",warning:"#ffc857",notice:"#74c0fc"},ue=function(e){return se[e]||"#adb5bd"},de=V.Ay.div(g||(g=q(["\n /* Same 2px as the grid, the PHP Info panel and the speed cards, so every tab\n shares one left edge. */\n margin: 0 2px;\n color: rgba(255, 255, 255, 0.92);\n\n .logs-bar {\n display: flex;\n align-items: center;\n flex-wrap: wrap;\n gap: 10px;\n margin-bottom: 10px;\n }\n\n .logs-filters {\n display: flex;\n align-items: center;\n gap: 6px;\n flex-wrap: wrap;\n }\n\n .logs-filters button {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-family: inherit;\n font-size: 11px;\n font-weight: 600;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n padding: 4px 10px;\n border-radius: 999px;\n cursor: pointer;\n color: rgba(255, 255, 255, 0.75);\n background: rgba(255, 255, 255, 0.08);\n border: 1px solid rgba(255, 255, 255, 0.16);\n transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;\n }\n\n .logs-filters button:hover {\n background: rgba(255, 255, 255, 0.16);\n color: white;\n }\n\n .logs-filters button { "," }\n\n @media (prefers-reduced-motion: reduce) {\n .logs-filters button { transition: none; }\n }\n\n /* The lit chip carries its severity's colour, so the filter you're on and the\n rows it selects are visibly the same thing. */\n .logs-filters button.is-on {\n color: white;\n background: color-mix(in srgb, var(--tone, white) 26%, transparent);\n border-color: var(--tone, rgba(255, 255, 255, 0.5));\n }\n\n .logs-filters b {\n font-variant-numeric: tabular-nums;\n color: var(--tone, inherit);\n }\n\n .logs-filters button.is-on b { color: white; }\n\n .logs-meta {\n margin-left: auto;\n font-size: 11px;\n color: rgba(255, 255, 255, 0.55);\n }\n\n .logs-console {\n background: rgba(0, 24, 40, 0.55);\n border: 1px solid rgba(255, 255, 255, 0.12);\n border-radius: 10px;\n /* Was calc(100vw - 276px): hardcoded to the width of an expanded admin menu,\n so the console hung 326px past the panel and clipped every long path.\n It's a block in a column; the column already knows how wide it is. */\n width: 100%;\n /* wp-admin doesn't set this globally, so width:100% plus the 1px border put\n the console 2px past its column. */\n box-sizing: border-box;\n max-height: 560px;\n min-height: 160px;\n overflow-y: auto;\n overflow-x: hidden;\n }\n\n .log-row {\n display: block;\n padding: 8px 12px;\n font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 12px;\n line-height: 1.5;\n }\n\n .log-row + .log-row { border-top: 1px solid rgba(255, 255, 255, 0.07); }\n\n .log-row:hover { background: rgba(255, 255, 255, 0.04); }\n\n .log-head {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 2px;\n }\n\n .log-type {\n flex: 0 0 auto;\n font-size: 9.5px;\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n padding: 2px 7px;\n border-radius: 5px;\n /* Dark text on the bright tone: white on amber failed contrast badly, and\n amber is the type you see most. */\n color: #071a2a;\n background: var(--tone);\n }\n\n .log-date {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.5);\n font-variant-numeric: tabular-nums;\n }\n\n /* Which plugin, theme or core file the path points at. Deliberately neutral —\n the severity pill owns the colour, this one only answers \"whose is it\". */\n .log-owner {\n flex: 0 0 auto;\n font-size: 10px;\n font-weight: 600;\n padding: 1px 7px;\n border-radius: 5px;\n color: rgba(255, 255, 255, 0.72);\n background: rgba(255, 255, 255, 0.09);\n border: 1px solid rgba(255, 255, 255, 0.14);\n }\n\n /* How many times this exact message was logged. The date beside it is the most\n recent one; the tooltip carries the full span. */\n .log-count {\n flex: 0 0 auto;\n font-size: 10px;\n font-weight: 700;\n padding: 1px 6px;\n border-radius: 999px;\n font-variant-numeric: tabular-nums;\n color: var(--tone);\n /* Plain values first: an unparseable color-mix drops its whole declaration,\n which would leave the badge with no background and a 0px border. */\n background: rgba(255, 255, 255, 0.1);\n border: 1px solid rgba(255, 255, 255, 0.22);\n background: color-mix(in srgb, var(--tone) 18%, transparent);\n border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);\n }\n\n /* pre-wrap, not pre: stack traces and absolute paths are longer than any\n panel, and horizontal scrolling hid the end of every one of them. */\n .log-content {\n display: block;\n color: rgba(255, 255, 255, 0.9);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n }\n\n .logs-blank {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 8px;\n min-height: 160px;\n padding: 28px 24px;\n text-align: center;\n }\n\n .logs-blank svg { color: rgba(255, 255, 255, 0.4); }\n\n .logs-blank.is-failed svg { color: #ff8f5a; }\n\n .logs-blank strong {\n font-size: 13px;\n font-weight: 600;\n color: rgba(255, 255, 255, 0.9);\n }\n\n .logs-blank span {\n font-size: 12px;\n line-height: 1.5;\n max-width: 460px;\n color: rgba(255, 255, 255, 0.62);\n }\n"])),X);function fe(e){return fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fe(e)}function pe(){pe=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==fe(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(fe(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function he(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ge(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ge(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ye=wp.element,ve=ye.useState,be=ye.useEffect,we=ye.useRef,Ee=ye.useCallback,xe="".concat(D,"/meow-common/v1"),Se={fast:"Fast",fair:"Could be better",slow:"Slow"},ke=function(e){var t=e.request,n=e.title,r=e.hint,o=e.max,a=e.good,i=e.ok,c=e.startSignal,l=e.onResult,s=me(ve(!1),2),u=s[0],d=s[1],f=me(ve([]),2),p=f[0],h=f[1],m=me(ve(!1),2),g=m[0],y=m[1],v=we(0),b=we(null),w=Ee((function(){v.current+=1,b.current&&clearTimeout(b.current),b.current=null,d(!1)}),[]),E=Ee((function(){v.current+=1,b.current&&clearTimeout(b.current),b.current=null;var e=v.current,n=[];h([]),y(!1),d(!0);var r=function(){var o,a=(o=pe().mark((function o(){var a;return pe().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=performance.now(),o.prev=1,o.next=4,(0,C.IU)("".concat(xe,"/").concat(t),{method:"POST",nonce:B});case 4:o.next=10;break;case 6:return o.prev=6,o.t0=o.catch(1),e===v.current&&(y(!0),d(!1)),o.abrupt("return");case 10:if(e===v.current){o.next=12;break}return o.abrupt("return");case 12:if(n.push(Math.round(performance.now()-a)),h([].concat(n)),!(n.length>=10)){o.next=17;break}return d(!1),o.abrupt("return");case 17:b.current=setTimeout(r,400);case 18:case"end":return o.stop()}}),o,null,[[1,6]])})),function(){var e=this,t=arguments;return new Promise((function(n,r){var a=o.apply(e,t);function i(e){he(a,n,r,i,c,"next",e)}function c(e){he(a,n,r,i,c,"throw",e)}i(void 0)}))});return function(){return a.apply(this,arguments)}}();r()}),[t]);be((function(){c&&E()}),[c,E]),be((function(){return function(){v.current+=1,b.current&&clearTimeout(b.current)}}),[]);var x,S=(x=p).length?Math.round(x.reduce((function(e,t){return e+t}),0)/x.length):0,k=p.length>0,R=k?S<=a?"fast":S<=i?"fair":"slow":null;return be((function(){l&&l(t,{title:n,avg:S,samples:p.length,verdict:R,failed:g,running:u})}),[l,t,n,S,p.length,R,g,u]),React.createElement(re,{className:u?"is-running":""},React.createElement("h3",null,n),React.createElement(Y.X,{width:168,value:S,max:o},React.createElement("span",{className:"gauge-value"},k?S:"—",k&&React.createElement("i",null,"ms")),React.createElement("span",{className:"gauge-sub"},u?"".concat(p.length," of ").concat(10):g?p.length?"Stopped after ".concat(p.length):"No response":k?"".concat(p.length," requests"):"Not measured")),React.createElement("span",{className:"verdict".concat(g?" is-failed":R?" is-".concat(R):"")},g?"Request failed":R?Se[R]:"Fast is under ".concat(a," ms")),React.createElement("p",{className:"hint"},g?"Your site did not answer. A security plugin or a server rule blocking the REST API is the usual cause.":r),React.createElement(I.M,{className:u?"danger":"primary",onClick:u?w:E},u?"Stop":g?"Try Again":k?"Start Again":"Start"))};function Re(e){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function Te(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Oe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}function Ne(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||Oe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(e,t){if(e){if("string"==typeof e)return Pe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pe(e,t):void 0}}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(n),!0).forEach((function(t){_e(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _e(e,t,n){return(t=function(e){var t=function(e){if("object"!=Re(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Re(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ae,Ce,je,Me,De,Ge,Fe,ze={intelligence:{label:"Intelligence",color:"#8ea2ff"},visuals:{label:"Media & Visuals",color:"#ffb15c"},upkeep:{label:"Upkeep",color:"#4fdcaa"},reach:{label:"Reach",color:"#ff86b4"},core:{label:"WordPress",color:"#6ea4ff"},world:{label:"The World",color:"#9db3d0"}},Ue={"meow-gallery":"#3fd6c0","meow-lightbox":"#ffc857","contact-form-block":"#c084fc","seo-engine":"#ff8459","meow-mailer":"#4ade80","social-engine":"#fb7185","ai-engine":"#ff9f45","code-engine":"#8b7ff5","media-file-renamer":"#ff8a65","wp-retina-2x":"#6ee7a0","wplr-sync":"#fbbf24","media-cleaner":"#22d3ee","database-cleaner":"#f472b6",posts:"#9fb8e8",media:"#8ecfe0",users:"#b3aee0",plugins:"#d8c39a",database:"#9dc6ad",visitors:"#a6bcd8",bots:"#b9b0d4",inboxes:"#a4cbcb",social:"#d2b0c6"},Be=[{id:"world",kind:"world",title:"Outside",icon:"external-link",accent:"#b6c2d4",blurb:"Everyone your site talks to.",items:["visitors","bots","inboxes","social"]},{id:"surface",kind:"plugin",title:"Front",icon:"eye",accent:"#5ec8d4",blurb:"What visitors and machines see.",items:["meow-gallery","meow-lightbox","contact-form-block","seo-engine","meow-mailer","social-engine"]},{id:"core",kind:"core",title:"Core",icon:"dashboard",accent:"#a9b8ff",blurb:"WordPress and AI Engine. Everything else plugs in here.",sections:[{id:"wordpress",label:"WordPress",items:["posts","media","users","plugins","database"]},{id:"ai",label:"AI",items:["ai-engine"]}]},{id:"workshop",kind:"plugin",title:"Backstage",icon:"tools",accent:"#c79ae0",blurb:"Working on it behind the scenes.",items:["code-engine","media-file-renamer","wp-retina-2x","wplr-sync","media-cleaner","database-cleaner"]}].map((function(e){var t=e.sections||[{id:e.id,label:null,items:e.items}];return Le(Le({},e),{},{sections:t,items:t.flatMap((function(e){return e.items}))})})),He={visitors:{name:"Visitors",iconName:"user",family:"world",desc:"People reading your posts, looking at your photos and filling in your forms."},bots:{name:"Search & AI",iconName:"search",family:"world",desc:"Google, Bing, and the AI assistants that read your site to answer questions about it."},inboxes:{name:"Inboxes",iconName:"mail",family:"world",desc:"Every email your site sends: resets, receipts, notifications, alerts."},social:{name:"Social Networks",iconName:"share",family:"world",desc:"X, Facebook, Instagram, LinkedIn, Pinterest and Mastodon."}},We={posts:{name:"Posts",iconName:"book",family:"core",desc:"Everything you write. The reason all the rest exists."},media:{name:"Media",iconName:"image",family:"core",desc:"Every image, video and file you have ever uploaded."},users:{name:"Users",iconName:"user",family:"core",desc:"Accounts and roles, and every email WordPress sends them."},plugins:{name:"Plugins",iconName:"plug",family:"core",desc:"Everything bolted onto WordPress. Including all of these."},database:{name:"Database",iconName:"database",family:"core",desc:"Where every last bit of it is actually stored."}},Ye=function(e){return"https://ps.w.org/".concat(e,"/assets/icon-256x256.png")},Ve={"ai-engine":{name:"AI Engine",icon:Ye("ai-engine"),role:"gives your site a brain",desc:"Your all-in-one AI suite for WordPress: chatbots, content generation, APIs and full REST support.",features:["Chatbots & Assistants","Content Generation","AI Forms & Images","MCP + REST API"]},"seo-engine":{name:"SEO Engine",icon:Ye("seo-engine"),role:"makes you findable",desc:"Tune your content for classic SEO and AI assistants, while staying fast and simple. ✌️",features:["Live Content Score","AI Suggestions","Sitemaps & Schema","AI Bot Analytics"]},"code-engine":{name:"Code Engine",icon:Ye("code-engine"),role:"lets you bend the rules",desc:"Manage and run snippets, custom functions and integrations directly from WordPress.",features:["PHP & JS Snippets","Functions as AI Tools","Scheduled Runs","REST Endpoints"]},"meow-gallery":{name:"Meow Gallery",icon:Ye("meow-gallery"),role:"shows off your photos",desc:"Beautiful, fast galleries with plenty of layouts. A lightweight alternative to bloated plugins. 💕",features:["Tiles, Masonry, Justified","Gallery Block","Retina & Lazy Load","No Bloat"]},"meow-lightbox":{name:"Meow Lightbox",icon:"https://ps.w.org/meow-lightbox/assets/icon-256x256.gif",role:"opens them beautifully",desc:"A sleek, performant lightbox with full EXIF support.",features:["EXIF & GPS Maps","Two Engines","Fully Responsive","Photographer Ready"]},"wp-retina-2x":{name:"Perfect Images",icon:Ye("wp-retina-2x"),role:"keeps every image sharp",desc:"Retina-ready imagery: manage, optimize and replace every image on your site.",features:["Image Size Control","Bulk Regenerate","Retina Support","WebP & AVIF"]},"wplr-sync":{name:"Photo Engine",icon:Ye("wplr-sync"),role:"organizes your library",desc:"Organize photos in folders and collections. Sync with Lightroom and speed up your workflow.",features:["Folders & Collections","Lightroom Sync","Galleries from Collections","Total Synchronization"]},"media-cleaner":{name:"Media Cleaner",icon:Ye("media-cleaner"),role:"takes out the trash",desc:"Detect and remove orphan files, unused entries and broken references from your library.",features:["Orphan Detection","Safe Internal Trash","Builder-Aware Scan","MCP Support"]},"database-cleaner":{name:"Database Cleaner",icon:Ye("database-cleaner"),role:"slims down your database",desc:"A friendly UI for trimming your database, even when it's grown huge.",features:["Easy & Expert Modes","One-Click Cleaning","Handles Huge Databases","Size History"]},"media-file-renamer":{name:"Media File Renamer",icon:Ye("media-file-renamer"),role:"names your files properly",desc:"Rename and move files manually, automatically or with AI, one by one or in bulk.",features:["AI Vision Naming","Bulk Renaming","Metadata Sync","Automatic Redirects"]},"contact-form-block":{name:"Contact Form Block",icon:Ye("contact-form-block"),role:"lets people write to you",desc:"A simple, fast and efficient contact form. Exactly what you need, nothing more.",features:["Gutenberg Block","No JS, No CSS","ReCAPTCHA Ready","Shortcode Too"],freeOnly:!0},"meow-mailer":{name:"Meow Mailer",icon:Ye("meow-mailer"),role:"gets your email delivered",desc:"Your essential, simple and honest SMTP plugin. Pick a provider once, and see every email.",features:["SMTP & Provider APIs","Full Email Log, Free","Automatic Fallback","Failure Alerts"],freeOnly:!0},"social-engine":{name:"Social Engine",icon:Ye("social-engine"),role:"posts everywhere for you",desc:"Schedule and automate posts across every network you care about. Free and unlimited.",features:["Visual Calendar","Six Networks","Self-Hosted","No Subscription"]}},qe=[["ai-engine","code-engine"],["ai-engine","seo-engine"],["ai-engine","media-file-renamer"],["ai-engine","media-cleaner"],["ai-engine","social-engine"],["meow-gallery","meow-lightbox"],["meow-gallery","wplr-sync"],["meow-gallery","wp-retina-2x"],["meow-lightbox","wplr-sync"],["media-file-renamer","seo-engine"],["contact-form-block","meow-mailer"],["media-cleaner","database-cleaner"],["ai-engine","database-cleaner"],["meow-gallery","database-cleaner"],["code-engine","database-cleaner"]],Ke=[[/chatbot|assistant/i,"message"],[/exif|gps|maps/i,"image"],[/vision|suggestion/i,"sparkles"],[/mcp|rest|api/i,"plug"],[/snippet|code|function|shortcode/i,"terminal"],[/schedul|runs/i,"timer-outline"],[/score|analytic|history|statistic/i,"dashboard"],[/sitemap|schema/i,"link"],[/generation|content/i,"wand"],[/form|recaptcha/i,"clipboard"],[/calendar/i,"calendar-month"],[/network|social|self-hosted|subscription/i,"share"],[/smtp|email|mail|inbox/i,"mail"],[/alert|failure|fallback/i,"warning"],[/gallery|tiles|masonry|justified|collection/i,"image-multiple-outline"],[/block/i,"view-grid"],[/lazy|bloat|performan|responsive|no js|no css/i,"zap"],[/sync/i,"sync"],[/naming|rename|metadata|tag/i,"tag"],[/redirect/i,"replay"],[/database|huge/i,"database"],[/orphan|trash|clean/i,"trash"],[/lightroom|photographer|camera/i,"image"],[/retina|webp|avif|image|thumbnail|regenerate/i,"retina"],[/scan|detect/i,"search"],[/mode|control|size|engine/i,"cog"]],Je=function(e){var t=Ke.find((function(t){return Ne(t,1)[0].test(e)}));return t?t[1]:null},$e=function(e){return qe.filter((function(t){return t.includes(e)})).map((function(t){return t[0]===e?t[1]:t[0]}))},Xe={"ai-engine":"intelligence","seo-engine":"intelligence","code-engine":"intelligence","meow-gallery":"visuals","meow-lightbox":"visuals","wp-retina-2x":"visuals","wplr-sync":"visuals","media-cleaner":"upkeep","database-cleaner":"upkeep","media-file-renamer":"upkeep","contact-form-block":"reach","meow-mailer":"reach","social-engine":"reach"},Qe=[["visitors","meow-gallery"],["visitors","meow-lightbox"],["visitors","contact-form-block"],["bots","seo-engine"],["bots","ai-engine"],["visitors","ai-engine"],["inboxes","meow-mailer"],["social","social-engine"],["visitors","users"],["meow-gallery","media"],["meow-lightbox","media"],["contact-form-block","posts"],["seo-engine","posts"],["meow-mailer","users"],["social-engine","posts"],["ai-engine","posts"],["ai-engine","media"],["code-engine","plugins"],["code-engine","database"],["media-file-renamer","media"],["wp-retina-2x","media"],["wplr-sync","media"],["media-cleaner","media"],["media-cleaner","database"],["database-cleaner","database"]],Ze=[{id:"reset",glyph:"✉️",label:"Password reset",needs:["meow-mailer"],stops:["users","meow-mailer","inboxes"]},{id:"welcome",glyph:"👋",label:"New account, welcome mail",needs:["meow-mailer"],stops:["visitors","users","meow-mailer","inboxes"]},{id:"digest",glyph:"📊",label:"Weekly summary of what was sent",needs:["meow-mailer"],stops:["meow-mailer","inboxes"]},{id:"contact",glyph:"📨",label:'"Hello, a question…"',needs:["contact-form-block","meow-mailer"],stops:["visitors","contact-form-block","meow-mailer","inboxes"]},{id:"chat",glyph:"💬",label:'"Do you ship to Japan?"',needs:["ai-engine"],stops:["visitors","ai-engine","posts"]},{id:"mcp",glyph:"🤖",label:"An AI assistant reads your site",needs:["ai-engine"],stops:["bots","ai-engine","posts"]},{id:"write",glyph:"✍️",label:"A draft written for you",needs:["ai-engine"],stops:["ai-engine","posts"]},{id:"tool",glyph:"🧩",label:"Your own function, called by the chatbot",needs:["ai-engine","code-engine"],stops:["ai-engine","code-engine","database"]},{id:"snippet",glyph:"⚙️",label:"A snippet runs on schedule",needs:["code-engine"],stops:["code-engine","database"]},{id:"extend",glyph:"🔌",label:"A snippet instead of a whole plugin",needs:["code-engine"],stops:["code-engine","plugins"]},{id:"crawl",glyph:"🔍",label:"Googlebot drops by",needs:["seo-engine"],stops:["bots","seo-engine","posts"]},{id:"score",glyph:"🎯",label:"A post scored and improved",needs:["seo-engine"],stops:["posts","seo-engine"]},{id:"publish",glyph:"📣",label:"New post, everywhere",needs:["social-engine"],stops:["posts","social-engine","social"]},{id:"caption",glyph:"📝",label:"The caption, written for you",needs:["social-engine","ai-engine"],stops:["ai-engine","social-engine","social"]},{id:"photo",glyph:"🖼️",label:"Someone opens a photo",needs:["meow-gallery"],stops:["visitors","meow-gallery","media"]},{id:"exif",glyph:"📸",label:"A photo, with its EXIF and its map",needs:["meow-lightbox"],stops:["visitors","meow-lightbox","media"]},{id:"retina",glyph:"✨",label:"Thumbnails regenerated",needs:["wp-retina-2x"],stops:["media","wp-retina-2x","meow-gallery"]},{id:"lightroom",glyph:"📷",label:"Lightroom sends over a photo",needs:["wplr-sync"],stops:["wplr-sync","media"]},{id:"collection",glyph:"🗂️",label:"A collection becomes a gallery",needs:["wplr-sync","meow-gallery"],stops:["wplr-sync","meow-gallery","visitors"]},{id:"sweep",glyph:"🧹",label:"Nightly clean-up",needs:["media-cleaner"],stops:["media","media-cleaner","database"]},{id:"trim",glyph:"🗄️",label:"The database gets trimmed",needs:["database-cleaner"],stops:["database-cleaner","database"]},{id:"rename",glyph:"🏷️",label:"Upload named by AI",needs:["media-file-renamer","ai-engine"],stops:["media","media-file-renamer","ai-engine"]},{id:"redirect",glyph:"🔁",label:"Renamed, and the old link still works",needs:["media-file-renamer"],stops:["media-file-renamer","media"]}],et=function(){var e,t={},n=Te(Be);try{for(n.s();!(e=n.n()).done;){var r,o=e.value,a=Te(o.items);try{for(a.s();!(r=a.n()).done;){var i=r.value,c=Ve[i]?"plugin":We[i]?"core":"world",l=Ve[i]||We[i]||He[i];if(l){var s="plugin"===c?Xe[i]:c;t[i]=Le({id:i,kind:c,layer:o.id,family:s,color:it(i,s),standout:"plugin"===c&&"core"===o.kind},l)}}}catch(e){a.e(e)}finally{a.f()}}}catch(e){n.e(e)}finally{n.f()}return t},tt=function(e){for(var t=[],n=0,r=Qe;n<r.length;n++){var o=Ne(r[n],2),a=o[0],i=o[1];a===e?t.push(i):i===e&&t.push(a)}var c,l=Te($e(e));try{for(l.s();!(c=l.n()).done;){var s=c.value;t.includes(s)||t.push(s)}}catch(e){l.e(e)}finally{l.f()}return t},nt=function(e,t){if(!t)return null;for(var n=null,r=0,o=[e,"".concat(e,"-pro")];r<o.length;r++){var a=t[o[r]];if("active"===a)return"active";"inactive"===a&&(n="inactive")}return n},rt=function(e){return"https://wordpress.org/plugins/".concat(e,"/")},ot=function(e){return"https://meowapps.com/".concat(e,"/")},at=function(e){return Ze.filter((function(t){return t.stops.includes(e)}))},it=function(e,t){return Ue[e]||(ze[t||Xe[e]]||{}).color||"#8fd0ff"},ct=function(e){return it(e.needs[0])},lt=function(e){return"active"===e?"Installed and active":"inactive"===e?"Installed, but not activated":"unknown"===e?"Checking whether this is installed":"Not installed on this site"};function st(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var ut=(0,V.i7)(Ae||(Ae=st(["\n to { stroke-dashoffset: -33; }\n"]))),dt=(0,V.i7)(Ce||(Ce=st(["\n 0%, 100% { box-shadow: 0 3px 12px rgba(3, 22, 62, 0.22), 0 0 0 0 rgba(255, 255, 255, 0); }\n 50% { box-shadow: 0 3px 12px rgba(3, 22, 62, 0.22), 0 0 18px 2px var(--glow); }\n"]))),ft=V.Ay.div(je||(je=st(['\n position: relative;\n z-index: 30;\n margin: 14px 16px 6px;\n height: 88px;\n border-radius: 14px;\n background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));\n border: 1px solid rgba(255, 255, 255, 0.15);\n box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12);\n overflow: hidden;\n\n\n .header-idle,\n .header-live {\n display: flex;\n align-items: center;\n gap: 18px;\n height: 100%;\n /* Right padding clears the view toggle (72px wide, inset 17px). */\n padding: 0 110px 0 18px;\n }\n\n .header-mark {\n flex: 0 0 auto;\n width: 64px;\n height: 64px;\n border-radius: 16px;\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n background: rgba(255, 255, 255, 0.09);\n border: 1px solid rgba(255, 255, 255, 0.16);\n }\n\n /* Deliberately larger than the frame that clips it: the plugin artwork is\n drawn to the edges, so letting it bleed and cropping looks better than\n fitting it with a margin of dead space. */\n .header-mark img {\n width: 76px;\n height: 76px;\n display: block;\n background: color-mix(in srgb, var(--accent, #8fb3d9) 20%, rgba(255, 255, 255, 0.07));\n }\n .header-mark.is-plugin { background: none; border: 0; }\n\n .header-id {\n display: flex;\n flex-direction: column;\n gap: 5px;\n /* The identity never shrinks: when the strip runs out of room the chips and\n partners give way instead. Relaxed only under .is-tight, far below. */\n flex: 0 0 auto;\n min-width: 0;\n }\n\n .header-name {\n display: flex;\n align-items: center;\n gap: 9px;\n font-size: 15px;\n font-weight: 700;\n letter-spacing: 0.13em;\n text-transform: uppercase;\n color: white;\n line-height: 1.25;\n white-space: nowrap;\n }\n\n .header-sub, .header-desc {\n margin-top: 4px;\n line-height: 1.4;\n /* Caps how wide the non-shrinking identity column can get. */\n max-width: 300px;\n overflow: hidden;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n }\n\n .header-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.5); }\n .header-sub b { color: rgba(255, 255, 255, 0.8); font-weight: 650; }\n\n .header-desc {\n margin: 8px 0 0;\n font-size: 12.5px;\n line-height: 1.45;\n color: rgba(255, 255, 255, 0.72);\n max-height: 37px;\n overflow: hidden;\n }\n\n /* Sized for exactly two chips per row, so the block always reads as a tidy\n 2x2 rather than a ragged stack. Fixed basis for the same reason as\n .header-related: no reflow as you sweep across the board. */\n .header-features {\n /* Doesn\'t shrink: squeezed, the chips truncate to "One…" and "Han…", which\n is worse than not showing them. The partner icons yield instead — they\n degrade by showing fewer, which costs nothing legible. */\n flex: 0 0 306px;\n display: flex;\n flex-wrap: wrap;\n /* flex-start, not center. A chip row is 23px and the gap 6px, so 52px is\n exactly two rows. Centring was fine while everything fitted, but the\n moment a node produced three rows it centred them in a two-row window and\n sliced the first and last in half lengthwise. Starting at the top means\n the overflow is always a whole row that simply isn\'t drawn. */\n align-content: flex-start;\n gap: 6px;\n max-height: 52px;\n overflow: hidden;\n }\n\n .feature-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n /* No width cap: every label fits inside the 306px block on its own, so\n letting them size naturally means short ones pair up two to a row and\n long ones take a row to themselves. A tidy 2x2 isn\'t worth reading\n "A photo, with its EXIF a…". */\n box-sizing: border-box;\n max-width: 100%;\n padding: 4px 9px;\n border-radius: 7px;\n font-size: 11px;\n line-height: 1.2;\n color: rgba(255, 255, 255, 0.82);\n background: rgba(255, 255, 255, 0.07);\n border: 1px solid rgba(255, 255, 255, 0.12);\n }\n\n .chip-label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .feature-chip svg { flex: 0 0 auto; opacity: 0.75; }\n .feature-chip .chip-glyph { font-style: normal; font-size: 12px; line-height: 1; }\n\n /* A journey your site can\'t run yet still earns a place, dashed and dimmed. */\n .feature-chip.is-ghost {\n color: rgba(255, 255, 255, 0.5);\n border-style: dashed;\n border-color: rgba(255, 255, 255, 0.22);\n background: rgba(255, 255, 255, 0.03);\n }\n\n .header-spacer { flex: 1 1 auto; }\n\n .related-icons {\n display: flex;\n gap: 6px;\n margin-top: 6px;\n }\n\n .related-icons img {\n width: 26px;\n height: 26px;\n border-radius: 8px;\n display: block;\n }\n\n .related-icons img.off { filter: grayscale(1); opacity: 0.45; }\n\n .related-more {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 26px;\n height: 26px;\n border-radius: 8px;\n font-size: 10.5px;\n font-weight: 650;\n color: rgba(255, 255, 255, 0.72);\n background: rgba(255, 255, 255, 0.09);\n border: 1px solid rgba(255, 255, 255, 0.16);\n }\n\n .header-actions {\n flex: 0 0 auto;\n display: flex;\n gap: 8px;\n }\n\n .header-actions a {\n width: 72px;\n text-align: center;\n padding: 9px 0;\n border-radius: 9px;\n font-size: 10.5px;\n font-weight: 700;\n letter-spacing: 0.08em;\n text-transform: uppercase;\n text-decoration: none;\n transition: background 0.18s ease, color 0.18s ease;\n ',"\n }\n\n .header-actions a.free {\n color: white;\n background: linear-gradient(135deg, #3f7bec, #2f5fbd);\n border: 1px solid rgba(150, 190, 255, 0.5);\n }\n\n .header-actions a.pro {\n color: #ffcf7a;\n background: rgba(255, 186, 66, 0.1);\n border: 1px solid rgba(255, 186, 66, 0.55);\n }\n\n .header-actions a.free:hover { background: linear-gradient(135deg, #5590ff, #3a6cd0); }\n .header-actions a.pro:hover { background: rgba(255, 186, 66, 0.24); }\n\n /* The last resort. By this width the chips and partners are already gone and\n the icon, identity and buttons still don't fit, so the identity yields —\n the description reflows first, and only in the extreme does the name\n ellipsis. The buttons keep clear of the view toggle either way. */\n &.is-tight .header-id { flex: 0 1 auto; }\n\n /* The name gives way before the pill does: a clipped name still reads, a\n clipped status badge looks broken. */\n .header-title {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .header-stats {\n display: flex;\n gap: 10px;\n }\n\n .stat {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 9px 14px;\n min-width: 106px;\n border-radius: 12px;\n background: rgba(255, 255, 255, 0.045);\n border: 1px solid rgba(255, 255, 255, 0.09);\n }\n\n .stat-value {\n display: flex;\n align-items: baseline;\n gap: 5px;\n line-height: 1;\n }\n\n .stat-value b {\n font-size: 19px;\n font-weight: 650;\n color: #4ce7a8;\n }\n\n .stat-value i,\n .stat-value em {\n font-style: normal;\n font-size: 13px;\n font-weight: 400;\n color: rgba(255, 255, 255, 0.38);\n }\n\n /* The infinity glyph sits small and low next to the digits at 13px. */\n .stat-value em.is-endless {\n font-size: 17px;\n line-height: 0.8;\n color: rgba(255, 255, 255, 0.45);\n }\n\n\n\n .stat-label {\n font-size: 9.5px;\n font-weight: 700;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.45);\n }\n\n .header-status {\n /* Never shrinks: the name ellipsises before the badge does. */\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n gap: 6px;\n font-size: 9px;\n font-weight: 700;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n padding: 4px 10px;\n border-radius: 999px;\n white-space: nowrap;\n }\n\n .header-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }\n .header-status.is-active { background: rgba(43, 212, 125, 0.18); color: #4ce7a8; border: 1px solid rgba(43, 212, 125, 0.4); }\n .header-status.is-inactive { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.2); }\n .header-status.is-none { background: rgba(0, 0, 0, 0.22); color: rgba(255, 255, 255, 0.6); border: 1px dashed rgba(255, 255, 255, 0.26); }\n /* Waiting on the install list — deliberately quieter than \"not installed\",\n which it must not be mistaken for. */\n .header-status.is-unknown { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.14); }\n\n .header-related {\n /* Five icons at 26px with 6px gaps is the widest this ever gets. Fixed at\n that, so the column doesn't jump about as you move between nodes — but\n allowed to give the width back on a narrow screen, where it simply shows\n fewer icons rather than forcing anything else to clip. */\n flex: 0 1 178px;\n overflow: hidden;\n min-width: 0;\n align-self: stretch;\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: 9px;\n padding-left: 24px;\n border-left: 1px solid rgba(255, 255, 255, 0.09);\n }\n\n .related-label {\n font-size: 9px;\n font-weight: 700;\n letter-spacing: 0.13em;\n text-transform: uppercase;\n color: rgba(255, 255, 255, 0.42);\n }\n\n\n\n\n\n\n\n"])),X),pt=V.Ay.div(Me||(Me=st(["\n position: relative;\n /* The view area already cancels the tab's padding; this just fills it. */\n margin: 0;\n border-radius: 0;\n /* The tab behind this is the brand blue. The board shouldn't be a dark panel\n sitting on it — it's the same surface, very slightly recessed. */\n background:\n radial-gradient(1100px 380px at 50% 40%, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 70%),\n linear-gradient(180deg, rgba(3, 22, 62, 0.10) 0%, rgba(3, 22, 62, 0.22) 100%);\n border: 0;\n border-top: 1px solid rgba(255, 255, 255, 0.1);\n\n /* Below MIN_SCALE the board stops shrinking, so it has to be able to pan.\n Scrolling here rather than on an ancestor, because NekoUI's tab wrapper is\n overflow:hidden and would simply clip it. */\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-width: thin;\n scrollbar-color: rgba(255, 255, 255, 0.28) transparent;\n\n &::-webkit-scrollbar { height: 8px; }\n &::-webkit-scrollbar-track { background: transparent; }\n\n &::-webkit-scrollbar-thumb {\n background: rgba(255, 255, 255, 0.22);\n border-radius: 4px;\n }\n\n &::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.34); }\n\n .board-fit { position: relative; }\n\n"]))),ht=V.Ay.div(De||(De=st(["\n position: relative;\n width: ","px;\n height: ","px;\n transform-origin: top left;\n user-select: none;\n\n /* The board was one flat blue rectangle. This is a soft light sitting behind\n the Core row — where everything plugs in — falling off towards the edges,\n so the stack reads as having a middle rather than being evenly lit. It sits\n under everything and catches no pointer events. */\n &::before {\n content: '';\n position: absolute;\n /* Strictly inside the stage. Bleeding past it added real width to the\n scroll container and left a horizontal scrollbar on at every size. */\n inset: 0;\n z-index: 0;\n pointer-events: none;\n background:\n radial-gradient(58% 42% at 50% 55%, rgba(150, 190, 255, 0.16), transparent 70%),\n radial-gradient(80% 60% at 50% 108%, rgba(10, 24, 60, 0.28), transparent 72%);\n }\n\n /* ---------------------------------------------------------------- layers */\n\n /* Two stacked washes: a white \"lift\" that sets how far forward the layer sits,\n over a tint in the layer's own colour. Keeping them separate means the depth\n ranking and the hue can be tuned without fighting each other — they used to\n be four near-identical hardcoded gradients, which is why every layer read as\n the same blue. */\n .layer-panel {\n position: absolute;\n z-index: 1;\n --lift: 0.07;\n --lift-soft: 0.04;\n border-radius: 18px;\n /* Declared twice on purpose. A browser without color-mix throws away the\n whole declaration it appears in — which for a shorthand like this meant\n losing the white lift too, leaving every layer panel with no background\n at all and the four bands invisible. The plain pair below lands first and\n survives; the tinted pair overrides it wherever color-mix is understood. */\n background: linear-gradient(180deg,\n rgba(255, 255, 255, var(--lift)), rgba(255, 255, 255, var(--lift-soft)));\n border: 1px solid rgba(255, 255, 255, 0.11);\n background:\n linear-gradient(180deg, rgba(255, 255, 255, var(--lift)), rgba(255, 255, 255, var(--lift-soft))),\n linear-gradient(180deg,\n color-mix(in srgb, var(--layer) 13%, transparent),\n color-mix(in srgb, var(--layer) 4%, transparent));\n border: 1px solid color-mix(in srgb, var(--layer) 24%, rgba(255, 255, 255, 0.07));\n transition: background 0.3s ease, border-color 0.3s ease, top 0.28s cubic-bezier(0.22, 1, 0.36, 1), height 0.28s cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n /* A wash big enough to see would fight the cards, so the layer's colour is\n concentrated into a spine instead: unmistakable, and it takes up no room. */\n .layer-panel::before {\n content: '';\n position: absolute;\n left: 0;\n top: 16px;\n bottom: 16px;\n width: 3px;\n border-radius: 0 3px 3px 0;\n background: linear-gradient(180deg,\n transparent,\n color-mix(in srgb, var(--layer) 85%, transparent) 22%,\n color-mix(in srgb, var(--layer) 85%, transparent) 78%,\n transparent);\n transition: opacity 0.25s ease;\n opacity: 0.75;\n }\n\n .layer-panel.is-lit::before { opacity: 1; }\n\n /* Name and description in a fixed left column; the cards get the rest. */\n .layer-label {\n position: absolute;\n left: 20px;\n /* Centred on the cards, not on the panel: headroom is added above the\n cards, so centring on the panel would leave the name sitting high. */\n top: calc(50% + var(--headroom, 0px) / 2);\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n .layer-mark {\n flex: 0 0 auto;\n width: 34px;\n height: 34px;\n border-radius: 11px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: rgba(255, 255, 255, 0.12);\n border: 1px solid rgba(255, 255, 255, 0.28);\n background: color-mix(in srgb, var(--layer) 28%, transparent);\n border: 1px solid color-mix(in srgb, var(--layer) 62%, transparent);\n box-shadow: 0 0 14px color-mix(in srgb, var(--layer) 22%, transparent);\n }\n\n .layer-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }\n\n /* Each layer sits at its own depth. Lightness steps down as you go further\n from the surface, and WordPress — the floor everything stands on — is the\n brightest. Blue on blue would just disappear, so it's value, not hue. */\n /* How far forward each layer sits. Core is the brightest because everything\n else plugs into it; the outside world is the faintest because it isn't\n yours. */\n .layer-panel.is-world { --lift: 0.04; --lift-soft: 0.02; }\n .layer-panel.is-surface { --lift: 0.085; --lift-soft: 0.05; }\n .layer-panel.is-workshop { --lift: 0.06; --lift-soft: 0.035; }\n\n .layer-panel.is-core {\n --lift: 0.15;\n --lift-soft: 0.085;\n box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);\n }\n\n .layer-panel.is-lit {\n --lift: 0.13;\n --lift-soft: 0.09;\n border-color: color-mix(in srgb, var(--layer) 45%, rgba(255, 255, 255, 0.2));\n }\n\n .layer-panel.is-core.is-lit { --lift: 0.2; --lift-soft: 0.12; }\n\n .layer-title {\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.1em;\n white-space: nowrap;\n text-transform: uppercase;\n color: var(--layer, rgba(255, 255, 255, 0.72));\n }\n\n\n .layer-blurb {\n font-size: 11px;\n line-height: 1.45;\n color: rgba(255, 255, 255, 0.45);\n transition: color 0.3s ease;\n }\n\n .layer-panel.is-lit .layer-blurb { color: rgba(255, 255, 255, 0.6); }\n\n /* ----------------------------------------------------------------- wires */\n\n .board-wires {\n position: absolute;\n inset: 0;\n z-index: 2;\n pointer-events: none;\n overflow: visible;\n }\n\n .wire { opacity: 0.5; transition: opacity 0.3s ease; }\n\n .wire-line {\n fill: none;\n stroke-width: 1.5;\n transition: stroke-width 0.3s ease;\n }\n\n .wire-port { opacity: 0; transition: opacity 0.3s ease; }\n\n /* Particles drifting toward the arrow — only ever on the two or three wires\n you're actually looking at, so the cost stays trivial. */\n .wire-flow {\n fill: none;\n stroke-width: 3;\n stroke-linecap: round;\n stroke-dasharray: 0.5 16;\n opacity: 0.9;\n animation: "," 1.9s linear infinite;\n }\n\n .wire-flow.is-back { animation-direction: reverse; }\n\n .wire.is-synergy { opacity: 0.16; }\n .wire.is-synergy .wire-line { stroke-dasharray: 4 5; }\n .wire.is-dormant .wire-line { stroke-dasharray: 3 6; }\n .wire.is-dormant { opacity: 0.22; }\n .wire.is-dim { opacity: 0.05; }\n\n .wire.is-lit {\n opacity: 1;\n filter: drop-shadow(0 0 4px currentColor);\n }\n\n .wire.is-lit .wire-line { stroke-width: 2; stroke-dasharray: none; }\n .wire.is-lit .wire-port { opacity: 1; }\n\n /* Surveying a layer: present but understated. Showing these at full strength\n is what turned the board into spaghetti the first time round. */\n .wire.is-survey { opacity: 0.5; }\n .wire.is-survey .wire-line { stroke-width: 1.4; stroke-dasharray: none; }\n .wire.is-survey.is-dormant { opacity: 0.24; }\n .wire.is-survey.is-dormant .wire-line { stroke-dasharray: 3 6; }\n\n /* Structure reads first; integrations stay a thinner, quieter dashed line. */\n .wire.is-synergy.is-lit { opacity: 0.66; }\n .wire.is-synergy.is-lit .wire-line { stroke-dasharray: 5 6; stroke-width: 1.3; }\n\n /* --------------------------------------------------------------- packets */\n\n /* The route is its own layer whose opacity fades — a compositor job. The chip\n rides an offset-path, which Chrome turns into a transform. Neither touches\n the wire SVG, which is what kept the tab alive. */\n /* No z-index here on purpose: it would create a stacking context and trap\n the two children together. The route needs to sit *under* the cards so a\n card occludes it — that is what makes a packet look like it enters a node\n and comes out the other side — while the chip rides above everything. */\n .packet {\n position: absolute;\n inset: 0;\n pointer-events: none;\n }\n\n .packet-route {\n position: absolute;\n inset: 0;\n z-index: 3;\n opacity: 0;\n will-change: opacity;\n }\n\n /* The line is drawn in step with the packet rather than appearing whole —\n that is what makes one route legible where thirty at once were not. */\n .packet-route path {\n fill: none;\n stroke: var(--flight, #8fd0ff);\n stroke-width: 2;\n stroke-linecap: round;\n stroke-dasharray: 100;\n stroke-dashoffset: 100;\n filter: drop-shadow(0 0 6px var(--flight-soft, rgba(143, 208, 255, 0.45)));\n }\n\n .route-port {\n fill: var(--flight, #cfe6ff);\n stroke: rgba(10, 30, 70, 0.9);\n stroke-width: 1.5;\n opacity: 0;\n filter: drop-shadow(0 0 5px var(--flight-soft, rgba(143, 208, 255, 0.9)));\n }\n\n .packet.is-ghost .route-port {\n fill: rgba(214, 228, 246, 0.85);\n filter: none;\n }\n\n /* Icon only. A label can't be read while it's moving, and the words are in\n the readout anyway — which also means a new journey costs one glyph. */\n .packet-chip {\n position: absolute;\n z-index: 6;\n left: 0;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 34px;\n height: 34px;\n border-radius: 50%;\n background: rgba(9, 20, 44, 0.94);\n border: 1.5px solid var(--flight, #8fd0ff);\n box-shadow: 0 4px 14px rgba(3, 22, 62, 0.5), 0 0 16px var(--flight-soft, rgba(143, 208, 255, 0.45));\n offset-rotate: 0deg;\n /* Dead centre on the path. Anchoring it above looked fine on horizontal\n runs and plainly wrong on vertical ones, where the offset shifts the\n icon along the wire instead of beside it. */\n offset-anchor: 50% 50%;\n offset-distance: 0%;\n opacity: 0;\n will-change: transform, opacity;\n }\n\n .chip-glyph { font-size: 17px; line-height: 1; }\n\n /* A ghost is greyed *towards* the colour of the plugin it would need, rather\n than to flat grey. It still reads as \"not yours yet\" — muted, dashed chip,\n no glow — but keeps enough identity to tell one missing plugin from\n another. On a site with nothing installed every journey is a ghost, and\n flat grey left the board that is meant to sell them with no colour at all. */\n .packet.is-ghost .packet-route path {\n stroke: color-mix(in srgb, var(--flight, #bacce8) 40%, #b9c8de);\n filter: none;\n }\n\n .packet.is-ghost .packet-chip {\n background: rgba(9, 20, 44, 0.82);\n border-color: color-mix(in srgb, var(--flight, #bacce8) 45%, rgba(186, 204, 232, 0.75));\n border-style: dashed;\n box-shadow: 0 4px 12px rgba(3, 22, 62, 0.45);\n }\n\n .packet.is-ghost .chip-glyph { opacity: 0.55; }\n\n /* Section labels live in the panel's top padding, so a divided row costs no\n extra height — the board is already tight vertically. */\n /* White, not the layer accent: the accents are close enough to the panel\n colour that a label drawn in one is barely there. */\n .section-label {\n position: absolute;\n /* Sits in the row's headroom, breathing on both sides rather than wedged\n between the panel edge and the cards. */\n top: calc(var(--headroom, 0px) - 3px);\n /* Pinned, because the inherited line box was twice the glyph height and\n pushed the label down onto the cards. */\n line-height: 1;\n font-size: 9px;\n font-weight: 700;\n letter-spacing: 0.15em;\n text-transform: uppercase;\n white-space: nowrap;\n color: rgba(255, 255, 255, 0.5);\n }\n\n .section-rule {\n position: absolute;\n top: calc(var(--headroom, 0px) + 12px);\n bottom: 12px;\n width: 1px;\n background: linear-gradient(180deg,\n transparent,\n rgba(255, 255, 255, 0.2) 25%,\n rgba(255, 255, 255, 0.2) 75%,\n transparent);\n }\n\n\n /* ------------------------------------------------------------------ nodes */\n\n .node {\n position: absolute;\n z-index: 4;\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: 0 10px;\n margin: 0;\n text-align: left;\n overflow: hidden;\n border: 1px solid var(--edge, rgba(255, 255, 255, 0.14));\n border-radius: 13px;\n background:\n linear-gradient(158deg, var(--tint, rgba(255, 255, 255, 0.1)), rgba(255, 255, 255, 0.07));\n box-shadow: 0 3px 12px rgba(3, 22, 62, 0.22),\n inset 0 1px 0 rgba(255, 255, 255, 0.12);\n cursor: pointer;\n transition: transform 0.2s cubic-bezier(0.34, 1.4, 0.64, 1),\n opacity 0.25s ease, border-color 0.25s ease,\n background 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;\n }\n\n .node:focus { outline: none; }\n\n .node-head {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n gap: 9px;\n min-width: 0;\n }\n\n /* Seven workshop cards are too narrow for a name beside an icon. */\n .node.is-stacked { padding: 0 6px; }\n\n .node.is-stacked .node-head {\n flex-direction: column;\n gap: 9px;\n text-align: center;\n }\n\n .node.is-stacked .node-name { text-align: center; }\n .node.is-stacked .node-mark,\n .node.is-stacked .node-mark img { width: 48px; height: 48px; }\n\n /* Zoomed in: the card grows down into the empty routing band and lists what\n the thing actually gives you. Nothing else on the board moves. */\n\n\n .node-mark {\n position: relative;\n flex: 0 0 auto;\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n /* The accent radiating from behind the icon. The plugin artwork is mostly\n grey cats, so without this the colour only ever showed up as a hairline. */\n .node-mark::before {\n content: '';\n position: absolute;\n /* 6px, not more: the cards clip their overflow and the shortest row is only\n 50px tall, so a wider halo gets a hard edge sliced off it. */\n inset: -6px;\n border-radius: 50%;\n background: radial-gradient(circle, var(--glow, transparent) 0%, transparent 68%);\n opacity: 0.85;\n transition: opacity 0.25s ease;\n }\n\n .node-mark img,\n .node-mark svg { position: relative; }\n\n /* A tile behind the artwork, in the plugin's own colour. The icons come from\n ps.w.org, so a site with no outbound internet gets none of them — without\n this that left a blank 36px gap and a name, which reads as broken. The\n artwork is opaque and covers this whenever it does load. */\n .node-mark img {\n width: 36px;\n height: 36px;\n border-radius: 11px;\n display: block;\n background: color-mix(in srgb, var(--accent, #8fb3d9) 20%, rgba(255, 255, 255, 0.07));\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);\n transition: filter 0.3s ease, opacity 0.3s ease;\n }\n\n .node-name {\n flex: 1 1 auto;\n min-width: 0;\n font-size: 12.5px;\n font-weight: 600;\n line-height: 1.25;\n letter-spacing: 0;\n color: rgba(255, 255, 255, 0.94);\n transition: color 0.25s ease;\n }\n\n .node-dot {\n position: absolute;\n top: 8px;\n right: 8px;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n }\n\n .node-dot.is-active {\n background: #2bd47d;\n box-shadow: 0 0 7px rgba(43, 212, 125, 0.9);\n }\n\n .node-dot.is-inactive { background: rgba(255, 255, 255, 0.42); }\n\n /* The world layer is context, not product — quieter by design. */\n /* The outside world keeps its own soft colour, like every other card. This\n used to flatten all four to the same grey, which made the accents defined\n for them dead data and left the top row the deadest thing on the board.\n They stay the quietest cards — their accents are barely saturated — but\n Visitors is no longer indistinguishable from Inboxes. */\n .node.is-world {\n background: linear-gradient(158deg, var(--tint), rgba(255, 255, 255, 0.04));\n border-color: var(--edge);\n border-radius: 24px;\n }\n\n /* Round, where everything inside your site is rectangular: these are people\n and places out there, not modules you own. */\n .node.is-world .node-mark {\n width: 30px;\n height: 30px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.09);\n border: 1px solid rgba(255, 255, 255, 0.2);\n background: color-mix(in srgb, var(--accent) 20%, transparent);\n border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);\n }\n\n /* The badge replaces the halo rather than sitting on top of it. */\n .node.is-world .node-mark::before { display: none; }\n\n .node.is-world .node-name { color: rgba(255, 255, 255, 0.8); font-weight: 600; }\n\n .node.is-core .node-mark { width: 32px; height: 32px; }\n\n /* A plugin sitting in the Core row is part of the platform, so it carries its\n own colour rather than the neutral core surface. */\n .node.is-standout {\n background: linear-gradient(158deg, var(--tint-strong), rgba(255, 255, 255, 0.09));\n border-color: var(--accent);\n box-shadow: 0 4px 16px rgba(3, 22, 62, 0.3),\n 0 0 18px var(--glow),\n inset 0 1px 0 rgba(255, 255, 255, 0.16);\n }\n\n .node.is-standout .node-name { color: white; font-weight: 700; }\n .node.is-standout .node-mark,\n .node.is-standout .node-mark img { width: 42px; height: 42px; }\n\n .node.is-core {\n border-color: rgba(255, 255, 255, 0.24);\n background: linear-gradient(158deg, rgba(255, 255, 255, 0.17), rgba(255, 255, 255, 0.09));\n }\n\n .node.is-core .node-name { color: white; }\n\n /* Not installed: present on the board, visibly not wired in. */\n .node.is-dormant {\n background: rgba(255, 255, 255, 0.022);\n border-style: dashed;\n border-color: rgba(255, 255, 255, 0.2);\n box-shadow: none;\n }\n\n .node.is-dormant .node-mark img { filter: grayscale(1) brightness(0.75); opacity: 0.5; }\n .node.is-dormant .node-name { color: rgba(255, 255, 255, 0.5); font-weight: 500; }\n\n .node.is-inactive .node-mark img { filter: grayscale(0.45); opacity: 0.8; }\n\n /* The plugin a ghost journey is waiting on. It keeps its dashed, greyed\n treatment — it still isn't installed — but comes far enough forward to be\n read as the missing piece of the story currently crossing the board. */\n .node.is-wanted {\n border-color: var(--edge);\n animation: "," 1.5s ease-in-out infinite;\n }\n\n .node.is-wanted .node-mark img { filter: grayscale(0.3); opacity: 0.95; }\n .node.is-wanted .node-name { color: rgba(255, 255, 255, 0.92); font-weight: 650; }\n .node.is-wanted .node-mark::before { opacity: 1; }\n\n .node:hover,\n .node:focus-visible,\n .node.is-focus {\n transform: translateY(-2px);\n border-style: solid;\n border-color: var(--accent, rgba(255, 255, 255, 0.45));\n background: linear-gradient(158deg, var(--tint-strong), rgba(255, 255, 255, 0.13));\n box-shadow: 0 10px 24px rgba(3, 22, 62, 0.34),\n 0 0 22px var(--glow),\n inset 0 1px 0 rgba(255, 255, 255, 0.2);\n }\n\n /* Held, not hovered. Clicking a card locks the readout and brings out the\n wires it pairs with, and the board deliberately stops following the mouse\n for as long as it holds — focus is pinned-or-hovered, and pinned wins.\n Sharing the hover treatment meant that stopped looking like a mode and\n started looking like a bug: you move the pointer, nothing responds, and the\n card you are no longer pointing at is still lit. A steady ring says which\n card is doing it. Click it again, or anywhere on the board, to let go.\n\n (No backticks in here: this is a comment inside a template literal, and one\n stray backtick ends the CSS and the file stops parsing.) */\n .node.is-pinned {\n outline: 2px solid var(--accent, rgba(255, 255, 255, 0.6));\n outline-offset: 3px;\n }\n\n .node:hover .node-mark img,\n .node.is-focus .node-mark img { filter: none; opacity: 1; }\n\n /* Keyboard focus needs its own mark. Sharing the hover treatment meant the\n only signal was a 2px lift, which is not something you can follow while\n tabbing. Ringed in the card's own colour so it reads on the blue. */\n .node:focus-visible,\n .layer-panel:focus-visible {\n outline: 2px solid var(--accent, var(--layer, #cfe0ff));\n outline-offset: 3px;\n }\n\n .layer-panel:focus-visible {\n --lift: 0.13;\n --lift-soft: 0.09;\n }\n\n .node:hover .node-name,\n .node.is-focus .node-name { color: white; }\n\n .node.is-dim {\n opacity: 0.26;\n filter: saturate(0.4);\n }\n\n /* The module a packet has just reached. */\n /* Coloured by the journey that just arrived, falling back to the old cyan if\n a pulse ever fires without one. */\n .node.is-pulse {\n border-color: var(--pulse, #8fd0ff);\n background: linear-gradient(160deg,\n var(--pulse-soft, rgba(143, 208, 255, 0.22)),\n rgba(255, 255, 255, 0.07));\n box-shadow: 0 0 0 1px var(--pulse-glow, rgba(143, 208, 255, 0.5)),\n 0 0 22px var(--pulse-glow, rgba(143, 208, 255, 0.35));\n }\n\n .node.is-pulse .node-name { color: white; }\n .node.is-pulse .node-mark img { filter: none; opacity: 1; }\n\n /* Asked for less motion: the board goes still. Packets never spawn at all\n (canAnimatePackets checks the same query), but the wire flow starts on\n hover, which has nothing to do with packets — so it has to be stopped\n here or it loops for exactly the people who asked it not to. */\n @media (prefers-reduced-motion: reduce) {\n .packet { display: none; }\n .wire-flow { display: none; }\n .node.is-wanted { animation: none; }\n .node,\n .layer-panel,\n .node-mark::before { transition: none; }\n }\n"])),1300,646,ut,dt),mt=V.Ay.div(Ge||(Ge=st(["\n position: relative;\n margin: -18px;\n\n /* Sides and bottom only. The 56px that used to sit on top was clearance for\n the view toggle, back when it floated over the grid rather than living in\n the header strip. All it did once the toggle moved was shove the header 56px\n down the page and make it jump when you switched views. The grid still gets\n its side and bottom padding back, because cards are ordinary content and\n shouldn't run to the edges the way the board does. */\n &.is-grid {\n padding: 0 18px 18px;\n }\n\n /* The strip carries its own side margin for the board, where the shell runs\n edge to edge. In the grid that margin stacked on top of the padding above\n and left the header sitting 14px inside the cards it belongs to. */\n &.is-grid "," {\n margin-left: 2px;\n margin-right: 2px;\n }\n"])),ft),gt=V.Ay.div(Fe||(Fe=st(["\n position: absolute;\n top: 50%;\n right: 14px;\n transform: translateY(-50%);\n z-index: 20;\n display: inline-flex;\n padding: 3px;\n border-radius: 10px;\n background: rgba(3, 22, 62, 0.34);\n border: 1px solid rgba(255, 255, 255, 0.18);\n backdrop-filter: blur(6px);\n -webkit-backdrop-filter: blur(6px);\n\n button {\n appearance: none;\n border: 0;\n background: none;\n cursor: pointer;\n width: 32px;\n height: 26px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 7px;\n color: rgba(255, 255, 255, 0.55);\n transition: background 0.18s ease, color 0.18s ease;\n }\n\n button svg { display: block; }\n button:hover { color: white; }\n button { "," }\n\n button.is-on {\n background: rgba(255, 255, 255, 0.16);\n color: white;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);\n }\n"])),X),yt=1300,vt=646;function bt(e){return function(e){if(Array.isArray(e))return xt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Et(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||Et(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Et(e,t){if(e){if("string"==typeof e)return xt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(e,t):void 0}}function xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var St=wp.element,kt=St.useMemo,Rt=St.useState,Tt=St.useEffect,Nt=St.useRef,Ot=function(){try{var e=document.querySelector("#wp-admin-bar-site-name > a"),t=e?e.textContent.trim():"";if(t&&t.length<=30)return t}catch(e){}return"Your WordPress Site"},Pt=function(e){var t=e.installedPlugins,n=e.node,r=void 0===n?null:n,o=e.partners,a=void 0===o?[]:o,i=e.states,c=void 0===i?null:i,l=e.view,s=e.onView,u=e.ready,d=void 0===u||u,f=kt(Ot,[]),p=Nt(null),h=wt(Rt({chips:!0,partners:!0,tight:!1,stats:"all"}),2),m=h[0],g=h[1];Tt((function(){var e=p.current;if(e){var t=function(){return g({chips:e.clientWidth>=1045,partners:e.clientWidth>=1250,tight:e.clientWidth<1e3,stats:e.clientWidth>=880?"all":e.clientWidth>=620?"one":"none"})};if(t(),"undefined"==typeof ResizeObserver)return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)};var n=new ResizeObserver(t);return n.observe(e),function(){return n.disconnect()}}}),[]);var y,v=kt((function(){var e=c||{},n=Object.keys(Ve),r=function(n){return c?e[n]:nt(n,t)},o=n.filter((function(e){return r(e)})).length,a=n.filter((function(e){return"active"===r(e)})).length,i=qe.filter((function(e){var t=wt(e,2),n=t[0],o=t[1];return"active"===r(n)&&"active"===r(o)})).length,l=Ze.filter((function(e){return e.needs.every((function(e){return"active"===r(e)}))})).length;return{installed:o,total:n.length,stats:[{label:"Running",value:a,of:n.length,hint:"".concat(a," of your ").concat(n.length," Meow plugins are installed and active.")},{label:"Working together",value:i,of:qe.length,hint:"Pairs of Meow plugins that make each other better. "+"".concat(i," of ").concat(qe.length," pairs have both halves running.")},{label:"Things it can do",value:l,of:"∞",hint:"".concat(l," of the ").concat(Ze.length," journeys drawn on this board are live on ")+"your site. The plugins do plenty more that no board could fit."}]}}),[t,c]),b=d?r&&c?c[r.id]:null:"unknown",w=kt((function(){if(!r)return[];var e=function(e){return e.needs.every((function(e){return c&&"active"===c[e]}))};if(d&&"plugin"===r.kind&&c&&!c[r.id]){var t=bt(at(r.id));if(t.length)return t.slice(0,4).map((function(e){return{key:e.id,label:e.label,glyph:e.glyph,live:!1}}))}return"plugin"===r.kind?(r.features||[]).slice(0,4).map((function(e){return{key:e,label:e,live:!0}})):bt(at(r.id)).sort((function(t,n){return Number(e(n))-Number(e(t))})).slice(0,4).map((function(t){return{key:t.id,label:t.label,glyph:t.glyph,live:e(t)}}))}),[r,c,d]);return React.createElement(ft,{ref:p,className:m.tight?"is-tight":"",onClick:function(e){return e.stopPropagation()}},!r&&React.createElement("div",{className:"header-idle"},React.createElement("span",{className:"header-mark is-site"},React.createElement(W.z,{icon:"cat",width:26,height:26,color:"#ffffff"})),React.createElement("div",{className:"header-id"},React.createElement("span",{className:"header-name"},f),React.createElement("span",{className:"header-sub"},d?React.createElement(React.Fragment,null,React.createElement("b",null,v.installed)," of ",v.total," Meow plugins installed"):"Checking which Meow plugins are installed…")),React.createElement("span",{className:"header-spacer"}),d&&"none"!==m.stats&&React.createElement("div",{className:"header-stats"},("all"===m.stats?v.stats:v.stats.slice(0,1)).map((function(e){return React.createElement("div",{key:e.label,className:"stat",title:e.hint},React.createElement("span",{className:"stat-value"},React.createElement("b",null,e.value),React.createElement("i",null,"/"),React.createElement("em",{className:"number"==typeof e.of?"":"is-endless"},e.of)),React.createElement("span",{className:"stat-label"},e.label))})))),r&&React.createElement("div",{className:"header-live"},React.createElement("span",{className:"header-mark is-".concat(r.kind),style:{"--accent":r.color}},"plugin"===r.kind?React.createElement("img",{src:r.icon,alt:""}):React.createElement(W.z,{icon:r.iconName,width:24,height:24,color:r.color})),React.createElement("div",{className:"header-id"},React.createElement("span",{className:"header-name"},React.createElement("span",{className:"header-title"},r.name),"plugin"===r.kind&&React.createElement("span",{className:"header-status is-".concat(b||"none"),title:lt(b)},React.createElement("i",null),"active"===(y=b)?"Running":"inactive"===y?"Inactive":"unknown"===y?"Checking…":"Not installed")),React.createElement("span",{className:"header-desc"},r.desc)),m.chips&&w.length>0&&React.createElement("div",{className:"header-features"},w.map((function(e){return React.createElement("span",{key:e.key,className:"feature-chip".concat(e.live?"":" is-ghost"),title:e.label},e.glyph?React.createElement("i",{className:"chip-glyph"},e.glyph):React.createElement(W.z,{icon:Je(e.label)||"circle",width:13,height:13}),React.createElement("span",{className:"chip-label"},e.label))}))),React.createElement("span",{className:"header-spacer"}),m.partners&&a.length>0&&React.createElement("div",{className:"header-related"},React.createElement("span",{className:"related-label"},"plugin"===r.kind?"Works with":"Worked on by"),React.createElement("span",{className:"related-icons"},a.slice(0,a.length>5?4:5).map((function(e){return React.createElement("img",{key:e.id,src:e.icon,alt:e.name,title:e.name,className:c&&c[e.id]?"on":"off"})})),a.length>5&&React.createElement("span",{className:"related-more",title:a.slice(4).map((function(e){return e.name})).join(", ")},"+",a.length-4))),"plugin"===r.kind&&React.createElement("div",{className:"header-actions"},React.createElement("a",{className:"free",href:rt(r.id),target:"_blank",rel:"noreferrer"},"Free"),!r.freeOnly&&React.createElement("a",{className:"pro",href:ot(r.id),target:"_blank",rel:"noreferrer"},"Pro"))),React.createElement(gt,{role:"group","aria-label":"View"},React.createElement("button",{type:"button",className:"board"===l?"is-on":"","aria-pressed":"board"===l,onClick:function(){return s("board")},title:"Board","aria-label":"Board view"},React.createElement(W.z,{icon:"share",width:16,height:16})),React.createElement("button",{type:"button",className:"grid"===l?"is-on":"","aria-pressed":"grid"===l,onClick:function(){return s("grid")},title:"Grid","aria-label":"Grid view"},React.createElement(W.z,{icon:"view-grid",width:16,height:16}))))};function It(e){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}function Lt(e){return function(e){if(Array.isArray(e))return Gt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Dt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||Dt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function At(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ct(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?At(Object(n),!0).forEach((function(t){jt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jt(e,t,n){return(t=function(e){var t=function(e){if("object"!=It(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=It(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==It(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mt(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Dt(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}function Dt(e,t){if(e){if("string"==typeof e)return Gt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gt(e,t):void 0}}function Gt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}for(var Ft=wp.element,zt=Ft.useState,Ut=Ft.useEffect,Bt=Ft.useMemo,Ht=Ft.useRef,Wt=Ft.useCallback,Yt=Ft.Fragment,Vt={left:8,right:1292},qt=1264,Kt={world:{y:16,itemH:52,gap:16,vertical:!1},surface:{y:160,itemH:68,gap:14,vertical:!1},core:{y:320,itemH:68,gap:14,vertical:!1,headroom:14,weights:{"ai-engine":1.9}},workshop:{y:494,itemH:100,gap:12,vertical:!0}},Jt=0,$t=Object.values(Kt);Jt<$t.length;Jt++){var Xt=$t[Jt];Xt.headroom=Xt.headroom||0,Xt.h=Xt.itemH+36+Xt.headroom}var Qt,Zt,en,tn,nn,rn=function(e,t){var n=Kt[e].y+Kt[e].h,r=Kt[t].y;return{top:n,bottom:r,lanes:[12,24,36,48].map((function(e){return n+e}))}},on={"world|surface":rn("world","surface"),"surface|core":rn("surface","core"),"core|workshop":rn("core","workshop")},an=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n="M ".concat(e[0][0].toFixed(1)," ").concat(e[0][1].toFixed(1)),r=1;r<e.length-1;r++){var o=_t(e[r-1],2),a=o[0],i=o[1],c=_t(e[r],2),l=c[0],s=c[1],u=_t(e[r+1],2),d=u[0],f=u[1],p=Math.hypot(l-a,s-i)||1,h=Math.hypot(d-l,f-s)||1,m=Math.min(t,p/2,h/2),g=s-(s-i)/p*m,y=l+(d-l)/h*m,v=s+(f-s)/h*m;n+=" L ".concat((l-(l-a)/p*m).toFixed(1)," ").concat(g.toFixed(1)," Q ").concat(l.toFixed(1)," ").concat(s.toFixed(1)," ").concat(y.toFixed(1)," ").concat(v.toFixed(1))}var b=e[e.length-1];return"".concat(n," L ").concat(b[0].toFixed(1)," ").concat(b[1].toFixed(1))},cn=Be.map((function(e){return e.id})),ln=function(e){return cn.indexOf(e)},sn=function(){var e={};return function(t,n,r){for(var o=e[t]||(e[t]=[]),a=Math.min(n,r),i=Math.max(n,r),c=0;o[c]&&o[c].some((function(e){return a<e[1]&&e[0]<i}));)c++;return o[c]||(o[c]=[]),o[c].push([a,i]),c}},un=function(e){var t=ln(e.layer),n=cn[t+1];return n&&on["".concat(e.layer,"|").concat(n)]?{key:"".concat(e.layer,"|").concat(n),edgeOf:function(e){return e.bottom}}:{key:"".concat(cn[t-1],"|").concat(e.layer),edgeOf:function(e){return e.top}}},dn=function(e,t,n,r){var o=cn.slice(ln(e)+1,ln(t)).map((function(e){return function(e,t){for(var n=Be.find((function(t){return t.id===e})).items.map((function(e){return t[e]})).filter(Boolean).sort((function(e,t){return e.x-t.x})),r=[],o=1;o<n.length;o++)r.push((n[o-1].right+n[o].left)/2);return r.push((n[n.length-1].right+18+qt)/2),r}(e,r)})),a=o.length?o[0].filter((function(e){return o.every((function(t){return t.some((function(t){return Math.abs(t-e)<26}))}))})):[];return a.length?a.reduce((function(e,t){return Math.abs(t-n)<Math.abs(e-n)?t:e})):n<650?Vt.left:Vt.right},fn=function(e){var t,n=sn(),r=[],o=new Set,a=function(t,n,a){var i=e[t],c=e[n];if(i&&c){var l=[t,n].sort().join("|");if(!o.has(l)){o.add(l);var s,u=ln(i.layer),d=ln(c.layer),f=_t(u<=d?[i,c]:[c,i],2),p=f[0],h=f[1],m=Math.abs(u-d),g=null;if(0===m){var y=un(p).edgeOf(p)===p.bottom?"bottom":"top";s={upper:y,lower:y}}else s={upper:"bottom",lower:"top"},m>=2&&(g=dn(p.layer,h.layer,(p.x+h.x)/2,e));r.push({key:l,a:t,b:n,kind:a,upper:p,lower:h,gap:m,edges:s,corridor:g,aimX:{upper:null!==g?g:h.x,lower:null!==g?g:p.x},portX:{upper:p.x,lower:h.x}})}}},i=Mt(Qe);try{for(i.s();!(t=i.n()).done;){var c=_t(t.value,2);a(c[0],c[1],"link")}}catch(e){i.e(e)}finally{i.f()}var l,s=Mt(qe);try{for(s.s();!(l=s.n()).done;){var u=_t(l.value,2);a(u[0],u[1],"synergy")}}catch(e){s.e(e)}finally{s.f()}return function(e){var t,n={},r=Mt(e);try{for(r.s();!(t=r.n()).done;)for(var o=t.value,a=0,i=["upper","lower"];a<i.length;a++){var c=i[a],l="".concat(o[c].id,"|").concat(o.edges[c]);(n[l]||(n[l]=[])).push({spec:o,end:c})}}catch(e){r.e(e)}finally{r.f()}for(var s=function(){var e=d[u];if(e.length<2)return 1;var t=e[0].spec[e[0].end];e.sort((function(e,t){return e.spec.aimX[e.end]-t.spec.aimX[t.end]}));var n=Math.max(0,t.w-40),r=Math.min(15,n/(e.length-1)),o=t.x-r*(e.length-1)/2;e.forEach((function(e,t){e.spec.portX[e.end]=o+t*r}))},u=0,d=Object.values(n);u<d.length;u++)s()}(r),r.map((function(t){var r,o=t.upper,a=t.lower,i=t.gap,c=t.edges,l=t.corridor,s=t.portX,u=s.upper,d=s.lower,f="bottom"===c.upper?o.bottom:o.top,p="top"===c.lower?a.top:a.bottom;if(1===i){var h="".concat(o.layer,"|").concat(a.layer),m=on[h],g=n(h,u,d);r=[[u,f],[u,m.lanes[Math.min(g,m.lanes.length-1)]],[d,m.lanes[Math.min(g,m.lanes.length-1)]],[d,p]]}else if(0===i){var y=un(o),v=n(y.key,u,d),b=on[y.key].lanes[Math.min(v,on[y.key].lanes.length-1)];r=[[u,f],[u,b],[d,b],[d,p]]}else{var w="".concat(o.layer,"|").concat(cn[ln(o.layer)+1]),E="".concat(cn[ln(a.layer)-1],"|").concat(a.layer),x=n(w,u,l),S=n(E,l,d),k=on[w].lanes[Math.min(x,on[w].lanes.length-1)],R=on[E].lanes[Math.min(S,on[E].lanes.length-1)];r=[[u,f],[u,k],[l,k],[l,R],[d,R],[d,p]]}var T=e[t.a],N=e[t.b],O="plugin"===T.kind?T.color:"plugin"===N.kind?N.color:T.color;return{key:t.key,a:t.a,b:t.b,kind:t.kind,tint:O,from:o.id,to:a.id,d:an(r),ports:[r[0],r[r.length-1]]}}))},pn=null,hn=function(e){try{if(!pn){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("width","0"),t.setAttribute("height","0"),t.style.cssText="position:absolute;width:0;height:0;overflow:hidden",pn=document.createElementNS("http://www.w3.org/2000/svg","path"),t.appendChild(pn),document.body.appendChild(t)}return pn.setAttribute("d",e),pn.getTotalLength()}catch(e){return null}},mn=function(e){var t=sn(),n=function(n,r){var o=ln(n.layer),a=ln(r.layer);if(o===a){var i=cn[o+1],c=on["".concat(n.layer,"|").concat(i)]||on["core|workshop"],l=t("j-".concat(n.layer),n.x,r.x),s=c.lanes[Math.min(l,c.lanes.length-1)];return[[n.x,n.y],[n.x,s],[r.x,s],[r.x,r.y]]}var u=_t(o<a?[n,r]:[r,n],2),d=u[0],f=u[1],p=o<a,h=1===Math.abs(o-a)?"".concat(d.layer,"|").concat(f.layer):null;if(h&&on[h]){var m=t("j-".concat(h),n.x,r.x),g=on[h].lanes[Math.min(m,on[h].lanes.length-1)],y=[[d.x,d.y],[d.x,g],[f.x,g],[f.x,f.y]];return p?y:y.slice().reverse()}var v="".concat(d.layer,"|").concat(cn[ln(d.layer)+1]),b="".concat(cn[ln(f.layer)-1],"|").concat(f.layer),w=dn(d.layer,f.layer,(n.x+r.x)/2,e),E=on[v].lanes[0],x=on[b].lanes[on[b].lanes.length-1],S=[[d.x,d.y],[d.x,E],[w,E],[w,x],[f.x,x],[f.x,f.y]];return p?S:S.slice().reverse()},r=function(e){return e.slice(1).reduce((function(t,n,r){return t+Math.hypot(n[0]-e[r][0],n[1]-e[r][1])}),0)};return Ze.map((function(t){var o=t.stops.map((function(t){return e[t]})).filter(Boolean);if(o.length<2)return null;new Set(t.stops).size!==t.stops.length&&console.warn('[meow-board] journey "'.concat(t.id,'" revisits a stop'),t.stops);for(var a="",i=[],c=0;c<o.length-1;c++){var l,s,u=o[c],d=o[c+1],f=n(u,d),p=an(f);a+=0===c?p:p.replace(/^M/," L");var h=f[1][1]>u.y?u.bottom:u.top,m=f[f.length-2][1]<d.y?d.top:d.bottom,g=[[u.x,h]].concat(Lt(f.slice(1,-1)),[[d.x,m]]),y=an(g);i.push({d:y,hopLen:null!==(l=hn(p))&&void 0!==l?l:r(f),len:null!==(s=hn(y))&&void 0!==s?s:r(g),lead:Math.abs(u.y-h),from:{x:u.x,y:h},to:{x:d.x,y:m}})}for(var v=i.reduce((function(e,t){return e+t.hopLen}),0)||1,b=[0],w=0,E=0,x=i;E<x.length;E++)w+=x[E].hopLen,b.push(w/v);return Ct(Ct({},t),{},{d:a,segments:i,fractions:b,accent:ct(t),stopIds:t.stops})})).filter(Boolean)},gn=function(e,t,n){return Math.max(t,Math.min(n,e))},yn=function(e){for(var t=Lt(e),n=t.length-1;n>0;n--){var r=Math.floor(Math.random()*(n+1)),o=[t[r],t[n]];t[n]=o[0],t[r]=o[1]}return t},vn=function(e,t){var n=parseInt(e.slice(1),16);return"rgba(".concat(n>>16&255,", ").concat(n>>8&255,", ").concat(255&n,", ").concat(t,")")},bn={active:1,inactive:.6,none:.34,fixture:.7},wn=function(e,t){var n="plugin"===e.kind?bn[t||"none"]:bn.fixture;return{"--tint":vn(e.color,.3*n),"--tint-strong":vn(e.color,.46*n),"--edge":vn(e.color,.62*n),"--glow":vn(e.color,.55*n)}},En=(Qt=function(e,t,n){return 3*(1-e)*(1-e)*e*t+3*(1-e)*e*e*n+e*e*e},function(e){if(e<=0)return 0;if(e>=1)return 1;for(var t=0,n=1,r=e,o=0;o<24;o++){var a=Qt(r,.5,.2);if(Math.abs(a-e)<1e-5)break;a<e?t=r:n=r,r=(t+n)/2}return Qt(r,0,1)}),xn=(Zt=[],en=1,tn=!1,nn=function(e){return Zt.forEach((function(t){return t.anims.forEach(e)}))},{onRequest:null,register:function(e,t){Zt.push({id:e,anims:t}),t.forEach((function(e){e.playbackRate=en,tn&&e.pause()}))},release:function(e){Zt=Zt.filter((function(t){return t.anims!==e}))},api:{speed:function(e){return en=e,nn((function(t){t.playbackRate=e})),"speed ".concat(e,"x")},pause:function(){return tn=!0,nn((function(e){return e.pause()})),"paused"},play:function(){return tn=!1,nn((function(e){return e.play()})),"playing"},seek:function(e){return tn=!0,nn((function(t){t.pause(),t.currentTime=gn(e,0,1)*t.effect.getTiming().duration})),this.flying()},only:function(e){return xn.onRequest?(xn.onRequest(e),e?"only ".concat(e):"back to all journeys"):"board not mounted"},flying:function(){return Zt.map((function(e){return e.id}))},help:function(){return"meowBoard: .only(id|null) .speed(x) .pause() .play() .seek(0..1) .flying()"}}});"undefined"!=typeof window&&(window.meowBoard=xn.api);var Sn=function(e){var t=e.packet,n=e.onArrive,r=Ht(null),o=Ht([]),a=Ht(null),i=Ht([]);return Ut((function(){try{return function(){var e=function(e){for(var t=e.segments.length,n=1420*t,r=[],o=e.segments.map((function(){return[]})),a=[],i=0;i<t;i++){var c,l=e.segments[i],s=1420*i,u=e.fractions[i],d=e.fractions[i+1];o[i].push({offset:0,drawn:0},{offset:s/n,drawn:0});for(var f=null,p=0;p<=16;p++){var h=En(p/16),m=(s+p/16*980)/n;r.push({offset:m,distance:u+(d-u)*h});var g=gn((h*l.hopLen-l.lead)/l.len,0,1);o[i].push({offset:m,drawn:g}),null===f&&g>0&&(f=m)}o[i].push({offset:1,drawn:1}),a.push(Ct(Ct({},l.from),{},{at:null!==(c=f)&&void 0!==c?c:s/n})),a.push(Ct(Ct({},l.to),{},{at:(s+980)/n})),r.push({offset:(s+980+440)/n,distance:d})}return{total:n,chip:r,segments:o,ports:a}}(t.journey),c={duration:e.total,fill:"forwards"},l=[];r.current&&(l.push(r.current.animate(e.chip.map((function(e){return{offset:e.offset,offsetDistance:"".concat((100*e.distance).toFixed(3),"%")}})),c)),l.push(r.current.animate([{opacity:0},{opacity:1,offset:.06},{opacity:1,offset:.9},{opacity:0}],c))),e.segments.forEach((function(e,t){var n=o.current[t];n&&l.push(n.animate(e.map((function(e){return{offset:e.offset,strokeDashoffset:100-100*e.drawn}})),c))})),a.current&&l.push(a.current.animate([{opacity:0},{opacity:.85,offset:.07},{opacity:.85,offset:.86},{opacity:0}],c)),e.ports.forEach((function(e,t){var n=i.current[t];if(n){var r=gn(e.at,0,1),o=gn(r-.015,0,r),a=gn(.92,r,1);l.push(n.animate([{opacity:0,offset:0},{opacity:0,offset:o},{opacity:1,offset:r},{opacity:1,offset:a},{opacity:0,offset:1}],c))}}));for(var s=[],u=function(e){s.push(setTimeout((function(){return n(t.journey.stopIds[e],t.journey.accent)}),1420*e-440))},d=1;d<=t.journey.segments.length;d++)u(d);return xn.register(t.journey.id,l),function(){xn.release(l),l.forEach((function(e){return e.cancel()})),s.forEach(clearTimeout)}}()}catch(e){return void console.warn("[meow-board] packet animation skipped",e)}}),[]),React.createElement("div",{"aria-hidden":"true",className:"packet".concat(t.live?"":" is-ghost"),style:{"--flight":t.journey.accent,"--flight-soft":vn(t.journey.accent,.45)}},React.createElement("svg",{className:"packet-route",ref:a,viewBox:"0 0 ".concat(yt," ").concat(vt),width:yt,height:vt},t.journey.segments.map((function(e,t){return React.createElement("path",{key:t,ref:function(e){o.current[t]=e},d:e.d,pathLength:"100"})})),t.journey.segments.flatMap((function(e){return[e.from,e.to]})).map((function(e,t){return React.createElement("circle",{key:t,className:"route-port",ref:function(e){i.current[t]=e},cx:e.x,cy:e.y,r:3.5})}))),React.createElement("div",{className:"packet-chip",ref:r,style:{offsetPath:'path("'.concat(t.journey.d,'")')}},React.createElement("span",{className:"chip-glyph"},t.journey.glyph)))},kn=null,Rn=function(e){var t=e.installedPlugins,n=e.view,r=e.onView,o=Bt((function(){var e=et(),t=function(e){var t,n=[],r=Mt(Be);try{var o=function(){var r,o=t.value,a=Kt[o.id],i=o.sections.map((function(t){return Ct(Ct({},t),{},{items:t.items.filter((function(t){return e[t]}))})})).filter((function(e){return e.items.length})),c=i.reduce((function(e,t){return e+t.items.length}),0),l=function(e){return a.weights&&a.weights[e]||1},s=i.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+l(t)}),0)}),0),u=(1052-((c-i.length)*a.gap+34*(i.length-1)))/s,d=208,f=[],p=Mt(i);try{for(p.s();!(r=p.n()).done;){var h,m=r.value,g=d,y=Mt(m.items);try{for(y.s();!(h=y.n()).done;){var v=h.value,b=e[v],w=u*l(v);b.w=w,b.h=a.itemH,b.vertical=a.vertical,b.left=d,b.right=d+w,b.x=d+w/2,b.top=a.y+18+a.headroom,b.bottom=b.top+a.itemH,b.y=b.top+a.itemH/2,d+=w+a.gap}}catch(e){y.e(e)}finally{y.f()}d-=a.gap,f.push(Ct(Ct({},m),{},{left:g,right:d})),d+=34}}catch(e){p.e(e)}finally{p.f()}n.push(Ct(Ct({},o),{},{x:18,y:a.y,w:qt,h:a.h,headroom:a.headroom,sections:f}))};for(r.s();!(t=r.n()).done;)o()}catch(e){r.e(e)}finally{r.f()}return n}(e);return{nodes:e,panels:t,wires:fn(e),journeys:mn(e)}}),[]),a=o.nodes,i=o.panels,c=o.wires,l=o.journeys,s=Ht(null),u=_t(zt(1),2),d=u[0],f=u[1],p=_t(zt(null),2),h=p[0],m=p[1],g=_t(zt(null),2),y=g[0],v=g[1],b=_t(zt(null),2),w=b[0],E=b[1],x=_t(zt([]),2),S=x[0],k=x[1],R=_t(zt(null),2),T=R[0],N=R[1],O=y||h,P=O?a[O]:null;Ut((function(){var e=s.current;if(e){var t=function(){var t=e.clientWidth;t>0&&f(gn(t/yt,.8,1.4))};if(t(),"undefined"==typeof ResizeObserver)return window.addEventListener("resize",t),function(){return window.removeEventListener("resize",t)};var n=new ResizeObserver(t);return n.observe(e),function(){return n.disconnect()}}}),[]);var I=Bt((function(){for(var e={},n=0,r=Object.values(a);n<r.length;n++){var o=r[n];e[o.id]="plugin"===o.kind?nt(o.id,t):"core"}return e}),[a,t]),L=Wt((function(e){return l.filter((function(t){return t.stopIds.includes(e)}))}),[l]),_=!y&&Boolean(h),A=_t(zt(null),2),C=A[0],j=A[1];Ut((function(){return xn.onRequest=j,function(){xn.onRequest=null}}),[]);var M=Bt((function(){if(C){var e=l.filter((function(e){return e.id===C}));if(e.length)return e}if(y){var t=L(y);if(t.length)return t}return l}),[l,L,C,y]);Ut((function(){if((!_||C)&&t&&function(){if(null!==kn)return kn;try{var e=window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;kn=!e&&window.CSS&&CSS.supports("offset-path",'path("M0 0 L1 1")')}catch(e){kn=!1}return kn}()){var e=function(e){return e.needs.every((function(e){return"active"===I[e]}))},n=M.filter(e),r=yn(M.filter((function(t){return!e(t)}))),o=0,a=[],i=null,c=0,l=[],s=function(){if(document.hidden)l.push(setTimeout(s,1200));else{var e=function(){if(!a.length){var e=r.length?Array.from({length:Math.min(3,r.length)},(function(e,t){return r[(3*o+t)%r.length]})):[];if(a=function(e,t){if(!e.length)return Lt(t);if(!t.length)return Lt(e);var n=[],r=e.length/(t.length+1),o=0;for(e.forEach((function(e,a){n.push(e),o<t.length&&a+1>=Math.round(r*(o+1))&&(n.push(t[o]),o++)}));o<t.length;)n.push(t[o++]);return n}(yn(n),e),a.length>1&&i&&a[0].id===i){var t=[a[1],a[0]];a[0]=t[0],a[1]=t[1]}o++}var c=a.shift();return c&&(i=c.id),c}();if(e){c++;var t=e.needs.filter((function(e){return"active"!==I[e]})),u="".concat(e.id,"-").concat(c),d=function(e){return 1420*e.segments.length}(e);k((function(n){return[].concat(Lt(n),[{key:u,journey:e,live:0===t.length,missing:t}])})),C||(l.push(setTimeout((function(){return k((function(e){return e.filter((function(e){return e.key!==u}))}))}),d+120)),l.push(setTimeout(s,d+(y?420:900))))}}};return s(),function(){l.forEach(clearTimeout),k([])}}}),[M,I,_,y,C,t]);var D=Bt((function(){if(!O)return null;var e,t=new Set([O].concat(Lt(tt(O)))),n=Mt(S);try{for(n.s();!(e=n.n()).done;){var r,o=Mt(e.value.journey.stopIds);try{for(o.s();!(r=o.n()).done;){var a=r.value;t.add(a)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}return t}),[O,S]),G=w||(P?P.layer:null),F=Bt((function(){var e,t=new Set,n=Mt(S);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.live||r.missing.forEach((function(e){return t.add(e)}))}}catch(e){n.e(e)}finally{n.f()}return t}),[S]),z=Bt((function(){if(!w)return null;var e=Be.find((function(e){return e.id===w}));return e?new Set(e.items):null}),[w]),U=Bt((function(){if(!P)return null;if("plugin"===P.kind){var e=$e(P.id).map((function(e){return a[e]})).filter(Boolean);return{node:P,partners:e}}var t=tt(P.id).map((function(e){return a[e]})).filter((function(e){return e&&"plugin"===e.kind}));return{node:P,partners:t}}),[P,a]),B=Wt((function(e,t){N({id:e,accent:t}),setTimeout((function(){return N((function(t){return t&&t.id===e?null:t}))}),620)}),[]);return React.createElement(pt,{ref:s,onClick:function(){return v(null)}},React.createElement(Pt,{installedPlugins:t,ready:!!t,node:U&&U.node,partners:U?U.partners:[],states:I,view:n,onView:r}),React.createElement("div",{className:"board-fit",style:{width:yt*d,height:vt*d}},React.createElement(ht,{role:"group","aria-label":"Site map: the outside world, the plugins facing it, WordPress, and the plugins working behind it",style:{transform:"scale(".concat(d,")")},className:O?"is-focused":""},i.map((function(e){return React.createElement("div",{key:e.id,className:"layer-panel is-".concat(e.kind," is-").concat(e.id).concat(G===e.id?" is-lit":""),style:{left:e.x,top:e.y,width:e.w,height:e.h,"--layer":e.accent,"--headroom":"".concat(e.headroom,"px")},tabIndex:0,"aria-label":"".concat(e.title,". ").concat(e.blurb," Shows what this layer connects to."),onMouseEnter:function(){return E(e.id)},onMouseLeave:function(){return E(null)},onFocus:function(){return E(e.id)},onBlur:function(){return E(null)}},React.createElement("div",{className:"layer-label",style:{width:150}},React.createElement("span",{className:"layer-mark"},React.createElement(W.z,{icon:e.icon,width:22,height:22,color:e.accent})),React.createElement("span",{className:"layer-text"},React.createElement("span",{className:"layer-title"},e.title),React.createElement("span",{className:"layer-blurb"},e.blurb))),e.sections.length>1&&e.sections.map((function(t,n){return React.createElement(Yt,{key:t.id},n>0&&React.createElement("span",{"aria-hidden":"true",className:"section-rule",style:{left:t.left-e.x-17}}),React.createElement("span",{className:"section-label",style:{left:t.left-e.x}},t.label))})))})),React.createElement("svg",{"aria-hidden":"true",className:"board-wires",viewBox:"0 0 ".concat(yt," ").concat(vt),width:yt,height:vt},React.createElement("defs",null,React.createElement("marker",{id:"mw-arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"4.5",markerHeight:"4.5",orient:"auto"},React.createElement("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"context-stroke"})),React.createElement("marker",{id:"mw-arrow-back",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"4.5",markerHeight:"4.5",orient:"auto-start-reverse"},React.createElement("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"context-stroke"}))),c.map((function(e){var t=!(O!==e.a&&O!==e.b||"link"!==e.kind&&y!==e.a&&y!==e.b),n=!O&&z&&(z.has(e.a)||z.has(e.b));if(!t&&!n)return null;var r=!I[e.a]||!I[e.b],o=["wire","is-".concat(e.kind)];t&&o.push("is-lit"),n&&o.push("is-survey"),r&&o.push("is-dormant");var i=t?a[O].color:e.tint,c=O===e.from,l=_t(e.ports,2),s=l[0],u=l[1];return React.createElement("g",{key:e.key,className:o.join(" ")},React.createElement("path",{className:"wire-line",d:e.d,stroke:i,markerEnd:t&&c?"url(#mw-arrow)":void 0,markerStart:t&&!c?"url(#mw-arrow-back)":void 0}),t&&React.createElement(React.Fragment,null,React.createElement("path",{className:"wire-flow".concat(c?"":" is-back"),d:e.d,stroke:i}),React.createElement("circle",{className:"wire-port",r:3,fill:i,cx:c?s[0]:u[0],cy:c?s[1]:u[1]})))}))),S.map((function(e){return React.createElement(Sn,{key:e.key,packet:e,onArrive:B})})),Object.values(a).map((function(e){var n,r=I[e.id],o=["node","is-".concat(e.kind),e.vertical?"is-stacked":"is-inline"];e.standout&&o.push("is-standout"),"plugin"===e.kind&&o.push(r?"is-".concat(r):"is-dormant"),O===e.id&&o.push("is-focus"),y===e.id&&o.push("is-pinned"),n=e.id,!Boolean(O)||D&&D.has(n)||o.push("is-dim");var a=T&&T.id===e.id;return a&&o.push("is-pulse"),F.has(e.id)&&o.push("is-wanted"),React.createElement("button",{key:e.id,type:"button",className:o.join(" "),style:Ct(Ct(Ct({left:e.left,width:e.w,"--accent":e.color},wn(e,r)),a?{"--pulse":T.accent,"--pulse-soft":vn(T.accent,.22),"--pulse-glow":vn(T.accent,.35)}:{}),{},{top:e.top,height:e.h}),"aria-label":"plugin"===e.kind?"".concat(e.name,". ").concat(lt(t?r:"unknown"),". ").concat(e.desc):"".concat(e.name,". ").concat(e.desc),onMouseEnter:function(){m(e.id),E(null)},onMouseLeave:function(){return m(null)},onFocus:function(){return m(e.id)},onBlur:function(){return m(null)},"aria-pressed":y===e.id,onClick:function(t){t.stopPropagation(),v((function(t){return t===e.id?null:e.id}))}},React.createElement("span",{className:"node-head"},React.createElement("span",{className:"node-mark"},"plugin"===e.kind?React.createElement("img",{src:e.icon,alt:""}):React.createElement(W.z,{icon:e.iconName,width:"core"===e.kind?21:19,height:"core"===e.kind?21:19,color:e.color})),React.createElement("span",{className:"node-name"},e.name)),"active"===r&&React.createElement("span",{className:"node-dot is-active"}),"inactive"===r&&React.createElement("span",{className:"node-dot is-inactive"}))})))))};function Tn(e){return Tn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tn(e)}function Nn(){return Nn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nn.apply(null,arguments)}function On(){On=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Tn(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Tn(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Pn(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function In(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Pn(a,r,o,i,c,"next",e)}function c(e){Pn(a,r,o,i,c,"throw",e)}i(void 0)}))}}function Ln(e){return function(e){if(Array.isArray(e))return Gn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Dn(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Dn(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}function An(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?An(Object(n),!0).forEach((function(t){jn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jn(e,t,n){return(t=function(e){var t=function(e){if("object"!=Tn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Tn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Tn(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||Dn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Dn(e,t){if(e){if("string"==typeof e)return Gn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gn(e,t):void 0}}function Gn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Fn=wp.element,zn=Fn.useState,Un=Fn.useEffect,Bn=Fn.useMemo,Hn=Fn.useCallback,Wn=Fn.useRef;G&&D&&F||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var Yn="".concat(D,"/meow-common/v1"),Vn=function(){var e=Mn(zn(mr),2),t=e[0],n=e[1],r=function(){var e=!t;n(e),gr(e)};return t?React.createElement(J,{className:"is-folded"},React.createElement("button",{type:"button",className:"intro-peek",onClick:r,title:"A word from Jordy and the Meow Apps team","aria-label":"A word from Jordy and the Meow Apps team"},"?")):React.createElement(J,null,React.createElement("p",null,"Hi! ☀️ Meow Apps isn't your typical plugin suite. It's a passion project led by me, ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://jordymeow.com"},"Jordy Meow"),", and a stellar team. 💕 Based in ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://offbeatjapan.org"},"Japan"),", we focus on making your WordPress experience smoother, faster, and more enjoyable. Ready to level up your site? Check out ",React.createElement("a",{href:"https://meowapps.com",rel:"noreferrer",target:"_blank"},"Meow Apps")," and let's make magic happen! 🌴🙀"),React.createElement("button",{type:"button",className:"intro-fold",onClick:r,title:"Fold this away","aria-label":"Fold this away"},"×"))},qn=Object.keys(Ve).map((function(e){return Cn({slug:e,family:Xe[e]},Ve[e])})),Kn=function(e){var t=e.plugin,n=e.installState,r=e.onPoint;return React.createElement(te,{className:n?"is-".concat(n):"is-dormant",style:{"--accent":it(t.slug,t.family)},onMouseEnter:function(){return r(t.slug)},onMouseLeave:function(){return r(null)}},React.createElement("a",{className:"card-main",href:rt(t.slug),target:"_blank",rel:"noreferrer",title:t.desc,onFocus:function(){return r(t.slug)},onBlur:function(){return r(null)}},React.createElement("span",{className:"card-head"},React.createElement("img",{src:t.icon,alt:""}),React.createElement("span",{className:"card-body"},React.createElement("span",{className:"card-title"},t.name,React.createElement("span",{className:"sr-only"},lt(n)),"active"===n&&React.createElement("i",{"aria-hidden":"true",className:"dot on"}),"inactive"===n&&React.createElement("i",{"aria-hidden":"true",className:"dot off"})),React.createElement("span",{className:"card-role"},t.role))),React.createElement("span",{className:"card-features"},t.features.map((function(e){return React.createElement("span",{key:e,title:e},React.createElement(W.z,{icon:Je(e)||"circle",width:12,height:12}),React.createElement("em",null,e))})))),React.createElement("div",{className:"card-foot"},React.createElement("span",{className:"card-family"},ze[t.family].label),React.createElement("a",{href:rt(t.slug),target:"_blank",rel:"noreferrer"},"Free"),!t.freeOnly&&React.createElement("a",{className:"pro",href:ot(t.slug),target:"_blank",rel:"noreferrer"},"Pro")))},Jn=["fatal","parse","exception","warning","notice"],$n=function(e){var t,n,r,o=new Map,a=[],i=_n(e);try{for(i.s();!(t=i.n()).done;){var c=t.value,l="".concat(c.type,"\0").concat(c.content),s=o.get(l);if(s)s.count+=1,s.oldest=c.date;else{var u={key:l,type:c.type,content:c.content,owner:(n=c.content,r=void 0,r=n.match(/\/(?:mu-plugins|plugins)\/([^/\s]+)/),r||(r=n.match(/\/themes\/([^/\s]+)/))?r[1]:/\/wp-(?:includes|admin)\//.test(n)?"WordPress":null),latest:c.date,oldest:c.date,count:1};o.set(l,u),a.push(u)}}}catch(e){i.e(e)}finally{i.f()}return a},Xn=["Speed","Environment","Errors"],Qn={Speed:"zap",Environment:"server",Errors:"alert-triangle"},Zn={Speed:"How quickly your server answers.",Environment:"Whether PHP gives your site enough room.",Errors:"What your error log is reporting."},er=[["memory_limit","Memory limit"],["max_execution_time","Max execution (s)"],["upload_max_filesize","Max upload"],["post_max_size","Max post size"],["max_input_vars","Max input vars"]],tr=[{key:"environment",label:"Reading your PHP configuration"},{key:"speed",label:"Timing your server"},{key:"errors",label:"Reading the error log"},{key:"plugins",label:"Checking which plugins are installed"},{key:"thinking",label:"Asking AI Engine what it makes of it",slow:!0}],nr=function(e){var t=e.verdict;return React.createElement("div",{className:"analysis-areas"},Xn.map((function(e){var n=t?(t.areas||[]).find((function(t){return t.area===e})):null,r=n?Math.max(1,Math.min(5,Number(n.rating)||1)):0,o=n?r>=4?"good":r>=3?"fair":"poor":"blank";return React.createElement("div",{key:e,className:"analysis-area is-".concat(o)},React.createElement("span",{className:"area-name"},React.createElement(W.z,{icon:Qn[e],width:13,height:13}),e),React.createElement("span",{className:"area-dots","aria-hidden":"true"},[1,2,3,4,5].map((function(e){return React.createElement("i",{key:e,className:e<=r?"on":""})}))),React.createElement("span",{className:"area-label"},n?n.label:"Not rated yet"),React.createElement("span",{className:"area-summary"},n?n.summary:Zn[e]))})))},rr=[{label:"PHP"}].concat(Ln(er.map((function(e){return{label:Mn(e,2)[1]}})))),or=function(e){var t=e.facts,n=t&&t.length>0;return React.createElement("div",{className:"php-facts"},(n?t:rr).map((function(e){return React.createElement("div",{key:e.label,className:"php-fact".concat(n?"":" is-blank")},React.createElement("span",{className:"fact-value"},n?e.value:"—"),React.createElement("span",{className:"fact-label"},e.label))})))},ar=function(e){var t=e.verdict,n=e.facts;return React.createElement("div",{className:"health-top"},React.createElement(nr,{verdict:t}),React.createElement(or,{facts:n}))},ir=function(e){var t=e.title,n=e.icon,r=e.note,o=e.action,a=e.open,i=e.onToggle;return React.createElement("header",{className:"section-head".concat(i?" is-toggle":"").concat(a?" is-open":"")},React.createElement("h3",null,n&&React.createElement(W.z,{icon:n,width:14,height:14}),i?React.createElement("button",{type:"button","aria-expanded":a,onClick:i},t):t),React.createElement("span",{className:"head-note"},r),(o||i)&&React.createElement("span",{className:"head-right"},o,React.createElement("i",{className:"head-caret".concat(i?"":" is-placeholder"),"aria-hidden":"true"})))},cr=function(e){var t=e.status,n=e.busy,r=e.error,o=e.verdict,a=e.step,i=e.open,c=void 0===i||i,l=Mn(zn((function(){return new Set})),2),s=l[0],u=l[1];return t&&!t.installed?React.createElement("div",{className:"analysis-offer"},React.createElement(W.z,{icon:"wand",width:30,height:30}),React.createElement("div",null,React.createElement("strong",null,"Have this site looked over"),React.createElement("span",null,"AI Engine can read everything on this page (your PHP settings, how fast the server answers, what the error log says) and tell you in plain words what is worth fixing."," ","It's free, and runs on your own AI provider key.")),React.createElement("a",{className:"analysis-cta",href:rt("ai-engine"),target:"_blank",rel:"noreferrer"},"Get AI Engine")):t&&!t.ready?React.createElement("div",{className:"analysis-offer"},React.createElement(W.z,{icon:"alert-triangle",width:30,height:30}),React.createElement("div",null,React.createElement("strong",null,"AI Engine needs an API key first"),React.createElement("span",null,"It's installed, but no AI environment is set up yet, so there is nothing to ask. Add a key and this will be ready.")),React.createElement("a",{className:"analysis-cta",href:"admin.php?page=mwai_settings"},"Open AI Engine")):React.createElement("div",{className:"analysis-body"},!n&&!o&&!(null!=t&&t.consented)&&React.createElement("p",{className:"analysis-note"},"Sends your PHP settings, test timings, recent error messages and the names of your Meow plugins to your AI provider. File paths are shortened first."),n&&React.createElement("ol",{className:"analysis-steps"},tr.map((function(e,t){var n=t<a,r=t===a;return React.createElement("li",{key:e.key,className:n?"is-done":r?"is-now":""},React.createElement("i",null),e.label,r&&e.slow&&React.createElement("span",{className:"step-note"},"this one takes a moment"))}))),r&&!n&&React.createElement("div",{className:"analysis-error"},r,React.createElement("span",null,"This uses the ",React.createElement("b",null,"JSON")," row under “Default Environments for AI” in AI Engine's settings, not the Default one. If that row has no model set, it falls back to whatever the environment itself is pointing at.")),c&&o&&!n&&React.createElement("div",{className:"analysis-verdict"},o.conclusion&&React.createElement("p",{className:"analysis-conclusion"},React.createElement("span",null,o.conclusion)),(o.findings||[]).length>0&&React.createElement("ul",{className:"analysis-findings"},o.findings.map((function(e,t){var n=s.has(t);return React.createElement("li",{key:t,className:"is-".concat(e.severity||"low").concat(n?" is-open":"")},React.createElement("button",{type:"button",className:"finding-head","aria-expanded":n,onClick:function(){return function(e){return u((function(t){var n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}))}(t)}},React.createElement("b",null,e.title),React.createElement("em",null,e.area),React.createElement("i",{className:"finding-chevron","aria-hidden":"true"})),n&&React.createElement("div",{className:"finding-more"},React.createElement("span",{className:"finding-detail"},e.detail),e.action&&React.createElement("span",{className:"finding-action"},e.action),e.plugin&&Ve[e.plugin]&&React.createElement("a",{className:"finding-plugin",href:rt(e.plugin),target:"_blank",rel:"noreferrer"},React.createElement("img",{src:Ve[e.plugin].icon,alt:""}),Ve[e.plugin].name,React.createElement("i",null,"by Meow Apps"))))}))),0===(o.findings||[]).length&&React.createElement("p",{className:"analysis-clean"},"Nothing stood out as worth fixing.")))},lr=[],sr=function(e){var t=e.entries,n=e.loaded,r=e.failed,o=e.compact,a=void 0!==o&&o,i=Mn(zn("all"),2),c=i[0],l=i[1],s=t||lr,u=Bn((function(){return $n(s)}),[s]),d=Bn((function(){var e,t={},n=_n(u);try{for(n.s();!(e=n.n()).done;){var r=e.value;t[r.type]=(t[r.type]||0)+1}}catch(e){n.e(e)}finally{n.f()}var o=Jn.filter((function(e){return t[e]})),a=Object.keys(t).filter((function(e){return!Jn.includes(e)})).sort();return[].concat(Ln(o),Ln(a)).map((function(e){return{type:e,count:t[e]}}))}),[u]);Un((function(){"all"===c||d.some((function(e){return e.type===c}))||l("all")}),[d,c]);var f="all"===c?u:u.filter((function(e){return e.type===c}));return a?null:React.createElement(de,null,React.createElement("div",{className:"logs-bar"},u.length>0&&React.createElement("div",{className:"logs-filters",role:"group","aria-label":"Filter by severity"},React.createElement("button",{type:"button","aria-pressed":"all"===c,className:"all"===c?"is-on":"",onClick:function(){return l("all")}},"All ",React.createElement("b",null,u.length)),d.map((function(e){var t=e.type,n=e.count;return React.createElement("button",{key:t,type:"button","aria-pressed":c===t,className:c===t?"is-on":"",style:{"--tone":ue(t)},onClick:function(){return l(t)}},t," ",React.createElement("b",null,n))}))),u.length>0&&React.createElement("span",{className:"logs-meta"},s.length>u.length&&"".concat(s.length," entries in ").concat(u.length," lines · "),"Newest first")),React.createElement("div",{className:"logs-console"},f.map((function(e){return React.createElement("div",{className:"log-row",key:e.key,style:{"--tone":ue(e.type)}},React.createElement("span",{className:"log-head"},React.createElement("span",{className:"log-type"},e.type),React.createElement("span",{className:"log-date"},e.latest),e.owner&&React.createElement("span",{className:"log-owner"},e.owner),e.count>1&&React.createElement("span",{className:"log-count",title:"Logged ".concat(e.count," times, between ").concat(e.oldest," and ").concat(e.latest)},"×",e.count)),React.createElement("span",{className:"log-content"},e.content))})),0===f.length&&React.createElement("div",{className:"logs-blank".concat(r?" is-failed":"")},React.createElement(W.z,{icon:r?"alert-triangle":n?"check-circle":"terminal",width:34,height:34}),React.createElement("strong",null,r?"Could not read the error logs":n?"No errors found":"Error logs not loaded yet"),React.createElement("span",null,r?"The request to your site did not come back. That is usually a security plugin or\n a server rule blocking the REST API. Try again, and if it keeps failing, read the\n log from your hosting control panel instead.":n?"Nothing was written to your PHP error log, or your host doesn't allow reading\n it remotely. If you expected entries here, check your hosting control panel.":"Read the tail of your PHP error log to see recent warnings and fatal errors."))))},ur=[{state:"active",key:"active",label:"Running",note:"Installed and active on this site."},{state:"inactive",key:"inactive",label:"Installed, not active",note:"Switch these on from your Plugins screen to put them to work."},{state:null,key:"none",label:"Not installed",note:"Every one of these has a free version on WordPress.org."}],dr=function(e){var t=e.phpFacts,n=e.speed,r=e.logRows,o=e.logRaw,a=e.states,i=Object.entries(a||{}).filter((function(e){return Mn(e,2)[1]})).map((function(e){var t=Mn(e,2),n=t[0],r=t[1];return"".concat(n," (").concat(r,")")}));return{php:t.reduce((function(e,t){return e[t.label]=t.value,e}),{}),speed:Object.values(n||{}).filter((function(e){return e&&e.samples})).map((function(e){return{test:e.title,averageMs:e.avg,samples:e.samples,verdict:e.verdict}})),errors:{distinctProblems:r.length,totalEntries:o.length,top:r.slice(0,12).map((function(e){return{type:e.type,from:e.owner,times:e.count,message:(t=e.content,t.replace(/\/[^\s'"]*?\/(?:mu-plugins|plugins|themes)\/([^\s'"]+)/g,"$1").replace(/\/[^\s'"]*?\/(wp-includes|wp-admin)\/([^\s'"]+)/g,"$1/$2")).slice(0,220)};var t}))},meowPluginsInstalled:i}},fr=function(e){var t=e.html,n=e.compact,r=void 0!==n&&n,o=e.onSummary,a=Mn(zn(""),2),i=a[0],c=a[1],l=Wn(null),s=Mn(zn({shown:0,total:0,sections:0}),2),u=s[0],d=s[1],f=Mn(zn([]),2),p=f[0],h=f[1],m=Mn(zn({rows:0,sections:0}),2),g=m[0],y=m[1];return Un((function(){var e,t=l.current;if(t){for(var n=Ln(t.querySelectorAll("tr")),r=function(e){var t,r=n.find((function(t){var n=t.querySelector("td.e");return n&&n.textContent.trim().toLowerCase()===e}));return r&&(null===(t=r.querySelector("td.v"))||void 0===t?void 0:t.textContent.trim())||null},o=((null===(e=t.querySelector("h1"))||void 0===e?void 0:e.textContent)||"").replace(/^\s*PHP Version\s*/i,"").trim(),a=o?[{label:"PHP",value:o}]:[],i=0,c=er;i<c.length;i++){var s=Mn(c[i],2),u=s[0],d=s[1],f=r(u);f&&a.push({label:d,value:f})}h(a);var p=n.filter((function(e){return!e.querySelector("th")})).length;y({rows:p,sections:t.querySelectorAll("h2").length})}else h([])}),[t]),Un((function(){o&&o(Cn({facts:p},g))}),[o,p,g]),Un((function(){var e=l.current;if(e){var t=i.trim().toLowerCase(),n=0,r=0;e.querySelectorAll("table").forEach((function(e){var o=0;e.querySelectorAll("tr").forEach((function(e){if(!e.querySelector("th")){n+=1;var r=!t||e.textContent.toLowerCase().includes(t);e.style.display=r?"":"none",r&&(o+=1)}})),r+=o,e.style.display=""!==t&&0===o?"none":""}));var o=Ln(e.querySelectorAll("h2"));o.forEach((function(e){for(var n=e.nextElementSibling,r=!1;n&&"H2"!==n.tagName;)"TABLE"===n.tagName&&"none"!==n.style.display&&(r=!0),n=n.nextElementSibling;e.style.display=""===t||r?"":"none"}));var a=o.filter((function(e){return"none"!==e.style.display})).length;d({shown:r,total:n,sections:a})}}),[i,t]),"string"==typeof t&&""!==t.trim()?React.createElement(le,null,React.createElement("div",{className:r?"php-rest is-hidden":"php-rest"},React.createElement("div",{className:"php-bar"},React.createElement(x.A,{className:"php-search",value:i,onChange:c,placeholder:"Search directives, extensions, values…"}),React.createElement("span",{className:"php-count"},i.trim()?"".concat(u.shown," matching ").concat(1===u.shown?"row":"rows"):"".concat(u.total," rows across ").concat(u.sections," sections"))),React.createElement("div",{className:"php-body",ref:l,dangerouslySetInnerHTML:{__html:t}}),""!==i.trim()&&0===u.shown&&React.createElement("div",{className:"php-blank"},"Nothing matches “",i.trim(),"”."))):React.createElement(le,null,React.createElement("div",{className:"php-body"},React.createElement("div",{className:"php-blank is-empty"},React.createElement(W.z,{icon:"alert-triangle",width:34,height:34}),React.createElement("strong",null,"PHP info isn't available here"),React.createElement("span",null,"Your host has most likely disabled PHP's ",React.createElement("code",null,"phpinfo()")," function. Your hosting control panel will show the same details."))))},pr="meow_dashboard_view",hr="meow_dashboard_intro",mr=function(){try{return"folded"===window.localStorage.getItem(hr)}catch(e){return!1}},gr=function(e){try{window.localStorage.setItem(hr,e?"folded":"open")}catch(e){}},yr=function(){try{return"grid"===window.localStorage.getItem(pr)?"grid":"board"}catch(e){return"board"}},vr=[{request:"empty_request",title:"Empty Request Time",short:"Request",max:2500,good:500,ok:2e3,hint:"How long your server takes to answer a request that does nothing. The baseline everything else sits on top of."},{request:"file_operation",title:"File Operation Time",short:"Disk",max:2600,good:600,ok:2e3,hint:"Writes and removes a temporary 10 MB file, so it reflects how quick your disk is."},{request:"sql_request",title:"SQL Request Time",short:"Database",max:2800,good:500,ok:2e3,hint:"Counts every post in your database. Should land close to the empty request time."}],br=React.createElement(ae,null,React.createElement(ie,null,[{emoji:"🔍",title:"SEO Checklist & Optimization",blurb:"Make your content findable on Google and AI assistants.",href:"https://meowapps.com/tutorial-improve-seo-wordpress/"},{emoji:"⚡️",title:"Optimize Your WordPress Speed",blurb:"Practical tips to make WordPress fast.",href:"https://meowapps.com/tutorial-faster-wordpress-optimize/"},{emoji:"🖼️",title:"Optimize Images (CDN & More)",blurb:"Lighter images, faster pages, happier visitors.",href:"https://meowapps.com/tutorial-optimize-images-wordpress/"},{emoji:"🏠",title:"The Best Hosting Services",blurb:"Pick a host that won't hold your site back.",href:"https://meowapps.com/tutorial-hosting-service-wordpress/"}].map((function(e){return React.createElement(ce,{key:e.href,href:e.href,target:"_blank",rel:"noreferrer"},React.createElement("span",{className:"article-emoji"},e.emoji),React.createElement("span",{className:"article-body"},React.createElement("span",{className:"article-title"},e.title),React.createElement("span",{className:"article-blurb"},e.blurb)),React.createElement("span",{className:"article-arrow"},"→"))})))),wr=function(){var e=In(On().mark((function e(){var t;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(Yn,"/all_settings/"),{method:"POST",nonce:B});case 2:return t=e.sent,e.abrupt("return",t.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Er=function(){var e=In(On().mark((function e(t){var n,r,o;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.value,r=t.id,e.next=3,(0,C.IU)("".concat(Yn,"/update_option"),{method:"POST",nonce:B,json:{name:r,value:n}});case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xr=function(){var e=In(On().mark((function e(){var t;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(Yn,"/installed_plugins/"),{method:"POST",nonce:B});case 2:return t=e.sent,e.abrupt("return",t.data||{});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Sr=function(){var e=In(On().mark((function e(){var t;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(Yn,"/error_logs"),{method:"POST",nonce:B});case 2:return t=e.sent,e.abrupt("return",t.data.reverse());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),kr=function(){var e,t=(0,v.jE)(),n=Mn(zn(!1),2),r=n[0],o=n[1],a=Mn(zn(""),2),i=a[0],c=a[1],l=Mn(zn(yr),2),s=l[0],u=l[1],d=Mn(zn(null),2),f=d[0],p=d[1],h=Mn(zn(0),2),m=h[0],g=h[1],y=(0,w.I)({queryKey:["all_settings"],queryFn:wr}),b=y.data,x=y.error,_=(0,w.I)({queryKey:["installed_plugins"],queryFn:xr,staleTime:6e4}).data,j=(0,E.n)({mutationFn:Er,onSuccess:function(){t.invalidateQueries(["all_settings"])}}),M=(0,E.n)({mutationFn:Sr}),D=null==b?void 0:b.meowapps_hide_meowapps,G=null==b?void 0:b.force_sslverify;Un((function(){x&&!r&&(o(!0),console.error("Error from useQuery",x.message))}),[x]),Un((function(){var e=document.getElementById("meow-common-phpinfo");e&&c(e.innerHTML)}),[]);var F=function(e){u(e),function(e){try{window.localStorage.setItem(pr,e)}catch(e){}}(e),p(null)},z=Bn(et,[]),U=Bn((function(){for(var e={},t=0,n=Object.keys(Ve);t<n.length;t++){var r=n[t];e[r]=nt(r,_)}return e}),[_]),H=Bn((function(){var e=f?z[f]:null;return e?{node:e,partners:$e(e.id).map((function(e){return z[e]})).filter(Boolean)}:{node:null,partners:[]}}),[f,z]),W=Hn((function(e){return p(e)}),[]),Y=Mn(zn({analysis:!1,speed:!1,environment:!1,errors:!1,reading:!1}),2),V=Y[0],q=Y[1],K=function(e){return q((function(t){return Cn(Cn({},t),{},jn({},e,!t[e]))}))},J=Mn(zn({}),2),X=J[0],Q=J[1],te=Mn(zn({facts:[],rows:0,sections:0}),2),re=te[0],ae=te[1],ie=re.facts,ce=Wn({});Un((function(){ce.current=X}),[X]);var le=(0,w.I)({queryKey:["analysis_status"],queryFn:function(){return(0,C.IU)("".concat(Yn,"/analysis_status/"),{method:"POST",nonce:B}).then((function(e){return e.data}))},staleTime:3e5}),se=le.data,ue=le.refetch,de=Mn(zn(0),2),fe=de[0],pe=de[1],he=Mn(zn(null),2),me=he[0],ge=he[1],ye=Mn(zn(null),2),ve=ye[0],be=ye[1],we=Mn(zn(!1),2),Ee=we[0],xe=we[1],Se=ve||(null==se?void 0:se.last)||null,Re=Hn((function(e,t){Q((function(n){var r=n[e];return r&&r.avg===t.avg&&r.samples===t.samples&&r.verdict===t.verdict&&r.failed===t.failed&&r.running===t.running?n:Cn(Cn({},n),{},jn({},e,t))}))}),[]),Te=!!_,Ne=Bn((function(){if(!Te)return[{key:"unknown",label:"Your Meow plugins",note:"Checking which ones are installed…",items:Ln(qn).sort((function(e,t){return e.name.localeCompare(t.name)})).map((function(e){return{plugin:e,state:"unknown"}}))}];var e=qn.map((function(e){return{plugin:e,state:nt(e.slug,_)||null}}));return ur.map((function(t){return Cn(Cn({},t),{},{items:e.filter((function(e){return e.state===t.state})).sort((function(e,t){return e.plugin.name.localeCompare(t.plugin.name)}))})})).filter((function(e){return e.items.length>0}))}),[_,Te]),Oe=Hn(In(On().mark((function e(){var t,n,r,o,a,i,c;return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return xe(!0),ge(null),pe(0),t=function(e){return new Promise((function(t){return setTimeout(t,e)}))},e.prev=4,pe(1),e.next=8,t(280);case 8:if(Object.values(X).some((function(e){return null==e?void 0:e.samples}))){e.next=20;break}g((function(e){return e+1})),n=0;case 11:if(!(n<40)){e.next=20;break}return e.next=14,t(500);case 14:if((r=Object.values(ce.current)).length!==vr.length||!r.every((function(e){return!e.running}))){e.next=17;break}return e.abrupt("break",20);case 17:n++,e.next=11;break;case 20:return pe(2),e.next=23,t(280);case 23:if(o=M.data){e.next=34;break}return e.prev=25,e.next=28,M.mutateAsync();case 28:o=e.sent,e.next=34;break;case 31:e.prev=31,e.t0=e.catch(25),o=[];case 34:return a=$n(o||[]),pe(3),e.next=38,t(280);case 38:return pe(4),e.next=41,t(200);case 41:return i=dr({phpFacts:ie,speed:ce.current,logRows:a,logRaw:o||[],states:U}),e.next=44,(0,C.IU)("".concat(Yn,"/analysis_run/"),{method:"POST",nonce:B,json:{facts:i}});case 44:(c=e.sent).success?(be(c.data),q((function(e){return Cn(Cn({},e),{},{analysis:!0})})),ue()):ge(c.message||"The analysis could not be completed."),e.next=51;break;case 48:e.prev=48,e.t1=e.catch(4),ge((null===e.t1||void 0===e.t1?void 0:e.t1.message)||"The analysis could not be completed.");case 51:return e.prev=51,xe(!1),e.finish(51);case 54:case"end":return e.stop()}}),e,null,[[4,48,51,54],[25,31]])}))),[X,ie,M,U,ue]),Pe=Bn((function(){return vr.some((function(e){var t=X[e.request];return t&&(t.samples||t.running||t.failed)}))?React.createElement("span",{className:"speed-summary"},vr.map((function(e){var t=X[e.request];return React.createElement("em",{key:e.request,className:null!=t&&t.verdict?"is-".concat(t.verdict):""},e.short,React.createElement("b",null,null!=t&&t.failed?"failed":null!=t&&t.running?"…":null!=t&&t.samples?"".concat(t.avg," ms"):"—"))}))):"Your server, timed."}),[X]),Ie=re.rows?"".concat(re.rows," values across ").concat(re.sections," sections."):"Every value PHP reports.",Le=Bn((function(){return function(e,t,n){if(n)return"The log could not be read.";if(!t)return"What PHP is complaining about.";var r=$n(e);if(!r.length)return"Nothing in the log.";var o,a={},i=_n(r);try{for(i.s();!(o=i.n()).done;){var c=o.value;c.owner&&(a[c.owner]=(a[c.owner]||0)+1)}}catch(e){i.e(e)}finally{i.f()}var l=Object.entries(a).sort((function(e,t){return t[1]-e[1]}))[0],s="".concat(r.length," distinct ").concat(1===r.length?"problem":"problems");return"".concat(s," in ").concat(e.length," entries").concat(l?" · mostly ".concat(l[0]):"")}(M.data||lr,M.isSuccess,M.isError)}),[M.data,M.isSuccess,M.isError]),_e=Bn((function(){if(!Se)return"Read together, and explained.";var e=(Se.findings||[]).length,t=0===e?"Nothing worth fixing":"".concat(e," ").concat(1===e?"thing":"things"," worth looking at");return Se.ranAt?"".concat(t," · Last run ").concat(Se.ranAt):t}),[Se]),Ae=Mn(zn(!1),2),Ce=Ae[0],je=Ae[1],Me=Hn(In(On().mark((function e(){return On().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return je(!0),e.prev=1,e.next=4,(0,C.IU)("".concat(Yn,"/analysis_forget/"),{method:"POST",nonce:B});case 4:return be(null),ge(null),e.next=8,ue();case 8:return e.prev=8,je(!1),e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[1,,8,11]])}))),[ue]),De=function(e,t){j.mutate({value:e,id:t})},Ge=React.createElement(S.d,{title:"Main Menu"},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"meowapps_hide_meowapps",variant:"danger",label:"Hide the Meow Apps menu (not recommended)",description:'Removes the Meow Apps menu on the left, and every plugin screen inside it. To bring it back, tick "Show Meow Apps Menu" in Settings → General.',value:"1",disabled:j.isPending,checked:D,onChange:De}))),Fe=React.createElement(S.d,{title:"SSL Verify"},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"force_sslverify",variant:"danger",label:"Force SSL verification (not recommended)",description:"Requires a valid SSL certificate when checking a licence or fetching an update. Hosts with an out-of-date certificate bundle will fail both, which is why it is off by default.",value:"1",disabled:j.isPending,checked:G,onChange:De})));return React.createElement(T.z,{showRestError:r},React.createElement(N.n,{title:"The Dashboard"}),React.createElement(O.N,null,React.createElement(O.Y,{full:!0},React.createElement(P._,{keepTabOnReload:!0},React.createElement(P.V,{title:"Meow Apps"},React.createElement(mt,{className:"grid"===s?"is-grid":""},"grid"===s&&React.createElement(Pt,{installedPlugins:_,ready:Te,node:H.node,partners:H.partners,states:U,view:s,onView:F}),"board"===s&&React.createElement(Rn,{installedPlugins:_,view:s,onView:F}),"grid"===s&&React.createElement(ee,null,Ne.map((function(e){return React.createElement("section",{key:e.key,className:"plugin-group is-".concat(e.key)},React.createElement("header",{className:"group-head"},React.createElement("h3",null,e.label,React.createElement("b",null,e.items.length)),React.createElement("span",{className:"head-note"},e.note)),React.createElement(Z,null,e.items.map((function(e){var t=e.plugin,n=e.state;return React.createElement(Kn,{key:t.slug,plugin:t,installState:n,onPoint:W})}))))})))),React.createElement(Vn,null)),React.createElement(P.V,{title:"Health"},React.createElement(oe,null,React.createElement(ar,{verdict:Se,facts:ie}),React.createElement("section",{className:"health-section is-analysis".concat(V.analysis?" is-open":"")},React.createElement(ir,{title:"Analysis",icon:"wand",note:_e,open:V.analysis,onToggle:Se&&!Ee?function(){return K("analysis")}:null,action:!Ee&&(!se||se.ready)&&React.createElement(I.M,{className:"primary",onClick:Oe},"Start Analysis")}),React.createElement(cr,{status:se,busy:Ee,error:me,verdict:Se,step:fe,open:V.analysis})),React.createElement("section",{className:"health-section".concat(V.speed?" is-open":"")},React.createElement(ir,{title:"Speed",icon:Qn.Speed,note:Pe,open:V.speed,onToggle:function(){return K("speed")},action:React.createElement(I.M,{className:"primary",onClick:function(){return g((function(e){return e+1}))}},"Start Speed Test")}),React.createElement(ne,{className:V.speed?"":"is-hidden"},vr.map((function(e){return React.createElement(ke,Nn({key:e.request},e,{startSignal:m,onResult:Re}))})))),React.createElement("section",{className:"health-section".concat(V.environment?" is-open":"")},React.createElement(ir,{title:"Environment",icon:Qn.Environment,note:Ie,open:V.environment,onToggle:function(){return K("environment")}}),React.createElement(fr,{html:i,compact:!V.environment,onSummary:ae})),React.createElement("section",{className:"health-section".concat(V.errors?" is-open":"")},React.createElement(ir,{title:"Errors",icon:Qn.Errors,note:Le,open:V.errors,onToggle:function(){return K("errors")},action:React.createElement(I.M,{className:"primary",onClick:function(){M.mutate()},disabled:M.isPending,isBusy:M.isPending},"Load Error Logs")}),React.createElement(sr,{entries:M.data,loaded:M.isSuccess,failed:M.isError,compact:!V.errors})),React.createElement("section",{className:"health-section".concat(V.reading?" is-open":"")},React.createElement(ir,{title:"Further reading",icon:"book",note:"Usually it comes down to your host, or how much you ask of it.",open:V.reading,onToggle:function(){return K("reading")}}),V.reading&&br))),React.createElement(P.V,{title:"Settings"},React.createElement(L.z,{title:"Shared Preferences",className:"primary",subtitle:"Settings every Meow Apps plugin on this site shares, and the data the dashboard keeps about it."},D&&React.createElement(A.X,{variant:"warning"},"The Meow Apps menu is hidden right now, so every plugin screen behind it is only reachable by direct link."),((null==se?void 0:se.last)||(null==se?void 0:se.consented))&&React.createElement(S.d,{title:"Site analysis"},React.createElement($,null,React.createElement(I.M,{className:"danger",onClick:Me,disabled:Ce,isBusy:Ce},"Forget the stored analysis"),React.createElement("span",{className:"action-note"},"Removes the saved result and this site's agreement to send data for it.",(null==se||null===(e=se.last)||void 0===e?void 0:e.ranAt)&&" Last run ".concat(se.last.ranAt,".")))),Ge,Fe))))))},Rr=n(8700),Tr=n(4977),Nr=n(6734),Or=n(9794);function Pr(e){return Pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pr(e)}function Ir(){Ir=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Pr(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Pr(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Lr(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function _r(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Lr(a,r,o,i,c,"next",e)}function c(e){Lr(a,r,o,i,c,"throw",e)}i(void 0)}))}}var Ar=function(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t).toString(36)},Cr=function(){setTimeout(_r(Ir().mark((function e(){var t,n,r,o,a,i,c,l,s,u;return Ir().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fetch("".concat(null===(t=window.MWCODE)||void 0===t||null===(t=t.rest_url)||void 0===t?void 0:t.replace(/\/+$/,""),"/meow-licenser/").concat(null===(n=window.MWCODE)||void 0===n?void 0:n.prefix,"/v1/get_license"),{method:"POST",headers:{"X-WP-Nonce":null===(r=window.MWCODE)||void 0===r?void 0:r.rest_nonce}});case 3:if(!(o=e.sent).ok){e.next=9;break}return e.next=7,o.json();case 7:if((a=e.sent).success&&a.data&&a.data.key)if(i=a.data,32===(c=i.key).length&&/^[0-9a-f]{32}$/.test(c)){u=Ar(window.location.hostname);try{localStorage.removeItem(u)}catch(e){}}else if(!i.issue){l=Ar(window.location.hostname);try{s=JSON.stringify({k:c,t:Date.now()}),localStorage.setItem(l,s)}catch(e){}}case 9:e.next=13;break;case 11:e.prev=11,e.t0=e.catch(0);case 13:case"end":return e.stop()}}),e,null,[[0,11]])}))),3e4)},jr=function(){try{var e,t,n=Ar(window.location.hostname);try{var r,o=localStorage.getItem(n);if(o&&null!==(r=window.MWCODE)&&void 0!==r&&r.is_pro)try{var a,i,c,l=JSON.parse(o).t;if(Date.now()-l<288e5)return fetch("".concat(null===(a=window.MWCODE)||void 0===a||null===(a=a.rest_url)||void 0===a?void 0:a.replace(/\/+$/,""),"/meow-licenser/").concat(null===(i=window.MWCODE)||void 0===i?void 0:i.prefix,"/v1/get_license"),{method:"POST",headers:{"X-WP-Nonce":null===(c=window.MWCODE)||void 0===c?void 0:c.rest_nonce}}).then((function(e){if(e.ok)return e.json()})).then((function(e){e&&e.success&&e.data&&e.data.issue&&(localStorage.removeItem(n),window.location.reload())})).catch((function(){})),Cr(),!1;localStorage.removeItem(n)}catch(e){localStorage.removeItem(n)}}catch(e){}var s,u=null===(e=window.MWCODE)||void 0===e?void 0:e.build_ref;if(!u)return null!==(s=window.MWCODE)&&void 0!==s&&s.is_pro&&Cr(),!0;var d,f=function(e){for(var t="",n=0;n<e.length;n++)t+=(e.charCodeAt(n)^"9e1b6a5b15119ef7699943e6210b36e1".charCodeAt(n%32)).toString(16).padStart(2,"0");return t}(u),p="[CRYPTED_CHECKSUM_PIRACY]";if(p===String.fromCharCode(91,67,82,89,80,84,69,68,95,67,72,69,67,75,83,85,77,95,80,73,82,65,67,89,93))return null!==(d=window.MWCODE)&&void 0!==d&&d.is_pro&&Cr(),!0;var h=f===p;return h&&null!==(t=window.MWCODE)&&void 0!==t&&t.is_pro&&Cr(),h}catch(e){return!1}};function Mr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Dr=wp.element.useState,Gr=wp.i18n.__,Fr=function(e){var t=e.notice,n=e.onClose;return React.createElement(Or.n,{isOpen:null!==t,onRequestClose:n,title:(null==t?void 0:t.title)||Gr("Notice",M),content:(null==t?void 0:t.content)||"",okButton:{label:(null==t?void 0:t.closeLabel)||Gr("Close",M),onClick:n}})};function zr(e){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zr(e)}function Ur(){Ur=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==zr(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(zr(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Br(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function Hr(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Br(a,r,o,i,c,"next",e)}function c(e){Br(a,r,o,i,c,"throw",e)}i(void 0)}))}}function Wr(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Vr=wp.element,qr=Vr.useState,Kr=Vr.useEffect,Jr=wp.i18n.__,$r="".concat(D,"/meow-licenser/").concat(j,"/v1"),Xr=function(){var e=Wr(qr(!1),2),t=e[0],n=e[1],r=Wr(qr(!1),2),o=r[0],a=r[1],i=Wr(qr(null),2),c=i[0],l=i[1],s=Wr(qr(null),2),u=s[0],d=s[1],f=Wr(qr(""),2),p=f[0],h=f[1],m=Wr(qr(!1),2),g=m[0],y=m[1],v=Wr(qr(!1),2),b=v[0],w=v[1],E=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Mr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Dr(null),2),t=e[0],n=e[1];return{notice:t,showNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n({title:t.title||Gr("Notice",M),content:e||Gr("An unexpected error occurred.",M),closeLabel:t.closeLabel||Gr("Close",M),onClose:"function"==typeof t.onClose?t.onClose:null})},closeNotice:function(){var e=null==t?void 0:t.onClose;n(null),e&&window.setTimeout(e,0)}}}(),S=E.notice,k=E.showNotice,R=E.closeNotice,T=U&&(!u||"valid"!==u.license),N=function(e){k(e,{title:Jr("License Error",M)})},O=function(){var e=Hr(Ur().mark((function e(){var t;return Ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(z){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.prev=3,e.next=6,(0,C.IU)("".concat($r,"/get_license"),{method:"POST",nonce:B});case 6:if(t=e.sent,d(t.data),!t.data||!t.data.key){e.next=15;break}if(32===t.data.key.length&&/^[0-9a-f]{32}$/.test(t.data.key)||t.data.issue){e.next=14;break}return w(!0),n(!1),e.abrupt("return");case 14:h(t.data.key);case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(3),N(Jr("Error while checking the license. Check your console for more information.",M)),console.error(e.t0);case 21:n(!1);case 22:case"end":return e.stop()}}),e,null,[[3,17]])})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=Hr(Ur().mark((function e(){return Ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,C.IU)("".concat($r,"/set_license"),{method:"POST",nonce:B,json:{serialKey:null}});case 4:e.sent.success&&(h(""),d(null),l("licenseRemoved")),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),N(Jr("Error while removing the license. Check your console for more information.",M)),console.error(e.t0);case 12:n(!1);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),_=function(){var e=Hr(Ur().mark((function e(){var t;return Ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,C.IU)("".concat($r,"/set_license"),{method:"POST",nonce:B,json:{serialKey:p,override:!0}});case 4:(t=e.sent).success&&(d(t.data),t.data&&!t.data.issue&&l("licenseAdded")),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),N(Jr("Error while forcing the license. Check your console for more information.",M)),console.error(e.t0);case 12:n(!1);case 13:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),j=function(){var e=Hr(Ur().mark((function e(){var t;return Ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MEOW_OVERRIDE"!==p){e.next=9;break}if(a(!0),jr()){e.next=6;break}return w(!0),e.abrupt("return");case 6:return d(null),h(""),e.abrupt("return");case 9:return n(!0),e.prev=10,e.next=13,(0,C.IU)("".concat($r,"/set_license"),{method:"POST",nonce:B,json:{serialKey:p}});case 13:(t=e.sent).success&&(d(t.data),t.data&&!t.data.issue&&(y(!1),l("licenseAdded"))),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(10),N(Jr("Error while validating the license. Check your console for more information.",M)),console.error(e.t0);case 21:n(!1);case 22:case"end":return e.stop()}}),e,null,[[10,17]])})));return function(){return e.apply(this,arguments)}}();Kr((function(){z&&(jr()||w(!0))}),[]),Kr((function(){O()}),[]);var D=T?"Forced License":U?"Enabled":"Disabled",G=!b&&(T||u&&"valid"===u.license),F="Your license is active. Thanks a lot for your support :)";T&&(F="This license has been force-enabled for you.",u&&u.check_url&&(F=React.createElement(React.Fragment,null,React.createElement("span",null,F),React.createElement("br",null),React.createElement("small",null,"To check your license status, please click ",React.createElement("a",{target:"_blank",href:u.check_url+"&cache="+642e3*Math.random(),rel:"noreferrer"},"here"),".")))),G||(b?F=React.createElement(React.Fragment,null,React.createElement("p",null,"This copy does not match the official release. It appears to have been tampered with and may contain ",React.createElement("strong",null,"malicious code, spyware, or other security risks"),". For your safety, delete this version immediately and download only from the official source: ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps"),"."),React.createElement("p",null,"If you obtained this from any other website than Meow Apps, ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us")," and dispute the charge with your credit card provider or bank immediately.")):u&&u.key?"no_activations_left"===u.issue?F=React.createElement("span",null,"There are no activations left for this license. You can visit your account at ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===u.issue?F=React.createElement("span",null,"Your license has expired. You can get another license or renew the current one by visiting your account at ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps"),"."):"missing"===u.issue?F="This license does not exist.":"disabled"===u.issue?F="This license has been disabled.":"item_name_mismatch"===u.issue?F="This license seems to be for a different plugin... isn't it? :)":"forced"===u.issue?F="ABC":(F=React.createElement("span",null,"There is an unknown error related to the system or this serial key. Really sorry about this! Make sure your security plugins and systems are off temporarily. If you are still experiencing an issue, please ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us"),"."),console.error({license:u})):F="Please enter your license key below to activate Pro features.");var H=React.createElement(L.z,{title:"Pro Version (Not Installed)",className:"primary"},"You will find more information about the Pro Version ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"here"),". If you actually bought the Pro Version already, please remove the current plugin and download the Pro Version from your account at ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/"},"Meow Apps"),"."),W=React.createElement(L.z,{title:"Pro Version (".concat(D,")"),busy:t,className:"primary"},!b&&!T&&(g||!(u&&u.key===p))&&React.createElement(React.Fragment,null,React.createElement("div",{style:{marginBottom:10}},"License Key:"),React.createElement(x.A,{id:"mfrh_pro_serial",name:"mfrh_pro_serial",disabled:t,value:p,onChange:function(e){return h(e.trim())},placeholder:"Type your license key..."}),React.createElement(Tr.s,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://meowapps.com"},"here"),". If there was an error during the validation, try the ",React.createElement("i",null,"Retry")," to ",React.createElement("i",null,"validate")," button.")),!G&&React.createElement(A.X,{variant:"danger"},F),G&&!g&&React.createElement(A.X,{variant:"success"},F),!b&&React.createElement("div",{style:{marginTop:15,display:"flex",justifyContent:"end",gap:5}},G&&!g&&React.createElement(React.Fragment,null,React.createElement(I.M,{className:"secondary",disabled:t,onClick:j},"Re-Validate License"),React.createElement(I.M,{className:"secondary",disabled:t,onClick:function(){y(!0),h("")}},"Modify License"),React.createElement(I.M,{className:"danger",disabled:t,onClick:P},"Remove License")),G&&g&&React.createElement(React.Fragment,null,React.createElement(I.M,{className:"secondary",disabled:t,onClick:function(){y(!1),h(u&&u.key?u.key:"")}},"Cancel"),React.createElement(I.M,{disabled:t||!p,onClick:j},"Validate License")),!G&&React.createElement(React.Fragment,null,u&&React.createElement(I.M,{className:"secondary",disabled:t||!p,onClick:j},"Retry to validate"),u&&u.key===p&&React.createElement(I.M,{className:"danger",disabled:t||!p,onClick:P},"Remove License"),React.createElement(I.M,{disabled:t||!p||u&&u.key===p,onClick:j},"Validate License"),o&&React.createElement(I.M,{disabled:t||!p||u&&u.key===p,onClick:_,className:"danger"},"Force License"))),React.createElement(Or.n,{isOpen:"licenseAdded"===c,title:"Thank you :)",content:"The Pro features have been enabled. This page should be now reloaded.",okButton:{label:"Reload",onClick:function(){return location.reload()}}}),React.createElement(Or.n,{isOpen:"licenseRemoved"===c,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",okButton:{label:"Reload",onClick:function(){return location.reload()}}}),React.createElement(Fr,{notice:S,onClose:R}));return z?W:H},Qr=wp.i18n.__,Zr={},eo="code-engine";Zr.PENDING=Qr("Pending",eo),Zr.RENAME=Qr("Rename",eo),Zr.TITLE=Qr("Title",eo),Zr.ERROR={SNIPPET_FATAL:Qr("⚠️ A fatal error occured while running the snippet ",eo),SNIPPET_DISABLED:Qr("This snippet has been disabled. This message will disappear automatically when you refresh the page.",eo),UPDATING_OPTIONS:Qr("An error occured while updating the options.",eo),GETTING_OPTIONS:Qr("An error occured while getting the options.",eo),CHECK_YOUR_CONSOLE:Qr('For more information, check <a target="_blank" href="https://meowapps.com/tutorial-network-activity-dev-tools/">your console</a>. You might also want to check your <a target="_blank" href="https://meowapps.com/tutorial-php-error-logs/">PHP Error Logs</a>.',eo)},Zr.ALERTS={ARE_YOU_SURE:Qr("Are you sure?",eo)},Zr.MAINTENANCE={CLEAN_UNINSTALL:Qr("Clean Uninstall",eo),CLEAN_UNINSTALL_DESCRIPTION:Qr("This will delete all the plugin's data from the database when uninstalling.",eo)},Zr.COMMON={YES:Qr("Yes",eo),NO:Qr("No",eo),OK:Qr("OK",eo),CANCEL:Qr("Cancel",eo),CLEAR:Qr("Clear",eo),CLOSE:Qr("Close",eo),SAVE:Qr("Save",eo),SAVE_AND_CLOSE:Qr("Save & Close",eo),UPDATE:Qr("Update",eo),RESET:Qr("Reset",eo),REFRESH:Qr("Refresh",eo),LOADING:Qr("Loading...",eo),RESET_SETTINGS:Qr("Reset Settings",eo),REFRESH_SETTINGS:Qr("Refresh Settings",eo),DELETE:Qr("Delete",eo),CLONE:Qr("Clone",eo),NO_RESULTS:Qr("There aren't any snippets yet.",eo),ADD:Qr("Add",eo),UPLOAD:Qr("Upload",eo),UPLOADING:Qr("Uploading...",eo),EDIT:Qr("Edit",eo),RENAME:Qr("Rename",eo),MAINTENANCE:Qr("Maintenance",eo),SEARCH:Qr("Search",eo),SELECT:Qr("Select",eo),SELECT_ALL:Qr("Select All",eo),UNSELECT_ALL:Qr("Unselect All",eo),ENABLE:Qr("Enable",eo),ENABLE_RECOMMENDED:Qr("Enable (Recommended)",eo),ENABLE_NOT_RECOMMENDED:Qr("Enable (Not Recommended)",eo),DISABLE:Qr("Disable",eo),DISABLE_RECOMMENDED:Qr("Disable (Recommended)",eo),DASHBOARD:Qr("Dashboard",eo),SETTINGS:Qr("Settings",eo),LICENSE_TAB:Qr("License",eo),REFRESH_LOGS:Qr("Refresh Logs",eo),CLEAR_LOGS:Qr("Clear Logs",eo),LOGS:Qr("Logs",eo),HIDE:Qr("Hide",eo),DATA_NOT_AVAILABLE:Qr("Data not available",eo)},Zr.SETTINGS={TITLE:Qr("Settings",eo),HEADER_TITLE:Qr("Code Engine",eo),IMPORT_SETTINGS:Qr("Import Settings & Snippets",eo),EXPORT_SETTINGS:Qr("Export Settings & Snippets",eo),SHOW_TUTORIAL:Qr("Show Tutorial",eo),QUICK_START:Qr("Quick Start",eo),QUICK_START_INFO:Qr("Describe what you are trying to achieve, and Code Engine will generate the code and set up all the parameters for you.",eo),QUICK_START_PLACEHOLDER:Qr("A PHP function that takes a message and send it to an email...",eo),MODULES:{TITLE:Qr("Modules",eo),DESCRIPTION:Qr("Manage the modules and their settings.",eo),CODE_BLOCKS:Qr("Code Blocks",eo),CODE_BLOCKS_DESCRIPTION:Qr("This will let you select all the posts where you want to enable the Code Engine Blocks. Each of these selected posts will allow you to run PHP/JS code directly as Blocks or Shortcodes. However, it is recommended to use the Code Engine Content Snippets instead.",eo),CODE_BLOCKS_SELECTION:Qr("Code Blocks Enabled Posts",eo),CODE_BLOCKS_INSTRUCTIONS:Qr("Instructions",eo),CODE_BLOCKS_INSTRUCTIONS_DESCRIPTION:Qr("The posts you select here will be allowed to use the Code Engine Blocks. This means that any user with the “edit_posts” capability will be able to run PHP/JS code in these posts, either using the Code Engine Block or the Code Engine shortcode with the “code” attribute.",eo),CODE_BLOCKS_INSTRUCTIONS_WARNING:Qr("If you want to include PHP/JS code snippets in your posts that are managed only by an admin, you should create a Content Snippet (PHP/JS) instead. This allows you to reference the code using a shortcode with a unique ID, and it will not be editable by other users. This is the recommended way to use Code Engine in your posts.",eo)},AI_PARAMETERS:{TITLE:Qr("AI Parameters",eo),AI_ENGINE_INSTALLED:Qr("AI Engine",eo),AI_ENGINE_REQUIRED:Qr("AI Engine",eo),DOWNLOAD_AI_ENGINE:Qr("Download AI Engine",eo),AI_SUGGESTIONS:Qr("AI Suggestions",eo),AI_SUGGESTIONS_DESCRIPTION:Qr(" Will add a panel of AI features above the code editor.",eo)},DEVELOPERS:{TITLE:Qr("For Developers",eo),SANITIZE_ARGS:Qr("Sanitize Arguments",eo),SANITIZE_ARGS_DESCRIPTION:Qr("Sanitize the arguments before running the snippet: Make sure the non numeric values are in quotes, and ensure the API arguments' names are using the PHP '$' prefix.",eo),LOGS:Qr("Logs",eo),LOGS_DESCRIPTION:Qr("Enable the server logs for debugging purposes.",eo),DATABASE_INSPECTION:Qr("Database Inspection",eo),DATABASE_INSPECTION_DESCRIPTION:Qr("This will add a new tab in the settings to inspect the plugin's options directly from the databse.",eo),DISALLOW_BLOCK_PHP:Qr("No PHP in Blocks",eo),DISALLOW_BLOCK_PHP_DESCRIPTION:Qr('The Code Engine Block will not be able to run PHP code. This is recommended for security reasons, but you can disable it if you want to use PHP in Blocks. It is recommended to use a Content Snippet (PHP) instead. If disabled, any user with the "edit_posts" capability will be able to run PHP code in Blocks.',eo),BYPASS_SECURITY:Qr("Bypass REST Security",eo),BYPASS_SECURITY_DESCRIPTION:Qr("Disables REST API security checks. Better to use filters mwcode_rest_whitelist or mwcode_rest_authorized for specific routes.",eo),MCP_SUPPORT:Qr("Snippet Management via MCP",eo),MCP_SUPPORT_DESCRIPTION:Qr("Exposes Code Engine's management API (list, create, run, update and delete snippets) as tools on AI Engine's MCP server, so external agents can manage your snippets. This is separate from publishing a single function — to expose one Callable, use its MCP toggle in the Availability section of the snippet. Advanced: enable only if you want agents to manage snippets.",eo),MCP_FUNCTIONS:Qr("Functions via MCP",eo),MCP_FUNCTIONS_DESCRIPTION:Qr("Master switch for exposing individual Callables on AI Engine's MCP server. A function is only published when this is enabled and its own MCP toggle is on. Keep this off unless you want external agents to run your Callables directly.",eo),RAW_EDIT:Qr("Raw Edit",eo)},PREFERENCES:{TITLE:Qr("Preferences",eo),PUBLIC_API:Qr("Public API",eo),SNIPPET_ENDPOINT:Qr("Snippet Endpoint",eo),SNIPPET_ENDPOINT_DESCRIPTION:Qr("This will let you choose for each snippet an endpoint to call it from the outside.",eo),CODE_PREVIEW:Qr("Code Preview",eo),CODE_PREVIEW_DESCRIPTION:Qr("Display code preview inside the snippets table.",eo)},SNIPPETS:Qr("Snippets",eo),SNIPPETS_TABLE_COLUMNS:{SNIPPET:Qr("Snippet",eo),ATTRIBUTES:Qr("Attributes",eo),TYPE:Qr("Type",eo),ACTIVE:Qr("Active",eo),ACTIONS:Qr("Actions",eo),FUNCTION:Qr("Function",eo)},SNIPPET:{PUBLIC_API:Qr("Public API",eo),TOKEN:Qr("Bearer Token",eo),METHOD:Qr("Method",eo),LABEL:Qr("Snippet",eo),TURN_ON:Qr("On",eo),TURN_OFF:Qr("Disabled",eo),RUN:Qr("Run",eo),CODE:Qr("Code",eo),NAME:Qr("Name",eo),TEST:Qr("Test",eo),BEHAVIOR:Qr("Behavior",eo),TARGET:Qr("Target",eo),BEHAVIOR_DYNAMIC:Qr("Allows functions to feedback into the AI for ongoing interactions.",eo),BEHAVIOR_STATIC:Qr("Executes tasks independently, suitable for single, definitive actions.",eo),MCP:Qr("Expose via MCP",eo),MCP_DESCRIPTION:Qr("Register this function as its own tool on the MCP server (AI Engine), callable by external agents like Claude or ChatGPT.",eo),DESCRIPTION:Qr("Description",eo),MISSING_TYPE_WARNING:Qr("Types are missing for the arguments. Add a type to each one to avoid errors.",eo),DEFAULT_VALUE:Qr("Default Value",eo),TAGS:Qr("Tags",eo),TAGS_DESCRIPTION:Qr("Tags separated by commas.",eo),HOURS:Qr("Hours",eo),MINUTES:Qr("Minutes",eo),PRIORITY:Qr("Priority",eo),TIMEFRAME:Qr("Timeframe",eo),TARGET_TIME:Qr("Target Time",eo),TYPE:Qr("Type",eo),READ_COMMENTS:Qr("Query AI (Via Comments)",eo),MODIFY_BEFORE_USE:Qr("Modify before use",eo),ENDPOINT:Qr("Endpoint Slug",eo),ENDPOINT_URL:Qr("The endpoint will be <strong>{0}</strong>",eo),PUBLIC_API_DESCRIPTION:Qr("This feature is in beta. It allows calling this function via the REST API",eo),SCOPES:{ALL:Qr("All",eo),GLOBAL_FRONTEND_BACKEND:Qr("Global (All)",eo),GLOBAL_FRONTEND:Qr("Global (Front)",eo),GLOBAL_BACKEND:Qr("Global (Admin)",eo),CONTENT:Qr("Content",eo),CONTENT_PHP:Qr("Content (PHP)",eo),CONTENT_JS:Qr("Content (JS)",eo),FRONTEND:Qr("Front",eo),BACKEND:Qr("Admin",eo),PERSISTENT:Qr("Global",eo),FUNCTION:Qr("Callable",eo),MCP:Qr("MCP",eo),SCHEDULED:Qr("Scheduled",eo)},SELECT_SNIPPET:Qr("Select a snippet on the left, or click the + button if you want new one.",eo),SELECT_ALL_TAGS:Qr("Select all tags",eo),IMPORT_CODE_SNIPPETS:Qr("Import All Snippets from Code Snippets",eo),DELETE_DUPLICATE_SNIPPETS:Qr("Delete Duplicates",eo),TEST_PARAMETERS_DESCRIPTION_LOG:Qr("Use the <strong>echo (PHP)</strong> or <strong>console.log() (JS)</strong> functions to print anything in the console above.",eo),TEST_PARAMETERS_DESCRIPTION_ARG:Qr("• You can change the default value of the function paramaters in the <strong>Function</strong> tab.",eo)},STRING_VALUE_WARNING:Qr("This value appears to be a string. Ensure to have quotes around it.",eo),ADD_QOUTES:Qr("Add Quotes",eo),EDITOR:Qr("Editor",eo),SIDEBAR_EDITOR:Qr("Sidebar Editor",eo),SUCCESSFULLY_RAN:Qr("Snippet successfully ran: {0}",eo)};const to=Zr;function no(e){return no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},no(e)}function ro(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ro(Object(n),!0).forEach((function(t){ao(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ao(e,t,n){return(t=function(e){var t=function(e){if("object"!=no(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=no(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==no(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function io(){io=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==no(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(no(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function co(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function lo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){co(a,r,o,i,c,"next",e)}function c(e){co(a,r,o,i,c,"throw",e)}i(void 0)}))}}var so=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,C.IU)("".concat(G,"/get_logs"),{nonce:B,method:"GET"});case 3:return t=e.sent,e.abrupt("return",t.data);case 7:throw e.prev=7,e.t0=e.catch(0),new Error(e.t0.message);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}(),uo=function(){var e=lo(io().mark((function e(){return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,C.IU)("".concat(G,"/clear_logs"),{nonce:B});case 3:e.next=8;break;case 5:throw e.prev=5,e.t0=e.catch(0),new Error(e.t0.message);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(){return e.apply(this,arguments)}}(),fo=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/settings/list"),{method:"GET",nonce:B});case 2:if((t=e.sent).success){e.next=5;break}throw new Error(null==t?void 0:t.message);case 5:return e.abrupt("return",t.options);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),po=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/settings/update"),{method:"POST",nonce:B,json:t});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",n.options);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ho=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/settings/reset"),{method:"POST",nonce:B});case 2:if((t=e.sent).success){e.next=5;break}throw new Error(null==t?void 0:t.message);case 5:return e.abrupt("return",t.options);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),mo=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t(!0),e.next=4,(0,C.IU)("".concat(G,"/snippets/delete_duplicates"),{method:"POST",nonce:B});case 4:if((n=e.sent).success){e.next=7;break}throw new Error(null==n?void 0:n.message);case 7:alert(n.data.deleted+" duplicate snippets deleted."),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(0),alert("Error while deleting duplicate snippets. Please check your console."),console.log(e.t0);case 14:return e.prev=14,t(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[0,10,14,17]])})));return function(t){return e.apply(this,arguments)}}(),go=function(){var e=lo(io().mark((function e(t){var n,r,o,a,i,c,l,s,u;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t(!0),n=new Date,e.next=5,fo();case 5:return r=e.sent,e.next=8,Eo({limit:999});case 8:return o=e.sent.snippets,e.next=11,xo();case 11:a=e.sent,i={options:r,snippets:o,functions:a},c="code-engine-".concat(n.getFullYear(),"-").concat(n.getMonth()+1,"-").concat(n.getDate(),".json"),l=new Blob([JSON.stringify(i)],{type:"application/json"}),s=URL.createObjectURL(l),(u=document.createElement("a")).href=s,u.setAttribute("download",c),u.click(),e.next=26;break;case 22:e.prev=22,e.t0=e.catch(0),alert("Error while exporting settings. Please check your console."),console.log(e.t0);case 26:return e.prev=26,t(!1),e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[0,22,26,29]])})));return function(t){return e.apply(this,arguments)}}(),yo=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{(n=document.createElement("input")).type="file",n.accept="application/json",n.onchange=function(){var e=lo(io().mark((function e(n){var r,o;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=n.target.files[0]){e.next=3;break}return e.abrupt("return");case 3:o=new FileReader,t(!0),o.onload=function(){var e=lo(io().mark((function e(t){var n,r,o,a;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=JSON.parse(t.target.result),r=n.options,o=n.snippets,a=n.functions,console.log("Updating settings...",r),e.next=5,po({options:r});case 5:return console.log("Settings updated."),console.log("Updating snippets...",o),e.next=9,Ro(o);case 9:return console.log("Snippets updated."),console.log("Updating functions...",a),e.next=13,So(a);case 13:console.log("Functions updated."),alert("Settings imported. The page will now reload to reflect the changes."),window.location.reload();case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),o.readAsText(r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.click()}catch(e){alert("Error while importing settings. Please check your console."),console.log(e)}finally{t(!1)}case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),vo=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/settings/functions/raw"),{method:"GET",nonce:B});case 2:if((t=e.sent).success){e.next=5;break}throw new Error(null==t?void 0:t.message);case 5:return e.abrupt("return",t.functions);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),bo=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/settings/functions/raw"),{method:"POST",nonce:B,json:{functions:t}});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",n.functions);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),wo=!0,Eo=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return wo=!0,e.next=3,(0,C.IU)("".concat(G,"/snippets/list"),{method:"POST",nonce:B,json:t});case 3:if(n=e.sent,wo=!1,n.success){e.next=7;break}throw new Error(null==n?void 0:n.message);case 7:return e.abrupt("return",{snippets:n.data,total:n.total});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xo=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/settings/functions"),{method:"GET",nonce:B});case 2:if((t=e.sent).success){e.next=5;break}throw new Error(null==t?void 0:t.message);case 5:return e.abrupt("return",t.functions);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),So=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/settings/functions/replace"),{method:"POST",nonce:B,json:{functions:t}});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",{functions:n.data});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ko=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/snippets/tags"),{method:"POST",nonce:B});case 2:if((t=e.sent).success){e.next=5;break}throw new Error(null==t?void 0:t.message);case 5:return e.abrupt("return",{tags:t.data});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ro=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/snippets/replace"),{method:"POST",nonce:B,json:{snippets:t}});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",{snippets:n.data});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),To=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/snippets/import"),{method:"GET",nonce:B});case 2:if((t=e.sent).success){e.next=6;break}throw alert("⚠️ "+(null==t?void 0:t.message)),new Error(null==t?void 0:t.message);case 6:return alert(t.total+" snippets imported."),e.abrupt("return",{total:t.total});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),No=function(){var e=lo(io().mark((function e(){var t;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/snippets/stats"),{method:"GET",nonce:B});case 2:if((t=e.sent).success){e.next=5;break}throw new Error(null==t?void 0:t.message);case 5:return e.abrupt("return",{stats:t.data});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Oo=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/snippets/add"),{method:"POST",nonce:B,json:t});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",{snippet:n.snippet,snippets:n.data,total:n.total});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Po=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/snippets/update"),{method:"POST",nonce:B,json:t});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",{snippets:n.data,total:n.total});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Io=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/snippets/delete"),{method:"POST",nonce:B,json:t});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",{snippets:n.data,total:n.total});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Lo=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/run/test"),{method:"POST",nonce:B,json:oo(oo({},t),{},{test:!0})});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",{result:{return:n.return,error:n.error}});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),_o=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/run/lint"),{method:"POST",nonce:B,json:t});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",{result:n.lint});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ao=function(){var e=lo(io().mark((function e(t){var n;return io().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/quick_start"),{method:"POST",nonce:B,json:{prompt:t}});case 2:if((n=e.sent).success){e.next=5;break}throw new Error(null==n?void 0:n.message);case 5:return e.abrupt("return",n.data);case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function Co(e){return Co="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Co(e)}function jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jo(Object(n),!0).forEach((function(t){Do(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Do(e,t,n){return(t=function(e){var t=function(e){if("object"!=Co(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Co(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Co(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Go(){Go=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Co(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Co(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Fo(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function zo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Fo(a,r,o,i,c,"next",e)}function c(e){Fo(a,r,o,i,c,"throw",e)}i(void 0)}))}}function Uo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Bo(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bo(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Bo(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ho=wp.element,Wo=Ho.useContext,Yo=Ho.createContext,Vo=Ho.useState,qo=Yo(),Ko=function(e){var t=e.children,n=Uo(Vo(H),2),r=n[0],o=n[1],a=Uo(Vo({}),2),i=a[0],c=a[1],l=Uo(Vo(null),2),s=l[0],u=l[1],d=Uo(Vo(!1),2),f=d[0],p=d[1],h=function(e){console.error(to.ERROR.GETTING_OPTIONS,null!=e&&e.message?{message:e.message}:{err:e}),e.message&&u(React.createElement(React.Fragment,null,React.createElement("div",null,to.ERROR.GETTING_OPTIONS),React.createElement("small",null,(0,C.FE)(to.ERROR.CHECK_YOUR_CONSOLE))))},m=function(){var e=zo(Go().mark((function e(){var t;return Go().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return p(!0),e.prev=1,e.next=4,fo();case 4:t=e.sent,o(t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),h(e.t0);case 11:return e.prev=11,p(!1),e.finish(11);case 14:case"end":return e.stop()}}),e,null,[[1,8,11,14]])})));return function(){return e.apply(this,arguments)}}(),g=function(){var e=zo(Go().mark((function e(t,n){var a,i;return Go().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Mo(Mo({},r),{},Do({},n,t)),JSON.stringify(a)!==JSON.stringify(r)){e.next=3;break}return e.abrupt("return");case 3:return p(!0),e.prev=4,e.next=7,po({options:a});case 7:i=e.sent,o(i),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),h(e.t0);case 14:return e.prev=14,p(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[4,11,14,17]])})));return function(t,n){return e.apply(this,arguments)}}(),y=function(){var e=zo(Go().mark((function e(){var t;return Go().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm(to.ALERTS.ARE_YOU_SURE)){e.next=2;break}return e.abrupt("return");case 2:return p(!0),e.prev=3,e.next=6,ho();case 6:t=e.sent,o(t),e.next=14;break;case 10:e.prev=10,e.t0=e.catch(3),console.error(to.ERROR.UPDATING_OPTIONS,null!==e.t0&&void 0!==e.t0&&e.t0.message?{message:e.t0.message}:{err:e.t0}),e.t0.message&&u(React.createElement(React.Fragment,null,React.createElement("div",null,to.ERROR.UPDATING_OPTIONS),React.createElement("small",null,(0,C.FE)(to.ERROR.CHECK_YOUR_CONSOLE))));case 14:return e.prev=14,p(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[3,10,14,17]])})));return function(){return e.apply(this,arguments)}}(),v={updateOption:g,getOption:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null!==(t=r[e])&&void 0!==t?t:n},resetOptions:y,refreshOptions:m,setError:u,setIsLoading:p,setModals:c},b={options:r,error:s,isLoading:f,modals:i};return React.createElement(qo.Provider,{value:{state:b,actions:v}},t,React.createElement(Or.n,{isOpen:s,title:to.COMMON.ERROR,content:s,ok:to.COMMON.CLOSE,onRequestClose:function(){return u(!1)},onOkClick:function(){return u(!1)}}))},Jo=function(){var e=Wo(qo);if(!e)throw new Error("useCoreContext must be used within a CoreContextProvider");return e},$o=n(7494),Xo=n(4694),Qo=n(8482),Zo=n(520),ea=n(1843),ta=n(2557),na=n(3896),ra=n(7571);function oa(e){return oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oa(e)}function aa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?aa(Object(n),!0).forEach((function(t){ca(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ca(e,t,n){return(t=function(e){var t=function(e){if("object"!=oa(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oa(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oa(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var la=function(e,t){if(!e||!t)return e!==t;var n=ia({},e),r=ia({},t);delete n.functionError,delete r.functionError;var o=Object.keys(n).sort().reduce((function(e,t){return e[t]=n[t],e}),{}),a=Object.keys(r).sort().reduce((function(e,t){return e[t]=r[t],e}),{});return JSON.stringify(o)!==JSON.stringify(a)},sa=[{value:"all",label:to.SETTINGS.SNIPPET.SCOPES.ALL,color:"var(--neko-grey)",select_hidden:!0},{value:"global",label:to.SETTINGS.SNIPPET.SCOPES.PERSISTENT,color:"var(--neko-purple)",childScopes:["frontend","backend","persistent"]},{value:"function",label:to.SETTINGS.SNIPPET.SCOPES.FUNCTION,color:"var(--neko-orange)"},{value:"scheduled",label:to.SETTINGS.SNIPPET.SCOPES.SCHEDULED,color:"var(--neko-cyan)"},{value:"disabled",label:to.SETTINGS.SNIPPET.TURN_OFF,select_hidden:!0},{value:"content_js",label:to.SETTINGS.SNIPPET.SCOPES.CONTENT_JS,color:"var(--neko-green)"},{value:"content_php",label:to.SETTINGS.SNIPPET.SCOPES.CONTENT_PHP,color:"var(--neko-green)"}],ua=[{value:"all",label:to.SETTINGS.SNIPPET.SCOPES.ALL},{value:"global",label:to.SETTINGS.SNIPPET.SCOPES.PERSISTENT},{value:"function",label:to.SETTINGS.SNIPPET.SCOPES.FUNCTION},{value:"mcp",label:to.SETTINGS.SNIPPET.SCOPES.MCP},{value:"scheduled",label:to.SETTINGS.SNIPPET.SCOPES.SCHEDULED},{value:"content",label:to.SETTINGS.SNIPPET.SCOPES.CONTENT},{value:"disabled",label:to.SETTINGS.SNIPPET.TURN_OFF}],da=(to.SETTINGS.SNIPPET.SCOPES.GLOBAL_FRONTEND_BACKEND,to.SETTINGS.SNIPPET.SCOPES.GLOBAL_FRONTEND,to.SETTINGS.SNIPPET.SCOPES.GLOBAL_BACKEND,to.SETTINGS.SNIPPET.SCOPES.FUNCTION,to.SETTINGS.SNIPPET.SCOPES.SCHEDULED,to.SETTINGS.SNIPPET.SCOPES.CONTENT_PHP,to.SETTINGS.SNIPPET.SCOPES.CONTENT_JS,{marginTop:10,background:"rgb(0, 72, 88)",padding:10,color:"rgb(58, 212, 58)",maxHeight:220,minHeight:200,display:"block",fontFamily:"monospace",fontSize:12,overflowX:"auto",borderRadius:10,overflowWrap:"break-word"}),fa={id:null,name:"New Snippet",description:"New snippet without a description.",code:"",tags:"",priority:10,scope:"persistent",active:1,endpoint:"",functionName:"",functionArgs:[],functionArgsDict:{},functionBehavior:"dynamic",functionTarget:"php",intervalHours:(new Date).getHours(),intervalMinutes:(new Date).getMinutes()},pa=(to.SETTINGS.SNIPPETS_TABLE_COLUMNS.SNIPPET,to.SETTINGS.SNIPPETS_TABLE_COLUMNS.FUNCTION,to.SETTINGS.SNIPPETS_TABLE_COLUMNS.ENDPOINT,to.SETTINGS.SNIPPETS_TABLE_COLUMNS.TYPE,to.SETTINGS.SNIPPETS_TABLE_COLUMNS.ACTIONS,React.createElement("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{"clip-path":"url(#clip0_323_423)"},React.createElement("path",{d:"M0 0H64V64H0V0Z",fill:"#8F9ED1"}),React.createElement("path",{d:"M21.7412 32.0461L22.0318 30.8851L21.7412 32.0461ZM21.7412 32.0461C21.0578 34.7763 18.616 36.6829 15.803 36.6829M21.7412 32.0461L15.803 36.6829M15.803 36.6829H10.9194M15.803 36.6829H10.9194M10.9194 36.6829L13.361 26.9164H18.9313C19.9227 26.9164 20.8396 27.3638 21.45 28.1449C22.0588 28.9261 22.2706 29.9252 22.0318 30.885L10.9194 36.6829ZM24.1207 26.0585L24.1206 26.0584C22.8634 24.4501 20.9733 23.5276 18.9313 23.5276H10.7526H10.7136L10.7041 23.5655L4.95149 46.5872L4.93597 46.6493H5H8.38837H8.42741L8.43688 46.6114L10.0722 40.0717H15.803C20.1731 40.0717 23.9668 37.1093 25.0274 32.87L24.9789 32.8579L25.0274 32.87L25.3181 31.7074C25.8132 29.7269 25.3763 27.6684 24.1207 26.0585Z",fill:"white",stroke:"white","stroke-width":"0.1"}),React.createElement("path",{d:"M56.2737 32.0461L56.5643 30.8851L56.2737 32.0461ZM56.2737 32.0461C55.5903 34.7763 53.1485 36.6829 50.3355 36.6829M56.2737 32.0461L50.3355 36.6829M50.3355 36.6829H45.4519M50.3355 36.6829H45.4519M45.4519 36.6829L47.8935 26.9164H53.4637C54.4552 26.9164 55.372 27.3638 55.9824 28.1449C56.5912 28.9261 56.8031 29.9252 56.5643 30.885L45.4519 36.6829ZM58.6532 26.0585L58.6531 26.0584C57.3959 24.4501 55.5057 23.5276 53.4637 23.5276H45.2851H45.246L45.2366 23.5655L39.484 46.5872L39.4684 46.6493H39.5325H42.9208H42.9599L42.9693 46.6114L44.6047 40.0717H50.3355C54.7055 40.0717 58.4993 37.1093 59.5599 32.87L59.5114 32.8579L59.5599 32.87L59.8506 31.7074C60.3457 29.7269 59.9088 27.6684 58.6532 26.0585Z",fill:"white",stroke:"white","stroke-width":"0.1"}),React.createElement("path",{d:"M40.9479 25.5534L40.9478 25.5534C39.8994 24.2667 38.3467 23.5276 36.6857 23.5276H31.5329L32.7178 17.0089L32.7285 16.95H32.6686H29.3276H29.2859L29.2784 16.9911L25.0933 40.0127L25.0826 40.0716H25.1425H28.4835H28.5252L28.5327 40.0306L30.9168 26.9164H36.6857C37.3226 26.9164 37.917 27.1987 38.3186 27.6929C38.7205 28.1874 38.8767 28.827 38.7631 29.3829L36.092 40.0094L36.0763 40.0716H36.1405H39.5314H39.5704L39.5799 40.0338L42.0656 30.1417L42.0657 30.1417L42.0661 30.1397C42.4032 28.5143 41.9947 26.8417 40.9479 25.5534Z",fill:"white",stroke:"white","stroke-width":"0.1"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_323_423"},React.createElement("rect",{width:"64",height:"64",fill:"white"}))))),ha=React.createElement("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",xmlns:"http://www.w3.org/2000/svg"},React.createElement("g",{"clip-path":"url(#clip0_323_419)"},React.createElement("path",{d:"M0 0H64V64H0V0Z",fill:"#FFDF00"}),React.createElement("path",{d:"M36.3116 37.1954C37.4119 39.0229 38.8435 40.3661 41.3753 40.3661C43.5022 40.3661 44.8609 39.2847 44.8609 37.7907C44.8609 36.0002 43.465 35.3661 41.1239 34.3245L39.8406 33.7644C36.1364 32.1592 33.6757 30.1482 33.6757 25.8971C33.6757 21.9811 36.609 19 41.1932 19C44.4569 19 46.8032 20.1554 48.494 23.1806L44.4968 25.7913C43.6167 24.1861 42.6673 23.5537 41.1932 23.5537C39.6897 23.5537 38.7368 24.5239 38.7368 25.7913C38.7368 27.3577 39.6906 27.9918 41.8929 28.9621L43.1762 29.5212C47.5376 31.4236 50 33.3631 50 37.7236C50 42.4246 46.3695 45 41.494 45C36.7268 45 33.647 42.6892 32.14 39.6605L36.3116 37.1954ZM18.1784 37.6479C18.9848 39.1032 19.7184 40.3335 21.482 40.3335C23.1685 40.3335 24.2324 39.6623 24.2324 37.0526V19.2982H29.3655V37.123C29.3655 42.5295 26.2493 44.9903 21.7005 44.9903C17.5906 44.9903 15.2105 42.8268 14 40.221L18.1784 37.6479Z",fill:"black"})),React.createElement("defs",null,React.createElement("clipPath",{id:"clip0_323_419"},React.createElement("rect",{width:"64",height:"64",fill:"white"}))));function ma(e){return ma="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ma(e)}function ga(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ga(Object(n),!0).forEach((function(t){va(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ga(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function va(e,t,n){return(t=function(e){var t=function(e){if("object"!=ma(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ma(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ma(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ba(){ba=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==ma(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ma(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function wa(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function Ea(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){wa(a,r,o,i,c,"next",e)}function c(e){wa(a,r,o,i,c,"throw",e)}i(void 0)}))}}function xa(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Sa(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Sa(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Sa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ka,Ra=wp.element,Ta=Ra.useState,Na=Ra.useMemo,Oa=function(e){var t,n=e.onCreated,r=e.onUpdated,o=e.onDeleted,a=e.onTestedSnippet,i=(e.onRanSnippet,e.onError),c=xa(Ta(null),2),l=c[0],s=c[1],u=xa(Ta(!1),2),d=u[0],f=u[1],p=xa(Ta({page:1,limit:10,filters:[{accessor:"scope",value:"all"}],sort:{accessor:"id",by:"asc"}}),2),h=p[0],m=p[1],g=["snippets",h],y=["tags"],b=["stats"],w=(0,v.jE)(),x=(0,ra.E)({queries:[{queryKey:y,queryFn:ko},{queryKey:g,queryFn:function(){return Eo(h)}},{queryKey:b,queryFn:No}]}),S=(x[0].data||{}).tags,k=void 0===S?[]:S,R=x[1].data||{},T=R.snippets,N=void 0===T?[]:T,O=R.total,P=void 0===O?0:O,I=(x[2].data||{}).stats,L=void 0===I?{}:I,_=function(){var e=Ea(ba().mark((function e(){return ba().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f(!0),e.next=3,w.invalidateQueries({queryKey:g});case 3:w.invalidateQueries({queryKey:y}),w.invalidateQueries({queryKey:b}),f(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),A=(0,E.n)({mutationFn:Oo,onSuccess:function(e){_(),s(e.snippet),null==n||n()},onError:function(e){return i(e.message)}}),C=(0,E.n)({mutationFn:Po,onSuccess:(t=Ea(ba().mark((function e(t,n){var o,a;return ba().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_();case 2:null!=(o=w.getQueryData(g))&&o.snippets&&(a=o.snippets.find((function(e){return e.id===n.id})))&&s(a),null==r||r();case 5:case"end":return e.stop()}}),e)}))),function(e,n){return t.apply(this,arguments)}),onError:function(e){return i(e.message)}}),j=(0,E.n)({mutationFn:Io,onSuccess:function(){_(),s(null),null==o||o()}}),M=(0,E.n)({mutationFn:Lo,onSuccess:function(e){var t=e.result;return a(t)},onError:function(e){return i(e.message)}}),D=(0,E.n)({mutationFn:To,onSuccess:function(){_(),null==n||n()},onError:function(e){return i(e.message)}}),G=function(){var e=Ea(ba().mark((function e(t){return ba().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t.id){e.next=6;break}return e.next=3,A.mutateAsync(t);case 3:e.t0=e.sent,e.next=9;break;case 6:return e.next=8,C.mutateAsync(t);case 8:e.t0=e.sent;case 9:return e.abrupt("return",e.t0);case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),F=A.isLoading||C.isLoading||j.isLoading||D.isLoading||M.isLoading||d||wo,z=Na((function(){if(!l)return window.mwcode_block_save_reason=null,!1;if(null!=l&&l.functionNotValid)return window.mwcode_block_save_reason="The function is not valid to save.",!1;if(null!=l&&l.functionError)return window.mwcode_block_save_reason="Resolve the syntax errors in the function code to save.",!1;var e=l.name&&l.code;if(!e)return window.mwcode_block_save_reason="The snippet name or code is missing to save.",e;var t=N.find((function(e){return e.id===l.id})),n=la(t,l);return n||(window.mwcode_block_save_reason=null),n}),[N,l]),U=Na((function(){if(!l)return!1;if(null===(null==l?void 0:l.id))return la(fa,l);var e=N.find((function(e){return e.id===l.id}));return la(e,l)}),[N,l]);return{isProcessing:F,snippets:N,total:P,tags:k,stats:L,onImportCodeSnippets:D.mutate,onCreate:A.mutate,onUpdate:C.mutate,onDelete:j.mutate,onSave:G,onCancel:function(e){var t;return s(null!==(t=N.find((function(t){return t.id===e.id})))&&void 0!==t?t:fa)},onDuplicate:function(e){return A.mutate(ya(ya({},e),{},{id:null,endpoint:"",active:"0"}))},onRunTestOnFunctionSnippet:M.mutate,onRefresh:function(){return _()},tableFilters:h,setTableFilters:m,editSnippet:l,setEditSnippet:s,isSavable:z,isResetable:U}},Pa=n(8668),Ia=n(1594),La=n(4783),_a=n(106),Aa=n(3720),Ca=n(7967),ja=n(1419),Ma=n(1638),Da=n(6898),Ga=n(5230);function Fa(e){return Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fa(e)}function za(){za=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Fa(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Fa(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Ua(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function Ba(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Ua(a,r,o,i,c,"next",e)}function c(e){Ua(a,r,o,i,c,"throw",e)}i(void 0)}))}}function Ha(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||Wa(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wa(e,t){if(e){if("string"==typeof e)return Ya(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ya(e,t):void 0}}function Ya(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Va,qa,Ka=(0,_a.a)({theme:"light",settings:{background:"#ffffff",foreground:"#75baff",caret:"#5d00ff",selection:"#036dd626",lineHighlight:"#8a91991a",gutterBackground:"#fff",gutterForeground:"#8a919966"},styles:[{tag:Aa._A.comment,color:"#787b8099"},{tag:Aa._A.variableName,color:"#0080ff"},{tag:Aa._A.function(Aa._A.variableName),color:"#daa520"},{tag:[Aa._A.string,Aa._A.special(Aa._A.brace)],color:"#ff4500"},{tag:Aa._A.number,color:"#2e8b57"},{tag:Aa._A.bool,color:"#8b0000"},{tag:Aa._A.null,color:"#8b008b"},{tag:Aa._A.keyword,color:"#00008b"},{tag:Aa._A.operator,color:"#daa520"},{tag:Aa._A.className,color:"#8a2be2"},{tag:Aa._A.definition(Aa._A.typeName),color:"#5f9ea0"},{tag:Aa._A.typeName,color:"#b22222"},{tag:Aa._A.angleBracket,color:"#556b2f"},{tag:Aa._A.tagName,color:"#ff8c00"},{tag:Aa._A.attributeName,color:"#6b8e23"},{tag:Aa._A.comment,color:"#787b8099"}]}),Ja=V.Ay.div(ka||(Va=["\n font-size: 13px;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n position: relative;\n\n overflow: auto;\n /* In a full-size modal (~85vh) the chrome (header + footer + paddings) eats\n ~180px. Cap the editor so it always fits inside that content area instead\n of overflowing past the footer. Outside the modal use the looser cap. */\n ","\n\n\n /* CodeMirror draws a dotted focus outline around the editor box; with a short\n snippet in a tall editor it shows as an ugly dotted line under the code. */\n .cm-editor, .cm-editor.cm-focused { outline: none; }\n\n .cm-readonly-prefix {\n background-color: #efefef;\n color: #818181 !important;\n user-select: none;\n padding: 4px;\n }\n\n /* Linting styles */\n .cm-gutter-lint {\n min-width: 20px;\n }\n\n .cm-lintRange-error {\n background-color: #fdd !important;\n }\n\n .cm-lintRange::before {\n content: '✖';\n color: #f00;\n font-size: 1.2em;\n position: absolute;\n margin-left: -20px;\n z-index: 999;\n }\n\n .cm-diagnosticText {\n color: #f00;\n font-size: 1.1em;\n }\n\n .cm-tooltip {\n border-radius: 3px;\n border: none;\n background-color: #fbfbfb;\n color: #f00;\n padding: 5px;\n }\n\n .cm-tooltip-below {\n box-shadow: 0px 8px 7px 0px rgba(0, 0, 0, 0.15);\n }\n\n .cm-diagnosticAction {\n background-color: var(--neko-blue);\n color: #fff;\n padding: 5px 8px;\n border-radius: 3px;\n cursor: pointer;\n }\n\n /* Loading indicator styles */\n .loading-indicator {\n position: absolute;\n top: 10px;\n right: 10px;\n }\n"],qa||(qa=Va.slice(0)),ka=Object.freeze(Object.defineProperties(Va,{raw:{value:Object.freeze(qa)}}))),(function(e){return e.$isModal?"height: calc(85vh - 180px); min-height: 240px;":"max-height: 76vh;"})),$a=function(e){var t=e.code,n=e.snippet,r=e.setCode,o=e.setFunctionError,a=void 0===o?null:o,i=e.isModal,c=void 0===i||i,l=e.onLintTrigger,s=void 0===l?null:l,u=Ha((0,Ia.useState)(t||""),2),d=u[0],f=u[1],p=Ha((0,Ia.useState)(!1),2),h=p[0],m=p[1],g=Ha((0,Ia.useState)(""),2),y=g[0],v=g[1],b=Ha((0,Ia.useState)([]),2),w=b[0],E=b[1],x=(0,Ia.useRef)(null),S=(0,Ia.useRef)(null);(0,Ia.useEffect)((function(){n&&n.externalCode&&n.externalCode!==d&&f(n.externalCode)}),[n]),(0,Ia.useEffect)((function(){s&&s(Ba(za().mark((function e(){var t,n,r;return za().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!x.current||!S.current){e.next=11;break}return t=Date.now(),e.next=4,k(x.current);case 4:if(n=e.sent,x.current.destroyed||x.current.dispatch({effects:S.current.of(n)}),!((r=Date.now()-t)<500)){e.next=10;break}return e.next=10,new Promise((function(e){return setTimeout(e,500-r)}));case 10:return e.abrupt("return",0===n.length);case 11:return e.abrupt("return",!0);case 12:case"end":return e.stop()}}),e)}))))}),[k,s]);var k=(0,Ia.useCallback)(function(){var e=Ba(za().mark((function e(t){var r,o,i,c,l;return za().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!==n.scope||"js"!==(null==n?void 0:n.functionTarget)){e.next=3;break}return null==a||a(!1),e.abrupt("return",[]);case 3:if("content_js"!==n.scope){e.next=6;break}return null==a||a(!1),e.abrupt("return",[]);case 6:if((r=t.state.doc.toString())!==y){e.next=9;break}return e.abrupt("return",w);case 9:return m(!0),null==a||a(!0),e.prev=11,o=r,e.next=15,_o({code:o,snippet:n});case 15:if(i=e.sent,m(!1),v(r),!i.result){e.next=26;break}return c=i.result,l=[{from:t.state.doc.line(c.attributes.startLine).from,to:t.state.doc.line(c.attributes.endLine).to,severity:"error",message:c.message,actions:[{name:"AI Correction",apply:function(){}}]}],E(l),null==a||a(!0),e.abrupt("return",l);case 26:return null==a||a(!1),E([]),e.abrupt("return",[]);case 29:e.next=35;break;case 31:return e.prev=31,e.t0=e.catch(11),m(!1),e.abrupt("return",[]);case 35:case"end":return e.stop()}}),e,null,[[11,31]])})));return function(t){return e.apply(this,arguments)}}(),[n,y,w]),R=(0,Ia.useCallback)((function(e,t){"string"==typeof e&&(f(e),r(e))}),[r]),T=(0,Ia.useMemo)((function(){var e=Ma.Pe.define();S.current=e;var t,n=Ma.sU.define({create:function(){return w},update:function(t,n){var r,o=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Wa(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,i=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==t.return||t.return()}finally{if(i)throw o}}}}(n.effects);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a.is(e))return a.value}}catch(e){o.e(e)}finally{o.f()}return t}}),r=(0,ja.bu)((function(e){return e.state.field(n)}));return[(0,Ca.Q2)(),n,r,Da.w4.of([Ga.Yc]),Da.Lz.lineWrapping,Da.Lz.updateListener.of((function(e){e.docChanged&&(x.current=e.view)})),Da.Lz.domEventHandlers({blur:(t=Ba(za().mark((function t(n,r){var o;return za().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,k(r);case 2:o=t.sent,r.destroyed||r.dispatch({effects:e.of(o)});case 4:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})})]}),[n,w]);return React.createElement(Ja,{$isModal:c},React.createElement(La.Ay,{value:d,onChange:R,onKeyDown:function(e){9===e.keyCode&&e.preventDefault()},theme:Ka,extensions:T,maxHeight:"100%",minHeight:"300px",overflow:"auto",basicSetup:{lineNumbers:!0,highlightActiveLineGutter:!0,highlightActiveLine:!0,foldGutter:!0,dropCursor:!0,allowMultipleSelections:!0,indentOnInput:!0,bracketMatching:!0,closeBrackets:!0,autocompletion:!0,rectangularSelection:!0,crosshairCursor:!0,highlightSelectionMatches:!0}}),h&&React.createElement("div",{className:"loading-indicator"},React.createElement("span",null,"Checking code...")))};function Xa(e){return Xa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xa(e)}function Qa(){Qa=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Xa(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Xa(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Za(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var ti=wp.element.useState,ni=("".concat(F,"/images/wand.png"),function(e){var t=e.code,n=e.setCode,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ei(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ei(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(ti(!1),2),o=r[0],a=r[1],i=function(){var e,t=(e=Qa().mark((function e(t){var r;return Qa().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a(!0),e.next=3,(0,C.IU)("".concat(G,"/ai_read_comments"),{method:"POST",json:{code:t},nonce:B});case 3:(r=e.sent).success?(console.log("AI Suggestions",r.code),n(r.code)):console.error("AI Suggestions",r.message),a(!1);case 6:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Za(a,r,o,i,c,"next",e)}function c(e){Za(a,r,o,i,c,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}();return React.createElement(I.M,{ai:!0,disabled:!t||!t.includes("//"),busy:o,onClick:function(){return i(t)}},to.SETTINGS.SNIPPET.READ_COMMENTS)});function ri(e){return ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ri(e)}function oi(){oi=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==ri(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ri(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function ai(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function ii(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ci(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ci(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ci(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var li=wp.element.useState,si=("".concat(F,"/images/wand.png"),function(e){var t=e.setCode,n=e.close,r=e.snippet,o=ii(li(!1),2),a=o[0],i=o[1],c=ii(li(""),2),l=c[0],s=c[1],u=ii(li(""),2),d=u[0],f=u[1],p=ii(li(!1),2),h=p[0],m=p[1],g=ii(li(!1),2),y=g[0],v=g[1],b=function(){var e,t=(e=oi().mark((function e(t){var n;return oi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i(!0),e.next=3,(0,C.IU)("".concat(G,"/ai_query"),{method:"POST",json:{code:t,query:l},nonce:B});case 3:(n=e.sent).success?(console.log("AI Suggestions",n.code),f(n.code),m(!0)):console.error("AI Suggestions",n.message),i(!1);case 6:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){ai(a,r,o,i,c,"next",e)}function c(e){ai(a,r,o,i,c,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}();return React.createElement(React.Fragment,null,React.createElement(na.m,{value:l,onChange:function(e){return s(e)},disabled:a,rows:2}),React.createElement(Nr.g,{tiny:!0}),React.createElement("div",{style:{display:"flex"}},React.createElement(I.M,{style:{flex:1},className:"secondary",onClick:n},to.COMMON.CANCEL),React.createElement(I.M,{style:{flex:4},className:"primary",busy:a,onClick:function(){return b(r.code)}},to.SETTINGS.SNIPPET.RUN)),React.createElement(Or.n,{isOpen:h,title:to.SETTINGS.SNIPPET.MODIFY_BEFORE_USE,contentWidth:"800px",style:{minWidth:"800px",maxWidth:"800px"},content:React.createElement("div",{style:{height:"calc(100vh - 200px)",overflow:"auto"}},y&&React.createElement(A.X,{variant:"danger"},"⚠️ It looks like there is an error in your code."),React.createElement($a,{snippet:r,code:d,setFunctionError:function(e){v(e)},setCode:function(e){return f(e)}})),onRequestClose:function(){return m(!1)},okButton:{label:to.COMMON.SAVE,disabled:y,onClick:function(){t(d),m(!1),n()}},cancelButton:{label:to.COMMON.CANCEL,onClick:function(){return m(!1)}}}))});function ui(e){return ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ui(e)}function di(){di=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==ui(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ui(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function fi(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var hi,mi,gi,yi=wp.element,vi=yi.useState,bi=yi.useEffect,wi=function(){var e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return pi(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(vi("..."),2),t=e[0],n=e[1];bi((function(){r()}),[]);var r=function(){var e,t=(e=di().mark((function e(){var t;return di().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/server_clock"),{method:"GET",nonce:B});case 2:(t=e.sent).success?(console.log("Wordpress Clock",t.code),n(t.time)):console.error("Wordpress Clock",t.message);case 4:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){fi(a,r,o,i,c,"next",e)}function c(e){fi(a,r,o,i,c,"throw",e)}i(void 0)}))});return function(){return t.apply(this,arguments)}}();return React.createElement("b",null,t)},Ei=n(9985),xi=n(4756);function Si(e){return Si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Si(e)}function ki(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ri(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ki(Object(n),!0).forEach((function(t){Ti(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ki(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ti(e,t,n){return(t=function(e){var t=function(e){if("object"!=Si(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Si(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ni(){Ni=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Si(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Si(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Oi(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function Pi(e){return function(e){if(Array.isArray(e))return _i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Li(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ii(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||Li(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Li(e,t){if(e){if("string"==typeof e)return _i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_i(e,t):void 0}}function _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ai(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ci,ji,Mi,Di=wp.element,Gi=Di.useState,Fi=Di.useEffect,zi=Di.useRef,Ui=("".concat(F,"/images/wand.png"),"".concat(F,"/images/callable.svg")),Bi="".concat(F,"/images/global-back.svg"),Hi="".concat(F,"/images/global-front.svg"),Wi="".concat(F,"/images/global-front-back.svg"),Yi="".concat(F,"/images/scheduled.svg"),Vi="".concat(F,"/images/content.svg"),qi={persistent:"Loaded on every page (front-end and admin).",frontend:"Loaded on public-facing pages only.",backend:"Loaded in the WordPress admin only.",function:"Exposed as a callable function (REST or AI Engine).",scheduled:"Runs once a day at the chosen time.",content_php:"Inserted into a post via shortcode (PHP).",content_js:"Inserted into a post via shortcode (JS)."},Ki=[{value:"global",label:to.SETTINGS.SNIPPET.SCOPES.PERSISTENT},{value:"function",label:to.SETTINGS.SNIPPET.SCOPES.FUNCTION},{value:"scheduled",label:to.SETTINGS.SNIPPET.SCOPES.SCHEDULED},{value:"content",label:to.SETTINGS.SNIPPET.SCOPES.CONTENT}],Ji={global:"persistent",function:"function",scheduled:"scheduled",content:"content_php"},$i=[{value:"persistent",label:"Everywhere (front-end & admin)"},{value:"frontend",label:"Front-end only"},{value:"backend",label:"Admin only"}],Xi=[{value:"content_php",label:"PHP"},{value:"content_js",label:"JavaScript"}],Qi=(0,V.Ay)(Ei.A)(hi||(hi=Ai(["\n padding: 0px;\n border: 1px solid #e0e0e0;\n max-height: 140px;\n margin-top: 5px;\n\n code, pre {\n font-size: 13px;\n font-weight: 500;\n background: none;\n overflow-x: hidden !important;\n }\n"]))),Zi=function(e){var t=e.title,n=e.children;return React.createElement("section",{style:{marginBottom:22}},React.createElement("h3",{style:{margin:"0 0 6px 0",fontSize:15,fontWeight:600,color:"var(--neko-main-color)"}},t),React.createElement("div",{style:{fontSize:13,lineHeight:1.55,color:"var(--neko-font-color)"}},n))},ec=function(e){var t=e.text,n=e.title,r=void 0===n?"Copy":n,o=Ii(Gi(!1),2),a=o[0],i=o[1];return React.createElement("button",{type:"button",className:"dest-copy-btn",onClick:function(){try{navigator.clipboard.writeText(t),i(!0),setTimeout((function(){return i(!1)}),1200)}catch(e){}},title:r},React.createElement(W.z,{icon:a?"check":"copy",width:14,height:14}))},tc=V.Ay.div(mi||(mi=Ai(['\n margin-top: 16px;\n .usage-heading { font-weight: 600; font-size: 13px; margin-bottom: 6px; }\n .usage-card { border: 1px solid #e3e6eb; border-radius: 8px; overflow: hidden; }\n .usage-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }\n .usage-row + .usage-row { border-top: 1px solid #eef0f3; }\n .usage-row.is-off .usage-main { opacity: 0.55; }\n .usage-emoji { font-size: 16px; line-height: 20px; }\n .usage-main { flex: 1; min-width: 0; }\n .usage-title { font-weight: 600; font-size: 13px; }\n .usage-desc { font-size: 12px; color: var(--neko-grey, #6b7280); margin-top: 2px; line-height: 1.45; }\n .usage-code {\n display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; max-width: 100%;\n background: #f3f4f6; border-radius: 6px; padding: 2px 4px 2px 8px;\n }\n .usage-code code { font-family: monospace; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .usage-control { display: flex; align-items: center; gap: 8px; margin-top: 8px; }\n .usage-control-label { font-size: 12px; color: var(--neko-grey, #6b7280); }\n .usage-right { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; }\n .usage-pill { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }\n .pill-on { color: #0f9d58; background: rgba(23, 201, 100, 0.14); }\n .pill-off { color: #6b7280; background: #eef0f3; }\n .pill-info { color: var(--neko-main-color); background: rgba(33, 92, 187, 0.10); }\n\n /* Compact "Destinations" list: collapsed rows show title + status; expand to enable/configure. */\n .dest-namebar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }\n .dest-list { border: 1px solid #e3e6eb; border-radius: 8px; overflow: hidden; }\n .dest-row + .dest-row { border-top: 1px solid #eef0f3; }\n .dest-head { display: flex; align-items: center; gap: 11px; padding: 10px 13px; cursor: pointer; }\n .dest-head:hover { background: #f7f8fa; }\n .dest-row.is-open .dest-head { background: #f3f6fb; }\n .dest-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; box-sizing: border-box; }\n .dest-dot.st-on { background: #17c964; }\n .dest-dot.st-off { background: #c3c8d0; }\n .dest-dot.st-muted { background: transparent; border: 1.5px solid #c3c8d0; }\n .dest-main { flex: 1; min-width: 0; }\n .dest-title { font-weight: 600; font-size: 13px; }\n .dest-substatus { font-size: 11px; color: #9aa1ab; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .dest-chevron { font-size: 18px; line-height: 1; color: #aab0ba; width: 14px; flex-shrink: 0; text-align: center; transition: transform 0.12s ease; }\n .dest-row.is-open .dest-chevron { transform: rotate(90deg); }\n .dest-body { padding: 2px 14px 13px 14px; font-size: 12px; color: var(--neko-grey, #6b7280); line-height: 1.5; }\n .dest-body p { margin: 0 0 8px 0; font-size: 12px; }\n .dest-body code { font-family: inherit; background: none; padding: 0; font-size: inherit; color: var(--neko-font-color, #4a5160); font-weight: 600; }\n .dest-action { display: flex; align-items: center; gap: 10px; margin-top: 8px; }\n .dest-field { margin-top: 8px; }\n .dest-field-label { font-size: 11px; font-weight: 600; color: var(--neko-font-color, #4a5160); margin-bottom: 4px; }\n .dest-help { font-size: 11px; color: #9aa1ab; line-height: 1.45; }\n .dest-chip {\n display: inline-flex; align-items: center; gap: 2px; max-width: 100%;\n background: var(--neko-input-background, #f3f4f6); border: 1px solid var(--neko-input-border, #e3e6eb);\n border-radius: 7px; padding: 2px 3px 2px 9px;\n }\n .dest-chip code { flex: 1; min-width: 0; font-family: inherit; background: none; padding: 0; font-size: 13px; color: var(--neko-font-color, #1f2733); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n .dest-chip-grow { flex: 1; min-width: 0; }\n .dest-copy-btn {\n display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;\n border: none; background: transparent; border-radius: 5px; cursor: pointer; color: #8a93a0; flex-shrink: 0; padding: 0;\n }\n .dest-copy-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--neko-main-color); }\n']))),nc=function(e){var t=e.title,n=e.statusText,r=e.statusVariant,o=e.children,a=Ii(Gi(!1),2),i=a[0],c=a[1];return React.createElement("div",{className:"dest-row".concat(i?" is-open":"")},React.createElement("div",{className:"dest-head",onClick:function(){return c((function(e){return!e}))}},React.createElement("span",{className:"dest-dot ".concat(r)}),React.createElement("div",{className:"dest-main"},React.createElement("div",{className:"dest-title"},t),React.createElement("div",{className:"dest-substatus"},n)),React.createElement("span",{className:"dest-chevron"},"›")),i&&React.createElement("div",{className:"dest-body"},o))},rc=V.Ay.div(gi||(gi=Ai(["\n flex: 1 1 0;\n min-width: 300px;\n ","\n"])),(function(e){return e.$fill?"min-height: 0; overflow-y: auto;":""})),oc=function(e){var t=e.icon,n=e.name,r=e.active,o=e.children;return React.createElement("li",{style:{display:"flex",gap:10,alignItems:"flex-start",padding:"8px 10px",borderRadius:6,background:r?"rgba(33, 92, 187, 0.08)":"transparent",marginBottom:4}},React.createElement("img",{src:t,alt:"",style:{width:22,height:22,flexShrink:0,marginTop:1}}),React.createElement("span",null,React.createElement("strong",{style:{color:r?"var(--neko-main-color)":"inherit"}},n)," — ",o))},ac=function(e){var t=e.scope;return React.createElement("div",null,React.createElement("h2",{style:{margin:"0 0 4px 0",fontSize:18,fontWeight:700}},"How the snippet editor works"),React.createElement("p",{style:{margin:"0 0 22px 0",fontSize:13,color:"var(--neko-font-secondary-color)"}},"A field-by-field guide to configuring a snippet. Toggle ",React.createElement("strong",null,"Help")," off to return to the code editor."),React.createElement(Zi,{title:"Name"},"A short, human label for this snippet — what you'll see in the snippets list. It has no effect on how or where the code runs."),React.createElement(Zi,{title:"Description"},"A longer note for your future self (or your team). Explain what the snippet does and why it exists."),React.createElement(Zi,{title:"Type — where the snippet runs"},React.createElement("p",{style:{margin:"0 0 8px 0"}},"The most important field. It controls ",React.createElement("em",null,"when")," WordPress loads your code and ",React.createElement("em",null,"how")," it can be triggered. The currently selected type is highlighted."),React.createElement("ul",{style:{listStyle:"none",padding:0,margin:0}},React.createElement(oc,{icon:Wi,name:"Global (All)",active:"persistent"===t},"Loaded on every page — both the public site and the WordPress admin. Use for things that need to be wired up everywhere (custom post types, hooks, REST routes)."),React.createElement(oc,{icon:Hi,name:"Global (Front)",active:"frontend"===t},"Loaded only on public-facing pages. Use for front-end-only behavior (template tweaks, public scripts)."),React.createElement(oc,{icon:Bi,name:"Global (Admin)",active:"backend"===t},"Loaded only inside ",React.createElement("code",null,"wp-admin"),". Use for admin-only tools, dashboard widgets, or back-office automation."),React.createElement(oc,{icon:Ui,name:"Callable",active:"function"===t},"Not loaded automatically. Exposed as a callable function — invoke it via the REST API, AI Engine, or your own PHP. Define a clean function signature; arguments are typed in the ",React.createElement("em",null,"Callable")," tab."),React.createElement(oc,{icon:Yi,name:"Scheduled",active:"scheduled"===t},"Runs once a day at the time you set (Hours / Minutes appear when this is selected). Triggered by site visits after the scheduled time has passed — there's no separate cron daemon."),React.createElement(oc,{icon:Vi,name:"Content (PHP)",active:"content_php"===t},"Inserted into a post or page via a generated shortcode. The PHP runs at render time. You can read shortcode attributes via ",React.createElement("code",null,"$mwcode_atts"),"."),React.createElement(oc,{icon:Vi,name:"Content (JS)",active:"content_js"===t},"Same idea as Content (PHP), but the snippet is JavaScript that runs in the visitor's browser when the shortcode renders."))),React.createElement(Zi,{title:"Target (Callable only)"},"Whether the callable runs on the server (PHP) or in the visitor's browser (JS). PHP is the default and is what most callables use."),React.createElement(Zi,{title:"Priority"},"Loading order. Lower numbers load first. The default ",React.createElement("strong",null,"10")," is fine for most cases — change it only if a snippet must hook earlier or later than another (e.g., you need to wrap a function another snippet defines)."),React.createElement(Zi,{title:"Tags"},"Comma-separated keywords for filtering and organizing the snippets list. Purely for your own bookkeeping — they don't change behavior."),React.createElement(Zi,{title:"Behavior (Callable only)"},React.createElement("strong",null,"Dynamic")," lets the callable feed results back to the AI for ongoing conversations."," ",React.createElement("strong",null,"Static")," means it executes once and returns a definitive result — best for one-shot actions."),React.createElement(Zi,{title:"Test tab"},"Runs the snippet in isolation against the database, with logs streamed back to you. Use ",React.createElement("code",null,"echo")," (PHP) or ",React.createElement("code",null,"console.log")," (JS) to emit anything to the test console. For Callables with arguments, you can fill in test values per argument."))},ic=function(e){var t,n,r,o,a,i,c=e.isInline,l=void 0!==c&&c,s=e.onClose,u=e.busy,d=e.isSavable,f=e.onSave,p=e.editSnippet,h=e.setEditSnippet,m=e.editorKey,g=void 0===m?0:m,y=e.onLintReady,v=void 0===y?null:y,b=e.helpMode,w=void 0!==b&&b,E=zi(null),S=Oa({onRanSnippet:function(e){return console.log((0,C.g7)(to.SETTINGS.SUCCESSFULLY_RAN,e))},onTestedSnippet:function(e){return ee(e)},onError:j}),k=S.onRunTestOnFunctionSnippet,R=S.isProcessing;Fi((function(){v&&E.current&&v(E.current)}),[v]);var T,N=Ii(Gi(!1),2),O=N[0],j=N[1],M=Ii(Gi([]),2),D=M[0],F=M[1],z=Ii(Gi(null),2),U=z[0],B=z[1],H=Ii(Gi(!1),2),W=H[0],Y=H[1],V="frontend"===(T=null==p?void 0:p.scope)||"backend"===T||"persistent"===T?"global":"content_php"===T||"content_js"===T?"content":"function"===T||"scheduled"===T?T:"global",q="function"===(null==p?void 0:p.scope),K=q&&"php"===(null==p?void 0:p.functionTarget),J=q&&"js"===(null==p?void 0:p.functionTarget),$="scheduled"===(null==p?void 0:p.scope),X="content_php"===(null==p?void 0:p.scope)||"content_js"===(null==p?void 0:p.scope),Q="content_php"===(null==p?void 0:p.scope),Z=null!==(t=(null==p||null===(n=p.functionArgs)||void 0===n?void 0:n.length)>0&&!(1===(null==p||null===(r=p.functionArgs)||void 0===r?void 0:r.length)&&""===(null==p||null===(o=p.functionArgs)||void 0===o?void 0:o[0])))&&void 0!==t&&t,ee=function(e){var t=(new Date).toLocaleTimeString();if(null!=e&&e.error)F([].concat(Pi(D),[{message:"["+t+"] "+e.error,color:"#ffce44"}]));else{var n=e.return.map((function(e){return{message:"["+t+"] "+e,color:"#00ff51"}}));F([].concat(Pi(D),Pi(n)))}},te=Jo().actions.getOption,ne=function(){var e,t=(e=Ni().mark((function e(t){return Ni().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f(t);case 2:s();case 3:case"end":return e.stop()}}),e)})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Oi(a,r,o,i,c,"next",e)}function c(e){Oi(a,r,o,i,c,"throw",e)}i(void 0)}))});return function(e){return t.apply(this,arguments)}}();Fi((function(){if(q&&null!=p&&p.code){if("js"===(null==p?void 0:p.functionTarget))return;if(null==p||!p.functionTarget)return void h((function(e){return Ri(Ri({},e),{},{functionTarget:"php"})}));var e=p.code,t=(e=(e=e.replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,"$1")).trim().replace(/\n/g,"")).match(/^function\s+(\w+)\s*\((.*?)\)\s*{([\s\S]*)}\s*$/);if(!t)return j("Invalid PHP Function."),void h((function(e){return Ri(Ri({},e),{},{functionNotValid:!0,functionArgs:[],name:""})}));var n=Ii(t,4),r=(n[0],n[1]),o=n[2],a=(n[3],o?o.split(",").map((function(e){return e.trim()})):[]);if(a.some((function(e){return e.includes("=")||e.includes("?")||e.includes(" ")})))return j("Don't use typed arguments in PHP functions. Declare them as normal variables ( e.g. $arg1, $arg2 ). Go into the “Callable” tab and define the types and default values there instead."),void h((function(e){return Ri(Ri({},e),{},{functionNotValid:!0,functionArgs:[],name:""})}));var i=a.filter((function(e){return""!==e&&!e.startsWith("$__mwai_")}));p.functionName===r&&!1===p.functionNotValid&&JSON.stringify(p.functionArgs)===JSON.stringify(i)||h((function(e){return Ri(Ri({},e),{},{functionName:r,functionNotValid:!1,functionArgs:i,name:(null==e?void 0:e.name)||r})})),j(!1)}}),[null==p?void 0:p.code,q,null==p?void 0:p.functionTarget]),Fi((function(){if(q&&null!=p&&p.code){if("php"===(null==p?void 0:p.functionTarget))return;var e=p.code,t=(e=(e=(e=e.replace(/^<script>\s*/,"").replace(/\s*<\/script>$/,"")).replace(/\/\*[\s\S]*?\*\/|([^\\:]|^)\/\/.*$/gm,"$1")).trim()).match(/^(function\s+(\w+)\s*\((.*?)\)\s*{([\s\S]*)})\s*$|^(const|let|var)?\s*(\w+)\s*=\s*(\((.*?)\)|(\w+))\s*=>\s*({([\s\S]*)}|\S.*)\s*$/);if(t&&t[0]===e){var n,r;if(t[1]){var o=Ii(t,5);_=o[0],_=o[1],n=o[2],r=o[3],o[4]}else{var a=Ii(t,10);_=a[0],_=a[1],_=a[2],_=a[3],_=a[4],_=a[5],n=a[6],_=a[7];var i=a[8];r=void 0===i?t[9]:i;var c=a[9];void 0===c&&(t[10]||t[11])}var l=(r?r.split(",").map((function(e){return e.trim()})):[]).filter((function(e){return""!==e}));p.functionName===n&&!1===p.functionNotValid&&JSON.stringify(p.functionArgs)===JSON.stringify(l)||h((function(e){return Ri(Ri({},e),{},{functionName:n,functionNotValid:!1,functionArgs:l,name:(null==e?void 0:e.name)||n})})),j(!1)}else j("Invalid JavaScript Function. Ensure the function is the only code present."),h((function(e){return Ri(Ri({},e),{},{functionNotValid:!0,functionArgs:[],name:""})}))}}),[null==p?void 0:p.code,q,null==p?void 0:p.functionTarget]),Fi((function(){!q||null!=p&&p.name||null==p||!p.functionName||h((function(e){return Ri(Ri({},e),{},{name:null==p?void 0:p.functionName})}))}),[null==p?void 0:p.name,null==p?void 0:p.functionName,q]),Fi((function(){$&&(null==p?void 0:p.intervalTime)<=0&&h((function(e){return Ri(Ri({},e),{},{intervalTime:1})}))}),[null==p?void 0:p.intervalTime,$]);var re,oe,ae,ie,ce,le,se,ue,de,fe,pe,he,me=function(e,t){return React.createElement("div",{style:{marginBottom:10}},React.createElement(Tr.s,{label:!0,style:{display:"block",marginBottom:4,fontWeight:500,color:"var(--neko-main-color)"}},e),t)},ge=function(e){if(e)return!!isNaN(e)&&!/^["'].*["']$/.test(e)},ye=function(e){var t=e.arg,n=e.key;return React.createElement(React.Fragment,null,React.createElement(A.X,{variant:"warning"},to.SETTINGS.STRING_VALUE_WARNING),React.createElement("div",{style:{position:"relative",width:"max-content",left:"200px",bottom:"23px",border:"3px solid white",borderRadius:"5px"}},React.createElement(I.M,{icon:"pencil",onClick:function(){var e;return h(Ri(Ri({},p),{},{functionArgsDict:Ri(Ri({},p.functionArgsDict),{},Ti({},t,Ri(Ri({},p.functionArgsDict[t]),{},Ti({},n,'"'.concat(null===(e=p.functionArgsDict[t])||void 0===e?void 0:e[n],'"')))))}))}}," ",to.SETTINGS.ADD_QOUTES," ")))},ve=function(){var e,t;return(null==p||null===(e=p.functionArgsDict)||void 0===e||null===(e=e[U])||void 0===e?void 0:e.input)||(null==p||null===(t=p.functionArgsDict)||void 0===t||null===(t=t[U])||void 0===t?void 0:t.default)||""};return React.createElement("div",{style:Ri({display:"flex",flexDirection:l?"column":"row",gap:"15px"},l?{}:{flex:1,minHeight:0})},React.createElement(L.z,{busy:u,style:{flex:"3 1 0",marginBottom:0,minWidth:0},contentStyle:Ri({maxWidth:"100%"},l?{}:w?{maxHeight:"calc(85vh - 180px)",overflowY:"auto"}:{})},w?React.createElement(ac,{scope:null==p?void 0:p.scope}):React.createElement(React.Fragment,null,q&&O&&React.createElement(A.X,{variant:"danger",style:{marginBottom:10}},"⚠️ ",O),Q&&React.createElement(A.X,{variant:"info",style:{marginBottom:10}},"You can pass your own attributes to the shortcode and access them in your PHP code using the ",React.createElement("code",null,"$mwcode_atts")," variable as an associative array. For example, if you pass ",React.createElement("code",null,'key="value"')," in the shortcode, you can access it in your code with ",React.createElement("code",null,"$mwcode_atts['key']"),"."),te("ai_suggestions",!1)&&React.createElement(React.Fragment,null,W&&React.createElement(L.z,{style:{marginBottom:15}},React.createElement(si,{snippet:p,close:function(){return Y(!1)},setCode:function(e){h(Ri(Ri({},p),{},{externalCode:e}))}})),!W&&React.createElement("div",{style:{display:"flex",marginBottom:15}},React.createElement(I.M,{ai:!0,disabled:u,onClick:function(){return Y(!W)}},"Query AI"),React.createElement(ni,{code:null==p?void 0:p.code,setCode:function(e){return h(Ri(Ri({},p),{},{externalCode:e}))}}))),React.createElement($a,{key:g,isModal:!l,code:null==p?void 0:p.code,snippet:p,setCode:function(e){h(Ri(Ri({},p),{},{code:e}))},setFunctionError:function(e){h(Ri(Ri({},p),{},{functionError:e}))},onLintTrigger:function(e){E.current=e,v&&v(e)}}))),React.createElement(rc,{$fill:!l},React.createElement(ta.A,null,React.createElement(P._,{inversed:!0,keepTabOnReload:!0},React.createElement(P.V,{title:to.SETTINGS.SNIPPET.LABEL,key:"snippet"},React.createElement(React.Fragment,null,me(to.SETTINGS.SNIPPET.NAME,React.createElement(x.A,{name:"name",disabled:u,value:null==p?void 0:p.name,onChange:function(e){return h(Ri(Ri({},p),{},{name:e}))}})),me(to.SETTINGS.SNIPPET.DESCRIPTION,React.createElement(x.A,{name:"description",value:null==p?void 0:p.description,disabled:u,onChange:function(e){return h(Ri(Ri({},p),{},{description:e}))}})),me(to.SETTINGS.SNIPPET.TYPE,React.createElement(React.Fragment,null,React.createElement(Xo.u,{fullWidth:!0,name:"scope_group",scrolldown:!0,value:V,disabled:u,onChange:function(e){return h(Ri(Ri({},p),{},{scope:Ji[e]}))}},Ki.map((function(e){return React.createElement(Xo.j,{key:e.value,id:e.value,value:e.value,label:e.label})}))),"global"===V&&React.createElement("div",{style:{marginTop:8}},React.createElement(Xo.u,{fullWidth:!0,name:"global_scope",scrolldown:!0,value:null==p?void 0:p.scope,disabled:u,onChange:function(e){return h(Ri(Ri({},p),{},{scope:e}))}},$i.map((function(e){return React.createElement(Xo.j,{key:e.value,id:e.value,value:e.value,label:e.label})})))),"content"===V&&React.createElement("div",{style:{marginTop:8}},React.createElement(Xo.u,{fullWidth:!0,name:"content_scope",scrolldown:!0,value:null==p?void 0:p.scope,disabled:u,onChange:function(e){return h(Ri(Ri({},p),{},{scope:e}))}},Xi.map((function(e){return React.createElement(Xo.j,{key:e.value,id:e.value,value:e.value,label:e.label})})))),React.createElement("p",{style:{fontSize:"var(--neko-small-font-size)",color:"var(--neko-font-secondary-color)",margin:"5px 0 0 0",lineHeight:1.4}},qi[null==p?void 0:p.scope]||"Choose where this snippet runs."))),q&&me(to.SETTINGS.SNIPPET.TARGET,React.createElement(Xo.u,{fullWidth:!0,name:"target",scrolldown:!0,value:null==p?void 0:p.functionTarget,onChange:function(e){return h(Ri(Ri({},p),{},{functionTarget:e}))}},React.createElement(Xo.j,{id:"php",value:"php",label:"PHP (backend)"}),React.createElement(Xo.j,{id:"js",value:"js",label:"JS (frontend)"}))),me(to.SETTINGS.SNIPPET.PRIORITY,React.createElement(x.A,{name:"priority",type:"number",value:null==p?void 0:p.priority,disabled:u,description:"Lower numbers run first when multiple snippets are loaded. Default is 10.",onBlur:function(e){h(Ri(Ri({},p),{},{priority:e}))}})),$&&React.createElement(React.Fragment,null,me(to.SETTINGS.SNIPPET.TARGET_TIME,React.createElement(x.A,{name:"interval_hours",type:"number",value:null==p?void 0:p.intervalHours,disabled:u,max:23,min:0,onBlur:function(e){return h(Ri(Ri({},p),{},{intervalHours:e}))},description:to.SETTINGS.SNIPPET.HOURS})),me(to.SETTINGS.SNIPPET.MINUTES,React.createElement(x.A,{name:"interval_minutes",type:"number",value:null==p?void 0:p.intervalMinutes,disabled:u,max:59,min:0,onBlur:function(e){return h(Ri(Ri({},p),{},{intervalMinutes:e}))},description:to.SETTINGS.SNIPPET.MINUTES})),React.createElement(Nr.g,{tiny:!0}),React.createElement("small",null,"The action will trigger when someone visits your WordPress site if the scheduled time has passed. For your WordPress server the time is ",React.createElement(wi,null),". "),React.createElement(Nr.g,{tiny:!0})),X&&React.createElement(React.Fragment,null,"A shortcode will be generated to use this snippet in your posts or pages."),me(to.SETTINGS.SNIPPET.TAGS,React.createElement(x.A,{isCommaSeparatedArray:!0,name:"tags",value:null==p?void 0:p.tags,disabled:u,onFinalChange:function(e){return h(Ri(Ri({},p),{},{tags:e}))},description:to.SETTINGS.SNIPPET.TAGS_DESCRIPTION})),l&&React.createElement(I.M,{className:"primary",disabled:u||!d,style:{marginTop:"10px"},onClick:function(){return ne(p)}},to.COMMON.SAVE))),q&&React.createElement(P.V,{title:to.SETTINGS.SNIPPET.SCOPES.FUNCTION,key:"function"},me(to.SETTINGS.SNIPPET.NAME,React.createElement(x.A,{name:"name",disabled:!0,value:null==p?void 0:p.functionName,onChange:function(e){return h(Ri(Ri({},p),{},{functionName:e}))}})),React.createElement(Pa.aD,null,null==p||null===(a=p.functionArgs)||void 0===a?void 0:a.map((function(e){return""===e||"js"!==(null==p?void 0:p.functionTarget)&&"$"!==e[0]?null:React.createElement(Pa.YQ,{key:e,title:e},(t=e,React.createElement(React.Fragment,null,me(to.SETTINGS.SNIPPET.NAME,React.createElement(x.A,{disabled:!0,name:"name",value:t})),me(to.SETTINGS.SNIPPET.TYPE,React.createElement(Xo.u,{fullWidth:!0,name:"type",scrolldown:!0,value:null==p||null===(n=p.functionArgsDict)||void 0===n||null===(n=n[t])||void 0===n?void 0:n.type,onChange:function(e){return h(Ri(Ri({},p),{},{functionArgsDict:Ri(Ri({},p.functionArgsDict),{},Ti({},t,Ri(Ri({},p.functionArgsDict[t]),{},{type:e})))}))}},React.createElement(Xo.j,{id:"string",value:"string",label:"String"}),React.createElement(Xo.j,{id:"number",value:"number",label:"Number"}),React.createElement(Xo.j,{id:"boolean",value:"boolean",label:"Boolean"}),React.createElement(Xo.j,{id:"array",value:"array",label:"Array"}),React.createElement(Xo.j,{id:"object",value:"object",label:"Object"}),React.createElement(Xo.j,{id:"mixed",value:"mixed",label:"Mixed"}))),me(to.SETTINGS.SNIPPET.DESCRIPTION,React.createElement(x.A,{disabled:u,name:"desc",value:null==p||null===(r=p.functionArgsDict)||void 0===r||null===(r=r[t])||void 0===r?void 0:r.desc,onBlur:function(e){return h(Ri(Ri({},p),{},{functionArgsDict:Ri(Ri({},p.functionArgsDict),{},Ti({},t,Ri(Ri({},p.functionArgsDict[t]),{},{desc:e})))}))}})),me(to.SETTINGS.SNIPPET.DEFAULT_VALUE,React.createElement(x.A,{disabled:u,name:"default",value:null==p||null===(o=p.functionArgsDict)||void 0===o||null===(o=o[t])||void 0===o?void 0:o.default,onBlur:function(e){return h(Ri(Ri({},p),{},{functionArgsDict:Ri(Ri({},p.functionArgsDict),{},Ti({},t,Ri(Ri({},p.functionArgsDict[t]),{},{default:e})))}))}})),!te("sanitize_arguments",!0)&&ge(null==p||null===(a=p.functionArgsDict)||void 0===a||null===(a=a[t])||void 0===a?void 0:a.default)&&ye({arg:t,key:"default"}))));var t,n,r,o,a}))),!Z&&React.createElement(A.X,{variant:"info"},"No parameters in the function"),q&&(ie=te("ai_engine_status",!1),ce=!(null==p||!p.functionMcp),le=te("api_endpoint",!1),se=null==p?void 0:p.functionName,ue=(null==p?void 0:p.name)||se,fe=(de=null==p?void 0:p.endpoint)?"".concat(G,"/snippets-endpoint/").concat(de):"",pe=le&&!!de,he=to.SETTINGS.SNIPPET[null!=p&&p.functionBehavior?"BEHAVIOR_".concat(p.functionBehavior.toUpperCase()):"BEHAVIOR_DYNAMIC"],React.createElement(tc,null,React.createElement("div",{className:"usage-heading"},"Destinations"),se&&React.createElement("div",{className:"dest-namebar"},React.createElement("span",{className:"usage-control-label"},"Function name"),React.createElement("span",{className:"dest-chip dest-chip-grow"},React.createElement("code",null,se),React.createElement(ec,{text:se,title:"Copy function name"}))),React.createElement("div",{className:"dest-list"},React.createElement(nc,{title:"AI Engine",statusText:ie?"Available in AI Engine":"AI Engine is not installed",statusVariant:ie?"st-on":"st-muted"},React.createElement("p",null,"Selectable as a function-calling tool inside your AI Engine chatbots and assistants."),ie&&React.createElement("div",{className:"dest-field"},React.createElement("div",{className:"dest-field-label"},to.SETTINGS.SNIPPET.BEHAVIOR),React.createElement(Xo.u,{name:"behavior",scrolldown:!0,value:null==p?void 0:p.functionBehavior,onChange:function(e){return h(Ri(Ri({},p),{},{functionBehavior:e}))}},React.createElement(Xo.j,{id:"dynamic",value:"dynamic",label:"Dynamic"}),React.createElement(Xo.j,{id:"static",value:"static",label:"Static"})),React.createElement("div",{className:"dest-help",style:{marginTop:4}},he))),K&&React.createElement(nc,{title:"MCP Server",statusText:ce?"Enabled":"Disabled",statusVariant:ce?"st-on":"st-off"},React.createElement("p",null,"Publish this function as its own tool on AI Engine's MCP server, callable by external agents (Claude, ChatGPT, Claude Code). Independent of the snippet-management API in Settings."),React.createElement("div",{className:"dest-action"},React.createElement(Qo.S,{onValue:"1",offValue:"0",onLabel:"ON",offLabel:"OFF",width:"64px",checked:ce,onChange:function(e){return h(Ri(Ri({},p),{},{functionMcp:"1"===e}))}}),React.createElement("span",{className:"dest-help"},"Expose on the MCP server"))),React.createElement(nc,{title:"Workflow Engine",statusText:"Available when installed",statusVariant:"st-muted"},React.createElement("p",null,"When Workflow Engine is installed, this function appears as its own step on the canvas, named after the snippet (",React.createElement("code",null,ue),").")),K&&React.createElement(nc,{title:"REST Endpoint",statusText:pe?"Enabled":le?"No endpoint set":"Public API is off",statusVariant:pe?"st-on":le?"st-off":"st-muted"},React.createElement("p",null,le?de?"Trigger it from Make.com, n8n, a webhook, or any HTTP client.":"Set an endpoint in the Public API tab to get a URL.":"Enable the Public API in Settings to call this over REST (Make.com, n8n, webhooks…)."),pe&&React.createElement("span",{className:"dest-chip",style:{marginTop:6}},React.createElement("code",null,fe),React.createElement(ec,{text:fe,title:"Copy endpoint URL"}))))))),React.createElement(P.V,{title:to.SETTINGS.SNIPPET.TEST,key:"test"},React.createElement(I.M,{className:"primary",disabled:u||R,style:{width:"100%"},onClick:function(){var e=(new Date).toLocaleTimeString();if(F([{message:"["+e+"] Running test...",color:"white"}]),"function"!==(null==p?void 0:p.scope)||"js"!==(null==p?void 0:p.functionTarget))if("content_js"!==(null==p?void 0:p.scope))k({scope:null==p?void 0:p.scope,code:null==p?void 0:p.code,name:null==p?void 0:p.functionName,args:(null==p?void 0:p.functionArgs)||[],values:(null==p?void 0:p.functionArgsDict)||{}});else try{var t=null==p?void 0:p.code.replace(/<script>|<\/script>/g,"").trim(),n=new Function("\n function mwcode_content_js() {\n ".concat(t,"\n }\n return mwcode_content_js;\n "))(),r=[],o=console.log;console.log=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r.push(t.join(" ")),o.apply(console,t)};var a=n();console.log=o;var i=[].concat(r,[JSON.stringify(a)]);ee({return:i})}catch(e){ee({error:e.toString()})}else try{var c,l=null==p?void 0:p.code.replace(/<script>|<\/script>/g,"").trim(),s=new Function("\n ".concat(l,"\n return ").concat(null==p?void 0:p.functionName,";\n "))(),u=(null==p||null===(c=p.functionArgs)||void 0===c?void 0:c.map((function(e){var t,n;return(null==p||null===(t=p.functionArgsDict)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.input)||(null==p||null===(n=p.functionArgsDict)||void 0===n||null===(n=n[e])||void 0===n?void 0:n.default)||null})))||[],d=[],f=console.log;console.log=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];d.push(t.join(" ")),f.apply(console,t)};var h=s.apply(void 0,Pi(u));console.log=f;var m=[].concat(d,[JSON.stringify(h)]);ee({return:m})}catch(e){ee({error:e.toString()})}}},"Run Test"),React.createElement("div",{style:da},null==D?void 0:D.map((function(e,t){return React.createElement("div",{key:t,style:{color:null==e?void 0:e.color}},null==e?void 0:e.message)}))),Z&&q&&React.createElement(React.Fragment,null,React.createElement(Nr.g,null),React.createElement(Xo.u,{fullWidth:!0,name:"function_test_args",scrolldown:!0,value:U,onChange:function(e){return B(e)}},null==p||null===(i=p.functionArgs)||void 0===i?void 0:i.map((function(e){return React.createElement(Xo.j,{key:e,id:e,value:e,label:e})}))),U&&React.createElement(React.Fragment,null,React.createElement(Nr.g,{tiny:!0}),React.createElement(x.A,{name:"test_arg_value",value:ve(),onChange:function(e){return h(Ri(Ri({},p),{},{functionArgsDict:Ri(Ri({},p.functionArgsDict),{},Ti({},U,Ri(Ri({},p.functionArgsDict[U]),{},{input:e})))}))}}),!te("sanitize_arguments",!0)&&ge(ve())&&React.createElement(React.Fragment,null,React.createElement(Nr.g,null),ye({arg:U,key:"input"})))),React.createElement(React.Fragment,null,React.createElement(Nr.g,null),React.createElement(A.X,{variant:"info"},(0,C.FE)(to.SETTINGS.SNIPPET.TEST_PARAMETERS_DESCRIPTION_LOG),Z&&React.createElement(React.Fragment,null,React.createElement("br",null),(0,C.FE)(to.SETTINGS.SNIPPET.TEST_PARAMETERS_DESCRIPTION_ARG))))),te("api_endpoint",!1)&&q&&!J&&React.createElement(P.V,{title:to.SETTINGS.SNIPPET.PUBLIC_API,key:"public_api"},(re={},null!=p&&p.functionArgsDict&&Object.entries(p.functionArgsDict).forEach((function(e){var t=Ii(e,2),n=t[0],r=t[1];re[n.replace("$","")]=function(e,t){switch(e){case"boolean":return"true"===t;case"number":return Number(t)||0;case"array":try{return JSON.parse(t)||[]}catch(e){return[]}case"object":try{return JSON.parse(t)||{}}catch(e){return{}}default:return t||""}}(r.type,r.default)})),oe=re,ae=JSON.stringify(oe,null,2),React.createElement(React.Fragment,null,React.createElement(A.X,{variant:"warning"},to.SETTINGS.SNIPPET.PUBLIC_API_DESCRIPTION),React.createElement(Nr.g,null),me(to.SETTINGS.SNIPPET.ENDPOINT,React.createElement(x.A,{name:"endpoint",value:null==p?void 0:p.endpoint,onChange:function(e){return h(Ri(Ri({},p),{},{endpoint:e}))}})),React.createElement("div",null,!(null==p||!p.endpoint)&&React.createElement(Tr.s,{p:!0},(0,C.FE)((0,C.g7)(to.SETTINGS.SNIPPET.ENDPOINT_URL,"".concat(G,"/snippets-endpoint/").concat(p.endpoint))))),(null==p?void 0:p.endpoint)&&(null==p?void 0:p.endpoint.length)>0&&React.createElement(React.Fragment,null,React.createElement(Nr.g,null),me(to.SETTINGS.SNIPPET.METHOD,React.createElement(Xo.u,{fullWidth:!0,name:"method",scrolldown:!0,value:null==p?void 0:p.method,onChange:function(e){return h(Ri(Ri({},p),{},{method:e}))}},React.createElement(Xo.j,{id:"GET",value:"GET",label:"GET"}),React.createElement(Xo.j,{id:"POST",value:"POST",label:"POST"}),React.createElement(Xo.j,{id:"PUT",value:"PUT",label:"PUT"}),React.createElement(Xo.j,{id:"DELETE",value:"DELETE",label:"DELETE"}))),React.createElement(Nr.g,null),React.createElement(Pa.aD,null,React.createElement(Pa.YQ,{title:"Example (JS Fetch)"},React.createElement(Qi,{language:"javascript",style:xi.A},'fetch("'.concat(G,"/snippets-endpoint/").concat(p.endpoint,'", {\n method: "').concat(p.method,'",\n headers: {\n "Content-Type": "application/json",\n "Authorization": "Bearer YOUR_API_TOKEN"\n },\n body: JSON.stringify(').concat(ae,")\n })\n .then(response => response.json())\n .then(data => console.log(data))\n .catch(error => console.error('Error:', error));"))),React.createElement(Nr.g,null),React.createElement(Pa.YQ,{title:"Example (CURL)"},React.createElement(Qi,{language:"bash",style:xi.A},"curl -X ".concat(p.method,' "').concat(G,"/snippets-endpoint/").concat(p.endpoint,'" \\\n -H "Content-Type: application/json" \\\n -H "Authorization: Bearer YOUR_API_TOKEN" \\\n -d \'').concat(JSON.stringify(oe),"'"))))))))))))},cc=n(6087),lc=n(309),sc=n(1997),uc=n(5954);function dc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var fc,pc,hc,mc,gc,yc,vc,bc,wc,Ec,xc,Sc,kc,Rc,Tc,Nc,Oc,Pc=V.Ay.div(Ci||(Ci=dc(["\n display: flex;\n flex-direction: column;\n line-height: 1;\n opacity: ",";\n filter: ",";\n pointer-events: ",";\n \n .snippet-header {\n display: flex;\n flex-direction: column;\n margin: 5px 0px;\n }\n .snippet-title,\n .snippet-description,\n .snippet-endpoint {\n margin: 2px 0;\n padding: 0;\n }\n .snippet-title {\n font-size: 16px;\n cursor: ",";\n font-weight: 600;\n color: ",";\n }\n .snippet-description {\n margin-top: 8px;\n color: ",";\n font-size: var(--neko-font-size);\n }\n .snippet-endpoint {\n color: ",";\n }\n\n .code-container {\n\n pre {\n margin: 0;\n border-radius: 5px;\n }\n \n overflow: auto;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n .snippet-footer {\n }\n"])),(function(e){return e.active?1:.5}),(function(e){return e.active?"none":"grayscale(100%)"}),(function(e){return e.active?"auto":"none"}),(function(e){return e.active?"pointer":"default"}),(function(e){return e.active?"var(--neko-blue)":"var(--neko-gray-60)"}),(function(e){return e.active?"var(--neko-gray-60)":"var(--neko-gray-40)"}),(function(e){return e.active?"#a8a8a8":"#c8c8c8"})),Ic=(0,V.Ay)(Ei.A)(ji||(ji=dc(["\n padding: 0px;\n border: 1px solid #e0e0e0;\n max-height: 140px;\n margin-top: 5px;\n opacity: ",";\n filter: ",";\n code, pre {\n font-size: 13px;\n font-weight: 500;\n background: none;\n overflow-x: hidden !important;\n }\n"])),(function(e){return e.active?1:.7}),(function(e){return e.active?"none":"grayscale(100%)"})),Lc=V.Ay.div(Mi||(Mi=dc(["\n margin-right: 5px;\n width: 20px;\n height: 20px;\n vertical-align: middle;\n opacity: ",";\n filter: ",";\n \n svg {\n border-radius: 3px;\n width: 100%;\n height: 100%;\n }\n"])),(function(e){return e.active?1:.5}),(function(e){return e.active?"none":"grayscale(100%)"})),_c=function(e){var t=e.snippet,n=e.onEditClick,r=e.simplified,o=Jo().actions.getOption,a=(null!=t&&t.functionArgsDict?Object.values(null==t?void 0:t.functionArgsDict):[]).some((function(e){return null===(null==e?void 0:e.type)||void 0===(null==e?void 0:e.type)})),i=t.endpoint&&t.method,c=o("ui_show_preview",!1)&&t.code,l=(null==t?void 0:t.functionTarget)&&(null==t?void 0:t.functionName),s="1"===t.active;return React.createElement(Pc,{active:s,simplified:r},(a||l||i)&&React.createElement(React.Fragment,null,React.createElement("div",{style:{flex:"auto"}}),React.createElement("div",{className:"snippet-footer"},a&&React.createElement(A.X,{variant:"warning",style:{marginBottom:5,padding:"8px 15px",opacity:s?1:.7,filter:s?"none":"grayscale(100%)"}},to.SETTINGS.SNIPPET.MISSING_TYPE_WARNING))),React.createElement("div",{className:"snippet-header"},React.createElement("div",{className:"snippet-info"},React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement(sc.f,{position:"top",text:null==t?void 0:t.functionName},React.createElement(Lc,{active:s},"js"===(null==t?void 0:t.functionTarget)||"content_js"===(null==t?void 0:t.scope)?ha:("php"===(null==t?void 0:t.functionTarget)||null==t||t.scope,pa))),React.createElement("a",{onClick:s?n:void 0,className:"snippet-title"},t.name)),React.createElement("p",{className:"snippet-description"},t.description))),c&&React.createElement(React.Fragment,null,React.createElement("div",{className:"code-container"},React.createElement(Ic,{language:"js"===(null==t?void 0:t.functionTarget)?"javascript":"php",style:xi.A,wrapLines:!0,wrapLongLines:!0,active:s},t.code))))},Ac=function(e){var t=e.scope,n=e.active,r=void 0===n||n,o=sa.find((function(e){var n;return e.value===t||(null===(n=e.childScopes)||void 0===n?void 0:n.includes(t))}));if(!o)return console.warn('Code Engine: The scope "'.concat(t,'" is not supported.')),null;var a,i="content_php"===t||"content_js"===t,c=o.label;if(i){var l=c.match(/Content \((PHP|JS)\)/);a=l?React.createElement(React.Fragment,null,"Content",React.createElement("br",null),l[1]):c}else a=c;return React.createElement("div",{style:{padding:"5px 8px",borderRadius:"3px",background:r?o.color:"var(--neko-gray-80)",fontSize:"10px",textTransform:"uppercase",color:"white",textAlign:"center",lineHeight:i?"1.3":"normal"}},a)},Cc=function(e){var t=e.tags;return t?("string"==typeof t&&(t=t.split(",")),Array.isArray(t)?0===t.length?null:React.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"3px"}},t.map((function(e,t){if(e)return React.createElement(jc,{key:t,label:e})}))):null):null},jc=function(e){var t=e.label;return React.createElement("div",{style:{cursor:"default",display:"flex",alignItems:"center",padding:"2px 8px",borderRadius:"5px",background:"#fff7e0",fontSize:"12px",color:"rgb(0 0 0 / 54%)",border:"1px solid #ffc10763"}},t)};function Mc(e){return Mc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mc(e)}function Dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dc(Object(n),!0).forEach((function(t){Fc(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dc(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fc(e,t,n){return(t=function(e){var t=function(e){if("object"!=Mc(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mc(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mc(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zc(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Uc="".concat(F,"/images/callable.svg"),Bc="".concat(F,"/images/global-back.svg"),Hc="".concat(F,"/images/global-front.svg"),Wc="".concat(F,"/images/global-front-back.svg"),Yc="".concat(F,"/images/scheduled.svg"),Vc="".concat(F,"/images/content.svg"),qc=V.Ay.div(fc||(fc=zc(["\n display: grid;\n grid-template-columns: repeat(2, 1fr);\n gap: 15px;\n \n @media (max-width: 1200px) {\n grid-template-columns: 1fr;\n }\n"]))),Kc=V.Ay.div(pc||(pc=zc(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 60px 20px;\n text-align: center;\n color: white;\n font-size: 14px;\n line-height: 1.6;\n"]))),Jc=V.Ay.div(hc||(hc=zc(["\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 60px 20px;\n text-align: center;\n color: white;\n font-size: 14px;\n"]))),$c=V.Ay.div(mc||(mc=zc(["\n display: flex;\n flex-direction: column;\n border-radius: 8px;\n overflow: hidden;\n background: white;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);\n border-left: 8px solid ",";\n\n height: 100%;\n transition: box-shadow 0.2s ease;\n\n\n &:hover {\n box-shadow: 0 0px 5px rgb(0 0 0 / 25%);\n }\n"])),(function(e){return e.active?"persistent"===e.scope?"var(--neko-purple)":"frontend"===e.scope?"var(--neko-yellow)":"backend"===e.scope?"var(--neko-green)":"function"===e.scope?"var(--neko-orange)":"scheduled"===e.scope?"var(--neko-cyan)":"content_php"===e.scope||"content_js"===e.scope?"var(--neko-green)":"var(--neko-gray)":"var(--neko-gray-80)"})),Xc=V.Ay.div(gc||(gc=zc(["\n display: flex;\n gap: 24px;\n padding: 10px;\n height: inherit;\n"]))),Qc=V.Ay.div(yc||(yc=zc(["\n flex: 0 0 80px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: flex-start;\n"]))),Zc=V.Ay.div(vc||(vc=zc(["\n flex: 1;\n min-width: 0;\n"]))),el=V.Ay.div(bc||(bc=zc(["\n flex: 0 0 auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n align-items: flex-end;\n"]))),tl=V.Ay.div(wc||(wc=zc(["\n width: ",";\n height: ",";\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 8px;\n cursor: pointer;\n transition: transform 0.2s ease, width 0.2s ease, height 0.2s ease;\n\n &:hover {\n transform: scale(1.1);\n }\n\n img {\n width: 100%;\n height: 100%;\n filter: ",";\n opacity: ",";\n }\n"])),(function(e){return e.simplified?"40px":"60px"}),(function(e){return e.simplified?"40px":"60px"}),(function(e){return e.active?"none":"grayscale(100%)"}),(function(e){return e.active?1:.5})),nl=V.Ay.div(Ec||(Ec=zc(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 6px;\n"]))),rl=V.Ay.span(xc||(xc=zc(["\n font-size: 10px;\n padding: 2px 5px;\n border-radius: 3px;\n border: 1px solid var(--neko-gray-60);\n color: var(--neko-gray-60);\n background: var(--neko-gray-98);\n font-weight: 500;\n"]))),ol=V.Ay.span(Sc||(Sc=zc(["\n font-size: 10px;\n padding: 2px 6px;\n border-radius: 3px;\n border: 1px solid var(--neko-orange);\n color: var(--neko-orange);\n background: rgba(255, 152, 0, 0.08);\n font-weight: 600;\n letter-spacing: 0.3px;\n cursor: default;\n"]))),al=V.Ay.span(kc||(kc=zc(["\n font-size: 10px;\n padding: 2px 6px;\n border-radius: 3px;\n border: 1px solid var(--neko-main-color);\n color: var(--neko-main-color);\n background: rgba(33, 92, 187, 0.08);\n font-weight: 600;\n letter-spacing: 0.3px;\n cursor: default;\n"]))),il=V.Ay.div(Rc||(Rc=zc(["\n display: flex;\n align-items: center;\n gap: 8px;\n margin-top: 8px;\n flex-wrap: wrap;\n"]))),cl=V.Ay.div(Tc||(Tc=zc(["\n display: flex;\n gap: 8px;\n padding: 10px;\n background: ",";\n border-radius: 0 0 8px 0px;\n box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);\n justify-content: space-between;\n"])),(function(e){return e.active?"persistent"===e.scope?"rgba(147, 83, 211, 0.08)":"frontend"===e.scope?"rgba(245, 165, 36, 0.08)":"backend"===e.scope?"rgba(23, 201, 100, 0.08)":"function"===e.scope?"rgba(255, 152, 0, 0.08)":"scheduled"===e.scope?"rgba(6, 182, 212, 0.08)":"content_php"===e.scope||"content_js"===e.scope?"rgba(0, 179, 133, 0.08)":"rgba(229, 231, 235, 0.5)":"rgba(229, 231, 235, 0.5)"})),ll=V.Ay.div(Nc||(Nc=zc(["\n display: flex;\n gap: 8px;\n align-items: center;\n"]))),sl=V.Ay.div(Oc||(Oc=zc(["\n display: flex;\n gap: 8px;\n align-items: center;\n"]))),ul=function(e){var t=e.snippet,n=e.onClick,r=e.simplified,o="1"===t.active,a=t.scope,i=Wc;return"persistent"===a?i=Wc:"frontend"===a?i=Hc:"backend"===a?i=Bc:"function"===a?i=Uc:"scheduled"===a?i=Yc:"content_php"===a||"content_js"===a?i=Vc:console.warn('Code Engine: The scope "'.concat(a,'" is not supported.')),React.createElement(tl,{active:o,simplified:r,onClick:n},React.createElement("img",{src:i,alt:a}))},dl=function(e){var t=e.busy,n=e.snippets,r=e.useInlineEditor,o=e.simplifiedView,a=e.onEditSnippet,i=e.onSave,c=e.onDelete,l=e.onDuplicate,s=e.currentScope;return React.createElement(React.Fragment,null,t&&0===n.length?React.createElement(Jc,null,React.createElement(cc.X,{size:"large",color:"var(--neko-gray-60)"}),React.createElement("div",{style:{marginTop:"16px",color:"var(--neko-gray-60)"}},to.COMMON.LOADING)):null,!t&&0===n.length&&React.createElement(Kc,null,React.createElement("div",{style:{fontSize:"16px",fontWeight:"600",marginBottom:"8px"}},to.COMMON.NO_RESULTS),React.createElement("div",{style:{maxWidth:"500px"}},"all"===s?"Get started by clicking the + button to create your first snippet, or use Quick Start to generate one with AI.":'Click the + button above to create a new snippet, or switch to the "All" view for more options.')),n.length>0&&React.createElement(qc,null,n.map((function(e){var n="1"===e.active,s=e.endpoint&&e.method;return React.createElement(ta.A,{key:e.id,busy:t},React.createElement($c,{active:n,scope:e.scope},React.createElement(Xc,null,React.createElement(Qc,null,React.createElement(ul,{snippet:e,onClick:function(){return a(e)},simplified:o}),React.createElement(nl,null,React.createElement(Ac,{scope:e.scope,active:n}))),React.createElement(Zc,null,React.createElement(_c,{snippet:e,onEditClick:function(){return a(e)},simplified:o}),React.createElement(il,null,("content_php"===e.scope||"content_js"===e.scope)&&React.createElement(lc.H,{prefix:"code-engine",params:{id:null==e?void 0:e.id}}),"scheduled"===e.scope&&React.createElement("div",{style:{fontSize:"12px",color:"var(--neko-gray-60)",display:"flex",alignItems:"center",gap:"4px"}},React.createElement(W.z,{icon:"timer-reset",width:"18px",style:{color:"rgb(150, 150, 150)",marginRight:"4px"}})," ",React.createElement("span",null,"Triggers every day at ",React.createElement("strong",null,e.intervalHours,":",e.intervalMinutes))),e.functionName&&React.createElement("div",{style:{fontSize:"12px",color:"var(--neko-gray-60)",display:"flex",alignItems:"center",gap:"4px"}},React.createElement("strong",null,"→")," ",React.createElement("pre",{style:{margin:0}},e.functionName,"();")),e.functionMcp&&React.createElement(sc.f,{position:"top",text:"Exposed as its own MCP tool in AI Engine"},React.createElement(ol,null,"MCP")),s&&React.createElement(sc.f,{position:"top",text:"REST endpoint: ".concat(e.method," /").concat(e.endpoint)},React.createElement(al,null,"REST"))),s&&React.createElement(il,null,React.createElement("div",{style:{fontSize:"13px",color:"var(--neko-gray-60)",cursor:"default"}},React.createElement(sc.f,{position:"top",text:"".concat(e.method," /").concat(e.endpoint)},React.createElement(rl,null,e.method)),React.createElement("small",{style:{marginLeft:5}},G,"/snippets-endpoint/",React.createElement("strong",null,e.endpoint)))),!o&&e.tags&&React.createElement("div",{style:{marginTop:"8px"}},React.createElement(Cc,{tags:e.tags}))),React.createElement(el,null,r&&React.createElement(React.Fragment,null,React.createElement(I.M,{rounded:!0,title:to.COMMON.EDIT,icon:"pencil",className:"primary",onClick:function(){return a(e)}}),React.createElement(I.M,{rounded:!0,icon:"duplicate",title:to.COMMON.CLONE,className:"primary",onClick:function(){return l(e)}})))),!o&&React.createElement(cl,{active:n,scope:e.scope},React.createElement(ll,null,React.createElement(I.M,{icon:"pencil",title:to.COMMON.EDIT,className:"primary",onClick:function(){return a(e)}},to.COMMON.EDIT),React.createElement(Qo.S,{onLabel:"ON",offLabel:"OFF",onValue:"1",offValue:"0",width:"64px",checked:"1"===e.active,onChange:function(t){return i(Gc(Gc({},e),{},{active:t}))}})),React.createElement(sl,null,React.createElement(uc._,{size:"normal",variant:"primary",items:[{label:to.COMMON.CLONE,icon:"duplicate",onClick:function(){return l(e)}},{label:to.COMMON.DELETE,icon:"trash",danger:!0,separatorBefore:!0,onClick:function(){return c(e)}}]})))))}))))};function fl(e){return fl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fl(e)}function pl(){pl=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==fl(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(fl(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function hl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ml(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?hl(Object(n),!0).forEach((function(t){gl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function gl(e,t,n){return(t=function(e){var t=function(e){if("object"!=fl(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fl(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fl(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yl(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function vl(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){yl(a,r,o,i,c,"next",e)}function c(e){yl(a,r,o,i,c,"throw",e)}i(void 0)}))}}function bl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||wl(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wl(e,t){if(e){if("string"==typeof e)return El(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?El(e,t):void 0}}function El(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var xl=wp.element,Sl=xl.useState,kl=xl.useEffect,Rl=xl.useMemo,Tl=xl.useRef;const Nl=function(){var e,t=Jo(),n=t.actions,r=t.state,o=((0,b.z)().colors,n.getOption),a=(n.updateOption,n.setError),i=r.isLoading,c=Oa({onRanSnippet:function(e){return T((0,C.g7)(to.SETTINGS.SUCCESSFULLY_RAN,e))},onError:function(e){return a(e)}}),l=c.isProcessing,s=c.snippets,u=c.total,d=(c.tags,c.stats),f=c.tableFilters,p=c.setTableFilters,h=c.editSnippet,m=c.setEditSnippet,g=c.isSavable,y=c.isResetable,v=c.onDelete,w=c.onSave,E=(c.onImportCodeSnippets,c.onDuplicate),S=c.onRefresh,k=bl(Sl(null),2),R=k[0],T=k[1],N=bl(Sl(!1),2),P=N[0],L=(N[1],bl(Sl(!1),2)),_=L[0],j=L[1],M=bl(Sl(!1),2),D=M[0],G=M[1],F=bl(Sl(""),2),z=F[0],U=F[1],B=bl(Sl(0),2),H=B[0],W=B[1],Y=bl(Sl(!1),2),V=Y[0],q=Y[1],K=bl(Sl(""),2),J=K[0],$=K[1],X=bl(Sl(!1),2),Q=X[0],Z=X[1],ee=bl(Sl(!1),2),te=ee[0],ne=ee[1],re=bl(Sl(!1),2),oe=re[0],ae=re[1],ie=bl(Sl(!1),2),ce=ie[0],le=ie[1],se=Tl(null),ue=Rl((function(){if(!h)return!1;if(null!=h&&h.functionNotValid)return!1;if(!(null==h?void 0:h.name)||!(null==h?void 0:h.code))return!1;var e=s.find((function(e){return e.id===h.id}));return la(e,h)}),[s,h]),de=(null===(e=f.filters.find((function(e){return"scope"===e.accessor})))||void 0===e?void 0:e.value)||"all",fe=o("ai_engine_status",!1);kl((function(){var e=function(){var e=vl(pl().mark((function e(t){var n,r;return pl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t.metaKey&&!t.ctrlKey||"s"!==t.key){e.next=20;break}if(!_||te||oe){e.next=20;break}if(t.preventDefault(),t.stopPropagation(),!h||!ue){e.next=20;break}if(ne(!0),e.prev=6,!se.current){e.next=14;break}return e.next=10,se.current();case 10:if(e.sent){e.next=14;break}return ne(!1),e.abrupt("return");case 14:return n=ml(ml({},h),{},{functionError:!1}),e.next=17,w(n);case 17:return e.prev=17,ne(!1),e.finish(17);case 20:if(!t.metaKey&&!t.ctrlKey||"Enter"!==t.key){e.next=41;break}if(!_||te||oe){e.next=41;break}if(t.preventDefault(),t.stopPropagation(),!h||!ue){e.next=41;break}if(ae(!0),e.prev=26,!se.current){e.next=34;break}return e.next=30,se.current();case 30:if(e.sent){e.next=34;break}return ae(!1),e.abrupt("return");case 34:return r=ml(ml({},h),{},{functionError:!1}),e.next=37,w(r);case 37:he(!1);case 38:return e.prev=38,ae(!1),e.finish(38);case 41:case"end":return e.stop()}}),e,null,[[6,,17,20],[26,,38,41]])})));return function(t){return e.apply(this,arguments)}}();return _&&document.addEventListener("keydown",e,!0),function(){document.removeEventListener("keydown",e,!0)}}),[_,h,ue,te,oe,w]);var pe=function(e){confirm(to.ALERTS.ARE_YOU_SURE)&&v(e)},he=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fa;j(!P),m(e?t:null),ne(!1),ae(!1),le(!1),se.current=null,e||(j(!1),m(null))},me=function(){q(!V)},ge=function(){var e=vl(pl().mark((function e(){var t,n;return pl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,Z(!0),e.next=4,Ao(J);case 4:t=e.sent,(n=JSON.parse(JSON.stringify(fa))).name=null==t?void 0:t.name,n.description=null==t?void 0:t.description,n.code=null==t?void 0:t.code,n.tags=null==t?void 0:t.tags,n.scope=null==t?void 0:t.type,n.functionTarget=null==t?void 0:t.functionTarget,n.intervalHours=null==t?void 0:t.target_hour,n.intervalMinutes=null==t?void 0:t.target_minute,"function"===(null==t?void 0:t.type)&&null!=t&&t.parameters&&t.parameters.forEach((function(e){var r="php"===(null==t?void 0:t.functionTarget)?"$":"";n.functionArgs.push(r+(null==e?void 0:e.name)),n.functionArgsDict[r+(null==e?void 0:e.name)]={name:r+(null==e?void 0:e.name),desc:null==e?void 0:e.description,type:null==e?void 0:e.type,default:null==e?void 0:e.default,required:null==e?void 0:e.required}})),console.log(n),m(n),j(!0),e.next=23;break;case 20:e.prev=20,e.t0=e.catch(0),a(e.t0);case 23:return e.prev=23,me(),Z(!1),e.finish(23);case 27:case"end":return e.stop()}}),e,null,[[0,20,23,27]])})));return function(){return e.apply(this,arguments)}}(),ye=function(e){T(null),he(!0,e)},ve=f.limit,be=f.page,we=i||l,Ee=(React.Fragment,R&&A.X,React.createElement(A.X,{variant:"danger",style:{marginBottom:"16px"}},to.ERROR.SNIPPET_FATAL,o("fatal_error",""),". ",to.ERROR.SNIPPET_DISABLED)),xe=Rl((function(){if(!z)return s;var e=z.toLowerCase();return s.filter((function(t){var n,r,o=null===(n=t.name)||void 0===n?void 0:n.toLowerCase().includes(e),a=null===(r=t.description)||void 0===r?void 0:r.toLowerCase().includes(e),i=!1;return t.tags&&("string"==typeof t.tags?i=t.tags.toLowerCase().includes(e):Array.isArray(t.tags)&&(i=t.tags.some((function(t){return null==t?void 0:t.toLowerCase().includes(e)})))),o||a||i}))}),[s,z]),Se=Rl((function(){return React.createElement(dl,{busy:we,snippets:xe,onEditSnippet:ye,currentScope:de,useInlineEditor:P,simplifiedView:D,onSave:w,onDelete:pe,onDuplicate:E})}),[xe,we,de,P,D]),ke=Rl((function(){return React.createElement($o.V,{style:{marginTop:"20px",justifyContent:"space-between"}},React.createElement("div",{style:{display:"flex",gap:"10px",alignItems:"center"}},React.createElement(Xo.u,{scrolldown:!0,value:ve,onChange:function(e){return p(ml(ml({},f),{},{limit:e,offset:0}))}},React.createElement(Xo.j,{value:5,label:"5 Snippets"}),React.createElement(Xo.j,{value:10,label:"10 Snippets"}),React.createElement(Xo.j,{value:25,label:"25 Snippets"}),React.createElement(Xo.j,{value:50,label:"50 Snippets"}),React.createElement(Xo.j,{value:100,label:"100 Snippets"})),React.createElement("div",{style:{marginLeft:"20px",display:"flex",alignItems:"center",gap:"8px"}},React.createElement("span",null,"Simplify"),React.createElement(Qo.S,{checked:D,onChange:G}))),React.createElement(Zo.Q,{currentPage:be,limit:ve,total:u,onClick:function(e){return p(ml(ml({},f),{},{page:e}))}}))}),[ve,be,u,D]);return React.createElement(React.Fragment,null,React.createElement(O.N,null,React.createElement(O.Y,{minimal:!0},React.createElement("div",{style:{padding:"10px"}},o("fatal_error",null)&&Ee,React.createElement($o.V,{style:{marginBottom:"20px"}},React.createElement(I.M,{className:"primary",icon:"plus",onClick:function(){return he(!0)}},to.COMMON.ADD),React.createElement(I.M,{className:"primary",color:"purple",icon:"wand",disabled:!fe,onClick:function(){return me()}},to.SETTINGS.QUICK_START),React.createElement("div",{style:{flex:"auto"}}),React.createElement(x.A,{value:z,onChange:U,onReset:function(){return U("")},placeholder:"Search snippets...",style:{width:"250px"}}),React.createElement(I.M,{busy:we,className:"primary",onClick:S},to.COMMON.REFRESH)),React.createElement("div",{style:{marginBottom:"20px"}},React.createElement(ea.o,{name:"scope_filter",value:de,onChange:function(e){var t;ua.some((function(t){return t.value===e}))&&p(ml(ml({},f),{},{page:1,filters:[].concat((t=f.filters.filter((function(e){return"scope"!==e.accessor})),function(e){if(Array.isArray(e))return El(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||wl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),[{accessor:"scope",value:e}])}))},inversed:!0},ua.map((function(e){return React.createElement(ea.K,{key:e.value,title:e.label,value:e.value,count:(null==d?void 0:d[e.value])||0})})))),Se,ke))),React.createElement(Or.n,{isOpen:V,title:to.SETTINGS.QUICK_START,content:React.createElement(ta.A,{busy:Q},React.createElement(A.X,{variant:"info",style:{marginBottom:"16px"}},to.SETTINGS.QUICK_START_INFO),React.createElement(na.m,{value:J,onBlur:$,placeholder:to.SETTINGS.QUICK_START_PLACEHOLDER,style:{height:"200px"}})),onRequestClose:me,okButton:{label:to.COMMON.RUN,onClick:function(){ge()},disabled:Q},cancelButton:{label:to.COMMON.CLOSE,onClick:me,disabled:Q}}),React.createElement(Or.n,{isOpen:_,size:"full-size",title:to.SETTINGS.EDITOR,action:React.createElement(React.Fragment,null,React.createElement(I.M,{className:"primary",color:ce?"orange":void 0,icon:ce?"close":"question",onClick:function(){return le((function(e){return!e}))}},ce?"Close Help":"Help"),React.createElement(I.M,{className:"secondary",onClick:function(){if(h){var e=s.find((function(e){return e.id===h.id}));e?(m(JSON.parse(JSON.stringify(e))),W((function(e){return e+1}))):null===h.id&&(m(JSON.parse(JSON.stringify(fa))),W((function(e){return e+1})))}},disabled:!y||te||oe},"Reset"),React.createElement(I.M,{onClick:vl(pl().mark((function e(){var t;return pl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ne(!0),e.prev=1,!se.current){e.next=9;break}return e.next=5,se.current();case 5:if(e.sent){e.next=9;break}return ne(!1),e.abrupt("return");case 9:return t=ml(ml({},h),{},{functionError:!1}),e.next=12,w(t);case 12:return e.prev=12,ne(!1),e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,,12,15]])}))),busy:te,disabled:!ue&&!te||oe},to.COMMON.SAVE),React.createElement(I.M,{onClick:vl(pl().mark((function e(){var t;return pl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(ae(!0),e.prev=1,!se.current){e.next=9;break}return e.next=5,se.current();case 5:if(e.sent){e.next=9;break}return ae(!1),e.abrupt("return");case 9:return t=ml(ml({},h),{},{functionError:!1}),e.next=12,w(t);case 12:he(!1);case 13:return e.prev=13,ae(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,,13,16]])}))),busy:oe,disabled:!ue&&!oe||te},to.COMMON.SAVE_AND_CLOSE)),content:React.createElement("div",{style:{padding:"15px 0",flex:1,minHeight:0,display:"flex",flexDirection:"column"}},R&&React.createElement(A.X,{variant:"success",style:{marginBottom:"12px"}},R),React.createElement(ic,{editorKey:H,busy:we,onClose:function(){return he(!1)},editSnippet:h,setEditSnippet:m,isSavable:g,onSave:w,helpMode:ce,onLintReady:function(e){se.current=e}})),contentStyle:{margin:"0 -15px",height:"100%",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:"var(--neko-main-color)",overflow:"hidden"},onRequestClose:function(){return he(!1)},customButtons:React.createElement("span",{style:{fontSize:"12px",color:"rgba(0, 0, 0, 0.5)",alignSelf:"center",marginRight:"auto"}},"⌘S to save • ⌘↵ to save & close"),customButtonsPosition:"left",cancelButton:{label:to.COMMON.CLOSE,onClick:function(){return he(!1)}}}))};var Ol=n(6031),Pl=n(7392);function Il(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ll=wp.element.useState;const _l=function(){var e=Jo(),t=e.actions,n=e.state,r=t.getOption,o=t.updateOption,a=t.resetOptions,i=t.refreshOptions,c=n.isLoading,l=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Il(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Il(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(Ll(!1),2),s=l[0],u=l[1],d=Oa({onError:function(e){return alert("⚠️ "+e)}}),f=d.onImportCodeSnippets,p=d.isProcessing,h=r("ai_engine_status",!1),m=r("mwai_active",!1),g=r("ai_engine_message",""),y=(r("database_inspection",!1),r("code_blocks",!1),c||s||p);return React.createElement(React.Fragment,null,React.createElement(O.N,null,React.createElement(O.Y,{minimal:!0},React.createElement(L.z,{busy:y,title:to.SETTINGS.PREFERENCES.TITLE,className:"primary"},React.createElement(S.d,{title:to.SETTINGS.PREFERENCES.CODE_PREVIEW},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"ui_show_preview",disabled:y,label:to.COMMON.ENABLE,description:to.SETTINGS.PREFERENCES.CODE_PREVIEW_DESCRIPTION,value:"1",checked:r("ui_show_preview",!1),onChange:o})))),React.createElement(L.z,{busy:y,title:to.SETTINGS.MODULES.TITLE,className:"primary"},React.createElement(S.d,{title:to.SETTINGS.MODULES.CODE_BLOCKS},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"code_blocks",disabled:y,requirePro:!U,label:to.COMMON.ENABLE,description:to.SETTINGS.MODULES.CODE_BLOCKS_DESCRIPTION,value:"1",checked:r("code_blocks",!1),onChange:o}))),React.createElement(S.d,{title:to.SETTINGS.DEVELOPERS.DATABASE_INSPECTION},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"database_inspection",disabled:y,label:to.COMMON.ENABLE,description:to.SETTINGS.DEVELOPERS.DATABASE_INSPECTION_DESCRIPTION,value:"1",checked:r("database_inspection",!1),onChange:o}))),React.createElement(S.d,{title:to.SETTINGS.PREFERENCES.PUBLIC_API},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"api_endpoint",disabled:y,label:to.COMMON.ENABLE,description:to.SETTINGS.PREFERENCES.SNIPPET_ENDPOINT_DESCRIPTION,value:"1",checked:r("api_endpoint",!1),onChange:o}))),r("api_endpoint",!1)&&React.createElement(S.d,{title:to.SETTINGS.SNIPPET.TOKEN},React.createElement("div",{style:{display:"flex",gap:"10px"}},React.createElement(x.A,{style:{flex:1},name:"api_token",value:r("api_token",""),onBlur:o}),React.createElement(I.M,{rounded:!0,icon:"replay",onClick:function(){return o(Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),"api_token")}})))),React.createElement(L.z,{busy:y,title:to.COMMON.MAINTENANCE,className:"primary"},React.createElement(S.d,{title:to.MAINTENANCE.CLEAN_UNINSTALL},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"clean_uninstall",disabled:y,label:to.COMMON.ENABLE,description:to.MAINTENANCE.CLEAN_UNINSTALL_DESCRIPTION,value:"1",checked:r("clean_uninstall",!1),onChange:o}))),React.createElement(Tr.s,{h4:!0},"Settings"),React.createElement("div",{style:{display:"flex",gap:"0px",alignItems:"center"}},React.createElement(I.M,{className:"danger",onClick:a},to.COMMON.RESET_SETTINGS),React.createElement(I.M,{className:"primary",onClick:i},to.COMMON.REFRESH_SETTINGS),React.createElement(I.M,{className:"secondary",onClick:function(){return o(!1,"hide_tutorial")}},to.SETTINGS.SHOW_TUTORIAL)),React.createElement(Nr.g,null),React.createElement(Tr.s,{h4:!0},"Snippets"),React.createElement("div",{style:{display:"flex",gap:"0px"}},React.createElement(I.M,{className:"danger",onClick:function(){return yo(u)}},to.SETTINGS.IMPORT_SETTINGS),React.createElement(I.M,{className:"primary",onClick:function(){return go(u)}},to.SETTINGS.EXPORT_SETTINGS)),React.createElement(Nr.g,{tiny:!0}),React.createElement("div",{style:{display:"flex",gap:"0px"}},React.createElement(I.M,{className:"secondary",onClick:f,busy:y},to.SETTINGS.SNIPPET.IMPORT_CODE_SNIPPETS),React.createElement(I.M,{className:"danger",icon:"trash",onClick:function(){return mo(u)}},to.SETTINGS.SNIPPET.DELETE_DUPLICATE_SNIPPETS)))),React.createElement(O.Y,{minimal:!0},React.createElement(L.z,{busy:y,title:to.SETTINGS.AI_PARAMETERS.TITLE,className:"primary",action:React.createElement(React.Fragment,null,h&&React.createElement(Ol.B,{tooltip:g,className:"success",label:to.SETTINGS.AI_PARAMETERS.AI_ENGINE_INSTALLED}),!h&&React.createElement(Ol.B,{className:"warning",tooltip:g,label:to.SETTINGS.AI_PARAMETERS.DOWNLOAD_AI_ENGINE,link:"https://meowapps.com/ai-engine/"}))},React.createElement(S.d,{title:to.SETTINGS.AI_PARAMETERS.AI_SUGGESTIONS},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"ai_suggestions",disabled:y||!h,label:to.COMMON.ENABLE,description:to.SETTINGS.AI_PARAMETERS.AI_SUGGESTIONS_DESCRIPTION,value:"1",checked:r("ai_suggestions",!1),onChange:o})))),React.createElement(L.z,{busy:y,title:to.SETTINGS.DEVELOPERS.TITLE,className:"primary"},React.createElement(S.d,{title:to.SETTINGS.DEVELOPERS.SANITIZE_ARGS},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"sanitize_arguments",disabled:y,label:to.COMMON.ENABLE_RECOMMENDED,description:to.SETTINGS.DEVELOPERS.SANITIZE_ARGS_DESCRIPTION,value:"1",checked:r("sanitize_arguments",!0),onChange:o}))),React.createElement(S.d,{title:to.SETTINGS.DEVELOPERS.MCP_SUPPORT},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"mcp_support",disabled:y||!m,label:to.COMMON.ENABLE,description:to.SETTINGS.DEVELOPERS.MCP_SUPPORT_DESCRIPTION,value:"1",checked:r("mcp_support",!1),onChange:o}))),React.createElement(S.d,{title:to.SETTINGS.DEVELOPERS.MCP_FUNCTIONS},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"mcp_functions",disabled:y||!m,label:to.COMMON.ENABLE,description:to.SETTINGS.DEVELOPERS.MCP_FUNCTIONS_DESCRIPTION,value:"1",checked:r("mcp_functions",!1),onChange:o}))),React.createElement(S.d,{title:to.SETTINGS.DEVELOPERS.BYPASS_SECURITY},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"bypass_rest_security",disabled:y,label:to.COMMON.ENABLE_NOT_RECOMMENDED,description:to.SETTINGS.DEVELOPERS.BYPASS_SECURITY_DESCRIPTION,value:"1",checked:r("bypass_rest_security",!1),onChange:o}))),React.createElement(S.d,{title:to.SETTINGS.DEVELOPERS.LOGS},React.createElement(k.E,{max:"1"},React.createElement(R.R,{name:"server_debug_mode",disabled:y,label:to.COMMON.ENABLE,description:to.SETTINGS.DEVELOPERS.LOGS_DESCRIPTION,value:"1",checked:r("server_debug_mode",!1),onChange:o})))),r("server_debug_mode",!1)&&React.createElement(Pl.k,{refreshQuery:so,clearQuery:uo,i18n:to}))))};var Al=n(6842);function Cl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return jl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jl(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Ml=wp.element,Dl=Ml.useState,Gl=Ml.useEffect,Fl=Ml.useCallback,zl=function(e){!function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e);var t=Cl(Dl([]),2),n=t[0],r=t[1],o=Cl(Dl(!0),2),a=o[0],i=o[1],c=Cl(Dl(!1),2),l=c[0],s=c[1],u=Cl(Dl(""),2),d=u[0],f=u[1],p=Fl((function(){vo().then((function(e){r(e),f(JSON.stringify(e,null,2)),console.log(e)})).catch((function(e){console.error(e)})).finally((function(){i(!1)}))}),[]);return Gl((function(){p()}),[]),React.createElement(React.Fragment,null,l&&React.createElement(na.m,{textAreaStyle:{height:380},value:d,onChange:function(e){f(e)},style:{height:"100%",width:"100%",minHeight:380}}),!l&&React.createElement("div",{style:{height:380,overflow:"auto",maxHeight:380}},a&&React.createElement("i",{style:{color:"gray"}},"Loading..."),!a&&!n&&React.createElement("i",{style:{color:"gray"}},to.COMMON.DATA_NOT_AVAILABLE),!a&&n&&React.createElement(Al.p2,{value:n,rootName:"functions",indentWidth:2,displayDataTypes:!1,displayObjectSize:!1,displayArrayKey:!1,enableClipboard:!1,style:{fontSize:12}})),React.createElement(Nr.g,null),React.createElement(I.M,{className:"secondary",onClick:function(){return s(!l)}},l?to.COMMON.CANCEL:to.SETTINGS.DEVELOPERS.RAW_EDIT),l&&React.createElement(I.M,{onClick:function(){bo(d).then((function(){alert("Functions updated."),p(),s(!1)})).catch((function(e){alert("Error while updating functions. Please check your console."),console.error(e)}))}},to.COMMON.UPDATE))},Ul=n(6198);function Bl(e){return Bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bl(e)}function Hl(){Hl=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),c=new I(r||[]);return o(i,"_invoke",{value:T(e,n,c)}),i}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var f="suspendedStart",p="suspendedYield",h="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(L([])));x&&x!==n&&r.call(x,i)&&(w=x);var S=b.prototype=y.prototype=Object.create(w);function k(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function R(e,t){function n(o,a,i,c){var l=d(e[o],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Bl(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(u).then((function(e){s.value=e,i(s)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function T(t,n,r){var o=f;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===f)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?m:p,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var a=d(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,g;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function L(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Bl(t)+" is not iterable")}return v.prototype=b,o(S,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},k(R.prototype),s(R.prototype,c,(function(){return this})),t.AsyncIterator=R,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new R(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},k(S),s(S,l,"Generator"),s(S,i,(function(){return this})),s(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=L,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:L(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function Wl(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function Yl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||Vl(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vl(e,t){if(e){if("string"==typeof e)return ql(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ql(e,t):void 0}}function ql(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Kl=wp.element,Jl=Kl.useState,$l=Kl.useEffect,Xl=(Kl.useMemo,Kl.useCallback),Ql=function(e){!function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e);var t,n,r,o=Jo().actions,a=o.getOption,i=o.updateOption,c=(o.resetOptions,o.refreshOptions,"code_blocks_whitelist"),l=a(c,[]),s=l,u=Yl(Jl(""),2),d=u[0],f=u[1],p=Yl(Jl(1),2),h=p[0],m=p[1],g=Yl(Jl([]),2),y=g[0],v=g[1],b=Yl(Jl(!1),2),E=b[0],S=b[1],k=Yl(Jl(l),2),R=k[0],T=k[1],N=(t={search:d,offset:10*(h-1),limit:10},(0,w.I)({queryKey:["posts",t],queryFn:(n=Hl().mark((function e(){var n;return Hl().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,C.IU)("".concat(G,"/fetch_posts"),{nonce:B,method:"POST",json:t});case 2:if(!(n=e.sent).success){e.next=5;break}return e.abrupt("return",{data:n.data,total:n.total});case 5:throw new Error(n.message||"Failed to fetch posts");case 6:case"end":return e.stop()}}),e)})),r=function(){var e=this,t=arguments;return new Promise((function(r,o){var a=n.apply(e,t);function i(e){Wl(a,r,o,i,c,"next",e)}function c(e){Wl(a,r,o,i,c,"throw",e)}i(void 0)}))},function(){return r.apply(this,arguments)})})),O=N.data,P=N.isLoading,L=(N.error,(null==O?void 0:O.data)||[]),_=(null==O?void 0:O.total)||0;$l((function(){if(!(d.length>0)&&(null==s?void 0:s.length)>0){var e=L.filter((function(e){return s.includes(e.id)}));v(e)}}),[s,L.length,d]);var A=Xl((function(e){f(e),m(1)}),[]),j=Xl((function(e){m(e)}),[]),M=Xl((function(e){var t,n=e[0];y.some((function(e){return e.id===n.id}))?v(y.filter((function(e){return e.id!==n.id}))):v([].concat(function(e){if(Array.isArray(e))return ql(e)}(t=y)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Vl(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[n]))}),[y,L]),D=Xl((function(){S(!1),f(""),m(1)}),[]),F=Xl((function(){i(y.map((function(e){return e.id})),c),T(y.map((function(e){return e.id}))),D()}),[y]);return React.createElement(React.Fragment,null,React.createElement(x.A,{disabled:!0,name:"post_ids",type:"text",value:R.join(", "),style:{flex:1},placeholder:"Post IDs... (separated by commas)",onChange:function(e){T(e.split(",").map((function(e){return e.trim()})))}}),React.createElement(I.M,{className:"primary",style:{marginLeft:10},onClick:function(){return S(!0)}},"Select Posts"),React.createElement(Ul._,{isOpen:E,posts:L,selected:y,maxSelect:100,onNextPage:function(){return j(h+1)},onPreviousPage:function(){return j(h-1)},onRefresh:function(){return j(1)},onSearch:A,searchValue:d,busy:P,currentPage:h,limit:10,total:_,onPageChange:j,onSelect:M,onClose:D,onCancel:D,onSave:F}))};function Zl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var es=wp.element.useState;const ts=function(){var e=Jo(),t=e.actions,n=e.state,r=t.getOption,o=t.updateOption,a=n.isLoading,i=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,s=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){s=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Zl(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zl(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(es("snippets"),2),c=i[0],l=i[1],s=r("database_inspection",!1),u={snippets:to.SETTINGS.SNIPPET.LABEL+"s",settings:to.COMMON.SETTINGS,"database-inspection":to.SETTINGS.DEVELOPERS.DATABASE_INSPECTION,license:to.COMMON.LICENSE_TAB}[c]||to.SETTINGS.SNIPPET.LABEL+"s",d=React.createElement(Rr.M,{hideText:to.COMMON.HIDE,hide:r("hide_tutorial",!1),onHide:function(){confirm(to.ALERTS.ARE_YOU_SURE)&&o(!0,"hide_tutorial")},showMessagesCount:!0,messages:[{title:"⚠️ Use the Plugin Carefully",message:"Please use this plugin with care. Ensure you know what you are doing and that the code you input does what you expect. You are solely responsible for the code you use and any issues that might arise because of it. Always have a backup of your website."},{title:"🤖 Seek Professional Help When Unsure",message:"If you are not sure what you are doing, contact a freelancer or someone with experience. Don't use ChatGPT to generate code that you don't understand to use out of the box; always verify."},{title:"ℹ️ Register Callable Functions",message:"If you want to use Function Calling or Tools with AI models, make sure you register your code under the Callable type. Ensure that the snippet is only the function and nothing else in this case."},{title:"📝 Create Global Snippets for WordPress Filters",message:"You can also create global snippets to call WordPress filters. You can choose between front and back, meaning that the code will be loaded on the live site or the admin panel. If you choose all, the code will always be loaded."},{title:"🔐 Whitelist REST Routes for Front Global Snippets",message:"If you choose Front for the global snippet, for security reasons you may need to whitelist some REST routes. You can do so with the following filter: `mwcode_rest_whitelist` or bypass the authorization using `mwcode_rest_authorized`."}]}),f=React.createElement(P.V,{title:to.SETTINGS.MODULES.CODE_BLOCKS},React.createElement(O.N,null,React.createElement(O.Y,{minimal:!0},React.createElement(L.z,{busy:a,title:to.SETTINGS.MODULES.CODE_BLOCKS_SELECTION,className:"primary"},React.createElement(Ql,null))),React.createElement(O.Y,{minimal:!0},React.createElement(L.z,{busy:a,title:to.SETTINGS.MODULES.CODE_BLOCKS_INSTRUCTIONS,className:"primary"},React.createElement(Tr.s,null,to.SETTINGS.MODULES.CODE_BLOCKS_INSTRUCTIONS_DESCRIPTION),React.createElement(Nr.g,{tiny:!0}),React.createElement(A.X,{variant:"warning"},to.SETTINGS.MODULES.CODE_BLOCKS_INSTRUCTIONS_WARNING)))));return React.createElement(b.A,null,React.createElement(T.z,null,React.createElement(N.n,{title:to.SETTINGS.HEADER_TITLE,section:u,isPro:z}),React.createElement(O.N,null,React.createElement(O.Y,{fullWidth:!0},d,React.createElement(P._,{keepTabOnReload:!0,onChange:function(e,t,n){null!=t&&t.key&&l(t.key)}},React.createElement(P.V,{title:to.SETTINGS.SNIPPET.LABEL+"s",key:"snippets"},React.createElement(Nl,null)),React.createElement(P.V,{title:to.COMMON.SETTINGS,key:"settings"},React.createElement(_l,null)),r("code_blocks",!1)&&f,s&&React.createElement(P.V,{title:to.SETTINGS.DEVELOPERS.DATABASE_INSPECTION,key:"database-inspection"},React.createElement(O.N,null,React.createElement(O.Y,{minimal:!0},React.createElement(L.z,{busy:a,title:to.SETTINGS.DEVELOPERS.DATABASE_INSPECTION,className:"primary"},React.createElement(zl,null))))),React.createElement(P.V,{title:to.COMMON.LICENSE_TAB,key:"license"},React.createElement(O.N,null,React.createElement(O.Y,{minimal:!0},React.createElement(Xr,{domain:M,prefix:j,isPro:z,isRegistered:U})))))))))};var ns,rs=n(6897),os=["children","type","title","hint","isSelected","isDisplayed"];function as(){return as=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},as.apply(null,arguments)}var is=React.createElement(W.z,{icon:"cat",style:{width:20,height:20}}),cs=V.Ay.div(ns||(ns=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n color: black;\n display: flex;\n flex-direction: column;\n border: 1px solid black;\n font-size: 15px;\n box-sizing: content-box;\n font-weight: 400;\n font-size: 13px;\n padding: 10px;\n background: hsl(0deg 0% 100% / 75%);\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;\n margin-bottom: 10px;\n\n\n .mwcode-title-container {\n flex: inherit;\n padding: 5px 0px 5px 10px;\n display: flex;\n align-items: center;\n color: black;\n font-weight: 600;\n cursor: pointer;\n\n .mwcode-hint {\n font-size: 10px;\n font-weight: 400;\n text-align: right;\n flex: auto;\n\n .mwcode-pill {\n background: var(--wp--preset--color--vivid-cyan-blue);\n padding: 5px 10px;\n border-radius: 8px;\n color: white;\n }\n\n .mwcode-pill-purple {\n background: var(--wp--preset--color--vivid-purple);\n }\n }\n }\n\n .mwcode-block-container-content {\n flex: auto;\n padding: 10px;\n display: flex;\n flex-direction: column;\n }\n\n\t&.mwcode-chatbot {\n\t\tbackground: var(--neko-main-color);\n\n\t\t.mwcode-title-container {\n\t\t\tcolor: white;\n\t\t}\t\n\n\t\t.mwcode-block-container-content {\n\t\t\tmargin-top: 10px;\n\t\t\tborder-radius: 5px;\n\t\t\tbackground: var(--neko-background-color);\n\t\t}\n\t}\n\n &.is-selected {\n }\n']))),ls=function(e){var t=e.children,n=e.type,r=void 0===n?"":n,o=e.title,a=void 0===o?"":o,i=e.hint,c=void 0===i?"":i,l=e.isSelected,s=e.isDisplayed,u=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,os),d=(0,rs.gR)("mwcode-block-container","mwcode-".concat(r),{"is-selected":l,"is-meow":!0});return React.createElement(cs,as({className:d},u),React.createElement("div",{className:"mwcode-title-container"},is,React.createElement("div",null,a),React.createElement("div",{className:"mwcode-hint"},c)),(l||s)&&React.createElement("div",{className:"mwcode-block-container-content"},t))},ss=wp.i18n.__,us=wp.blocks.registerBlockType,ds=wp.blockEditor,fs=ds.InspectorControls,ps=ds.useBlockProps,hs=wp.components,ms=hs.PanelBody,gs=hs.SelectControl,ys=function(e){var t=e.attributes,n=e.setAttributes,r=e.isSelected,o=t.code,a=t.target,i=ps();return React.createElement("div",i,React.createElement(fs,null,React.createElement(ms,{title:ss("Code Block Settings","code-engine")},React.createElement(gs,{label:ss("Target Language","code-engine"),value:a,options:[{label:"PHP",value:"php"},{label:"JS",value:"js"}],onChange:function(e){return n({target:e})}}))),React.createElement(ls,{title:ss("Content Code Block","code-engine"),isSelected:r,isDisplayed:!0},React.createElement(gs,{label:ss("Target Language","code-engine"),value:a,options:[{label:"PHP",value:"php"},{label:"JS",value:"js"}],onChange:function(e){return n({target:e})}}),React.createElement("div",{style:{marginTop:"10px",outline:"rgb(160, 177, 233) solid 3px",padding:"5px",borderRadius:"5px"}},React.createElement($a,{code:o,snippet:{scope:"content_"+a,functionTarget:a},setCode:function(e){return n({code:e})}}))))},vs=function(e){var t=e.attributes,n=t.code,r=t.target,o=function(e){return e?e.replace(/\\/g,"\\\\").replace(/"/g,"&quot;"):""}(n),a='[code-engine target="'.concat(r,'" code="').concat(o,'" ]');return React.createElement("div",null,a)};var bs=wp.element.render,ws=new y.E({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnMount:!1,retry:!1,placeholderData:function(e){return e}}}});H.code_blocks&&us("code-engine/content",{title:ss("Content Code Block","code-engine"),description:ss("Container to embed code directly into the post content","code-engine"),icon:is,category:"widgets",keywords:[ss("code","code-engine"),ss("content","code-engine"),ss("block","code-engine")],attributes:{target:{type:"string",default:"php"},code:{type:"string",default:""}},edit:ys,save:vs}),document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("mwcode-admin-settings");e&&bs(React.createElement(Ko,null,React.createElement(v.Ht,{client:ws},React.createElement(ts,null))),e);var t=document.getElementById("meow-common-dashboard");t&&bs(React.createElement(v.Ht,{client:ws},React.createElement(b.A,null,React.createElement(kr,null))),t)}))},1594:e=>{e.exports=React},5206:e=>{e.exports=ReactDOM}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.m=t,r.amdO={},e=[],r.O=(t,n,o,a)=>{if(!n){var i=1/0;for(u=0;u<e.length;u++){for(var[n,o,a]=e[u],c=!0,l=0;l<n.length;l++)(!1&a||i>=a)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(c=!1,a<i&&(i=a));if(c){e.splice(u--,1);var s=o();void 0!==s&&(t=s)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,o,a]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e={57:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,a,[i,c,l]=n,s=0;if(i.some((t=>0!==e[t]))){for(o in c)r.o(c,o)&&(r.m[o]=c[o]);if(l)var u=l(r)}for(t&&t(n);s<i.length;s++)a=i[s],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(u)},n=self.webpackChunkcode_engine=self.webpackChunkcode_engine||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),r.nc=void 0;var o=r.O(void 0,[121],(()=>r(4689)));o=r.O(o)})();