/
var
/
www
/
html
/
wordpress
/
wp-content
/
plugins
/
elementor
/
assets
/
js
/
packages
/
editor-widget-creation
/
Upload File
HOME
!function(){"use strict";var e={d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{init:function(){return y}});var n=window.elementorV2.editor,o=window.React,i=window.elementorV2.editorMcp,r=window.elementorV2.editorUi,l=window.elementorV2.events,a=window.elementorV2.icons,c=window.elementorV2.ui,s=window.wp.i18n;const d="elementor/editor/create-widget",m="https://assets.elementor.com/packages/v1/images/angie-promotion.svg",u="angie_cta_clicked",g="angie_install_started";function p({prompt:e,entryPoint:t,onClose:n}){const[d,u]=(0,o.useState)("idle"),p=()=>{"installing"!==d&&n()};return o.createElement(r.ThemeProvider,null,o.createElement(c.Dialog,{fullWidth:!0,maxWidth:"md",open:!0,onClose:p},o.createElement(c.IconButton,{"aria-label":(0,s.__)("Close","elementor"),onClick:p,sx:{position:"absolute",right:8,top:8,zIndex:1}},o.createElement(a.XIcon,null)),o.createElement(c.DialogContent,{sx:{p:0,overflow:"hidden"}},o.createElement(c.Stack,{direction:"row",sx:{height:400}},o.createElement(c.Image,{sx:{height:"100%",aspectRatio:"1 / 1",objectFit:"cover",objectPosition:"right center"},src:m}),o.createElement(c.Stack,{gap:2,justifyContent:"center",p:4},o.createElement(c.Typography,{variant:"h6",fontWeight:600,whiteSpace:"nowrap"},"error"===d?(0,s.__)("Installation failed","elementor"):(0,s.__)("Install Angie to build custom widgets","elementor")),o.createElement(c.Typography,{variant:"body2",color:"text.secondary"},"error"===d?(0,s.__)("We couldn't install Angie automatically. Click below to install it manually.","elementor"):(0,s.__)("Angie lets you generate custom widgets, sections, and code using simple instructions.","elementor")),"error"!==d&&o.createElement(c.Typography,{variant:"body2",color:"text.secondary"},(0,s.__)("Install once to start building directly inside the editor.","elementor")),o.createElement(c.Stack,{direction:"row",justifyContent:"flex-end",sx:{mt:2}},"error"===d?o.createElement(c.Button,{variant:"contained",color:"accent",onClick:()=>{e&&(0,i.redirectToInstallation)(e)}},(0,s.__)("Install Manually","elementor")):o.createElement(c.Button,{variant:"contained",color:"accent",onClick:async()=>{e&&(u("installing"),(0,l.trackEvent)({eventName:g,trigger_source:t}),(await(0,i.installAngiePlugin)()).success?(0,i.redirectToAppAdmin)(e):u("error"))},disabled:"installing"===d,startIcon:"installing"===d?o.createElement(c.CircularProgress,{size:18,color:"inherit"}):void 0},"installing"===d?(0,s.__)("Installing…","elementor"):(0,s.__)("Install Angie","elementor"))))))))}function w(){const[e,t]=(0,o.useState)(null);return(0,o.useEffect)(()=>{const e=e=>{const n=e,o=(0,i.isAngieAvailable)();(0,l.trackEvent)({eventName:u,entry_point:n.detail.entry_point,has_angie_installed:o}),o?(0,i.sendPromptToAngie)(n.detail?.prompt):t(n.detail)};return window.addEventListener(d,e),()=>{window.removeEventListener(d,e)}},[]),e?o.createElement(p,{prompt:e.prompt,entryPoint:e.entry_point,onClose:()=>t(null)}):null}function y(){(0,n.injectIntoTop)({id:"create-widget",component:w})}(window.elementorV2=window.elementorV2||{}).editorWidgetCreation=t}(),window.elementorV2.editorWidgetCreation?.init?.();