/home/desid573/verdenaturopathy.com.au/wp-content/themes/Divi/ai-app/build
Edit: /home/desid573/verdenaturopathy.com.au/wp-content/themes/Divi/ai-app/build/et-ai-app.bundle.js (2161301B)
/*! For license information please see et-ai-app.bundle.js.LICENSE.txt */
(()=>{var __webpack_modules__={22105:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ApiProvider:()=>tt,QueryStatus:()=>n,buildCreateApi:()=>he,copyWithStructuralSharing:()=>O,coreModule:()=>Oe,createApi:()=>rt,defaultSerializeQueryArgs:()=>pe,fakeBaseQuery:()=>de,fetchBaseQuery:()=>j,reactHooksModule:()=>et,retry:()=>V,setupListeners:()=>q,skipSelector:()=>ae,skipToken:()=>oe});var n,i,o=r(24268),a=r(12902),s=r(22222),l=r(14791),u=r(44815),c=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]
=200&&e.status<=299},T=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function L(e){if(!(0,o.isPlainObject)(e))return e;for(var t=b({},e),r=0,n=Object.entries(t);r=c)}var h=(0,o.createAsyncThunk)(r+"/executeQuery",f,{getPendingMeta:function(){var e;return(e={startedTimeStamp:Date.now()})[o.SHOULD_AUTOBATCH]=!0,e},condition:function(e,t){var n,i,o,a=(0,t.getState)(),l=null==(i=null==(n=a[r])?void 0:n.queries)?void 0:i[e.queryCacheKey],u=null==l?void 0:l.fulfilledTimeStamp,c=e.originalArgs,f=null==l?void 0:l.originalArgs,h=s[e.endpointName];return!(!X(e)&&("pending"===(null==l?void 0:l.status)||!p(e,a)&&(!Y(h)||!(null==(o=null==h?void 0:h.forceRefetch)?void 0:o.call(h,{currentArg:c,previousArg:f,endpointState:l,state:a})))&&u))},dispatchConditionRejection:!0}),d=(0,o.createAsyncThunk)(r+"/executeMutation",f,{getPendingMeta:function(){var e;return(e={startedTimeStamp:Date.now()})[o.SHOULD_AUTOBATCH]=!0,e}});function m(e){return function(t){var r,n;return(null==(n=null==(r=null==t?void 0:t.meta)?void 0:r.arg)?void 0:n.endpointName)===e}}return{queryThunk:h,mutationThunk:d,prefetch:function(e,t,r){return function(n,i){var o=function(e){return"force"in e}(r)&&r.force,a=function(e){return"ifOlderThan"in e}(r)&&r.ifOlderThan,s=function(r){return void 0===r&&(r=!0),u.endpoints[e].initiate(t,{forceRefetch:r})},l=u.endpoints[e].select(t)(i());if(o)n(s());else if(a){var c=null==l?void 0:l.fulfilledTimeStamp;if(!c)return void n(s());(Number(new Date)-Number(new Date(c)))/1e3>=a&&n(s())}else n(s(!1))}},updateQueryData:function(e,t,r){return function(i,o){var s,l,c=u.endpoints[e].select(t)(o()),f={patches:[],inversePatches:[],undo:function(){return i(u.util.patchQueryData(e,t,f.inversePatches))}};if(c.status===n.uninitialized)return f;if("data"in c)if((0,a.o$)(c.data)){var p=(0,a.aS)(c.data,r),h=p[1],d=p[2];(s=f.patches).push.apply(s,h),(l=f.inversePatches).push.apply(l,d)}else{var m=r(c.data);f.patches.push({op:"replace",path:[],value:m}),f.inversePatches.push({op:"replace",path:[],value:c.data})}return i(u.util.patchQueryData(e,t,f.patches)),f}},upsertQueryData:function(e,t,r){return function(n){var i;return n(u.endpoints[e].initiate(t,((i={subscribe:!1,forceRefetch:!0})[Q]=function(){return{data:r}},i)))}},patchQueryData:function(e,t,r){return function(n){var i=s[e];n(u.internalActions.queryResultPatched({queryCacheKey:l({queryArgs:t,endpointDefinition:i,endpointName:e}),patches:r}))}},buildMatchThunkActions:function(e,t){return{matchPending:(0,o.isAllOf)((0,o.isPending)(e),m(t)),matchFulfilled:(0,o.isAllOf)((0,o.isFulfilled)(e),m(t)),matchRejected:(0,o.isAllOf)((0,o.isRejected)(e),m(t))}}}}({baseQuery:i,reducerPath:s,context:r,api:e,serializeQueryArgs:u}),v=g.queryThunk,w=g.mutationThunk,_=g.patchQueryData,S=g.updateQueryData,E=g.upsertQueryData,C=g.prefetch,P=g.buildMatchThunkActions,A=function(e){var t=e.reducerPath,r=e.queryThunk,i=e.mutationThunk,s=e.context,u=s.endpointDefinitions,c=s.apiUid,f=s.extractRehydrationInfo,p=s.hasRehydrationInfo,h=e.assertTagType,d=e.config,m=(0,o.createAction)(t+"/resetApiState"),y=(0,o.createSlice)({name:t+"/queries",initialState:ie,reducers:{removeQueryResult:{reducer:function(e,t){delete e[t.payload.queryCacheKey]},prepare:(0,o.prepareAutoBatched)()},queryResultPatched:function(e,t){var r=t.payload,n=r.queryCacheKey,i=r.patches;te(e,n,(function(e){e.data=(0,a.QE)(e.data,i.concat())}))}},extraReducers:function(e){e.addCase(r.pending,(function(e,t){var r,i=t.meta,o=t.meta.arg,a=X(o);(o.subscribe||a)&&(null!=e[r=o.queryCacheKey]||(e[r]={status:n.uninitialized,endpointName:o.endpointName})),te(e,o.queryCacheKey,(function(e){e.status=n.pending,e.requestId=a&&e.requestId?e.requestId:i.requestId,void 0!==o.originalArgs&&(e.originalArgs=o.originalArgs),e.startedTimeStamp=i.startedTimeStamp}))})).addCase(r.fulfilled,(function(e,t){var r=t.meta,i=t.payload;te(e,r.arg.queryCacheKey,(function(e){var t;if(e.requestId===r.requestId||X(r.arg)){var o=u[r.arg.endpointName].merge;if(e.status=n.fulfilled,o)if(void 0!==e.data){var s=r.fulfilledTimeStamp,l=r.arg,c=r.baseQueryMeta,f=r.requestId,p=(0,a.ZP)(e.data,(function(e){return o(e,i,{arg:l.originalArgs,baseQueryMeta:c,fulfilledTimeStamp:s,requestId:f})}));e.data=p}else e.data=i;else e.data=null==(t=u[r.arg.endpointName].structuralSharing)||t?O((0,a.mv)(e.data)?(0,a.Js)(e.data):e.data,i):i;delete e.error,e.fulfilledTimeStamp=r.fulfilledTimeStamp}}))})).addCase(r.rejected,(function(e,t){var r=t.meta,i=r.condition,o=r.arg,a=r.requestId,s=t.error,l=t.payload;te(e,o.queryCacheKey,(function(e){if(i);else{if(e.requestId!==a)return;e.status=n.rejected,e.error=null!=l?l:s}}))})).addMatcher(p,(function(e,t){for(var r=f(t).queries,i=0,o=Object.entries(r);i{"use strict";r.r(t),r.d(t,{EnhancerArray:()=>P,MiddlewareArray:()=>C,SHOULD_AUTOBATCH:()=>$e,TaskAbortError:()=>Pe,__DO_NOT_USE__ActionTypes:()=>i.Kf,addListener:()=>Ge,applyMiddleware:()=>i.md,autoBatchEnhancer:()=>Je,bindActionCreators:()=>i.DE,clearAllListeners:()=>He,combineReducers:()=>i.UY,compose:()=>i.qC,configureStore:()=>F,createAction:()=>N,createAsyncThunk:()=>ne,createDraftSafeSelector:()=>_,createEntityAdapter:()=>Q,createImmutableStateInvariantMiddleware:()=>M,createListenerMiddleware:()=>qe,createNextState:()=>n.ZP,createReducer:()=>W,createSelector:()=>o.P1,createSerializableStateInvariantMiddleware:()=>D,createSlice:()=>U,createStore:()=>i.MT,current:()=>n.Vk,findNonSerializableValue:()=>L,freeze:()=>n.vV,getDefaultMiddleware:()=>I,getType:()=>G,isAction:()=>B,isAllOf:()=>se,isAnyOf:()=>ae,isAsyncThunkAction:()=>de,isDraft:()=>n.mv,isFluxStandardAction:()=>V,isFulfilled:()=>he,isImmutableDefault:()=>A,isPending:()=>ce,isPlain:()=>T,isPlainObject:()=>E,isRejected:()=>fe,isRejectedWithValue:()=>pe,legacy_createStore:()=>i.jB,miniSerializeError:()=>re,nanoid:()=>X,original:()=>n.Js,prepareAutoBatched:()=>Ke,removeListener:()=>We,unwrapResult:()=>ie});var n=r(12902),i=r(14791),o=r(22222);function a(e){return function(t){var r=t.dispatch,n=t.getState;return function(t){return function(i){return"function"==typeof i?i(r,n,e):t(i)}}}}var s=a();s.withExtraArgument=a;const l=s;var u,c=(u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},u(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),f=function(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]",value:e};if("object"!=typeof e||null===e)return!1;if(null==o?void 0:o.has(e))return!1;for(var s=null!=n?n(e):Object.entries(e),l=i.length>0,u=function(e,s){var u=t?t+"."+e:e;if(l&&i.some((function(e){return e instanceof RegExp?e.test(u):u===e})))return"continue";return r(s)?"object"==typeof s&&(a=L(s,u,r,n,i,o))?{value:a}:void 0:{value:{keyPath:u,value:s}}},c=0,f=s;c-1}function G(e){return""+e}function H(e){var t,r={},n=[],i={addCase:function(e,t){var n="string"==typeof e?e:e.type;if(n in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[n]=t,i},addMatcher:function(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return t=e,i}};return e(i),[r,n,t]}function W(e,t,r,i){void 0===r&&(r=[]);var o,a="function"==typeof t?H(t):[t,r,i],s=a[0],l=a[1],u=a[2];if("function"==typeof e)o=function(){return O(e())};else{var c=O(e);o=function(){return c}}function f(e,t){void 0===e&&(e=o());var r=p([s[t.type]],l.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===r.filter((function(e){return!!e})).length&&(r=[u]),r.reduce((function(e,r){if(r){var i;if((0,n.mv)(e))return void 0===(i=r(e,t))?e:i;if((0,n.o$)(e))return(0,n.ZP)(e,(function(e){return r(e,t)}));if(void 0===(i=r(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return i}return e}),e)}return f.getInitialState=o,f}function U(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var r,n="function"==typeof e.initialState?e.initialState:O(e.initialState),i=e.reducers||{},o=Object.keys(i),a={},s={},l={};function u(){var t="function"==typeof e.extraReducers?H(e.extraReducers):[e.extraReducers],r=t[0],i=void 0===r?{}:r,o=t[1],a=void 0===o?[]:o,l=t[2],u=void 0===l?void 0:l,c=x(x({},i),s);return W(n,(function(e){for(var t in c)e.addCase(t,c[t]);for(var r=0,n=a;r0){var o=t.filter((function(t){return function(t,r,n){var i=n.entities[r.id],o=Object.assign({},i,r.changes),a=Y(o,e),s=a!==r.id;return s&&(t[r.id]=a,delete n.entities[r.id]),n.entities[a]=o,s}(n,t,r)})).length>0;o&&(r.ids=Object.keys(r.entities))}}function a(t,n){var i=K(t,e,n),a=i[0];o(i[1],n),r(a,n)}return{removeAll:(s=function(e){Object.assign(e,{ids:[],entities:{}})},l=q((function(e,t){return s(t)})),function(e){return l(e,void 0)}),addOne:q(t),addMany:q(r),setOne:q(n),setMany:q((function(e,t){for(var r=0,i=e=$(e);r-1;return r&&n}function ue(e){return"function"==typeof e[0]&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function ce(){for(var e=[],t=0;t0)for(var p=e.getState(),h=Array.from(r.values()),d=0,m=h;d{"use strict";r.r(t),r.d(t,{default:()=>c});var n=r(27361),i=r.n(n);function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||s(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 a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||s(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 s(e,t){if(e){if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r2?c-2:0),p=2;p0){var h=i()(window,"wp.i18n.sprintf");return h?h.apply(void 0,[u].concat(f)):u.replace("%s",f[0])}return u};const c=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useEnhanceMutation=t.useOutpaintImageMutation=t.useSketchImageMutation=t.useInpaintImageMutation=t.useGenerateSectionImagesMutation=t.useGenerateSectionContentMutation=t.useGenerateSectionShortcodeMutation=t.useGenerateLayoutImagesMutation=t.useGenerateLayoutContentMutation=t.useGenerateLayoutShortcodeMutation=t.useUpscaleImageMutation=t.useRefineImageMutation=t.useAutoGenerateImageMutation=t.useLazyRefineCodeQuery=t.useGenerateCodeMutation=t.useGenerateImageMutation=t.useLazyUserQuery=t.useUserQuery=t.useRefineModuleMutation=t.useRefineQuery=t.useLazyRefineQuery=t.useGeneratePromptMutation=t.useGenerateModuleMutation=t.useGenerateFieldMutation=void 0;var n=r(22105),i=window.EtAiAppData,o=i.ai_server_url,a=i.product_version,s=(0,n.fetchBaseQuery)({baseUrl:o,credentials:"same-origin",prepareHeaders:function(e,t){var r,n,i,o,s=t.getState();return e.set("Authorization","Bearer ".concat(null==s||null===(r=s.diviAIOptions)||void 0===r||null===(n=r.etAccount)||void 0===n?void 0:n.username,":").concat(null==s||null===(i=s.diviAIOptions)||void 0===i||null===(o=i.etAccount)||void 0===o?void 0:o.apiKey)),e.set("X-Product-Version",a),e}}),l=(0,n.createApi)({reducerPath:"api",baseQuery:(0,n.retry)(s,{retryCondition:function(e,t,r){var n,i=(null==r||null===(n=r.extraOptions)||void 0===n?void 0:n.maxRetries)||2,o=(null==r?void 0:r.attempt)||1;return 401!==e.status&&404!==e.status&&403!==e.status&&i>o}}),endpoints:function(e){return{generateField:e.mutation({query:function(e){return{url:"generate-text",method:"POST",body:e}}}),generateModule:e.mutation({query:function(e){return{url:"generate-module",method:"POST",body:e}}}),generatePrompt:e.mutation({query:function(e){return{url:"generate-prompt",method:"POST",body:e}}}),refineModule:e.mutation({query:function(e){return{url:"refine-module",method:"POST",body:e}}}),refine:e.query({query:function(e){return{url:"refine-text",method:"POST",body:e}}}),user:e.query({query:function(){return{url:"user"}}}),generateImage:e.mutation({query:function(e){return{url:"generate-image",method:"POST",body:e}},extraOptions:{maxRetries:3}}),autoGenerateImage:e.mutation({query:function(e){return{url:"autogenerate-image",method:"POST",body:e}},extraOptions:{maxRetries:3}}),refineImage:e.mutation({query:function(e){return{url:"refine-image",method:"POST",body:e}},extraOptions:{maxRetries:3}}),upscaleImage:e.mutation({query:function(e){return{url:"upscale-image",method:"POST",body:e}},extraOptions:{maxRetries:3}}),inpaintImage:e.mutation({query:function(e){return{url:"inpainting/selection",method:"POST",body:e}},extraOptions:{maxRetries:3}}),sketchImage:e.mutation({query:function(e){return{url:"inpainting/sketch",method:"POST",body:e}},extraOptions:{maxRetries:3}}),outpaintImage:e.mutation({query:function(e){return{url:"outpainting",method:"POST",body:e}},extraOptions:{maxRetries:3}}),enhance:e.mutation({query:function(e){return{url:"enhance",method:"POST",body:e}},extraOptions:{maxRetries:3}}),generateCode:e.mutation({query:function(e){return{url:"generate-code",method:"POST",body:e}},extraOptions:{maxRetries:3}}),refineCode:e.query({query:function(e){return{url:"refine-code",method:"POST",body:e}},extraOptions:{maxRetries:3}}),generateLayoutShortcode:e.mutation({query:function(e){return{url:"generate-layout/shortcode",method:"POST",body:e}},extraOptions:{maxRetries:3}}),generateLayoutContent:e.mutation({query:function(e){return{url:"generate-layout/content",method:"POST",body:e}},extraOptions:{maxRetries:3}}),generateLayoutImages:e.mutation({query:function(e){return{url:"generate-layout/images",method:"POST",body:e}},extraOptions:{maxRetries:3}}),generateSectionShortcode:e.mutation({query:function(e){return{url:"generate-section/shortcode",method:"POST",body:e}},extraOptions:{maxRetries:3}}),generateSectionContent:e.mutation({query:function(e){return{url:"generate-section/content",method:"POST",body:e}},extraOptions:{maxRetries:3}}),generateSectionImages:e.mutation({query:function(e){return{url:"generate-section/images",method:"POST",body:e}},extraOptions:{maxRetries:3}})}}});t.useGenerateFieldMutation=l.useGenerateFieldMutation,t.useGenerateModuleMutation=l.useGenerateModuleMutation,t.useGeneratePromptMutation=l.useGeneratePromptMutation,t.useLazyRefineQuery=l.useLazyRefineQuery,t.useRefineQuery=l.useRefineQuery,t.useRefineModuleMutation=l.useRefineModuleMutation,t.useUserQuery=l.useUserQuery,t.useLazyUserQuery=l.useLazyUserQuery,t.useGenerateImageMutation=l.useGenerateImageMutation,t.useGenerateCodeMutation=l.useGenerateCodeMutation,t.useLazyRefineCodeQuery=l.useLazyRefineCodeQuery,t.useAutoGenerateImageMutation=l.useAutoGenerateImageMutation,t.useRefineImageMutation=l.useRefineImageMutation,t.useUpscaleImageMutation=l.useUpscaleImageMutation,t.useGenerateLayoutShortcodeMutation=l.useGenerateLayoutShortcodeMutation,t.useGenerateLayoutContentMutation=l.useGenerateLayoutContentMutation,t.useGenerateLayoutImagesMutation=l.useGenerateLayoutImagesMutation,t.useGenerateSectionShortcodeMutation=l.useGenerateSectionShortcodeMutation,t.useGenerateSectionContentMutation=l.useGenerateSectionContentMutation,t.useGenerateSectionImagesMutation=l.useGenerateSectionImagesMutation,t.useInpaintImageMutation=l.useInpaintImageMutation,t.useSketchImageMutation=l.useSketchImageMutation,t.useOutpaintImageMutation=l.useOutpaintImageMutation,t.useEnhanceMutation=l.useEnhanceMutation,t.default=l},4255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useUpdateETAccountLocalMutation=void 0;var n=r(22105),i=window.EtAiAppData.ajaxurl,o=(0,n.createApi)({baseQuery:(0,n.fetchBaseQuery)({baseUrl:i}),endpoints:function(e){return{updateETAccountLocal:e.mutation({query:function(e){return{url:i,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=".concat(e.action,"&wp_nonce=").concat(e.nonce,"&et_api_key=").concat(e.et_api_key,"&et_username=").concat(e.et_username)}}})}}});t.useUpdateETAccountLocalMutation=o.useUpdateETAccountLocalMutation,t.default=o},74968:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDeleteImagesMutation=t.useUploadImageMutation=void 0;var n=r(22105),i=window.EtAiAppData.ajaxurl,o=window.EtAiAppData.nonces.et_ai_delete_images,a=(0,n.createApi)({reducerPath:"apiImage",baseQuery:(0,n.retry)((0,n.fetchBaseQuery)({baseUrl:i}),{retryCondition:function(e,t,r){var n,i=(null==r||null===(n=r.extraOptions)||void 0===n?void 0:n.maxRetries)||1,o=(null==r?void 0:r.attempt)||1;return 401!==e.status&&404!==e.status&&403!==e.status&&i>o}}),endpoints:function(e){return{uploadImage:e.mutation({query:function(e){return{url:i,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=".concat(e.action,"&wp_nonce=").concat(e.nonce,"&imageURL=").concat(e.url)}},extraOptions:{maxRetries:2}}),deleteImages:e.mutation({query:function(e){var t;return{url:i,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=et_ai_delete_images&wp_nonce=".concat(o,"&").concat(null==e||null===(t=e.imageIds)||void 0===t?void 0:t.map((function(e){return"image_ids[]=".concat(e)})).join("&"))}},extraOptions:{maxRetries:2}})}}});t.useUploadImageMutation=a.useUploadImageMutation,t.useDeleteImagesMutation=a.useDeleteImagesMutation,t.default=a},28809:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useSectionParsedMutation=void 0;var n=r(22105),i=window.EtAiAppData.ajaxurl,o=window.EtAiAppData.nonces.et_ai_shortcode_string_to_object,a=(0,n.createApi)({reducerPath:"localAPI",baseQuery:(0,n.retry)((0,n.fetchBaseQuery)({baseUrl:i}),{retryCondition:function(e,t,r){var n,i=(null==r||null===(n=r.extraOptions)||void 0===n?void 0:n.maxRetries)||1,o=(null==r?void 0:r.attempt)||1;return 401!==e.status&&404!==e.status&&403!==e.status&&i>o}}),endpoints:function(e){return{sectionParsed:e.mutation({query:function(e){return{url:i,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=utf-8"},body:"action=".concat(e.action,"&wp_nonce=").concat(o,"&shortcode_string=").concat(e.shortcodeString)}},extraOptions:{maxRetries:2}})}}});t.useSectionParsedMutation=a.useSectionParsedMutation,t.default=a},21062:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(85893),o=r(87363),a=n(r(69345)),s=(0,o.memo)((function(e){var t;return(0,i.jsx)(a.default,{button:(t=e.buttonText,(0,i.jsx)("div",{className:"et-fb-settings-custom-select-wrapper-outer et-fb-settings-context-select-wrapper-outer",children:(0,i.jsx)("div",{id:"et-fb-context",className:"et-fb-settings-custom-select-wrapper et-fb-settings-option-select-closed",children:(0,i.jsx)("ul",{className:"et-fb-settings-option-select et-fb-settings-option-select-advanced et-fb-main-setting",style:{maxHeight:"none"},children:(0,i.jsxs)("li",{className:"select-option-item et-fb-selected-item select-option-item-creative","data-value":"creative",children:[(0,i.jsx)("span",{className:"select-option-item__name",children:t}),(0,i.jsx)("span",{className:"et-fb-select-marker",children:(0,i.jsx)("div",{className:"et-common-icon et-common-icon--caret-solid-down",style:{fill:"var(--dark-gray)",width:"28px",minWidth:"28px",height:"28px",margin:"-6px"},children:(0,i.jsx)("svg",{viewBox:"0 0 28 28",preserveAspectRatio:"xMidYMid meet",shapeRendering:"geometricPrecision",children:(0,i.jsx)("g",{fillRule:"evenodd",children:(0,i.jsx)("path",{d:"M14.5998 16.5293L17.8726 12.8074C18.0022 12.6668 18.0363 12.4626 17.9593 12.2874C17.8824 12.1122 17.7092 11.9993 17.5181 12H10.4796C10.2901 12.0005 10.1186 12.1125 10.0416 12.2859C9.96452 12.4594 9.99629 12.662 10.1227 12.8034L13.3987 16.5293C13.5506 16.7021 13.7694 16.8012 13.9993 16.8012C14.2291 16.8012 14.4479 16.7021 14.5998 16.5293Z",fillRule:"evenodd"})})})})})]})})})})),value:e.value,options:e.options,onSelect:function(t){var r=t.value;return e.setControlValue(r)},showSearchField:e.showSearchField,useOriginalButton:!0,scrollableParentMenu:!0})}));s.defaultProps={showSearchField:!0},t.default=s},34197:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(85893),o=r(77466),a=r(14587),s=n(r(63629)),l=n(r(54555)),u=n(r(787)),c=n(r(36267)),f=n(r(45128)),p=n(r(95394)),h=n(r(40692));r(95091);t.default=function(){var e,t,r=(0,o.useAppDispatch)(),n=(0,o.useAppSelector)(a.selectError),d=(0,c.default)(r,n),m=n.show,y=n.status,g=null==n||null===(e=n.data)||void 0===e?void 0:e.error,v=null==n||null===(t=n.data)||void 0===t?void 0:t.ai_error_message,b=(0,f.default)(v,g),x=(0,p.default)(y,b),w=(0,h.default)(y);return m?(0,i.jsx)("div",{className:"et-ai-error-modal",onClick:function(e){e.stopPropagation()},children:(0,i.jsxs)(s.default,{children:[(0,i.jsx)(s.default.Header,{onClose:d,children:(0,i.jsx)("div",{className:"left",children:w})}),(0,i.jsx)(s.default.Content,{children:(0,i.jsx)("p",{"data-testid":"finalErrorMessage",dangerouslySetInnerHTML:{__html:x}})}),(0,i.jsx)(s.default.Actions,{children:(0,i.jsx)(l.default,{className:"et-common-button et-common-button--primary","data-testid":"close-icon",onClick:d,children:(0,u.default)("userPrompt","Close")})})]})}):null}},36267:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(87363),i=r(29548),o=r(98136);t.default=function(e,t){return(0,n.useCallback)((function(){var r,n,a=null==t||null===(r=t.data)||void 0===r?void 0:r.error,s=null==t||null===(n=t.data)||void 0===n?void 0:n.ai_error_message;"limit_reached"===a&&e((0,o.showUpgradeModal)(!0)),"401_user"!==a&&"Invalid credentials."!==s||e((0,i.setETAccount)({et_username:"",et_api_key:"",errorMessage:""})),a&&["404_user","unable_to_render_reference"].includes(a)&&e((0,o.hideModal)()),e((0,o.showError)({show:!1,status:"",data:{error:"",ai_error_message:""}}))}),[e,t])}},40692:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(87363),o=n(r(787));t.default=function(e){return(0,i.useMemo)((function(){return"403"==e?(0,o.default)("userPrompt","Purchase A Divi AI Membership"):(0,o.default)("userPrompt","Error")}),[e])}},95394:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(87363),o=n(r(787));t.default=function(e,t){return(0,i.useMemo)((function(){return"busy"===e?(0,o.default)("userPrompt","$serverBusy"):t}),[e,t])}},45128:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(87363),o=n(r(787));t.default=function(e,t){return(0,i.useMemo)((function(){var r=e&&""!==e?e:(0,o.default)("userPrompt","Something went wrong");return"unable_to_render_reference"===t&&(r=(0,o.default)("userPrompt","$unable_to_render_reference")),r}),[e,t])}},5528:function(e,t,r){"use strict";function n(e){return n="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},n(e)}var i=["label","hint","resetAction"];function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var f=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FieldLabel=void 0;var p=r(85893),h=r(87363),d=f(r(94184));r(92872);t.FieldLabel=function(e){var t=e.label,r=e.hint,n=e.resetAction,o=c(e,i),s=l((0,h.useState)(!1),2),u=s[0],f=s[1],m=l((0,h.useState)(!1),2),y=m[0],g=m[1],v=function(){f((function(e){return!e}))};return(0,p.jsxs)("span",{className:"et-fb-form__label",onMouseEnter:function(){return g(!0)},onMouseLeave:function(){return g(!1)},children:[(0,p.jsxs)("label",a(a({className:"et-fb-form__label-text"},o),{},{children:[t,r||n?(0,p.jsx)(p.Fragment,{children:y&&(0,p.jsxs)(p.Fragment,{children:[r&&(0,p.jsx)("span",{"data-testid":"help-icon",className:(0,d.default)({"et-fb-help-icon":!0,"et-fb-help-icon--active":u}),onClick:v,children:(0,p.jsx)("svg",{viewBox:"0 0 16 16",preserveAspectRatio:"xMidYMid meet","shape-rendering":"geometricPrecision",children:(0,p.jsxs)("g",{children:[(0,p.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M14 7.5C14 10.5376 11.5376 13 8.5 13C5.46243 13 3 10.5376 3 7.5C3 4.46243 5.46243 2 8.5 2C11.5376 2 14 4.46243 14 7.5ZM8.5 12C10.9853 12 13 9.98528 13 7.5C13 5.01472 10.9853 3 8.5 3C6.01472 3 4 5.01472 4 7.5C4 9.98528 6.01472 12 8.5 12Z"}),(0,p.jsx)("path",{d:"M9 5.5C9 5.77614 8.77614 6 8.5 6C8.22386 6 8 5.77614 8 5.5C8 5.22386 8.22386 5 8.5 5C8.77614 5 9 5.22386 9 5.5Z"}),(0,p.jsx)("path",{d:"M8 7.5C8 7.22386 8.22386 7 8.5 7C8.77614 7 9 7.22386 9 7.5V9.5C9 9.77614 8.77614 10 8.5 10C8.22386 10 8 9.77614 8 9.5V7.5Z"})]})})}),n&&(0,p.jsx)("span",{"data-testid":"reset-icon",className:(0,d.default)({"et-fb-help-icon":!0}),onClick:n,children:(0,p.jsx)("svg",{viewBox:"0 0 16 16",preserveAspectRatio:"xMidYMid meet","shape-rendering":"geometricPrecision",children:(0,p.jsx)("g",{children:(0,p.jsx)("path",{d:"M8 4.5L8 5L8 4.5ZM8 12.5L8 13L8 12.5ZM4.34189 4.52566C4.07991 4.61298 3.93833 4.89614 4.02566 5.15811C4.11298 5.42009 4.39614 5.56167 4.65811 5.47434L4.34189 4.52566ZM4.53339 8.9859C4.49546 8.71237 4.24297 8.52139 3.96944 8.55933C3.69592 8.59727 3.50494 8.84976 3.54288 9.12328L4.53339 8.9859ZM4 5L3.64645 4.64645L3.29289 5L3.64645 5.35355L4 5ZM6.85355 2.85355C7.04882 2.65829 7.04882 2.34171 6.85355 2.14645C6.65829 1.95118 6.34171 1.95118 6.14645 2.14645L6.85355 2.85355ZM6.14645 7.85355C6.34171 8.04882 6.65829 8.04882 6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L6.14645 7.85355ZM8 5C9.933 5 11.5 6.567 11.5 8.5L12.5 8.5C12.5 6.01472 10.4853 4 8 4L8 5ZM11.5 8.5C11.5 10.433 9.933 12 8 12L8 13C10.4853 13 12.5 10.9853 12.5 8.5L11.5 8.5ZM8 4C6.95955 4 6.0509 4.12992 5.40194 4.25971C5.07697 4.3247 4.81574 4.38994 4.63407 4.43949C4.54319 4.46428 4.47211 4.48517 4.42278 4.50018C4.39811 4.50769 4.37887 4.51373 4.36531 4.51806C4.35853 4.52022 4.35317 4.52196 4.34926 4.52323C4.3473 4.52387 4.3457 4.5244 4.34447 4.5248C4.34386 4.525 4.34334 4.52518 4.3429 4.52532C4.34269 4.52539 4.3425 4.52546 4.34233 4.52551C4.34224 4.52554 4.34213 4.52558 4.34209 4.52559C4.34198 4.52563 4.34189 4.52566 4.5 5C4.65811 5.47434 4.65803 5.47437 4.65795 5.4744C4.65793 5.4744 4.65785 5.47443 4.65781 5.47444C4.65773 5.47447 4.65768 5.47449 4.65764 5.4745C4.65758 5.47452 4.6576 5.47451 4.65772 5.47447C4.65794 5.4744 4.65853 5.47421 4.65947 5.4739C4.66136 5.47328 4.66466 5.47221 4.66935 5.47071C4.67874 5.46772 4.69369 5.46302 4.71394 5.45685C4.75446 5.44452 4.81618 5.42635 4.89718 5.40426C5.05926 5.36006 5.29803 5.3003 5.59806 5.24029C6.1991 5.12008 7.04045 5 8 5L8 4ZM8 12C6.23208 12 4.76958 10.6887 4.53339 8.9859L3.54288 9.12328C3.84669 11.3137 5.726 13 8 13L8 12ZM4.35355 5.35355L6.85355 2.85355L6.14645 2.14645L3.64645 4.64645L4.35355 5.35355ZM6.85355 7.14645L4.35355 4.64645L3.64645 5.35355L6.14645 7.85355L6.85355 7.14645Z"})})})})]})}):null]})),r&&u&&(0,p.jsx)("p",{className:"et-fb-form-hint",children:r})]})}},54842:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(85893),o=n(r(787)),a=r(77466),s=r(98136);r(68039);t.default=function(){var e=(0,a.useAppDispatch)();return(0,i.jsxs)("div",{className:"free-upgrade-bar","data-tip":!0,"data-for":"ai-subscription-message",onMouseEnter:function(){return e((0,s.showUpgradeTip)(!0))},onMouseLeave:function(){return e((0,s.showUpgradeTip)(!1))},"data-testid":"free-upgrade-bar",children:[(0,i.jsx)("p",{children:(0,o.default)("userPrompt","Free Trial")}),(0,i.jsx)("button",{type:"button",onClick:function(){e((0,s.showUpgradeTip)(!1)),e((0,s.showUpgradeModal)(!0))},children:(0,o.default)("userPrompt","Upgrade")})]})}},63309:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorRoot=void 0;var i=r(85893),o=r(98136),a=r(91021),s=r(77466),l=n(r(63629)),u=n(r(787)),c=r(90922),f=r(14587),p=r(13603);r(31733);t.ImageEditorRoot=function(){var e=(0,s.useAppDispatch)(),t=(0,s.useAppSelector)(f.selectIsLocalImageEditorActive),r=(0,s.useAppSelector)(f.selectImagesHistoryUrls),n=(0,s.useAppSelector)(p.imageEditorURL),h=function(){e((0,o.setImageEditor)(!1)),e((0,a.setEditorImageURL)("")),t&&r.length<2&&(e((0,a.clearImageEditorHistory)(n)),e((0,o.hideModal)()))};return(0,i.jsx)("div",{className:"et-ai-user-prompt et-ai-modal-no-footer et-ai-image-editor-modal",children:(0,i.jsxs)(l.default,{modalKey:"et_ai_image_editor",children:[(0,i.jsx)(l.default.Header,{onBack:h,onClose:h,children:(0,i.jsx)("div",{className:"left",children:(0,u.default)("aiImageEditor","Edit Image")})}),(0,i.jsx)(l.default.Content,{children:(0,i.jsx)("div",{className:"ai-content-wrapper",children:(0,i.jsx)(c.ImageEditorContainer,{})})})]})})}},62743:function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=R?(A.current.minWidth=240,void(A.current.minHeight=240*R/I)):(A.current.minWidth=240*I/R,void(A.current.minHeight=240))},G=function(){var e=V(),t=g.clientWidth,r=g.clientHeight,n=e.minWidth/P.current,i=e.minHeight/P.current,o=t-n,a=r-i;if(o||a){var s=g.offsetTop+a/2,l=g.offsetLeft+o/2;g.style.width="".concat(n,"px"),g.style.height="".concat(i,"px"),g.style.top="".concat(s,"px"),g.style.left="".concat(l,"px"),(0,h.addEditorState)({imageURL:k,editorState:{extendCanvasData:{imageStyle:{left:l,top:s,width:n,height:i}}}})}},H=function(){var e=t.originalWidth,r=t.originalHeight,n=V(),i=b.clientWidth-14,o=b.clientHeight-14,a=Math.min(i,o),s=e/(I/n.minWidth),l=r/(R/n.minHeight);if(P.current=1,s>i||l>o){var u=Math.max(s,l),c=Math.max(1,u/a);s/=c,l/=c,P.current=c}return[s,l]},W=function(){var e=V(),t=e.minWidth,r=e.minHeight;return{top:b.clientHeight/2-r/2,left:b.clientWidth/2-t/2,width:t,height:r}},U=function(e){e.preventDefault(),j.current.dragging=!0,j.current.prevX=e.clientX,j.current.prevY=e.clientY,j.current.el=e.target,b.addEventListener("mousemove",K),b.addEventListener("mouseup",q)},q=function e(){j.current.dragging=!1,N(),b.removeEventListener("mousemove",K),b.removeEventListener("mouseup",e)},Y=function e(t){t.preventDefault(),N(),b.removeEventListener("mousemove",Z),b.removeEventListener("mouseup",e)},$=function(e){var t=e.width,r=e.height,n=e.top,i=e.left,o=V(),a=o.minWidth,s=o.minHeight;Math.round(t)0?"".concat(i,"px"):"0",v.style.top=n&&n>0?"".concat(n,"px"):"0",Q()})),F({width:t,height:r,top:n,left:i}))},K=function(e){var t,i,o,a,s,l,u,c,f=j.current;if(f.dragging&&e.buttons){var p=b.getBoundingClientRect(),h=v.getBoundingClientRect(),d=g.getBoundingClientRect(),m=h.top-p.top,x=h.left-p.left,w=h.width,k=h.height,_=m,S=x,E="";if(null!==(t=f.el)&&void 0!==t&&t.classList.contains("bottom-right")?(w=h.width+e.clientX-f.prevX,k=h.height+e.clientY-f.prevY,E="bottom-right"):null!==(i=f.el)&&void 0!==i&&i.classList.contains("bottom-left")?(w=h.width-e.clientX+f.prevX,k=h.height+e.clientY-f.prevY,S=x+e.clientX-f.prevX,E="bottom-left"):null!==(o=f.el)&&void 0!==o&&o.classList.contains("top-right")?(w=h.width+e.clientX-f.prevX,k=h.height-e.clientY+f.prevY,_=m+e.clientY-f.prevY,E="top-right"):null!==(a=f.el)&&void 0!==a&&a.classList.contains("top-left")?(w=h.width-e.clientX+f.prevX,k=h.height-e.clientY+f.prevY,_=m+e.clientY-f.prevY,S=x+e.clientX-f.prevX,E="top-left"):null!==(s=f.el)&&void 0!==s&&s.classList.contains("right")?(w=h.width+e.clientX-f.prevX,E="right"):null!==(l=f.el)&&void 0!==l&&l.classList.contains("left")?(w=h.width-e.clientX+f.prevX,S=x+e.clientX-f.prevX,E="left"):null!==(u=f.el)&&void 0!==u&&u.classList.contains("bottom")?(k=h.height+e.clientY-f.prevY,E="bottom"):null!==(c=f.el)&&void 0!==c&&c.classList.contains("top")&&(k=h.height-e.clientY+f.prevY,_=m+e.clientY-f.prevY,E="top"),r&&"string"==typeof r){var C=function(e,t,n){var i=r.split(":"),o=parseInt(i[0]),a=parseInt(i[1]);switch(n){case"bottom-right":case"bottom-left":case"top-right":case"top-left":ei.right||o>i.bottom||r>y.MAX_CANVAS_SIZE||n>y.MAX_CANVAS_SIZE)}(S,_,w,k,p)){var O=w*(I/d.width),A=k*(R/d.height);O>y.MAX_CANVAS_SIZE||A>y.MAX_CANVAS_SIZE||(j.current.prevX=e.clientX,j.current.prevY=e.clientY,$({width:w,height:k,top:_,left:S}),B(O,A))}}},Z=function(e){e.preventDefault(),e.stopPropagation();var t={x:0,y:0};if(t.x=(e.clientX||e.pageX)+window.scrollX,t.y=(e.clientY||e.pageY)+window.scrollY,g){var r=g.getBoundingClientRect(),n=v.getBoundingClientRect(),i={left:t.x-(j.current.prevX-j.current.imageLeft),top:t.y-(j.current.prevY-j.current.imageTop)},o=i.left,a=i.top,s=i.left+r.width,l=i.top+r.height,u={left:n.left,top:n.top,right:n.left+n.width,bottom:n.top+n.height};ou.right&&(i.left=u.right-r.width),l>u.bottom&&(i.top=u.bottom-r.height),setTimeout((function(){J(g,i)}))}},Q=function(){var e=g.getBoundingClientRect(),t=v.getBoundingClientRect(),r=t.left>e.left,n=t.top>e.top,i=t.right2&&void 0!==arguments[2])||arguments[2],n=b.clientHeight/2-t/2,i=b.clientWidth/2-e/2;$({width:e,height:t,top:n,left:i}),r&&z(e,t)},te=function(t,n){P.current=1,z(),G();var i,o,a=V();if(!t&&!n)return i=a.minWidth,o=a.minHeight,ee(i,o),void e((0,h.addEditorState)({imageURL:k,editorState:{extendCanvasData:{originalWidth:I,originalHeight:R}}}));var s=I,l=R;["1:1","2:3","3:4","9:16"].includes(r)&&(s=I,l=n/t*I),["3:2","4:3","16:9"].includes(r)&&(s=t/n*R,l=R);sy.MAX_CANVAS_SIZE||c>y.MAX_CANVAS_SIZE)){e((0,h.addEditorState)({imageURL:k,editorState:{extendCanvasData:{originalWidth:u,originalHeight:c}}}));var f=s/(I/a.minWidth),p=l/(R/a.minHeight);ee(f,p)}},re=function(e,t,r){try{var n=document.createElement("canvas"),i=n.getContext("2d");n.width=t,n.height=r,i.drawImage(e,0,0,t,r);var o=n.toDataURL("image/png");return n=null,i=null,o}catch(e){}return""},ne=function(){var t=document.createElement("canvas"),r=t.getContext("2d"),n=function(){var e=g.getBoundingClientRect(),t=v.getBoundingClientRect(),r=I/e.width,n=R/e.height;return{imageRect:e,canvasRect:t,widthRatio:r,heightRatio:n,initialCanvasWidth:r*t.width,initialCanvasHeight:n*t.height}}(),i=n.imageRect,o=n.canvasRect,a=n.widthRatio,s=n.heightRatio,l=n.initialCanvasWidth,u=n.initialCanvasHeight;t.width=l,t.height=u;var c,f,p,y=function(e){var t=Math.max(e.width,e.height);return Math.max(1,Math.round(t/1024))}(t);if(11024&&(x/=b=Math.round(x/1024));var w=(c=(0,m.getMultipleUpscaleRates)(x,Math.max(t.width,t.height),b)).reduce((function(e,t){return e*t}),1);f=(0,d.getDivisibleByEight)(t.width/w),p=(0,d.getDivisibleByEight)(t.height/w)}else c=[y],f=(0,d.getDivisibleByEight)(t.width/y),p=(0,d.getDivisibleByEight)(t.height/y);e((0,h.addEditorState)({imageURL:k,editorState:{extendCanvasData:{finalScales:c,finalWidth:f,finalHeight:p}}}));var _=a*(i.left-o.left),S=s*(i.top-o.top);if(!r||!g)return{imageBase64:"",mask:""};!function(e,t,r){if(O.current){var n=e.createPattern(O.current,"repeat");e.fillStyle=n,e.fillRect(0,0,e.canvas.width,e.canvas.height),g.crossOrigin="anonymous",e.drawImage(g,t,r,I,R)}}(r,_,S);var E=re(t,f,p);!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;e.fillStyle="#fff",e.fillRect(0,0,t.width,t.height);var i=I,o=R,a=.9,s=r+I,l=n+R,u={left:r,top:n};r&&(i*=a,u.left=s-i),n&&(o*=a,u.top=l-o),s{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="data:image/png;base64,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"},71648:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}}function s(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(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 l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorContainer=void 0;var n=r(85893),i=r(4316),o=r(72740);r(64474);t.ImageEditorContainer=function(){return(0,n.jsxs)("div",{className:"et-ai-image-editor-container",children:[(0,n.jsx)(o.ImageEditorSidebar,{}),(0,n.jsx)(i.ImageEditorMain,{})]})}},4316:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorMain=void 0;var a=r(85893),s=r(13603),l=r(91021),u=r(77466),c=r(92854),f=o(r(62743)),p=r(82508);t.ImageEditorMain=function(){var e,t=(0,u.useAppSelector)(s.editorMode),r=(i(e={},l.EditorModes.Modify,c.ImageEditorCanvas),i(e,l.EditorModes.Extend,f.default),i(e,l.EditorModes.Upscale,p.ImageEditorUpscale),i(e,l.EditorModes.Enhance,p.ImageEditorUpscale),e)[t];return(0,a.jsx)("div",{className:"et-ai-image-editor-main",children:r&&(0,a.jsx)(r,{})})}},72740:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorSidebar=void 0;var i=r(85893),o=r(87363),a=n(r(94184)),s=n(r(787)),l=r(13603),u=r(91021),c=r(77466),f=n(r(36789)),p=n(r(264)),h=n(r(27120)),d=n(r(57684)),m=n(r(14123));r(5501);var y=r(52814);t.ImageEditorSidebar=function(){var e=(0,c.useAppDispatch)(),t=(0,c.useAppSelector)(l.editorMode),r=(0,o.useMemo)((function(){return[u.EditorModes.Modify,u.EditorModes.Extend,u.EditorModes.Upscale,u.EditorModes.Enhance].map((function(r,n){var o=r===t;return(0,i.jsxs)("li",{className:(0,a.default)({"et-ai-editor-mode-toggle-item":!0,"et-ai-editor-mode-toggle-item-active":r===t}),"data-testid":"editor-mode-toggle-".concat(r),onClick:function(){return e((0,u.setEditorMode)(r))},children:[(0,i.jsx)(f.default,{size:14,color:o?y.COLORS.dustyBlue:y.COLORS.mediumGray,viewBox:"0 0 28 28",icon:r.toLowerCase()}),(0,s.default)("aiImageEditor",r)]},n)}))}),[t]);return(0,i.jsxs)("div",{className:"et-ai-image-editor-sidebar",children:[(0,i.jsx)("ul",{className:"et-ai-image-editor-mode-toggle",children:r}),u.EditorModes.Modify===t&&(0,i.jsx)(p.default,{}),u.EditorModes.Extend===t&&(0,i.jsx)(h.default,{}),u.EditorModes.Upscale===t&&(0,i.jsx)(d.default,{}),u.EditorModes.Enhance===t&&(0,i.jsx)(m.default,{})]})}},14123:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]&&arguments[1],s=e.target,l=s.name,u=s.value;if(i){var c=parseInt(u)||0;"originalWidth"===l&&(u=(0,k.getDivisibleByEight)(Math.min(Math.max(c,L),_.MAX_CANVAS_SIZE))),"originalHeight"===l&&(u=(0,k.getDivisibleByEight)(Math.min(Math.max(c,j),_.MAX_CANVAS_SIZE)))}r((0,x.addEditorState)({imageURL:A,editorState:{activeExtendRatio:"",extendCanvasData:o(o({},n),{},(t={},a(t,l,u),a(t,"actionOrigin","sidebar"),t))}}))},I=(0,f.useMemo)((function(){return n.originalWidth!==L||n.originalHeight!==j}),[n,L,j]),R=(0,f.useMemo)((function(){return I?"":(0,h.default)("aiImageEditor","$imageExtendRequired")}),[I]);return(0,c.jsxs)("div",{className:"et-fb-form__toggle",children:[(0,c.jsxs)("div",{className:"et-fb-form__group",children:[(0,c.jsx)(w.FieldLabel,{label:(0,h.default)("aiImageEditor","Background Fill Description"),hint:(0,h.default)("aiImageEditor","$backgroundFillDescriptionHelp")}),(0,c.jsx)("textarea",{className:"et-ai-control-textarea et-fb-disabled-global-shortcuts",rows:5,ref:i})]}),(0,c.jsxs)("div",{className:"et-fb-form__group",children:[(0,c.jsx)(w.FieldLabel,{label:(0,h.default)("aiImageEditor","Canvas Size"),hint:(0,h.default)("aiImageEditor","$canvasSzieHelp")}),(0,c.jsxs)("div",{className:"et-ai-image-editor-sidebar-extend-canvas",children:[(0,c.jsxs)("span",{children:[(0,c.jsx)(v.default,{className:"et-fb-disabled-global-shortcuts",onChange:function(e){return D(e)},onBlur:function(e){return D(e,!0)},name:"originalWidth","data-testid":"width",value:null!==(e=n.originalWidth)&&void 0!==e?e:""}),(0,c.jsx)("label",{htmlFor:"originalWidth",children:(0,h.default)("aiImageEditor","Width")})]}),(0,c.jsx)("span",{className:"et-ai-image-editor-sidebar-extend-canvas--times",children:"\xd7"}),(0,c.jsxs)("span",{children:[(0,c.jsx)(v.default,{className:"et-fb-disabled-global-shortcuts",onChange:function(e){return D(e)},onBlur:function(e){return D(e,!0)},name:"originalHeight","data-testid":"height",value:null!==(t=n.originalHeight)&&void 0!==t?t:""}),(0,c.jsx)("label",{htmlFor:"originalHeight",children:(0,h.default)("aiImageEditor","Height")})]})]})]}),(0,c.jsxs)("div",{className:"et-ai-edit-image-submit",onMouseEnter:function(){return E(!0)},onMouseLeave:function(){return E(!1)},children:[S&&""!==R&&(0,c.jsx)(d.default,{id:"ai-image-extend-submit-tooltip",children:R}),(0,c.jsx)(g.default,{type:"submit",className:(0,p.default)({"et-common-button":!0,"et-common-button--primary":!0,"et-common-button--disabled":!I}),onClick:function(){var e,t,r={prompt:null!==(e=null==i||null===(t=i.current)||void 0===t?void 0:t.value)&&void 0!==e?e:""};l(r)},disabled:!I,"data-for":"ai-image-extend-submit-tooltip",children:(0,h.default)("aiImageEditor","Extend Image")})]})]})}},264:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0}catch(e){return!1}}),[C,P]),L=(0,f.useMemo)((function(){return T?"":g.EditorTabs.ImageSketch===t?(0,h.default)("aiImageEditor","$imageSketchRequired"):g.EditorTabs.ImageSelection===t?(0,h.default)("aiImageEditor","$imageSelectionRequired"):""}),[T,t]);return(0,c.jsxs)("div",{className:"et-fb-form__toggle et-ai-image-modify-sidebar",children:[(0,c.jsxs)("div",{className:"et-fb-form__group",children:[(0,c.jsx)(w.FieldLabel,{label:(0,h.default)("aiImageEditor","Image Fill Description"),hint:(0,h.default)("aiImageEditor","$imageFillDescriptionHelp")}),(0,c.jsx)("textarea",{className:"et-ai-control-textarea et-fb-disabled-global-shortcuts",rows:5,ref:e})]}),g.EditorTabs.ImageSketch===t?null:(0,c.jsxs)("div",{className:"et-fb-form__group",children:[(0,c.jsx)(w.FieldLabel,{label:(0,h.default)("aiImageEditor","Modification Type"),hint:(0,h.default)("aiImageEditor","$modificationTypeHelp")}),(0,c.jsx)(k.default,{_onChange:function(e,t){return E(t)},value:S,options:{add:(0,h.default)("aiImageEditor","Add Element"),edit:(0,h.default)("aiImageEditor","Modify Element")}})]}),(0,c.jsxs)("div",{className:"et-fb-form__group",children:[(0,c.jsx)(w.FieldLabel,{label:(0,h.default)("aiImageEditor","Modification Strength"),hint:(0,h.default)("aiImageEditor","$modificationStrengthHelp")}),(0,c.jsx)(b.default,{default_unit:"%",name:"reference_content_strength",_onChange:function(e,t){return u(parseInt(t))},default:90,value:l})]}),(0,c.jsxs)("div",{className:"et-ai-edit-image-submit",onMouseEnter:function(){return M(!0)},onMouseLeave:function(){return M(!1)},children:[A&&""!==L&&(0,c.jsx)(d.default,{id:"ai-image-modify-submit-tooltip",children:L}),(0,c.jsx)(v.default,{type:"submit",className:(0,p.default)({"et-common-button":!0,"et-common-button--primary":!0,"et-common-button--disabled":!T}),onClick:function(){var r,a,s={prompt:null!==(r=null==e||null===(a=e.current)||void 0===a?void 0:a.value)&&void 0!==r?r:"",modification_strength:Math.ceil(l/100*100)/100};g.EditorTabs.ImageSketch===t?i(s):n(o(o({},s),{},{modification_type:S}))},disabled:!T,"data-for":"ai-image-modify-submit-tooltip",children:(0,h.default)("aiImageEditor","Generate Modified Image")})]})]})}},57684:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r_.MAX_CANVAS_SIZE||D>_.MAX_CANVAS_SIZE)&&n(1)}),[r]);var I=1===r,R=(0,k.checkMultiples)(Math.max(T,L));return(0,l.jsxs)("div",{className:"et-fb-form__toggle",children:[(0,l.jsxs)("div",{className:"et-fb-form__group",children:[(0,l.jsx)(m.FieldLabel,{label:(0,p.default)("aiImageEditor","Image Scale"),hint:(0,p.default)("aiImageEditor","$imageScaleHelp")}),(0,f.isEmpty)(R)?(0,l.jsx)(g.default,{className:"disabled-placeholder-input",disabled:!0}):(0,l.jsx)(y.default,{_onChange:function(e,t){return n(parseInt(t))},value:r.toString(),options:R})]}),(0,l.jsxs)("div",{className:"et-fb-form__group",children:[(0,l.jsx)(m.FieldLabel,{label:(0,p.default)("aiImageEditor","Image Dimensions"),hint:(0,p.default)("aiImageEditor","$imageDimensionsHelp")}),(0,l.jsxs)("div",{className:"et-fb-form__image-dimensions",children:[(0,l.jsxs)("div",{className:"et-fb-form__image-dimensions-field",children:[(0,l.jsx)(g.default,{name:"width",value:j,disabled:!0}),(0,l.jsx)(m.FieldLabel,{label:(0,p.default)("aiImageEditor","Width")})]}),(0,l.jsx)(v.default,{size:15,color:_.COLORS.dustyBlue,viewBox:"0 0 30 30",icon:"close",margin:"0"}),(0,l.jsxs)("div",{className:"et-fb-form__image-dimensions-field",children:[(0,l.jsx)(g.default,{name:"height",value:D,disabled:!0}),(0,l.jsx)(m.FieldLabel,{label:(0,p.default)("aiImageEditor","Height")})]})]})]}),(0,l.jsxs)("div",{className:"et-ai-upscale-image-submit",onMouseEnter:function(){return A(!0)},onMouseLeave:function(){return A(!1)},children:[O&&I&&(0,l.jsx)(h.default,{id:"ai-image-upscale-submit-tooltip",children:(0,p.default)("aiImageEditor","$imageUpscaleRequired")}),(0,l.jsx)(d.default,{type:"submit",className:(0,c.default)({"et-common-button":!0,"et-common-button--primary":!0,"et-common-button--disabled":I}),onClick:function(){var t=(0,k.increaseUrlVersion)(E),r={width:s,height:S,scale:j/s};e((0,w.updateImagesHistory)(i({},t,r))),e((0,w.setImageEditor)(!1)),setTimeout((function(){var e,t=null===(e=window.top)||void 0===e?void 0:e.document.querySelector("ul.et-ai-images-grid li.et-ai-single-image:last-child");t&&t.scrollIntoView({behavior:"smooth"})}))},disabled:I,"data-for":"ai-image-upscale-submit-tooltip",children:(0,p.default)("aiImageEditor","Upscale Image")})]})]})}},92854:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorCanvas=void 0;var i=r(85893),o=r(87363),a=n(r(787)),s=r(13603),l=r(91021),u=r(77466),c=r(52748);r(31198);var f=n(r(94184));t.ImageEditorCanvas=function(){var e=(0,u.useAppDispatch)(),t=(0,u.useAppSelector)(s.imageEditorTab),r=(0,o.useMemo)((function(){var r=[l.EditorTabs.ImageSelection,l.EditorTabs.ImageSketch].map((function(r,n){return(0,i.jsx)("li",{className:(0,f.default)({"et-ai-canvas-tab-toggle":!0,"et-ai-canvas-tab-toggle-active":r===t}),onClick:function(){return e((0,l.setEditorTab)(r))},children:(0,a.default)("aiImageEditor",r)},n)}));return(0,i.jsx)("ul",{className:"et-ai-canvas-tab-nav",children:r})}),[t]),n=l.EditorTabs.ImageSketch===t?(0,a.default)("aiImageEditor","$sketchAreaDesc"):(0,a.default)("aiImageEditor","$selectAreaDesc");return(0,i.jsxs)("div",{className:(0,f.default)({"et-ai-canvas-wrapper":!0,"et-ai-canvas-wrapper__image_selection":l.EditorTabs.ImageSelection===t,"et-ai-canvas-wrapper__image_sketch":l.EditorTabs.ImageSketch===t}),children:[r,(0,i.jsx)("p",{className:"et-ai-canvas-description",children:n}),(0,i.jsx)(c.ImageEditorCanvasDrawWrapper,{},t)]})}},13521:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorControlsBar=void 0;var n=r(85893),i=r(90527);r(44158);t.ImageEditorControlsBar=function(e){var t=e.controls.map((function(e,t){return(0,n.jsx)(i.ImageEditorSingleControl,{control:e},t)}));return(0,n.jsx)("ul",{className:"et-ai-canvas-controls",children:t})}},90527:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorSingleControl=void 0;var a=r(85893),s=o(r(94184)),l=o(r(787)),u=o(r(71472)),c=o(r(36789)),f=o(r(33270));r(44158);t.ImageEditorSingleControl=function(e){var t,r=e.control;switch(r.type){case"Range":return(0,a.jsxs)("li",{className:"et-ai-canvas-controls-item et-ai-canvas-controls-item__paint_control et-ai-canvas-controls-item__left_aligned",children:[(0,a.jsxs)("span",{className:"et-ai-canvas-control-label",children:[(0,l.default)("aiImageEditor",r.label)," :"]}),(0,a.jsx)(u.default,{default_unit:"",name:r.name,_onChange:function(e,t){return r.callback(r.name,parseInt(t))},value:r.value,range_settings:{min:null!==(t=r.minValue)&&void 0!==t?t:0,max:100,step:1}})]});case"TextInput":return(0,a.jsxs)("li",{className:"et-ai-canvas-controls-item",children:[(0,a.jsx)("span",{className:"et-ai-canvas-control-label",children:(0,l.default)("aiImageEditor",r.label)}),(0,a.jsx)("input",{onChange:function(e){return r.callback(r.name,e.target.value)},value:r.value})]});case"Icon":return(0,a.jsx)("li",{className:(0,s.default)(i({"et-ai-canvas-controls-item":!0,"et-ai-canvas-controls-item__icon":!0,"et-ai-canvas-controls-item__right_aligned":!0},r.classNames,!0)),onClick:r.callback,children:(0,a.jsx)(c.default,{icon:r.iconCode})});case"TextButton":return(0,a.jsx)("li",{className:(0,s.default)(i({"et-ai-canvas-controls-item":!0,"et-ai-canvas-controls-item-text-button":!0,"et-ai-canvas-controls-item__left_aligned":!0},r.classNames,!0)),onClick:r.callback,children:(0,l.default)("aiImageEditor",r.label)});case"ColorPicker":return(0,a.jsxs)("li",{className:"et-ai-canvas-controls-item et-ai-canvas-controls-item__paint_control et-ai-canvas-controls-item__color_picker \n et-ai-canvas-controls-item__left_aligned",children:[(0,a.jsxs)("span",{className:"et-ai-canvas-control-label",children:[(0,l.default)("aiImageEditor",r.label)," :"]}),(0,a.jsx)(f.default,{value:r.value,_onChange:function(e,t){r.callback(r.name,t)},name:r.name,animate:!0,hideHarmoniusColors:!0,hideCurrentColorWrapper:!0})]})}}},52748:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function s(){s=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,a,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,a)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(i,a,s,l){var u=p(e[i],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return o("throw",e,s,l)}))}l(u.arg)}var a;i(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function l(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){l(o,n,i,a,s,"next",e)}function s(e){l(o,n,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(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 p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||h(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 h(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r20?_.brushRadius:20),g.push(_)}catch(e){v.e(e)}finally{v.f()}d.lines=g}S=JSON.stringify(d),W(S).then((function(){var e,t=null==m||null===(e=m.current)||void 0===e?void 0:e.getDataURL("png",!1,E.COLORS.black);G("mask",t)}));case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=function(e,t){return e!==t?t:e},Y=(0,g.useMemo)((function(){return(0,y.jsx)(C.ImageEditorControlsBar,{controls:H})}),[r,n,i,h,O,F,D]),$=h===k.EditorTabs.ImageSelection?"rgb(255, 0, 0)":i,K=h===k.EditorTabs.ImageSelection?n:0;return(0,y.jsxs)("div",{className:"et-ai-canvas-frame",onMouseLeave:U,children:[Y,(0,y.jsx)("div",{className:"et-ai-image-editor-frame-wrapper",ref:P,children:(0,y.jsxs)("div",{className:"et-ai-image-editor-frame",style:{transform:"scale(".concat(L,")")},children:[(0,y.jsx)("div",{className:(0,x.default)({"et-ai-image-background-placeholder":!0,"et-ai-image-background-placeholder__image_selection":k.EditorTabs.ImageSelection===h}),style:{background:"url(".concat(t,")"),backgroundSize:"contain",backgroundRepeat:"no-repeat"},children:(0,y.jsx)(v.default,{canvasWidth:T,canvasHeight:M,style:{position:"relative"},backgroundColor:"rgba(0, 0, 0, 0)",brushRadius:r,hideGrid:!0,brushBlur:K,immediateLoading:!0,brushColor:$,lazyRadius:0,ref:d,disabled:O,onChange:function(e){I((function(t){var r,n;return q(t,null!==(r=(null==e||null===(n=e.lines)||void 0===n?void 0:n.length)>0)&&void 0!==r&&r)})),N((function(t){var r,n;return q(t,null!==(r=(null==e||null===(n=e.undoneLines)||void 0===n?void 0:n.length)>0)&&void 0!==r&&r)}))}},h)}),(0,y.jsx)("div",{style:{position:"absolute",zIndex:"-99999"},children:(0,y.jsx)(v.default,{canvasWidth:T,canvasHeight:M,style:{position:"relative"},backgroundColor:"rgba(0, 0, 0, 0)",brushRadius:r,hideGrid:!0,brushBlur:K,immediateLoading:!0,brushColor:$,lazyRadius:0,ref:m},"".concat(h,"-hidden"))})]})})]})}},77946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useImagePropsCalculator=void 0;var n=r(77466),i=r(13603);t.useImagePropsCalculator=function(e){var t=(0,n.useAppSelector)(i.selectImage),r=t.width,o=t.height;return{imageWidth:r,imageHeight:o,scaleRate:r>512||o>512?512/Math.max(r,o):1}}},82508:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ImageEditorUpscale=void 0;var n=r(85893),i=r(13603),o=r(77466);t.ImageEditorUpscale=function(){var e=(0,o.useAppSelector)(i.imageEditorURL);return(0,n.jsx)("div",{className:"et-ai-canvas-frame",children:(0,n.jsx)("div",{className:"et-ai-image-editor-frame",children:(0,n.jsx)("div",{className:"et-ai-image-background-placeholder",style:{background:"url(".concat(e,")"),backgroundPosition:"center",backgroundSize:"contain",backgroundRepeat:"no-repeat",width:"512px",height:"512px"}})})})}},47617:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(w.current=setInterval((function(){return d((function(e){return t&&e===t&&clearInterval(w.current),e+1}))}),7e3))}),[t]),(0,u.useEffect)((function(){r&&r>0&&(k.current=setInterval((function(){return x((function(e){return r&&e===r&&clearInterval(k.current),e+1}))}),1e4))}),[r]);return(0,l.jsx)("div",{className:"et_layout_generation__overlay",children:(0,l.jsx)("div",{className:"et_layout_generation__container",children:function(){if(!e)return null;var o=!t&&"images"===e,a=o?"content":e,u=b[a],d=e,m=u.animation,g=u.text,v=u.progress,x=Object.keys(b),w=x.indexOf(d),k=x[w-1],_=w>0?b[k].progress:20,S="et_layout_generation_card__stage_".concat(a),E=("Stage ".concat(w+1),"shortcode"===e&&"layout"===n?(0,p.default)("userPrompt","Generating Layout"):g),C=o?80:v,P=(0,c.default)(i({et_layout_generation__card:!0},S,!0));if("images"===a){C+=(t&&t>0?Math.floor(15/t):0)*s,E=t&&t>0&&s<=t?"".concat(g," (").concat(s,"/").concat(t,")"):r&&r>0&&y<=r?"".concat((0,p.default)("userPrompt","Upscaling Images")," (").concat(y,"/").concat(r,")"):(0,p.default)("userPrompt","Processing Imagery")}return(0,l.jsxs)("div",{className:P,children:[(0,l.jsx)(f.default,{animationData:m,loop:!0}),(0,l.jsx)("div",{className:"et_layout_generation_card__stage_text",children:(0,l.jsx)("h3",{children:E})}),(0,l.jsx)("div",{className:"et_layout_generation_card__stage_progress",children:(0,l.jsx)(h.default,{targetProgress:C,previousProgress:_})})]},w)}()})})}},43626:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t&&clearInterval(e),n}))}),20);return function(){return clearInterval(e)}}),[t]),(0,o.jsx)("div",{className:"et-common-progress-bar",children:(0,o.jsx)("div",{className:"et-common-progress-bar__background",children:(0,o.jsx)("div",{className:"et-common-progress-bar__bar",style:{width:"".concat(l,"%")},children:(0,o.jsx)("div",{className:"et-common-progress-bar__value",children:"".concat(l,"%")})})})})}},54134:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(85893),o=n(r(787)),a=r(77466),s=r(98136);r(60937);t.default=function(e){var t=e.error,r=(0,a.useAppDispatch)(),n="";switch(t){case"You have used all your free requests. Please upgrade your subscription.":n=(0,o.default)("userPrompt","Purchase Membership");break;case"You have reached your monthly usage limit. Please upgrade your subscription.":n=(0,o.default)("userPrompt","Upgrade Membership");break;default:n=(0,o.default)("userPrompt","Level up your efficiency")}return(0,i.jsxs)("div",{className:"et-ai-upgrade-modal",children:[(0,i.jsx)("img",{width:"440",height:"192",src:"https://www.elegantthemes.com/images/vb/ai/upgrade.png",alt:(0,o.default)("userPrompt","AI Unlimited")}),(0,i.jsx)("h2",{children:(0,o.default)("userPrompt","Upgrade to Divi AI Unlimited")}),(0,i.jsx)("p",{children:n}),(0,i.jsx)("button",{className:"et-common-button et-common-button--primary",onClick:function(){r((0,s.hideModal)()),window.open("https://www.elegantthemes.com/ai/?utm_source=Divi+AI&utm_medium=Free+Trial&utm_campaign=Native","_blank")},children:(0,o.default)("userPrompt","Learn More")})]})}},85463:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(85893),o=r(40930),a=n(r(94184)),s=n(r(54555)),l=n(r(787)),u=r(77466),c=n(r(59353)),f=n(r(2428)),p=n(r(84565)),h=n(r(13288)),d=n(r(20759)),m=r(14587);r(64591);t.default=function(e){var t=(0,o.useFormContext)().getValues,r=(0,u.useAppSelector)(m.selectPrefilledContentType),n="html"===t("content_type")?"html":"css",y=(0,d.default)(e),g=y.isLoading,v=y.setIsLoading,b=y.generatedCode,x=y.onChange,w=y.setRefinedCode,k=y.onCodeEditorChange,_=y.handleUseCodeClick;if(g)return(0,i.jsx)("div",{className:"et-ai-modal-spinner-container",children:(0,i.jsx)(f.default,{})});var S={"et-ai-content-results-prompt":!0,"et-ai-modal-disabled":g};return(0,i.jsxs)("div",{className:(0,a.default)(S),children:[(0,i.jsx)("div",{className:"et-fb-form__toggle et-fb-form__description-toggle",children:(0,i.jsxs)("div",{className:"et-ai-content-results-prompt__description",children:[(0,i.jsx)(c.default,{viewportMargin:1/0,inline:"css"!==r&&"free-form-css"!==r,cursorBlinkRate:550,value:b,lint:!0,mode:n,name:"code-results",_onChange:k}),(0,i.jsx)(h.default,{onChange:x}),(0,i.jsx)(s.default,{className:"et-common-button--primary",onClick:_,children:(0,l.default)("userPrompt","Use This Code")})]})}),(0,i.jsx)(p.default,{setCode:w,setIsLoading:v})]})}},84565:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(t,"__esModule",{value:!0});var a=r(77466),s=r(14587);t.default=function(){var e=(0,a.useAppSelector)(s.selectAiMode),t=(0,a.useAppSelector)(s.selectEditorValue),r=(0,a.useAppSelector)(s.selectEditorName),n=(0,a.useAppSelector)(s.selectEditorInsertMode),l=(0,a.useAppSelector)(s.selectEditorCursor);return[function(a){if("code"===e){var s,u=function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==A[1]&&A[1],t(!0),p=a({prompt:"retry"===u.tag?r("rewrite"):"",code_language:_,previous_result:o.at(c)||s||""},"before"===S||"after"===S?{pseudo_element:S}:{}),(0,h.isObject)(u)&&(p=a(a({},p),u)),C!==v.AICodeInsertMode.REPLACE&&(p.existing_code=P),!f||"refine"===O){i.next=13;break}return m=a({prompt:r("prompt"),code_language:_,module_html:(0,b.getModuleHTMLForCode)(E.module,_)},"before"===S||"after"===S?{pseudo_element:S}:{}),i.next=9,w(m);case 9:d=i.sent,n((0,y.setLastCodeRequestType)("generate")),i.next=18;break;case 13:return"retry"===u.tag&&(p=a(a({},p),{tag:""})),i.next=16,x(p);case 16:d=i.sent,n((0,y.setLastCodeRequestType)("refine"));case 18:g=(0,h.get)(d,"data.content",""),(k=(0,h.get)(d,"error",!1))&&n((0,y.showError)(k)),g&&(e(g),n((0,y.updateSelectedOption)(v.CodeOption.RESULT)),n((0,y.updateHistory)(g))),t(!1);case 23:case"end":return i.stop()}}),l)})),function(){var e=this,t=arguments;return new Promise((function(r,n){var i=u.apply(e,t);function o(e){l(i,r,n,o,a,"next",e)}function a(e){l(i,r,n,o,a,"throw",e)}o(void 0)}))});return function(e){return f.apply(this,arguments)}}();return{onSubmit:I,onSelect:function(e){var t=e.parentValue,r=e.value,n=e.name;return T(n),D(r),I(t&&t!==r?{tag:[t,r]}:{tag:r})},selectedLabel:M,selectedValue:j}}},535:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useRefineCodeForm=void 0;var n=r(40930);t.useRefineCodeForm=function(){var e=(0,n.useFormContext)(),t=e.control;return{control:t,register:e.register,getValues:e.getValues,rewrite:(0,n.useWatch)({control:t,name:"rewrite"})}}},22398:function(e,t,r){"use strict";function n(e){return n="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},n(e)}var i=["onChange"],o=["onChange"],a=["onChange"],s=["onChange"];function l(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?n/100:0)}(0,r,t)},default:50,value:V.influence})}});return(0,m.jsxs)("div",{className:"et-fb-form__group",children:[e,t]})}(),""!==V.url?null:(0,m.jsxs)("div",{className:"et-fb-form__group",children:[(0,m.jsx)(C.FieldLabel,{label:(0,w.default)("userPrompt","Aspect Ratio"),hint:(0,w.default)("userPrompt","$aspectRatioHint")}),(0,m.jsx)(g.Controller,{name:"aspectRatio",control:u,render:function(e){var t=e.field,r=t.onChange,n=l(t,i);return(0,m.jsx)(x.default,c(c({},n),{},{_onChange:function(e,t){r(t),K()},options:c({},(0,w.default)("userPrompt","aspectRatio"))}))}})]}),""!==V.url?null:(0,m.jsxs)("div",{className:"et-fb-form__group",children:[(0,m.jsx)(C.FieldLabel,{label:(0,w.default)("userPrompt","Size"),hint:(0,w.default)("userPrompt","$sizeHint")}),(0,m.jsxs)("div",{className:"et-fb-form-group-in-row",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)(g.Controller,{name:"imageWidth",control:u,render:function(e){var t=e.field,r=t.onChange,n=l(t,o);return(0,m.jsx)(_.default,c(c({role:"imageWidth",className:"et-fb-disabled-global-shortcuts"},n),{},{onChange:function(e){var t=e.target.value;r(t),Z("width",parseInt(t))},type:"number",min:"512",step:"1",value:h("imageWidth")||"",placeholder:(0,M.getDefaultDimensions)(h("aspectRatio")).width}))}}),(0,m.jsx)("span",{children:(0,w.default)("userPrompt","Width")})]}),(0,m.jsx)(k.default,{icon:"close"}),(0,m.jsxs)("div",{children:[(0,m.jsx)(g.Controller,{name:"imageHeight",control:u,render:function(e){var t=e.field,r=t.onChange,n=l(t,a);return(0,m.jsx)(_.default,c(c({role:"imageHeight",className:"et-fb-disabled-global-shortcuts"},n),{},{onChange:function(e){var t=e.target.value;r(t),Z("height",parseInt(t))},type:"number",min:"512",step:"1",value:h("imageHeight")||"",placeholder:(0,M.getDefaultDimensions)(h("aspectRatio")).height}))}}),(0,m.jsx)("span",{children:(0,w.default)("userPrompt","Height")})]})]})]})]})]})}},86817:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||u(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 o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}(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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&t("imageHeight",e)}if("height"===i){var n=d(i,r("imageHeight"));n&&n>0&&t("imageWidth",n)}},onDimensionChange:function(e,n){!function(e){var r=o(o({},p),{},a({},e,!0));r.width&&r.height&&t("aspectRatio","custom"),l(e),h(r)}(e),"custom"!==r("aspectRatio")&&(isNaN(n)||("width"===e&&t("imageHeight",d(e,n)),"height"===e&&t("imageWidth",d(e,n))))}}}},5599:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function l(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){l(o,n,i,a,s,"next",e)}function s(e){l(o,n,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1e7)){e.next=7;break}return x(!0),e.abrupt("return");case 7:h=function(e,t,n,i){var a=o(o({},E),{},{url:p.url,base64:e});w((0,y.setImageReference)(a)),w((0,y.updateImageQuery)(o(o({},C),{},{width:n,height:i,scale:t}))),r("referenceImageBase64",e),r("imageHeight",c),r("imageWidth",f)},(0,b.convertImageToBase64)(p,h);case 9:case"end":return e.stop()}}),e)}))))}}}},26626:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(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 a(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||l(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 l(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function a(){a=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(i,a,s,l){var u=p(e[i],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return o("throw",e,s,l)}))}l(u.arg)}var a;i(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(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 i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||o(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 o(e,t){if(e){if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r20?r((function(t){return t.filter((function(t){return t!==e}))})):(r((function(t){return[].concat(n(t),[e])})),setTimeout((function(){l(a+1)}),1e3))}}}},82875:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(87363),i=r(96486);t.default=function(e){var t=e.isLoading,r=e.imagesHistoryUrls,o=e.selectedImage,a=e.imagesPlaceholderRef,s=e.setSelectedImage;(0,n.useEffect)((function(){var e;t?null===(e=a.current)||void 0===e||e.scrollIntoView({behavior:"smooth"}):o||(0,i.isEmpty)(r)||s(r[0])}),[t])}},92374:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}var i=["image_base64","image_influence","width","height"];function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u(){u=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new P(n||[]);return i(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,a,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,a)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function o(i,a,s,l){var u=p(e[i],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,s,l)}),(function(e){o("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return o("throw",e,s,l)}))}l(u.arg)}var a;i(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function c(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){c(o,n,i,a,s,"next",e)}function s(e){c(o,n,i,a,s,"throw",e)}a(void 0)}))}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(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 h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?L.influence/100:L.influence,prompt:p},f),o.t0=e,o.next=15,T(M);case 15:o.t1=o.sent,o.t2=M,o.t0.handleGeneratedImage.call(o.t0,o.t1,o.t2),o.next=33;break;case 20:if(!(0,y.isObject)(_)||!S[0]||"upscale"!==S[0]){o.next=26;break}j=parseInt(S[1])||1,r((0,v.updateImageQuery)(a(a({},n),{},{scale:j}))),e.utilizeImage(L.url,!1,L.base64,j),o.next=33;break;case 26:return D=a(a({},g),{},{width:b,height:w,image_base64:L.base64,image_influence:L.influence>0?L.influence/100:L.influence,prompt:p},f),o.t3=e,o.next=30,A(D);case 30:o.t4=o.sent,o.t5=D,o.t3.handleGeneratedImage.call(o.t3,o.t4,o.t5);case 33:o.next=38;break;case 35:o.prev=35,o.t6=o.catch(8),console.log(o.t6);case 38:case"end":return o.stop()}}),o,null,[[8,35]])})));return function(){return o.apply(this,arguments)}}()}},13016:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(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 a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=l(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function a(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||l(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 l(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)){t.next=14;break}return t.next=6,null===(o=e(n))||void 0===o?void 0:o.unwrap();case 6:return s=t.sent,f=null!==(a=null==s?void 0:s.eta)&&void 0!==a?a:0,h=Math.ceil((0,c.toNumber)(f)),d=isNaN(h)?0:1e3*h+2e3,t.next=12,new Promise((function(e){return setTimeout(e,d)}));case 12:null!=s&&s.content&&(l=(0,c.isArray)(s.content)?(0,c.first)(s.content):s.content),u=!1;case 14:case"end":return t.stop()}}),t)})),f.s();case 7:if((p=f.n()).done){t.next=11;break}return t.delegateYield(h(),"t0",9);case 9:t.next=7;break;case 11:t.next=16;break;case 13:t.prev=13,t.t1=t.catch(4),f.e(t.t1);case 16:return t.prev=16,f.f(),t.finish(16);case 19:return t.abrupt("return",l);case 20:case"end":return t.stop()}}),t,null,[[4,13,16,19]])})),function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function s(e){a(o,n,i,s,l,"next",e)}function l(e){a(o,n,i,s,l,"throw",e)}s(void 0)}))});return function(e,t,n){return r.apply(this,arguments)}}();return{applyFullImageUpscale:t}}},15263:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==f[1]?f[1]:0,e.next=3,u({url:encodeURIComponent(t),action:"et_ai_upload_image",nonce:window.EtAiAppData.nonces.et_ai_upload_image}).unwrap();case 3:if(o=e.sent,a=null!==(r=null==o?void 0:o.data)&&void 0!==r?r:{},s=a.localImageURL,a.localImageID,l=a.message,!(n<10)||s||"Forbidden"!==l&&"Not Found"!==l){e.next=12;break}return e.next=8,new Promise((function(e){return setTimeout(e,5e3)}));case 8:return c=0===n?"?v=".concat(n):n,e.next=11,g("".concat(t).concat(c),++n);case 11:return e.abrupt("return",e.sent);case 12:return e.abrupt("return",o);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),v=function(){var e=a(i().mark((function e(a){var s,u,c,f,h,d,v,b,x,w,k,_,S,E,C,P,O=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=O.length>1&&void 0!==O[1]&&O[1],c=O.length>2&&void 0!==O[2]?O[2]:"",f=O.length>3&&void 0!==O[3]?O[3]:1,a){e.next=5;break}return e.abrupt("return");case 5:return h=a,d=1!==f?f:null!==(s=null==o?void 0:o.scale)&&void 0!==s?s:1,u||t(!0),v=(0,p.removeQueryParam)(a,"v"),b=(0,p.isCurrentDomain)(a)||""!==c,x=(0,p.isCurrentDomain)(a)?l.base64:c,w=b&&x?x:v,u||r(!0),e.next=15,m(w,d,b);case 15:return h=e.sent,u||r(!1),e.prev=17,e.next=20,g(h);case 20:return S=e.sent,E=null==S||null===(k=S.data)||void 0===k?void 0:k.localImageURL,C=null==S||null===(_=S.data)||void 0===_?void 0:_.localImageID,u||t(!1),!u&&E&&(P={text:E,localImageID:C,fieldName:y},window.dispatchEvent(new CustomEvent("ai_prompt_use_text_click",{detail:P})),n()),e.abrupt("return",E);case 28:return e.prev=28,e.t0=e.catch(17),console.log(e.t0),e.abrupt("return","");case 32:case"end":return e.stop()}}),e,null,[[17,28]])})));return function(t){return e.apply(this,arguments)}}();return{utilizeImage:v,applyFullImageUpscale:m}}},56921:function(e,t,r){"use strict";var n=["value","onChange"],i=["value","onChange"],o=["value","onChange"],a=["value","onChange"];function s(e){return s="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},s(e)}function l(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c(e,t)}(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 c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var f=r(85893),p=r(87363),h=r(40930),d=r(96486),m=c(r(787)),y=r(5528),g=c(r(92419)),v=c(r(33270));t.default=function(e){var t=e.options,r=e.aiDefaultColor,n=e.showFontColorCustom,a=e.setShowFontColorCustom,l=e.label,c=e.hint,b=e.websiteDefaultColor,x=void 0===b?"":b,w=e.fontColorSelectName,k=e.fontColorName,_=(0,h.useFormContext)(),S=_.control,E=_.setValue,C=(0,_.watch)(w);return(0,p.useEffect)((function(){r&&"diviAIDefault"!==C?E(w,"diviAIDefault"):r||"diviAIDefault"!==C||(E(w,""),E(k,""))}),[r]),(0,p.useEffect)((function(){a("custom"===C),(0,d.startsWith)(C,"gcid-")?E(k,C):"diviAIDefault"===C?E(k,r):C||E(k,"")}),[C,x,r,a,k,w]),(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(y.FieldLabel,{label:(0,m.default)("userPrompt",l),hint:(0,m.default)("userPrompt",c)}),(0,f.jsx)(h.Controller,{name:w,control:S,render:function(e){var r=e.field,n=r.onChange,o=u(r,i);return(0,f.jsx)(g.default,s(s({},o),{},{options:t,_onChange:function(e,t){n(t),E(w,t)},showSearchField:!1}))}}),n&&(0,f.jsx)(h.Controller,{name:k,control:S,render:function(e){var t=e.field,n=t.onChange,i=t.value,a=u(t,o);return(0,f.jsx)(v.default,s(s({},a),{},{value:i,_onChange:function(e,t){n(t),t||E(w,""),""!==t&&r!==t&&E(w,"custom"),""!==t&&r===t&&E(w,"diviAIDefault"),""!==t&&x===t&&E(w,"websiteDefault")},animate:!0,hideHarmoniusColors:!0,hideCurrentColorWrapper:!0}))}})]})}},86040:function(e,t,r){"use strict";var n=["onChange"],i=["onChange"];function o(e){return o="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},o(e)}function a(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);rt))return f(),function(){c.current=!1}}),[]);var f=function e(){o<1||setTimeout((function(){c.current&&(u((function(e){return--e})),e())}),1e3)},p=(0,s.useMemo)((function(){var e=100*(1-o/t);return Math.floor(e)}),[o]),h=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"et-common-progress-bar",children:(0,a.jsx)("span",{className:"et-common-loader et-common-loader-success"})}),(0,a.jsx)("p",{children:(0,l.default)("userPrompt","$finalizeImage")})]}),d=o<1;return 2>t?null:(0,a.jsxs)("div",{className:"image-countdown-timer",children:[d&&h,!d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("h4",{children:[(0,l.default)("userPrompt","Generating Images"),"..."]}),(0,a.jsx)("div",{className:"image-countdown-timer-bar",children:(0,a.jsx)("div",{className:"image-countdown-timer-bar-progress",style:{width:"".concat(p,"%")}})}),(0,a.jsxs)("div",{className:"image-countdown-info",children:[(0,a.jsx)("p",{className:"image-countdown-info-percentage",children:"".concat(p,"%")}),(0,a.jsx)("p",{children:(0,l.default)("userPrompt","$imagesETAMessage",o)})]})]})]})}},8900:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(0,c.jsxs)("label",{className:"et-ai-content-results-prompt__tag",htmlFor:"tag",children:[(0,b.default)("userPrompt","tags.Retry"),(0,c.jsx)("input",o(o({id:"tag",type:"radio",value:"retry"},i("tag")),{},{onClick:function(){return B({tag:"retry"})}}))]}),(0,c.jsx)("div",{className:"et-ai-content-results-prompt__tone",children:(0,c.jsx)(d.default,{button:(0,c.jsxs)(c.Fragment,{children:[u||(0,b.default)("userPrompt","Improve With AI"),(0,c.jsx)(m.default,{icon:"arrow-down-dense"})]}),value:T,onSelect:function(e){var t=e.parentValue,r=e.value,n=e.name;return A(n),L(r),B(t&&t!==r?{tag:[t,r]}:{tag:r})},context:j})})]})]}),(0,c.jsxs)("div",{className:"et-ai-content-results-prompt__regenerate",children:[(0,c.jsx)(w.FieldLabel,{label:(0,b.default)("userPrompt","Refine Result"),hint:(0,b.default)("userPrompt","$refineHint"),htmlFor:"refineResult"}),(0,c.jsxs)("div",{className:"et-ai-content-results-prompt__rewrite",children:[(0,c.jsx)(p.Controller,{name:"rewrite",control:n,render:function(e){var t=e.field;return(0,c.jsx)(v.default,o(o({},t),{},{id:"refineResult",value:t.value||"",placeholder:(0,b.default)("userPrompt","Rewrite to be more engaging"),onKeyDown:function(e){return(0,E.handleEnterKeyCallback)(e,(function(){return B({tag:"retry"})}),""===z)}}))}}),(0,c.jsx)(g.default,{onClick:function(){return B({tag:"retry"})},ripple:!1,disabled:""===z,className:"et-common-button--secondary",children:(0,b.default)("userPrompt","Regenerate")})]})]})]})]})]})}},13288:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(85893),o=r(40930),a=n(r(94184)),s=r(98136),l=r(14587),u=n(r(36789)),c=n(r(787)),f=r(8035),p=r(77466);r(23426);t.default=function(e){var t=(0,o.useFormContext)().setValue,r=(0,p.useAppSelector)(l.selectCurrent),n=(0,p.useAppSelector)(l.selectHistory),h=(0,p.useAppSelector)(l.selectAdditionalInfo),d=(0,p.useAppDispatch)(),m=h||{},y=m.intent,g=m.fields,v=function(r){e.onChange?e.onChange(r):f.MODULE_FIELDS_AUTOFILL===y?g.map((function(e){var i=e.name;t(i,n[r][i])})):t("text",n[r]),d((0,s.updateCurrent)(r))},b=(0,a.default)({"et-ai-content-results-prompt__history__prev":!0,"et-ai-content-results-prompt__history__prev--enabled":r>0}),x=(0,a.default)({"et-ai-content-results-prompt__history__next":!0,"et-ai-content-results-prompt__history__next--enabled":r>=0&&rr||v(r-1)},children:(0,i.jsx)(u.default,{icon:"left-arrow",viewBox:"0 0 13 13"})}),(0,i.jsx)("div",{className:x,role:"next-history",onClick:function(){r>=n.length-1||v(r+1)},children:(0,i.jsx)(u.default,{icon:"right-arrow",viewBox:"0 0 13 13"})}),(0,i.jsxs)("div",{className:"et-ai-content-results-prompt__history__count",children:[r+1," ",(0,i.jsx)("span",{children:"/"})," ",n.length," ",(0,c.default)("userPrompt","Results")]})]})}},91647:function(e,t,r){"use strict";function n(e){return n="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},n(e)}var i=["onChange"];function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var u=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=r(85893),f=r(40930),p=u(r(92419));t.default=function(e){var t=e.name,r=e.control,n=e.options;return(0,c.jsx)(f.Controller,{name:t,control:r,render:function(e){var t=e.field,r=t.onChange,o=l(t,i);return(0,c.jsx)(p.default,a(a({},o),{},{_onChange:function(e,t){return r(t)},options:n}))}})}},47485:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function l(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){l(o,n,i,a,s,"next",e)}function s(e){l(o,n,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useAppSelector=t.useAppDispatch=void 0;var n=r(36113);t.useAppDispatch=n.useDispatch,t.useAppSelector=n.useSelector},55102:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function s(){s=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function c(e,t,r,i){var o=t&&t.prototype instanceof d?t:d,a=Object.create(o.prototype),s=new P(i||[]);return n(a,"_invoke",{value:_(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var p={};function d(){}function m(){}function y(){}var g={};u(g,o,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,o)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(n,o,a,s){var l=f(e[n],e,o);if("throw"!==l.type){var u=l.arg,c=u.value;return c&&"object"==h(c)&&r.call(c,"__await")?t.resolve(c.__await).then((function(e){i("next",e,a,s)}),(function(e){i("throw",e,a,s)})):t.resolve(c).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,s)}))}s(l.arg)}var o;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=f(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),p;var i=f(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,p;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},e}function l(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){l(o,n,i,a,s,"next",e)}function s(e){l(o,n,i,a,s,"throw",e)}a(void 0)}))}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||f(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 f(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==f[1]?f[1]:0,e.next=3,g({url:encodeURIComponent(t),action:"et_ai_upload_image",nonce:window.EtAiAppData.nonces.et_ai_upload_image});case 3:if(o=e.sent,a=null!==(r=null==o||null===(n=o.data)||void 0===n?void 0:n.data)&&void 0!==r?r:{},l=a.localImageURL,a.localImageID,u=a.message,!(i<10)||l||"Forbidden"!==u){e.next=12;break}return e.next=8,new Promise((function(e){return setTimeout(e,5e3)}));case 8:return c=0===i?"?v=".concat(i):i,e.next=11,w("".concat(t).concat(c),++i);case 11:return e.abrupt("return",e.sent);case 12:return e.abrupt("return",o);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),k=function(){var n=u(s().mark((function n(i){var o,a,u,c,f,p,h,m,y,g,v,b,w,k,_,C,P,O,M,T,L,j;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(f=i.page_name,p=i.pageDescription,h=i.companyName,m=i.headingFont,y=i.bodyFont,g=i.headingFontColor,v=i.bodyFontColor,b=i.primaryColor,w=i.secondaryColor,k=i.site_description,_=i.additionalSiteDescription,C=i.post_type,x(_),t((0,E.setLayoutGenerationStage)("shortcode")),P={prompt:p,site_name:h,heading_font_color:g,body_font_color:v,primary_color:b,secondary_color:w,heading_font:(0,A.prepareLayoutGenerationFont)(m,null===(o=window)||void 0===o||null===(a=o.EtAiAppData)||void 0===a?void 0:a.ai_default_heading_font,I),body_font:(0,A.prepareLayoutGenerationFont)(y,null===(u=window)||void 0===u||null===(c=u.EtAiAppData)||void 0===c?void 0:c.ai_default_body_font,R),additional_description:_,theme_builder_area:(0,A.getThemeBuilderArea)(C),has_woocommerce:"active"===F,site_description:k,page_name:f,post_type:C},"layout"!==e){n.next=10;break}return n.next=7,l(P);case 7:O=n.sent,n.next=14;break;case 10:if("section"!==e){n.next=14;break}return n.next=13,d(P);case 13:O=n.sent;case 14:if(M=(0,S.get)(O,"data.content",""),T=(0,S.get)(O,"data.page_outline",{}),L=(0,S.get)(O,"error",!1),r.current=(0,S.get)(O,"data.design",{}),!L){n.next=20;break}throw new N("AI Error",L);case 20:return(j={layout:M,tempImport:!0,design:r.current}).layout&&"layout"===e&&window.dispatchEvent(new CustomEvent("ai_prompt_use_layout",{detail:j})),n.abrupt("return",{shortcode:M,pageOutline:T});case 23:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}(),D=function(){var i=u(s().mark((function i(a,l,u){var c,p,h,d,y,g,v,b,x,w,k,_;return s().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(c=a.page_name,p=a.pageDescription,h=a.companyName,d=a.imagesFrom,y=a.site_description,g=a.additionalSiteDescription,v=a.post_type,t((0,E.setLayoutGenerationStage)("content")),b={prompt:p,site_name:h,additional_description:g,page_outline:u,page_content:o.page,site_description:y,page_name:c,shortcode:l,post_type:v},"layout"!==e){i.next=9;break}return i.next=6,f(b);case 6:x=i.sent,i.next=13;break;case 9:if("section"!==e){i.next=13;break}return i.next=12,m(b);case 12:x=i.sent;case 13:if(w=(0,S.get)(x,"data.content",""),k=(0,S.get)(x,"data.imageCount",0),!(_=(0,S.get)(x,"error",!1))){i.next=18;break}throw new N("AI Error",_);case 18:return"layout"===e&&"stock_images"!==d&&window.dispatchEvent(new CustomEvent("ai_prompt_use_layout",{detail:{layout:w,design:r.current,tempImport:"placeholder_images"!==(null==a?void 0:a.imagesFrom)}})),n.current=k,t((0,E.setLayoutsImagesCount)(k)),i.abrupt("return",w);case 22:case"end":return i.stop()}}),i)})));return function(e,t,r){return i.apply(this,arguments)}}(),B=function(){var i=u(s().mark((function i(l,c,f){var h,d,m,g,v,x,k,_,C,P,O,A,M,T,L,D,I,R,F,B,V,z,G,H,W,U,q,Y,$,K,Z,Q,X,J,ee,te,re,ne,ie,oe,ae,se,le,ue,ce,fe,pe,he,de,me;return s().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(h=l.additionalSiteDescription,d=l.bodyFont,m=l.bodyFontColor,g=l.companyName,v=l.headingFont,x=l.headingFontColor,k=l.imagesFrom,_=l.page_name,C=l.pageDescription,P=l.post_type,O=l.primaryColor,A=l.secondaryColor,M=l.site_description,t((0,E.setLayoutGenerationStage)("images")),T={prompt:C,site_name:g,additional_description:h,page_outline:f,site_description:M,page_name:_,shortcode:c,post_type:P,primary_color:O,secondary_color:A,images_type:k},"layout"!==e||!n.current){i.next=9;break}return i.next=6,p(T);case 6:L=i.sent,i.next=13;break;case 9:if("section"!==e||!n.current){i.next=13;break}return i.next=12,y(T);case 12:L=i.sent;case 13:if(D=(0,S.get)(L,"data.content",c),I=(0,S.get)(L,"error",!1),R=(0,S.get)(L,"data.images",[]),F=(0,S.get)(L,"data.upscale",[]),B=(0,S.get)(L,"data.attributions",[]),V={},!I){i.next=21;break}throw new N("AI Error",I);case 21:if(D){i.next=23;break}throw new Error((0,j.default)("userPrompt","Unable to generate shortcode"));case 23:if(z=window.EtAiAppData.placeholder_image,G=[],!((H=(0,S.get)(L,"data.eta",0))&&H>0)){i.next=29;break}return i.next=29,new Promise((function(e){return setTimeout(e,1e3*H+2e3)}));case 29:if(F){t((0,E.setLayoutsImagesUpscaleCount)(F.length)),W=a(F);try{for(W.s();!(U=W.n()).done;)q=U.value,Y=q.index,$=q.scale,V["".concat(R[Y])]=$}catch(e){W.e(e)}finally{W.f()}}K=[],Z=a(R),i.prev=32,X=s().mark((function e(){var t;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Q.value,K.push(new Promise(function(){var e=u(s().mark((function e(r){var n,i,o,a,l;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t,!V[t]){e.next=11;break}return e.next=4,b({image_url:t,scale:V[t]});case 4:if(!("data"in(i=e.sent))){e.next=11;break}if(n=null!==(o=i.data.content)&&void 0!==o?o:n,!(i.data.eta&&i.data.eta>0)){e.next=11;break}return a=1e3*i.data.eta+2e3,e.next=11,new Promise((function(e){return setTimeout(e,a)}));case 11:return e.next=13,w(n);case 13:return l=e.sent,e.abrupt("return",r({url:t,response:l}));case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)})),Z.s();case 35:if((Q=Z.n()).done){i.next=39;break}return i.delegateYield(X(),"t0",37);case 37:i.next=35;break;case 39:i.next=44;break;case 41:i.prev=41,i.t1=i.catch(32),Z.e(i.t1);case 44:return i.prev=44,Z.f(),i.finish(44);case 47:if((0,S.isEmpty)(K)){i.next=52;break}return i.next=50,Promise.allSettled(K);case 50:if(J=i.sent,!(0,S.isEmpty)(J)){ee=a(J);try{for(ee.s();!(te=ee.n()).done;)"fulfilled"===(re=te.value).status&&(ue=null!==(ne=null==re||null===(ie=re.value)||void 0===ie?void 0:ie.response)&&void 0!==ne?ne:{},ce=null!==(oe=null==re||null===(ae=re.value)||void 0===ae?void 0:ae.url)&&void 0!==oe?oe:"",fe=null!==(se=null==ue||null===(le=ue.data)||void 0===le?void 0:le.data)&&void 0!==se?se:{},pe=fe.localImageURL,he=fe.localImageID,D=D.replace(ce,null!=pe?pe:z),G.push(null!=he?he:""))}catch(e){ee.e(e)}finally{ee.f()}}case 52:return de=!(d&&m&&v&&x&&O&&A),me=setTimeout((function(){window.dispatchEvent(new CustomEvent("ai_prompt_use_".concat(e),{detail:{layout:D,design:r.current,tempImport:!1,askToSaveFontColor:de,imageAttributions:B,ownerId:o.ownerId}})),t((0,E.hideModal)()),t((0,E.setLayoutGenerationStage)(""))}),1e3),i.abrupt("return",{timerId:me,localImageIDs:G});case 55:case"end":return i.stop()}}),i,null,[[32,41,44,47]])})));return function(e,t,r){return i.apply(this,arguments)}}(),V=function(){var n=u(s().mark((function n(l,u,c){var f,p,h,d,m,y,g,v,b,x,w,k,_,S,C,P;return s().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(f=c.bodyFont,p=c.bodyFontColor,h=c.headingFont,d=c.headingFontColor,m=c.primaryColor,y=c.secondaryColor,g=/https?:\/\/[^\s]+\.(jpg|jpeg|png|gif|bmp|webp)/gi,v=void 0,b=l.match(g)){n.next=6;break}return n.abrupt("return",{shortcode:l,timerId:void 0,localImageIDs:v});case 6:x=a(b),n.prev=7,x.s();case 9:if((w=x.n()).done){n.next=24;break}return k=w.value,n.prev=11,n.next=14,(0,A.getImageDimensions)(k);case 14:_=n.sent,S=(0,A.createPlaceholderImage)(i(i({},_),{},{color:"#C4C4C4"})),l=l.replace(k,S),n.next=22;break;case 19:n.prev=19,n.t0=n.catch(11),console.error("Error fetching or converting image: ".concat(k),n.t0);case 22:n.next=9;break;case 24:n.next=29;break;case 26:n.prev=26,n.t1=n.catch(7),x.e(n.t1);case 29:return n.prev=29,x.f(),n.finish(29);case 32:return C=!(f&&p&&h&&d&&m&&y),P=setTimeout((function(){window.dispatchEvent(new CustomEvent("ai_prompt_use_".concat(e),{detail:{layout:l,design:r.current,tempImport:!1,askToSaveFontColor:C,ownerId:o.ownerId}})),t((0,E.hideModal)()),t((0,E.setLayoutGenerationStage)(""))}),1e3),n.abrupt("return",{shortcode:l,timerId:P,localImageIDs:v});case 35:case"end":return n.stop()}}),n,null,[[7,26,29,32],[11,19]])})));return function(e,t,r){return n.apply(this,arguments)}}(),z=function(){var r=u(s().mark((function r(n){var i,o,a,l,u,c,f,p,h,d;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return H(),r.prev=1,r.next=4,k(n);case 4:return l=r.sent,u=l.shortcode,c=l.pageOutline,r.next=9,D(n,u,c);case 9:if(f=r.sent,"placeholder_images"!==(null==n?void 0:n.imagesFrom)){r.next=16;break}return r.next=13,V(f,c,n);case 13:a=r.sent,r.next=19;break;case 16:return r.next=18,B(n,f,c);case 18:a=r.sent;case 19:i=a.timerId,o=a.localImageIDs,r.next=32;break;case 23:r.prev=23,r.t0=r.catch(1),v({imageIds:o}),t((0,E.setLayoutGenerationStage)("")),t((0,E.setIsLayoutGenerationInProgress)(!1)),t((0,E.setModalDisplay)(!0)),r.t0 instanceof N?t((0,E.showError)(r.t0)):(h=null!==(p=null===r.t0||void 0===r.t0?void 0:r.t0.message)&&void 0!==p?p:(0,j.default)("userPrompt","Unable to generate shortcode"),d={status:"AI Error",data:{ai_error_message:h}},t((0,E.showError)(d))),clearTimeout(i),window.dispatchEvent(new CustomEvent("ai_prompt_use_".concat(e,"_generation_failure"),{}));case 32:case"end":return r.stop()}}),r,null,[[1,23]])})));return function(e){return r.apply(this,arguments)}}(),G=function(){var e=u(s().mark((function e(t){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:z(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),H=function(){window.dispatchEvent(new CustomEvent("ai_prompt_use_".concat(e,"_close_image_attributions"),{detail:{}}))};return{generateLayoutRequest:z,generateSectionRequest:G}}},54816:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function c(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function f(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var o=e.apply(t,r);function a(e){c(o,n,i,a,s,"next",e)}function s(e){c(o,n,i,a,s,"throw",e)}a(void 0)}))}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||h(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 h(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}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,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(ee.entries());try{for(i.s();!(n=i.n()).done;){var o=p(n.value,2),s=o[0],l=o[1];(0,b.isArray)(l)&&oe(l,t[s],s)}}catch(e){i.e(e)}finally{i.f()}}else ie(ee),oe(ee,e);re&&!O&&se()}else r("text",e?(0,P.stripDoubleQuotes)((0,b.toString)(e)):"")}}),[a.length]);var ae=function(){var e=f(o().mark((function e(t){var l,f,p,h,m,y,g,v,x,w,k,S,C;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=n(),f=l.tone,p=l.rewrite,h=l.more_option,V(!0),E.MODULE_FIELDS_AUTOFILL===J){e.next=15;break}return m=d.content,y=u(d,i),g=s(s({},y),{},{previous_result:a.at(I)||m||"",previous_prompt:d.prompt,prompt:p,more_option:h,module_fields:F}),(0,b.isObject)(t)&&(g=s(s({},g),t)),e.next=8,R(g);case 8:return v=e.sent,x=v.data,(w=v.error)&&Z((0,_.showError)(w)),(o=null==x?void 0:x.content)&&(r("text",(0,P.stripDoubleQuotes)(o)),Z((0,_.updateHistory)(o))),V(!1),e.abrupt("return");case 15:return e.next=17,T(s(s({},s(s({},c),{},{tone:f})),{},{prompt:p,previous_result:a.at(I)},t));case 17:if(k=e.sent,(S=(0,b.get)(k,"error",!1))&&Z((0,_.showError)(S)),V(!1),C=(0,b.get)(k,"data")){e.next=24;break}return e.abrupt("return");case 24:Z((0,_.updateHistory)(C)),ee.map((function(e){var t=e.name;r(t,null!=C&&C[t]?(0,P.stripDoubleQuotes)(C[t]):"")}));case 26:case"end":return e.stop()}var o}),e)})));return function(t){return e.apply(this,arguments)}}(),se=function(){var t=null==te?void 0:te.match(/__hover|_tablet|_phone/),r=ee.find((function(e){var r=e.name;return null!=t&&t.length&&(r+=(0,b.first)(t)),r===te})),i={};if(r){var o=r.selectedText,l=r.defaultValue;i=o?{text:l.replace(o,n("text")),fieldName:te}:{text:n("text"),fieldName:te}}else i={text:n("text"),fieldName:te};E.MODULE_FIELDS_AUTOFILL===J?(i=function(){var e={intent:J,settings:[],module:ne};if((0,b.isArray)((0,b.first)(ee))){var t=a.at(-1);e.settings=[],(0,b.forEach)(ee,(function(r,n){(0,b.isArray)(r)&&(0,b.forEach)(r,(function(r){var i=r.name,o=r.attrName,a=r.attrSubName,s=r.moduleId,l=(0,b.get)(t,n,{})[i];(0,b.includes)(P.aiSupportedImageFields,i)&&(l=(0,b.get)(A,n,"")),(0,b.isUndefined)(e.settings[n])&&(e.settings[n]={}),e.settings[n][i]={moduleId:s,value:l,attrName:o,attrSubName:a}}))}))}else e.settings={},ee.forEach((function(t){var r=t.name,i=t.attrName,o=t.attrSubName;t.moduleId,e.settings[r]={value:n(r),attrName:i,attrSubName:o,moduleId:M.ownerId}}));return e}(),"divi/page-settings"===j.module&&(i=s(s({},i),{},{text:G,localImageID:Q.current[G]}))):i.attrSubName=M.attrSubName,i.ownerId=M.ownerId,i.attrName=M.attrName,window.dispatchEvent(new CustomEvent("ai_prompt_use_text_click",{detail:i})),e.closePrompt()},le=function(){var e=f(o().mark((function e(t){var r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,L({url:encodeURIComponent(t),action:"et_ai_upload_image",nonce:window.EtAiAppData.nonces.et_ai_upload_image}).unwrap();case 5:return r=e.sent,e.abrupt("return",null==r?void 0:r.data);case 9:e.prev=9,e.t0=e.catch(2),console.log(e.t0);case 12:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),ue=function(){var e=f(o().mark((function e(t,n,i){var a,u,c,p,h,d;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=(0,b.get)(n,"data",""),u=(0,b.get)(n,"error",!1),c=(0,b.get)(n,"data.eta",0),p=(0,b.get)(n,"data.status",""),h=Math.ceil((0,b.toNumber)(c)),d=(0,b.isNaN)(h)?0:1e3*h+2e3,u&&Z((0,_.showError)(u)),"busy"===p?(V(!1),Z((0,_.showError)({status:"busy",error:(0,x.default)("userPrompt","$serverBusy")}))):(V(!0),q(!0),K(d/1e3),setTimeout(f(o().mark((function e(){var n,u,c,f,p;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.length){e.next=15;break}return e.next=3,le(a);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:n=e.t0,u=n.localImageID,c=void 0===u?0:u,f=n.localImageURL,p=void 0===f?"":f,(0,b.isUndefined)(i)?H(p):A=s(s({},A),l({},i,p)),r(t,p),Q.current=s(s({},Q.current),{},l({},p,c)),Z((0,_.updateHistoryAtIndex)({index:I,value:l({},t,p),merge:!0}));case 15:V(!1),q(!1),re&&(O&&O--,O||se());case 18:case"end":return e.stop()}}),e)}))),d));case 8:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}();return{isLoading:B,localImageURL:G,isWaitingImages:U,imagesProgressTimeout:$,onSubmit:ae,handleUseTextClick:se}}},13456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(87363),i=r(96486),o=r(77466),a=r(77466),s=r(19695),l=r(98136),u=r(14587),c=r(50013);t.default=function(){var e=(0,o.useAppDispatch)(),t=(0,a.useAppSelector)(u.selectError),r=(0,a.useAppSelector)(s.etAccount),f=(0,a.useAppSelector)(s.selectShowAuthorizationModal),p=(0,a.useAppSelector)(u.selectAdditionalInfo),h=!(null==r||!r.username||null==r||!r.apiKey),d=(0,c.useUserQuery)(void 0,{skip:!h}).data,m=!(0,i.isUndefined)(d)&&"active"===d.subscription,y=(0,i.get)(t,"data.ai_error_message","").endsWith("Please upgrade your subscription.")||!(0,i.isUndefined)(d)&&!m&&!d.remainingRequests,g=p||{},v=g.excludeStep;g.fields,g.intent,g.module;return(0,n.useEffect)((function(){(0,i.isUndefined)(d)||f||v||m||!h||y&&e((0,l.showUpgradeModal)(!0))}),[y,d,f,v,m,h,e]),{showFreeUpgradeBar:h&&!(0,i.isUndefined)(d)&&!(f||v||m)}}},92e3:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}(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 s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(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 a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0])||arguments[0];if(t)return e((0,u.showUpgradeModal)(!1)),void(h()&&e((0,u.showError)({show:!1,status:"",data:{error:"",ai_error_message:""}})));if(r&&d(),"image"===n){e((0,u.setSelectedPrompt)(""))}e((0,u.hideModal)())},handleBackBtnClick:function(){if(c){if("code"===n)return function(){d(),e((0,u.setBackButtonVisibility)(!1)),e((0,u.updateSelectedOption)(s.CodeOption.CODE_WITH_AI))}}else if("code"!==n&&s.PromptType.Refine===p&&s.TextOption.RESULT===f)return function(){return e((0,u.updateSelectedOption)(s.TextOption.WRITE_WITH_AI))}}}}},83104:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function s(e){o(a,n,i,s,l,"next",e)}function l(e){o(a,n,i,s,l,"throw",e)}s(void 0)}))}}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(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 l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_CANVAS_SIZE=t.COLORS=void 0,t.COLORS={white:"#ffffff",black:"#000000",charcoal:"var(--dark-gray)",dustyBlue:"var(--app-color)",mediumGray:"var(--medium-gray)"},t.MAX_CANVAS_SIZE=8192},8035:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.TBArea=t.TBPostType=t.AICodeInsertMode=t.DefaultImageReferenceSize=t.CodeContentType=t.ContentType=t.MODULE_FIELDS_AUTOFILL=t.Tags=t.AuthOption=t.SectionOption=t.LayoutOption=t.CodeOption=t.ImageOption=t.TextOption=t.PromptType=void 0,function(e){e[e.Generate=0]="Generate",e[e.Refine=1]="Refine"}(r||(t.PromptType=r={})),t.TextOption={WRITE_WITH_AI:"write_with_ai",IMPROVE_WITH_AI:"improve_with_ai",WRITE_AUTOMATICALLY:"write_automatically",WRITE_AND_REPLACE:"write_and_replace",RESULT:"result"},t.ImageOption={GENERATE_WITH_AI:"generate_with_ai",GENERATE_AUTOMATICALLY:"generate_automatically",IMPROVE_WITH_AI:"improve_with_ai",GENERATE_AND_REPLACE:"generate_and_replace",REIMAGINE:"reimagine",RESULT:"result"},t.CodeOption={CODE_WITH_AI:"code_with_ai",IMPROVE_CODE_WITH_AI:"improve_code_with_ai",RESULT:"result"},t.LayoutOption={LAYOUT_WITH_AI:"layout_with_ai",RESULT:"result"},t.SectionOption={SECTION_WITH_AI:"section_with_ai",RESULT:"result"},t.AuthOption={AUTH_ONLY_NO_GENERATE:"auth_only_no_generate"},t.Tags={Retry:"retry",Simplify:"simplify",Shorten:"shorten",Lengthen:"lengthen"},t.MODULE_FIELDS_AUTOFILL="module_fields_autofill",t.ContentType={paragraph:"paragraph",title:"title",button:"button"},t.CodeContentType={code_css:"css",code_html:"html",code_css_no_selector:"css-declarations",code_css_free_form:"free-form-css"},t.DefaultImageReferenceSize={width:512,height:512,scale:1},t.AICodeInsertMode={APPEND:"append",INSERT:"insert",REPLACE:"replace"},function(e){e.EtHeaderLayout="et_header_layout",e.EtBodyLayout="et_body_layout",e.EtFooterLayout="et_footer_layout"}(n||(t.TBPostType=n={})),function(e){e.Header="header",e.Body="post_content",e.Footer="footer"}(i||(t.TBArea=i={}))},89861:function(e,t,r){"use strict";function n(e){return n="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},n(e)}function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,a=Object.create(i.prototype),s=new P(n||[]);return o(a,"_invoke",{value:_(e,r,s)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=f;var h={};function d(){}function m(){}function y(){}var g={};c(g,s,(function(){return this}));var v=Object.getPrototypeOf,b=v&&v(v(O([])));b&&b!==t&&r.call(b,s)&&(g=b);var x=y.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,l){var u=p(e[o],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==n(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){i("next",e,s,l)}),(function(e){i("throw",e,s,l)})):t.resolve(f).then((function(e){c.value=e,s(c)}),(function(e){return i("throw",e,s,l)}))}l(u.arg)}var a;o(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function _(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return A()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=S(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var l=p(e,t,r);if("normal"===l.type){if(n=r.done?"completed":"suspendedYield",l.arg===h)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(n="completed",r.method="throw",r.arg=l.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var i=p(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,h;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function E(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function O(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;C(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}function o(e,t,r,n,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,i)}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t2&&void 0!==arguments[2]&&arguments[2];if(e.stopPropagation(),"Enter"===e.key)return e.preventDefault(),r||t(),!1};t.prepareLayoutGenerationFont=function(e,t,r){return"default"===e?t:"websiteDefault"===e?r:e};t.createImagesHistoryData=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:512,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:512,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return e.reduce((function(e,i){return e[i]={width:t,height:r,scale:n},e}),{})};t.increaseUrlVersion=function(e){var t=new URL(e),r=parseInt(t.searchParams.get("v")||"0")+1;return t.searchParams.set("v",r.toString()),t.toString()};t.appendQueryString=function(e,t){var r=Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");return e+(e.includes("?")?"&":"?")+r};t.removeQueryParam=function(e,t){var r=new URL(e),n=new URLSearchParams(r.search);return n.delete(t),r.search=n.toString(),r.toString()};t.isCurrentDomain=function(e){try{var t,r,n,i=null===(t=window.top)||void 0===t?void 0:t.location.hostname,o=null===(r=window.top)||void 0===r?void 0:r.location.protocol,a=e;return e.startsWith("/")&&(a="".concat(o,"//").concat(i).concat(e)),new URL(a).hostname===(null===(n=window.top)||void 0===n?void 0:n.location.hostname)}catch(e){return console.error(e),!1}};t.getThemeBuilderArea=function(e){var t,r;return null!==(r=(l(t={},h.TBPostType.EtHeaderLayout,h.TBArea.Header),l(t,h.TBPostType.EtBodyLayout,h.TBArea.Body),l(t,h.TBPostType.EtFooterLayout,h.TBArea.Footer),t)[e])&&void 0!==r?r:"post_content"};t.getMultipleUpscaleRates=function(e,t,r){for(var n=[],i=e;i1&&n.push(r),n};t.checkMultiples=function(e){for(var t={},r=0,n=[2,3,4];r{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(24268),o=(n=null,{middleware:function(){return function(e){return function(t){if((0,i.isAsyncThunkAction)(t)){var r=t.meta,o=r.arg.endpointName;"pending"===r.requestStatus&&["generateImage","autoGenerateImage","refineImage","inpaintImage","sketchImage","outpaintImage","enhance"].includes(o)&&(n=t)}return e(t)}}},getLastApiAction:function(){return n}});t.default=o},19695:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectShowAuthorizationModal=t.etAccountStatus=t.etAccount=void 0;var n=r(24268);t.etAccount=function(e){return e.diviAIOptions.etAccount};t.etAccountStatus=function(e){return e.diviAIOptions.etAccount.status},t.selectShowAuthorizationModal=(0,n.createSelector)(t.etAccount,(function(e){return(null==e?void 0:e.errorMessage)&&""!==(null==e?void 0:e.errorMessage)||!e.username||!e.apiKey}))},29548:(e,t,r)=>{"use strict";var n,i,o,a,s,l;Object.defineProperty(t,"__esModule",{value:!0}),t.setETAccount=t.diviAIOptionsSlice=void 0;var u=r(24268),c={etAccount:{username:null!==(n=null===(i=window.EtAiAppData.et_account)||void 0===i?void 0:i.et_username)&&void 0!==n?n:"",apiKey:null!==(o=null===(a=window.EtAiAppData.et_account)||void 0===a?void 0:a.et_api_key)&&void 0!==o?o:"",status:null!==(s=null===(l=window.EtAiAppData.et_account)||void 0===l?void 0:l.status)&&void 0!==s?s:"",errorMessage:""}};t.diviAIOptionsSlice=(0,u.createSlice)({name:"diviAIOptions",initialState:c,reducers:{setETAccount:function(e,t){var r,n,i;e.etAccount.username=null!==(r=t.payload.et_username)&&void 0!==r?r:e.etAccount.username,e.etAccount.apiKey=null!==(n=t.payload.et_api_key)&&void 0!==n?n:e.etAccount.apiKey,e.etAccount.status=null!==(i=t.payload.status)&&void 0!==i?i:e.etAccount.status,e.etAccount.errorMessage=t.payload.errorMessage}}}),t.setETAccount=t.diviAIOptionsSlice.actions.setETAccount,t.default=t.diviAIOptionsSlice.reducer},13603:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.selectModifySelectedAll=t.extendCanvasRatio=t.currentExtendCanvas=t.hasImageEditHistory=t.currentImageTransparentMask=t.currentImageMask=t.currentBrushColor=t.currentHistory=t.currentBrushBlur=t.currentBrushSize=t.extendCanvasData=t.editorMode=t.imageEditorLastState=t.imageEditorTab=t.selectImage=t.imageEditorURL=void 0;var n=r(24268);t.imageEditorURL=function(e){return e.diviAIImageEditor.imageURL};t.selectImage=function(e){return e.diviAIImageEditor.image};t.imageEditorTab=function(e){return e.diviAIImageEditor.editorTab};t.imageEditorLastState=function(e){return e.diviAIImageEditor.imageEditorLastState};t.editorMode=function(e){return e.diviAIImageEditor.editorMode};t.extendCanvasData=function(e){return e.diviAIImageEditor.imageEditorLastState.extendCanvasData},t.currentBrushSize=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,t.imageEditorTab,(function(e,t,r){var n,i,o;return null!==(n=null==e||null===(i=e[t])||void 0===i||null===(o=i[r])||void 0===o?void 0:o.brushSize)&&void 0!==n?n:30})),t.currentBrushBlur=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,t.imageEditorTab,(function(e,t,r){var n,i,o;return null!==(n=null==e||null===(i=e[t])||void 0===i||null===(o=i[r])||void 0===o?void 0:o.brushBlur)&&void 0!==n?n:5})),t.currentHistory=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,t.imageEditorTab,(function(e,t,r){var n,i,o;return null!==(n=null==e||null===(i=e[t])||void 0===i||null===(o=i[r])||void 0===o?void 0:o.lastPoints)&&void 0!==n?n:""})),t.currentBrushColor=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,t.imageEditorTab,(function(e,t,r){var n,i,o;return null!==(n=null==e||null===(i=e[t])||void 0===i||null===(o=i[r])||void 0===o?void 0:o.brushColor)&&void 0!==n?n:"#000000"})),t.currentImageMask=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,t.imageEditorTab,(function(e,t,r){var n,i,o;return null!==(n=null==e||null===(i=e[t])||void 0===i||null===(o=i[r])||void 0===o?void 0:o.mask)&&void 0!==n?n:""})),t.currentImageTransparentMask=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,t.imageEditorTab,(function(e,t,r){var n,i,o;return null!==(n=null==e||null===(i=e[t])||void 0===i||null===(o=i[r])||void 0===o?void 0:o.transparentMask)&&void 0!==n?n:""})),t.hasImageEditHistory=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,(function(e,t){var r=(null==e?void 0:e[t])||{};return Object.keys(r).length>0})),t.currentExtendCanvas=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,(function(e,t){var r,n;return null!==(r=null==e||null===(n=e[t])||void 0===n?void 0:n.Extend.extendCanvasData)&&void 0!==r?r:{}})),t.extendCanvasRatio=(0,n.createSelector)(t.imageEditorLastState,t.imageEditorURL,(function(e,t){var r,n;return null!==(r=null==e||null===(n=e[t])||void 0===n?void 0:n.Extend.activeExtendRatio)&&void 0!==r?r:""}));t.selectModifySelectedAll=function(e){return e.diviAIImageEditor.modifySelectedAll}},91021:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}function i(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t{"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r{"use strict";function n(e){return n="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},n(e)}function i(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}(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 o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r ')),(0,l.default)(w).css({width:"auto",height:"auto"}),(0,a.render)((0,o.jsx)(s.Provider,{store:c.store,children:(0,o.jsx)(p.default,{})}),x.querySelector(w)))}}))},36789:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var n=r(87363),i=r.n(n),o=r(94480),a=r.n(o),s=r(58618),l=r.n(s),u=r(22211),c=r.n(u);function f(e){return f="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},f(e)}function p(e,t){for(var r=0;r