­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ /*! For license information please see edit.js.LICENSE.txt */ (self.webpackChunkcode_snippets=self.webpackChunkcode_snippets||[]).push([[8739],{3175(e,t,n){"use strict";n.d(t,{F:()=>C});var r=n(4467),i=n(1609),s=n(7723),o=n(1240),a=n(7834),c=n(7738),l=n(6094),u=n(7894),d=n(752),p=n(4080),f=n(7161),h=n(781),m=n(1755),v=n(2804),b=n(7870),g=n(8493),y=n(4885),_=n(6724),w=n(6940),j=n(790);function x(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 O(e){for(var t=1;td}),n(1609);var r=n(7723),i=n(6942),s=n.n(i),o=n(4888),a=n(2449),c=n(4885),l=n(6940),u=n(790),d=function(e){var t=e.accepted,n=(0,r.sprintf)((0,r._n)("Bundle · %d snippet","Bundle · %d snippets",c.a6.parts.length,"code-snippets"),c.a6.parts.length);return(0,u.jsxs)("div",{className:"ai-agent-plan",children:[(0,u.jsxs)("div",{className:"ai-agent-plan__header",children:[(0,u.jsx)("h2",{className:"ai-agent-plan__title",children:c.a6.title}),(0,u.jsx)("span",{className:"ai-agent-plan__badge is-bundle",children:n})]}),(0,u.jsx)("p",{className:"ai-agent-plan__overview",children:c.a6.summary}),(0,u.jsx)("h3",{className:"ai-agent-plan__parts-heading",children:(0,r.__)("What will be created","code-snippets")}),(0,u.jsx)("ul",{className:"ai-agent-plan__parts",children:c.a6.parts.map(function(e){return(0,u.jsxs)("li",{className:"ai-agent-plan__part",children:[(0,u.jsx)(o.E,{name:(0,l.bE)(e.language),small:!0}),(0,u.jsx)("span",{className:"ai-agent-plan__part-name",children:e.name}),(0,u.jsx)("p",{className:"ai-agent-plan__part-desc",children:e.description})]},e.name)})}),(0,u.jsxs)("div",{className:"ai-agent-plan__actions",children:[(0,u.jsx)(a.$,{primary:!0,type:"button",className:s()("ai-agent-demo-accept",{"demo-click":t}),"aria-hidden":"true",tabIndex:-1,children:(0,r.__)("Accept & create","code-snippets")}),(0,u.jsx)(a.$,{secondary:!0,type:"button","aria-hidden":"true",tabIndex:-1,children:(0,r.__)("Refine plan","code-snippets")})]})]})}},781(e,t,n){"use strict";n.d(t,{z:()=>c}),n(1609);var r=n(7723),i=n(6942),s=n.n(i),o=n(2449),a=n(790),c=function(e){var t=e.value,n=e.submitLabel,i=e.placeholder,c=e.typing,l=e.pressed,u=void 0!==l&&l,d=e.disabled,p=void 0!==d&&d;return(0,a.jsxs)("div",{className:s()("ai-agent-prompt","ai-agent-demo-prompt",{"is-typing":c}),children:[(0,a.jsxs)("div",{className:"ai-agent-prompt__input ai-agent-demo-prompt__text","aria-live":"polite",children:[""===t?(0,a.jsx)("span",{className:"ai-agent-demo-prompt__placeholder",children:i}):t,c&&(0,a.jsx)("span",{className:"ai-agent-demo-prompt__caret","aria-hidden":"true"})]}),(0,a.jsxs)("div",{className:"ai-agent-prompt__footer",children:[(0,a.jsx)("span",{className:"ai-agent-prompt__hint",children:(0,r.__)("Enter to send · Shift/Ctrl/⌘+Enter for a new line","code-snippets")}),(0,a.jsx)(o.$,{primary:!0,type:"button",disabled:p,className:s()("ai-agent-demo-send",{"demo-click":u}),"aria-hidden":"true",tabIndex:-1,children:n})]})]})}},1755(e,t,n){"use strict";n.d(t,{H:()=>h});var r=n(3453),i=n(1609),s=n(7723),o=n(4888),a=n(2449),c=n(7166),l=n(781),u=n(6940),d=n(790),p=function(e){var t=e.snippet,n=e.stage,r=e.onPreview;return(0,d.jsxs)("li",{className:"ai-agent-result__row",children:[(0,u.Nl)(n,"refine-open")&&(0,d.jsx)("input",{type:"checkbox",checked:!0,disabled:!0,"aria-label":t.name}),(0,d.jsx)(o.E,{name:(0,u.bE)(t.language),small:!0}),(0,d.jsx)("span",{className:"ai-agent-result__name",children:t.name}),(0,d.jsx)(a.$,{link:!0,type:"button",onClick:r,children:(0,s.__)("Preview code","code-snippets")}),"applying"!==n&&(0,d.jsx)(a.$,{link:!0,type:"button",className:"ai-agent-result__link","aria-hidden":"true",tabIndex:-1,children:(0,s.__)("Edit","code-snippets")})]})},f=function(e){var t=e.stage,n=e.typedRefinement;return(0,u.Nl)(t,"refine-open")?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"ai-agent-result__edit-head",children:[(0,d.jsx)("span",{children:(0,s.__)("Select the snippets to change, then describe the change.","code-snippets")}),(0,d.jsxs)("div",{className:"ai-agent-result__edit-actions",children:[(0,d.jsx)(a.$,{link:!0,type:"button","aria-hidden":"true",tabIndex:-1,children:(0,s.__)("Deselect all","code-snippets")}),(0,d.jsx)(a.$,{link:!0,type:"button","aria-hidden":"true",tabIndex:-1,children:(0,s.__)("Cancel","code-snippets")})]})]}),(0,d.jsx)(l.z,{value:n,typing:"typing-refinement"===t,pressed:"applying"===t,submitLabel:(0,s.__)("Apply changes","code-snippets"),placeholder:(0,s.__)("Describe the changes to the selected snippet(s)…","code-snippets")})]}):(0,d.jsx)(a.$,{secondary:!0,type:"button",className:"ai-agent-result__make-changes","aria-hidden":"true",tabIndex:-1,children:(0,s.__)("Make changes","code-snippets")})},h=function(e){var t=e.stage,n=e.snippets,o=e.typedRefinement,a=(0,i.useState)(),l=(0,r.A)(a,2),h=l[0],m=l[1];return(0,d.jsxs)("div",{className:"ai-agent-result",children:[(0,d.jsxs)("div",{className:"ai-agent-plan__header",children:[(0,d.jsx)("h2",{className:"ai-agent-plan__title",children:(0,s.__)("Dismissible welcome banner","code-snippets")}),(0,d.jsx)("span",{className:"ai-agent-plan__badge is-done",children:"applying"===t?(0,s.__)("Updating…","code-snippets"):(0,s.__)("Created","code-snippets")})]}),(0,d.jsx)("p",{className:"ai-agent-result__lead",children:(0,s.__)("In Pro these snippets would now be on your site, inactive. Preview the code, or make changes below.","code-snippets")}),(0,d.jsx)("ul",{className:"ai-agent-result__rows",children:n.map(function(e){return(0,d.jsx)(p,{snippet:e,stage:t,onPreview:function(){return m(e)}},e.key)})}),(0,d.jsx)("div",{className:"ai-agent-result__edit",children:(0,d.jsx)(f,{stage:t,typedRefinement:o})}),h&&(0,d.jsx)(c.M3,{title:h.name,code:h.code,type:(0,u.bE)(h.language),onRequestClose:function(){return m(void 0)}})]})}},2804(e,t,n){"use strict";n.d(t,{W:()=>v});var r=n(3453),i=n(1609),s=n(7723),o=n(6942),a=n.n(o),c=n(4885),l=n(6940),u=n(790),d=[{label:(0,s.__)("Today","code-snippets"),used:2,limit:25},{label:(0,s.__)("This month","code-snippets"),used:34,limit:300}],p=[(0,s.__)("Hide the admin bar for subscribers","code-snippets"),(0,s.__)("Custom login screen logo","code-snippets")],f=function(){return(0,u.jsxs)("div",{className:"ai-agent-quota",children:[(0,u.jsx)("h2",{className:"ai-agent-sidebar__heading",children:(0,s.__)("AI usage","code-snippets")}),d.map(function(e){var t=e.label,n=e.used,r=e.limit;return(0,u.jsxs)("div",{className:"ai-agent-quota__row",children:[(0,u.jsxs)("div",{className:"ai-agent-quota__label",children:[(0,u.jsx)("span",{children:t}),(0,u.jsx)("span",{children:(0,s.sprintf)((0,s.__)("%1$d / %2$d","code-snippets"),n,r)})]}),(0,u.jsx)("div",{className:"ai-agent-quota__track is-ok",children:(0,u.jsx)("div",{className:"ai-agent-quota__fill",style:{inlineSize:"".concat(100*n/r,"%")}})})]},t)})]})},h=function(e){var t=e.stage,n=function(e){return"applying"===e?{label:(0,s.__)("Updating","code-snippets")}:(0,l.Nl)(e,"result-ready")?{label:(0,s.__)("Completed","code-snippets"),modifier:"is-done"}:(0,l.Nl)(e,"building")?{label:(0,s.__)("Building","code-snippets")}:(0,l.Nl)(e,"plan-ready")?{label:(0,s.__)("Plan ready","code-snippets"),modifier:"is-plan"}:{label:(0,s.__)("Planning","code-snippets")}}(t);return(0,u.jsx)("div",{className:"ai-agent-history",children:(0,u.jsxs)("ul",{className:"ai-agent-history__list",children:[(0,l.Nl)(t,"prompt-sent")&&(0,u.jsx)("li",{className:"ai-agent-history__item is-active",children:(0,u.jsxs)("span",{className:"ai-agent-history__open",children:[(0,u.jsx)("span",{className:"ai-agent-history__title",children:(0,s.__)("Dismissible welcome banner","code-snippets")}),(0,u.jsx)("span",{className:a()("ai-agent-history__status",n.modifier),children:n.label})]})}),p.map(function(e){return(0,u.jsx)("li",{className:"ai-agent-history__item",children:(0,u.jsxs)("span",{className:"ai-agent-history__open",children:[(0,u.jsx)("span",{className:"ai-agent-history__title",children:e}),(0,u.jsx)("span",{className:"ai-agent-history__status is-done",children:(0,s.__)("Completed","code-snippets")})]})},e)})]})})},m=function(e){var t=e.tab,n=e.current,r=e.label,i=e.onSelect;return(0,u.jsx)("button",{type:"button",role:"tab",id:"ai-agent-demo-tab-".concat(t),"aria-selected":t===n,"aria-controls":"ai-agent-demo-panel-".concat(t),className:a()("ai-agent-sidebar__tab",{"is-active":t===n}),onClick:function(){return i(t)},children:r})},v=function(e){var t=e.stage,n=(0,i.useState)("actions"),o=(0,r.A)(n,2),a=o[0],l=o[1];return(0,u.jsxs)("aside",{className:"ai-agent-sidebar","aria-label":(0,s.__)("AI Agent tools","code-snippets"),children:[(0,u.jsxs)("div",{className:"ai-agent-sidebar__tabs",role:"tablist",children:[(0,u.jsx)(m,{tab:"actions",current:a,label:(0,s.__)("Prompt Actions","code-snippets"),onSelect:l}),(0,u.jsx)(m,{tab:"history",current:a,label:(0,s.__)("Past Conversations","code-snippets"),onSelect:l})]}),(0,u.jsxs)("div",{className:"ai-agent-sidebar__panel",role:"tabpanel",id:"ai-agent-demo-panel-actions","aria-labelledby":"ai-agent-demo-tab-actions",hidden:"actions"!==a,children:[(0,u.jsxs)("div",{className:"ai-agent-examples",children:[(0,u.jsx)("h2",{className:"ai-agent-sidebar__heading",children:(0,s.__)("Prompt examples","code-snippets")}),c.Qn.map(function(e){return(0,u.jsx)("button",{type:"button",className:"ai-agent-examples__chip",disabled:!0,children:e},e)})]}),(0,u.jsx)(f,{})]}),(0,u.jsx)("div",{className:"ai-agent-sidebar__panel",role:"tabpanel",id:"ai-agent-demo-panel-history","aria-labelledby":"ai-agent-demo-tab-history",hidden:"history"!==a,children:(0,u.jsx)(h,{stage:t})})]})}},7870(e,t,n){"use strict";n.d(t,{$V:()=>s,RC:()=>o,dI:()=>a}),n(1609);var r=n(7723),i=n(790),s=function(e){var t=e.speaker,n=e.children;return(0,i.jsxs)("div",{className:"ai-agent-message is-".concat(t),children:[(0,i.jsx)("span",{className:"ai-agent-message__role",children:"user"===t?(0,r.__)("You","code-snippets"):(0,r.__)("AI Agent","code-snippets")}),(0,i.jsx)("div",{className:"ai-agent-message__content",children:n})]})},o=function(e){var t=e.label;return(0,i.jsxs)("div",{className:"ai-agent-typing",children:[(0,i.jsxs)("span",{className:"ai-agent-typing__dots","aria-hidden":"true",children:[(0,i.jsx)("i",{}),(0,i.jsx)("i",{}),(0,i.jsx)("i",{})]}),(0,i.jsx)("span",{children:t})]})},a=function(e){var t=e.label;return(0,i.jsxs)("div",{className:"ai-agent-demo-transit",children:[(0,i.jsx)("span",{className:"ai-agent-demo-transit__endpoint",children:(0,r.__)("Your site","code-snippets")}),(0,i.jsx)("span",{className:"ai-agent-demo-transit__track","aria-hidden":"true",children:(0,i.jsx)("span",{className:"ai-agent-demo-transit__pulse"})}),(0,i.jsx)("span",{className:"ai-agent-demo-transit__endpoint",children:(0,r.__)("Code Snippets Cloud","code-snippets")}),(0,i.jsx)("span",{className:"screen-reader-text",children:t})]})}},8493(e,t,n){"use strict";n.d(t,{c:()=>o}),n(1609);var r=n(7723),i=n(1075),s=n(790),o=function(e){var t=e.onReplay;return(0,s.jsxs)(i.T,{title:(0,r.__)("That was a demo: the real agent writes for you","code-snippets"),onReplay:t,children:[(0,s.jsx)("p",{children:(0,r.__)("The whole walkthrough was scripted and ran inside this plugin. No prompt or snippet left your site, and none were added to it.","code-snippets")}),(0,s.jsx)("p",{children:(0,r.__)("In Code Snippets Pro, the AI Agent does all of this for whatever you ask it to build, and the snippets it writes are real. They are saved to your site switched off, so nothing runs until you have read them and turned them on.","code-snippets")})]})}},4080(e,t,n){"use strict";n.d(t,{t:()=>o});var r=n(7723),i={ask:{step:(0,r.__)("Step 1 of 5","code-snippets"),title:(0,r.__)("Ask in plain English","code-snippets"),body:(0,r.__)("No syntax to learn and no boilerplate to copy. Describe what you want the site to do, and the agent works out what that means in code.","code-snippets")},plan:{step:(0,r.__)("Step 2 of 5","code-snippets"),title:(0,r.__)("Sent for planning","code-snippets"),body:(0,r.__)("Your request goes to Code Snippets Cloud, which works out what needs building, whether that is one snippet or several, before writing anything.","code-snippets")},approve:{step:(0,r.__)("Step 3 of 5","code-snippets"),title:(0,r.__)("You approve the plan","code-snippets"),body:(0,r.__)("Nothing is written until you accept. Read what it intends to build, send it back for changes, or let it go ahead.","code-snippets")},build:{step:(0,r.__)("Step 4 of 5","code-snippets"),title:(0,r.__)("Built and added to your site","code-snippets"),body:(0,r.__)("Each part of the plan becomes a real snippet, written to suit your site rather than pulled from a template. They arrive inactive, so nothing runs until you have read the code and switched them on.","code-snippets")},refine:{step:(0,r.__)("Step 5 of 5","code-snippets"),title:(0,r.__)("Refine what it built","code-snippets"),body:(0,r.__)("Not quite right? Say what to change in plain English and it rewrites the snippets in place, keeping the conversation so each refinement builds on the last.","code-snippets")},done:{step:(0,r.__)("Done","code-snippets"),title:(0,r.__)("Ready to review","code-snippets"),body:(0,r.__)("The finished snippets are on your site, waiting for you to check them over and activate them.","code-snippets")}},s={"typing-prompt":"ask","prompt-sent":"plan",planning:"plan","plan-ready":"approve","plan-accepted":"approve",building:"build","result-ready":"build","refine-open":"refine","typing-refinement":"refine",applying:"refine",saved:"done"},o=function(e){var t=s[e];return t?i[t]:void 0}},4885(e,t,n){"use strict";n.d(t,{Lq:()=>p,Qn:()=>a,SK:()=>f,Ze:()=>h,a6:()=>u,cr:()=>b,j7:()=>c,s$:()=>g});var r=n(4467),i=n(7723);function s(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 o(e){for(var t=1;t\n\t\t\t

%s

\n\t\t\t\n\t\t\',\n\t\tesc_html( \''.concat(e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),"' ),\n\t\tesc_attr__( 'Dismiss this message', 'default' )\n\t);\n} );\n\nadd_action( 'wp_footer', function () {\n\t?>\n\t