diff --git a/classifai.php b/classifai.php index 427b98352..7fdb60cf0 100644 --- a/classifai.php +++ b/classifai.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/10up/classifai * Update URI: https://classifaiplugin.com * Description: Enhance your WordPress content with Artificial Intelligence and Machine Learning services. - * Version: 2.3.0 + * Version: 2.4.0 * Requires at least: 5.8 * Requires PHP: 7.4 * Author: 10up @@ -87,7 +87,7 @@ classifai_define( 'CLASSIFAI_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /** * Loads the CLASSIFAI PHP autoloader if possible. * - * @return bool True or false if autoloading was successfull. + * @return bool True or false if autoloading was successful. */ function classifai_autoload() { if ( classifai_can_autoload() ) { diff --git a/config.php b/config.php index d7fd1070d..0e7b3c94c 100644 --- a/config.php +++ b/config.php @@ -4,7 +4,7 @@ * declared here instead of a Class. */ -$plugin_version = '2.3.0'; +$plugin_version = '2.4.0'; if ( file_exists( __DIR__ . '/.commit' ) ) { $plugin_version .= '-' . file_get_contents( __DIR__ . '/.commit' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents diff --git a/dist/admin.asset.php b/dist/admin.asset.php index 031371e9e..03ed4cfdc 100644 --- a/dist/admin.asset.php +++ b/dist/admin.asset.php @@ -1 +1 @@ - array(), 'version' => 'b88da674f852dcc57e0e'); + array('wp-i18n'), 'version' => 'c640880b75ab1a186669'); diff --git a/dist/admin.css b/dist/admin.css index d066c8fe7..5fa2b52e9 100644 --- a/dist/admin.css +++ b/dist/admin.css @@ -1,3 +1,3 @@ -:root{--classifai-admin-theme-color:#007cba;--classifai-admin-theme-color--rgb:0,124,186;--classifai-admin-theme-color-darker-10:#006ba1}body.admin-color-light{--classifai-admin-theme-color:#0085ba;--classifai-admin-theme-color--rgb:0,133,186;--classifai-admin-theme-color-darker-10:#0073a1}body.admin-color-modern{--classifai-admin-theme-color:#3858e9;--classifai-admin-theme-color--rgb:56,88,233;--classifai-admin-theme-color-darker-10:#2145e6}body.admin-color-blue{--classifai-admin-theme-color:#096484;--classifai-admin-theme-color--rgb:9,100,132;--classifai-admin-theme-color-darker-10:#07526c}body.admin-color-coffee{--classifai-admin-theme-color:#46403c;--classifai-admin-theme-color--rgb:70,64,60;--classifai-admin-theme-color-darker-10:#383330}body.admin-color-ectoplasm{--classifai-admin-theme-color:#523f6d;--classifai-admin-theme-color--rgb:82,63,109;--classifai-admin-theme-color-darker-10:#46365d}body.admin-color-midnight{--classifai-admin-theme-color:#e14d43;--classifai-admin-theme-color--rgb:225,77,67;--classifai-admin-theme-color-darker-10:#dd382d}body.admin-color-ocean{--classifai-admin-theme-color:#627c83;--classifai-admin-theme-color--rgb:98,124,131;--classifai-admin-theme-color-darker-10:#576e74}body.admin-color-sunrise{--classifai-admin-theme-color:#dd823b;--classifai-admin-theme-color--rgb:221,130,59;--classifai-admin-theme-color-darker-10:#d97426}#classifai-activation-notice{padding:24px}#classifai-activation-notice .classifai-logo{line-height:0}#classifai-activation-notice .classifai-logo img{width:180px}#classifai-activation-notice h3.classifai-activation-message{font-size:1.6em;font-weight:400;line-height:1.3;margin:8px 0 18px}a.classifai-button,input.classifai-button{background:var(--classifai-admin-theme-color);border-color:var(--classifai-admin-theme-color);border-radius:4px;border-style:solid;border-width:1px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;font-style:normal;font-weight:400;padding:8px 16px;text-decoration:none;text-shadow:none;text-transform:uppercase;white-space:nowrap}a.classifai-button:active,a.classifai-button:focus,a.classifai-button:hover,input.classifai-button:active,input.classifai-button:focus,input.classifai-button:hover{background:var(--classifai-admin-theme-color-darker-10);border-color:var(--classifai-admin-theme-color-darker-10);color:#fff}a.classifai-button:focus,input.classifai-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--classifai-admin-theme-color-darker-10)}a.classifai-button:active,input.classifai-button:active{box-shadow:none}a.classifai-button.disabled,a.classifai-button:disabled,input.classifai-button.disabled,input.classifai-button:disabled{background:#9ea3a8;box-shadow:none;color:#fff;cursor:not-allowed}#classifai-header{background-color:#fff;box-shadow:0 10px 10px 0 #f0f0f1;box-sizing:border-box;display:block;left:0;margin-left:-20px;padding:0 10px;position:sticky;right:0;top:0;z-index:1001}@media screen and (max-width:782px){#classifai-header{margin-left:-10px;padding:0 5px}}@media(min-width:601px){body.admin-bar #classifai-header{top:46px}}@media(min-width:783px){body.admin-bar #classifai-header{top:32px}}.classifai-setup-page #classifai-header{position:relative}@media(min-width:601px){body.admin-bar .classifai-setup-page #classifai-header{top:0}}@media(min-width:783px){body.admin-bar .classifai-setup-page #classifai-header{top:0}}#classifai-header .classifai-header-layout{align-items:center;display:flex;justify-content:space-between;padding:18px}#classifai-header #classifai-logo{line-height:0}#classifai-header #classifai-logo img{max-width:180px}#classifai-header #classifai-header-controls{align-items:center;display:flex;flex-direction:row}#classifai-header #classifai-header-controls .header-control-item{align-items:center;cursor:pointer;display:flex;flex-direction:column;justify-content:center;margin-left:24px;outline:none;position:relative}#classifai-header #classifai-header-controls a.classifai-help-links{color:#757575;text-align:center;text-decoration:none}#classifai-header #classifai-header-controls a.classifai-help-links:hover,#classifai-header #classifai-header-controls a.classifai-help-links[aria-expanded=true]{color:var(--classifai-admin-theme-color)}#classifai-header #classifai-header-controls a.classifai-help-links span.control-item-text{display:block}#classifai-header .classifai-help-menu{display:block;width:200px}#classifai-header .classifai-help-menu__menu-item{color:#757575;display:block;padding:8px 12px;text-decoration:none}#classifai-header .classifai-help-menu__menu-item:hover{color:var(--classifai-admin-theme-color)}.admin_page_classifai_setup #classifai-header{box-shadow:none}.classifai-content .classifai-wrap{background-color:#fff;border-radius:4px;margin:0 20px 0 0;padding:24px}.classifai-content .classifai-wrap .form-table td fieldset p{margin-bottom:12px}.classifai-content input[type=password],.classifai-content input[type=text]{font-size:14px;height:38px;margin-bottom:4px}.classifai-content h2.nav-tab-wrapper.classifai-nav-wrapper{border-color:transparent;margin-right:20px;margin-top:20px;padding-top:0}.classifai-content a.nav-tab{background:transparent;border:none;margin-left:0;padding:10px 12px;position:relative}.classifai-content a.nav-tab:after{background:var(--classifai-admin-theme-color);border-radius:3px 3px 0 0;bottom:0;box-shadow:0 4px 10px 3px rgba(var(--classifai-admin-theme-color--rgb),.15);content:"";height:3px;left:0;opacity:0;position:absolute;right:0;transform:scaleX(0);transition:all .3s cubic-bezier(1,0,0,1);will-change:transform,box-shadow,opacity}.classifai-content a.nav-tab.nav-tab-active,.classifai-content a.nav-tab:hover{color:var(--classifai-admin-theme-color);font-weight:600}.classifai-content a.nav-tab.nav-tab-active:after,.classifai-content a.nav-tab:hover:after{opacity:1;transform:scale(1)}.classifai-setup{margin-left:-20px}.classifai-setup__header{align-items:center;background:#fff;border-bottom:1px solid #dcdcde;border-top:1px solid #dcdcde;display:flex;height:60px;justify-content:center}.classifai-setup__step-wrapper{margin:0 16px;max-width:980px;width:100%}.classifai-setup__steps{display:flex;justify-content:space-around}.classifai-setup__step{font-weight:400;padding:8px;position:relative}.classifai-setup__step__label{align-items:center;display:inline-flex;font-size:16px;justify-content:center}.classifai-setup__step__label span.step-count{background:#f0f0f0;border-radius:50%;color:#757575;height:24px;margin-right:8px;min-width:24px;width:24px}.classifai-setup__step__label span.step-count,.classifai-setup__step__label span.step-title{align-items:center;display:inline-flex;justify-content:center}.classifai-setup__step__label a,.classifai-setup__step__label a:active,.classifai-setup__step__label a:focus,.classifai-setup__step__label a:hover{color:#3c434a;display:inherit;text-decoration:none}@media screen and (max-width:480px){.classifai-setup__step__label{font-size:14px}}.classifai-setup__step.is-complete span.step-count{background:var(--classifai-admin-theme-color);color:#fff}.classifai-setup__step.is-active span.step-title{font-weight:600}.classifai-setup__step.is-active span.step-count{background:var(--classifai-admin-theme-color);color:#fff}.classifai-setup__step-divider{align-self:flex-start;border-bottom:1px solid #f0f0f0;flex-grow:1;margin-top:20px}.classifai-setup__step-label{font-size:1.2em}@media screen and (max-width:782px){.classifai-setup{margin-left:-10px}}.classifai-setup__wrapper{margin:0 auto;max-width:1232px}.classifai-setup__content{background-color:#fff;border-radius:4px;box-sizing:border-box;display:block;margin:20px;padding:24px 24px 48px}.classifai-setup__content__row{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.classifai-setup__content__row__column{display:flex;flex-basis:100%;flex-direction:column}.classifai-setup__content__row__column img{max-width:400px;width:100%}@media screen and (min-width:767px){.classifai-setup__content__row__column{flex:1;padding:0 10px}}.classifai-setup__content h1.classifai-setup-heading{font-size:22px;font-weight:600;margin:24px 0;text-align:center}.classifai-setup__content .classifai-setup-image{margin-top:20px;text-align:center}.classifai-setup__content h2.classifai-setup-title{font-size:22px;font-weight:400;margin:0;padding:0}.classifai-setup__content .classifai-step1-content,.classifai-setup__content .classifai-step4-content{margin-top:20px;max-width:400px}.classifai-setup__content .classifai-step2-content{margin:0 auto;max-width:480px}.classifai-setup__content .classifai-setup-footer{margin-top:40px}.classifai-setup__content .classifai-feature-box{margin:40px 0}.classifai-setup__content .classifai-feature-box-title{font-weight:700;text-transform:uppercase}.classifai-setup__content li.classifai-enable-feature{clear:both;display:block;list-style:none;margin-top:14px;width:100%}.classifai-setup__content li.classifai-enable-feature span.dashicons.dashicons-yes-alt{color:#48be1e}.classifai-setup__content li.classifai-enable-feature span.dashicons.dashicons-dismiss{color:#c00}.classifai-setup__content .classifai-feature-box-divider{border:1px solid #ddd}.classifai-setup__content label.classifai-feature-text,.classifai-setup__content span.classifai-feature-text{color:#707070;font-size:14px}.classifai-setup__content span.classifai-feature-text{float:left}.classifai-setup__content .classifai-setup-footer{text-align:right}.classifai-setup__content a.classifai-setup-skip-link{color:#000;font-weight:400;text-decoration:none}.classifai-setup__content .classifai-setup-footer__right{margin-left:40px}@media screen and (max-width:767px){.classifai-setup__content .classifai-step1-content,.classifai-setup__content .classifai-step4-content{margin-top:20px;max-width:100%}.classifai-setup__content h2.classifai-setup-title{text-align:center}}.classifai-step3-content .classifai-setup__content .classifai-setup-form{margin:0 auto;max-width:480px}.classifai-setup__content .classifai-setup-form .classifai-setup-form-field{margin-top:40px}.classifai-setup__content .classifai-setup-form label{display:block;font-weight:700;margin-bottom:20px;text-transform:uppercase}.classifai-setup__content .classifai-setup-form input[type=password],.classifai-setup__content .classifai-setup-form input[type=text]{font-size:14px;height:38px;margin-bottom:4px;width:100%}.classifai-setup__content .classifai-setup-form .classifai-setup-footer{margin-top:40px}.classifai-setup__content .classifai-step3-content{margin:0 auto}.classifai-setup__content .classifai-step3-content .classifai-setup-title{margin-bottom:12px;text-align:center}.classifai-setup__content .classifai-step3-content .classifai-setup-footer,.classifai-setup__content .classifai-step3-content .classifai-setup-form{margin:0 auto;max-width:480px}.classifai-setup__content .classifai-step3-content .classifai-setup-footer{margin-top:40px}.classifai-setup__content .classifai-tabs{display:block}.classifai-setup__content .classifai-tabs.tabs-center{margin:auto auto 24px}.classifai-setup__content .classifai-tabs.tabs-justify{table-layout:fixed;width:100%}.classifai-setup__content .classifai-tabs a.tab{color:#1d2327;cursor:pointer;display:inline-block;font-size:14px;padding:16px 12px;position:relative;text-decoration:none;transform:translateZ(0);transition:all .3s ease;white-space:nowrap}.classifai-setup__content .classifai-tabs a.tab:focus{box-shadow:none}.classifai-setup__content .classifai-tabs a.tab:hover{color:var(--classifai-admin-theme-color)}.classifai-setup__content .classifai-tabs a.tab:after{background:var(--classifai-admin-theme-color);border-radius:3px 3px 0 0;bottom:0;box-shadow:0 4px 10px 3px rgba(var(--classifai-admin-theme-color--rgb),.15);content:"";height:3px;left:0;opacity:0;position:absolute;right:0;transform:scaleX(0);transition:all .3s cubic-bezier(1,0,0,1);will-change:transform,box-shadow,opacity}.classifai-setup__content .classifai-tabs a.tab.active{color:var(--classifai-admin-theme-color);font-weight:600}.classifai-setup__content .classifai-tabs a.tab.active:after{opacity:1;transform:scale(1)}.classifai-setup__content p.classifai-setup-error{color:red;text-align:center}.classifai-setup__content span.classifai-input-description{font-size:12px}.classifai-toggle{cursor:pointer;display:inline-block;text-align:right;width:100%}.classifai-toggle-switch{background:transparent;border:1px solid #1e1e1e;border-radius:9px;box-sizing:border-box;display:inline-block;height:18px;position:relative;transition:background .25s;vertical-align:middle;width:36px}.classifai-toggle-switch:after,.classifai-toggle-switch:before{content:""}.classifai-toggle-switch:before{background:#1e1e1e;border-radius:50%;box-sizing:border-box;display:block;height:12px;left:2px;position:absolute;top:2px;transition:left .25s;width:12px}.classifai-toggle-checkbox:checked+.classifai-toggle-switch{background:var(--classifai-admin-theme-color);border-color:var(--classifai-admin-theme-color)}.classifai-toggle-checkbox:checked+.classifai-toggle-switch:before{background-color:#fff;left:20px}.classifai-toggle-checkbox{position:absolute;visibility:hidden}#classifai-generate-excerpt{position:absolute;right:12px;top:70px} +:root{--classifai-admin-theme-color:#007cba;--classifai-admin-theme-color--rgb:0,124,186;--classifai-admin-theme-color-darker-10:#006ba1}body.admin-color-light{--classifai-admin-theme-color:#0085ba;--classifai-admin-theme-color--rgb:0,133,186;--classifai-admin-theme-color-darker-10:#0073a1}body.admin-color-modern{--classifai-admin-theme-color:#3858e9;--classifai-admin-theme-color--rgb:56,88,233;--classifai-admin-theme-color-darker-10:#2145e6}body.admin-color-blue{--classifai-admin-theme-color:#096484;--classifai-admin-theme-color--rgb:9,100,132;--classifai-admin-theme-color-darker-10:#07526c}body.admin-color-coffee{--classifai-admin-theme-color:#46403c;--classifai-admin-theme-color--rgb:70,64,60;--classifai-admin-theme-color-darker-10:#383330}body.admin-color-ectoplasm{--classifai-admin-theme-color:#523f6d;--classifai-admin-theme-color--rgb:82,63,109;--classifai-admin-theme-color-darker-10:#46365d}body.admin-color-midnight{--classifai-admin-theme-color:#e14d43;--classifai-admin-theme-color--rgb:225,77,67;--classifai-admin-theme-color-darker-10:#dd382d}body.admin-color-ocean{--classifai-admin-theme-color:#627c83;--classifai-admin-theme-color--rgb:98,124,131;--classifai-admin-theme-color-darker-10:#576e74}body.admin-color-sunrise{--classifai-admin-theme-color:#dd823b;--classifai-admin-theme-color--rgb:221,130,59;--classifai-admin-theme-color-darker-10:#d97426}#classifai-activation-notice{padding:24px}#classifai-activation-notice .classifai-logo{line-height:0}#classifai-activation-notice .classifai-logo img{width:180px}#classifai-activation-notice h3.classifai-activation-message{font-size:1.6em;font-weight:400;line-height:1.3;margin:8px 0 18px}a.classifai-button,input.classifai-button{background:var(--classifai-admin-theme-color);border-color:var(--classifai-admin-theme-color);border-radius:4px;border-style:solid;border-width:1px;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-size:14px;font-style:normal;font-weight:400;padding:8px 16px;text-decoration:none;text-shadow:none;text-transform:uppercase;white-space:nowrap}a.classifai-button:active,a.classifai-button:focus,a.classifai-button:hover,input.classifai-button:active,input.classifai-button:focus,input.classifai-button:hover{background:var(--classifai-admin-theme-color-darker-10);border-color:var(--classifai-admin-theme-color-darker-10);color:#fff}a.classifai-button:focus,input.classifai-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--classifai-admin-theme-color-darker-10)}a.classifai-button:active,input.classifai-button:active{box-shadow:none}a.classifai-button.disabled,a.classifai-button:disabled,input.classifai-button.disabled,input.classifai-button:disabled{background:#9ea3a8;box-shadow:none;color:#fff;cursor:not-allowed}#classifai-header{background-color:#fff;box-shadow:0 10px 10px 0 #f0f0f1;box-sizing:border-box;display:block;left:0;margin-left:-20px;padding:0 10px;position:sticky;right:0;top:0;z-index:1001}@media screen and (max-width:782px){#classifai-header{margin-left:-10px;padding:0 5px}}@media(min-width:601px){body.admin-bar #classifai-header{top:46px}}@media(min-width:783px){body.admin-bar #classifai-header{top:32px}}.classifai-setup-page #classifai-header{position:relative}@media(min-width:601px){body.admin-bar .classifai-setup-page #classifai-header{top:0}}@media(min-width:783px){body.admin-bar .classifai-setup-page #classifai-header{top:0}}#classifai-header .classifai-header-layout{align-items:center;display:flex;justify-content:space-between;padding:18px}#classifai-header #classifai-logo{line-height:0}#classifai-header #classifai-logo img{max-width:180px}#classifai-header #classifai-header-controls{align-items:center;display:flex;flex-direction:row}#classifai-header #classifai-header-controls .header-control-item{align-items:center;cursor:pointer;display:flex;flex-direction:column;justify-content:center;margin-left:24px;outline:none;position:relative}#classifai-header #classifai-header-controls a.classifai-help-links{color:#757575;text-align:center;text-decoration:none}#classifai-header #classifai-header-controls a.classifai-help-links:hover,#classifai-header #classifai-header-controls a.classifai-help-links[aria-expanded=true]{color:var(--classifai-admin-theme-color)}#classifai-header #classifai-header-controls a.classifai-help-links span.control-item-text{display:block}#classifai-header .classifai-help-menu{display:block;width:200px}#classifai-header .classifai-help-menu__menu-item{color:#757575;display:block;padding:8px 12px;text-decoration:none}#classifai-header .classifai-help-menu__menu-item:hover{color:var(--classifai-admin-theme-color)}.admin_page_classifai_setup #classifai-header{box-shadow:none}.classifai-content .classifai-wrap{background-color:#fff;border-radius:4px;margin:0 20px 0 0;padding:24px}.classifai-content .classifai-wrap .form-table td fieldset p{margin-bottom:12px}.classifai-content .classifai-wrap textarea{max-width:600px}.classifai-content .classifai-wrap .classifai-input-description{display:block;line-height:1.4;margin-top:8px;max-width:600px}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting{border:1px solid #f0f0f1;display:flex;flex-direction:column;max-width:600px;padding:5px 20px;position:relative}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting:first-child>input,.classifai-content .classifai-wrap .classifai-field-type-prompt-setting:first-child>label{display:none}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting:nth-child(odd){background-color:#f0f0f1}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting label{display:block}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting input,.classifai-content .classifai-wrap .classifai-field-type-prompt-setting textarea{display:block;margin-right:0}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting input[type=text]{width:90%}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting .actions-rows{display:flex;margin:.35em 0 .5em!important}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting .actions-rows a{cursor:pointer;margin-left:8px;text-decoration:none}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting .actions-rows a.action__remove_prompt{color:#b32d2e}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting .actions-rows a:before{color:#a7aaad;content:"|"}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting .actions-rows a:first-child{margin-left:0}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting .actions-rows a:first-child.selected{color:#a7aaad;pointer-events:none}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting .actions-rows a:first-child:before{content:""}.classifai-content .classifai-wrap .classifai-field-type-prompt-setting+button{margin-top:10px}.classifai-content input[type=password],.classifai-content input[type=text]{font-size:14px;height:38px;margin-bottom:4px}.classifai-content h2.nav-tab-wrapper.classifai-nav-wrapper{border-color:transparent;margin-right:20px;margin-top:20px;padding-top:0}.classifai-content a.nav-tab{background:transparent;border:none;margin-left:0;padding:10px 12px;position:relative}.classifai-content a.nav-tab:after{background:var(--classifai-admin-theme-color);border-radius:3px 3px 0 0;bottom:0;box-shadow:0 4px 10px 3px rgba(var(--classifai-admin-theme-color--rgb),.15);content:"";height:3px;left:0;opacity:0;position:absolute;right:0;transform:scaleX(0);transition:all .3s cubic-bezier(1,0,0,1);will-change:transform,box-shadow,opacity}.classifai-content a.nav-tab.nav-tab-active,.classifai-content a.nav-tab:hover{color:var(--classifai-admin-theme-color);font-weight:600}.classifai-content a.nav-tab.nav-tab-active:after,.classifai-content a.nav-tab:hover:after{opacity:1;transform:scale(1)}.classifai-setup{margin-left:-20px}.classifai-setup__header{align-items:center;background:#fff;border-bottom:1px solid #dcdcde;border-top:1px solid #dcdcde;display:flex;height:60px;justify-content:center}.classifai-setup__step-wrapper{margin:0 16px;max-width:980px;width:100%}.classifai-setup__steps{display:flex;justify-content:space-around}.classifai-setup__step{font-weight:400;padding:8px;position:relative}.classifai-setup__step__label{align-items:center;display:inline-flex;font-size:16px;justify-content:center}.classifai-setup__step__label span.step-count{background:#f0f0f0;border-radius:50%;color:#757575;height:24px;margin-right:8px;min-width:24px;width:24px}.classifai-setup__step__label span.step-count,.classifai-setup__step__label span.step-title{align-items:center;display:inline-flex;justify-content:center}.classifai-setup__step__label a,.classifai-setup__step__label a:active,.classifai-setup__step__label a:focus,.classifai-setup__step__label a:hover{color:#3c434a;display:inherit;text-decoration:none}@media screen and (max-width:480px){.classifai-setup__step__label{font-size:14px}}.classifai-setup__step.is-complete span.step-count{background:var(--classifai-admin-theme-color);color:#fff}.classifai-setup__step.is-active span.step-title{font-weight:600}.classifai-setup__step.is-active span.step-count{background:var(--classifai-admin-theme-color);color:#fff}.classifai-setup__step-divider{align-self:flex-start;border-bottom:1px solid #f0f0f0;flex-grow:1;margin-top:20px}.classifai-setup__step-label{font-size:1.2em}@media screen and (max-width:782px){.classifai-setup{margin-left:-10px}}.classifai-setup__wrapper{margin:0 auto;max-width:1232px}.classifai-setup__content{background-color:#fff;border-radius:4px;box-sizing:border-box;display:block;margin:20px;padding:24px 24px 48px}.classifai-setup__content__row{display:flex;flex-direction:row;flex-wrap:wrap;width:100%}.classifai-setup__content__row__column{display:flex;flex-basis:100%;flex-direction:column}.classifai-setup__content__row__column img{max-width:400px;width:100%}@media screen and (min-width:767px){.classifai-setup__content__row__column{flex:1;padding:0 10px}}.classifai-setup__content h1.classifai-setup-heading{font-size:22px;font-weight:600;margin:24px 0;text-align:center}.classifai-setup__content .classifai-setup-image{margin-top:20px;text-align:center}.classifai-setup__content h2.classifai-setup-title{font-size:22px;font-weight:400;margin:0;padding:0}.classifai-setup__content .classifai-step1-content,.classifai-setup__content .classifai-step4-content{margin-top:20px;max-width:400px}.classifai-setup__content .classifai-step2-content{margin:0 auto;max-width:480px}.classifai-setup__content .classifai-setup-footer{margin-top:40px}.classifai-setup__content .classifai-feature-box{margin:40px 0}.classifai-setup__content .classifai-feature-box-title{font-weight:700;text-transform:uppercase}.classifai-setup__content li.classifai-enable-feature{clear:both;display:block;list-style:none;margin-top:14px;width:100%}.classifai-setup__content li.classifai-enable-feature span.dashicons.dashicons-yes-alt{color:#48be1e}.classifai-setup__content li.classifai-enable-feature span.dashicons.dashicons-dismiss{color:#c00}.classifai-setup__content .classifai-feature-box-divider{border:1px solid #ddd}.classifai-setup__content label.classifai-feature-text,.classifai-setup__content span.classifai-feature-text{color:#707070;font-size:14px}.classifai-setup__content span.classifai-feature-text{float:left}.classifai-setup__content .classifai-setup-footer{text-align:right}.classifai-setup__content a.classifai-setup-skip-link{color:#000;font-weight:400;text-decoration:none}.classifai-setup__content .classifai-setup-footer__right{margin-left:40px}@media screen and (max-width:767px){.classifai-setup__content .classifai-step1-content,.classifai-setup__content .classifai-step4-content{margin-top:20px;max-width:100%}.classifai-setup__content h2.classifai-setup-title{text-align:center}}.classifai-step3-content .classifai-setup__content .classifai-setup-form{margin:0 auto;max-width:480px}.classifai-setup__content .classifai-setup-form .classifai-setup-form-field{margin-top:40px}.classifai-setup__content .classifai-setup-form label{display:block;font-weight:700;margin-bottom:20px;text-transform:uppercase}.classifai-setup__content .classifai-setup-form input[type=password],.classifai-setup__content .classifai-setup-form input[type=text]{font-size:14px;height:38px;margin-bottom:4px;width:100%}.classifai-setup__content .classifai-setup-form .classifai-setup-footer{margin-top:40px}.classifai-setup__content .classifai-step3-content{margin:0 auto}.classifai-setup__content .classifai-step3-content .classifai-setup-title{margin-bottom:12px;text-align:center}.classifai-setup__content .classifai-step3-content .classifai-setup-footer,.classifai-setup__content .classifai-step3-content .classifai-setup-form{margin:0 auto;max-width:480px}.classifai-setup__content .classifai-step3-content .classifai-setup-footer{margin-top:40px}.classifai-setup__content .classifai-tabs{display:block}.classifai-setup__content .classifai-tabs.tabs-center{margin:auto auto 24px}.classifai-setup__content .classifai-tabs.tabs-justify{table-layout:fixed;width:100%}.classifai-setup__content .classifai-tabs a.tab{color:#1d2327;cursor:pointer;display:inline-block;font-size:14px;padding:16px 12px;position:relative;text-decoration:none;transform:translateZ(0);transition:all .3s ease;white-space:nowrap}.classifai-setup__content .classifai-tabs a.tab:focus{box-shadow:none}.classifai-setup__content .classifai-tabs a.tab:hover{color:var(--classifai-admin-theme-color)}.classifai-setup__content .classifai-tabs a.tab:after{background:var(--classifai-admin-theme-color);border-radius:3px 3px 0 0;bottom:0;box-shadow:0 4px 10px 3px rgba(var(--classifai-admin-theme-color--rgb),.15);content:"";height:3px;left:0;opacity:0;position:absolute;right:0;transform:scaleX(0);transition:all .3s cubic-bezier(1,0,0,1);will-change:transform,box-shadow,opacity}.classifai-setup__content .classifai-tabs a.tab.active{color:var(--classifai-admin-theme-color);font-weight:600}.classifai-setup__content .classifai-tabs a.tab.active:after{opacity:1;transform:scale(1)}.classifai-setup__content p.classifai-setup-error{color:red;text-align:center}.classifai-setup__content span.classifai-input-description{font-size:12px}.classifai-toggle{cursor:pointer;display:inline-block;text-align:right;width:100%}.classifai-toggle-switch{background:transparent;border:1px solid #1e1e1e;border-radius:9px;box-sizing:border-box;display:inline-block;height:18px;position:relative;transition:background .25s;vertical-align:middle;width:36px}.classifai-toggle-switch:after,.classifai-toggle-switch:before{content:""}.classifai-toggle-switch:before{background:#1e1e1e;border-radius:50%;box-sizing:border-box;display:block;height:12px;left:2px;position:absolute;top:2px;transition:left .25s;width:12px}.classifai-toggle-checkbox:checked+.classifai-toggle-switch{background:var(--classifai-admin-theme-color);border-color:var(--classifai-admin-theme-color)}.classifai-toggle-checkbox:checked+.classifai-toggle-switch:before{background-color:#fff;left:20px}.classifai-toggle-checkbox{position:absolute;visibility:hidden}#classifai-generate-excerpt{position:absolute;right:12px;top:70px} .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{background-color:#333;border-radius:4px;color:#fff;font-size:14px;line-height:1.4;outline:0;position:relative;transition-property:transform,visibility,opacity;white-space:normal}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{border-top-color:initial;border-width:8px 8px 0;bottom:-7px;left:0;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:initial;border-width:0 8px 8px;left:0;top:-7px;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-left-color:initial;border-width:8px 0 8px 8px;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{border-right-color:initial;border-width:8px 8px 8px 0;left:-7px;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{color:#333;height:16px;width:16px}.tippy-arrow:before{border-color:transparent;border-style:solid;content:"";position:absolute}.tippy-content{padding:5px 9px;position:relative;z-index:1} .tippy-box[data-theme~=light]{background-color:#fff;box-shadow:0 0 20px 4px rgba(154,161,177,.15),0 4px 80px -8px rgba(36,40,47,.25),0 4px 4px -2px rgba(91,94,105,.15);color:#26323d}.tippy-box[data-theme~=light][data-placement^=top]>.tippy-arrow:before{border-top-color:#fff}.tippy-box[data-theme~=light][data-placement^=bottom]>.tippy-arrow:before{border-bottom-color:#fff}.tippy-box[data-theme~=light][data-placement^=left]>.tippy-arrow:before{border-left-color:#fff}.tippy-box[data-theme~=light][data-placement^=right]>.tippy-arrow:before{border-right-color:#fff}.tippy-box[data-theme~=light]>.tippy-backdrop{background-color:#fff}.tippy-box[data-theme~=light]>.tippy-svg-arrow{fill:#fff} diff --git a/dist/admin.js b/dist/admin.js index 21caed574..6d9bc3d77 100644 --- a/dist/admin.js +++ b/dist/admin.js @@ -1 +1 @@ -(()=>{"use strict";function e(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function t(t){return t instanceof e(t).Element||t instanceof Element}function n(t){return t instanceof e(t).HTMLElement||t instanceof HTMLElement}function r(t){return"undefined"!=typeof ShadowRoot&&(t instanceof e(t).ShadowRoot||t instanceof ShadowRoot)}var i=Math.max,o=Math.min,a=Math.round;function s(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function c(){return!/^((?!chrome|android).)*safari/i.test(s())}function u(r,i,o){void 0===i&&(i=!1),void 0===o&&(o=!1);var s=r.getBoundingClientRect(),u=1,f=1;i&&n(r)&&(u=r.offsetWidth>0&&a(s.width)/r.offsetWidth||1,f=r.offsetHeight>0&&a(s.height)/r.offsetHeight||1);var p=(t(r)?e(r):window).visualViewport,l=!c()&&o,d=(s.left+(l&&p?p.offsetLeft:0))/u,m=(s.top+(l&&p?p.offsetTop:0))/f,v=s.width/u,h=s.height/f;return{width:v,height:h,top:m,right:d+v,bottom:m+h,left:d,x:d,y:m}}function f(t){var n=e(t);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function p(e){return e?(e.nodeName||"").toLowerCase():null}function l(e){return((t(e)?e.ownerDocument:e.document)||window.document).documentElement}function d(e){return u(l(e)).left+f(e).scrollLeft}function m(t){return e(t).getComputedStyle(t)}function v(e){var t=m(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function h(t,r,i){void 0===i&&(i=!1);var o,s,c=n(r),m=n(r)&&function(e){var t=e.getBoundingClientRect(),n=a(t.width)/e.offsetWidth||1,r=a(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(r),h=l(r),g=u(t,m,i),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(c||!c&&!i)&&(("body"!==p(r)||v(h))&&(y=(o=r)!==e(o)&&n(o)?{scrollLeft:(s=o).scrollLeft,scrollTop:s.scrollTop}:f(o)),n(r)?((b=u(r,!0)).x+=r.clientLeft,b.y+=r.clientTop):h&&(b.x=d(h))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function g(e){var t=u(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function y(e){return"html"===p(e)?e:e.assignedSlot||e.parentNode||(r(e)?e.host:null)||l(e)}function b(e){return["html","body","#document"].indexOf(p(e))>=0?e.ownerDocument.body:n(e)&&v(e)?e:b(y(e))}function w(t,n){var r;void 0===n&&(n=[]);var i=b(t),o=i===(null==(r=t.ownerDocument)?void 0:r.body),a=e(i),s=o?[a].concat(a.visualViewport||[],v(i)?i:[]):i,c=n.concat(s);return o?c:c.concat(w(y(s)))}function x(e){return["table","td","th"].indexOf(p(e))>=0}function O(e){return n(e)&&"fixed"!==m(e).position?e.offsetParent:null}function E(t){for(var i=e(t),o=O(t);o&&x(o)&&"static"===m(o).position;)o=O(o);return o&&("html"===p(o)||"body"===p(o)&&"static"===m(o).position)?i:o||function(e){var t=/firefox/i.test(s());if(/Trident/i.test(s())&&n(e)&&"fixed"===m(e).position)return null;var i=y(e);for(r(i)&&(i=i.host);n(i)&&["html","body"].indexOf(p(i))<0;){var o=m(i);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return i;i=i.parentNode}return null}(t)||i}var A="top",T="bottom",L="right",D="left",j="auto",k=[A,T,L,D],C="start",M="end",B="viewport",I="popper",H=k.reduce((function(e,t){return e.concat([t+"-"+C,t+"-"+M])}),[]),V=[].concat(k,[j]).reduce((function(e,t){return e.concat([t,t+"-"+C,t+"-"+M])}),[]),S=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function W(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var P={placement:"bottom",modifiers:[],strategy:"absolute"};function R(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function z(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?q(i):null,a=i?U(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case A:t={x:s,y:n.y-r.height};break;case T:t={x:s,y:n.y+n.height};break;case L:t={x:n.x+n.width,y:c};break;case D:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var u=o?F(o):null;if(null!=u){var f="y"===u?"height":"width";switch(a){case C:t[u]=t[u]-(n[f]/2-r[f]/2);break;case M:t[u]=t[u]+(n[f]/2-r[f]/2)}}return t}var $={top:"auto",right:"auto",bottom:"auto",left:"auto"};function X(t){var n,r=t.popper,i=t.popperRect,o=t.placement,s=t.variation,c=t.offsets,u=t.position,f=t.gpuAcceleration,p=t.adaptive,d=t.roundOffsets,v=t.isFixed,h=c.x,g=void 0===h?0:h,y=c.y,b=void 0===y?0:y,w="function"==typeof d?d({x:g,y:b}):{x:g,y:b};g=w.x,b=w.y;var x=c.hasOwnProperty("x"),O=c.hasOwnProperty("y"),j=D,k=A,C=window;if(p){var B=E(r),I="clientHeight",H="clientWidth";B===e(r)&&"static"!==m(B=l(r)).position&&"absolute"===u&&(I="scrollHeight",H="scrollWidth"),(o===A||(o===D||o===L)&&s===M)&&(k=T,b-=(v&&B===C&&C.visualViewport?C.visualViewport.height:B[I])-i.height,b*=f?1:-1),o!==D&&(o!==A&&o!==T||s!==M)||(j=L,g-=(v&&B===C&&C.visualViewport?C.visualViewport.width:B[H])-i.width,g*=f?1:-1)}var V,S=Object.assign({position:u},p&&$),W=!0===d?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:a(n*i)/i||0,y:a(r*i)/i||0}}({x:g,y:b},e(r)):{x:g,y:b};return g=W.x,b=W.y,f?Object.assign({},S,((V={})[k]=O?"0":"",V[j]=x?"0":"",V.transform=(C.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",V)):Object.assign({},S,((n={})[k]=O?b+"px":"",n[j]=x?g+"px":"",n.transform="",n))}const Y={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var r=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];n(o)&&p(o)&&(Object.assign(o.style,r),Object.keys(i).forEach((function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce((function(e,t){return e[t]="",e}),{});n(i)&&p(i)&&(Object.assign(i.style,a),Object.keys(o).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};var J={left:"right",right:"left",bottom:"top",top:"bottom"};function G(e){return e.replace(/left|right|bottom|top/g,(function(e){return J[e]}))}var K={start:"end",end:"start"};function Q(e){return e.replace(/start|end/g,(function(e){return K[e]}))}function Z(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&r(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ee(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function te(n,r,o){return r===B?ee(function(t,n){var r=e(t),i=l(t),o=r.visualViewport,a=i.clientWidth,s=i.clientHeight,u=0,f=0;if(o){a=o.width,s=o.height;var p=c();(p||!p&&"fixed"===n)&&(u=o.offsetLeft,f=o.offsetTop)}return{width:a,height:s,x:u+d(t),y:f}}(n,o)):t(r)?function(e,t){var n=u(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,o):ee(function(e){var t,n=l(e),r=f(e),o=null==(t=e.ownerDocument)?void 0:t.body,a=i(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=i(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),c=-r.scrollLeft+d(e),u=-r.scrollTop;return"rtl"===m(o||n).direction&&(c+=i(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:c,y:u}}(l(n)))}function ne(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function re(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function ie(e,r){void 0===r&&(r={});var a=r,s=a.placement,c=void 0===s?e.placement:s,f=a.strategy,d=void 0===f?e.strategy:f,v=a.boundary,h=void 0===v?"clippingParents":v,g=a.rootBoundary,b=void 0===g?B:g,x=a.elementContext,O=void 0===x?I:x,D=a.altBoundary,j=void 0!==D&&D,C=a.padding,M=void 0===C?0:C,H=ne("number"!=typeof M?M:re(M,k)),V=O===I?"reference":I,S=e.rects.popper,W=e.elements[j?V:O],P=function(e,r,a,s){var c="clippingParents"===r?function(e){var r=w(y(e)),i=["absolute","fixed"].indexOf(m(e).position)>=0&&n(e)?E(e):e;return t(i)?r.filter((function(e){return t(e)&&Z(e,i)&&"body"!==p(e)})):[]}(e):[].concat(r),u=[].concat(c,[a]),f=u[0],l=u.reduce((function(t,n){var r=te(e,n,s);return t.top=i(r.top,t.top),t.right=o(r.right,t.right),t.bottom=o(r.bottom,t.bottom),t.left=i(r.left,t.left),t}),te(e,f,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}(t(W)?W:W.contextElement||l(e.elements.popper),h,b,d),R=u(e.elements.reference),N=z({reference:R,element:S,strategy:"absolute",placement:c}),_=ee(Object.assign({},S,N)),q=O===I?_:R,U={top:P.top-q.top+H.top,bottom:q.bottom-P.bottom+H.bottom,left:P.left-q.left+H.left,right:q.right-P.right+H.right},F=e.modifiersData.offset;if(O===I&&F){var $=F[c];Object.keys(U).forEach((function(e){var t=[L,T].indexOf(e)>=0?1:-1,n=[A,T].indexOf(e)>=0?"y":"x";U[e]+=$[n]*t}))}return U}function oe(e,t,n){return i(e,o(t,n))}function ae(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function se(e){return[A,L,T,D].some((function(t){return e[t]>=0}))}var ce=N({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var n=t.state,r=t.instance,i=t.options,o=i.scroll,a=void 0===o||o,s=i.resize,c=void 0===s||s,u=e(n.elements.popper),f=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&f.forEach((function(e){e.addEventListener("scroll",r.update,_)})),c&&u.addEventListener("resize",r.update,_),function(){a&&f.forEach((function(e){e.removeEventListener("scroll",r.update,_)})),c&&u.removeEventListener("resize",r.update,_)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=z({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,u={placement:q(t.placement),variation:U(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,X(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,X(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Y,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=V.reduce((function(e,n){return e[n]=function(e,t,n){var r=q(e),i=[D,A].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[D,L].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,u=n.padding,f=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,m=void 0===d||d,v=n.allowedAutoPlacements,h=t.options.placement,g=q(h),y=c||(g!==h&&m?function(e){if(q(e)===j)return[];var t=G(e);return[Q(e),t,Q(t)]}(h):[G(h)]),b=[h].concat(y).reduce((function(e,n){return e.concat(q(n)===j?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?V:c,f=U(r),p=f?s?H:H.filter((function(e){return U(e)===f})):k,l=p.filter((function(e){return u.indexOf(e)>=0}));0===l.length&&(l=p);var d=l.reduce((function(t,n){return t[n]=ie(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[q(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:f,rootBoundary:p,padding:u,flipVariations:m,allowedAutoPlacements:v}):n)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,E=!0,M=b[0],B=0;B=0,R=P?"width":"height",N=ie(t,{placement:I,boundary:f,rootBoundary:p,altBoundary:l,padding:u}),_=P?W?L:D:W?T:A;w[R]>x[R]&&(_=G(_));var F=G(_),z=[];if(o&&z.push(N[S]<=0),s&&z.push(N[_]<=0,N[F]<=0),z.every((function(e){return e}))){M=I,E=!1;break}O.set(I,z)}if(E)for(var $=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return M=t,"break"},X=m?3:1;X>0&&"break"!==$(X);X--);t.placement!==M&&(t.modifiersData[r]._skip=!0,t.placement=M,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,s=void 0===a||a,c=n.altAxis,u=void 0!==c&&c,f=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.padding,m=n.tether,v=void 0===m||m,h=n.tetherOffset,y=void 0===h?0:h,b=ie(t,{boundary:f,rootBoundary:p,padding:d,altBoundary:l}),w=q(t.placement),x=U(t.placement),O=!x,j=F(w),k="x"===j?"y":"x",M=t.modifiersData.popperOffsets,B=t.rects.reference,I=t.rects.popper,H="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,V="number"==typeof H?{mainAxis:H,altAxis:H}:Object.assign({mainAxis:0,altAxis:0},H),S=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,W={x:0,y:0};if(M){if(s){var P,R="y"===j?A:D,N="y"===j?T:L,_="y"===j?"height":"width",z=M[j],$=z+b[R],X=z-b[N],Y=v?-I[_]/2:0,J=x===C?B[_]:I[_],G=x===C?-I[_]:-B[_],K=t.elements.arrow,Q=v&&K?g(K):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Z[R],te=Z[N],ne=oe(0,B[_],Q[_]),re=O?B[_]/2-Y-ne-ee-V.mainAxis:J-ne-ee-V.mainAxis,ae=O?-B[_]/2+Y+ne+te+V.mainAxis:G+ne+te+V.mainAxis,se=t.elements.arrow&&E(t.elements.arrow),ce=se?"y"===j?se.clientTop||0:se.clientLeft||0:0,ue=null!=(P=null==S?void 0:S[j])?P:0,fe=z+ae-ue,pe=oe(v?o($,z+re-ue-ce):$,z,v?i(X,fe):X);M[j]=pe,W[j]=pe-z}if(u){var le,de="x"===j?A:D,me="x"===j?T:L,ve=M[k],he="y"===k?"height":"width",ge=ve+b[de],ye=ve-b[me],be=-1!==[A,D].indexOf(w),we=null!=(le=null==S?void 0:S[k])?le:0,xe=be?ge:ve-B[he]-I[he]-we+V.altAxis,Oe=be?ve+B[he]+I[he]-we-V.altAxis:ye,Ee=v&&be?function(e,t,n){var r=oe(e,t,n);return r>n?n:r}(xe,ve,Oe):oe(v?xe:ge,ve,v?Oe:ye);M[k]=Ee,W[k]=Ee-ve}t.modifiersData[r]=W}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=q(n.placement),c=F(s),u=[D,L].indexOf(s)>=0?"height":"width";if(o&&a){var f=function(e,t){return ne("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:re(e,k))}(i.padding,n),p=g(o),l="y"===c?A:D,d="y"===c?T:L,m=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],v=a[c]-n.rects.reference[c],h=E(o),y=h?"y"===c?h.clientHeight||0:h.clientWidth||0:0,b=m/2-v/2,w=f[l],x=y-p[u]-f[d],O=y/2-p[u]/2+b,j=oe(w,O,x),C=c;n.modifiersData[r]=((t={})[C]=j,t.centerOffset=j-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&Z(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=ie(t,{elementContext:"reference"}),s=ie(t,{altBoundary:!0}),c=ae(a,r),u=ae(s,i,o),f=se(c),p=se(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}}]}),ue="tippy-content",fe="tippy-backdrop",pe="tippy-arrow",le="tippy-svg-arrow",de={passive:!0,capture:!0},me=function(){return document.body};function ve(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function he(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function ge(e,t){return"function"==typeof e?e.apply(void 0,t):e}function ye(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function be(e){return[].concat(e)}function we(e,t){-1===e.indexOf(t)&&e.push(t)}function xe(e){return[].slice.call(e)}function Oe(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Ee(){return document.createElement("div")}function Ae(e){return["Element","Fragment"].some((function(t){return he(e,t)}))}function Te(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function Le(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function De(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function je(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var ke={isTouch:!1},Ce=0;function Me(){ke.isTouch||(ke.isTouch=!0,window.performance&&document.addEventListener("mousemove",Be))}function Be(){var e=performance.now();e-Ce<20&&(ke.isTouch=!1,document.removeEventListener("mousemove",Be)),Ce=e}function Ie(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var He=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),Ve=Object.assign({appendTo:me,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),Se=Object.keys(Ve);function We(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=Ve[i])?r:o),t}),{});return Object.assign({},e,t)}function Pe(e,t){var n=Object.assign({},t,{content:ge(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(We(Object.assign({},Ve,{plugins:t}))):Se).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ve.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var Re=function(){return"innerHTML"};function Ne(e,t){e[Re()]=t}function _e(e){var t=Ee();return!0===e?t.className=pe:(t.className=le,Ae(e)?t.appendChild(e):Ne(t,e)),t}function qe(e,t){Ae(t.content)?(Ne(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Ne(e,t.content):e.textContent=t.content)}function Ue(e){var t=e.firstElementChild,n=xe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ue)})),arrow:n.find((function(e){return e.classList.contains(pe)||e.classList.contains(le)})),backdrop:n.find((function(e){return e.classList.contains(fe)}))}}function Fe(e){var t=Ee(),n=Ee();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ee();function i(n,r){var i=Ue(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||qe(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(_e(r.arrow))):o.appendChild(_e(r.arrow)):s&&o.removeChild(s)}return r.className=ue,r.setAttribute("data-state","hidden"),qe(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}Fe.$$tippy=!0;var ze=1,$e=[],Xe=[];function Ye(e,t){var n,r,i,o,a,s,c,u,f=Pe(e,Object.assign({},Ve,We(Oe(t)))),p=!1,l=!1,d=!1,m=!1,v=[],h=ye(X,f.interactiveDebounce),g=ze++,y=(u=f.plugins).filter((function(e,t){return u.indexOf(e)===t})),b={id:g,reference:e,popper:Ee(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(!b.state.isDestroyed){I("onBeforeUpdate",[b,t]),z();var n=b.props,r=Pe(e,Object.assign({},n,Oe(t),{ignoreAttributes:!0}));b.props=r,F(),n.interactiveDebounce!==r.interactiveDebounce&&(S(),h=ye(X,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?be(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded"),V(),B(),O&&O(n,r),b.popperInstance&&(K(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),I("onAfterUpdate",[b,t])}},setContent:function(e){b.setProps({content:e})},show:function(){var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=ke.isTouch&&!b.props.touch,i=ve(b.props.duration,0,Ve.duration);if(!(e||t||n||r||j().hasAttribute("disabled")||(I("onShow",[b],!1),!1===b.props.onShow(b)))){if(b.state.isVisible=!0,D()&&(x.style.visibility="visible"),B(),N(),b.state.isMounted||(x.style.transition="none"),D()){var o=C();Te([o.box,o.content],0)}var a,c,u;s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,D()&&b.props.animation){var t=C(),n=t.box,r=t.content;Te([n,r],i),Le([n,r],"visible")}H(),V(),we(Xe,b),null==(e=b.popperInstance)||e.forceUpdate(),I("onMount",[b]),b.props.animation&&D()&&function(e,t){q(e,(function(){b.state.isShown=!0,I("onShown",[b])}))}(i)}},c=b.props.appendTo,u=j(),(a=b.props.interactive&&c===me||"parent"===c?u.parentNode:ge(c,[u])).contains(x)||a.appendChild(x),b.state.isMounted=!0,K()}},hide:function(){var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=ve(b.props.duration,1,Ve.duration);if(!(e||t||n)&&(I("onHide",[b],!1),!1!==b.props.onHide(b))){if(b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,D()&&(x.style.visibility="hidden"),S(),_(),B(!0),D()){var i=C(),o=i.box,a=i.content;b.props.animation&&(Te([o,a],r),Le([o,a],"hidden"))}H(),V(),b.props.animation?D()&&function(e,t){q(e,(function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,b.unmount):b.unmount()}},hideWithInteractivity:function(e){k().addEventListener("mousemove",h),we($e,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide(),b.state.isMounted&&(Q(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Xe=Xe.filter((function(e){return e!==b})),b.state.isMounted=!1,I("onHidden",[b]))},destroy:function(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),z(),delete e._tippy,b.state.isDestroyed=!0,I("onDestroy",[b]))}};if(!f.render)return b;var w=f.render(b),x=w.popper,O=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var E=y.map((function(e){return e.fn(b)})),A=e.hasAttribute("aria-expanded");return F(),V(),B(),I("onCreate",[b]),f.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&k().addEventListener("mousemove",h)})),b;function T(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===T()[0]}function D(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function j(){return c||e}function k(){var e,t,n=j().parentNode;return n?null!=(t=be(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function C(){return Ue(x)}function M(e){return b.state.isMounted&&!b.state.isVisible||ke.isTouch||o&&"focus"===o.type?0:ve(b.props.delay,e?0:1,Ve.delay)}function B(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function I(e,t,n){var r;void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n&&(r=b.props)[e].apply(r,t)}function H(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;be(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function V(){!A&&b.props.aria.expanded&&be(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===j()?"true":"false"):e.removeAttribute("aria-expanded")}))}function S(){k().removeEventListener("mousemove",h),$e=$e.filter((function(e){return e!==h}))}function W(t){if(!ke.isTouch||!d&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!je(x,n)){if(be(b.props.triggerTarget||e).some((function(e){return je(e,n)}))){if(ke.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else I("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout((function(){l=!1})),b.state.isMounted||_())}}}function P(){d=!0}function R(){d=!1}function N(){var e=k();e.addEventListener("mousedown",W,!0),e.addEventListener("touchend",W,de),e.addEventListener("touchstart",R,de),e.addEventListener("touchmove",P,de)}function _(){var e=k();e.removeEventListener("mousedown",W,!0),e.removeEventListener("touchend",W,de),e.removeEventListener("touchstart",R,de),e.removeEventListener("touchmove",P,de)}function q(e,t){var n=C().box;function r(e){e.target===n&&(De(n,"remove",r),t())}if(0===e)return t();De(n,"remove",a),De(n,"add",r),a=r}function U(t,n,r){void 0===r&&(r=!1),be(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function F(){var e;L()&&(U("touchstart",$,{passive:!0}),U("touchend",Y,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(U(e,$),e){case"mouseenter":U("mouseleave",Y);break;case"focus":U(He?"focusout":"blur",J);break;case"focusin":U("focusout",J)}}))}function z(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function $(e){var t,n=!1;if(b.state.isEnabled&&!G(e)&&!l){var r="focus"===(null==(t=o)?void 0:t.type);o=e,c=e.currentTarget,V(),!b.state.isVisible&&he(e,"MouseEvent")&&$e.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(p=!n),n&&!r&&te(e)}}function X(e){var t=e.target,n=j().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:f}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=i.placement.split("-")[0],s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,p="left"===a?s.right.x:0,l=t.top-r+c>o,d=r-t.bottom-u>o,m=t.left-n+f>o,v=n-t.right-p>o;return l||d||m||v}))})(r,e)&&(S(),te(e))}}function Y(e){G(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function J(e){b.props.trigger.indexOf("focusin")<0&&e.target!==j()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function G(e){return!!ke.isTouch&&L()!==e.type.indexOf("touch")>=0}function K(){Q();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=D()?Ue(x).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||j()}:e,f=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(D()){var n=C().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];D()&&c&&f.push({name:"arrow",options:{element:c,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),b.popperInstance=ce(u,x,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function Q(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return xe(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&I("onTrigger",[b,e]),N();var t=M(!0),r=T(),i=r[0],o=r[1];ke.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),I("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=M(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else _()}}function Je(e,t){void 0===t&&(t={});var n=Ve.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Me,de),window.addEventListener("blur",Ie);var r,i=Object.assign({},t,{plugins:n}),o=(r=e,Ae(r)?[r]:function(e){return he(e,"NodeList")}(r)?xe(r):Array.isArray(r)?r:xe(document.querySelectorAll(r))).reduce((function(e,t){var n=t&&Ye(t,i);return n&&e.push(n),e}),[]);return Ae(e)?o[0]:o}Je.defaultProps=Ve,Je.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ve[t]=e[t]}))},Je.currentInput=ke,Object.assign({},Y,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),Je.setDefaultProps({render:Fe});const Ge=Je;document.addEventListener("DOMContentLoaded",(function(){const e=document.getElementById("help-menu-template");if(!e)return;const t=document.createElement("div");t.appendChild(document.importNode(e.content,!0)),Ge(".classifai-help",{allowHTML:!0,content:t.innerHTML,trigger:"click",placement:"bottom-end",arrow:!0,animation:"scale",duration:[250,200],theme:"light",interactive:!0})})),(()=>{const e=document.getElementById("classifai-waston-cred-toggle"),t=document.getElementById("classifai-settings-watson_username");if(null===e||null===t)return;let n=null,r=null;t.closest("tr")?n=t.closest("tr"):t.closest(".classifai-setup-form-field")&&(n=t.closest(".classifai-setup-form-field")),document.getElementById("classifai-settings-watson_password").closest("tr")?[r]=document.getElementById("classifai-settings-watson_password").closest("tr").getElementsByTagName("label"):document.getElementById("classifai-settings-watson_password").closest(".classifai-setup-form-field")&&([r]=document.getElementById("classifai-settings-watson_password").closest(".classifai-setup-form-field").getElementsByTagName("label")),e.addEventListener("click",(i=>{if(i.preventDefault(),n.classList.toggle("hidden"),n.classList.contains("hidden"))return e.innerText=ClassifAI.use_password,r.innerText=ClassifAI.api_key,void(t.value="apikey");e.innerText=ClassifAI.use_key,r.innerText=ClassifAI.api_password}))})()})(); \ No newline at end of file +(()=>{"use strict";const e=window.wp.i18n;function t(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function n(e){return e instanceof t(e).Element||e instanceof Element}function r(e){return e instanceof t(e).HTMLElement||e instanceof HTMLElement}function i(e){return"undefined"!=typeof ShadowRoot&&(e instanceof t(e).ShadowRoot||e instanceof ShadowRoot)}var o=Math.max,a=Math.min,s=Math.round;function c(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function u(){return!/^((?!chrome|android).)*safari/i.test(c())}function f(e,i,o){void 0===i&&(i=!1),void 0===o&&(o=!1);var a=e.getBoundingClientRect(),c=1,f=1;i&&r(e)&&(c=e.offsetWidth>0&&s(a.width)/e.offsetWidth||1,f=e.offsetHeight>0&&s(a.height)/e.offsetHeight||1);var p=(n(e)?t(e):window).visualViewport,l=!u()&&o,d=(a.left+(l&&p?p.offsetLeft:0))/c,m=(a.top+(l&&p?p.offsetTop:0))/f,v=a.width/c,h=a.height/f;return{width:v,height:h,top:m,right:d+v,bottom:m+h,left:d,x:d,y:m}}function p(e){var n=t(e);return{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function l(e){return e?(e.nodeName||"").toLowerCase():null}function d(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return f(d(e)).left+p(e).scrollLeft}function v(e){return t(e).getComputedStyle(e)}function h(e){var t=v(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function g(e,n,i){void 0===i&&(i=!1);var o,a,c=r(n),u=r(n)&&function(e){var t=e.getBoundingClientRect(),n=s(t.width)/e.offsetWidth||1,r=s(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(n),v=d(n),g=f(e,u,i),y={scrollLeft:0,scrollTop:0},b={x:0,y:0};return(c||!c&&!i)&&(("body"!==l(n)||h(v))&&(y=(o=n)!==t(o)&&r(o)?{scrollLeft:(a=o).scrollLeft,scrollTop:a.scrollTop}:p(o)),r(n)?((b=f(n,!0)).x+=n.clientLeft,b.y+=n.clientTop):v&&(b.x=m(v))),{x:g.left+y.scrollLeft-b.x,y:g.top+y.scrollTop-b.y,width:g.width,height:g.height}}function y(e){var t=f(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function b(e){return"html"===l(e)?e:e.assignedSlot||e.parentNode||(i(e)?e.host:null)||d(e)}function w(e){return["html","body","#document"].indexOf(l(e))>=0?e.ownerDocument.body:r(e)&&h(e)?e:w(b(e))}function x(e,n){var r;void 0===n&&(n=[]);var i=w(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=t(i),s=o?[a].concat(a.visualViewport||[],h(i)?i:[]):i,c=n.concat(s);return o?c:c.concat(x(b(s)))}function O(e){return["table","td","th"].indexOf(l(e))>=0}function E(e){return r(e)&&"fixed"!==v(e).position?e.offsetParent:null}function A(e){for(var n=t(e),o=E(e);o&&O(o)&&"static"===v(o).position;)o=E(o);return o&&("html"===l(o)||"body"===l(o)&&"static"===v(o).position)?n:o||function(e){var t=/firefox/i.test(c());if(/Trident/i.test(c())&&r(e)&&"fixed"===v(e).position)return null;var n=b(e);for(i(n)&&(n=n.host);r(n)&&["html","body"].indexOf(l(n))<0;){var o=v(n);if("none"!==o.transform||"none"!==o.perspective||"paint"===o.contain||-1!==["transform","perspective"].indexOf(o.willChange)||t&&"filter"===o.willChange||t&&o.filter&&"none"!==o.filter)return n;n=n.parentNode}return null}(e)||n}var T="top",L="bottom",j="right",D="left",_="auto",k=[T,L,j,D],S="start",C="end",M="viewport",B="popper",q=k.reduce((function(e,t){return e.concat([t+"-"+S,t+"-"+C])}),[]),I=[].concat(k,[_]).reduce((function(e,t){return e.concat([t,t+"-"+S,t+"-"+C])}),[]),H=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function V(e){var t=new Map,n=new Set,r=[];function i(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var r=t.get(e);r&&i(r)}})),r.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||i(e)})),r}var P={placement:"bottom",modifiers:[],strategy:"absolute"};function W(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function $(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?U(i):null,a=i?F(i):null,s=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(o){case T:t={x:s,y:n.y-r.height};break;case L:t={x:s,y:n.y+n.height};break;case j:t={x:n.x+n.width,y:c};break;case D:t={x:n.x-r.width,y:c};break;default:t={x:n.x,y:n.y}}var u=o?z(o):null;if(null!=u){var f="y"===u?"height":"width";switch(a){case S:t[u]=t[u]-(n[f]/2-r[f]/2);break;case C:t[u]=t[u]+(n[f]/2-r[f]/2)}}return t}var Q={top:"auto",right:"auto",bottom:"auto",left:"auto"};function X(e){var n,r=e.popper,i=e.popperRect,o=e.placement,a=e.variation,c=e.offsets,u=e.position,f=e.gpuAcceleration,p=e.adaptive,l=e.roundOffsets,m=e.isFixed,h=c.x,g=void 0===h?0:h,y=c.y,b=void 0===y?0:y,w="function"==typeof l?l({x:g,y:b}):{x:g,y:b};g=w.x,b=w.y;var x=c.hasOwnProperty("x"),O=c.hasOwnProperty("y"),E=D,_=T,k=window;if(p){var S=A(r),M="clientHeight",B="clientWidth";S===t(r)&&"static"!==v(S=d(r)).position&&"absolute"===u&&(M="scrollHeight",B="scrollWidth"),(o===T||(o===D||o===j)&&a===C)&&(_=L,b-=(m&&S===k&&k.visualViewport?k.visualViewport.height:S[M])-i.height,b*=f?1:-1),o!==D&&(o!==T&&o!==L||a!==C)||(E=j,g-=(m&&S===k&&k.visualViewport?k.visualViewport.width:S[B])-i.width,g*=f?1:-1)}var q,I=Object.assign({position:u},p&&Q),H=!0===l?function(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:s(n*i)/i||0,y:s(r*i)/i||0}}({x:g,y:b},t(r)):{x:g,y:b};return g=H.x,b=H.y,f?Object.assign({},I,((q={})[_]=O?"0":"",q[E]=x?"0":"",q.transform=(k.devicePixelRatio||1)<=1?"translate("+g+"px, "+b+"px)":"translate3d("+g+"px, "+b+"px, 0)",q)):Object.assign({},I,((n={})[_]=O?b+"px":"",n[E]=x?g+"px":"",n.transform="",n))}const Y={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},o=t.elements[e];r(o)&&l(o)&&(Object.assign(o.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?o.removeAttribute(e):o.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],o=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(i)&&l(i)&&(Object.assign(i.style,a),Object.keys(o).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};var J={left:"right",right:"left",bottom:"top",top:"bottom"};function G(e){return e.replace(/left|right|bottom|top/g,(function(e){return J[e]}))}var K={start:"end",end:"start"};function Z(e){return e.replace(/start|end/g,(function(e){return K[e]}))}function ee(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&i(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function te(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ne(e,r,i){return r===M?te(function(e,n){var r=t(e),i=d(e),o=r.visualViewport,a=i.clientWidth,s=i.clientHeight,c=0,f=0;if(o){a=o.width,s=o.height;var p=u();(p||!p&&"fixed"===n)&&(c=o.offsetLeft,f=o.offsetTop)}return{width:a,height:s,x:c+m(e),y:f}}(e,i)):n(r)?function(e,t){var n=f(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(r,i):te(function(e){var t,n=d(e),r=p(e),i=null==(t=e.ownerDocument)?void 0:t.body,a=o(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=o(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),c=-r.scrollLeft+m(e),u=-r.scrollTop;return"rtl"===v(i||n).direction&&(c+=o(n.clientWidth,i?i.clientWidth:0)-a),{width:a,height:s,x:c,y:u}}(d(e)))}function re(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function ie(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function oe(e,t){void 0===t&&(t={});var i=t,s=i.placement,c=void 0===s?e.placement:s,u=i.strategy,p=void 0===u?e.strategy:u,m=i.boundary,h=void 0===m?"clippingParents":m,g=i.rootBoundary,y=void 0===g?M:g,w=i.elementContext,O=void 0===w?B:w,E=i.altBoundary,D=void 0!==E&&E,_=i.padding,S=void 0===_?0:_,C=re("number"!=typeof S?S:ie(S,k)),q=O===B?"reference":B,I=e.rects.popper,H=e.elements[D?q:O],V=function(e,t,i,s){var c="clippingParents"===t?function(e){var t=x(b(e)),i=["absolute","fixed"].indexOf(v(e).position)>=0&&r(e)?A(e):e;return n(i)?t.filter((function(e){return n(e)&&ee(e,i)&&"body"!==l(e)})):[]}(e):[].concat(t),u=[].concat(c,[i]),f=u[0],p=u.reduce((function(t,n){var r=ne(e,n,s);return t.top=o(r.top,t.top),t.right=a(r.right,t.right),t.bottom=a(r.bottom,t.bottom),t.left=o(r.left,t.left),t}),ne(e,f,s));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}(n(H)?H:H.contextElement||d(e.elements.popper),h,y,p),P=f(e.elements.reference),W=$({reference:P,element:I,strategy:"absolute",placement:c}),R=te(Object.assign({},I,W)),N=O===B?R:P,U={top:V.top-N.top+C.top,bottom:N.bottom-V.bottom+C.bottom,left:V.left-N.left+C.left,right:N.right-V.right+C.right},F=e.modifiersData.offset;if(O===B&&F){var z=F[c];Object.keys(U).forEach((function(e){var t=[j,L].indexOf(e)>=0?1:-1,n=[T,L].indexOf(e)>=0?"y":"x";U[e]+=z[n]*t}))}return U}function ae(e,t,n){return o(e,a(t,n))}function se(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ce(e){return[T,j,L,D].some((function(t){return e[t]>=0}))}var ue=R({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,r=e.instance,i=e.options,o=i.scroll,a=void 0===o||o,s=i.resize,c=void 0===s||s,u=t(n.elements.popper),f=[].concat(n.scrollParents.reference,n.scrollParents.popper);return a&&f.forEach((function(e){e.addEventListener("scroll",r.update,N)})),c&&u.addEventListener("resize",r.update,N),function(){a&&f.forEach((function(e){e.removeEventListener("scroll",r.update,N)})),c&&u.removeEventListener("resize",r.update,N)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=$({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,c=void 0===s||s,u={placement:U(t.placement),variation:F(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,X(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,X(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Y,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=I.reduce((function(e,n){return e[n]=function(e,t,n){var r=U(e),i=[D,T].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[D,j].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],c=s.x,u=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,c=n.fallbackPlacements,u=n.padding,f=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.flipVariations,m=void 0===d||d,v=n.allowedAutoPlacements,h=t.options.placement,g=U(h),y=c||(g!==h&&m?function(e){if(U(e)===_)return[];var t=G(e);return[Z(e),t,Z(t)]}(h):[G(h)]),b=[h].concat(y).reduce((function(e,n){return e.concat(U(n)===_?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=void 0===c?I:c,f=F(r),p=f?s?q:q.filter((function(e){return F(e)===f})):k,l=p.filter((function(e){return u.indexOf(e)>=0}));0===l.length&&(l=p);var d=l.reduce((function(t,n){return t[n]=oe(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[U(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:n,boundary:f,rootBoundary:p,padding:u,flipVariations:m,allowedAutoPlacements:v}):n)}),[]),w=t.rects.reference,x=t.rects.popper,O=new Map,E=!0,A=b[0],C=0;C=0,P=V?"width":"height",W=oe(t,{placement:M,boundary:f,rootBoundary:p,altBoundary:l,padding:u}),R=V?H?j:D:H?L:T;w[P]>x[P]&&(R=G(R));var N=G(R),z=[];if(o&&z.push(W[B]<=0),s&&z.push(W[R]<=0,W[N]<=0),z.every((function(e){return e}))){A=M,E=!1;break}O.set(M,z)}if(E)for(var $=function(e){var t=b.find((function(t){var n=O.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return A=t,"break"},Q=m?3:1;Q>0&&"break"!==$(Q);Q--);t.placement!==A&&(t.modifiersData[r]._skip=!0,t.placement=A,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,s=void 0===i||i,c=n.altAxis,u=void 0!==c&&c,f=n.boundary,p=n.rootBoundary,l=n.altBoundary,d=n.padding,m=n.tether,v=void 0===m||m,h=n.tetherOffset,g=void 0===h?0:h,b=oe(t,{boundary:f,rootBoundary:p,padding:d,altBoundary:l}),w=U(t.placement),x=F(t.placement),O=!x,E=z(w),_="x"===E?"y":"x",k=t.modifiersData.popperOffsets,C=t.rects.reference,M=t.rects.popper,B="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,q="number"==typeof B?{mainAxis:B,altAxis:B}:Object.assign({mainAxis:0,altAxis:0},B),I=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,H={x:0,y:0};if(k){if(s){var V,P="y"===E?T:D,W="y"===E?L:j,R="y"===E?"height":"width",N=k[E],$=N+b[P],Q=N-b[W],X=v?-M[R]/2:0,Y=x===S?C[R]:M[R],J=x===S?-M[R]:-C[R],G=t.elements.arrow,K=v&&G?y(G):{width:0,height:0},Z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Z[P],te=Z[W],ne=ae(0,C[R],K[R]),re=O?C[R]/2-X-ne-ee-q.mainAxis:Y-ne-ee-q.mainAxis,ie=O?-C[R]/2+X+ne+te+q.mainAxis:J+ne+te+q.mainAxis,se=t.elements.arrow&&A(t.elements.arrow),ce=se?"y"===E?se.clientTop||0:se.clientLeft||0:0,ue=null!=(V=null==I?void 0:I[E])?V:0,fe=N+ie-ue,pe=ae(v?a($,N+re-ue-ce):$,N,v?o(Q,fe):Q);k[E]=pe,H[E]=pe-N}if(u){var le,de="x"===E?T:D,me="x"===E?L:j,ve=k[_],he="y"===_?"height":"width",ge=ve+b[de],ye=ve-b[me],be=-1!==[T,D].indexOf(w),we=null!=(le=null==I?void 0:I[_])?le:0,xe=be?ge:ve-C[he]-M[he]-we+q.altAxis,Oe=be?ve+C[he]+M[he]-we-q.altAxis:ye,Ee=v&&be?function(e,t,n){var r=ae(e,t,n);return r>n?n:r}(xe,ve,Oe):ae(v?xe:ge,ve,v?Oe:ye);k[_]=Ee,H[_]=Ee-ve}t.modifiersData[r]=H}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=U(n.placement),c=z(s),u=[D,j].indexOf(s)>=0?"height":"width";if(o&&a){var f=function(e,t){return re("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:ie(e,k))}(i.padding,n),p=y(o),l="y"===c?T:D,d="y"===c?L:j,m=n.rects.reference[u]+n.rects.reference[c]-a[c]-n.rects.popper[u],v=a[c]-n.rects.reference[c],h=A(o),g=h?"y"===c?h.clientHeight||0:h.clientWidth||0:0,b=m/2-v/2,w=f[l],x=g-p[u]-f[d],O=g/2-p[u]/2+b,E=ae(w,O,x),_=c;n.modifiersData[r]=((t={})[_]=E,t.centerOffset=E-O,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&ee(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=oe(t,{elementContext:"reference"}),s=oe(t,{altBoundary:!0}),c=se(a,r),u=se(s,i,o),f=ce(c),p=ce(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":p})}}]}),fe="tippy-content",pe="tippy-backdrop",le="tippy-arrow",de="tippy-svg-arrow",me={passive:!0,capture:!0},ve=function(){return document.body};function he(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function ge(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function ye(e,t){return"function"==typeof e?e.apply(void 0,t):e}function be(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function we(e){return[].concat(e)}function xe(e,t){-1===e.indexOf(t)&&e.push(t)}function Oe(e){return[].slice.call(e)}function Ee(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function Ae(){return document.createElement("div")}function Te(e){return["Element","Fragment"].some((function(t){return ge(e,t)}))}function Le(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function je(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function De(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function _e(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var ke={isTouch:!1},Se=0;function Ce(){ke.isTouch||(ke.isTouch=!0,window.performance&&document.addEventListener("mousemove",Me))}function Me(){var e=performance.now();e-Se<20&&(ke.isTouch=!1,document.removeEventListener("mousemove",Me)),Se=e}function Be(){var e,t=document.activeElement;if((e=t)&&e._tippy&&e._tippy.reference===e){var n=t._tippy;t.blur&&!n.state.isVisible&&t.blur()}}var qe=!("undefined"==typeof window||"undefined"==typeof document||!window.msCrypto),Ie=Object.assign({appendTo:ve,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),He=Object.keys(Ie);function Ve(e){var t=(e.plugins||[]).reduce((function(t,n){var r,i=n.name,o=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:null!=(r=Ie[i])?r:o),t}),{});return Object.assign({},e,t)}function Pe(e,t){var n=Object.assign({},t,{content:ye(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(Ve(Object.assign({},Ie,{plugins:t}))):He).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},Ie.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}var We=function(){return"innerHTML"};function Re(e,t){e[We()]=t}function Ne(e){var t=Ae();return!0===e?t.className=le:(t.className=de,Te(e)?t.appendChild(e):Re(t,e)),t}function Ue(e,t){Te(t.content)?(Re(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Re(e,t.content):e.textContent=t.content)}function Fe(e){var t=e.firstElementChild,n=Oe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(fe)})),arrow:n.find((function(e){return e.classList.contains(le)||e.classList.contains(de)})),backdrop:n.find((function(e){return e.classList.contains(pe)}))}}function ze(e){var t=Ae(),n=Ae();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Ae();function i(n,r){var i=Fe(t),o=i.box,a=i.content,s=i.arrow;r.theme?o.setAttribute("data-theme",r.theme):o.removeAttribute("data-theme"),"string"==typeof r.animation?o.setAttribute("data-animation",r.animation):o.removeAttribute("data-animation"),r.inertia?o.setAttribute("data-inertia",""):o.removeAttribute("data-inertia"),o.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?o.setAttribute("role",r.role):o.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||Ue(a,e.props),r.arrow?s?n.arrow!==r.arrow&&(o.removeChild(s),o.appendChild(Ne(r.arrow))):o.appendChild(Ne(r.arrow)):s&&o.removeChild(s)}return r.className=fe,r.setAttribute("data-state","hidden"),Ue(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props),{popper:t,onUpdate:i}}ze.$$tippy=!0;var $e=1,Qe=[],Xe=[];function Ye(e,t){var n,r,i,o,a,s,c,u,f=Pe(e,Object.assign({},Ie,Ve(Ee(t)))),p=!1,l=!1,d=!1,m=!1,v=[],h=be(Q,f.interactiveDebounce),g=$e++,y=(u=f.plugins).filter((function(e,t){return u.indexOf(e)===t})),b={id:g,reference:e,popper:Ae(),popperInstance:null,props:f,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:y,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(i)},setProps:function(t){if(!b.state.isDestroyed){M("onBeforeUpdate",[b,t]),z();var n=b.props,r=Pe(e,Object.assign({},n,Ee(t),{ignoreAttributes:!0}));b.props=r,F(),n.interactiveDebounce!==r.interactiveDebounce&&(I(),h=be(Q,r.interactiveDebounce)),n.triggerTarget&&!r.triggerTarget?we(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded"),q(),C(),O&&O(n,r),b.popperInstance&&(G(),Z().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)}))),M("onAfterUpdate",[b,t])}},setContent:function(e){b.setProps({content:e})},show:function(){var e=b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=ke.isTouch&&!b.props.touch,i=he(b.props.duration,0,Ie.duration);if(!(e||t||n||r||D().hasAttribute("disabled")||(M("onShow",[b],!1),!1===b.props.onShow(b)))){if(b.state.isVisible=!0,j()&&(x.style.visibility="visible"),C(),W(),b.state.isMounted||(x.style.transition="none"),j()){var o=k();Le([o.box,o.content],0)}var a,c,u;s=function(){var e;if(b.state.isVisible&&!m){if(m=!0,x.offsetHeight,x.style.transition=b.props.moveTransition,j()&&b.props.animation){var t=k(),n=t.box,r=t.content;Le([n,r],i),je([n,r],"visible")}B(),q(),xe(Xe,b),null==(e=b.popperInstance)||e.forceUpdate(),M("onMount",[b]),b.props.animation&&j()&&function(e,t){N(e,(function(){b.state.isShown=!0,M("onShown",[b])}))}(i)}},c=b.props.appendTo,u=D(),(a=b.props.interactive&&c===ve||"parent"===c?u.parentNode:ye(c,[u])).contains(x)||a.appendChild(x),b.state.isMounted=!0,G()}},hide:function(){var e=!b.state.isVisible,t=b.state.isDestroyed,n=!b.state.isEnabled,r=he(b.props.duration,1,Ie.duration);if(!(e||t||n)&&(M("onHide",[b],!1),!1!==b.props.onHide(b))){if(b.state.isVisible=!1,b.state.isShown=!1,m=!1,p=!1,j()&&(x.style.visibility="hidden"),I(),R(),C(!0),j()){var i=k(),o=i.box,a=i.content;b.props.animation&&(Le([o,a],r),je([o,a],"hidden"))}B(),q(),b.props.animation?j()&&function(e,t){N(e,(function(){!b.state.isVisible&&x.parentNode&&x.parentNode.contains(x)&&t()}))}(r,b.unmount):b.unmount()}},hideWithInteractivity:function(e){_().addEventListener("mousemove",h),xe(Qe,h),h(e)},enable:function(){b.state.isEnabled=!0},disable:function(){b.hide(),b.state.isEnabled=!1},unmount:function(){b.state.isVisible&&b.hide(),b.state.isMounted&&(K(),Z().forEach((function(e){e._tippy.unmount()})),x.parentNode&&x.parentNode.removeChild(x),Xe=Xe.filter((function(e){return e!==b})),b.state.isMounted=!1,M("onHidden",[b]))},destroy:function(){b.state.isDestroyed||(b.clearDelayTimeouts(),b.unmount(),z(),delete e._tippy,b.state.isDestroyed=!0,M("onDestroy",[b]))}};if(!f.render)return b;var w=f.render(b),x=w.popper,O=w.onUpdate;x.setAttribute("data-tippy-root",""),x.id="tippy-"+b.id,b.popper=x,e._tippy=b,x._tippy=b;var E=y.map((function(e){return e.fn(b)})),A=e.hasAttribute("aria-expanded");return F(),q(),C(),M("onCreate",[b]),f.showOnCreate&&ee(),x.addEventListener("mouseenter",(function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()})),x.addEventListener("mouseleave",(function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&_().addEventListener("mousemove",h)})),b;function T(){var e=b.props.touch;return Array.isArray(e)?e:[e,0]}function L(){return"hold"===T()[0]}function j(){var e;return!(null==(e=b.props.render)||!e.$$tippy)}function D(){return c||e}function _(){var e,t,n=D().parentNode;return n?null!=(t=we(n)[0])&&null!=(e=t.ownerDocument)&&e.body?t.ownerDocument:document:document}function k(){return Fe(x)}function S(e){return b.state.isMounted&&!b.state.isVisible||ke.isTouch||o&&"focus"===o.type?0:he(b.props.delay,e?0:1,Ie.delay)}function C(e){void 0===e&&(e=!1),x.style.pointerEvents=b.props.interactive&&!e?"":"none",x.style.zIndex=""+b.props.zIndex}function M(e,t,n){var r;void 0===n&&(n=!0),E.forEach((function(n){n[e]&&n[e].apply(n,t)})),n&&(r=b.props)[e].apply(r,t)}function B(){var t=b.props.aria;if(t.content){var n="aria-"+t.content,r=x.id;we(b.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(b.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var i=t&&t.replace(r,"").trim();i?e.setAttribute(n,i):e.removeAttribute(n)}}))}}function q(){!A&&b.props.aria.expanded&&we(b.props.triggerTarget||e).forEach((function(e){b.props.interactive?e.setAttribute("aria-expanded",b.state.isVisible&&e===D()?"true":"false"):e.removeAttribute("aria-expanded")}))}function I(){_().removeEventListener("mousemove",h),Qe=Qe.filter((function(e){return e!==h}))}function H(t){if(!ke.isTouch||!d&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!b.props.interactive||!_e(x,n)){if(we(b.props.triggerTarget||e).some((function(e){return _e(e,n)}))){if(ke.isTouch)return;if(b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else M("onClickOutside",[b,t]);!0===b.props.hideOnClick&&(b.clearDelayTimeouts(),b.hide(),l=!0,setTimeout((function(){l=!1})),b.state.isMounted||R())}}}function V(){d=!0}function P(){d=!1}function W(){var e=_();e.addEventListener("mousedown",H,!0),e.addEventListener("touchend",H,me),e.addEventListener("touchstart",P,me),e.addEventListener("touchmove",V,me)}function R(){var e=_();e.removeEventListener("mousedown",H,!0),e.removeEventListener("touchend",H,me),e.removeEventListener("touchstart",P,me),e.removeEventListener("touchmove",V,me)}function N(e,t){var n=k().box;function r(e){e.target===n&&(De(n,"remove",r),t())}if(0===e)return t();De(n,"remove",a),De(n,"add",r),a=r}function U(t,n,r){void 0===r&&(r=!1),we(b.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),v.push({node:e,eventType:t,handler:n,options:r})}))}function F(){var e;L()&&(U("touchstart",$,{passive:!0}),U("touchend",X,{passive:!0})),(e=b.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(U(e,$),e){case"mouseenter":U("mouseleave",X);break;case"focus":U(qe?"focusout":"blur",Y);break;case"focusin":U("focusout",Y)}}))}function z(){v.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,i=e.options;t.removeEventListener(n,r,i)})),v=[]}function $(e){var t,n=!1;if(b.state.isEnabled&&!J(e)&&!l){var r="focus"===(null==(t=o)?void 0:t.type);o=e,c=e.currentTarget,q(),!b.state.isVisible&&ge(e,"MouseEvent")&&Qe.forEach((function(t){return t(e)})),"click"===e.type&&(b.props.trigger.indexOf("mouseenter")<0||p)&&!1!==b.props.hideOnClick&&b.state.isVisible?n=!0:ee(e),"click"===e.type&&(p=!n),n&&!r&&te(e)}}function Q(e){var t=e.target,n=D().contains(t)||x.contains(t);if("mousemove"!==e.type||!n){var r=Z().concat(x).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:f}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,i=e.popperState,o=e.props.interactiveBorder,a=i.placement.split("-")[0],s=i.modifiersData.offset;if(!s)return!0;var c="bottom"===a?s.top.y:0,u="top"===a?s.bottom.y:0,f="right"===a?s.left.x:0,p="left"===a?s.right.x:0,l=t.top-r+c>o,d=r-t.bottom-u>o,m=t.left-n+f>o,v=n-t.right-p>o;return l||d||m||v}))})(r,e)&&(I(),te(e))}}function X(e){J(e)||b.props.trigger.indexOf("click")>=0&&p||(b.props.interactive?b.hideWithInteractivity(e):te(e))}function Y(e){b.props.trigger.indexOf("focusin")<0&&e.target!==D()||b.props.interactive&&e.relatedTarget&&x.contains(e.relatedTarget)||te(e)}function J(e){return!!ke.isTouch&&L()!==e.type.indexOf("touch")>=0}function G(){K();var t=b.props,n=t.popperOptions,r=t.placement,i=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=j()?Fe(x).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||D()}:e,f=[{name:"offset",options:{offset:i}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(j()){var n=k().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];j()&&c&&f.push({name:"arrow",options:{element:c,padding:3}}),f.push.apply(f,(null==n?void 0:n.modifiers)||[]),b.popperInstance=ue(u,x,Object.assign({},n,{placement:r,onFirstUpdate:s,modifiers:f}))}function K(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Z(){return Oe(x.querySelectorAll("[data-tippy-root]"))}function ee(e){b.clearDelayTimeouts(),e&&M("onTrigger",[b,e]),W();var t=S(!0),r=T(),i=r[0],o=r[1];ke.isTouch&&"hold"===i&&o&&(t=o),t?n=setTimeout((function(){b.show()}),t):b.show()}function te(e){if(b.clearDelayTimeouts(),M("onUntrigger",[b,e]),b.state.isVisible){if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&p)){var t=S(!1);t?r=setTimeout((function(){b.state.isVisible&&b.hide()}),t):i=requestAnimationFrame((function(){b.hide()}))}}else R()}}function Je(e,t){void 0===t&&(t={});var n=Ie.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",Ce,me),window.addEventListener("blur",Be);var r,i=Object.assign({},t,{plugins:n}),o=(r=e,Te(r)?[r]:function(e){return ge(e,"NodeList")}(r)?Oe(r):Array.isArray(r)?r:Oe(document.querySelectorAll(r))).reduce((function(e,t){var n=t&&Ye(t,i);return n&&e.push(n),e}),[]);return Te(e)?o[0]:o}Je.defaultProps=Ie,Je.setDefaultProps=function(e){Object.keys(e).forEach((function(t){Ie[t]=e[t]}))},Je.currentInput=ke,Object.assign({},Y,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),Je.setDefaultProps({render:ze});const Ge=Je;document.addEventListener("DOMContentLoaded",(function(){const e=document.getElementById("help-menu-template");if(!e)return;const t=document.createElement("div");t.appendChild(document.importNode(e.content,!0)),Ge(".classifai-help",{allowHTML:!0,content:t.innerHTML,trigger:"click",placement:"bottom-end",arrow:!0,animation:"scale",duration:[250,200],theme:"light",interactive:!0})})),(()=>{const e=document.getElementById("classifai-waston-cred-toggle"),t=document.getElementById("classifai-settings-watson_username");if(null===e||null===t)return;let n=null,r=null;t.closest("tr")?n=t.closest("tr"):t.closest(".classifai-setup-form-field")&&(n=t.closest(".classifai-setup-form-field")),document.getElementById("classifai-settings-watson_password").closest("tr")?[r]=document.getElementById("classifai-settings-watson_password").closest("tr").getElementsByTagName("label"):document.getElementById("classifai-settings-watson_password").closest(".classifai-setup-form-field")&&([r]=document.getElementById("classifai-settings-watson_password").closest(".classifai-setup-form-field").getElementsByTagName("label")),e.addEventListener("click",(i=>{if(i.preventDefault(),n.classList.toggle("hidden"),n.classList.contains("hidden"))return e.innerText=ClassifAI.use_password,r.innerText=ClassifAI.api_key,void(t.value="apikey");e.innerText=ClassifAI.use_key,r.innerText=ClassifAI.api_password}))})(),(()=>{const t=document.querySelectorAll("button.js-classifai-add-prompt-fieldset");t.length&&t.forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),function(t){const n=t.parentElement.querySelector(".classifai-field-type-prompt-setting").cloneNode(!0);(function(t,n){const r=n.querySelectorAll("fieldset"),i=Array.from(r).pop(),o=parseInt(i.querySelector("input").name.match(/\d+/).pop()),a=t.querySelectorAll("input, textarea"),s=t.querySelectorAll(".actions-rows .action__set_default");a.forEach((e=>{e.value="",e.removeAttribute("readonly"),e.name=e.name.replace(/(\d+)/g,(()=>o+1))})),s.forEach((t=>{t.classList.remove("selected"),t.textContent=(0,e.__)("Set as default prompt","classifai")}))})(n,t.closest("tr")),r(n),n.querySelector(".classifai-original-prompt").remove(),n.querySelector(".action__remove_prompt").style.display="block",t.insertAdjacentElement("afterend",n)}(t.target.previousElementSibling)}))}));const n=document.querySelectorAll(".classifai-field-type-prompt-setting");function r(t){t.querySelector("a.action__remove_prompt").addEventListener("click",(t=>{var n;t.preventDefault(),n=t.target,jQuery("#js-classifai--delete-prompt-modal").dialog({modal:!0,title:(0,e.__)("Remove Prompt","classifai"),width:550,buttons:[{text:(0,e.__)("Cancel","classifai"),class:"button-secondary",click(){jQuery(this).dialog("close")}},{text:(0,e.__)("Remove","classifai"),class:"button-primary",click(){const e=n.closest("fieldset"),t=e.parentElement,r="1"===e.querySelector(".js-setting-field__default").value,i=2===t.querySelectorAll("fieldset").length;e.remove(),r&&t.querySelector("fieldset .action__set_default").click(),i&&(t.querySelector(".action__remove_prompt").style.display="none"),jQuery(this).dialog("close")},style:"margin-left: 10px;"}]})})),t.querySelector("a.action__set_default").addEventListener("click",(n=>{n.preventDefault(),n.target.classList.contains("selected")||(n.target.closest("tr").querySelectorAll(".action__set_default").forEach((t=>{t.classList.contains("selected")&&(t.textContent=(0,e.__)("Set as default prompt","classifai")),t.classList.remove("selected"),t.closest("fieldset").querySelector(".js-setting-field__default").value=""})),n.target.classList.add("selected"),n.target.textContent=(0,e.__)("Default prompt","classifai"),t.querySelector(".js-setting-field__default").value="1")}))}n.length&&n.forEach((e=>{r(e)}))})()})(); \ No newline at end of file diff --git a/includes/Classifai/Admin/SavePostHandler.php b/includes/Classifai/Admin/SavePostHandler.php index 6a8df50fe..0b8ba9f03 100644 --- a/includes/Classifai/Admin/SavePostHandler.php +++ b/includes/Classifai/Admin/SavePostHandler.php @@ -64,7 +64,7 @@ public function is_configured() { * * Skips classification if running under the Gutenberg Metabox * compatibility request. The classification is performed during the REST - * lifecyle when using Gutenberg. + * lifecycle when using Gutenberg. * * @param int $post_id The post that was saved */ diff --git a/includes/Classifai/Blocks.php b/includes/Classifai/Blocks.php index fd6eaf5d0..785e80d05 100644 --- a/includes/Classifai/Blocks.php +++ b/includes/Classifai/Blocks.php @@ -48,7 +48,7 @@ function blocks_styles() { 'recommended-content-block-style', CLASSIFAI_PLUGIN_URL . 'dist/recommended-content-block-frontend.css', [], - CLASSIFAI_PLUGIN_VERSION + get_asset_info( 'recommended-content-block-frontend', 'version' ) ); wp_enqueue_script( diff --git a/includes/Classifai/Command/ClassifaiCommand.php b/includes/Classifai/Command/ClassifaiCommand.php index fb6050b8a..bc677063c 100644 --- a/includes/Classifai/Command/ClassifaiCommand.php +++ b/includes/Classifai/Command/ClassifaiCommand.php @@ -750,7 +750,7 @@ private function should_transcribe_attachment( $attachment, int $attachment_id, * ## Options * * [] - * : Comma delimeted Attachment IDs to classify + * : Comma delimited Attachment IDs to classify * * [--limit=] * : Limit classification to N attachments. Default 100. @@ -1219,7 +1219,7 @@ private function get_attachment_to_classify( $opts = [] ) { /** * Prints the output from the NLU API. * - * @param mixed $output The variable to oputput. + * @param mixed $output The variable to output. * @param int $post_id The post id. */ private function print( $output, $post_id ) { diff --git a/includes/Classifai/Plugin.php b/includes/Classifai/Plugin.php index d9aad7b04..255b29db9 100644 --- a/includes/Classifai/Plugin.php +++ b/includes/Classifai/Plugin.php @@ -158,6 +158,8 @@ public function add_privacy_policy_content() { /** * Enqueue the admin scripts. + * + * @since 2.4.0 Use get_asset_info to get the asset version and dependencies. */ public function enqueue_admin_assets() { @@ -165,15 +167,15 @@ public function enqueue_admin_assets() { 'classifai-admin-style', CLASSIFAI_PLUGIN_URL . 'dist/admin.css', array(), - CLASSIFAI_PLUGIN_VERSION, + get_asset_info( 'admin', 'version' ), 'all' ); wp_enqueue_script( 'classifai-admin-script', CLASSIFAI_PLUGIN_URL . 'dist/admin.js', - [], - CLASSIFAI_PLUGIN_VERSION, + get_asset_info( 'admin', 'dependencies' ), + get_asset_info( 'admin', 'version' ), true ); diff --git a/includes/Classifai/Providers/Azure/ComputerVision.php b/includes/Classifai/Providers/Azure/ComputerVision.php index 5fdabe5e3..3ea2f275e 100644 --- a/includes/Classifai/Providers/Azure/ComputerVision.php +++ b/includes/Classifai/Providers/Azure/ComputerVision.php @@ -1193,7 +1193,7 @@ public function sanitize_settings( $settings ) { } /** - * Authenitcates our credentials. + * Authenticates our credentials. * * @param string $url Endpoint URL. * @param string $api_key Api Key. diff --git a/includes/Classifai/Providers/Azure/Read.php b/includes/Classifai/Providers/Azure/Read.php index dfb45a4d6..c1a5abb62 100644 --- a/includes/Classifai/Providers/Azure/Read.php +++ b/includes/Classifai/Providers/Azure/Read.php @@ -147,7 +147,7 @@ public function read_document() { * Filters the request arguments sent to Read endpoint. * * @since 1.7.0 - * @hook classifai_azure_read_should_process + * @hook classifai_azure_read_request_args * * @param {array} $args Whether to run OCR processing or not. * @param {int} $attachment_id The attachment ID. @@ -277,7 +277,7 @@ public function check_read_result( $operation_url ) { } /** - * Update document desctiption using text received from Read API. + * Update document description using text received from Read API. * * @param array $data Read result. * diff --git a/includes/Classifai/Providers/Azure/TextToSpeech.php b/includes/Classifai/Providers/Azure/TextToSpeech.php index d978f89a7..e4a2906de 100644 --- a/includes/Classifai/Providers/Azure/TextToSpeech.php +++ b/includes/Classifai/Providers/Azure/TextToSpeech.php @@ -85,6 +85,8 @@ public function __construct( $service ) { /** * Enqueue the editor scripts. + * + * @since 2.4.0 Use get_asset_info to get the asset version and dependencies. */ public function enqueue_editor_assets() { $post = get_post(); @@ -102,8 +104,8 @@ public function enqueue_editor_assets() { wp_enqueue_script( 'classifai-gutenberg-plugin', CLASSIFAI_PLUGIN_URL . 'dist/gutenberg-plugin.js', - array( 'lodash', 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor', 'wp-edit-post', 'wp-components', 'wp-data', 'wp-plugins' ), - CLASSIFAI_PLUGIN_VERSION, + array_merge( get_asset_info( 'gutenberg-plugin', 'dependencies' ), array( 'lodash' ) ), + get_asset_info( 'gutenberg-plugin', 'version' ), true ); @@ -719,7 +721,7 @@ public function save_post_metadata( $post_id ) { } /** - * Adds audio controls to the post that has speech sythesis enabled. + * Adds audio controls to the post that has speech synthesis enabled. * * @param string $content Post content. * @return string diff --git a/includes/Classifai/Providers/OpenAI/APIRequest.php b/includes/Classifai/Providers/OpenAI/APIRequest.php index 333954e2c..5ffb23728 100644 --- a/includes/Classifai/Providers/OpenAI/APIRequest.php +++ b/includes/Classifai/Providers/OpenAI/APIRequest.php @@ -25,13 +25,22 @@ class APIRequest { */ public $api_key; + /** + * The feature name. + * + * @var string + */ + public $feature; + /** * OpenAI APIRequest constructor. * * @param string $api_key OpenAI API key. + * @param string $feature Feature name. */ - public function __construct( string $api_key = '' ) { + public function __construct( string $api_key = '', string $feature = '' ) { $this->api_key = $api_key; + $this->feature = $feature; } /** @@ -42,8 +51,55 @@ public function __construct( string $api_key = '' ) { * @return array|WP_Error */ public function get( string $url, array $options = [] ) { + /** + * Filter the URL for the get request. + * + * @since 2.4.0 + * @hook classifai_openai_api_request_get_url + * + * @param {string} $url The URL for the request. + * @param {array} $options The options for the request. + * @param {string} $this->feature The feature name. + * + * @return {string} The URL for the request. + */ + $url = apply_filters( 'classifai_openai_api_request_get_url', $url, $options, $this->feature ); + + /** + * Filter the options for the get request. + * + * @since 2.4.0 + * @hook classifai_openai_api_request_get_options + * + * @param {array} $options The options for the request. + * @param {string} $url The URL for the request. + * @param {string} $this->feature The feature name. + * + * @return {array} The options for the request. + */ + $options = apply_filters( 'classifai_openai_api_request_get_options', $options, $url, $this->feature ); + $this->add_headers( $options ); - return $this->get_result( wp_remote_get( $url, $options ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get + + /** + * Filter the response from OpenAI for a get request. + * + * @since 2.4.0 + * @hook classifai_openai_api_response_get + * + * @param {string} $url Request URL. + * @param {array} $options Request body options. + * @param {string} $this->feature Feature name. + * + * @return {array} API response. + */ + return apply_filters( + 'classifai_openai_api_response_get', + $this->get_result( wp_remote_get( $url, $options ) ), // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get + $url, + $options, + $this->feature + ); } /** @@ -60,8 +116,56 @@ public function post( string $url = '', array $options = [] ) { 'timeout' => 60, // phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout ] ); + + /** + * Filter the URL for the post request. + * + * @since 2.4.0 + * @hook classifai_openai_api_request_post_url + * + * @param {string} $url The URL for the request. + * @param {array} $options The options for the request. + * @param {string} $this->feature The feature name. + * + * @return {string} The URL for the request. + */ + $url = apply_filters( 'classifai_openai_api_request_post_url', $url, $options, $this->feature ); + + /** + * Filter the options for the post request. + * + * @since 2.4.0 + * @hook classifai_openai_api_request_post_options + * + * @param {array} $options The options for the request. + * @param {string} $url The URL for the request. + * @param {string} $this->feature The feature name. + * + * @return {array} The options for the request. + */ + $options = apply_filters( 'classifai_openai_api_request_post_options', $options, $url, $this->feature ); + $this->add_headers( $options ); - return $this->get_result( wp_remote_post( $url, $options ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get + + /** + * Filter the response from OpenAI for a post request. + * + * @since 2.4.0 + * @hook classifai_openai_api_response_post + * + * @param {string} $url Request URL. + * @param {array} $options Request body options. + * @param {string} $this->feature Feature name. + * + * @return {array} API response. + */ + return apply_filters( + 'classifai_openai_api_response_post', + $this->get_result( wp_remote_post( $url, $options ) ), // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get + $url, + $options, + $this->feature + ); } /** @@ -72,6 +176,19 @@ public function post( string $url = '', array $options = [] ) { * @return array|WP_Error */ public function post_form( string $url = '', array $body = [] ) { + /** + * Filter the URL for the post form request. + * + * @since 2.4.0 + * @hook classifai_openai_api_request_post_form_url + * + * @param {string} $url The URL for the request. + * @param {string} $this->feature The feature name. + * + * @return {string} The URL for the request. + */ + $url = apply_filters( 'classifai_openai_api_request_post_form_url', $url, $this->feature ); + $boundary = wp_generate_password( 24, false ); $payload = ''; @@ -95,17 +212,54 @@ public function post_form( string $url = '', array $body = [] ) { $payload .= '--' . $boundary . '--'; - $options = [ - 'body' => $payload, - 'headers' => [ - 'Content-Type' => 'multipart/form-data; boundary=' . $boundary, + /** + * Filter the options for the post form request. + * + * @since 2.4.0 + * @hook classifai_openai_api_request_post_form_options + * + * @param {array} $options The options for the request. + * @param {string} $url The URL for the request. + * @param {array} $body The body of the request. + * @param {string} $this->feature The feature name. + * + * @return {array} The options for the request. + */ + $options = apply_filters( + 'classifai_openai_api_request_post_form_options', + [ + 'body' => $payload, + 'headers' => [ + 'Content-Type' => 'multipart/form-data; boundary=' . $boundary, + ], + 'timeout' => 60, // phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout ], - 'timeout' => 60, // phpcs:ignore WordPressVIPMinimum.Performance.RemoteRequestTimeout.timeout_timeout - ]; + $url, + $body, + $this->feature + ); $this->add_headers( $options ); - return $this->get_result( wp_remote_post( $url, $options ) ); + /** + * Filter the response from OpenAI for a post form request. + * + * @since 2.4.0 + * @hook classifai_openai_api_response_post_form + * + * @param {string} $url Request URL. + * @param {array} $options Request body options. + * @param {string} $this->feature Feature name. + * + * @return {array} API response. + */ + return apply_filters( + 'classifai_openai_api_response_post_form', + $this->get_result( wp_remote_post( $url, $options ) ), // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_remote_get_wp_remote_get + $url, + $options, + $this->feature + ); } /** diff --git a/includes/Classifai/Providers/OpenAI/ChatGPT.php b/includes/Classifai/Providers/OpenAI/ChatGPT.php index 95669a16f..2290d9bca 100644 --- a/includes/Classifai/Providers/OpenAI/ChatGPT.php +++ b/includes/Classifai/Providers/OpenAI/ChatGPT.php @@ -35,6 +35,34 @@ class ChatGPT extends Provider { */ protected $max_tokens = 4096; + /** + * Prompt for generating excerpts + * + * @var string + */ + protected $generate_excerpt_prompt = 'Summarize the following message using a maximum of {{WORDS}} words. Ensure this summary pairs well with the following text: {{TITLE}}.'; + + /** + * Prompt for generating titles + * + * @var string + */ + protected $generate_title_prompt = 'Write an SEO-friendly title for the following content that will encourage readers to clickthrough, staying within a range of 40 to 60 characters.'; + + /** + * Prompt for shrinking content + * + * @var string + */ + protected $shrink_content_prompt = 'Decrease the content length no more than 2 to 4 sentences.'; + + /** + * Prompt for growing content + * + * @var string + */ + protected $grow_content_prompt = 'Increase the content length no more than 2 to 4 sentences.'; + /** * OpenAI ChatGPT constructor. * @@ -188,7 +216,7 @@ public function enqueue_editor_assets() { 'classifai-content-resizing-plugin-css', CLASSIFAI_PLUGIN_URL . 'dist/content-resizing-plugin.css', [], - CLASSIFAI_PLUGIN_VERSION, + get_asset_info( 'content-resizing-plugin', 'version' ), 'all' ); } @@ -199,90 +227,108 @@ public function enqueue_editor_assets() { * * @param string $hook_suffix The current admin page. */ - public function enqueue_admin_assets( $hook_suffix = '' ) { - if ( 'post.php' !== $hook_suffix && 'post-new.php' !== $hook_suffix ) { - return; + public function enqueue_admin_assets( string $hook_suffix ) { + // Load asset in OpenAI ChatGPT settings page. + if ( + 'tools_page_classifai' === $hook_suffix + && ( isset( $_GET['tab'], $_GET['provider'] ) ) // phpcs:ignore + && 'language_processing' === $_GET['tab'] // phpcs:ignore + && 'openai_chatgpt' === $_GET['provider'] // phpcs:ignore + ) { + wp_enqueue_script( 'jquery-ui-dialog' ); + wp_enqueue_style( 'wp-jquery-ui-dialog' ); + + add_action( + 'admin_footer', + static function () { + printf( + '', + esc_html__( 'Are you sure you want to delete the prompt?', 'classifai' ), + ); + } + ); } - $screen = get_current_screen(); - $settings = $this->get_settings(); - - // Load the assets for the classic editor. - if ( $screen && ! $screen->is_block_editor() ) { - if ( - post_type_supports( $screen->post_type, 'title' ) && - $this->is_feature_enabled( 'enable_titles' ) - ) { - wp_enqueue_style( - 'classifai-generate-title-classic-css', - CLASSIFAI_PLUGIN_URL . 'dist/generate-title-classic.css', - [], - CLASSIFAI_PLUGIN_VERSION, - 'all' - ); - - wp_enqueue_script( - 'classifai-generate-title-classic-js', - CLASSIFAI_PLUGIN_URL . 'dist/generate-title-classic.js', - array_merge( get_asset_info( 'generate-title-classic', 'dependencies' ), array( 'wp-api' ) ), - get_asset_info( 'generate-title-classic', 'version' ), - true - ); + // Load asset in new post and edit post screens. + if ( 'post.php' === $hook_suffix || 'post-new.php' === $hook_suffix ) { + $screen = get_current_screen(); + + // Load the assets for the classic editor. + if ( $screen && ! $screen->is_block_editor() ) { + if ( + post_type_supports( $screen->post_type, 'title' ) && + $this->is_feature_enabled( 'enable_titles' ) + ) { + wp_enqueue_style( + 'classifai-generate-title-classic-css', + CLASSIFAI_PLUGIN_URL . 'dist/generate-title-classic.css', + [], + get_asset_info( 'generate-title-classic', 'version' ), + 'all' + ); + + wp_enqueue_script( + 'classifai-generate-title-classic-js', + CLASSIFAI_PLUGIN_URL . 'dist/generate-title-classic.js', + array_merge( get_asset_info( 'generate-title-classic', 'dependencies' ), array( 'wp-api' ) ), + get_asset_info( 'generate-title-classic', 'version' ), + true + ); + + wp_add_inline_script( + 'classifai-generate-title-classic-js', + sprintf( + 'var classifaiChatGPTData = %s;', + wp_json_encode( $this->get_localised_vars() ) + ), + 'before' + ); + } - wp_add_inline_script( - 'classifai-generate-title-classic-js', - sprintf( - 'var classifaiChatGPTData = %s;', - wp_json_encode( $this->get_localised_vars() ) - ), - 'before' - ); + if ( + post_type_supports( $screen->post_type, 'excerpt' ) && + $this->is_feature_enabled( 'enable_excerpt' ) + ) { + wp_enqueue_style( + 'classifai-generate-title-classic-css', + CLASSIFAI_PLUGIN_URL . 'dist/generate-title-classic.css', + [], + get_asset_info( 'generate-title-classic', 'version' ), + 'all' + ); + + wp_enqueue_script( + 'classifai-generate-excerpt-classic-js', + CLASSIFAI_PLUGIN_URL . 'dist/generate-excerpt-classic.js', + array_merge( get_asset_info( 'generate-excerpt-classic', 'dependencies' ), array( 'wp-api' ) ), + get_asset_info( 'generate-excerpt-classic', 'version' ), + true + ); + + wp_add_inline_script( + 'classifai-generate-excerpt-classic-js', + sprintf( + 'var classifaiGenerateExcerpt = %s;', + wp_json_encode( + [ + 'path' => '/classifai/v1/openai/generate-excerpt/', + 'buttonText' => __( 'Generate excerpt', 'classifai' ), + 'regenerateText' => __( 'Re-generate excerpt', 'classifai' ), + ] + ) + ), + 'before' + ); + } } - if ( - post_type_supports( $screen->post_type, 'excerpt' ) && - $this->is_feature_enabled( 'enable_excerpt' ) - ) { - wp_enqueue_style( - 'classifai-generate-title-classic-css', - CLASSIFAI_PLUGIN_URL . 'dist/generate-title-classic.css', - [], - CLASSIFAI_PLUGIN_VERSION, - 'all' - ); - - wp_enqueue_script( - 'classifai-generate-excerpt-classic-js', - CLASSIFAI_PLUGIN_URL . 'dist/generate-excerpt-classic.js', - array_merge( get_asset_info( 'generate-excerpt-classic', 'dependencies' ), array( 'wp-api' ) ), - get_asset_info( 'generate-excerpt-classic', 'version' ), - true - ); - - wp_add_inline_script( - 'classifai-generate-excerpt-classic-js', - sprintf( - 'var classifaiGenerateExcerpt = %s;', - wp_json_encode( - [ - 'path' => '/classifai/v1/openai/generate-excerpt/', - 'buttonText' => __( 'Generate excerpt', 'classifai' ), - 'regenerateText' => __( 'Re-generate excerpt', 'classifai' ), - ] - ) - ), - 'before' - ); - } + wp_enqueue_style( + 'classifai-language-processing-style', + CLASSIFAI_PLUGIN_URL . 'dist/language-processing.css', + [], + get_asset_info( 'language-processing', 'version' ), + ); } - - wp_enqueue_style( - 'classifai-language-processing-style', - CLASSIFAI_PLUGIN_URL . 'dist/language-processing.css', - [], - CLASSIFAI_PLUGIN_VERSION, - 'all' - ); } /** @@ -379,6 +425,21 @@ public function setup_fields_sections() { ] ); + // Custom prompt for excerpt generation. + add_settings_field( + 'generate_excerpt_prompt', + esc_html__( 'Prompt', 'classifai' ), + [ $this, 'render_prompt_repeater_field' ], + $this->get_option_name(), + $this->get_option_name() . '_excerpt', + [ + 'label_for' => 'generate_excerpt_prompt', + 'placeholder' => $this->generate_excerpt_prompt, + 'default_value' => $default_settings['generate_excerpt_prompt'], + 'description' => __( 'Note the following variables that can be used in the prompt and will be replaced with content: {{WORDS}} will be replaced with the desired excerpt length setting. {{TITLE}} will be replaced with the item\'s title.', 'classifai' ), + ] + ); + // Add title fields. add_settings_section( $this->get_option_name() . '_title', @@ -429,10 +490,24 @@ public function setup_fields_sections() { ] ); - // Add resizing content fields. + // Custom prompt for generating titles. + add_settings_field( + 'generate_title_prompt', + esc_html__( 'Prompt', 'classifai' ), + [ $this, 'render_prompt_repeater_field' ], + $this->get_option_name(), + $this->get_option_name() . '_title', + [ + 'label_for' => 'generate_title_prompt', + 'placeholder' => $this->generate_title_prompt, + 'default_value' => $default_settings['generate_title_prompt'], + ] + ); + + // Add content resizing fields. add_settings_section( $this->get_option_name() . '_resize_content_settings', - esc_html__( 'Resizing content settings', 'classifai' ), + esc_html__( 'Content resizing settings', 'classifai' ), '', $this->get_option_name() ); @@ -447,7 +522,7 @@ public function setup_fields_sections() { 'label_for' => 'enable_resize_content', 'input_type' => 'checkbox', 'default_value' => $default_settings['enable_resize_content'], - 'description' => __( '"Shrink content" and "Grow content" menu items will be added to the paragraph block\'s toolbar menu.', 'classifai' ), + 'description' => __( '"Condense this text" and "Expand this text" menu items will be added to the paragraph block\'s toolbar menu.', 'classifai' ), ] ); @@ -482,6 +557,34 @@ public function setup_fields_sections() { 'description' => __( 'Number of suggestions that will be generated in one request.', 'classifai' ), ] ); + + // Custom prompt for shrinking content. + add_settings_field( + 'shrink_content_prompt', + esc_html__( 'Condense text prompt', 'classifai' ), + [ $this, 'render_prompt_repeater_field' ], + $this->get_option_name(), + $this->get_option_name() . '_resize_content_settings', + [ + 'label_for' => 'shrink_content_prompt', + 'placeholder' => $this->shrink_content_prompt, + 'default_value' => $default_settings['shrink_content_prompt'], + ] + ); + + // Custom prompt for growing content. + add_settings_field( + 'grow_content_prompt', + esc_html__( 'Expand text prompt', 'classifai' ), + [ $this, 'render_prompt_repeater_field' ], + $this->get_option_name(), + $this->get_option_name() . '_resize_content_settings', + [ + 'label_for' => 'grow_content_prompt', + 'placeholder' => $this->grow_content_prompt, + 'default_value' => $default_settings['grow_content_prompt'], + ] + ); } /** @@ -516,6 +619,12 @@ public function sanitize_settings( $settings ) { $new_settings['length'] = 55; } + if ( isset( $settings['generate_excerpt_prompt'] ) && is_array( $settings['generate_excerpt_prompt'] ) ) { + $new_settings['generate_excerpt_prompt'] = $this->sanitize_prompts( $settings['generate_excerpt_prompt'] ); + } else { + $new_settings['generate_excerpt_prompt'] = array(); + } + if ( empty( $settings['enable_titles'] ) || 1 !== (int) $settings['enable_titles'] ) { $new_settings['enable_titles'] = 'no'; } else { @@ -534,6 +643,12 @@ public function sanitize_settings( $settings ) { $new_settings['number_titles'] = 1; } + if ( isset( $settings['generate_title_prompt'] ) && is_array( $settings['generate_title_prompt'] ) ) { + $new_settings['generate_title_prompt'] = $this->sanitize_prompts( $settings['generate_title_prompt'] ); + } else { + $new_settings['generate_title_prompt'] = array(); + } + if ( empty( $settings['enable_resize_content'] ) || 1 !== (int) $settings['enable_resize_content'] ) { $new_settings['enable_resize_content'] = 'no'; } else { @@ -552,6 +667,18 @@ public function sanitize_settings( $settings ) { $new_settings['number_resize_content'] = 1; } + if ( isset( $settings['shrink_content_prompt'] ) && is_array( $settings['shrink_content_prompt'] ) ) { + $new_settings['shrink_content_prompt'] = $this->sanitize_prompts( $settings['shrink_content_prompt'] ); + } else { + $new_settings['shrink_content_prompt'] = array(); + } + + if ( isset( $settings['grow_content_prompt'] ) && is_array( $settings['grow_content_prompt'] ) ) { + $new_settings['grow_content_prompt'] = $this->sanitize_prompts( $settings['grow_content_prompt'] ); + } else { + $new_settings['grow_content_prompt'] = array(); + } + return $new_settings; } @@ -573,18 +700,48 @@ public function get_default_settings() { } $editable_roles = get_editable_roles() ?? []; + $excerpt_length = absint( apply_filters( 'excerpt_length', 55 ) ); + return [ - 'authenticated' => false, - 'api_key' => '', - 'enable_excerpt' => false, - 'roles' => array_keys( $editable_roles ), - 'length' => (int) apply_filters( 'excerpt_length', 55 ), - 'enable_titles' => false, - 'title_roles' => array_keys( $editable_roles ), - 'number_titles' => 1, - 'enable_resize_content' => false, - 'resize_content_roles' => array_keys( $editable_roles ), - 'number_resize_content' => 1, + 'authenticated' => false, + 'api_key' => '', + 'enable_excerpt' => false, + 'roles' => array_keys( $editable_roles ), + 'length' => $excerpt_length, + 'generate_excerpt_prompt' => array( + array( + 'title' => esc_html__( 'ClassifAI default', 'classifai' ), + 'prompt' => $this->generate_excerpt_prompt, + 'original' => 1, + ), + ), + 'enable_titles' => false, + 'title_roles' => array_keys( $editable_roles ), + 'number_titles' => 1, + 'generate_title_prompt' => array( + array( + 'title' => esc_html__( 'ClassifAI default', 'classifai' ), + 'prompt' => $this->generate_title_prompt, + 'original' => 1, + ), + ), + 'enable_resize_content' => false, + 'resize_content_roles' => array_keys( $editable_roles ), + 'number_resize_content' => 1, + 'shrink_content_prompt' => array( + array( + 'title' => esc_html__( 'ClassifAI default', 'classifai' ), + 'prompt' => $this->shrink_content_prompt, + 'original' => 1, + ), + ), + 'grow_content_prompt' => array( + array( + 'title' => esc_html__( 'ClassifAI default', 'classifai' ), + 'prompt' => $this->grow_content_prompt, + 'original' => 1, + ), + ), ]; } @@ -680,7 +837,14 @@ public function generate_excerpt( int $post_id = 0, array $args = [] ) { $excerpt_length = absint( $settings['length'] ?? 55 ); - $request = new APIRequest( $settings['api_key'] ?? '' ); + $request = new APIRequest( $settings['api_key'] ?? '', $this->get_option_name() ); + + $excerpt_prompt = esc_textarea( $this->get_default_prompt( $settings['generate_excerpt_prompt'] ) ?? $this->generate_excerpt_prompt ); + + // Replace our variables in the prompt. + $prompt_search = array( '{{WORDS}}', '{{TITLE}}' ); + $prompt_replace = array( $excerpt_length, $args['title'] ); + $prompt = str_replace( $prompt_search, $prompt_replace, $excerpt_prompt ); /** * Filter the prompt we will send to ChatGPT. @@ -694,7 +858,7 @@ public function generate_excerpt( int $post_id = 0, array $args = [] ) { * * @return {string} Prompt. */ - $prompt = apply_filters( 'classifai_chatgpt_excerpt_prompt', sprintf( 'Summarize the following message using a maximum of %d words. Ensure this summary pairs well with the following text: %s.', $excerpt_length, $args['title'] ), $post_id, $excerpt_length ); + $prompt = apply_filters( 'classifai_chatgpt_excerpt_prompt', $prompt, $post_id, $excerpt_length ); /** * Filter the request body before sending to ChatGPT. @@ -776,7 +940,9 @@ public function generate_titles( int $post_id = 0, array $args = [] ) { return new WP_Error( 'not_enabled', esc_html__( 'Title generation is disabled or OpenAI authentication failed. Please check your settings.', 'classifai' ) ); } - $request = new APIRequest( $settings['api_key'] ?? '' ); + $request = new APIRequest( $settings['api_key'] ?? '', $this->get_option_name() ); + + $prompt = esc_textarea( $this->get_default_prompt( $settings['generate_title_prompt'] ) ?? $this->generate_title_prompt ); /** * Filter the prompt we will send to ChatGPT. @@ -790,7 +956,7 @@ public function generate_titles( int $post_id = 0, array $args = [] ) { * * @return {string} Prompt. */ - $prompt = apply_filters( 'classifai_chatgpt_title_prompt', 'Write an SEO-friendly title for the following content that will encourage readers to clickthrough, staying within a range of 40 to 60 characters.', $post_id, $args ); + $prompt = apply_filters( 'classifai_chatgpt_title_prompt', $prompt, $post_id, $args ); /** * Filter the request body before sending to ChatGPT. @@ -873,18 +1039,19 @@ public function resize_content( int $post_id, array $args = array() ) { ] ); - $request = new APIRequest( $settings['api_key'] ?? '' ); + $request = new APIRequest( $settings['api_key'] ?? '', $this->get_option_name() ); if ( 'shrink' === $args['resize_type'] ) { - $prompt = 'Decrease the content length no more than 2 to 4 sentences.'; + $prompt = esc_textarea( $this->get_default_prompt( $settings['shrink_content_prompt'] ) ?? $this->shrink_content_prompt ); } else { - $prompt = 'Increase the content length no more than 2 to 4 sentences.'; + $prompt = esc_textarea( $this->get_default_prompt( $settings['grow_content_prompt'] ) ?? $this->grow_content_prompt ); } /** * Filter the resize prompt we will send to ChatGPT. * * @since 2.3.0 + * @hook classifai_chatgpt_' . $args['resize_type'] . '_content_prompt * * @param {string} $prompt Resize prompt we are sending to ChatGPT. Gets added as a system prompt. * @param {int} $post_id ID of post. @@ -1018,4 +1185,82 @@ public function get_content( int $post_id = 0, int $return_length = 0, bool $use return apply_filters( 'classifai_chatgpt_content', $content, $post_id ); } + /** + * Sanitize the prompt data. + * This is used for the repeater field. + * + * @since 2.4.0 + * + * @param array $prompts Prompt data. + * + * @return array Sanitized prompt data. + */ + public function sanitize_prompts( array $prompts ): array { + // Remove any prompts that don't have a title and prompt. + $prompts = array_filter( + $prompts, + function ( $prompt ) { + return ! empty( $prompt['title'] ) && ! empty( $prompt['prompt'] ); + } + ); + + // Sanitize the prompts and make sure only one prompt is marked as default. + $has_default = false; + + $prompts = array_map( + function ( $prompt ) use ( &$has_default ) { + $default = $prompt['default'] && ! $has_default; + + if ( $default ) { + $has_default = true; + } + + return array( + 'title' => sanitize_text_field( $prompt['title'] ), + 'prompt' => sanitize_textarea_field( $prompt['prompt'] ), + 'default' => absint( $default ), + 'original' => absint( $prompt['original'] ), + ); + }, + $prompts + ); + + // If there is no default, use the first prompt. + if ( false === $has_default && ! empty( $prompts ) ) { + $prompts[0]['default'] = 1; + } + + return $prompts; + } + + /** + * Get the default prompt for use. + * + * @since 2.4.0 + * + * @param array $prompts Prompt data. + * + * @return string|null Default prompt. + */ + public function get_default_prompt( array $prompts ): ?string { + $default_prompt = null; + + if ( ! empty( $prompts ) ) { + $prompt_data = array_filter( + $prompts, + function ( $prompt ) { + return $prompt['default'] && ! $prompt['original']; + } + ); + + if ( ! empty( $prompt_data ) ) { + $default_prompt = current( $prompt_data )['prompt']; + } elseif ( ! empty( $prompts[0]['prompt'] ) && ! $prompts[0]['original'] ) { + // If there is no default, use the first prompt, unless it's the original prompt. + $default_prompt = $prompts[0]['prompt']; + } + } + + return $default_prompt; + } } diff --git a/includes/Classifai/Providers/OpenAI/DallE.php b/includes/Classifai/Providers/OpenAI/DallE.php index 7a3b4a070..ffc279cf9 100644 --- a/includes/Classifai/Providers/OpenAI/DallE.php +++ b/includes/Classifai/Providers/OpenAI/DallE.php @@ -84,6 +84,8 @@ public function register_generate_media_page() { /** * Enqueue the admin scripts. * + * @since 2.4.0 Use get_asset_info to get the asset version and dependencies. + * * @param string $hook_suffix The current admin page. */ public function enqueue_admin_scripts( $hook_suffix = '' ) { @@ -100,14 +102,14 @@ public function enqueue_admin_scripts( $hook_suffix = '' ) { 'classifai-image-processing-style', CLASSIFAI_PLUGIN_URL . 'dist/media-modal.css', [], - CLASSIFAI_PLUGIN_VERSION, + get_asset_info( 'media-modal', 'version' ), 'all' ); wp_enqueue_script( 'classifai-generate-images', CLASSIFAI_PLUGIN_URL . 'dist/media-modal.js', - [ 'jquery', 'wp-api', 'wp-media-utils', 'wp-url' ], + array_merge( get_asset_info( 'media-modal', 'dependencies' ), array( 'jquery', 'wp-api' ) ), get_asset_info( 'media-modal', 'version' ), true ); @@ -158,7 +160,7 @@ public function enqueue_admin_scripts( $hook_suffix = '' ) { wp_enqueue_script( 'classifai-generate-images-media-upload', CLASSIFAI_PLUGIN_URL . 'dist/generate-image-media-upload.js', - [ 'jquery' ], + array_merge( get_asset_info( 'generate-image-media-upload', 'dependencies' ), array( 'jquery' ) ), get_asset_info( 'classifai-generate-images-media-upload', 'version' ), true ); @@ -482,7 +484,7 @@ public function generate_image_callback( string $prompt = '', array $args = [] ) return new WP_Error( 'invalid_param', esc_html__( 'Your image prompt is too long. Please ensure it doesn\'t exceed 1000 characters.', 'classifai' ) ); } - $request = new APIRequest( $settings['api_key'] ?? '' ); + $request = new APIRequest( $settings['api_key'] ?? '', 'generate-image' ); /** * Filter the request body before sending to DALL·E. diff --git a/includes/Classifai/Providers/OpenAI/Embeddings.php b/includes/Classifai/Providers/OpenAI/Embeddings.php index f82b93891..103c1edc3 100644 --- a/includes/Classifai/Providers/OpenAI/Embeddings.php +++ b/includes/Classifai/Providers/OpenAI/Embeddings.php @@ -95,7 +95,7 @@ public function enqueue_editor_assets() { wp_enqueue_script( 'classifai-gutenberg-plugin', CLASSIFAI_PLUGIN_URL . 'dist/gutenberg-plugin.js', - get_asset_info( 'gutenberg-plugin', 'dependencies' ), + array_merge( get_asset_info( 'gutenberg-plugin', 'dependencies' ), array( 'lodash' ) ), get_asset_info( 'gutenberg-plugin', 'version' ), true ); @@ -580,7 +580,7 @@ public function generate_embeddings( int $id = 0, $type = 'post' ) { return false; } - $request = new APIRequest( $settings['api_key'] ?? '' ); + $request = new APIRequest( $settings['api_key'] ?? '', $this->get_option_name() ); /** * Filter the request body before sending to OpenAI. diff --git a/includes/Classifai/Providers/OpenAI/Tokenizer.php b/includes/Classifai/Providers/OpenAI/Tokenizer.php index 70663a570..6785fe446 100644 --- a/includes/Classifai/Providers/OpenAI/Tokenizer.php +++ b/includes/Classifai/Providers/OpenAI/Tokenizer.php @@ -35,6 +35,32 @@ class Tokenizer { */ public function __construct( $max_tokens ) { $this->max_tokens = $max_tokens; + + /** + * How many characters in one token (roughly) + * + * @since 2.4..0 + * @hook classifai_openai_characters_in_token + * + * @param {int} $characters_in_token How many characters in one token (roughly) + * @param {int} $max_tokens Maximum tokens the model supports. + * + * @return {int} + */ + $this->characters_in_token = apply_filters( 'classifai_openai_characters_in_token', $this->characters_in_token, $max_tokens ); + + /** + * How many tokens a word will take (roughly) + * + * @since 2.4.0 + * @hook classifai_openai_tokens_per_word + * + * @param {int} $tokens_per_word How many tokens a word will take (roughly) + * @param {int} $max_tokens Maximum tokens the model supports. + * + * @return {int} + */ + $this->tokens_per_word = apply_filters( 'classifai_openai_tokens_per_word', $this->tokens_per_word, $max_tokens ); } /** diff --git a/includes/Classifai/Providers/OpenAI/Whisper/Transcribe.php b/includes/Classifai/Providers/OpenAI/Whisper/Transcribe.php index 9faebb731..449585826 100644 --- a/includes/Classifai/Providers/OpenAI/Whisper/Transcribe.php +++ b/includes/Classifai/Providers/OpenAI/Whisper/Transcribe.php @@ -63,7 +63,7 @@ public function process() { return new WP_Error( 'process_error', esc_html__( 'Attachment does not meet processing requirements. Ensure the file type and size meet requirements.', 'classifai' ) ); } - $request = new APIRequest( $this->settings['api_key'] ?? '' ); + $request = new APIRequest( $this->settings['api_key'] ?? '', 'whisper' ); /** * Filter the request body before sending to Whisper. diff --git a/includes/Classifai/Providers/Provider.php b/includes/Classifai/Providers/Provider.php index 35cfe03cc..49a4011c6 100644 --- a/includes/Classifai/Providers/Provider.php +++ b/includes/Classifai/Providers/Provider.php @@ -1,6 +1,6 @@ " } } + /** + * Generic prompt repeater field callback + * + * @since 2.4.0 + * + * @param array $args The args passed to add_settings_field. + */ + public function render_prompt_repeater_field( array $args ): void { + $option_index = $args['option_index'] ?? false; + $setting_index = $this->get_settings( $option_index ); + $prompts = $setting_index[ $args['label_for'] ] ?? ''; + $class = $args['class'] ?? 'large-text'; + $placeholder = $args['placeholder'] ?? ''; + $field_name_prefix = sprintf( + 'classifai_%1$s%2$s[%3$s]', + $this->option_name, + $option_index ? "[$option_index]" : '', + $args['label_for'] + ); + + $prompts = empty( $prompts ) && isset( $args['default_value'] ) ? $args['default_value'] : $prompts; + + $prompt_count = count( $prompts ); + $field_index = 0; + ?> + + + + +
+ +

