// ==UserScript==
// @name My Prompt
// @name:pt-BR Meu Prompt
// @name:zh-CN 我的提示词
// @name:zh-TW 我的提示詞
// @name:fr-CA Mon Prompt
// @name:ckb پڕۆمپتەکەم
// @name:ar مُوجِّهي
// @name:be Мой запыт
// @name:bg Моята подкана
// @name:cs Můj pokyn
// @name:da Min prompt
// @name:de Mein Prompt
// @name:el Η προτροπή μου
// @name:en My Prompt
// @name:eo Mia instigo
// @name:es Mi Prompt
// @name:fi Kehotteeni
// @name:fr Mon Prompt
// @name:he ההנחיה שלי
// @name:hr Moja uputa
// @name:hu Promptom
// @name:id Prompt Saya
// @name:it Il mio Prompt
// @name:ja マイプロンプト
// @name:ka ჩემი პრომპტი
// @name:ko 나의 프롬프트
// @name:mr माझी सूचना
// @name:nb Min prompt
// @name:nl Mijn Prompt
// @name:pl Mój Prompt
// @name:ro Prompt-ul meu
// @name:ru Мой Промпт
// @name:sk Môj pokyn
// @name:sr Мој упит
// @name:sv Min prompt
// @name:th พรอมต์ของฉัน
// @name:tr İstemim
// @name:uk Мій запит
// @name:ug مېنىڭ پرومپتۇم
// @name:vi Lời nhắc của tôi
// @namespace https://github.com/0H4S
// @version 2.8
// @description Organize and access your custom prompts quickly and easily. Use Dynamic Prompts to insert interactive information and adapt your prompts for any situation. Compatible with: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, and Perplexity.
// @description:pt-BR Organize e acesse seus prompts personalizados com rapidez e facilidade. Use o Prompt Dinâmico para inserir informações interativas e adapte seus prompts para qualquer situação. Compatível com: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI e Perplexity.
// @description:zh-CN 快速轻松地组织和访问您的自定义提示词。使用动态提示词插入交互式信息,并根据任何情况调整您的提示词。兼容:ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:zh-TW 快速輕鬆地組織和存取您的自訂提示詞。使用動態提示詞插入互動式資訊,並根據任何情況調整您的提示詞。相容於:ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:fr-CA Organisez et accédez rapidement à vos prompts personnalisés. Utilisez les Prompts Dynamiques pour insérer des informations interactives et adapter vos prompts à toutes les situations. Compatible avec : ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI et Perplexity.
// @description:ckb ڕێکخستن و دەستگەیشتن بە داواکارییە (prompts) تایبەتەکانت بە خێرایی و ئاسانی. بەکارهێنانی داواکاری داینامیکی بۆ تێکردنی زانیاری کارلێککارانە و گونجاندنی داواکارییەکانت بۆ هەر بارودۆخێک. گونجاوە لەگەڵ: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:ar تنظيم والوصول إلى مطالباتك (prompts) المخصصة بسرعة وسهولة. استخدم المطالبات الديناميكية لإدراج معلومات تفاعلية وتكييف مطالباتك مع أي موقف. متوافق مع: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:be Арганізуйце і хутка атрымлівайце доступ да вашых карыстальніцкіх падказак (prompts). Выкарыстоўвайце дынамічныя падказкі для ўстаўкі інтэрактыўнай інфармацыі і адаптуйце свае падказкі для любой сітуацыі. Сумяшчальны з: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:bg Организирайте и достъпвайте своите персонализирани подкани (prompts) бързо и лесно. Използвайте динамични подкани за вмъкване на интерактивна информация и адаптирайте подканите си за всяка ситуация. Съвместим с: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:cs Rychle a snadno organizujte své vlastní prompty a přistupujte k nim. Použijte dynamické prompty pro vkládání interaktivních informací a přizpůsobte své prompty jakékoli situaci. Kompatibilní s: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:da Organiser og få adgang til dine tilpassede prompts hurtigt og nemt. Brug dynamiske prompts til at indsætte interaktive oplysninger og tilpas dine prompts til enhver situation. Kompatibel med: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:de Organisieren und greifen Sie schnell und einfach auf Ihre individuellen Prompts zu. Verwenden Sie dynamische Prompts, um interaktive Informationen einzufügen und Ihre Prompts für jede Situation anzupassen. Kompatibel mit: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:el Οργανώστε και αποκτήστε πρόσβαση στις προσαρμοσμένες εντολές (prompts) σας γρήγορα και εύκολα. Χρησιμοποιήστε δυναμικές εντολές για εισαγωγή διαδραστικών πληροφοριών και προσαρμόστε τις εντολές σας σε κάθε κατάσταση. Συμβατό με: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:en Organize and access your custom prompts quickly and easily. Use Dynamic Prompts to insert interactive information and adapt your prompts for any situation. Compatible with: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, and Perplexity.
// @description:eo Organizu kaj aliru viajn personigitajn promptojn rapide kaj facile. Uzu Dinamikajn Promptojn por enmeti interagajn informojn kaj adapti viajn promptojn al iu ajn situacio. Kongrua kun: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:es Organice y acceda a sus prompts personalizados de forma rápida y sencilla. Utilice prompts dinámicos para insertar información interactiva y adapte sus prompts a cualquier situación. Compatible con: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI y Perplexity.
// @description:fi Järjestä ja käytä mukautettuja kehotteitasi (prompts) nopeasti ja helposti. Käytä dynaamisia kehotteita interaktiivisten tietojen lisäämiseen ja mukauta kehotteesi mihin tahansa tilanteeseen. Yhteensopiva: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:fr Organisez et accédez rapidement à vos prompts personnalisés. Utilisez les Prompts Dynamiques pour insérer des informations interactives et adapter vos prompts à toutes les situations. Compatible avec : ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI et Perplexity.
// @description:he ארגן וגש להנחיות (prompts) המותאמות אישית שלך במהירות ובקלות. השתמש בהנחיות דינמיות כדי להוסיף מידע אינטראקטיבי ולהתאים את ההנחיות שלך לכל סיטואציה. תואם ל: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:hr Organizirajte i pristupite svojim prilagođenim upitima (promptovima) brzo i jednostavno. Koristite dinamičke upite za umetanje interaktivnih informacija i prilagodite svoje upite svakoj situaciji. Kompatibilno sa: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:hu Rendezze és érje el egyéni promptjait gyorsan és egyszerűen. Használja a Dinamikus Promptokat interaktív információk beillesztéséhez, és igazítsa promptjait bármilyen helyzethez. Kompatibilis: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:id Atur dan akses prompt kustom Anda dengan cepat dan mudah. Gunakan Prompt Dinamis untuk menyisipkan informasi interaktif dan adaptasikan prompt Anda untuk situasi apa pun. Kompatibel dengan: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:it Organizza e accedi ai tuoi prompt personalizzati in modo rapido e semplice. Usa i Prompt Dinamici per inserire informazioni interattive e adatta i tuoi prompt a qualsiasi situazione. Compatibile con: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:ja カスタムプロンプトを素早く簡単に整理・アクセス。ダイナミックプロンプトを使用してインタラクティブな情報を挿入し、あらゆる状況にプロンプトを適応させます。対応:ChatGPT、Gemini、DeepSeek、Google AI Studio、Doubao、Claude、Kimi、Qwen、Grok、Mistral、LMArena、LongCat、Z.AI、Perplexity。
// @description:ka სწრაფად და მარტივად მოაწყვეთ და შედით თქვენს მორგებულ მოთხოვნებზე (prompts). გამოიყენეთ დინამიური მოთხოვნები ინტერაქტიული ინფორმაციის ჩასასმელად და მოარგეთ თქვენი მოთხოვნები ნებისმიერ სიტუაციას. თავსებადია: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:ko 사용자 지정 프롬프트를 빠르고 쉽게 구성하고 액세스하세요. 동적 프롬프트를 사용하여 대화형 정보를 삽입하고 모든 상황에 맞게 프롬프트를 조정하세요. 호환: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:mr आपले सानुकूल प्रॉम्प्ट्स जलद आणि सहजपणे व्यवस्थापित करा आणि त्यात प्रवेश करा. परस्परसंवादी माहिती समाविष्ट करण्यासाठी डायनॅमिक प्रॉम्प्ट्स वापरा आणि कोणत्याही परिस्थितीसाठी आपले प्रॉम्प्ट्स अनुकूल करा. सुसंगत: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:nb Organiser og få tilgang til dine tilpassede prompts raskt og enkelt. Bruk dynamiske prompts for å sette inn interaktiv informasjon og tilpass forespørslene dine til enhver situasjon. Kompatibel med: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:nl Organiseer en krijg snel en eenvoudig toegang tot uw aangepaste prompts. Gebruik Dynamische Prompts om interactieve informatie in te voegen en pas uw prompts aan elke situatie aan. Compatibel met: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:pl Organizuj i szybko uzyskuj dostęp do swoich niestandardowych promptów. Używaj dynamicznych promptów, aby wstawiać interaktywne informacje i dostosowywać prompty do każdej sytuacji. Zgodny z: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:ro Organizați și accesați solicitările (prompts) personalizate rapid și ușor. Utilizați solicitări dinamice pentru a insera informații interactive și adaptați-vă solicitările pentru orice situație. Compatibil cu: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:ru Организуйте и быстро получайте доступ к своим пользовательским подсказкам (prompts). Используйте динамические подсказки для вставки интерактивной информации и адаптируйте свои подсказки к любой ситуации. Совместимо с: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:sk Rýchlo a jednoducho organizujte svoje vlastné prompty a pristupujte k nim. Použite dynamické prompty na vkladanie interaktívnych informácií a prispôsobte svoje prompty akejkoľvek situácii. Kompatibilné s: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:sr Организујте и брзо приступајте својим прилагођеним упитима (prompts). Користите динамичке упите за уметање интерактивних информација и прилагодите своје упите свакој ситуацији. Компатибилно са: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:sv Organisera och få tillgång till dina anpassade prompts snabbt och enkelt. Använd dynamiska prompts för att infoga interaktiv information och anpassa dina prompts till alla situationer. Kompatibel med: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:th จัดระเบียบและเข้าถึงคำสั่ง (prompts) ที่กำหนดเองของคุณได้อย่างรวดเร็วและง่ายดาย ใช้คำสั่งแบบไดนามิกเพื่อแทรกข้อมูลเชิงโต้ตอบและปรับเปลี่ยนคำสั่งของคุณให้เหมาะกับทุกสถานการณ์ รองรับ: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:tr Özel istemlerinizi (prompts) hızlı ve kolay bir şekilde düzenleyin ve erişin. Etkileşimli bilgiler eklemek için Dinamik İstemleri kullanın ve istemlerinizi her duruma uyarlayın. Şunlarla uyumludur: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:uk Організовуйте та швидко отримуйте доступ до власних підказок (prompts). Використовуйте динамічні підказки для вставки інтерактивної інформації та адаптуйте свої підказки до будь-якої ситуації. Сумісність з: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:ug ئۆزىڭىزنىڭ خاس كۆرسەتمىلىرىنى تېز ۋە ئوڭاي تەشكىللەڭ ۋە زىيارەت قىلىڭ. ھەرىكەتچان كۆرسەتمىلەرنى ئىشلىتىپ ئۆز-ئارا تەسىر كۆرسىتىدىغان ئۇچۇرلارنى قىستۇرۇڭ ۋە كۆرسەتمىلىرىڭىزنى ھەر قانداق ئەھۋالغا ماسلاشتۇرۇڭ. ماسلىشىشچانلىقى: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @description:vi Sắp xếp và truy cập các lời nhắc (prompts) tùy chỉnh của bạn một cách nhanh chóng và dễ dàng. Sử dụng Lời nhắc động để chèn thông tin tương tác và điều chỉnh lời nhắc của bạn cho mọi tình huống. Tương thích với: ChatGPT, Gemini, DeepSeek, Google AI Studio, Doubao, Claude, Kimi, Qwen, Grok, Mistral, LMArena, LongCat, Z.AI, Perplexity.
// @author OHAS
// @homepage https://github.com/0H4S
// @icon https://cdn-icons-png.flaticon.com/512/4997/4997543.png
// @license CC-BY-NC-ND-4.0
// @copyright 2025 OHAS. All Rights Reserved.
// @match *://aistudio.google.com/*
// @match *://gemini.google.com/*
// @match *://chat.deepseek.com/*
// @match *://www.perplexity.ai/*
// @match *://chat.mistral.ai/*
// @match *://www.doubao.com/*
// @match *://www.kimi.com/*
// @match *://chat.qwen.ai/*
// @match *://longcat.chat/*
// @match *://chatgpt.com/*
// @match *://lmarena.ai/*
// @match *://chat.z.ai/*
// @match *://claude.ai/*
// @match *://grok.com/*
// @require https://update.greasyfork.icu/scripts/549920.js
// @connect gist.github.com
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_xmlhttpRequest
// @grant GM_registerMenuCommand
// @run-at document-end
// @noframes
// @compatible chrome
// @compatible firefox
// @compatible edge
// @compatible opera
// @bgf-colorLT #847dfd
// @bgf-colorDT #6963ca
// @bgf-compatible brave
// @bgf-copyright [2025 OHAS. All Rights Reserved.](https://gist.github.com/0H4S/ae2fa82957a089576367e364cbf02438)
// @contributionURL https://linktr.ee/0H4S
// @downloadURL none
// ==/UserScript==
(function() {
'use strict';
/*eslint-disable*/
// #region GLOBAL
const translations = {
'pt-BR': {
langName: 'Português (BR)',
prompt: 'Prompt',
prompts: 'Prompts',
newPrompt: 'Novo Prompt',
editPrompt: 'Editar Prompt',
title: 'Título',
text: 'Prompt',
save: 'Salvar',
close: 'Fechar',
edit: 'Editar',
delete: 'Excluir',
noSavedPrompts: 'Nenhum prompt salvo.',
addPrompt: 'Adicionar prompt',
import: 'Importar',
export: 'Exportar',
confirmDelete: 'Excluir prompt "{title}"?',
noPromptsToExport: 'Não há prompts para exportar.',
promptsImported: '{count} prompts importados com sucesso!',
errorImporting: 'Erro ao importar o arquivo: {error}',
requiredFields: 'Título e prompt são obrigatórios.',
editorNotFound: 'Não foi possível encontrar a área de texto para {platform}.',
languageSettings: '🌐 Idioma',
fillPlaceholders: 'Preencha as Informações',
insert: 'Inserir',
enablePlaceholders: 'Prompt Dinâmico',
autoExecute: 'Envio Automático',
infoTitle: 'Ajuda',
infoDPDesc: 'Acesse o guia de uso completo:
English | Português (BR) | 简体中文',
infoASDesc: 'Envia o prompt para o chat instantaneamente após ser inserido, sem necessidade de ação manual.',
search: 'Procurar prompt...',
searchLanguage: 'Procurar idioma...',
selectAll: 'Selecionar Tudo',
countPrompts: '{count} prompts',
confirmDownloads: 'Você está prestes a baixar {count} arquivos de texto individuais. Continuar?',
noSearchResults: 'Nenhum prompt corresponde à pesquisa.',
ffWarningTitle: 'Aviso Importante',
ffWarningText: 'Nesta área específica da página, o Meu Prompt não consegue interagir corretamente usando o Firefox.',
ffRecommend: 'Para obter suporte completo em todas as áreas do chat no Doubao, recomendamos o uso de navegadores baseados em Chromium (Chrome, Edge, Brave, etc).',
dontShowAgain: 'Remover Botão de Aviso',
select: 'Selecione uma opção:',
valueForVariable: 'Valor para {label} (e {varName})',
context: 'Contexto',
expand: 'Expandir',
collapse: 'Contrair'
},
'en': {
langName: 'English',
prompt: 'Prompt',
prompts: 'Prompts',
newPrompt: 'New Prompt',
editPrompt: 'Edit Prompt',
title: 'Title',
text: 'Prompt',
save: 'Save',
close: 'Close',
edit: 'Edit',
delete: 'Delete',
noSavedPrompts: 'No saved prompts.',
addPrompt: 'Add prompt',
import: 'Import',
export: 'Export',
confirmDelete: 'Delete prompt "{title}"?',
noPromptsToExport: 'No prompts to export.',
promptsImported: '{count} prompts imported successfully!',
errorImporting: 'Error importing file: {error}',
requiredFields: 'Title and prompt are required.',
editorNotFound: 'Could not find the text area for {platform}.',
languageSettings: '🌐 Language',
fillPlaceholders: 'Fill in the Information',
insert: 'Insert',
enablePlaceholders: 'Dynamic Prompt',
autoExecute: 'Auto-Send',
infoTitle: 'Help',
infoDPDesc: 'Access the complete usage guide:
English | Português (BR) | 简体中文',
infoASDesc: 'Sends the prompt to the chat instantly after being inserted, without needing manual action.',
search: 'Search prompt...',
searchLanguage: 'Search language...',
selectAll: 'Select All',
countPrompts: '{count} prompts',
confirmDownloads: 'You are about to download {count} individual text files. Continue?',
noSearchResults: 'No prompts match your search.',
ffWarningTitle: 'Important Notice',
ffWarningText: 'In this specific area of the page, My Prompt cannot interact properly when using Firefox.',
ffRecommend: 'For full support in all chat areas on Doubao, we recommend using Chromium-based browsers (Chrome, Edge, Brave, etc).',
dontShowAgain: 'Remove Warning Button',
select: 'Select an option:',
valueForVariable: 'Value for {label} (and {varName})',
context: 'Context',
expand: 'Expand',
collapse: 'Collapse'
},
'es': {
langName: 'Español',
prompt: 'Prompt',
prompts: 'Prompts',
newPrompt: 'Nuevo Prompt',
editPrompt: 'Editar Prompt',
title: 'Título',
text: 'Prompt',
save: 'Guardar',
close: 'Cerrar',
edit: 'Editar',
delete: 'Eliminar',
noSavedPrompts: 'No hay prompts guardados.',
addPrompt: 'Añadir prompt',
import: 'Importar',
export: 'Exportar',
confirmDelete: '¿Eliminar prompt "{title}"?',
noPromptsToExport: 'No hay prompts para exportar.',
promptsImported: '¡{count} prompts importados con éxito!',
errorImporting: 'Error al importar el archivo: {error}',
requiredFields: 'El título y el prompt son obligatorios.',
editorNotFound: 'No se pudo encontrar el área de texto para {platform}.',
languageSettings: '🌐 Idioma',
fillPlaceholders: 'Rellene la Información',
insert: 'Insertar',
enablePlaceholders: 'Prompt Dinámico',
autoExecute: 'Envío Automático',
infoTitle: 'Ayuda',
infoDPDesc: 'Accede a la guía de uso completa:
English | Português (BR) | 简体中文',
infoASDesc: 'Envía el prompt al chat instantáneamente después de ser insertado, sin necesidad de acción manual.',
search: 'Buscar prompt...',
searchLanguage: 'Buscar idioma...',
selectAll: 'Seleccionar todo',
countPrompts: '{count} prompts',
confirmDownloads: 'Estás a punto de descargar {count} archivos de texto individuales. ¿Continuar?',
noSearchResults: 'Ningún prompt coincide con tu búsqueda.',
ffWarningTitle: 'Aviso Importante',
ffWarningText: 'En esta área específica de la página, Mi Prompt no puede interactuar correctamente cuando se usa Firefox.',
ffRecommend: 'Para obtener compatibilidad completa en todas las áreas del chat en Doubao, recomendamos usar navegadores basados en Chromium (Chrome, Edge, Brave, etc).',
dontShowAgain: 'Quitar Botón de Aviso',
select: 'Seleccione una opción:',
valueForVariable: 'Valor para {label} (y {varName})',
context: 'Contexto',
expand: 'Expandir',
collapse: 'Contraer'
},
'fr': {
langName: 'Français',
prompt: 'Prompt',
prompts: 'Prompts',
newPrompt: 'Nouveau prompt',
editPrompt: 'Modifier le prompt',
title: 'Titre',
text: 'Prompt',
save: 'Enregistrer',
close: 'Fermer',
edit: 'Modifier',
delete: 'Supprimer',
noSavedPrompts: 'Aucun prompt enregistré.',
addPrompt: 'Ajouter un prompt',
import: 'Importer',
export: 'Exporter',
confirmDelete: 'Supprimer le prompt "{title}" ?',
noPromptsToExport: 'Aucun prompt à exporter.',
promptsImported: '{count} prompts importés avec succès !',
errorImporting: 'Erreur lors de l\'importation du fichier : {error}',
requiredFields: 'Le titre et le prompt sont obligatoires.',
editorNotFound: 'Impossible de trouver la zone de texte pour {platform}.',
languageSettings: '🌐 Langue',
fillPlaceholders: 'Remplir les informations',
insert: 'Insérer',
enablePlaceholders: 'Prompt Dynamique',
autoExecute: 'Envoi Automatique',
infoTitle: 'Aide',
infoDPDesc: 'Accédez au guide d\'utilisation complet :
English | Português (BR) | 简体中文',
infoASDesc: 'Envoie le prompt au chat instantanément après son insertion, sans nécessiter d\'action manuelle.',
search: 'Rechercher prompt...',
searchLanguage: 'Rechercher langue...',
selectAll: 'Tout sélectionner',
countPrompts: '{count} prompts',
confirmDownloads: 'Vous êtes sur le point de télécharger {count} fichiers texte individuels. Continuer ?',
noSearchResults: 'Aucun prompt ne correspond à la recherche.',
ffWarningTitle: 'Avis Important',
ffWarningText: 'Dans cette zone spécifique de la page, Mon Prompt ne peut pas interagir correctement avec Firefox.',
ffRecommend: 'Pour une prise en charge complète dans toutes les zones du chat sur Doubao, nous recommandons d’utiliser des navigateurs basés sur Chromium (Chrome, Edge, Brave, etc).',
dontShowAgain: 'Retirer le Bouton d’Avertissement',
select: 'Sélectionnez une option :',
valueForVariable: 'Valeur pour {label} (et {varName})',
context: 'Contexte',
expand: 'Développer',
collapse: 'Réduire'
},
'ru': {
langName: 'Русский',
prompt: 'Промпт',
prompts: 'Промпты',
newPrompt: 'Новый промпт',
editPrompt: 'Редактировать промпт',
title: 'Название',
text: 'Текст промпта',
save: 'Сохранить',
close: 'Закрыть',
edit: 'Редактировать',
delete: 'Удалить',
noSavedPrompts: 'Нет сохраненных промптов.',
addPrompt: 'Добавить промпт',
import: 'Импорт',
export: 'Экспорт',
confirmDelete: 'Удалить промпт "{title}"?',
noPromptsToExport: 'Нет промптов для экспорта.',
promptsImported: 'Успешно импортировано промптов: {count}!',
errorImporting: 'Ошибка при импорте файла: {error}',
requiredFields: 'Название и текст промпта обязательны.',
editorNotFound: 'Не удалось найти текстовое поле для {platform}.',
languageSettings: '🌐 Язык',
fillPlaceholders: 'Заполните данные',
insert: 'Вставить',
enablePlaceholders: 'Динамический промпт',
autoExecute: 'Автоотправка',
infoTitle: 'Справка',
infoDPDesc: 'Открыть полное руководство пользователя:
English | Português (BR) | 简体中文',
infoASDesc: 'Автоматически отправляет промпт в чат сразу после вставки, не требуя ручного подтверждения.',
search: 'Поиск промпта...',
searchLanguage: 'Поиск языка...',
selectAll: 'Выбрать все',
countPrompts: '{count} промптов',
confirmDownloads: 'Вы собираетесь скачать {count} отдельных текстовых файлов. Продолжить?',
noSearchResults: 'По вашему запросу промптов не найдено.',
ffWarningTitle: 'Важное уведомление',
ffWarningText: 'В этой конкретной области страницы Мой Промпты не может корректно взаимодействовать при использовании Firefox.',
ffRecommend: 'Для полной поддержки всех областей чата в Doubao мы рекомендуем использовать браузеры на базе Chromium (Chrome, Edge, Brave и др.).',
dontShowAgain: 'Удалить кнопку предупреждения',
select: 'Выберите вариант:',
valueForVariable: 'Значение для {label} (и {varName})',
context: 'Контекст',
expand: 'Развернуть',
collapse: 'Свернуть'
},
'zh-CN': {
langName: '简体中文',
prompt: '提示',
prompts: '提示',
newPrompt: '新建提示',
editPrompt: '编辑提示',
title: '标题',
text: '提示内容',
save: '保存',
close: '关闭',
edit: '编辑',
delete: '删除',
noSavedPrompts: '没有已保存的提示。',
addPrompt: '添加提示',
import: '导入',
export: '导出',
confirmDelete: '确定要删除提示 "{title}" 吗?',
noPromptsToExport: '沒有可導出的提示。',
promptsImported: '成功导入 {count} 个提示!',
errorImporting: '导入文件时出错: {error}',
requiredFields: '标题和提示内容为必填项。',
editorNotFound: '未能找到 {platform} 的文本输入区域。',
languageSettings: '🌐 语言',
fillPlaceholders: '填写信息',
insert: '插入',
enablePlaceholders: '动态提示',
autoExecute: '自动发送',
infoTitle: '帮助',
infoDPDesc: '访问完整的使用指南:
English | Português (BR) | 简体中文',
infoASDesc: '插入后立即将提示发送到聊天室,无需手动操作。',
search: '搜索提示...',
searchLanguage: '搜索语言...',
selectAll: '全选',
countPrompts: '{count} 个提示词',
confirmDownloads: '即将下载 {count} 个单独的文本文件。是否继续?',
noSearchResults: '未找到匹配的提示词。',
ffWarningTitle: '重要提示',
ffWarningText: '在页面的此特定区域,我的提示词 在使用 Firefox 时无法正常互动。',
ffRecommend: '为在 Doubao 的所有聊天区域获得完整支持,建议使用基于 Chromium 的浏览器(Chrome、Edge、Brave 等)。',
dontShowAgain: '移除警告按钮',
select: '请选择一个选项:',
valueForVariable: '{label}(和 {varName})的值',
context: '上下文',
expand: '展开',
collapse: '折叠'
},
'ja': {
langName: '日本語',
prompt: 'プロンプト',
prompts: 'プロンプト',
newPrompt: '新規プロンプト',
editPrompt: 'プロンプト編集',
title: 'タイトル',
text: 'プロンプト',
save: '保存',
close: '閉じる',
edit: '編集',
delete: '削除',
noSavedPrompts: '保存されたプロンプトはありません',
addPrompt: 'プロンプトを追加',
import: 'インポート',
export: 'エクスポート',
confirmDelete: 'プロンプト「{title}」を削除しますか?',
noPromptsToExport: 'エクスポートするプロンプトがありません',
promptsImported: '{count}件のプロンプトをインポートしました',
errorImporting: 'ファイルのインポート中にエラーが発生しました: {error}',
requiredFields: 'タイトルとプロンプトは必須です',
editorNotFound: '{platform}のテキストエリアが見つかりません',
languageSettings: '🌐 言語設定',
fillPlaceholders: '情報を入力',
insert: '挿入',
enablePlaceholders: '動的プロンプト',
autoExecute: '自動送信',
infoTitle: 'ヘルプ',
infoDPDesc: '完全な利用ガイドを見る:
English | Português (BR) | 简体中文',
infoASDesc: '挿入後、手動操作なしでプロンプトをチャットに即座に送信します。',
search: 'プロンプトを検索...',
searchLanguage: '言語を検索...',
selectAll: 'すべて選択',
countPrompts: '{count} 件のプロンプト',
confirmDownloads: '{count} 個のテキストファイルをダウンロードしようとしています。続行しますか?',
noSearchResults: '検索条件に一致するプロンプトはありません。',
ffWarningTitle: '重要なお知らせ',
ffWarningText: 'ページのこの特定エリアでは、Firefox を使用している場合、マイプロンプトが正しく動作できません。',
ffRecommend: 'Doubao のすべてのチャット領域で完全なサポートを受けるには、Chromium ベースのブラウザ(Chrome、Edge、Brave など)の使用を推奨します。',
dontShowAgain: '警告ボタンを削除',
select: 'オプションを選択してください:',
valueForVariable: '{label}(および {varName})の値',
context: 'コンテキスト',
expand: '展開',
collapse: '折りたたむ'
},
'ko': {
langName: '한국어',
prompt: '프롬프트',
prompts: '프롬프트',
newPrompt: '새 프롬프트',
editPrompt: '프롬프트 편집',
title: '제목',
text: '프롬프트',
save: '저장',
close: '닫기',
edit: '편집',
delete: '삭제',
noSavedPrompts: '저장된 프롬프트가 없습니다',
addPrompt: '프롬프트 추가',
import: '가져오기',
export: '내보내기',
confirmDelete: '프롬프트 "{title}"을(를) 삭제하시겠습니까?',
noPromptsToExport: '내보낼 프롬프트가 없습니다',
promptsImported: '프롬프트 {count}개를 성공적으로 가져왔습니다',
errorImporting: '파일 가져오기 오류: {error}',
requiredFields: '제목과 프롬프트는 필수 항목입니다',
editorNotFound: '{platform}의 텍스트 영역을 찾을 수 없습니다',
languageSettings: '🌐 언어 설정',
fillPlaceholders: '정보 채우기',
insert: '삽입',
enablePlaceholders: '동적 프롬프트',
autoExecute: '자동 전송',
infoTitle: '도움말',
infoDPDesc: '전체 사용 가이드 보기:
English | Português (BR) | 简体中文',
infoASDesc: '수동 조치 없이 삽입 후 즉시 프롬프트를 채팅으로 보냅니다.',
search: '프롬프트 검색...',
searchLanguage: '언어 검색...',
selectAll: '전체 선택',
countPrompts: '{count}개의 프롬프트',
confirmDownloads: '{count}개의 개별 텍스트 파일을 다운로드하시겠습니까?',
noSearchResults: '검색 결과와 일치하는 프롬프트가 없습니다.',
ffWarningTitle: '중요 안내',
ffWarningText: '페이지의 이 특정 영역에서는 Firefox 사용 시 나의 프롬프트가 제대로 동작하지 않습니다.',
ffRecommend: 'Doubao의 모든 채팅 영역에서 완전한 지원을 받으려면 Chromium 기반 브라우저(Chrome, Edge, Brave 등)를 사용할 것을 권장합니다.',
dontShowAgain: '경고 버튼 제거',
select: '옵션을 선택하세요:',
valueForVariable: '{label} (및 {varName})의 값',
context: '컨텍스트',
expand: '펼치기',
collapse: '접기'
}
};
const SCRIPT_CONFIG = {
notificationsUrl: 'https://gist.github.com/0H4S/b2f9a9f92259deadc35bdccb11cd9a75',
scriptVersion: '2.8',
};
const notifier = new ScriptNotifier(SCRIPT_CONFIG);
notifier.run();
const LANG_STORAGE_KEY = 'UserScriptLang';
const PROMPT_STORAGE_KEY = 'Prompts';
let currentLang = 'en';
let isInitialized = false;
let isInitializing = false;
let currentButton = null;
let currentPlatform = null;
let pageObserver = null;
let currentMenu = null;
let currentModal = null;
let languageModal = null;
let currentPlaceholderModal = null;
let infoModal = null;
const scriptPolicy = window.trustedTypes
? window.trustedTypes.createPolicy('MyPromptPolicy', { createHTML: (input) => input })
: null;
function setSafeInnerHTML(element, html) {
if (!element) return;
if (scriptPolicy) {
element.innerHTML = scriptPolicy.createHTML(html);
} else {
element.innerHTML = html;
}
}
function getTranslation(key, replacements = {}) {
let text = translations[currentLang]?.[key] || translations.en[key];
Object.entries(replacements).forEach(([p, v]) => text = text.replace(`{${p}}`, v));
return text;
}
async function determineLanguage() {
const savedLang = await GM_getValue(LANG_STORAGE_KEY);
if (savedLang && translations[savedLang]) {
currentLang = savedLang;
return;
}
const browserLang = (navigator.language || navigator.userLanguage).toLowerCase();
if (browserLang.startsWith('pt')) currentLang = 'pt-BR';
else if (browserLang.startsWith('zh')) currentLang = 'zh-CN';
else if (browserLang.startsWith('en')) currentLang = 'en';
else if (browserLang.startsWith('es')) currentLang = 'es';
else if (browserLang.startsWith('fr')) currentLang = 'fr';
else if (browserLang.startsWith('ru')) currentLang = 'ru';
else if (browserLang.startsWith('ja')) currentLang = 'ja';
else if (browserLang.startsWith('ko')) currentLang = 'ko';
else currentLang = 'en';
}
function waitFor(selector, timeout = 8000) {
return new Promise((resolve, reject) => {
const el = document.querySelector(selector);
if (el) { resolve(el); return; }
const timer = setTimeout(() => { obs.disconnect(); reject(`Timeout esperando por ${selector}`); }, timeout);
const obs = new MutationObserver(() => {
const target = document.querySelector(selector);
if (target) { clearTimeout(timer); obs.disconnect(); resolve(target); }
});
if (document.body) obs.observe(document.body, { childList: true, subtree: true });
else document.addEventListener('DOMContentLoaded', () => obs.observe(document.body, { childList: true, subtree: true }));
});
}
const debounce = (func, wait) => {
let timeout;
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), wait);
};
};
async function getAll() { return await GM_getValue(PROMPT_STORAGE_KEY, []); }
async function addItem(item) {
const prompts = await getAll();
prompts.unshift(item);
await GM_setValue(PROMPT_STORAGE_KEY, prompts);
}
async function update(index, item) {
let prompts = await getAll();
if (prompts[index]) {
prompts[index] = item;
await GM_setValue(PROMPT_STORAGE_KEY, prompts);
}
}
async function remove(index) {
let prompts = await getAll();
prompts.splice(index, 1);
await GM_setValue(PROMPT_STORAGE_KEY, prompts);
}
function createCustomTooltip(button, text, position = 'top') {
let tooltipElement = null;
const showTooltip = () => {
if (tooltipElement) return;
tooltipElement = document.createElement('div');
tooltipElement.className = 'mp-tooltip';
tooltipElement.textContent = text;
document.body.appendChild(tooltipElement);
const btnRect = button.getBoundingClientRect();
const tooltipRect = tooltipElement.getBoundingClientRect();
let top;
const margin = 8;
if (position === 'bottom') {
top = btnRect.bottom + margin;
if (top + tooltipRect.height > window.innerHeight) {
top = btnRect.top - tooltipRect.height - margin;
}
} else {
top = btnRect.top - tooltipRect.height - margin;
if (top < 0) {
top = btnRect.bottom + margin;
}
}
let left = btnRect.left + (btnRect.width / 2) - (tooltipRect.width / 2);
if (left < 0) { left = margin; }
if (left + tooltipRect.width > window.innerWidth) { left = window.innerWidth - tooltipRect.width - margin; }
tooltipElement.style.left = `${left}px`;
tooltipElement.style.top = `${top}px`;
requestAnimationFrame(() => {
tooltipElement.classList.add('visible');
});
};
const hideTooltip = () => {
if (!tooltipElement) return;
const el = tooltipElement;
tooltipElement = null;
el.classList.remove('visible');
setTimeout(() => {
if (document.body.contains(el)) {
document.body.removeChild(el);
}
}, 150);
};
button.addEventListener('mouseenter', showTooltip);
button.addEventListener('mouseleave', hideTooltip);
button.addEventListener('mousedown', hideTooltip);
}
function injectGlobalStyles() {
const styleId = 'my-prompt-styles';
if (document.getElementById(styleId)) return;
const styleElement = document.createElement('style');
styleElement.id = styleId;
setSafeInnerHTML(styleElement, `
/* ---VARIÁVEIS E TEMA (CLARO / ESCURO)--- */
:root {
/* Tipografia */
--mp-font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !important;
/* Cores Base (Modo Claro) */
--mp-bg-primary: #ffffff;
--mp-bg-secondary: #f8f9fa;
--mp-bg-tertiary: #f1f3f5;
--mp-bg-overlay: rgba(10, 10, 10, 0.5);
/* Texto */
--mp-text-primary: #212529;
--mp-text-secondary: #495057;
--mp-text-tertiary: #868e96;
/* Bordas */
--mp-border-primary: #dee2e6;
--mp-border-secondary: #ced4da;
/* Cores de Ação */
--mp-accent-primary: #7071fc;
--mp-accent-primary-hover: #595ac9;
--mp-accent-yellow: #fab005;
--mp-accent-yellow-hover: #f08c00;
--mp-accent-red: #f03e3e;
--mp-accent-red-hover: #c92a2a;
/* Sombras e Bordas */
--mp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
--mp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
--mp-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
--mp-border-radius-sm: 4px;
--mp-border-radius-md: 8px;
--mp-border-radius-lg: 16px;
/* Transições */
--mp-transition-fast: 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}
@media (prefers-color-scheme: dark) {
:root {
/* Cores Base (Modo Escuro) */
--mp-bg-primary: #212529;
--mp-bg-secondary: #2c2c30;
--mp-bg-tertiary: #343a40;
--mp-bg-overlay: rgba(0, 0, 0, 0.7);
/* Texto */
--mp-text-primary: #f8f9fa;
--mp-text-secondary: #e9ecef;
--mp-text-tertiary: #adb5bd;
/* Bordas */
--mp-border-primary: #495057;
--mp-border-secondary: #868e96;
/* Sombras */
--mp-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
--mp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
--mp-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3);
}
}
/* ---UTILITÁRIOS GERAIS--- */
.mp-hidden {
display: none !important;
}
/* ---SISTEMA DE SCROLL--- */
.mp-scroll-invisible {
overflow-y: auto !important;
scrollbar-width: none !important; /* Firefox */
-ms-overflow-style: none !important; /* IE/Edge */
scroll-behavior: smooth;
}
/* Remove scrollbar no Chrome/Safari/Webkit */
.mp-scroll-invisible::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
}
/* Wrapper que envolve a lista e contém as setas absolutas */
.mp-scroll-wrapper {
position: relative;
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
min-height: 0;
}
/* Estilo Base das Setas */
.mp-scroll-arrow {
position: absolute;
left: 0;
right: 0;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
color: var(--mp-text-tertiary);
cursor: pointer;
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease, color 0.2s ease;
z-index: 10;
}
/* Seta Superior */
.mp-scroll-arrow.up {
top: 0;
background: linear-gradient(to bottom, var(--scroll-bg, var(--mp-bg-primary)) 30%, transparent);
}
/* Seta Inferior */
.mp-scroll-arrow.down {
bottom: 0;
background: linear-gradient(to top, var(--scroll-bg, var(--mp-bg-primary)) 30%, transparent);
}
/* Estados da Seta */
.mp-scroll-arrow:hover {
color: var(--mp-accent-primary);
}
.mp-scroll-arrow.visible {
opacity: 1;
pointer-events: auto;
}
/* Ícone SVG da Seta */
.mp-scroll-arrow svg {
width: 20px;
height: 20px;
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}
/* --- AJUSTE ESPECÍFICO PARA O TEXTAREA DO EDITOR DE PROMPT --- */
#AB_modal_box_el #__ap_text,
#prompt-menu-container #__ap_text,
.mp-modal-box .form-group:has(#__ap_text) .form-textarea {
border: none !important;
box-shadow: none !important;
background-color: transparent !important;
padding: 10px;
width: 100%;
height: 100%;
}
.mp-modal-box .form-group:has(#__ap_text) .mp-scroll-wrapper {
border: 1px solid var(--mp-border-primary);
border-radius: var(--mp-border-radius-md);
background-color: var(--mp-bg-secondary);
transition: border-color 0.2s, box-shadow 0.2s;
overflow: hidden !important;
display: flex;
flex-direction: column;
height: 300px;
}
.mp-modal-box .form-group:has(#__ap_text) .mp-scroll-wrapper:focus-within {
border-color: var(--mp-accent-primary);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-accent-primary) 25%, transparent);
}
.mp-modal-box.mp-expanded .form-group:has(#__ap_text) .mp-scroll-wrapper {
height: 100% !important;
}
/* ---OVERLAY E MODAL PRINCIPAL--- */
.mp-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--mp-bg-overlay);
z-index: 2147483647;
display: flex;
justify-content: center;
align-items: center;
backdrop-filter: blur(4px);
opacity: 0;
visibility: hidden;
transition: opacity var(--mp-transition-fast), visibility var(--mp-transition-fast);
}
.mp-overlay.visible {
opacity: 1;
visibility: visible;
}
.mp-modal-box {
font-family: var(--mp-font-family-base) !important;
background-color: var(--mp-bg-primary);
color: var(--mp-text-primary);
border-radius: var(--mp-border-radius-lg);
padding: 24px;
box-shadow: var(--mp-shadow-lg);
width: min(90vw, 520px);
border: 1px solid var(--mp-border-primary);
transform: scale(0.95) translateY(10px);
opacity: 0;
transition: transform var(--mp-transition-fast), opacity var(--mp-transition-fast), width 0.3s cubic-bezier(0.4, 0, 0.2, 1), height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
display: flex;
flex-direction: column;
max-height: 85vh;
}
.mp-modal-box.mp-expanded {
width: 900px !important;
max-width: 95vw !important;
height: 85vh !important;
display: flex;
flex-direction: column;
}
.mp-modal-box.mp-expanded .modal-title {
display: none;
}
.mp-modal-box.mp-expanded .form-group:has(.form-textarea) {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
margin-bottom: 24px;
}
.mp-modal-box.mp-expanded .mp-scroll-wrapper {
flex: 1;
height: 100% !important;
}
.mp-modal-box.mp-expanded .form-textarea {
height: 100% !important;
}
.mp-modal-box.mp-expanded .mp-switch-container {
padding-top: 10px;
}
.mp-overlay.visible .mp-modal-box {
transform: scale(1) translateY(0);
opacity: 1;
}
.modal-title {
font-size: 18px;
font-weight: 600;
margin: 0 0 20px;
text-align: center;
color: var(--mp-text-primary);
flex-shrink: 0;
}
.modal-footer {
display: flex;
justify-content: center;
margin-top: 16px;
flex-shrink: 0;
}
/* Botões de Fechar e Info */
.mp-modal-close-btn,
.mp-modal-info-btn {
position: absolute;
top: 12px;
background: none;
border: none;
color: var(--mp-text-tertiary);
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease;
display: flex;
justify-content: center;
align-items: center;
padding: 0;
z-index: 20;
}
.mp-modal-close-btn {
right: 12px;
}
.mp-modal-info-btn {
right: 88px;
}
.mp-modal-close-btn:hover {
transform: rotate(90deg);
color: var(--mp-accent-red);
background-color: color-mix(in srgb, var(--mp-accent-red) 15%, transparent);
}
.mp-modal-info-btn:hover {
transform: scale(1.1);
color: var(--mp-accent-primary);
background-color: color-mix(in srgb, var(--mp-accent-primary) 15%, transparent);
}
.mp-modal-close-btn svg,
.mp-modal-info-btn svg {
width: 20px;
height: 20px;
stroke: currentColor;
stroke-width: 2.5;
fill: none;
}
.mp-modal-info-btn svg {
stroke-width: 0;
fill: currentColor;
}
/* Estilo do Botão de Expandir */
.mp-modal-expand-btn {
position: absolute;
top: 12px;
right: 50px;
background: none;
border: none;
color: var(--mp-text-tertiary);
cursor: pointer;
width: 32px;
height: 32px;
border-radius: 50%;
transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease;
display: flex;
justify-content: center;
align-items: center;
padding: 0;
z-index: 20;
}
.mp-modal-expand-btn:hover {
transform: scale(1.1);
color: var(--mp-accent-primary);
background-color: color-mix(in srgb, var(--mp-accent-primary) 15%, transparent);
}
.mp-modal-expand-btn svg {
width: 20px;
height: 20px;
stroke: currentColor;
stroke-width: 2;
fill: none;
}
/* --- HELPERS E TOOLTIPS DE CONTEXTO --- */
.mp-label-wrapper {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 6px;
width: 100%;
}
.mp-help-icon {
color: var(--mp-accent-primary);
cursor: pointer;
display: flex;
align-items: center;
transition: transform 0.2s;
opacity: 0.8;
}
.mp-help-icon:hover {
transform: scale(1.1);
opacity: 1;
}
.mp-help-icon svg {
width: 15px;
height: 15px;
fill: currentColor;
}
.mp-context-bubble {
display: none;
background-color: var(--mp-bg-tertiary);
border-left: 3px solid var(--mp-accent-primary);
padding: 8px 12px;
border-radius: 0 var(--mp-border-radius-sm) var(--mp-border-radius-sm) 0;
margin-bottom: 12px;
font-size: 13px;
color: var(--mp-text-secondary);
line-height: 1.4;
animation: mp-fade-in-down 0.2s ease-out forwards;
width: 100%;
box-sizing: border-box;
}
.mp-context-bubble.visible {
display: block;
}
.mp-context-bubble strong {
color: var(--mp-text-primary);
font-weight: 600;
}
@keyframes mp-fade-in-down {
from {
opacity: 0;
transform: translateY(-5px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* ---MENU FLUTUANTE DE PROMPTS--- */
.prompt-menu {
position: fixed;
min-width: 320px;
max-width: 420px;
background-color: var(--mp-bg-primary);
border: 1px solid var(--mp-border-primary);
border-radius: var(--mp-border-radius-lg);
box-shadow: var(--mp-shadow-lg);
z-index: 2147483647;
display: flex;
flex-direction: column;
user-select: none;
color: var(--mp-text-primary) !important;
font-family: var(--mp-font-family-base) !important;
overflow: hidden;
opacity: 0;
visibility: hidden;
transform: scale(0.95);
transform-origin: top left;
transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.prompt-menu.visible {
opacity: 1;
visibility: visible;
transform: scale(1);
transition-delay: 0s;
}
.prompt-menu-list {
max-height: 220px;
padding: 4px;
}
.prompt-item-row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
border-radius: var(--mp-border-radius-md);
cursor: pointer;
transition: background-color 0.15s ease-in-out;
}
.prompt-item-row:hover {
background-color: var(--mp-bg-tertiary);
}
.prompt-title {
font-size: 14px;
font-weight: 500;
flex: 1;
padding-right: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--mp-text-secondary);
}
.prompt-item-row:hover .prompt-title {
color: var(--mp-text-primary);
}
.prompt-actions {
display: flex;
align-items: center;
gap: 4px;
}
.action-btn {
background: transparent;
border: none;
cursor: pointer;
padding: 6px;
border-radius: var(--mp-border-radius-sm);
transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
display: flex;
align-items: center;
justify-content: center;
line-height: 0;
color: var(--mp-text-secondary);
}
.action-btn svg {
width: 16px;
height: 16px;
display: block;
}
.action-btn.edit:hover {
background-color: var(--mp-bg-tertiary);
color: var(--mp-accent-yellow);
}
.action-btn.delete:hover {
background-color: var(--mp-bg-tertiary);
color: var(--mp-accent-red);
}
/* Rodapé do Menu */
.menu-footer-grid {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
border-top: 1px solid var(--mp-border-primary);
background-color: var(--mp-bg-secondary);
flex-shrink: 0;
}
.menu-footer-btn {
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: none;
cursor: pointer;
padding: 12px 0;
color: var(--mp-text-secondary);
transition: all 0.2s ease;
height: auto;
}
.menu-footer-btn:not(:last-child) {
border-right: 1px solid var(--mp-border-primary);
}
.menu-footer-btn svg {
width: 20px;
height: 20px;
transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.menu-footer-btn:hover svg {
transform: scale(1.2);
}
.menu-footer-btn.btn-export:hover {
background-color: rgba(34, 129, 207, 0.1);
color: #2281cfff;
}
.menu-footer-btn.btn-add:hover {
background-color: rgba(32, 201, 97, 0.1);
color: #20c961ff;
transform: none;
}
.menu-footer-btn.btn-add:hover svg {
transform: scale(1.4);
}
.menu-footer-btn.btn-import:hover {
background-color: rgba(253, 126, 20, 0.1);
color: #fd7e14;
}
/* ---FORMULÁRIOS E INPUTS--- */
.form-group {
display: flex;
flex-direction: column;
margin-bottom: 16px;
margin-top: 16px;
flex-shrink: 0;
}
.form-label {
margin-bottom: 8px;
font-size: 13px !important;
font-weight: 500 !important;
color: var(--mp-text-secondary);
display: block;
}
.form-input,
.form-textarea {
background-color: var(--mp-bg-secondary) !important;
color: var(--mp-text-primary) !important;
border: 1px solid var(--mp-border-primary) !important;
border-radius: var(--mp-border-radius-md);
padding: 10px;
width: 100%;
box-sizing: border-box;
transition: border-color 0.2s, box-shadow 0.2s;
outline: 0 !important;
font-family: var(--mp-font-family-base) !important;
font-size: 14px !important;
}
.form-textarea {
height: 300px !important;
resize: none !important;
display: block;
}
.form-input:focus,
.form-textarea:focus {
border-color: var(--mp-accent-primary) !important;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--mp-accent-primary) 25%, transparent) !important;
}
.form-input::placeholder,
.form-textarea::placeholder,
.mp-search-input::placeholder,
.menu-search-input::placeholder,
.lang-search-input::placeholder {
color: var(--mp-text-tertiary) !important;
opacity: 0.7;
}
/* Switches (Checkbox estilo Toggle) */
.mp-switch-container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 4px 0 4px;
margin: -8px 0 24px;
flex-shrink: 0;
}
.mp-switch {
display: flex;
align-items: center;
gap: 8px;
}
.mp-switch input[type="checkbox"] {
height: 0;
width: 0;
visibility: hidden;
position: absolute;
}
.mp-switch label {
cursor: pointer;
text-indent: -9999px;
width: 40px;
height: 22px;
background: var(--mp-bg-tertiary);
display: block;
border-radius: 100px;
position: relative;
transition: background-color var(--mp-transition-fast);
}
.mp-switch label:after {
content: '';
position: absolute;
top: 3px;
left: 3px;
width: 16px;
height: 16px;
background: #fff;
border-radius: 90px;
transition: 0.3s cubic-bezier(.25, 1, .5, 1);
box-shadow: var(--mp-shadow-sm);
}
.mp-switch input:checked+label {
background: var(--mp-accent-primary);
}
.mp-switch input:checked+label:after {
left: calc(100% - 3px);
transform: translateX(-100%);
}
.mp-switch .switch-text {
font-size: 13px;
font-weight: 500;
color: var(--mp-text-secondary);
cursor: pointer;
user-select: none;
}
/* Checkboxe */
.mp-checkbox, .mp-option-item input[type="checkbox"] {
-webkit-appearance: none !important;
appearance: none !important;
width: 18px !important;
height: 18px !important;
border: 1px solid var(--mp-border-primary) !important;
border-radius: var(--mp-border-radius-sm) !important;
background-color: var(--mp-bg-secondary) !important;
cursor: pointer !important;
margin: 0 !important;
display: grid !important;
place-content: center !important;
transition: all 0.2s ease;
}
.mp-checkbox:checked, .mp-option-item input[type="checkbox"]:checked {
background-color: var(--mp-accent-primary) !important;
border-color: var(--mp-accent-primary) !important;
}
.mp-checkbox::before, .mp-option-item input[type="checkbox"]::before {
content: "";
width: 10px;
height: 10px;
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
background-color: #ffffff;
transform: scale(0);
transition: 0.15s transform ease-in-out;
}
.mp-checkbox:checked::before, .mp-option-item input[type="checkbox"]:checked::before {
transform: scale(1);
}
/* Campos de Busca */
.mp-search-container,
.menu-search-container {
position: sticky;
top: 0;
z-index: 10;
display: flex;
flex-direction: column;
flex-shrink: 0;
}
.menu-search-container {
padding: 10px 12px;
background-color: var(--mp-bg-secondary);
border-bottom: 1px solid var(--mp-border-primary);
}
.mp-search-input,
.menu-search-input,
.lang-search-input {
width: 100%;
padding: 10px 12px;
border-radius: var(--mp-border-radius-md);
border: 1px solid var(--mp-border-primary);
background-color: var(--mp-bg-secondary);
color: var(--mp-text-primary);
font-family: var(--mp-font-family-base) !important;
font-size: 13px;
box-sizing: border-box;
outline: none;
transition: border-color 0.2s;
}
.menu-search-input {
background-color: var(--mp-bg-primary) !important;
}
.lang-search-input {
margin-bottom: 12px;
}
.mp-search-input:focus,
.menu-search-input:focus,
.lang-search-input:focus {
border-color: var(--mp-accent-primary);
}
/* ---MENUS ESPECÍFICOS (EXPORTAÇÃO, DINÂMICO, IDIOMAS)--- */
/* Exportação */
.mp-export-actions {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 20px;
margin-bottom: 20px;
font-size: 13px;
color: var(--mp-text-secondary);
border-bottom: 1px solid var(--mp-border-primary);
padding-bottom: 16px;
}
.mp-checkbox-wrapper {
display: flex;
align-items: center;
cursor: pointer;
user-select: none;
}
.mp-export-list {
display: flex;
flex-direction: column;
gap: 4px;
margin: 0 -8px;
padding: 0 8px;
}
.mp-export-item {
display: flex;
align-items: center;
padding: 8px;
border-radius: var(--mp-border-radius-md);
transition: background 0.15s;
cursor: pointer;
border: 1px solid transparent;
}
.mp-export-item:hover {
background-color: var(--mp-bg-tertiary);
border-color: var(--mp-border-primary);
}
.mp-item-content {
display: flex;
flex-direction: column;
overflow: hidden;
margin-left: 12px;
}
.mp-item-title {
font-size: 14px;
font-weight: 500;
color: var(--mp-text-primary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.mp-item-preview {
font-size: 12px;
color: var(--mp-text-tertiary);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-top: 2px;
}
.mp-export-buttons {
display: flex;
gap: 10px;
margin-top: 20px;
justify-content: flex-end;
border-top: 1px solid var(--mp-border-primary);
padding-top: 16px;
flex-shrink: 0;
}
/* Dinâmico */
#__ap_placeholders_container {
padding-right: 4px;
}
.mp-option-group {
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 16px;
padding: 4px;
border: 1px solid var(--mp-border-primary);
border-radius: var(--mp-border-radius-md);
background-color: var(--mp-bg-tertiary);
}
.mp-option-item {
display: flex;
align-items: center;
gap: 10px;
font-size: 13px;
cursor: pointer;
padding: 6px;
border-radius: var(--mp-border-radius-sm);
background-color: var(--mp-bg-primary);
transition: background-color 0.2s;
user-select: none;
}
.mp-option-item:hover {
background-color: var(--mp-bg-secondary);
}
/* Idiomas */
.lang-box {
width: min(90vw, 320px);
}
.lang-button {
all: unset;
box-sizing: border-box;
display: block;
width: 100%;
padding: 12px 20px;
border-radius: var(--mp-border-radius-md);
background-color: var(--mp-bg-secondary);
color: var(--mp-text-primary);
border: 1px solid var(--mp-border-primary);
font-weight: 500;
cursor: pointer;
text-align: center;
transition: all 0.2s ease;
font-family: var(--mp-font-family-base) !important;
flex-shrink: 0;
}
.lang-button:hover {
transform: translateY(-2px);
box-shadow: var(--mp-shadow-sm);
background-color: var(--mp-bg-tertiary);
}
.lang-button.selected {
border-color: var(--mp-accent-primary);
color: var(--mp-accent-primary);
background-color: color-mix(in srgb, var(--mp-accent-primary) 5%, transparent);
font-weight: 600;
}
/* ---BOTÕES PRINCIPAIS--- */
.save-button {
padding: 10px 28px;
border-radius: var(--mp-border-radius-md);
background-color: var(--mp-accent-primary);
color: #fff;
border: none;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease-in-out;
font-family: var(--mp-font-family-base) !important;
}
.save-button:hover {
background-color: var(--mp-accent-primary-hover);
transform: translateY(-1px);
}
.mp-btn-secondary {
background: transparent;
border: 1px solid var(--mp-border-secondary);
color: var(--mp-text-secondary);
}
.mp-btn-secondary:hover {
background-color: var(--mp-bg-tertiary);
color: var(--mp-text-primary);
}
/* ---TABELA DE INFORMAÇÕES--- */
.mp-info-table {
display: flex;
flex-direction: column;
border: 1px solid var(--mp-border-primary);
border-radius: var(--mp-border-radius-md);
overflow: hidden;
margin-top: 8px;
}
.mp-info-row {
display: flex;
text-align: center;
}
.mp-info-row:not(:last-child) {
border-bottom: 1px solid var(--mp-border-primary);
}
.mp-info-col {
padding: 16px;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.mp-info-col:not(:last-child) {
border-right: 1px solid var(--mp-border-primary);
}
.mp-info-col h3 {
font-size: 14px;
font-weight: 600;
color: var(--mp-text-primary);
margin: 0 0 8px;
}
.mp-info-col p {
font-size: 13px;
color: var(--mp-text-secondary);
line-height: 1.5;
margin: 0;
}
/* ---EXTRAS (Tooltips, Empty States, Animações)--- */
.mp-tooltip {
position: fixed;
z-index: 2147483647;
border-radius: var(--mp-border-radius-sm);
padding: 6px 12px;
pointer-events: none;
white-space: nowrap;
font-family: var(--mp-font-family-base) !important;
font-size: 14px;
font-weight: 500;
background-color: var(--mp-text-primary);
color: var(--mp-bg-primary);
box-shadow: var(--mp-shadow-md);
opacity: 0;
transform: scale(0.95);
transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);
}
.mp-tooltip.visible {
opacity: 1;
transform: scale(1);
}
.empty-state {
padding: 24px 16px;
text-align: center;
color: var(--mp-text-tertiary);
font-size: 14px;
}
@keyframes mp-fade-in-up {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
`);
document.head.appendChild(styleElement);
}
// #endregion GLOBAL
// #region BOTÕES DE PROMPT
// ---CHATGPT---
function createChatGPTButton() {
const btn = document.createElement('button');
btn.type = 'button';
btn.setAttribute('data-testid', 'composer-button-prompts');
btn.className = 'composer-btn';
setSafeInnerHTML(btn, ``);
createCustomTooltip(btn, getTranslation('prompts'));
return btn;
}
// ---DEEPSEEK---
function createDeepSeekButton() {
const btn = document.createElement('button');
btn.setAttribute('role', 'button');
btn.setAttribute('aria-disabled', 'false');
btn.setAttribute('tabindex', '0');
btn.style.transform = 'translateZ(0px)';
btn.setAttribute('data-testid', 'composer-button-prompts');
const innerHTML = `
${getTranslation('infoDPDesc')}
${getTranslation('infoASDesc')}
${getTranslation('ffWarningText')}
${getTranslation('ffRecommend')}