Changeset 3376557
- Timestamp:
- 10/11/2025 07:43:01 AM (3 months ago)
- Location:
- ai-plus-block-editor
- Files:
-
- 112 added
- 20 edited
-
tags/1.8.0 (added)
-
tags/1.8.0/LICENSE (added)
-
tags/1.8.0/ai-plus-block-editor.php (added)
-
tags/1.8.0/composer.json (added)
-
tags/1.8.0/dist (added)
-
tags/1.8.0/dist/app.asset.php (added)
-
tags/1.8.0/dist/app.js (added)
-
tags/1.8.0/dist/app.js.map (added)
-
tags/1.8.0/inc (added)
-
tags/1.8.0/inc/Abstracts (added)
-
tags/1.8.0/inc/Abstracts/Provider.php (added)
-
tags/1.8.0/inc/Abstracts/Route.php (added)
-
tags/1.8.0/inc/Abstracts/Service.php (added)
-
tags/1.8.0/inc/Admin (added)
-
tags/1.8.0/inc/Admin/Form.php (added)
-
tags/1.8.0/inc/Admin/Options.php (added)
-
tags/1.8.0/inc/Core (added)
-
tags/1.8.0/inc/Core/AI.php (added)
-
tags/1.8.0/inc/Core/Container.php (added)
-
tags/1.8.0/inc/Interfaces (added)
-
tags/1.8.0/inc/Interfaces/Kernel.php (added)
-
tags/1.8.0/inc/Interfaces/Provider.php (added)
-
tags/1.8.0/inc/Interfaces/Router.php (added)
-
tags/1.8.0/inc/Plugin.php (added)
-
tags/1.8.0/inc/Providers (added)
-
tags/1.8.0/inc/Providers/Claude.php (added)
-
tags/1.8.0/inc/Providers/DeepSeek.php (added)
-
tags/1.8.0/inc/Providers/Gemini.php (added)
-
tags/1.8.0/inc/Providers/Grok.php (added)
-
tags/1.8.0/inc/Providers/OpenAI.php (added)
-
tags/1.8.0/inc/Routes (added)
-
tags/1.8.0/inc/Routes/SideBar.php (added)
-
tags/1.8.0/inc/Routes/Switcher.php (added)
-
tags/1.8.0/inc/Routes/Tone.php (added)
-
tags/1.8.0/inc/Services (added)
-
tags/1.8.0/inc/Services/Admin.php (added)
-
tags/1.8.0/inc/Services/Boot.php (added)
-
tags/1.8.0/inc/Services/PostMeta.php (added)
-
tags/1.8.0/inc/Services/Routes.php (added)
-
tags/1.8.0/languages (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ar-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ar.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ar.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ar.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-da_DK-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-da_DK.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-da_DK.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-da_DK.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-de_DE-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-de_DE.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-de_DE.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-de_DE.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-es_ES-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-es_ES.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-es_ES.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-es_ES.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-fr_FR-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-fr_FR.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-fr_FR.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-fr_FR.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-he_IL-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-he_IL.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-he_IL.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-he_IL.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hi_IN-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hi_IN.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hi_IN.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hi_IN.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hr-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hr.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hr.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-hr.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-it_IT-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-it_IT.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-it_IT.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-it_IT.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ru_RU-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ru_RU.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ru_RU.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-ru_RU.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor-zh_CN-a442c66c97675e8bda3e3b62b3a8c8ec.json (added)
-
tags/1.8.0/languages/ai-plus-block-editor-zh_CN.l10n.php (added)
-
tags/1.8.0/languages/ai-plus-block-editor-zh_CN.mo (added)
-
tags/1.8.0/languages/ai-plus-block-editor-zh_CN.po (added)
-
tags/1.8.0/languages/ai-plus-block-editor.pot (added)
-
tags/1.8.0/readme.txt (added)
-
tags/1.8.0/styles.css (added)
-
tags/1.8.0/vendor (added)
-
tags/1.8.0/vendor/autoload.php (added)
-
tags/1.8.0/vendor/composer (added)
-
tags/1.8.0/vendor/composer/ClassLoader.php (added)
-
tags/1.8.0/vendor/composer/InstalledVersions.php (added)
-
tags/1.8.0/vendor/composer/LICENSE (added)
-
tags/1.8.0/vendor/composer/autoload_classmap.php (added)
-
tags/1.8.0/vendor/composer/autoload_namespaces.php (added)
-
tags/1.8.0/vendor/composer/autoload_psr4.php (added)
-
tags/1.8.0/vendor/composer/autoload_real.php (added)
-
tags/1.8.0/vendor/composer/autoload_static.php (added)
-
tags/1.8.0/vendor/composer/installed.json (added)
-
tags/1.8.0/vendor/composer/installed.php (added)
-
tags/1.8.0/vendor/composer/platform_check.php (added)
-
tags/1.8.0/vendor/orhanerday (added)
-
tags/1.8.0/vendor/orhanerday/open-ai (added)
-
tags/1.8.0/vendor/orhanerday/open-ai/CHANGELOG.md (added)
-
tags/1.8.0/vendor/orhanerday/open-ai/LICENSE.md (added)
-
tags/1.8.0/vendor/orhanerday/open-ai/README.md (added)
-
tags/1.8.0/vendor/orhanerday/open-ai/composer.json (added)
-
tags/1.8.0/vendor/orhanerday/open-ai/src (added)
-
tags/1.8.0/vendor/orhanerday/open-ai/src/OpenAi.php (added)
-
tags/1.8.0/vendor/orhanerday/open-ai/src/Url.php (added)
-
trunk/ai-plus-block-editor.php (modified) (1 diff)
-
trunk/composer.json (modified) (2 diffs)
-
trunk/dist/app.asset.php (modified) (1 diff)
-
trunk/dist/app.js (modified) (1 diff)
-
trunk/dist/app.js.map (modified) (1 diff)
-
trunk/inc/Abstracts/Provider.php (added)
-
trunk/inc/Abstracts/Route.php (modified) (1 diff)
-
trunk/inc/Admin/Options.php (modified) (3 diffs)
-
trunk/inc/Core/AI.php (modified) (3 diffs)
-
trunk/inc/Core/Container.php (modified) (2 diffs)
-
trunk/inc/Providers/Claude.php (added)
-
trunk/inc/Providers/DeepSeek.php (modified) (6 diffs)
-
trunk/inc/Providers/Gemini.php (modified) (4 diffs)
-
trunk/inc/Providers/Grok.php (modified) (7 diffs)
-
trunk/inc/Providers/OpenAI.php (modified) (2 diffs)
-
trunk/inc/Services/Admin.php (modified) (1 diff)
-
trunk/inc/Services/Boot.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ai-plus-block-editor/trunk/ai-plus-block-editor.php
r3365034 r3376557 4 4 * Plugin URI: https://github.com/badasswp/ai-plus-block-editor 5 5 * Description: Add AI Capabilities to the WP Block Editor. 6 * Version: 1. 7.16 * Version: 1.8.0 7 7 * Author: badasswp 8 8 * Author URI: https://github.com/badasswp -
ai-plus-block-editor/trunk/composer.json
r3235704 r3376557 16 16 } 17 17 ], 18 "require": {19 "orhanerday/open-ai": "^5.1"20 },18 "require": { 19 "orhanerday/open-ai": "^5.1" 20 }, 21 21 "require-dev": { 22 "badasswp/wp-mock-tc": "^1.0", 22 23 "phpunit/phpunit": "^9.6", 23 24 "mockery/mockery": "^1.6", … … 42 43 "test": "vendor/bin/phpunit --testdox", 43 44 "analyse": "vendor/bin/phpstan analyse --memory-limit=2048M", 44 "coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-cobertura cobertura.xml && coveralls --repo-token=bDrttxr9v8g9lhyT05a0AqPzZPubS1hJq --file=cobertura.xml"45 "coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-cobertura cobertura.xml && coveralls --repo-token=bDrttxr9v8g9lhyT05a0AqPzZPubS1hJq --file=cobertura.xml" 45 46 } 46 47 } -
ai-plus-block-editor/trunk/dist/app.asset.php
r3365021 r3376557 1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives'), 'version' => ' a2bd6a8efd0af26c1ffa');1 <?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives'), 'version' => 'dc4e07b2ea253d802277'); -
ai-plus-block-editor/trunk/dist/app.js
r3365021 r3376557 1 (()=>{"use strict";var t={20:(t,e,o)=>{var n=o(609),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,o){var n,i={},l=null,d=null;for(n in void 0!==o&&(l=""+o),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(d=e.ref),e)s.call(e,n)&&!c.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)void 0===i[n]&&(i[n]=e[n]);return{$$typeof:r,type:t,key:l,ref:d,props:i,_owner:a.current}}e.Fragment=i,e.jsx=l,e.jsxs=l},21:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postSocial:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postSocial:null===(e=i("meta"))||void 0===e?void 0:e.apbe_social,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Social Media Hashtags","ai-plus-block-editor")})}),(0,n.jsx)(c.TextareaControl,{rows:4,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"social"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({meta:{apbe_social:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Hashtags. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({meta:{apbe_social:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},56:(t,e,o)=>{t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function o(t){for(var o=-1,n=0;n<e.length;n++)if(e[n].identifier===t){o=n;break}return o}function n(t,n){for(var i={},s=[],a=0;a<t.length;a++){var c=t[a],l=n.base?c[0]+n.base:c[0],d=i[l]||0,p="".concat(l," ").concat(d);i[l]=d+1;var u=o(p),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)e[u].references++,e[u].updater(f);else{var h=r(f,n);n.byIndex=a,e.splice(a,0,{identifier:p,updater:h,references:1})}s.push(p)}return s}function r(t,e){var o=e.domAPI(e);return o.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;o.update(t=e)}else o.remove()}}t.exports=function(t,r){var i=n(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<i.length;s++){var a=o(i[s]);e[a].references--}for(var c=n(t,r),l=0;l<i.length;l++){var d=o(i[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}i=c}}},87:t=>{t.exports=window.wp.element},100:(t,e,o)=>{o.d(e,{A:()=>a});var n=o(354),r=o.n(n),i=o(314),s=o.n(i)()(r());s.push([t.id,".apbe-toast{position:fixed;background:#000;color:#fff;bottom:-50px;opacity:0;left:15px;padding:20px;border-radius:5px;font-size:13px;z-index:1;box-shadow:0 0 15px rgba(0,0,0,.1);animation:slideUp .5s ease-out forwards}.apbe-sidebar p{margin-top:0 !important;margin-bottom:7.5px !important}.apbe-sidebar button{height:auto;padding:11.5px 15px;justify-content:center}.apbe-sidebar ul{margin:0;padding:0;display:flex;flex-direction:column}.apbe-sidebar ul li{padding:0 0 22.5px 0;margin:0}.apbe-sidebar ul li:first-child{padding-top:0}.apbe-button-group{display:flex;justify-content:space-between;margin-top:8.5px}.apbe-button-group button{height:38px;border-radius:3px}.apbe-button-group button.is-secondary{padding-left:9px;padding-right:9px}@keyframes slideUp{to{bottom:40px;opacity:1}}","",{version:3,sources:["webpack://./src/styles/app.scss"],names:[],mappings:"AACC,YACC,cAAA,CACA,eAAA,CACA,UAAA,CACA,YAAA,CACA,SAAA,CACA,SAAA,CACA,YAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA,CACA,kCAAA,CACE,uCAAA,CAIF,gBACC,uBAAA,CACA,8BAAA,CAGD,qBACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,iBACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,oBACC,oBAAA,CACA,QAAA,CAEA,gCACC,aAAA,CAOH,mBACC,YAAA,CACA,6BAAA,CACA,gBAAA,CAEA,0BACC,WAAA,CACA,iBAAA,CAEA,uCACC,gBAAA,CACA,iBAAA,CAOL,mBACE,GACD,WAAA,CACG,SAAA,CAAA",sourcesContent:[".apbe {\n\t&-toast {\n\t\tposition: fixed;\n\t\tbackground: #000;\n\t\tcolor: #FFF;\n\t\tbottom: -50px;\n\t\topacity: 0;\n\t\tleft: 15px;\n\t\tpadding: 20px;\n\t\tborder-radius: 5px;\n\t\tfont-size: 13px;\n\t\tz-index: 1;\n\t\tbox-shadow: 0 0 15px rgba(0, 0, 0, 0.1);\n \t\tanimation: slideUp 0.5s ease-out forwards;\n\t}\n\n\t&-sidebar {\n\t\tp {\n\t\t\tmargin-top: 0 !important;\n\t\t\tmargin-bottom: 7.5px !important;\n\t\t}\n\n\t\tbutton {\n\t\t\theight: auto;\n\t\t\tpadding: 11.5px 15px;\n\t\t\tjustify-content: center;\n\t\t}\n\n\t\tul {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\n\t\t\tli {\n\t\t\t\tpadding: 0 0 22.5px 0;\n\t\t\t\tmargin: 0;\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tpadding-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-button {\n\t\t&-group {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tmargin-top: 8.5px;\n\n\t\t\tbutton {\n\t\t\t\theight: 38px;\n\t\t\t\tborder-radius: 3px;\n\n\t\t\t\t&.is-secondary {\n\t\t\t\t\tpadding-left: 9px;\n\t\t\t\t\tpadding-right: 9px;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n@keyframes slideUp {\n to {\n\tbottom: 40px;\n opacity: 1;\n }\n}\n"],sourceRoot:""}]);const a=s},105:(t,e,o)=>{o.d(e,{D:()=>i,h:()=>s});var n=o(723),r=o(619);const i=t=>{const e=[],o=(0,r.applyFilters)("apbe.blockMenuOptions",{casual:(0,n.__)("Use Casual Tone","ai-plus-block-editor"),official:(0,n.__)("Use Official Tone","ai-plus-block-editor"),descriptive:(0,n.__)("Use Descriptive Tone","ai-plus-block-editor"),narrative:(0,n.__)("Use Narrative Tone","ai-plus-block-editor"),aggressive:(0,n.__)("Use Aggressive Tone","ai-plus-block-editor")});return Object.keys(o).forEach(n=>{e.push({title:o[n],onClick:()=>{t(n)}})}),e},s=()=>(0,r.applyFilters)("apbe.allowedBlocks",["core/paragraph"])},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},143:t=>{t.exports=window.wp.data},213:(t,e,o)=>{var n=o(848),r=o(723),i=o(830),s=o(619),a=o(715),c=o(143),l=o(427),d=o(455),p=o.n(d),u=o(105),f=o(814),h=(o(533),function(t,e,o,n){return new(o||(o=Promise))(function(r,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o(function(t){t(e)})).then(s,a)}c((n=n.apply(t,e||[])).next())})});(0,s.addFilter)("blocks.registerBlockType","apbe/ai",t=>{const{name:e,edit:o}=t;return-1===(0,u.h)().indexOf(e)||(t.edit=t=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.BlockControls,{children:(0,n.jsx)(l.ToolbarGroup,{children:(0,n.jsx)(l.ToolbarDropdownMenu,{icon:i.A,label:(0,r.__)("AI + Block Editor"),controls:(0,u.D)(t=>h(void 0,void 0,void 0,function*(){const{postId:e,blockId:o,blockContent:n}=(()=>{var t,e;const{getCurrentPostId:o}=(0,c.select)(f.FI),{getSelectedBlock:n,getSelectedBlockClientId:r}=(0,c.select)(f.Os);return{postId:o(),blockId:r(),blockContent:(null===(e=null===(t=n())||void 0===t?void 0:t.attributes)||void 0===e?void 0:e.content)||""}})(),{createNotice:i,createErrorNotice:s,removeNotice:a}=(0,c.dispatch)(f.DS),{updateBlockAttributes:l}=(0,c.dispatch)(f.Os),{getNotices:d}=(0,c.select)(f.DS);i("success",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-tone-success",type:"snackbar"});try{const r=yield p()({path:"/ai-plus-block-editor/v1/tone",method:"POST",data:{id:e,text:(null==n?void 0:n.text)||n,newTone:t}});let i=1;const s=setInterval(()=>{r.length===i&&clearInterval(s),l(o,{content:r.substring(0,i)}),i++},5);d().forEach(t=>a(t.id))}catch(t){s(t.message,{type:"snackbar",isDismissible:!0})}}))})})}),o(t)]})),t})},258:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postSummary:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postSummary:null===(e=i("meta"))||void 0===e?void 0:e.apbe_summary,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Summary","ai-plus-block-editor")})}),(0,n.jsx)(c.TextareaControl,{rows:4,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"summary"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({excerpt:t}),o({meta:{apbe_summary:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Summary. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({excerpt:t}),o({meta:{apbe_summary:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},279:t=>{t.exports=window.wp.plugins},309:t=>{t.exports=window.wp.editPost},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o}).join("")},e.i=function(t,o,n,r,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);n&&s[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),o&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=o):d[2]=o),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),e.push(d))}},e}},351:(t,e,o)=>{o.d(e,{A:()=>i});var n=o(609),r=o(573);const i=(0,n.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(r.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))},354:t=>{t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),i="/*# ".concat(r," */");return[e].concat([i]).join("\n")}return[e].join("\n")}},427:t=>{t.exports=window.wp.components},455:t=>{t.exports=window.wp.apiFetch},457:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postSlug:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postSlug:null===(e=i("meta"))||void 0===e?void 0:e.apbe_slug,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Slug","ai-plus-block-editor")})}),(0,n.jsx)(c.TextControl,{placeholder:"your-article-slug",value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"slug"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({slug:t}),o({meta:{apbe_slug:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Slug. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({slug:t}),o({meta:{apbe_slug:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},533:(t,e,o)=>{var n=o(72),r=o.n(n),i=o(825),s=o.n(i),a=o(659),c=o.n(a),l=o(56),d=o.n(l),p=o(540),u=o.n(p),f=o(113),h=o.n(f),A=o(100),b={};b.styleTagTransform=h(),b.setAttributes=d(),b.insert=c().bind(null,"head"),b.domAPI=s(),b.insertStyleElement=u(),r()(A.A,b),A.A&&A.A.locals&&A.A.locals},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},573:t=>{t.exports=window.wp.primitives},609:t=>{t.exports=window.React},619:t=>{t.exports=window.wp.hooks},659:t=>{var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},692:t=>{t.exports=window.wp.notices},715:t=>{t.exports=window.wp.blockEditor},723:t=>{t.exports=window.wp.i18n},814:(t,e,o)=>{o.d(e,{DS:()=>r,FI:()=>n,Os:()=>i});const n="core/editor",r="core/notices",i="core/block-editor"},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var r=void 0!==o.layer;r&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,r&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},830:(t,e,o)=>{o.d(e,{A:()=>i});var n=o(609),r=o(573);const i=(0,n.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(r.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"}))},848:(t,e,o)=>{t.exports=o(20)},897:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postKeywords:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postKeywords:null===(e=i("meta"))||void 0===e?void 0:e.apbe_seo_keywords,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("SEO Keywords","ai-plus-block-editor")})}),(0,n.jsx)(c.TextareaControl,{rows:7,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"keywords"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({meta:{apbe_seo_keywords:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch SEO Keywords. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({meta:{apbe_seo_keywords:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},922:(t,e,o)=>{o.d(e,{$j:()=>s.A,BD:()=>i.A,Gz:()=>c.A,Mw:()=>r.A,ij:()=>a.A,kW:()=>n.A});var n=o(897),r=o(457),i=o(258),s=o(924),a=o(973),c=o(21)},924:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(143),c=o(692),l=o(427),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,a.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,a.useDispatch)(c.store),{postId:b,postContent:v,postHeadline:x,notices:m}=(0,a.useSelect)(t=>{var e;const{getNotices:o}=t(c.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postHeadline:null===(e=i("meta"))||void 0===e?void 0:e.apbe_headline,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Headline","ai-plus-block-editor")})}),(0,n.jsx)(l.TextareaControl,{rows:4,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(l.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=(yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"headline"}})).trim().replace(/^"|"$/g,"");(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({meta:{apbe_headline:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Headline. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(l.Button,{variant:"secondary",onClick:()=>{let e=1;new Promise(n=>{const r=setInterval(()=>{e===t.length&&(clearInterval(r),n(t)),o({title:t.substring(0,e)}),e++},5)}).then(t=>{o({meta:{apbe_headline:t}}),d()})},children:(0,n.jsx)(l.Icon,{icon:i.A})})]})]})}},953:(t,e,o)=>{var n=o(848),r=o(723),i=o(830),s=o(87),a=o(427),c=o(279),l=o(309),d=o(922);o(533),(0,c.registerPlugin)("ai-plus-block-editor",{render:()=>(0,n.jsxs)(s.Fragment,{children:[(0,n.jsx)(l.PluginSidebarMoreMenuItem,{icon:i.A,target:"apbe-sidebar",children:(0,r.__)("AI + Block Editor","ai-plus-block-editor")}),(0,n.jsx)(l.PluginSidebar,{name:"apbe-sidebar",title:(0,r.__)("AI + Block Editor","ai-plus-block-editor"),icon:i.A,children:(0,n.jsx)(a.PanelBody,{children:(0,n.jsx)("div",{className:"apbe-sidebar",children:(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:(0,n.jsx)(d.ij,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.$j,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.Mw,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.kW,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.BD,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.Gz,{})})]})})})})]})})},973:(t,e,o)=>{o.d(e,{A:()=>p});var n=o(848),r=o(87),i=o(143),s=o(723),a=o(427),c=o(692),l=o(455),d=o.n(l);const p=()=>{const{createNotice:t}=(0,i.useDispatch)(c.store),[e,o]=(0,r.useState)(apbe.provider||"");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,s.__)("Switch AI Provider","ai-plus-block-editor")})}),(0,n.jsx)(a.SelectControl,{label:null,value:e,options: [{label:"ChatGPT",value:"OpenAI"},{label:"Gemini",value:"Gemini"},{label:"DeepSeek",value:"DeepSeek"},{label:"Grok",value:"Grok"}],onChange:e=>{return n=void 0,r=void 0,a=function*(){o(e);try{yield d()({path:"/ai-plus-block-editor/v1/switcher",method:"POST",data:{provider:e}}),t("success",(0,s.__)("Success! AI Provider switched successfully.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-success",type:"snackbar"})}catch(e){t("error",(0,s.__)("Error! Failed to switch AI Provider.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-error",type:"snackbar"}),console.error(e.message)}},new((i=void 0)||(i=Promise))(function(t,e){function o(t){try{c(a.next(t))}catch(t){e(t)}}function s(t){try{c(a.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i(function(t){t(n)})).then(o,s)}c((a=a.apply(n,r||[])).next())});var n,r,i,a},id:"switcher",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})}}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var i=e[n]={id:n,exports:{}};return t[n](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.nc=void 0,o(213),o(953)})();1 (()=>{"use strict";var t={20:(t,e,o)=>{var n=o(609),r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(t,e,o){var n,i={},l=null,d=null;for(n in void 0!==o&&(l=""+o),void 0!==e.key&&(l=""+e.key),void 0!==e.ref&&(d=e.ref),e)s.call(e,n)&&!c.hasOwnProperty(n)&&(i[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps)void 0===i[n]&&(i[n]=e[n]);return{$$typeof:r,type:t,key:l,ref:d,props:i,_owner:a.current}}e.Fragment=i,e.jsx=l,e.jsxs=l},21:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postSocial:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postSocial:null===(e=i("meta"))||void 0===e?void 0:e.apbe_social,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Social Media Hashtags","ai-plus-block-editor")})}),(0,n.jsx)(c.TextareaControl,{rows:4,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"social"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({meta:{apbe_social:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Hashtags. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({meta:{apbe_social:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},56:(t,e,o)=>{t.exports=function(t){var e=o.nc;e&&t.setAttribute("nonce",e)}},72:t=>{var e=[];function o(t){for(var o=-1,n=0;n<e.length;n++)if(e[n].identifier===t){o=n;break}return o}function n(t,n){for(var i={},s=[],a=0;a<t.length;a++){var c=t[a],l=n.base?c[0]+n.base:c[0],d=i[l]||0,p="".concat(l," ").concat(d);i[l]=d+1;var u=o(p),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==u)e[u].references++,e[u].updater(f);else{var h=r(f,n);n.byIndex=a,e.splice(a,0,{identifier:p,updater:h,references:1})}s.push(p)}return s}function r(t,e){var o=e.domAPI(e);return o.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;o.update(t=e)}else o.remove()}}t.exports=function(t,r){var i=n(t=t||[],r=r||{});return function(t){t=t||[];for(var s=0;s<i.length;s++){var a=o(i[s]);e[a].references--}for(var c=n(t,r),l=0;l<i.length;l++){var d=o(i[l]);0===e[d].references&&(e[d].updater(),e.splice(d,1))}i=c}}},87:t=>{t.exports=window.wp.element},100:(t,e,o)=>{o.d(e,{A:()=>a});var n=o(354),r=o.n(n),i=o(314),s=o.n(i)()(r());s.push([t.id,".apbe-toast{position:fixed;background:#000;color:#fff;bottom:-50px;opacity:0;left:15px;padding:20px;border-radius:5px;font-size:13px;z-index:1;box-shadow:0 0 15px rgba(0,0,0,.1);animation:slideUp .5s ease-out forwards}.apbe-sidebar p{margin-top:0 !important;margin-bottom:7.5px !important}.apbe-sidebar button{height:auto;padding:11.5px 15px;justify-content:center}.apbe-sidebar ul{margin:0;padding:0;display:flex;flex-direction:column}.apbe-sidebar ul li{padding:0 0 22.5px 0;margin:0}.apbe-sidebar ul li:first-child{padding-top:0}.apbe-button-group{display:flex;justify-content:space-between;margin-top:8.5px}.apbe-button-group button{height:38px;border-radius:3px}.apbe-button-group button.is-secondary{padding-left:9px;padding-right:9px}@keyframes slideUp{to{bottom:40px;opacity:1}}","",{version:3,sources:["webpack://./src/styles/app.scss"],names:[],mappings:"AACC,YACC,cAAA,CACA,eAAA,CACA,UAAA,CACA,YAAA,CACA,SAAA,CACA,SAAA,CACA,YAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA,CACA,kCAAA,CACE,uCAAA,CAIF,gBACC,uBAAA,CACA,8BAAA,CAGD,qBACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,iBACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,oBACC,oBAAA,CACA,QAAA,CAEA,gCACC,aAAA,CAOH,mBACC,YAAA,CACA,6BAAA,CACA,gBAAA,CAEA,0BACC,WAAA,CACA,iBAAA,CAEA,uCACC,gBAAA,CACA,iBAAA,CAOL,mBACE,GACD,WAAA,CACG,SAAA,CAAA",sourcesContent:[".apbe {\n\t&-toast {\n\t\tposition: fixed;\n\t\tbackground: #000;\n\t\tcolor: #FFF;\n\t\tbottom: -50px;\n\t\topacity: 0;\n\t\tleft: 15px;\n\t\tpadding: 20px;\n\t\tborder-radius: 5px;\n\t\tfont-size: 13px;\n\t\tz-index: 1;\n\t\tbox-shadow: 0 0 15px rgba(0, 0, 0, 0.1);\n \t\tanimation: slideUp 0.5s ease-out forwards;\n\t}\n\n\t&-sidebar {\n\t\tp {\n\t\t\tmargin-top: 0 !important;\n\t\t\tmargin-bottom: 7.5px !important;\n\t\t}\n\n\t\tbutton {\n\t\t\theight: auto;\n\t\t\tpadding: 11.5px 15px;\n\t\t\tjustify-content: center;\n\t\t}\n\n\t\tul {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\n\t\t\tli {\n\t\t\t\tpadding: 0 0 22.5px 0;\n\t\t\t\tmargin: 0;\n\n\t\t\t\t&:first-child {\n\t\t\t\t\tpadding-top: 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t&-button {\n\t\t&-group {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: space-between;\n\t\t\tmargin-top: 8.5px;\n\n\t\t\tbutton {\n\t\t\t\theight: 38px;\n\t\t\t\tborder-radius: 3px;\n\n\t\t\t\t&.is-secondary {\n\t\t\t\t\tpadding-left: 9px;\n\t\t\t\t\tpadding-right: 9px;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n@keyframes slideUp {\n to {\n\tbottom: 40px;\n opacity: 1;\n }\n}\n"],sourceRoot:""}]);const a=s},105:(t,e,o)=>{o.d(e,{D:()=>i,h:()=>s});var n=o(723),r=o(619);const i=t=>{const e=[],o=(0,r.applyFilters)("apbe.blockMenuOptions",{casual:(0,n.__)("Use Casual Tone","ai-plus-block-editor"),official:(0,n.__)("Use Official Tone","ai-plus-block-editor"),descriptive:(0,n.__)("Use Descriptive Tone","ai-plus-block-editor"),narrative:(0,n.__)("Use Narrative Tone","ai-plus-block-editor"),aggressive:(0,n.__)("Use Aggressive Tone","ai-plus-block-editor")});return Object.keys(o).forEach(n=>{e.push({title:o[n],onClick:()=>{t(n)}})}),e},s=()=>(0,r.applyFilters)("apbe.allowedBlocks",["core/paragraph"])},113:t=>{t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},143:t=>{t.exports=window.wp.data},213:(t,e,o)=>{var n=o(848),r=o(723),i=o(830),s=o(619),a=o(715),c=o(143),l=o(427),d=o(455),p=o.n(d),u=o(105),f=o(814),h=(o(533),function(t,e,o,n){return new(o||(o=Promise))(function(r,i){function s(t){try{c(n.next(t))}catch(t){i(t)}}function a(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o(function(t){t(e)})).then(s,a)}c((n=n.apply(t,e||[])).next())})});(0,s.addFilter)("blocks.registerBlockType","apbe/ai",t=>{const{name:e,edit:o}=t;return-1===(0,u.h)().indexOf(e)||(t.edit=t=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.BlockControls,{children:(0,n.jsx)(l.ToolbarGroup,{children:(0,n.jsx)(l.ToolbarDropdownMenu,{icon:i.A,label:(0,r.__)("AI + Block Editor"),controls:(0,u.D)(t=>h(void 0,void 0,void 0,function*(){const{postId:e,blockId:o,blockContent:n}=(()=>{var t,e;const{getCurrentPostId:o}=(0,c.select)(f.FI),{getSelectedBlock:n,getSelectedBlockClientId:r}=(0,c.select)(f.Os);return{postId:o(),blockId:r(),blockContent:(null===(e=null===(t=n())||void 0===t?void 0:t.attributes)||void 0===e?void 0:e.content)||""}})(),{createNotice:i,createErrorNotice:s,removeNotice:a}=(0,c.dispatch)(f.DS),{updateBlockAttributes:l}=(0,c.dispatch)(f.Os),{getNotices:d}=(0,c.select)(f.DS);i("success",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-tone-success",type:"snackbar"});try{const r=yield p()({path:"/ai-plus-block-editor/v1/tone",method:"POST",data:{id:e,text:(null==n?void 0:n.text)||n,newTone:t}});let i=1;const s=setInterval(()=>{r.length===i&&clearInterval(s),l(o,{content:r.substring(0,i)}),i++},5);d().forEach(t=>a(t.id))}catch(t){s(t.message,{type:"snackbar",isDismissible:!0})}}))})})}),o(t)]})),t})},258:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postSummary:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postSummary:null===(e=i("meta"))||void 0===e?void 0:e.apbe_summary,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Summary","ai-plus-block-editor")})}),(0,n.jsx)(c.TextareaControl,{rows:4,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"summary"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({excerpt:t}),o({meta:{apbe_summary:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Summary. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({excerpt:t}),o({meta:{apbe_summary:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},279:t=>{t.exports=window.wp.plugins},309:t=>{t.exports=window.wp.editPost},314:t=>{t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var o="",n=void 0!==e[5];return e[4]&&(o+="@supports (".concat(e[4],") {")),e[2]&&(o+="@media ".concat(e[2]," {")),n&&(o+="@layer".concat(e[5].length>0?" ".concat(e[5]):""," {")),o+=t(e),n&&(o+="}"),e[2]&&(o+="}"),e[4]&&(o+="}"),o}).join("")},e.i=function(t,o,n,r,i){"string"==typeof t&&(t=[[null,t,void 0]]);var s={};if(n)for(var a=0;a<this.length;a++){var c=this[a][0];null!=c&&(s[c]=!0)}for(var l=0;l<t.length;l++){var d=[].concat(t[l]);n&&s[d[0]]||(void 0!==i&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=i),o&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=o):d[2]=o),r&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=r):d[4]="".concat(r)),e.push(d))}},e}},351:(t,e,o)=>{o.d(e,{A:()=>i});var n=o(609),r=o(573);const i=(0,n.createElement)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,n.createElement)(r.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}))},354:t=>{t.exports=function(t){var e=t[1],o=t[3];if(!o)return e;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),r="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),i="/*# ".concat(r," */");return[e].concat([i]).join("\n")}return[e].join("\n")}},427:t=>{t.exports=window.wp.components},455:t=>{t.exports=window.wp.apiFetch},457:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postSlug:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postSlug:null===(e=i("meta"))||void 0===e?void 0:e.apbe_slug,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Slug","ai-plus-block-editor")})}),(0,n.jsx)(c.TextControl,{placeholder:"your-article-slug",value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"slug"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({slug:t}),o({meta:{apbe_slug:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Slug. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({slug:t}),o({meta:{apbe_slug:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},533:(t,e,o)=>{var n=o(72),r=o.n(n),i=o(825),s=o.n(i),a=o(659),c=o.n(a),l=o(56),d=o.n(l),p=o(540),u=o.n(p),f=o(113),h=o.n(f),A=o(100),b={};b.styleTagTransform=h(),b.setAttributes=d(),b.insert=c().bind(null,"head"),b.domAPI=s(),b.insertStyleElement=u(),r()(A.A,b),A.A&&A.A.locals&&A.A.locals},540:t=>{t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},573:t=>{t.exports=window.wp.primitives},609:t=>{t.exports=window.React},619:t=>{t.exports=window.wp.hooks},659:t=>{var e={};t.exports=function(t,o){var n=function(t){if(void 0===e[t]){var o=document.querySelector(t);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}(t);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(o)}},692:t=>{t.exports=window.wp.notices},715:t=>{t.exports=window.wp.blockEditor},723:t=>{t.exports=window.wp.i18n},814:(t,e,o)=>{o.d(e,{DS:()=>r,FI:()=>n,Os:()=>i});const n="core/editor",r="core/notices",i="core/block-editor"},825:t=>{t.exports=function(t){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var e=t.insertStyleElement(t);return{update:function(o){!function(t,e,o){var n="";o.supports&&(n+="@supports (".concat(o.supports,") {")),o.media&&(n+="@media ".concat(o.media," {"));var r=void 0!==o.layer;r&&(n+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),n+=o.css,r&&(n+="}"),o.media&&(n+="}"),o.supports&&(n+="}");var i=o.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),e.styleTagTransform(n,t,e.options)}(e,t,o)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},830:(t,e,o)=>{o.d(e,{A:()=>i});var n=o(609),r=o(573);const i=(0,n.createElement)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,n.createElement)(r.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"}))},848:(t,e,o)=>{t.exports=o(20)},897:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(692),c=o(427),l=o(143),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,l.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,l.useDispatch)(a.store),{postId:b,postContent:v,postKeywords:x,notices:m}=(0,l.useSelect)(t=>{var e;const{getNotices:o}=t(a.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postKeywords:null===(e=i("meta"))||void 0===e?void 0:e.apbe_seo_keywords,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("SEO Keywords","ai-plus-block-editor")})}),(0,n.jsx)(c.TextareaControl,{rows:7,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(c.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"keywords"}});(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({meta:{apbe_seo_keywords:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch SEO Keywords. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(c.Button,{variant:"secondary",onClick:()=>{o({meta:{apbe_seo_keywords:t}}),d()},children:(0,n.jsx)(c.Icon,{icon:i.A})})]})]})}},922:(t,e,o)=>{o.d(e,{$j:()=>s.A,BD:()=>i.A,Gz:()=>c.A,Mw:()=>r.A,ij:()=>a.A,kW:()=>n.A});var n=o(897),r=o(457),i=o(258),s=o(924),a=o(973),c=o(21)},924:(t,e,o)=>{o.d(e,{A:()=>f});var n=o(848),r=o(723),i=o(351),s=o(87),a=o(143),c=o(692),l=o(427),d=o(455),p=o.n(d),u=o(814);const f=()=>{const[t,e]=(0,s.useState)(""),{editPost:o,savePost:d}=(0,a.useDispatch)(u.FI),{createNotice:f,createErrorNotice:h,removeNotice:A}=(0,a.useDispatch)(c.store),{postId:b,postContent:v,postHeadline:x,notices:m}=(0,a.useSelect)(t=>{var e;const{getNotices:o}=t(c.store),{getCurrentPostId:n,getEditedPostContent:r,getEditedPostAttribute:i}=t(u.FI);return{postId:n(),postContent:r(),postHeadline:null===(e=i("meta"))||void 0===e?void 0:e.apbe_headline,notices:o()}},[]);return(0,s.useEffect)(()=>{e(x)},[x]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,r.__)("Headline","ai-plus-block-editor")})}),(0,n.jsx)(l.TextareaControl,{rows:4,value:t,onChange:t=>e(t),__nextHasNoMarginBottom:!0}),(0,n.jsxs)("div",{className:"apbe-button-group",children:[(0,n.jsx)(l.Button,{variant:"primary",onClick:()=>{return t=void 0,n=void 0,s=function*(){m.forEach(t=>A(t.id)),f("info",(0,r.__)("AI is generating text, please hold on for a bit.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-info",type:"snackbar"});try{const t=(yield p()({path:"/ai-plus-block-editor/v1/sidebar",method:"POST",data:{id:b,text:(null==v?void 0:v.text)||v,feature:"headline"}})).trim().replace(/^"|"$/g,"");(()=>{let o=1;return new Promise(n=>{const r=setInterval(()=>{t.length===o&&(clearInterval(r),n(t)),e(t.substring(0,o)),o++},5)})})().then(t=>{o({meta:{apbe_headline:t}})}),A("apbe-info")}catch(t){A("apbe-info"),h((0,r.__)("Error! Failed to fetch Headline. Please check your error logs or console for more info.","ai-plus-block-editor")),console.error(t.message)}},new((i=void 0)||(i=Promise))(function(e,o){function r(t){try{c(s.next(t))}catch(t){o(t)}}function a(t){try{c(s.throw(t))}catch(t){o(t)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i(function(t){t(o)})).then(r,a)}c((s=s.apply(t,n||[])).next())});var t,n,i,s},children:(0,r.__)("Generate","ai-plus-block-editor")}),(0,n.jsx)(l.Button,{variant:"secondary",onClick:()=>{let e=1;new Promise(n=>{const r=setInterval(()=>{e===t.length&&(clearInterval(r),n(t)),o({title:t.substring(0,e)}),e++},5)}).then(t=>{o({meta:{apbe_headline:t}}),d()})},children:(0,n.jsx)(l.Icon,{icon:i.A})})]})]})}},953:(t,e,o)=>{var n=o(848),r=o(723),i=o(830),s=o(87),a=o(427),c=o(279),l=o(309),d=o(922);o(533),(0,c.registerPlugin)("ai-plus-block-editor",{render:()=>(0,n.jsxs)(s.Fragment,{children:[(0,n.jsx)(l.PluginSidebarMoreMenuItem,{icon:i.A,target:"apbe-sidebar",children:(0,r.__)("AI + Block Editor","ai-plus-block-editor")}),(0,n.jsx)(l.PluginSidebar,{name:"apbe-sidebar",title:(0,r.__)("AI + Block Editor","ai-plus-block-editor"),icon:i.A,children:(0,n.jsx)(a.PanelBody,{children:(0,n.jsx)("div",{className:"apbe-sidebar",children:(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:(0,n.jsx)(d.ij,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.$j,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.Mw,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.kW,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.BD,{})}),(0,n.jsx)("li",{children:(0,n.jsx)(d.Gz,{})})]})})})})]})})},973:(t,e,o)=>{o.d(e,{A:()=>p});var n=o(848),r=o(87),i=o(143),s=o(723),a=o(427),c=o(692),l=o(455),d=o.n(l);const p=()=>{const{createNotice:t}=(0,i.useDispatch)(c.store),[e,o]=(0,r.useState)(apbe.provider||"");return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:(0,n.jsx)("strong",{children:(0,s.__)("Switch AI Provider","ai-plus-block-editor")})}),(0,n.jsx)(a.SelectControl,{label:null,value:e,options:(null===apbe||void 0===apbe?void 0:apbe.providers)||[],onChange:e=>{return n=void 0,r=void 0,a=function*(){o(e);try{yield d()({path:"/ai-plus-block-editor/v1/switcher",method:"POST",data:{provider:e}}),t("success",(0,s.__)("Success! AI Provider switched successfully.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-success",type:"snackbar"})}catch(e){t("error",(0,s.__)("Error! Failed to switch AI Provider.","ai-plus-block-editor"),{isDismissible:!0,id:"apbe-error",type:"snackbar"}),console.error(e.message)}},new((i=void 0)||(i=Promise))(function(t,e){function o(t){try{c(a.next(t))}catch(t){e(t)}}function s(t){try{c(a.throw(t))}catch(t){e(t)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i(function(t){t(n)})).then(o,s)}c((a=a.apply(n,r||[])).next())});var n,r,i,a},id:"switcher",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})]})}}},e={};function o(n){var r=e[n];if(void 0!==r)return r.exports;var i=e[n]={id:n,exports:{}};return t[n](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.nc=void 0,o(213),o(953)})(); 2 2 //# sourceMappingURL=app.js.map -
ai-plus-block-editor/trunk/dist/app.js.map
r3365021 r3376557 1 {"version":3,"file":"app.js","mappings":"uCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,E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runtime.production.min.js","webpack://ai-plus-block-editor/./src/components/Social.tsx","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://ai-plus-block-editor/external window [\"wp\",\"element\"]","webpack://ai-plus-block-editor/./src/styles/app.scss","webpack://ai-plus-block-editor/./src/utils/index.tsx","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://ai-plus-block-editor/external window [\"wp\",\"data\"]","webpack://ai-plus-block-editor/./src/core/AiTone.tsx","webpack://ai-plus-block-editor/./src/components/Summary.tsx","webpack://ai-plus-block-editor/external window [\"wp\",\"plugins\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"editPost\"]","webpack://ai-plus-block-editor/./node_modules/css-loader/dist/runtime/api.js","webpack://ai-plus-block-editor/./node_modules/@wordpress/icons/build-module/library/check.js","webpack://ai-plus-block-editor/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://ai-plus-block-editor/external window [\"wp\",\"components\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"apiFetch\"]","webpack://ai-plus-block-editor/./src/components/Slug.tsx","webpack://ai-plus-block-editor/./src/styles/app.scss?4dc7","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://ai-plus-block-editor/external window [\"wp\",\"primitives\"]","webpack://ai-plus-block-editor/external window \"React\"","webpack://ai-plus-block-editor/external window [\"wp\",\"hooks\"]","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://ai-plus-block-editor/external window [\"wp\",\"notices\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"blockEditor\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"i18n\"]","webpack://ai-plus-block-editor/./src/utils/store.ts","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://ai-plus-block-editor/./node_modules/@wordpress/icons/build-module/library/verse.js","webpack://ai-plus-block-editor/./node_modules/react/jsx-runtime.js","webpack://ai-plus-block-editor/./src/components/SEO.tsx","webpack://ai-plus-block-editor/./src/components/Headline.tsx","webpack://ai-plus-block-editor/./src/core/AiSideBar.tsx","webpack://ai-plus-block-editor/./src/components/Switcher.tsx","webpack://ai-plus-block-editor/webpack/bootstrap","webpack://ai-plus-block-editor/webpack/runtime/compat get default export","webpack://ai-plus-block-editor/webpack/runtime/define property getters","webpack://ai-plus-block-editor/webpack/runtime/hasOwnProperty shorthand","webpack://ai-plus-block-editor/webpack/runtime/nonce"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextareaControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Social.\n *\n * This Component returns the Social media\n * trending hash-tags & keywords.\n *\n * @since 1.5.0\n *\n * @return {JSX.Element} Social Hashtags.\n */\nconst Social = (): JSX.Element => {\n\tconst [ social, setSocial ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postSocial, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostSocial: getEditedPostAttribute( 'meta' )?.apbe_social,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetSocial( postSocial );\n\t}, [ postSocial ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiSocial: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'social',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated social media hashtags and keywords\n\t\t\t * when the Animation responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiSocial.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiSocial );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSocial( aiSocial.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newSocial ) => {\n\t\t\t\teditPost( { meta: { apbe_social: newSocial } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Hashtags. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { meta: { apbe_social: social } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>\n\t\t\t\t\t{ __( 'Social Media Hashtags', 'ai-plus-block-editor' ) }\n\t\t\t\t</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 4 }\n\t\t\t\tvalue={ social }\n\t\t\t\tonChange={ ( text ) => setSocial( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Social;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","module.exports = window[\"wp\"][\"element\"];","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.apbe-toast{position:fixed;background:#000;color:#fff;bottom:-50px;opacity:0;left:15px;padding:20px;border-radius:5px;font-size:13px;z-index:1;box-shadow:0 0 15px rgba(0,0,0,.1);animation:slideUp .5s ease-out forwards}.apbe-sidebar p{margin-top:0 !important;margin-bottom:7.5px !important}.apbe-sidebar button{height:auto;padding:11.5px 15px;justify-content:center}.apbe-sidebar ul{margin:0;padding:0;display:flex;flex-direction:column}.apbe-sidebar ul li{padding:0 0 22.5px 0;margin:0}.apbe-sidebar ul li:first-child{padding-top:0}.apbe-button-group{display:flex;justify-content:space-between;margin-top:8.5px}.apbe-button-group button{height:38px;border-radius:3px}.apbe-button-group button.is-secondary{padding-left:9px;padding-right:9px}@keyframes slideUp{to{bottom:40px;opacity:1}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/styles/app.scss\"],\"names\":[],\"mappings\":\"AACC,YACC,cAAA,CACA,eAAA,CACA,UAAA,CACA,YAAA,CACA,SAAA,CACA,SAAA,CACA,YAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA,CACA,kCAAA,CACE,uCAAA,CAIF,gBACC,uBAAA,CACA,8BAAA,CAGD,qBACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,iBACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,oBACC,oBAAA,CACA,QAAA,CAEA,gCACC,aAAA,CAOH,mBACC,YAAA,CACA,6BAAA,CACA,gBAAA,CAEA,0BACC,WAAA,CACA,iBAAA,CAEA,uCACC,gBAAA,CACA,iBAAA,CAOL,mBACE,GACD,WAAA,CACG,SAAA,CAAA\",\"sourcesContent\":[\".apbe {\\n\\t&-toast {\\n\\t\\tposition: fixed;\\n\\t\\tbackground: #000;\\n\\t\\tcolor: #FFF;\\n\\t\\tbottom: -50px;\\n\\t\\topacity: 0;\\n\\t\\tleft: 15px;\\n\\t\\tpadding: 20px;\\n\\t\\tborder-radius: 5px;\\n\\t\\tfont-size: 13px;\\n\\t\\tz-index: 1;\\n\\t\\tbox-shadow: 0 0 15px rgba(0, 0, 0, 0.1);\\n \\t\\tanimation: slideUp 0.5s ease-out forwards;\\n\\t}\\n\\n\\t&-sidebar {\\n\\t\\tp {\\n\\t\\t\\tmargin-top: 0 !important;\\n\\t\\t\\tmargin-bottom: 7.5px !important;\\n\\t\\t}\\n\\n\\t\\tbutton {\\n\\t\\t\\theight: auto;\\n\\t\\t\\tpadding: 11.5px 15px;\\n\\t\\t\\tjustify-content: center;\\n\\t\\t}\\n\\n\\t\\tul {\\n\\t\\t\\tmargin: 0;\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tflex-direction: column;\\n\\n\\t\\t\\tli {\\n\\t\\t\\t\\tpadding: 0 0 22.5px 0;\\n\\t\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t\\t&:first-child {\\n\\t\\t\\t\\t\\tpadding-top: 0;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&-button {\\n\\t\\t&-group {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tjustify-content: space-between;\\n\\t\\t\\tmargin-top: 8.5px;\\n\\n\\t\\t\\tbutton {\\n\\t\\t\\t\\theight: 38px;\\n\\t\\t\\t\\tborder-radius: 3px;\\n\\n\\t\\t\\t\\t&.is-secondary {\\n\\t\\t\\t\\t\\tpadding-left: 9px;\\n\\t\\t\\t\\t\\tpadding-right: 9px;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes slideUp {\\n to {\\n\\tbottom: 40px;\\n opacity: 1;\\n }\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { __ } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\n\ntype DropdownOption = {\n\ttitle: string;\n\tonClick: () => void;\n};\n\n/**\n * Get Options.\n *\n * This function filters the Block Menu AI Options\n * available when the user selects a block.\n *\n * @since 1.1.0\n *\n * @param {Function} getTone Function to get the tone.\n * @return {DropdownOption[]} Dropdown options.\n */\nexport const getBlockMenuOptions = ( getTone: Function ): DropdownOption[] => {\n\tconst menu = [];\n\n\t/**\n\t * Filter Menu Options.\n\t *\n\t * By default the passed object should contain\n\t * menu options.\n\t *\n\t * @since 1.1.0\n\t * @since 1.5.0 Pass in menu options before returning menu.\n\t *\n\t * @param {Object} menu Menu options.\n\t * @return {Object}\n\t */\n\tconst options = applyFilters( 'apbe.blockMenuOptions', {\n\t\tcasual: __( 'Use Casual Tone', 'ai-plus-block-editor' ),\n\t\tofficial: __( 'Use Official Tone', 'ai-plus-block-editor' ),\n\t\tdescriptive: __( 'Use Descriptive Tone', 'ai-plus-block-editor' ),\n\t\tnarrative: __( 'Use Narrative Tone', 'ai-plus-block-editor' ),\n\t\taggressive: __( 'Use Aggressive Tone', 'ai-plus-block-editor' ),\n\t} );\n\n\tObject.keys( options ).forEach( ( key ) => {\n\t\tmenu.push( {\n\t\t\ttitle: options[ key ],\n\t\t\tonClick: () => {\n\t\t\t\tgetTone( key );\n\t\t\t},\n\t\t} );\n\t} );\n\n\treturn menu;\n};\n\n/**\n * Get Allowed Blocks.\n *\n * This function filters the allowed blocks\n * available to the AI tone feature.\n *\n * @since 1.4.0\n *\n * @return {string[]} Allowed blocks.\n */\nexport const getAllowedBlocks = (): string[] => {\n\tconst allowedBlocks = [ 'core/paragraph' ];\n\n\t/**\n\t * Filter Allowed Blocks.\n\t *\n\t * By default the passed option should contain\n\t * allowed blocks.\n\t *\n\t * @since 1.4.0\n\t *\n\t * @param {string[]} allowedBlocks Allowed blocks array.\n\t * @return {string[]}\n\t */\n\treturn applyFilters( 'apbe.allowedBlocks', allowedBlocks ) as string[];\n};\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = window[\"wp\"][\"data\"];","import { __ } from '@wordpress/i18n';\nimport { verse } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { select, dispatch } from '@wordpress/data';\nimport { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps, selectBlockProps, noticeProps } from '../utils/types';\nimport { getAllowedBlocks, getBlockMenuOptions } from '../utils';\nimport { editorStore, noticesStore, blockEditorStore } from '../utils/store';\n\nimport '../styles/app.scss';\n\n/**\n * Filter Blocks with AI.\n *\n * @since 1.0.0\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nexport const filterBlockTypesWithAI = ( settings: any ): object => {\n\tconst { name, edit } = settings;\n\n\tif ( getAllowedBlocks().indexOf( name ) === -1 ) {\n\t\treturn settings;\n\t}\n\n\tsettings.edit = ( props: any ) => {\n\t\t/**\n\t\t * Get Tone Params.\n\t\t *\n\t\t * This function retrieves the current post ID,\n\t\t * selected block ID, and block content.\n\t\t *\n\t\t * @since 1.4.0\n\t\t * @return {Object} Object containing postId, blockId and blockContent.\n\t\t */\n\t\tconst getToneParams = (): any => {\n\t\t\tconst { getCurrentPostId } = select( editorStore ) as selectProps;\n\t\t\tconst { getSelectedBlock, getSelectedBlockClientId } = select(\n\t\t\t\tblockEditorStore\n\t\t\t) as selectBlockProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tblockId: getSelectedBlockClientId(),\n\t\t\t\tblockContent: getSelectedBlock()?.attributes?.content || '',\n\t\t\t};\n\t\t};\n\n\t\t/**\n\t\t * Get AI generated tone.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param {string} newTone AI tone sent to LLM endpoint.\n\t\t * @return {void}\n\t\t */\n\t\tconst getTone = async ( newTone: string ): Promise< void > => {\n\t\t\tconst { postId, blockId, blockContent } = getToneParams();\n\t\t\tconst { createNotice, createErrorNotice, removeNotice } = dispatch(\n\t\t\t\tnoticesStore\n\t\t\t) as any;\n\t\t\tconst { updateBlockAttributes } = dispatch(\n\t\t\t\tblockEditorStore\n\t\t\t) as any;\n\t\t\tconst { getNotices } = select( noticesStore ) as noticeProps;\n\n\t\t\tcreateNotice(\n\t\t\t\t'success',\n\t\t\t\t__(\n\t\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\tid: 'apbe-tone-success',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\tconst aiTone: string = await apiFetch( {\n\t\t\t\t\tpath: '/ai-plus-block-editor/v1/tone',\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tid: postId,\n\t\t\t\t\t\ttext: blockContent?.text || blockContent,\n\t\t\t\t\t\tnewTone,\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tlet limit = 1;\n\t\t\t\tconst displayWithEffect = setInterval( () => {\n\t\t\t\t\tif ( aiTone.length === limit ) {\n\t\t\t\t\t\tclearInterval( displayWithEffect );\n\t\t\t\t\t}\n\t\t\t\t\tupdateBlockAttributes( blockId, {\n\t\t\t\t\t\tcontent: aiTone.substring( 0, limit ),\n\t\t\t\t\t} );\n\t\t\t\t\tlimit++;\n\t\t\t\t}, 5 );\n\n\t\t\t\tgetNotices().forEach( ( notice: any ) =>\n\t\t\t\t\tremoveNotice( notice.id )\n\t\t\t\t);\n\t\t\t} catch ( e ) {\n\t\t\t\tcreateErrorNotice( e.message, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\ticon={ verse }\n\t\t\t\t\t\t\tlabel={ __( 'AI + Block Editor' ) }\n\t\t\t\t\t\t\tcontrols={ getBlockMenuOptions( getTone ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t\t{ edit( props ) }\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn settings;\n};\n\naddFilter( 'blocks.registerBlockType', 'apbe/ai', filterBlockTypesWithAI );\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextareaControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Summary.\n *\n * This Component returns the Summary\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} Summary.\n */\nconst Summary = (): JSX.Element => {\n\tconst [ summary, setSummary ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postSummary, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostSummary: getEditedPostAttribute( 'meta' )?.apbe_summary,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetSummary( postSummary );\n\t}, [ postSummary ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiSummary: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'summary',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated summary when the Animation\n\t\t\t * responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiSummary.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiSummary );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSummary( aiSummary.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newSummary ) => {\n\t\t\t\teditPost( { excerpt: newSummary } );\n\t\t\t\teditPost( { meta: { apbe_summary: newSummary } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Summary. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { excerpt: summary } );\n\t\teditPost( { meta: { apbe_summary: summary } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>{ __( 'Summary', 'ai-plus-block-editor' ) }</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 4 }\n\t\t\t\tvalue={ summary }\n\t\t\t\tonChange={ ( text ) => setSummary( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Summary;\n","module.exports = window[\"wp\"][\"plugins\"];","module.exports = window[\"wp\"][\"editPost\"];","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst check = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z\"\n}));\nexport default check;\n//# sourceMappingURL=check.js.map","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"apiFetch\"];","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Slug.\n *\n * This Component returns the Slug\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} Slug.\n */\nconst Slug = (): JSX.Element => {\n\tconst [ slug, setSlug ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postSlug, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostSlug: getEditedPostAttribute( 'meta' )?.apbe_slug,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetSlug( postSlug );\n\t}, [ postSlug ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiSlug: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'slug',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated slug when the Animation responsible\n\t\t\t * for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiSlug.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiSlug );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSlug( aiSlug.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newSlug ) => {\n\t\t\t\teditPost( { slug: newSlug } );\n\t\t\t\teditPost( { meta: { apbe_slug: newSlug } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Slug. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { slug } );\n\t\teditPost( { meta: { apbe_slug: slug } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>{ __( 'Slug', 'ai-plus-block-editor' ) }</strong>\n\t\t\t</p>\n\t\t\t<TextControl\n\t\t\t\tplaceholder=\"your-article-slug\"\n\t\t\t\tvalue={ slug }\n\t\t\t\tonChange={ ( text ) => setSlug( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Slug;\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n export default content && content.locals ? content.locals : undefined;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"hooks\"];","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","module.exports = window[\"wp\"][\"notices\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"i18n\"];","export const editorStore = 'core/editor';\nexport const noticesStore = 'core/notices';\nexport const blockEditorStore = 'core/block-editor';\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\nconst verse = createElement(SVG, {\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, createElement(Path, {\n d: \"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z\"\n}));\nexport default verse;\n//# sourceMappingURL=verse.js.map","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextareaControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * SEO.\n *\n * This Component returns the SEO keywords,\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} SEO Keywords.\n */\nconst SEO = (): JSX.Element => {\n\tconst [ keywords, setKeywords ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postKeywords, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostKeywords:\n\t\t\t\t\tgetEditedPostAttribute( 'meta' )?.apbe_seo_keywords,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetKeywords( postKeywords );\n\t}, [ postKeywords ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiKeywords: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'keywords',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated SEO keywords when the Animation\n\t\t\t * responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiKeywords.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiKeywords );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetKeywords( aiKeywords.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newKeywords ) => {\n\t\t\t\teditPost( { meta: { apbe_seo_keywords: newKeywords } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch SEO Keywords. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { meta: { apbe_seo_keywords: keywords } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>\n\t\t\t\t\t{ __( 'SEO Keywords', 'ai-plus-block-editor' ) }\n\t\t\t\t</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 7 }\n\t\t\t\tvalue={ keywords }\n\t\t\t\tonChange={ ( text ) => setKeywords( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default SEO;\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, Icon, TextareaControl } from '@wordpress/components';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Headline.\n *\n * This Component returns the Headline\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} Headline.\n */\nconst Headline = (): JSX.Element => {\n\tconst [ headline, setHeadline ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postHeadline, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostHeadline: getEditedPostAttribute( 'meta' )?.apbe_headline,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetHeadline( postHeadline );\n\t}, [ postHeadline ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst response: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'headline',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\tconst aiHeadline = response.trim().replace( /^\"|\"$/g, '' );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated headline when the Animation\n\t\t\t * responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiHeadline.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiHeadline );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetHeadline( aiHeadline.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newHeadline ) => {\n\t\t\t\teditPost( { meta: { apbe_headline: newHeadline } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Headline. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\tlet limit = 1;\n\n\t\t/**\n\t\t * This function returns a promise that\n\t\t * resolves to the headline when the Animation responsible\n\t\t * for showing the headline is completed.\n\t\t *\n\t\t * @since 1.2.0\n\t\t *\n\t\t * @return { Promise<string> } Animated text.\n\t\t */\n\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\tif ( limit === headline.length ) {\n\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\tresolve( headline );\n\t\t\t\t\t}\n\t\t\t\t\teditPost( { title: headline.substring( 0, limit ) } );\n\t\t\t\t\tlimit++;\n\t\t\t\t}, 5 );\n\t\t\t} );\n\t\t};\n\n\t\tshowAnimatedAiText().then( ( newHeadline ) => {\n\t\t\teditPost( { meta: { apbe_headline: newHeadline } } );\n\t\t\tsavePost();\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>{ __( 'Headline', 'ai-plus-block-editor' ) }</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 4 }\n\t\t\t\tvalue={ headline }\n\t\t\t\tonChange={ ( text ) => setHeadline( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Headline;\n","import { __ } from '@wordpress/i18n';\nimport { verse } from '@wordpress/icons';\nimport { Fragment } from '@wordpress/element';\nimport { PanelBody } from '@wordpress/components';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';\n\nimport { SEO, Slug, Summary, Headline, Switcher, Social } from '../components';\n\nimport '../styles/app.scss';\n\n/**\n * AI SideBar.\n *\n * This function returns a JSX component that comprises\n * the Plugin's Sidebar and controls.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} AI SideBar.\n */\nconst AiSideBar = (): JSX.Element => {\n\treturn (\n\t\t<Fragment>\n\t\t\t<PluginSidebarMoreMenuItem icon={ verse } target=\"apbe-sidebar\">\n\t\t\t\t{ __( 'AI + Block Editor', 'ai-plus-block-editor' ) }\n\t\t\t</PluginSidebarMoreMenuItem>\n\t\t\t<PluginSidebar\n\t\t\t\tname=\"apbe-sidebar\"\n\t\t\t\ttitle={ __( 'AI + Block Editor', 'ai-plus-block-editor' ) }\n\t\t\t\ticon={ verse }\n\t\t\t>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<div className=\"apbe-sidebar\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Switcher />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Headline />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Slug />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<SEO />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Summary />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Social />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t</PluginSidebar>\n\t\t</Fragment>\n\t);\n};\n\nregisterPlugin( 'ai-plus-block-editor', { render: AiSideBar } );\n","import { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\nimport { store as noticesStore } from '@wordpress/notices';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Switcher.\n *\n * This Component handles the switching of AI providers,\n * for e.g. Open AI -> Gemini and so on.\n *\n * @since 1.5.0\n *\n * @return {JSX.Element} Switcher.\n */\nconst Switcher = (): JSX.Element => {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst [ provider, setProvider ] = useState< string >( apbe.provider || '' );\n\n\tconst handleChange = async ( value: string ) => {\n\t\tsetProvider( value );\n\n\t\ttry {\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/switcher',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tprovider: value,\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\tcreateNotice(\n\t\t\t\t'success',\n\t\t\t\t__(\n\t\t\t\t\t'Success! AI Provider switched successfully.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\tid: 'apbe-success',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( e ) {\n\t\t\tcreateNotice(\n\t\t\t\t'error',\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to switch AI Provider.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\tid: 'apbe-error',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>\n\t\t\t\t\t{ __( 'Switch AI Provider', 'ai-plus-block-editor' ) }\n\t\t\t\t</strong>\n\t\t\t</p>\n\t\t\t<SelectControl\n\t\t\t\tlabel={ null }\n\t\t\t\tvalue={ provider }\n\t\t\t\toptions={ [\n\t\t\t\t\t{ label: 'ChatGPT', value: 'OpenAI' },\n\t\t\t\t\t{ label: 'Gemini', value: 'Gemini' },\n\t\t\t\t\t{ label: 'DeepSeek', value: 'DeepSeek' },\n\t\t\t\t\t{ label: 'Grok', value: 'Grok' },\n\t\t\t\t] }\n\t\t\t\tonChange={ handleChange }\n\t\t\t\tid=\"switcher\"\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default Switcher;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nc = undefined;"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","social","setSocial","useState","editPost","savePost","useDispatch","createNotice","createErrorNotice","removeNotice","postId","postContent","postSocial","notices","useSelect","select","getNotices","getCurrentPostId","getEditedPostContent","getEditedPostAttribute","apbe_social","useEffect","__","TextareaControl","rows","value","onChange","text","__nextHasNoMarginBottom","className","Button","variant","onClick","forEach","notice","id","isDismissible","aiSocial","path","method","data","feature","limit","Promise","resolve","animatedTextInterval","setInterval","length","clearInterval","substring","showAnimatedAiText","then","newSocial","meta","console","error","message","Icon","icon","module","styleElement","nonce","setAttribute","stylesInDOM","getIndexByIdentifier","identifier","result","i","modulesToDom","list","options","idCountMap","identifiers","item","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","push","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","window","___CSS_LOADER_EXPORT___","getBlockMenuOptions","getTone","menu","applyFilters","casual","official","descriptive","narrative","aggressive","keys","title","getAllowedBlocks","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","addFilter","settings","name","edit","indexOf","BlockControls","ToolbarGroup","ToolbarDropdownMenu","label","controls","newTone","blockId","blockContent","getSelectedBlock","getSelectedBlockClientId","attributes","content","getToneParams","dispatch","updateBlockAttributes","aiTone","displayWithEffect","summary","setSummary","postSummary","apbe_summary","aiSummary","newSummary","excerpt","cssWithMappingToString","toString","this","map","needLayer","join","modules","dedupe","undefined","alreadyImportedModules","_k","createElement","SVG","xmlns","viewBox","Path","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","sourceMapping","slug","setSlug","postSlug","apbe_slug","TextControl","placeholder","__next40pxDefaultSize","aiSlug","newSlug","styleTagTransform","setAttributes","insert","insertStyleElement","locals","element","memo","style","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","getTarget","Error","editorStore","noticesStore","blockEditorStore","apply","parentNode","removeStyleElement","keywords","setKeywords","postKeywords","apbe_seo_keywords","aiKeywords","newKeywords","headline","setHeadline","postHeadline","apbe_headline","aiHeadline","trim","replace","newHeadline","registerPlugin","render","PluginSidebarMoreMenuItem","PluginSidebar","PanelBody","provider","setProvider","apbe","SelectControl","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","prop","nc"],"sourceRoot":""}1 {"version":3,"file":"app.js","mappings":"uCASa,IAAIA,EAAE,EAAQ,KAASC,EAAEC,OAAOC,IAAI,iBAAiBC,EAAEF,OAAOC,IAAI,kBAAkBE,EAAEC,OAAOC,UAAUC,eAAeC,EAAET,EAAEU,mDAAmDC,kBAAkBC,EAAE,CAACC,KAAI,EAAGC,KAAI,EAAGC,QAAO,EAAGC,UAAS,GAChP,SAASC,EAAEC,EAAEC,EAAEC,GAAG,IAAIC,EAAEC,EAAE,CAAC,EAAEC,EAAE,KAAKC,EAAE,KAAiF,IAAIH,UAAhF,IAASD,IAAIG,EAAE,GAAGH,QAAG,IAASD,EAAEN,MAAMU,EAAE,GAAGJ,EAAEN,UAAK,IAASM,EAAEL,MAAMU,EAAEL,EAAEL,KAAcK,EAAEd,EAAEoB,KAAKN,EAAEE,KAAKT,EAAEJ,eAAea,KAAKC,EAAED,GAAGF,EAAEE,IAAI,GAAGH,GAAGA,EAAEQ,aAAa,IAAIL,KAAKF,EAAED,EAAEQ,kBAAe,IAASJ,EAAED,KAAKC,EAAED,GAAGF,EAAEE,IAAI,MAAM,CAACM,SAAS1B,EAAE2B,KAAKV,EAAEL,IAAIU,EAAET,IAAIU,EAAEK,MAAMP,EAAEQ,OAAOrB,EAAEsB,QAAQ,CAACC,EAAQC,SAAS7B,EAAE4B,EAAQE,IAAIjB,EAAEe,EAAQG,KAAKlB,C,6HCW1W,MA6IA,EA7Ie,KACd,MAAQmB,EAA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,EAAoBjQ,EAAKqF,IACxB,IAAIgL,EAAShL,GAAUA,EAAOiL,WAC7B,IAAOjL,EAAiB,QACxB,IAAM,EAEP,OADA4K,EAAoBpP,EAAEwP,EAAQ,CAAE3P,EAAG2P,IAC5BA,GCLRJ,EAAoBpP,EAAI,CAACU,EAASgP,KACjC,IAAI,IAAInQ,KAAOmQ,EACXN,EAAoBO,EAAED,EAAYnQ,KAAS6P,EAAoBO,EAAEjP,EAASnB,IAC5EP,OAAO4Q,eAAelP,EAASnB,EAAK,CAAEsQ,YAAY,EAAMC,IAAKJ,EAAWnQ,MCJ3E6P,EAAoBO,EAAI,CAAChK,EAAKoK,IAAU/Q,OAAOC,UAAUC,eAAeiB,KAAKwF,EAAKoK,GCAlFX,EAAoBY,QAAKpF,E","sources":["webpack://ai-plus-block-editor/./node_modules/react/cjs/react-jsx-runtime.production.min.js","webpack://ai-plus-block-editor/./src/components/Social.tsx","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js","webpack://ai-plus-block-editor/external window [\"wp\",\"element\"]","webpack://ai-plus-block-editor/./src/styles/app.scss","webpack://ai-plus-block-editor/./src/utils/index.tsx","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/styleTagTransform.js","webpack://ai-plus-block-editor/external window [\"wp\",\"data\"]","webpack://ai-plus-block-editor/./src/core/AiTone.tsx","webpack://ai-plus-block-editor/./src/components/Summary.tsx","webpack://ai-plus-block-editor/external window [\"wp\",\"plugins\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"editPost\"]","webpack://ai-plus-block-editor/./node_modules/css-loader/dist/runtime/api.js","webpack://ai-plus-block-editor/./node_modules/@wordpress/icons/build-module/library/check.js","webpack://ai-plus-block-editor/./node_modules/css-loader/dist/runtime/sourceMaps.js","webpack://ai-plus-block-editor/external window [\"wp\",\"components\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"apiFetch\"]","webpack://ai-plus-block-editor/./src/components/Slug.tsx","webpack://ai-plus-block-editor/./src/styles/app.scss?4dc7","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/insertStyleElement.js","webpack://ai-plus-block-editor/external window [\"wp\",\"primitives\"]","webpack://ai-plus-block-editor/external window \"React\"","webpack://ai-plus-block-editor/external window [\"wp\",\"hooks\"]","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/insertBySelector.js","webpack://ai-plus-block-editor/external window [\"wp\",\"notices\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"blockEditor\"]","webpack://ai-plus-block-editor/external window [\"wp\",\"i18n\"]","webpack://ai-plus-block-editor/./src/utils/store.ts","webpack://ai-plus-block-editor/./node_modules/style-loader/dist/runtime/styleDomAPI.js","webpack://ai-plus-block-editor/./node_modules/@wordpress/icons/build-module/library/verse.js","webpack://ai-plus-block-editor/./node_modules/react/jsx-runtime.js","webpack://ai-plus-block-editor/./src/components/SEO.tsx","webpack://ai-plus-block-editor/./src/components/Headline.tsx","webpack://ai-plus-block-editor/./src/core/AiSideBar.tsx","webpack://ai-plus-block-editor/./src/components/Switcher.tsx","webpack://ai-plus-block-editor/webpack/bootstrap","webpack://ai-plus-block-editor/webpack/runtime/compat get default export","webpack://ai-plus-block-editor/webpack/runtime/define property getters","webpack://ai-plus-block-editor/webpack/runtime/hasOwnProperty shorthand","webpack://ai-plus-block-editor/webpack/runtime/nonce"],"sourcesContent":["/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextareaControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Social.\n *\n * This Component returns the Social media\n * trending hash-tags & keywords.\n *\n * @since 1.5.0\n *\n * @return {JSX.Element} Social Hashtags.\n */\nconst Social = (): JSX.Element => {\n\tconst [ social, setSocial ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postSocial, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostSocial: getEditedPostAttribute( 'meta' )?.apbe_social,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetSocial( postSocial );\n\t}, [ postSocial ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiSocial: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'social',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated social media hashtags and keywords\n\t\t\t * when the Animation responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.5.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiSocial.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiSocial );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSocial( aiSocial.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newSocial ) => {\n\t\t\t\teditPost( { meta: { apbe_social: newSocial } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Hashtags. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.5.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { meta: { apbe_social: social } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>\n\t\t\t\t\t{ __( 'Social Media Hashtags', 'ai-plus-block-editor' ) }\n\t\t\t\t</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 4 }\n\t\t\t\tvalue={ social }\n\t\t\t\tonChange={ ( text ) => setSocial( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Social;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","module.exports = window[\"wp\"][\"element\"];","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.apbe-toast{position:fixed;background:#000;color:#fff;bottom:-50px;opacity:0;left:15px;padding:20px;border-radius:5px;font-size:13px;z-index:1;box-shadow:0 0 15px rgba(0,0,0,.1);animation:slideUp .5s ease-out forwards}.apbe-sidebar p{margin-top:0 !important;margin-bottom:7.5px !important}.apbe-sidebar button{height:auto;padding:11.5px 15px;justify-content:center}.apbe-sidebar ul{margin:0;padding:0;display:flex;flex-direction:column}.apbe-sidebar ul li{padding:0 0 22.5px 0;margin:0}.apbe-sidebar ul li:first-child{padding-top:0}.apbe-button-group{display:flex;justify-content:space-between;margin-top:8.5px}.apbe-button-group button{height:38px;border-radius:3px}.apbe-button-group button.is-secondary{padding-left:9px;padding-right:9px}@keyframes slideUp{to{bottom:40px;opacity:1}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/styles/app.scss\"],\"names\":[],\"mappings\":\"AACC,YACC,cAAA,CACA,eAAA,CACA,UAAA,CACA,YAAA,CACA,SAAA,CACA,SAAA,CACA,YAAA,CACA,iBAAA,CACA,cAAA,CACA,SAAA,CACA,kCAAA,CACE,uCAAA,CAIF,gBACC,uBAAA,CACA,8BAAA,CAGD,qBACC,WAAA,CACA,mBAAA,CACA,sBAAA,CAGD,iBACC,QAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CAEA,oBACC,oBAAA,CACA,QAAA,CAEA,gCACC,aAAA,CAOH,mBACC,YAAA,CACA,6BAAA,CACA,gBAAA,CAEA,0BACC,WAAA,CACA,iBAAA,CAEA,uCACC,gBAAA,CACA,iBAAA,CAOL,mBACE,GACD,WAAA,CACG,SAAA,CAAA\",\"sourcesContent\":[\".apbe {\\n\\t&-toast {\\n\\t\\tposition: fixed;\\n\\t\\tbackground: #000;\\n\\t\\tcolor: #FFF;\\n\\t\\tbottom: -50px;\\n\\t\\topacity: 0;\\n\\t\\tleft: 15px;\\n\\t\\tpadding: 20px;\\n\\t\\tborder-radius: 5px;\\n\\t\\tfont-size: 13px;\\n\\t\\tz-index: 1;\\n\\t\\tbox-shadow: 0 0 15px rgba(0, 0, 0, 0.1);\\n \\t\\tanimation: slideUp 0.5s ease-out forwards;\\n\\t}\\n\\n\\t&-sidebar {\\n\\t\\tp {\\n\\t\\t\\tmargin-top: 0 !important;\\n\\t\\t\\tmargin-bottom: 7.5px !important;\\n\\t\\t}\\n\\n\\t\\tbutton {\\n\\t\\t\\theight: auto;\\n\\t\\t\\tpadding: 11.5px 15px;\\n\\t\\t\\tjustify-content: center;\\n\\t\\t}\\n\\n\\t\\tul {\\n\\t\\t\\tmargin: 0;\\n\\t\\t\\tpadding: 0;\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tflex-direction: column;\\n\\n\\t\\t\\tli {\\n\\t\\t\\t\\tpadding: 0 0 22.5px 0;\\n\\t\\t\\t\\tmargin: 0;\\n\\n\\t\\t\\t\\t&:first-child {\\n\\t\\t\\t\\t\\tpadding-top: 0;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t&-button {\\n\\t\\t&-group {\\n\\t\\t\\tdisplay: flex;\\n\\t\\t\\tjustify-content: space-between;\\n\\t\\t\\tmargin-top: 8.5px;\\n\\n\\t\\t\\tbutton {\\n\\t\\t\\t\\theight: 38px;\\n\\t\\t\\t\\tborder-radius: 3px;\\n\\n\\t\\t\\t\\t&.is-secondary {\\n\\t\\t\\t\\t\\tpadding-left: 9px;\\n\\t\\t\\t\\t\\tpadding-right: 9px;\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n}\\n\\n@keyframes slideUp {\\n to {\\n\\tbottom: 40px;\\n opacity: 1;\\n }\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","import { __ } from '@wordpress/i18n';\nimport { applyFilters } from '@wordpress/hooks';\n\ntype DropdownOption = {\n\ttitle: string;\n\tonClick: () => void;\n};\n\n/**\n * Get Options.\n *\n * This function filters the Block Menu AI Options\n * available when the user selects a block.\n *\n * @since 1.1.0\n *\n * @param {Function} getTone Function to get the tone.\n * @return {DropdownOption[]} Dropdown options.\n */\nexport const getBlockMenuOptions = ( getTone: Function ): DropdownOption[] => {\n\tconst menu = [];\n\n\t/**\n\t * Filter Menu Options.\n\t *\n\t * By default the passed object should contain\n\t * menu options.\n\t *\n\t * @since 1.1.0\n\t * @since 1.5.0 Pass in menu options before returning menu.\n\t *\n\t * @param {Object} menu Menu options.\n\t * @return {Object}\n\t */\n\tconst options = applyFilters( 'apbe.blockMenuOptions', {\n\t\tcasual: __( 'Use Casual Tone', 'ai-plus-block-editor' ),\n\t\tofficial: __( 'Use Official Tone', 'ai-plus-block-editor' ),\n\t\tdescriptive: __( 'Use Descriptive Tone', 'ai-plus-block-editor' ),\n\t\tnarrative: __( 'Use Narrative Tone', 'ai-plus-block-editor' ),\n\t\taggressive: __( 'Use Aggressive Tone', 'ai-plus-block-editor' ),\n\t} );\n\n\tObject.keys( options ).forEach( ( key ) => {\n\t\tmenu.push( {\n\t\t\ttitle: options[ key ],\n\t\t\tonClick: () => {\n\t\t\t\tgetTone( key );\n\t\t\t},\n\t\t} );\n\t} );\n\n\treturn menu;\n};\n\n/**\n * Get Allowed Blocks.\n *\n * This function filters the allowed blocks\n * available to the AI tone feature.\n *\n * @since 1.4.0\n *\n * @return {string[]} Allowed blocks.\n */\nexport const getAllowedBlocks = (): string[] => {\n\tconst allowedBlocks = [ 'core/paragraph' ];\n\n\t/**\n\t * Filter Allowed Blocks.\n\t *\n\t * By default the passed option should contain\n\t * allowed blocks.\n\t *\n\t * @since 1.4.0\n\t *\n\t * @param {string[]} allowedBlocks Allowed blocks array.\n\t * @return {string[]}\n\t */\n\treturn applyFilters( 'apbe.allowedBlocks', allowedBlocks ) as string[];\n};\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","module.exports = window[\"wp\"][\"data\"];","import { __ } from '@wordpress/i18n';\nimport { verse } from '@wordpress/icons';\nimport { addFilter } from '@wordpress/hooks';\nimport { BlockControls } from '@wordpress/block-editor';\nimport { select, dispatch } from '@wordpress/data';\nimport { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps, selectBlockProps, noticeProps } from '../utils/types';\nimport { getAllowedBlocks, getBlockMenuOptions } from '../utils';\nimport { editorStore, noticesStore, blockEditorStore } from '../utils/store';\n\nimport '../styles/app.scss';\n\n/**\n * Filter Blocks with AI.\n *\n * @since 1.0.0\n *\n * @param {Object} settings Original block settings\n * @return {Object} Filtered block settings\n */\nexport const filterBlockTypesWithAI = ( settings: any ): object => {\n\tconst { name, edit } = settings;\n\n\tif ( getAllowedBlocks().indexOf( name ) === -1 ) {\n\t\treturn settings;\n\t}\n\n\tsettings.edit = ( props: any ) => {\n\t\t/**\n\t\t * Get Tone Params.\n\t\t *\n\t\t * This function retrieves the current post ID,\n\t\t * selected block ID, and block content.\n\t\t *\n\t\t * @since 1.4.0\n\t\t * @return {Object} Object containing postId, blockId and blockContent.\n\t\t */\n\t\tconst getToneParams = (): any => {\n\t\t\tconst { getCurrentPostId } = select( editorStore ) as selectProps;\n\t\t\tconst { getSelectedBlock, getSelectedBlockClientId } = select(\n\t\t\t\tblockEditorStore\n\t\t\t) as selectBlockProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tblockId: getSelectedBlockClientId(),\n\t\t\t\tblockContent: getSelectedBlock()?.attributes?.content || '',\n\t\t\t};\n\t\t};\n\n\t\t/**\n\t\t * Get AI generated tone.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param {string} newTone AI tone sent to LLM endpoint.\n\t\t * @return {void}\n\t\t */\n\t\tconst getTone = async ( newTone: string ): Promise< void > => {\n\t\t\tconst { postId, blockId, blockContent } = getToneParams();\n\t\t\tconst { createNotice, createErrorNotice, removeNotice } = dispatch(\n\t\t\t\tnoticesStore\n\t\t\t) as any;\n\t\t\tconst { updateBlockAttributes } = dispatch(\n\t\t\t\tblockEditorStore\n\t\t\t) as any;\n\t\t\tconst { getNotices } = select( noticesStore ) as noticeProps;\n\n\t\t\tcreateNotice(\n\t\t\t\t'success',\n\t\t\t\t__(\n\t\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\tid: 'apbe-tone-success',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\n\t\t\ttry {\n\t\t\t\tconst aiTone: string = await apiFetch( {\n\t\t\t\t\tpath: '/ai-plus-block-editor/v1/tone',\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\tid: postId,\n\t\t\t\t\t\ttext: blockContent?.text || blockContent,\n\t\t\t\t\t\tnewTone,\n\t\t\t\t\t},\n\t\t\t\t} );\n\n\t\t\t\tlet limit = 1;\n\t\t\t\tconst displayWithEffect = setInterval( () => {\n\t\t\t\t\tif ( aiTone.length === limit ) {\n\t\t\t\t\t\tclearInterval( displayWithEffect );\n\t\t\t\t\t}\n\t\t\t\t\tupdateBlockAttributes( blockId, {\n\t\t\t\t\t\tcontent: aiTone.substring( 0, limit ),\n\t\t\t\t\t} );\n\t\t\t\t\tlimit++;\n\t\t\t\t}, 5 );\n\n\t\t\t\tgetNotices().forEach( ( notice: any ) =>\n\t\t\t\t\tremoveNotice( notice.id )\n\t\t\t\t);\n\t\t\t} catch ( e ) {\n\t\t\t\tcreateErrorNotice( e.message, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t} );\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<BlockControls>\n\t\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t\t<ToolbarDropdownMenu\n\t\t\t\t\t\t\ticon={ verse }\n\t\t\t\t\t\t\tlabel={ __( 'AI + Block Editor' ) }\n\t\t\t\t\t\t\tcontrols={ getBlockMenuOptions( getTone ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolbarGroup>\n\t\t\t\t</BlockControls>\n\t\t\t\t{ edit( props ) }\n\t\t\t</>\n\t\t);\n\t};\n\n\treturn settings;\n};\n\naddFilter( 'blocks.registerBlockType', 'apbe/ai', filterBlockTypesWithAI );\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextareaControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Summary.\n *\n * This Component returns the Summary\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} Summary.\n */\nconst Summary = (): JSX.Element => {\n\tconst [ summary, setSummary ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postSummary, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostSummary: getEditedPostAttribute( 'meta' )?.apbe_summary,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetSummary( postSummary );\n\t}, [ postSummary ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiSummary: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'summary',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated summary when the Animation\n\t\t\t * responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiSummary.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiSummary );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSummary( aiSummary.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newSummary ) => {\n\t\t\t\teditPost( { excerpt: newSummary } );\n\t\t\t\teditPost( { meta: { apbe_summary: newSummary } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Summary. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { excerpt: summary } );\n\t\teditPost( { meta: { apbe_summary: summary } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>{ __( 'Summary', 'ai-plus-block-editor' ) }</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 4 }\n\t\t\t\tvalue={ summary }\n\t\t\t\tonChange={ ( text ) => setSummary( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Summary;\n","module.exports = window[\"wp\"][\"plugins\"];","module.exports = window[\"wp\"][\"editPost\"];","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\nconst check = createElement(SVG, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, createElement(Path, {\n d: \"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z\"\n}));\nexport default check;\n//# sourceMappingURL=check.js.map","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","module.exports = window[\"wp\"][\"components\"];","module.exports = window[\"wp\"][\"apiFetch\"];","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Slug.\n *\n * This Component returns the Slug\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} Slug.\n */\nconst Slug = (): JSX.Element => {\n\tconst [ slug, setSlug ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postSlug, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostSlug: getEditedPostAttribute( 'meta' )?.apbe_slug,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetSlug( postSlug );\n\t}, [ postSlug ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiSlug: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'slug',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated slug when the Animation responsible\n\t\t\t * for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiSlug.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiSlug );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetSlug( aiSlug.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newSlug ) => {\n\t\t\t\teditPost( { slug: newSlug } );\n\t\t\t\teditPost( { meta: { apbe_slug: newSlug } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Slug. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { slug } );\n\t\teditPost( { meta: { apbe_slug: slug } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>{ __( 'Slug', 'ai-plus-block-editor' ) }</strong>\n\t\t\t</p>\n\t\t\t<TextControl\n\t\t\t\tplaceholder=\"your-article-slug\"\n\t\t\t\tvalue={ slug }\n\t\t\t\tonChange={ ( text ) => setSlug( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t__next40pxDefaultSize\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Slug;\n","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\";\n export default content && content.locals ? content.locals : undefined;\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","module.exports = window[\"wp\"][\"primitives\"];","module.exports = window[\"React\"];","module.exports = window[\"wp\"][\"hooks\"];","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","module.exports = window[\"wp\"][\"notices\"];","module.exports = window[\"wp\"][\"blockEditor\"];","module.exports = window[\"wp\"][\"i18n\"];","export const editorStore = 'core/editor';\nexport const noticesStore = 'core/notices';\nexport const blockEditorStore = 'core/block-editor';\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","import { createElement } from \"react\";\n/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/primitives';\nconst verse = createElement(SVG, {\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, createElement(Path, {\n d: \"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z\"\n}));\nexport default verse;\n//# sourceMappingURL=verse.js.map","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, TextareaControl, Icon } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * SEO.\n *\n * This Component returns the SEO keywords,\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} SEO Keywords.\n */\nconst SEO = (): JSX.Element => {\n\tconst [ keywords, setKeywords ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postKeywords, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostKeywords:\n\t\t\t\t\tgetEditedPostAttribute( 'meta' )?.apbe_seo_keywords,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetKeywords( postKeywords );\n\t}, [ postKeywords ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst aiKeywords: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'keywords',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated SEO keywords when the Animation\n\t\t\t * responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiKeywords.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiKeywords );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetKeywords( aiKeywords.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newKeywords ) => {\n\t\t\t\teditPost( { meta: { apbe_seo_keywords: newKeywords } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch SEO Keywords. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\teditPost( { meta: { apbe_seo_keywords: keywords } } );\n\t\tsavePost();\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>\n\t\t\t\t\t{ __( 'SEO Keywords', 'ai-plus-block-editor' ) }\n\t\t\t\t</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 7 }\n\t\t\t\tvalue={ keywords }\n\t\t\t\tonChange={ ( text ) => setKeywords( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default SEO;\n","import { __ } from '@wordpress/i18n';\nimport { check } from '@wordpress/icons';\nimport { useState, useEffect } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { Button, Icon, TextareaControl } from '@wordpress/components';\nimport apiFetch from '@wordpress/api-fetch';\n\nimport { selectProps } from '../utils/types';\nimport { editorStore } from '../utils/store';\n\n/**\n * Headline.\n *\n * This Component returns the Headline\n * label and button.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} Headline.\n */\nconst Headline = (): JSX.Element => {\n\tconst [ headline, setHeadline ] = useState( '' );\n\tconst { editPost, savePost } = useDispatch( editorStore ) as any;\n\tconst { createNotice, createErrorNotice, removeNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { postId, postContent, postHeadline, notices } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getNotices } = select( noticesStore );\n\t\t\tconst {\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tgetEditedPostContent,\n\t\t\t\tgetEditedPostAttribute,\n\t\t\t} = select( editorStore ) as selectProps;\n\n\t\t\treturn {\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tpostContent: getEditedPostContent(),\n\t\t\t\tpostHeadline: getEditedPostAttribute( 'meta' )?.apbe_headline,\n\t\t\t\tnotices: getNotices(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tsetHeadline( postHeadline );\n\t}, [ postHeadline ] );\n\n\t/**\n\t * This function fires when the user clicks\n\t * the `Generate` button.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleClick = async (): Promise< void > => {\n\t\tnotices.forEach( ( notice ) => removeNotice( notice.id ) );\n\t\tcreateNotice(\n\t\t\t'info',\n\t\t\t__(\n\t\t\t\t'AI is generating text, please hold on for a bit.',\n\t\t\t\t'ai-plus-block-editor'\n\t\t\t),\n\t\t\t{\n\t\t\t\tisDismissible: true,\n\t\t\t\tid: 'apbe-info',\n\t\t\t\ttype: 'snackbar',\n\t\t\t}\n\t\t);\n\n\t\ttry {\n\t\t\tconst response: string = await apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/sidebar',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tid: postId,\n\t\t\t\t\ttext: postContent?.text || postContent,\n\t\t\t\t\tfeature: 'headline',\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\tconst aiHeadline = response.trim().replace( /^\"|\"$/g, '' );\n\n\t\t\t/**\n\t\t\t * This function returns a promise that resolves\n\t\t\t * to the AI generated headline when the Animation\n\t\t\t * responsible for showing same is completed.\n\t\t\t *\n\t\t\t * @since 1.2.0\n\t\t\t *\n\t\t\t * @return { Promise<string> } Animated text.\n\t\t\t */\n\t\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\t\tlet limit = 1;\n\n\t\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\t\tif ( aiHeadline.length === limit ) {\n\t\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\t\tresolve( aiHeadline );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetHeadline( aiHeadline.substring( 0, limit ) );\n\t\t\t\t\t\tlimit++;\n\t\t\t\t\t}, 5 );\n\t\t\t\t} );\n\t\t\t};\n\n\t\t\tshowAnimatedAiText().then( ( newHeadline ) => {\n\t\t\t\teditPost( { meta: { apbe_headline: newHeadline } } );\n\t\t\t} );\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t} catch ( e ) {\n\t\t\tremoveNotice( 'apbe-info' );\n\t\t\tcreateErrorNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to fetch Headline. Please check your error logs or console for more info.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t)\n\t\t\t);\n\t\t\t// eslint-disable-next-line\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\t/**\n\t * This function fires when the user selects\n\t * the AI generated result.\n\t *\n\t * @since 1.1.0\n\t *\n\t * @return { void }\n\t */\n\tconst handleSelection = (): void => {\n\t\tlet limit = 1;\n\n\t\t/**\n\t\t * This function returns a promise that\n\t\t * resolves to the headline when the Animation responsible\n\t\t * for showing the headline is completed.\n\t\t *\n\t\t * @since 1.2.0\n\t\t *\n\t\t * @return { Promise<string> } Animated text.\n\t\t */\n\t\tconst showAnimatedAiText = (): Promise< string > => {\n\t\t\treturn new Promise( ( resolve ) => {\n\t\t\t\tconst animatedTextInterval = setInterval( () => {\n\t\t\t\t\tif ( limit === headline.length ) {\n\t\t\t\t\t\tclearInterval( animatedTextInterval );\n\t\t\t\t\t\tresolve( headline );\n\t\t\t\t\t}\n\t\t\t\t\teditPost( { title: headline.substring( 0, limit ) } );\n\t\t\t\t\tlimit++;\n\t\t\t\t}, 5 );\n\t\t\t} );\n\t\t};\n\n\t\tshowAnimatedAiText().then( ( newHeadline ) => {\n\t\t\teditPost( { meta: { apbe_headline: newHeadline } } );\n\t\t\tsavePost();\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>{ __( 'Headline', 'ai-plus-block-editor' ) }</strong>\n\t\t\t</p>\n\t\t\t<TextareaControl\n\t\t\t\trows={ 4 }\n\t\t\t\tvalue={ headline }\n\t\t\t\tonChange={ ( text ) => setHeadline( text ) }\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t\t<div className=\"apbe-button-group\">\n\t\t\t\t<Button variant=\"primary\" onClick={ handleClick }>\n\t\t\t\t\t{ __( 'Generate', 'ai-plus-block-editor' ) }\n\t\t\t\t</Button>\n\t\t\t\t<Button variant=\"secondary\" onClick={ handleSelection }>\n\t\t\t\t\t<Icon icon={ check } />\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</>\n\t);\n};\n\nexport default Headline;\n","import { __ } from '@wordpress/i18n';\nimport { verse } from '@wordpress/icons';\nimport { Fragment } from '@wordpress/element';\nimport { PanelBody } from '@wordpress/components';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { PluginSidebar, PluginSidebarMoreMenuItem } from '@wordpress/edit-post';\n\nimport { SEO, Slug, Summary, Headline, Switcher, Social } from '../components';\n\nimport '../styles/app.scss';\n\n/**\n * AI SideBar.\n *\n * This function returns a JSX component that comprises\n * the Plugin's Sidebar and controls.\n *\n * @since 1.1.0\n *\n * @return {JSX.Element} AI SideBar.\n */\nconst AiSideBar = (): JSX.Element => {\n\treturn (\n\t\t<Fragment>\n\t\t\t<PluginSidebarMoreMenuItem icon={ verse } target=\"apbe-sidebar\">\n\t\t\t\t{ __( 'AI + Block Editor', 'ai-plus-block-editor' ) }\n\t\t\t</PluginSidebarMoreMenuItem>\n\t\t\t<PluginSidebar\n\t\t\t\tname=\"apbe-sidebar\"\n\t\t\t\ttitle={ __( 'AI + Block Editor', 'ai-plus-block-editor' ) }\n\t\t\t\ticon={ verse }\n\t\t\t>\n\t\t\t\t<PanelBody>\n\t\t\t\t\t<div className=\"apbe-sidebar\">\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Switcher />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Headline />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Slug />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<SEO />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Summary />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<Social />\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</PanelBody>\n\t\t\t</PluginSidebar>\n\t\t</Fragment>\n\t);\n};\n\nregisterPlugin( 'ai-plus-block-editor', { render: AiSideBar } );\n","import { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { SelectControl } from '@wordpress/components';\nimport { store as noticesStore } from '@wordpress/notices';\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Switcher.\n *\n * This Component handles the switching of AI providers,\n * for e.g. Open AI -> Gemini and so on.\n *\n * @since 1.5.0\n *\n * @return {JSX.Element} Switcher.\n */\nconst Switcher = (): JSX.Element => {\n\tconst { createNotice } = useDispatch( noticesStore );\n\tconst [ provider, setProvider ] = useState< string >( apbe.provider || '' );\n\n\tconst handleChange = async ( value: string ) => {\n\t\tsetProvider( value );\n\n\t\ttry {\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: '/ai-plus-block-editor/v1/switcher',\n\t\t\t\tmethod: 'POST',\n\t\t\t\tdata: {\n\t\t\t\t\tprovider: value,\n\t\t\t\t},\n\t\t\t} );\n\n\t\t\tcreateNotice(\n\t\t\t\t'success',\n\t\t\t\t__(\n\t\t\t\t\t'Success! AI Provider switched successfully.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\tid: 'apbe-success',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t} catch ( e ) {\n\t\t\tcreateNotice(\n\t\t\t\t'error',\n\t\t\t\t__(\n\t\t\t\t\t'Error! Failed to switch AI Provider.',\n\t\t\t\t\t'ai-plus-block-editor'\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\tid: 'apbe-error',\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.error( e.message );\n\t\t}\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<p>\n\t\t\t\t<strong>\n\t\t\t\t\t{ __( 'Switch AI Provider', 'ai-plus-block-editor' ) }\n\t\t\t\t</strong>\n\t\t\t</p>\n\t\t\t<SelectControl\n\t\t\t\tlabel={ null }\n\t\t\t\tvalue={ provider }\n\t\t\t\toptions={ apbe?.providers || [] }\n\t\t\t\tonChange={ handleChange }\n\t\t\t\tid=\"switcher\"\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t/>\n\t\t</>\n\t);\n};\n\nexport default Switcher;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","__webpack_require__.nc = undefined;"],"names":["f","k","Symbol","for","l","m","Object","prototype","hasOwnProperty","n","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","ReactCurrentOwner","p","key","ref","__self","__source","q","c","a","g","b","d","e","h","call","defaultProps","$$typeof","type","props","_owner","current","exports","Fragment","jsx","jsxs","social","setSocial","useState","editPost","savePost","useDispatch","createNotice","createErrorNotice","removeNotice","postId","postContent","postSocial","notices","useSelect","select","getNotices","getCurrentPostId","getEditedPostContent","getEditedPostAttribute","apbe_social","useEffect","__","TextareaControl","rows","value","onChange","text","__nextHasNoMarginBottom","className","Button","variant","onClick","forEach","notice","id","isDismissible","aiSocial","path","method","data","feature","limit","Promise","resolve","animatedTextInterval","setInterval","length","clearInterval","substring","showAnimatedAiText","then","newSocial","meta","console","error","message","Icon","icon","module","styleElement","nonce","setAttribute","stylesInDOM","getIndexByIdentifier","identifier","result","i","modulesToDom","list","options","idCountMap","identifiers","item","base","count","concat","indexByIdentifier","obj","css","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","push","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","window","___CSS_LOADER_EXPORT___","getBlockMenuOptions","getTone","menu","applyFilters","casual","official","descriptive","narrative","aggressive","keys","title","getAllowedBlocks","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","addFilter","settings","name","edit","indexOf","BlockControls","ToolbarGroup","ToolbarDropdownMenu","label","controls","newTone","blockId","blockContent","getSelectedBlock","getSelectedBlockClientId","attributes","content","getToneParams","dispatch","updateBlockAttributes","aiTone","displayWithEffect","summary","setSummary","postSummary","apbe_summary","aiSummary","newSummary","excerpt","cssWithMappingToString","toString","this","map","needLayer","join","modules","dedupe","undefined","alreadyImportedModules","_k","createElement","SVG","xmlns","viewBox","Path","cssMapping","btoa","base64","unescape","encodeURIComponent","JSON","stringify","sourceMapping","slug","setSlug","postSlug","apbe_slug","TextControl","placeholder","__next40pxDefaultSize","aiSlug","newSlug","styleTagTransform","setAttributes","insert","insertStyleElement","locals","element","memo","style","target","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","getTarget","Error","editorStore","noticesStore","blockEditorStore","apply","parentNode","removeStyleElement","keywords","setKeywords","postKeywords","apbe_seo_keywords","aiKeywords","newKeywords","headline","setHeadline","postHeadline","apbe_headline","aiHeadline","trim","replace","newHeadline","registerPlugin","render","PluginSidebarMoreMenuItem","PluginSidebar","PanelBody","provider","setProvider","apbe","SelectControl","providers","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","o","defineProperty","enumerable","get","prop","nc"],"sourceRoot":""} -
ai-plus-block-editor/trunk/inc/Abstracts/Route.php
r3235704 r3376557 96 96 * Get AI Client. 97 97 * 98 * @since TBD98 * @since 1.1.2 99 99 * 100 100 * @param Provider $provider -
ai-plus-block-editor/trunk/inc/Admin/Options.php
r3365021 r3376557 10 10 11 11 namespace AiPlusBlockEditor\Admin; 12 13 use AiPlusBlockEditor\Abstracts\Provider; 12 14 13 15 class Options { … … 132 134 'label' => esc_html__( 'AI Provider', 'ai-plus-block-editor' ), 133 135 'summary' => 'e.g. Open AI (Chat GPT)', 134 'options' => [ 135 'OpenAI' => 'ChatGPT', 136 'Gemini' => 'Gemini', 137 'DeepSeek' => 'DeepSeek', 138 'Grok' => 'Grok', 139 ], 136 'options' => Provider::get_providers(), 140 137 ], 141 138 ], … … 205 202 ], 206 203 ], 204 'claude_options' => [ 205 'heading' => esc_html__( 'Claude', 'ai-plus-block-editor' ), 206 'controls' => [ 207 'claude_enable' => [ 208 'control' => esc_attr( 'checkbox' ), 209 'label' => esc_html__( 'Enable Claude', 'ai-plus-block-editor' ), 210 'summary' => esc_html__( 'Use Claude capabilities in Block Editor', 'ai-plus-block-editor' ), 211 ], 212 'claude_token' => [ 213 'control' => esc_attr( 'password' ), 214 'placeholder' => esc_attr( '' ), 215 'label' => esc_html__( 'API Keys', 'ai-plus-block-editor' ), 216 'summary' => esc_html__( 'e.g. ae2kgch7ib9eqcbeveq9a923nv87392av', 'ai-plus-block-editor' ), 217 ], 218 ], 219 ], 207 220 ]; 208 221 } -
ai-plus-block-editor/trunk/inc/Core/AI.php
r3319323 r3376557 14 14 use AiPlusBlockEditor\Providers\Gemini; 15 15 use AiPlusBlockEditor\Providers\DeepSeek; 16 use AiPlusBlockEditor\Providers\Grok; 17 use AiPlusBlockEditor\Providers\Claude; 18 16 19 use AiPlusBlockEditor\Interfaces\Provider; 17 20 … … 42 45 $ai_provider = DeepSeek::class; 43 46 break; 47 48 case 'Grok': 49 $ai_provider = Grok::class; 50 break; 51 52 case 'Claude': 53 $ai_provider = Claude::class; 54 break; 44 55 } 45 56 … … 54 65 * `get_provider` method. 55 66 * 56 * @since TBD67 * @since 1.1.2 57 68 * 58 69 * @param Provider $provider -
ai-plus-block-editor/trunk/inc/Core/Container.php
r3226770 r3376557 12 12 13 13 use AiPlusBlockEditor\Services\Admin; 14 use AiPlusBlockEditor\Services\Boot; 14 15 use AiPlusBlockEditor\Services\PostMeta; 15 use AiPlusBlockEditor\Services\Boot;16 16 use AiPlusBlockEditor\Services\Routes; 17 17 use AiPlusBlockEditor\Interfaces\Kernel; … … 35 35 static::$services = [ 36 36 Admin::class, 37 Boot::class, 37 38 PostMeta::class, 38 Boot::class,39 39 Routes::class, 40 40 ]; -
ai-plus-block-editor/trunk/inc/Providers/DeepSeek.php
r3319323 r3376557 11 11 namespace AiPlusBlockEditor\Providers; 12 12 13 use AiPlusBlockEditor\Interfaces\Provider;14 13 use AiPlusBlockEditor\Admin\Options; 14 use AiPlusBlockEditor\Abstracts\Provider; 15 use AiPlusBlockEditor\Interfaces\Provider as ProviderInterface; 15 16 16 class DeepSeek implements Provider { 17 class DeepSeek extends Provider implements ProviderInterface { 18 /** 19 * Provider name. 20 * 21 * @since 1.8.0 22 * 23 * @var string 24 */ 25 protected static $name = 'DeepSeek'; 26 17 27 /** 18 28 * Get Default Args. … … 57 67 */ 58 68 protected function get_api_url(): string { 59 $url = esc_url( 'https://api.deepseek.com/chat/completions' );69 $url = 'https://api.deepseek.com/chat/completions'; 60 70 61 71 /** … … 67 77 * @return string 68 78 */ 69 return apply_filters( 'apbe_deepseek_api_url', $url);79 return esc_url( (string) apply_filters( 'apbe_deepseek_api_url', $url ) ); 70 80 } 71 81 … … 97 107 } 98 108 109 /** 110 * Filter DeepSeek System Prompt. 111 * 112 * @since 1.8.0 113 * 114 * @param string $prompt DeepSeek System prompt. 115 * @return string 116 */ 117 $system_prompt = apply_filters( 'apbe_deepseek_system_prompt', 'You are a helpful assistant.' ); 118 99 119 // DeepSeek API expects a specific body structure. 100 120 $body = wp_parse_args( … … 103 123 [ 104 124 'role' => 'system', 105 'content' => 'You are a helpful assistant.',125 'content' => $system_prompt, 106 126 ], 107 127 [ … … 127 147 128 148 if ( is_wp_error( $response ) ) { 129 return $this->get_json_error( $response->get_error_message() );149 return $this->get_json_error( $response->get_error_message(), $body ); 130 150 } 131 151 132 152 $data = json_decode( wp_remote_retrieve_body( $response ), true ); 133 153 134 return $data['choices'][0]['message']['content'] ?? ''; 135 } 154 // Notify user, if JSON yields null. 155 if ( empty( $data ) || ! isset( $data['choices'][0]['message']['content'] ) ) { 156 return $this->get_json_error( 157 $data['error']['message'] ?? __( 'Unexpected DeepSeek API response.', 'ai-plus-block-editor' ), 158 $body 159 ); 160 } 136 161 137 /** 138 * Get JSON Error. 139 * 140 * @since 1.6.0 141 * 142 * @param string $message Error Message. 143 * @return \WP_Error 144 */ 145 protected function get_json_error( $message ) { 146 return new \WP_Error( 147 'ai-plus-block-editor-json-error', 148 $message, 149 [ 'status' => 500 ] 150 ); 162 // Get API response. 163 $response = $data['choices'][0]['message']['content'] ?? ''; 164 165 // Return filtered response. 166 return $this->get_provider_response( $response, wp_json_encode( $body ) ); 151 167 } 152 168 } -
ai-plus-block-editor/trunk/inc/Providers/Gemini.php
r3319323 r3376557 11 11 namespace AiPlusBlockEditor\Providers; 12 12 13 use AiPlusBlockEditor\Interfaces\Provider;14 13 use AiPlusBlockEditor\Admin\Options; 14 use AiPlusBlockEditor\Abstracts\Provider; 15 use AiPlusBlockEditor\Interfaces\Provider as ProviderInterface; 15 16 16 class Gemini implements Provider { 17 class Gemini extends Provider implements ProviderInterface { 18 /** 19 * Provider name. 20 * 21 * @since 1.8.0 22 * 23 * @var string 24 */ 25 protected static $name = 'Gemini'; 26 17 27 /** 18 28 * Get Default Args. … … 57 67 */ 58 68 protected function get_api_url(): string { 59 $url = esc_url( 60 sprintf( 61 'https://generativelanguage.googleapis.com/v1beta/models/%s:generateContent', 62 $this->get_default_args()['model'] ?? '' 63 ) 69 $url = sprintf( 70 'https://generativelanguage.googleapis.com/v1beta/models/%s:generateContent', 71 $this->get_default_args()['model'] ?? '' 64 72 ); 65 73 … … 72 80 * @return string 73 81 */ 74 return apply_filters( 'apbe_gemini_api_url', $url);82 return esc_url( (string) apply_filters( 'apbe_gemini_api_url', $url ) ); 75 83 } 76 84 … … 130 138 131 139 if ( is_wp_error( $response ) ) { 132 return $this->get_json_error( $response->get_error_message() );140 return $this->get_json_error( $response->get_error_message(), $body ); 133 141 } 134 142 135 143 $data = json_decode( wp_remote_retrieve_body( $response ), true ); 136 144 137 if ( isset( $data['error'] ) ) { 138 return $this->get_json_error( $data['error']['message'] ?? 'Unknown Gemini API error.' ); 145 // Notify user, if JSON yields null. 146 if ( empty( $data ) || ! isset( $data['candidates'][0]['content']['parts'][0]['text'] ) ) { 147 return $this->get_json_error( 148 $data['error']['message'] ?? __( 'Unexpected Gemini API response.', 'ai-plus-block-editor' ), 149 $body 150 ); 139 151 } 140 152 141 return $data['candidates'][0]['content']['parts'][0]['text'] ?? '';142 }153 // Get API response. 154 $response = $data['candidates'][0]['content']['parts'][0]['text'] ?? ''; 143 155 144 /** 145 * Get JSON Error. 146 * 147 * @since 1.5.0 148 * 149 * @param string $message Error Message. 150 * @return \WP_Error 151 */ 152 protected function get_json_error( $message ) { 153 return new \WP_Error( 154 'ai-plus-block-editor-json-error', 155 $message, 156 [ 'status' => 500 ] 157 ); 156 // Return filtered response. 157 return $this->get_provider_response( $response, wp_json_encode( $body ) ); 158 158 } 159 159 } -
ai-plus-block-editor/trunk/inc/Providers/Grok.php
r3365021 r3376557 11 11 namespace AiPlusBlockEditor\Providers; 12 12 13 use AiPlusBlockEditor\Interfaces\Provider;14 13 use AiPlusBlockEditor\Admin\Options; 14 use AiPlusBlockEditor\Abstracts\Provider; 15 use AiPlusBlockEditor\Interfaces\Provider as ProviderInterface; 15 16 16 class Grok implements Provider { 17 class Grok extends Provider implements ProviderInterface { 18 /** 19 * Provider name. 20 * 21 * @since 1.8.0 22 * 23 * @var string 24 */ 25 protected static $name = 'Grok'; 26 17 27 /** 18 28 * Get Default Args. … … 53 63 */ 54 64 protected function get_api_url(): string { 55 $url = esc_url( 'https://api.x.ai/v1/chat/completions' );65 $url = 'https://api.x.ai/v1/chat/completions'; 56 66 57 67 /** … … 63 73 * @return string 64 74 */ 65 return apply_filters( 'apbe_grok_api_url', $url);75 return esc_url( (string) apply_filters( 'apbe_grok_api_url', $url ) ); 66 76 } 67 77 … … 105 115 // Grok API expects a specific body structure. 106 116 $body = wp_parse_args( 107 $this->get_default_args(),108 117 [ 109 118 'messages' => [ … … 117 126 ], 118 127 ], 119 ] 128 ], 129 $this->get_default_args(), 120 130 ); 121 131 … … 133 143 134 144 if ( is_wp_error( $response ) ) { 135 return $this->get_json_error( $response->get_error_message() );145 return $this->get_json_error( $response->get_error_message(), $body ); 136 146 } 137 147 … … 141 151 if ( empty( $data ) || ! isset( $data['choices'][0]['message']['content'] ) ) { 142 152 return $this->get_json_error( 143 $data['error']['message'] ?? __( 'Unexpected Grok API response.', 'ai-plus-block-editor' ) 153 $data['error']['message'] ?? __( 'Unexpected Grok API response.', 'ai-plus-block-editor' ), 154 $body 144 155 ); 145 156 } 146 157 147 return $data['choices'][0]['message']['content'] ?? '';148 }158 // Get API response. 159 $response = $data['choices'][0]['message']['content'] ?? ''; 149 160 150 /** 151 * Get JSON Error. 152 * 153 * @since 1.7.0 154 * 155 * @param string $message Error Message. 156 * @return \WP_Error 157 */ 158 protected function get_json_error( $message ) { 159 return new \WP_Error( 160 'ai-plus-block-editor-json-error', 161 $message, 162 [ 'status' => 500 ] 163 ); 161 // Return filtered response. 162 return $this->get_provider_response( $response, wp_json_encode( $body ) ); 164 163 } 165 164 } -
ai-plus-block-editor/trunk/inc/Providers/OpenAI.php
r3316042 r3376557 12 12 13 13 use Orhanerday\OpenAi\OpenAi as ChatGPT; 14 14 15 use AiPlusBlockEditor\Admin\Options; 15 use AiPlusBlockEditor\Interfaces\Provider; 16 use AiPlusBlockEditor\Abstracts\Provider; 17 use AiPlusBlockEditor\Interfaces\Provider as ProviderInterface; 16 18 17 class OpenAI implements Provider { 19 class OpenAI extends Provider implements ProviderInterface { 20 /** 21 * Provider name. 22 * 23 * @since 1.8.0 24 * 25 * @var string 26 */ 27 protected static $name = 'OpenAI'; 28 18 29 /** 19 30 * Get Default Args. … … 87 98 } 88 99 89 $payload = wp_parse_args( [ 'role' => 'user' ], $payload ); 100 /** 101 * Filter OpenAI System Prompt. 102 * 103 * @since 1.8.0 104 * 105 * @param string $prompt OpenAI System prompt. 106 * @return string 107 */ 108 $system_prompt = apply_filters( 'apbe_open_ai_system_prompt', 'You are ChatGPT, a highly intelligent, helpful AI assistant.' ); 109 110 // ChatGPT expects a specific body structure. 111 $body = wp_parse_args( 112 [ 113 'messages' => [ 114 [ 115 'role' => 'system', 116 'content' => $system_prompt, 117 ], 118 [ 119 'role' => 'user', 120 'content' => $prompt_text, 121 ], 122 ], 123 ], 124 $this->get_default_args() 125 ); 90 126 91 127 try { 92 $response = $this->get_client()->chat( 93 wp_parse_args( 94 [ 'messages' => [ $payload ] ], 95 $this->get_default_args() 96 ) 97 ); 128 $response = $this->get_client()->chat( $body ); 98 129 99 $response = json_decode( $response, true ); 130 if ( is_wp_error( $response ) ) { 131 return $this->get_json_error( $response->get_error_message(), $body ); 132 } 133 134 // Get JSON response. 135 $data = json_decode( $response, true ); 100 136 101 137 // Deal gracefully, with API error. 102 if ( isset( $response['error'] ) ) {103 $error_msg = $response['error']['message'] ?? '';104 error_log( $error_msg );105 106 return $this->get_json_error( $error_msg);138 if ( empty( $data ) || isset( $data['error'] ) ) { 139 return $this->get_json_error( 140 $data['error']['message'] ?? __( 'Unexpected OpenAI API response.', 'ai-plus-block-editor' ), 141 $body 142 ); 107 143 } 108 144 } catch ( \Exception $e ) { 109 $error_msg = sprintf( 110 'Error: OpenAI API call failed... %s', 111 $e->getMessage() 145 return $this->get_json_error( 146 sprintf( 147 'Error: OpenAI API call failed... %s', 148 $e->getMessage() 149 ), 150 $body 112 151 ); 113 error_log( $error_msg );114 115 return $this->get_json_error( $error_msg );116 152 } 117 153 118 if ( is_null( $ response) ) {119 $error_msg = 'Error: OpenAI API call returned malformed JSON.';120 error_log( $error_msg );121 122 return $this->get_json_error( $error_msg);154 if ( is_null( $data ) ) { 155 return $this->get_json_error( 156 __( 'Error: OpenAI API call returned malformed JSON.', 'ai-plus-block-editor' ), 157 $body 158 ); 123 159 } 124 160 125 return $response['choices'][0]['message']['content'] ?? '';126 }161 // Get API response. 162 $response = $data['choices'][0]['message']['content'] ?? ''; 127 163 128 /** 129 * Get JSON Error. 130 * 131 * @since 1.0.0 132 * 133 * @param string $message Error Message. 134 * @return \WP_Error 135 */ 136 protected function get_json_error( $message ) { 137 return new \WP_Error( 138 'ai-plus-block-editor-json-error', 139 $message, 140 [ 'status' => 500 ] 141 ); 164 // Return filtered response. 165 return $this->get_provider_response( $response, wp_json_encode( $body ) ); 142 166 } 143 167 } -
ai-plus-block-editor/trunk/inc/Services/Admin.php
r3217971 r3376557 46 46 Options::get_page_slug(), 47 47 [ $this, 'register_options_page' ], 48 'dashicons-superhero', 48 'data:image/svg+xml;base64,' . base64_encode( 49 '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> 50 <path d="M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" /> 51 </svg>' 52 ), 49 53 100 50 54 ); -
ai-plus-block-editor/trunk/inc/Services/Boot.php
r3316042 r3376557 14 14 use AiPlusBlockEditor\Abstracts\Service; 15 15 use AiPlusBlockEditor\Interfaces\Kernel; 16 use AiPlusBlockEditor\Abstracts\Provider; 16 17 17 18 class Boot extends Service implements Kernel { … … 51 52 'apbe', 52 53 [ 53 'provider' => get_option( Options::get_page_option(), [] )['ai_provider'] ?? '', 54 'provider' => get_option( Options::get_page_option(), [] )['ai_provider'] ?? '', 55 'providers' => $this->get_providers(), 54 56 ] 55 57 ); … … 100 102 return $assets; 101 103 } 104 105 /** 106 * Get Providers. 107 * 108 * Return processed array with label and value 109 * key-pairs for block editor use. 110 * 111 * @since 1.8.0 112 * 113 * @return array 114 */ 115 protected function get_providers(): array { 116 $providers = Provider::get_providers(); 117 118 return array_map( 119 function ( $key, $value ) { 120 return [ 121 'label' => $value, 122 'value' => $key, 123 ]; 124 }, 125 array_keys( $providers ), 126 array_values( $providers ), 127 ); 128 } 102 129 } -
ai-plus-block-editor/trunk/readme.txt
r3365034 r3376557 4 4 Requires at least: 6.0 5 5 Tested up to: 6.8 6 Stable tag: 1. 7.16 Stable tag: 1.8.0 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 33 33 Our plugin comes with everything you need to add AI capabilities to your Block Editor. 34 34 35 ✔️ <strong>Support for LLMs</strong> such as <strong>ChatGPT, Gemini, Deepseek, Grok </strong> and a host of others.35 ✔️ <strong>Support for LLMs</strong> such as <strong>ChatGPT, Gemini, Deepseek, Grok, Claude</strong> and a host of others. 36 36 ✔️ <strong>Change Text Tone (casual, official, narrative, and so on...)</strong> in block editor. 37 37 ✔️ <strong>Generate Title/Headline</strong> using AI. … … 68 68 69 69 == Changelog == 70 71 = 1.8.0 = 72 * Feat: Implement Claude AI provider. 73 * Fix: Load missing Grok provider correctly. 74 * Feat: Implement AI provider abstraction. 75 * Refactor: Improve AI providers. 76 * Feat: Enable filtering of AI Switcher options. 77 * Feat: Add error logging capabilities. 78 * Chore: Update plugin menu icon. 79 * Feat: Add custom filters: 80 - `apbe_ai_provider_success_call`. 81 - `apbe_ai_provider_fail_call`. 82 - `apbe_ai_provider_response`. 83 - `apbe_ai_providers`. 84 - `apbe_claude_api_url`. 85 - `apbe_claude_args`. 86 - `apbe_claude_system_prompt`. 87 - `apbe_deepseek_system_prompt`. 88 - `apbe_open_ai_system_prompt`. 89 * Docs: Update README docs. 90 * Test: Update unit tests. 91 * Tested up to WP 6.8.2. 70 92 71 93 = 1.7.1 = -
ai-plus-block-editor/trunk/vendor/autoload.php
r3271395 r3376557 20 20 require_once __DIR__ . '/composer/autoload_real.php'; 21 21 22 return ComposerAutoloaderInit 814ef90cdff375a916f0f768d951d18f::getLoader();22 return ComposerAutoloaderInit77424733094727f7b3216a40ad3d0de2::getLoader(); -
ai-plus-block-editor/trunk/vendor/composer/autoload_real.php
r3217971 r3376557 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 814ef90cdff375a916f0f768d951d18f5 class ComposerAutoloaderInit77424733094727f7b3216a40ad3d0de2 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 814ef90cdff375a916f0f768d951d18f', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInit77424733094727f7b3216a40ad3d0de2', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 814ef90cdff375a916f0f768d951d18f', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInit77424733094727f7b3216a40ad3d0de2', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 814ef90cdff375a916f0f768d951d18f::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInit77424733094727f7b3216a40ad3d0de2::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
ai-plus-block-editor/trunk/vendor/composer/autoload_static.php
r3217971 r3376557 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 814ef90cdff375a916f0f768d951d18f7 class ComposerStaticInit77424733094727f7b3216a40ad3d0de2 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 41 41 { 42 42 return \Closure::bind(function () use ($loader) { 43 $loader->prefixLengthsPsr4 = ComposerStaticInit 814ef90cdff375a916f0f768d951d18f::$prefixLengthsPsr4;44 $loader->prefixDirsPsr4 = ComposerStaticInit 814ef90cdff375a916f0f768d951d18f::$prefixDirsPsr4;45 $loader->classMap = ComposerStaticInit 814ef90cdff375a916f0f768d951d18f::$classMap;43 $loader->prefixLengthsPsr4 = ComposerStaticInit77424733094727f7b3216a40ad3d0de2::$prefixLengthsPsr4; 44 $loader->prefixDirsPsr4 = ComposerStaticInit77424733094727f7b3216a40ad3d0de2::$prefixDirsPsr4; 45 $loader->classMap = ComposerStaticInit77424733094727f7b3216a40ad3d0de2::$classMap; 46 46 47 47 }, null, ClassLoader::class); -
ai-plus-block-editor/trunk/vendor/composer/installed.php
r3365034 r3376557 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' f7468ae6862d0db243eafd7ebf7ed9d4537ad0dc',6 'reference' => 'b33df36c00abb77ece613efa44e5f6eca0a9048d', 7 7 'type' => 'package', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' f7468ae6862d0db243eafd7ebf7ed9d4537ad0dc',16 'reference' => 'b33df36c00abb77ece613efa44e5f6eca0a9048d', 17 17 'type' => 'package', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.