+ ; %2$s with ; %3$s with prompt. */ + esc_html__( '%1$sClassifAI default prompt%2$s: %3$s', 'classifai' ), + '', + '', + esc_html( $placeholder ) + ); + ?> +

+ + + " + value="" + class="js-setting-field__default"> + " + value=""> + + + + + +
+ + + + + + ' . wp_kses_post( $args['description'] ) . ''; + } + } + /** * Renders a select menu * diff --git a/includes/Classifai/Providers/Watson/NLU.php b/includes/Classifai/Providers/Watson/NLU.php index f38405832..80f38e120 100644 --- a/includes/Classifai/Providers/Watson/NLU.php +++ b/includes/Classifai/Providers/Watson/NLU.php @@ -207,6 +207,7 @@ public function enqueue_editor_assets() { wp_enqueue_script( 'classifai-gutenberg-plugin', CLASSIFAI_PLUGIN_URL . 'dist/gutenberg-plugin.js', + array_merge( get_asset_info( 'gutenberg-plugin', 'dependencies' ), array( 'lodash' ) ), get_asset_info( 'gutenberg-plugin', 'dependencies' ), get_asset_info( 'gutenberg-plugin', 'version' ), true @@ -240,7 +241,7 @@ public function enqueue_admin_assets() { 'classifai-language-processing-style', CLASSIFAI_PLUGIN_URL . 'dist/language-processing.css', array(), - CLASSIFAI_PLUGIN_VERSION, + get_asset_info( 'language-processing', 'version' ), 'all' ); } diff --git a/includes/Classifai/Services/ImageProcessing.php b/includes/Classifai/Services/ImageProcessing.php index 39d314178..e5621359e 100644 --- a/includes/Classifai/Services/ImageProcessing.php +++ b/includes/Classifai/Services/ImageProcessing.php @@ -41,12 +41,14 @@ public function init() { /** * Enqueue the script for the media modal. + * + * @since 2.4.0 Use get_asset_info to get the asset version and dependencies. */ public function enqueue_media_scripts() { wp_enqueue_script( 'classifai-media-script', CLASSIFAI_PLUGIN_URL . 'dist/media.js', - array( 'jquery', 'media-editor', 'lodash', 'wp-i18n' ), + array_merge( get_asset_info( 'media', 'dependencies' ), array( 'jquery', 'media-editor', 'lodash' ) ), get_asset_info( 'media', 'version' ), true ); diff --git a/includes/Classifai/Services/LanguageProcessing.php b/includes/Classifai/Services/LanguageProcessing.php index 0d6537abb..90b097078 100644 --- a/includes/Classifai/Services/LanguageProcessing.php +++ b/includes/Classifai/Services/LanguageProcessing.php @@ -204,7 +204,7 @@ public function register_endpoints() { 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg', - 'description' => esc_html__( 'The type of resize operation. "grow" or "shrink".', 'classifai' ), + 'description' => esc_html__( 'The type of resize operation. "expand" or "condense".', 'classifai' ), ], ], ] diff --git a/includes/Classifai/Services/Service.php b/includes/Classifai/Services/Service.php index 9ccfa0f86..460bcc089 100644 --- a/includes/Classifai/Services/Service.php +++ b/includes/Classifai/Services/Service.php @@ -234,7 +234,7 @@ public function add_service_debug_information( $debug_information ) { /** * Provides debug information for the service. * - * @return array Array of associative arrays respresenting lines of debug information. + * @return array Array of associative arrays representing lines of debug information. * @since 1.4.0 */ public function get_service_debug_information() { diff --git a/includes/Classifai/Watson/APIRequest.php b/includes/Classifai/Watson/APIRequest.php index 526961149..f448ffc9e 100644 --- a/includes/Classifai/Watson/APIRequest.php +++ b/includes/Classifai/Watson/APIRequest.php @@ -142,7 +142,7 @@ public function get_auth_hash() { /** * Add the headers. * - * @param array $options The header optins, passed by reference. + * @param array $options The header options, passed by reference. */ public function add_headers( &$options ) { if ( empty( $options['headers'] ) ) { diff --git a/languages/classifai.pot b/languages/classifai.pot index 4727f55e3..76450e4b8 100644 --- a/languages/classifai.pot +++ b/languages/classifai.pot @@ -2,9 +2,9 @@ # This file is distributed under the GPLv2. msgid "" msgstr "" -"Project-Id-Version: ClassifAI 2.3.0\n" +"Project-Id-Version: ClassifAI 2.4.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/classifai\n" -"POT-Creation-Date: 2023-09-05 19:07:31+00:00\n" +"POT-Creation-Date: 2023-11-09 17:12:21+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -56,9 +56,9 @@ msgstr "" #: includes/Classifai/Admin/BulkActions.php:159 #: includes/Classifai/Admin/BulkActions.php:413 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:269 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:324 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:609 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:315 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:370 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:766 msgid "Generate excerpt" msgstr "" @@ -197,8 +197,8 @@ msgid "Audio creation failed." msgstr "" #: includes/Classifai/Admin/SavePostHandler.php:380 -#: includes/Classifai/Providers/Azure/TextToSpeech.php:639 -#: includes/Classifai/Providers/Watson/NLU.php:841 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:641 +#: includes/Classifai/Providers/Watson/NLU.php:842 msgid "Post" msgstr "" @@ -208,12 +208,12 @@ msgid "%s classified successfully." msgstr "" #: includes/Classifai/Admin/templates/classifai-header.php:27 -#: includes/Classifai/Plugin.php:226 +#: includes/Classifai/Plugin.php:228 msgid "Settings" msgstr "" #: includes/Classifai/Admin/templates/classifai-header.php:36 -#: includes/Classifai/Plugin.php:221 +#: includes/Classifai/Plugin.php:223 msgid "Set up" msgstr "" @@ -315,26 +315,26 @@ msgid "" "like language processing, image processing, and content recommendations." msgstr "" -#: includes/Classifai/Plugin.php:184 +#: includes/Classifai/Plugin.php:186 msgid "API Password" msgstr "" -#: includes/Classifai/Plugin.php:185 +#: includes/Classifai/Plugin.php:187 #: includes/Classifai/Providers/Azure/ComputerVision.php:965 #: includes/Classifai/Providers/Azure/Personalizer.php:114 -#: includes/Classifai/Providers/Azure/TextToSpeech.php:169 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:171 #: includes/Classifai/Providers/OpenAI/OpenAI.php:78 -#: includes/Classifai/Providers/Watson/NLU.php:338 +#: includes/Classifai/Providers/Watson/NLU.php:339 msgid "API Key" msgstr "" -#: includes/Classifai/Plugin.php:186 -#: includes/Classifai/Providers/Watson/NLU.php:357 +#: includes/Classifai/Plugin.php:188 +#: includes/Classifai/Providers/Watson/NLU.php:358 msgid "Use an API Key instead?" msgstr "" -#: includes/Classifai/Plugin.php:187 -#: includes/Classifai/Providers/Watson/NLU.php:356 +#: includes/Classifai/Plugin.php:189 +#: includes/Classifai/Providers/Watson/NLU.php:357 msgid "Use a username/password instead?" msgstr "" @@ -468,7 +468,7 @@ msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:695 #: includes/Classifai/Providers/Azure/OCR.php:305 #: includes/Classifai/Providers/Azure/Read.php:120 -#: includes/Classifai/Services/ImageProcessing.php:293 +#: includes/Classifai/Services/ImageProcessing.php:295 #: includes/Classifai/Services/Personalizer.php:176 msgid "Please set up valid authentication with Azure." msgstr "" @@ -479,7 +479,7 @@ msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:952 #: includes/Classifai/Providers/Azure/Personalizer.php:89 -#: includes/Classifai/Providers/Azure/TextToSpeech.php:154 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:156 msgid "Endpoint URL" msgstr "" @@ -560,49 +560,49 @@ msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:1243 #: includes/Classifai/Providers/Azure/Personalizer.php:718 -#: includes/Classifai/Providers/Azure/TextToSpeech.php:420 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:608 -#: includes/Classifai/Providers/OpenAI/DallE.php:425 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:422 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:765 +#: includes/Classifai/Providers/OpenAI/DallE.php:427 #: includes/Classifai/Providers/OpenAI/Embeddings.php:313 #: includes/Classifai/Providers/OpenAI/Whisper.php:328 msgid "Authenticated" msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:1243 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:608 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:609 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:612 -#: includes/Classifai/Providers/OpenAI/DallE.php:425 -#: includes/Classifai/Providers/OpenAI/DallE.php:426 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:765 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:766 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:769 +#: includes/Classifai/Providers/OpenAI/DallE.php:427 +#: includes/Classifai/Providers/OpenAI/DallE.php:428 #: includes/Classifai/Providers/OpenAI/Embeddings.php:313 #: includes/Classifai/Providers/OpenAI/Embeddings.php:314 #: includes/Classifai/Providers/OpenAI/Whisper.php:328 #: includes/Classifai/Providers/OpenAI/Whisper.php:329 -#: includes/Classifai/Providers/Watson/NLU.php:763 +#: includes/Classifai/Providers/Watson/NLU.php:764 #: includes/Classifai/Services/ServicesManager.php:324 msgid "yes" msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:1243 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:608 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:609 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:612 -#: includes/Classifai/Providers/OpenAI/DallE.php:425 -#: includes/Classifai/Providers/OpenAI/DallE.php:426 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:765 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:766 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:769 +#: includes/Classifai/Providers/OpenAI/DallE.php:427 +#: includes/Classifai/Providers/OpenAI/DallE.php:428 #: includes/Classifai/Providers/OpenAI/Embeddings.php:313 #: includes/Classifai/Providers/OpenAI/Embeddings.php:314 #: includes/Classifai/Providers/OpenAI/Whisper.php:328 #: includes/Classifai/Providers/OpenAI/Whisper.php:329 -#: includes/Classifai/Providers/Watson/NLU.php:763 +#: includes/Classifai/Providers/Watson/NLU.php:764 #: includes/Classifai/Services/ServicesManager.php:324 msgid "no" msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:1244 #: includes/Classifai/Providers/Azure/Personalizer.php:719 -#: includes/Classifai/Providers/Azure/TextToSpeech.php:421 -#: includes/Classifai/Providers/Watson/NLU.php:310 -#: includes/Classifai/Providers/Watson/NLU.php:764 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:423 +#: includes/Classifai/Providers/Watson/NLU.php:311 +#: includes/Classifai/Providers/Watson/NLU.php:765 msgid "API URL" msgstr "" @@ -623,7 +623,7 @@ msgid "Latest response - OCR" msgstr "" #: includes/Classifai/Providers/Azure/ComputerVision.php:1295 -#: includes/Classifai/Services/ImageProcessing.php:230 +#: includes/Classifai/Services/ImageProcessing.php:232 #. translators: %1$s: the attachment ID msgid "%1$d is not found or is not an attachment" msgstr "" @@ -689,12 +689,12 @@ msgid "Error in send reward to personalizer: " msgstr "" #: includes/Classifai/Providers/Azure/Personalizer.php:718 -#: includes/Classifai/Providers/Azure/TextToSpeech.php:420 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:422 msgid "Yes" msgstr "" #: includes/Classifai/Providers/Azure/Personalizer.php:718 -#: includes/Classifai/Providers/Azure/TextToSpeech.php:420 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:422 msgid "No" msgstr "" @@ -755,7 +755,7 @@ msgstr "" msgid "Generate speech for post content" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:163 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:165 msgid "" "Text to Speech region endpoint, e.g., " "https://LOCATION.tts.speech.microsoft.com/. Replace " @@ -763,236 +763,268 @@ msgid "" "resource in Azure." msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:183 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:185 msgid "Post Types" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:198 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:200 msgid "Voice" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:253 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:255 msgid "" "One or more credentials required to connect to the Azure Text to Speech " "service is empty." msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:333 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:335 msgid "Azure Speech to Text: HTTP request failed." msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:347 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:349 msgid "Connection to Azure Text to Speech failed." msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:422 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:424 msgid "Latest response - Voices" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:602 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:604 msgid "ClassifAI Text to Speech Processing" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:649 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:651 msgid "Enable audio generation" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:654 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:656 #. translators: %s Post type label msgid "ClassifAI will generate audio for this %s when it is published or updated." msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:662 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:664 msgid "Display audio controls" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:666 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:668 msgid "Controls the display of the audio player on the front-end." msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:831 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:833 msgid "Play audio" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:831 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:833 msgid "Pause audio" msgstr "" -#: includes/Classifai/Providers/Azure/TextToSpeech.php:850 +#: includes/Classifai/Providers/Azure/TextToSpeech.php:852 msgid "Listen to this" msgstr "" -#: includes/Classifai/Providers/OpenAI/APIRequest.php:127 +#: includes/Classifai/Providers/OpenAI/APIRequest.php:281 msgid "An error occured" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:53 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:81 msgid "OpenAI ChatGPT" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:56 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:84 msgid "Excerpt generation" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:57 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:85 msgid "Title generation" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:58 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:86 msgid "Content resizing" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:129 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:392 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:612 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:157 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:453 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:769 msgid "Generate titles" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:130 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:158 msgid "Select a title" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:131 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:159 msgid "Select" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:270 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:246 +msgid "Are you sure you want to delete the prompt?" +msgstr "" + +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:316 msgid "Re-generate excerpt" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:317 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:363 msgid "Excerpt settings" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:332 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:378 msgid "" "A button will be added to the excerpt panel that can be used to generate an " "excerpt." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:354 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:406 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:460 -#: includes/Classifai/Providers/OpenAI/DallE.php:301 -#: includes/Classifai/Providers/OpenAI/DallE.php:427 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:400 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:467 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:535 +#: includes/Classifai/Providers/OpenAI/DallE.php:303 +#: includes/Classifai/Providers/OpenAI/DallE.php:429 #: includes/Classifai/Providers/OpenAI/Whisper.php:249 #: includes/Classifai/Providers/OpenAI/Whisper.php:330 msgid "Allowed roles" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:362 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:408 msgid "Choose which roles are allowed to generate excerpts." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:368 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:611 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:414 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:768 msgid "Excerpt length" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:378 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:424 msgid "" "How many words should the excerpt be? Note that the final result may not " "exactly match this. In testing, ChatGPT tended to exceed this number by " "10-15 words." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:385 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:431 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:496 +#: includes/Classifai/Providers/Provider.php:299 +msgid "Prompt" +msgstr "" + +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:439 +msgid "" +"Note the following variables that can be used in the prompt and will be " +"replaced with content: {{WORDS}} will be replaced with the desired excerpt " +"length setting. {{TITLE}} will be replaced with the item's title." +msgstr "" + +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:446 msgid "Title settings" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:400 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:461 msgid "" "A button will be added to the status panel that can be used to generate " "titles." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:414 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:475 msgid "Choose which roles are allowed to generate titles." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:420 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:614 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:481 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:771 msgid "Number of titles" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:428 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:489 msgid "Number of titles that will be generated in one request." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:435 -msgid "Resizing content settings" +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:510 +msgid "Content resizing settings" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:442 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:517 msgid "Enable content resizing" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:450 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:525 msgid "" -"\"Shrink content\" and \"Grow content\" menu items will be added to the " -"paragraph block's toolbar menu." +"\"Condense this text\" and \"Expand this text\" menu items will be added to " +"the paragraph block's toolbar menu." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:468 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:543 msgid "Choose which roles are allowed to resize content." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:474 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:616 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:549 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:773 msgid "Number of suggestions" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:482 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:557 msgid "Number of suggestions that will be generated in one request." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:610 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:564 +msgid "Condense text prompt" +msgstr "" + +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:578 +msgid "Expand text prompt" +msgstr "" + +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:713 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:723 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:733 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:740 +msgid "ClassifAI default" +msgstr "" + +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:767 msgid "Allowed roles (excerpt)" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:613 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:770 msgid "Allowed roles (titles)" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:615 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:772 msgid "Allowed roles (resize)" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:617 -#: includes/Classifai/Providers/OpenAI/DallE.php:430 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:774 +#: includes/Classifai/Providers/OpenAI/DallE.php:432 #: includes/Classifai/Providers/OpenAI/Embeddings.php:319 #: includes/Classifai/Providers/OpenAI/Whisper.php:331 -#: includes/Classifai/Providers/Watson/NLU.php:768 +#: includes/Classifai/Providers/Watson/NLU.php:769 msgid "Latest response" msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:633 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:663 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:790 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:820 msgid "A valid post ID is required to generate an excerpt." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:678 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:835 msgid "" "Excerpt generation is disabled or OpenAI authentication failed. Please " "check your settings." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:761 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:925 msgid "Post ID is required to generate titles." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:776 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:940 msgid "" "Title generation is disabled or OpenAI authentication failed. Please check " "your settings." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:841 -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:943 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:1007 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:1110 msgid "No choices were returned from OpenAI." msgstr "" -#: includes/Classifai/Providers/OpenAI/ChatGPT.php:865 +#: includes/Classifai/Providers/OpenAI/ChatGPT.php:1031 msgid "Post ID is required to resize content." msgstr "" @@ -1014,121 +1046,121 @@ msgstr "" msgid "Generate Image" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:137 +#: includes/Classifai/Providers/OpenAI/DallE.php:139 #. translators: %1$s is replaced with the OpenAI DALL·E URL msgid "Image generated by OpenAI's DALL·E" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:147 -#: includes/Classifai/Providers/OpenAI/DallE.php:210 -#: includes/Classifai/Providers/OpenAI/DallE.php:426 +#: includes/Classifai/Providers/OpenAI/DallE.php:149 +#: includes/Classifai/Providers/OpenAI/DallE.php:212 +#: includes/Classifai/Providers/OpenAI/DallE.php:428 msgid "Generate images" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:147 -#: includes/Classifai/Providers/OpenAI/DallE.php:212 +#: includes/Classifai/Providers/OpenAI/DallE.php:149 +#: includes/Classifai/Providers/OpenAI/DallE.php:214 msgid "Generate image" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:148 +#: includes/Classifai/Providers/OpenAI/DallE.php:150 msgid "Something went wrong. No results found" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:149 +#: includes/Classifai/Providers/OpenAI/DallE.php:151 msgid "Select image" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:191 +#: includes/Classifai/Providers/OpenAI/DallE.php:193 msgid "Enter a prompt below to generate images." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:193 +#: includes/Classifai/Providers/OpenAI/DallE.php:195 msgid "Enter a prompt below to generate an image." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:200 +#: includes/Classifai/Providers/OpenAI/DallE.php:202 msgid "" "Once images are generated, choose one or more of those to import into your " "Media Library and then choose one image to insert." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:202 +#: includes/Classifai/Providers/OpenAI/DallE.php:204 msgid "" "Once an image is generated, you can import it into your Media Library and " "then select to insert." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:206 +#: includes/Classifai/Providers/OpenAI/DallE.php:208 msgid "Enter prompt" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:222 +#: includes/Classifai/Providers/OpenAI/DallE.php:224 msgid "Images generated from prompt:" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:224 +#: includes/Classifai/Providers/OpenAI/DallE.php:226 msgid "Image generated from prompt:" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:241 +#: includes/Classifai/Providers/OpenAI/DallE.php:243 msgid "Import into Media Library" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:242 +#: includes/Classifai/Providers/OpenAI/DallE.php:244 msgid "Import and Insert" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:264 +#: includes/Classifai/Providers/OpenAI/DallE.php:266 msgid "Enable image generation" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:272 +#: includes/Classifai/Providers/OpenAI/DallE.php:274 msgid "" "When enabled, a new Generate images tab will be shown in the media upload " "flow, allowing you to generate and import images." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:309 +#: includes/Classifai/Providers/OpenAI/DallE.php:311 msgid "" "Choose which roles are allowed to generate images. Note that the roles " "above only include those that have permissions to upload media." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:315 -#: includes/Classifai/Providers/OpenAI/DallE.php:428 +#: includes/Classifai/Providers/OpenAI/DallE.php:317 +#: includes/Classifai/Providers/OpenAI/DallE.php:430 msgid "Number of images" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:323 +#: includes/Classifai/Providers/OpenAI/DallE.php:325 msgid "" "Number of images that will be generated in one request. Note that each " "image will incur separate costs." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:329 -#: includes/Classifai/Providers/OpenAI/DallE.php:429 +#: includes/Classifai/Providers/OpenAI/DallE.php:331 +#: includes/Classifai/Providers/OpenAI/DallE.php:431 msgid "Image size" msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:341 +#: includes/Classifai/Providers/OpenAI/DallE.php:343 msgid "Size of generated images." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:443 +#: includes/Classifai/Providers/OpenAI/DallE.php:445 msgid "A prompt is required to generate an image." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:461 +#: includes/Classifai/Providers/OpenAI/DallE.php:463 msgid "Sorry, you are not allowed to do that." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:465 +#: includes/Classifai/Providers/OpenAI/DallE.php:467 msgid "" "Image generation is disabled or OpenAI authentication failed. Please check " "your settings." msgstr "" -#: includes/Classifai/Providers/OpenAI/DallE.php:482 +#: includes/Classifai/Providers/OpenAI/DallE.php:484 msgid "" "Your image prompt is too long. Please ensure it doesn't exceed 1000 " "characters." @@ -1152,7 +1184,7 @@ msgstr "" #: includes/Classifai/Providers/OpenAI/Embeddings.php:144 #: includes/Classifai/Providers/OpenAI/Embeddings.php:315 -#: includes/Classifai/Providers/Watson/NLU.php:766 +#: includes/Classifai/Providers/Watson/NLU.php:767 msgid "Post types" msgstr "" @@ -1217,12 +1249,12 @@ msgid "No data returned from OpenAI." msgstr "" #: includes/Classifai/Providers/OpenAI/Embeddings.php:722 -#: includes/Classifai/Providers/Watson/NLU.php:818 +#: includes/Classifai/Providers/Watson/NLU.php:819 msgid "ClassifAI Language Processing" msgstr "" #: includes/Classifai/Providers/OpenAI/Embeddings.php:752 -#: includes/Classifai/Providers/Watson/NLU.php:849 +#: includes/Classifai/Providers/Watson/NLU.php:850 msgid "Process content on update" msgstr "" @@ -1262,7 +1294,7 @@ msgid "Generate transcripts from audio files" msgstr "" #: includes/Classifai/Providers/OpenAI/Whisper.php:64 -#: includes/Classifai/Services/ImageProcessing.php:346 +#: includes/Classifai/Services/ImageProcessing.php:348 #: includes/Classifai/Services/LanguageProcessing.php:371 #: includes/Classifai/Services/LanguageProcessing.php:488 #: includes/Classifai/Services/LanguageProcessing.php:572 @@ -1303,20 +1335,54 @@ msgstr "" msgid "Generate transcripts" msgstr "" -#: includes/Classifai/Providers/Provider.php:333 +#: includes/Classifai/Providers/Provider.php:270 +#. translators: %1$s is replaced with ; %2$s with ; %3$s with +#. prompt. +msgid "%1$sClassifAI default prompt%2$s: %3$s" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:287 +msgid "Title" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:289 +msgid "Short description of prompt to use for identification" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:292 +msgid "Prompt title" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:312 +msgid "Default prompt" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:314 +msgid "Set as default prompt" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:318 +msgid "Trash" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:327 +msgid "Add new prompt" +msgstr "" + +#: includes/Classifai/Providers/Provider.php:437 msgid "Alt text" msgstr "" -#: includes/Classifai/Providers/Provider.php:334 +#: includes/Classifai/Providers/Provider.php:438 msgid "Image caption" msgstr "" -#: includes/Classifai/Providers/Provider.php:335 +#: includes/Classifai/Providers/Provider.php:439 msgid "Image description" msgstr "" -#: includes/Classifai/Providers/Provider.php:415 -#: includes/Classifai/Providers/Watson/NLU.php:781 +#: includes/Classifai/Providers/Provider.php:519 +#: includes/Classifai/Providers/Watson/NLU.php:782 msgid "N/A" msgstr "" @@ -1381,7 +1447,7 @@ msgstr "" msgid "Automatically tag %s" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:260 +#: includes/Classifai/Providers/Watson/NLU.php:261 #. translators: %1$s is the link to register for an IBM Cloud account, %2$s is #. the link to setup the NLU service msgid "" @@ -1391,7 +1457,7 @@ msgid "" "key." msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:280 +#: includes/Classifai/Providers/Watson/NLU.php:281 #. translators: %s is the link to the IBM Watson documentation msgid "" "The `watsonplatform.net` endpoint URLs were retired on 26 May 2021. Please " @@ -1399,50 +1465,50 @@ msgid "" "watsonplatform.net\" href=\"%s\">here for details." msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:323 +#: includes/Classifai/Providers/Watson/NLU.php:324 msgid "API Username" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:386 +#: includes/Classifai/Providers/Watson/NLU.php:387 msgid "Post Types to Classify" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:397 +#: includes/Classifai/Providers/Watson/NLU.php:398 msgid "Post Statuses to Classify" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:548 +#: includes/Classifai/Providers/Watson/NLU.php:549 msgid "Watson Category Settings" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:553 +#: includes/Classifai/Providers/Watson/NLU.php:554 msgid "Enable" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:608 +#: includes/Classifai/Providers/Watson/NLU.php:609 msgid "Please enter your credentials." msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:726 +#: includes/Classifai/Providers/Watson/NLU.php:727 msgid "" "OpenAI Embeddings classification is turned on. This may conflict with the " "NLU classification feature. It is possible to run both features but if they " "use the same taxonomies, one will overwrite the other." msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:763 +#: includes/Classifai/Providers/Watson/NLU.php:764 msgid "Configured" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:765 +#: includes/Classifai/Providers/Watson/NLU.php:766 msgid "API username" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:767 +#: includes/Classifai/Providers/Watson/NLU.php:768 msgid "Features" msgstr "" -#: includes/Classifai/Providers/Watson/NLU.php:856 +#: includes/Classifai/Providers/Watson/NLU.php:857 #. translators: %s Post type label msgid "Classify %s" msgstr "" @@ -1451,40 +1517,40 @@ msgstr "" msgid "Image Processing" msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:83 -#: includes/Classifai/Services/ImageProcessing.php:102 -#: includes/Classifai/Services/ImageProcessing.php:121 -#: includes/Classifai/Services/ImageProcessing.php:140 -#: includes/Classifai/Services/ImageProcessing.php:159 +#: includes/Classifai/Services/ImageProcessing.php:85 +#: includes/Classifai/Services/ImageProcessing.php:104 +#: includes/Classifai/Services/ImageProcessing.php:123 +#: includes/Classifai/Services/ImageProcessing.php:142 +#: includes/Classifai/Services/ImageProcessing.php:161 msgid "Image ID to generate alt text for." msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:179 +#: includes/Classifai/Services/ImageProcessing.php:181 msgid "Prompt used to generate an image" msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:187 +#: includes/Classifai/Services/ImageProcessing.php:189 msgid "Number of images to generate" msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:198 +#: includes/Classifai/Services/ImageProcessing.php:200 msgid "Size of generated image" msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:208 +#: includes/Classifai/Services/ImageProcessing.php:210 msgid "Format of generated image" msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:235 +#: includes/Classifai/Services/ImageProcessing.php:237 #: includes/Classifai/Services/Personalizer.php:140 msgid "No route indicated for the provider class to use." msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:287 +#: includes/Classifai/Services/ImageProcessing.php:289 msgid "Ensure the service settings have been saved." msgstr "" -#: includes/Classifai/Services/ImageProcessing.php:351 +#: includes/Classifai/Services/ImageProcessing.php:353 msgid "Image generation not currently enabled." msgstr "" @@ -1537,7 +1603,7 @@ msgid "The content to resize." msgstr "" #: includes/Classifai/Services/LanguageProcessing.php:207 -msgid "The type of resize operation. \"grow\" or \"shrink\"." +msgid "The type of resize operation. \"expand\" or \"condense\"." msgstr "" #: includes/Classifai/Services/LanguageProcessing.php:226 diff --git a/readme.txt b/readme.txt index 33400a0b8..18c3b1f30 100644 --- a/readme.txt +++ b/readme.txt @@ -1,10 +1,10 @@ === ClassifAI === Contributors: 10up, jeffpaul, dkotter -Tags: AI, Artifical Intelligence, ML, Machine Learning, Microsoft Azure, IBM Watson, OpenAI, ChatGPT, DALL·E, Content Tagging, Classification, Smart Cropping, Alt Text +Tags: AI, Artificial Intelligence, ML, Machine Learning, Microsoft Azure, IBM Watson, OpenAI, ChatGPT, DALL·E, Content Tagging, Classification, Smart Cropping, Alt Text Requires at least: 5.8 -Tested up to: 6.3 +Tested up to: 6.4 Requires PHP: 7.4 -Stable tag: 2.3.0 +Stable tag: 2.4.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html diff --git a/vendor/autoload.php b/vendor/autoload.php index b5e755c7f..2c3b6ec58 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInitf98701dcedbd028a2e6420130e5c49ad::getLoader(); +return ComposerAutoloaderIniteac83010094406077b2bc944e936a9c2::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 61ee335e1..7776bcc04 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInitf98701dcedbd028a2e6420130e5c49ad +class ComposerAutoloaderIniteac83010094406077b2bc944e936a9c2 { private static $loader; @@ -24,16 +24,16 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInitf98701dcedbd028a2e6420130e5c49ad', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderIniteac83010094406077b2bc944e936a9c2', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInitf98701dcedbd028a2e6420130e5c49ad', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderIniteac83010094406077b2bc944e936a9c2', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInitf98701dcedbd028a2e6420130e5c49ad::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticIniteac83010094406077b2bc944e936a9c2::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitf98701dcedbd028a2e6420130e5c49ad::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticIniteac83010094406077b2bc944e936a9c2::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 813da7dab..dcbbfa691 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInitf98701dcedbd028a2e6420130e5c49ad +class ComposerStaticIniteac83010094406077b2bc944e936a9c2 { public static $files = array ( '9b77ddcfb14408a32f5aaf74e0a11694' => __DIR__ . '/..' . '/yahnis-elsts/plugin-update-checker/load-v5p1.php', @@ -46,9 +46,9 @@ class ComposerStaticInitf98701dcedbd028a2e6420130e5c49ad public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInitf98701dcedbd028a2e6420130e5c49ad::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInitf98701dcedbd028a2e6420130e5c49ad::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInitf98701dcedbd028a2e6420130e5c49ad::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticIniteac83010094406077b2bc944e936a9c2::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticIniteac83010094406077b2bc944e936a9c2::$prefixDirsPsr4; + $loader->classMap = ComposerStaticIniteac83010094406077b2bc944e936a9c2::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 016d0e0ad..1a1e38b87 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '10up/classifai', 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '1742dc0109ff82f708f47633782dca5b179e362c', + 'reference' => 'bfb38221098fa2b2c480f4083862b18bfe70dd7d', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '10up/classifai' => array( 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '1742dc0109ff82f708f47633782dca5b179e362c', + 'reference' => 'bfb38221098fa2b2c480f4083862b18bfe70dd7d', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),