', {
'class': 'size-[90%] rounded-md duration-150 [grid-area:1/-1] group-hover:opacity-100 opacity-0 border-borderMain/50 ring-borderMain/50 divide-borderMain/50 dark:divide-borderMainDark/50 dark:ring-borderMainDark/50 dark:border-borderMainDark/50 bg-offsetPlus dark:bg-offsetPlusDark'
}),
jq(svgHtml).addClass('relative duration-150 [grid-area:1/-1] group-hover:scale-110 text-text-200'),
),
jq('
', {
'class': 'light font-sans text-xs text-textOff dark:text-textOffDark selection:bg-super/50 selection:text-textMain dark:selection:bg-superDuper/10 dark:selection:text-superDark text-center',
'text': label ?? 'MISSING LABEL'
})
);
}
const handleLeftSettingsButtonSetup = () => {
const existingLeftSettingsButton = getLeftSettingsButtonEl();
if (existingLeftSettingsButton.length === 1) {
// const wrapper = existingLeftSettingsButton.parent();
// if (!wrapper.is(':last-child')) {
// wrapper.appendTo(wrapper.parent());
// }
return;
}
const $leftPanel = PP.getIconsInLeftPanel();
if ($leftPanel.length === 0) {
debugLog('handleLeftSettingsButtonSetup: leftPanel not found');
}
const $sidebarButton = createSidebarButton({
svgHtml: cogIco,
label: 'Perplexity Helper',
testId: 'perplexity-helper-settings',
href: '#',
})
.attr('id', leftSettingsButtonId)
.on('click', () => {
debugLog('left settings button clicked');
if (!PP.isBreakpoint('md')) {
PP.getLeftPanel().hide();
}
showPerplexityHelperSettingsModal();
});
$leftPanel.append($sidebarButton);
};
const handleSlimLeftMenu = () => {
const config = loadConfigOrDefault();
if (!config.slimLeftMenu) return;
const $leftPanel = PP.getLeftPanel();
if ($leftPanel.length === 0) {
// debugLog('handleSlimLeftMenu: leftPanel not found');
}
$leftPanel.addClass(leftPanelSlimCls);
$leftPanel.find('.py-md').css('width', '45px');
};
const handleHideHomeWidgets = () => {
const config = loadConfigOrDefault();
if (!config.hideHomeWidgets) return;
const homeWidgets = PP.getHomeWidgets();
if (homeWidgets.length === 0) {
debugLog('handleHideHomeWidgets: homeWidgets not found');
return;
}
if (homeWidgets.length > 1) {
console.warn(logPrefix, '[handleHideHomeWidgets] too many homeWidgets found', homeWidgets);
}
homeWidgets.hide();
};
const handleFixImageGenerationOverlay = () => {
const config = loadConfigOrDefault();
if (!config.fixImageGenerationOverlay) return;
const imageGenerationOverlay = PP.getImageGenerationOverlay();
if (imageGenerationOverlay.length === 0) {
// debugLog('handleFixImageGenerationOverlay: imageGenerationOverlay not found');
return;
}
// only if wrench button is cyan (we are in custom prompt)
if (!imageGenerationOverlay.find('button').hasClass('bg-super')) return;
const transform = imageGenerationOverlay.css('transform');
if (!transform) return;
// Handle both matrix and translate formats
const matrixMatch = transform.match(/matrix\(.*,\s*([\d.]+),\s*([\d.]+)\)/);
const translateMatch = transform.match(/translate\(([\d.]+)px(?:,\s*([\d.]+)px)?\)/);
const currentX = matrixMatch
? matrixMatch[1] // Matrix format: 5th value is X translation
: translateMatch?.[1] || 0; // Translate format: first value
debugLog('[handleFixImageGenerationOverlay] currentX', currentX, 'transform', transform);
imageGenerationOverlay.css({
transform: `translate(${currentX}px, 0px)`
});
};
const handleExtraSpaceBellowLastAnswer = () => {
const config = loadConfigOrDefault();
if (!config.extraSpaceBellowLastAnswer) return;
jq('body')
.find(`.erp-sidecar\\:h-fit .md\\:pt-md.isolate > .max-w-threadContentWidth`)
.last()
.css({
// backgroundColor: 'magenta',
paddingBottom: '15em',
})
;
};
const handleSearchPage = () => {
const controlsArea = getCurrentControlsArea();
controlsArea.addClass(controlsAreaCls);
controlsArea.parent().find('textarea').first().addClass(textAreaCls);
controlsArea.addClass(roundedMD);
controlsArea.parent().addClass(roundedMD);
if (controlsArea.length === 0) {
debugLog('controlsArea not found', {
controlsArea,
currentControlsArea: getCurrentControlsArea(),
isStandardControlsAreaFc: isStandardControlsAreaFc()
});
}
const lastQueryBoxText = getLastQuery();
const mainTextArea = isStandardControlsAreaFc() ? controlsArea.prev().prev() : controlsArea.parent().prev();
if (mainTextArea.length === 0) {
debugLog('mainTextArea not found', mainTextArea);
}
debugLog('lastQueryBoxText', { lastQueryBoxText });
if (lastQueryBoxText) {
const copilotNewThread = getCopilotNewThreadButton();
const copilotRepeatLast = getCopilotRepeatLastButton();
if (controlsArea.length > 0 && copilotNewThread.length < 1) {
controlsArea.append(button('copilot_new_thread', robotIco, "Starts new thread for with last query text and Copilot ON", standardButtonCls));
}
// Due to updates in Perplexity, this is unnecessary for now
// if (controlsArea.length > 0 && copilotRepeatLast.length < 1) {
// controlsArea.append(button('copilot_repeat_last', robotRepeatIco, "Repeats last query with Copilot ON"));
// }
if (!copilotNewThread.attr('data-has-custom-click-event')) {
copilotNewThread.on("click", function () {
debugLog('copilotNewThread Button clicked!');
openNewThreadModal(getLastQuery());
});
copilotNewThread.attr('data-has-custom-click-event', true);
}
if (!copilotRepeatLast.attr('data-has-custom-click-event')) {
copilotRepeatLast.on("click", function () {
const controlsArea = getCurrentControlsArea();
const textAreaElement = controlsArea.parent().find('textarea')[0];
const coPilotRepeatLastAutoSubmit =
getSavedStates()
? getSavedStates().coPilotRepeatLastAutoSubmit
: getCoPilotRepeatLastAutoSubmitCheckbox().prop('checked');
debugLog('coPilotRepeatLastAutoSubmit', coPilotRepeatLastAutoSubmit);
changeValueUsingEvent(textAreaElement, getLastQuery());
const copilotToggleButton = getCopilotToggleButton(mainTextArea);
debugLog('mainTextArea', mainTextArea);
debugLog('copilotToggleButton', copilotToggleButton);
toggleBtnDot(copilotToggleButton, true);
const isCopilotOnBtn = () => isCopilotOn(copilotToggleButton);
const copilotCheck = () => {
const ctx = { timer: null };
ctx.timer = setInterval(() => checkForCopilotToggleState(ctx.timer, isCopilotOnBtn, coPilotRepeatLastAutoSubmit, 0), 500);
};
copilotCheck();
debugLog('copilot_repeat_last Button clicked!');
});
copilotRepeatLast.attr('data-has-custom-click-event', true);
}
}
if (getNumberOfDashedSVGs() > 0 && getNumberOfDashedSVGs() === getDashedCheckboxButton().length
&& getSelectAllButton().length < 1 && getSelectAllAndSubmitButton().length < 1) {
debugLog('getNumberOfDashedSVGs() === getNumberOfDashedSVGs()', getNumberOfDashedSVGs());
debugLog('getSpecifyQuestionBox', getSpecifyQuestionBox());
const specifyQuestionControlsWrapper = getSpecifyQuestionControlsWrapper();
debugLog('specifyQuestionControlsWrapper', specifyQuestionControlsWrapper);
const selectAllButton = textButton('perplexity_helper_select_all', 'Select all', 'Selects all options');
const selectAllAndSubmitButton = textButton('perplexity_helper_select_all_and_submit', 'Select all & submit', 'Selects all options and submits');
specifyQuestionControlsWrapper.append(selectAllButton);
specifyQuestionControlsWrapper.append(selectAllAndSubmitButton);
getSelectAllButton().on("click", function () {
selectAllCheckboxes();
});
getSelectAllAndSubmitButton().on("click", function () {
selectAllCheckboxes();
setTimeout(() => {
getSpecifyQuestionControlsWrapper().find('button:contains("Continue")').click();
}, 200);
});
}
const constructClipBoard = (buttonId, buttonGetter, modalGetter, copiedModalId, elementGetter) => {
const placeholderValue = getSpecifyQuestionBox().find('textarea').attr('placeholder');
const clipboardInstance = new ClipboardJS(`#${buttonId}`, {
text: () => placeholderValue
});
const copiedModal = `
Copied!`;
debugLog('copiedModalId', copiedModalId);
debugLog('copiedModal', copiedModal);
jq('main').append(copiedModal);
clipboardInstance.on('success', _ => {
var buttonPosition = buttonGetter().position();
jq(`#${copiedModalId}`).css({
top: buttonPosition.top - 30,
left: buttonPosition.left + 50
}).show();
if (elementGetter !== undefined) {
changeValueUsingEvent(elementGetter()[0], placeholderValue);
}
setTimeout(() => {
modalGetter().hide();
}, 5000);
});
};
if (questionBoxWithPlaceholderExists() && getCopyPlaceholder().length < 1) {
const copyPlaceholder = textButton('perplexity_helper_copy_placeholder', 'Copy placeholder', 'Copies placeholder value');
const copyPlaceholderAndFillIn = textButton('perplexity_helper_copy_placeholder_and_fill_in', 'Copy placeholder and fill in',
'Copies placeholder value and fills in input');
const specifyQuestionControlsWrapper = getSpecifyQuestionControlsWrapper();
specifyQuestionControlsWrapper.append(copyPlaceholder);
specifyQuestionControlsWrapper.append(copyPlaceholderAndFillIn);
constructClipBoard('perplexity_helper_copy_placeholder', getCopyPlaceholder, getCopiedModal, 'copied-modal');
constructClipBoard('perplexity_helper_copy_placeholder_and_fill_in', getCopyAndFillInPlaceholder, getCopiedModal2, 'copied-modal-2', getCopyPlaceholderInput);
}
};
const getLabelFromModelDescription = modelLabelStyle => modelLabelFromAriaLabel => modelDescription => {
if (!modelDescription) return modelLabelFromAriaLabel;
switch (modelLabelStyle) {
case MODEL_LABEL_TEXT_MODE.FULL_NAME:
return modelDescription.nameEn;
case MODEL_LABEL_TEXT_MODE.SHORT_NAME:
return modelDescription.nameEnShort ?? modelDescription.nameEn;
case MODEL_LABEL_TEXT_MODE.PP_MODEL_ID:
return modelDescription.ppModelId;
case MODEL_LABEL_TEXT_MODE.OWN_NAME_VERSION_SHORT:
const nameText = modelDescription.ownNameEn ?? modelDescription.nameEn;
const versionTextRaw = modelDescription.ownVersionEnShort ?? modelDescription.ownVersionEn;
const versionText = versionTextRaw?.replace(/ P$/, ' Pro'); // HACK: Gemini 2.5 Pro
return [nameText, versionText].filter(Boolean).join(modelDescription.ownNameVersionSeparator ?? ' ');
default:
throw new Error(`Unknown model label style: ${modelLabelStyle}`);
}
};
const getExtraClassesFromModelLabelStyle = modelLabelStyle => {
switch (modelLabelStyle) {
case MODEL_LABEL_STYLE.BUTTON_SUBTLE:
return modelLabelStyleButtonSubtleCls;
case MODEL_LABEL_STYLE.BUTTON_WHITE:
return modelLabelStyleButtonWhiteCls;
case MODEL_LABEL_STYLE.BUTTON_CYAN:
return modelLabelStyleButtonCyanCls;
default:
return '';
}
};
const handleModelLabel = () => {
const config = loadConfigOrDefault();
if (!config.modelLabelStyle || config.modelLabelStyle === MODEL_LABEL_STYLE.OFF) return;
const $modelIcons = PP.getAnyModelButton();
$modelIcons.each((_, el) => {
const $el = jq(el);
if (!$el.find(`.${modelLabelCls}`).length) {
$el.prepend(jq(`
`));
}
if (!$el.hasClass(modelIconButtonCls)) {
$el.addClass(modelIconButtonCls);
}
if (config.modelLabelRemoveCpuIcon) {
$el.addClass(modelLabelRemoveCpuIconCls);
}
const $label = $el.find(`.${modelLabelCls}`);
const modelDescription = PP.getModelDescriptionFromModelButton($el);
const modelLabelFromAriaLabel = $el.attr('aria-label');
const modelLabel = getLabelFromModelDescription(config.modelLabelTextMode)(modelLabelFromAriaLabel)(modelDescription);
if (!modelLabel) {
console.error('[handleModelLabel] modelLabel is null', { modelDescription, modelLabelFromAriaLabel, $el });
return;
}
const extraClasses = [
getExtraClassesFromModelLabelStyle(config.modelLabelStyle),
config.modelLabelOverwriteCyanIconToGray ? modelLabelOverwriteCyanIconToGrayCls : '',
].filter(Boolean).join(' ');
$label.attr('data-extra-classes', extraClasses);
const isReasoningModel = modelDescription?.modelType === 'reasoning';
const hasReasoningIcon = isReasoningModel &&
config.modelLabelUseIconForReasoningModels !== MODEL_LABEL_ICON_REASONING_MODEL.OFF;
const reasoningIconRemoved = !isReasoningModel &&
config.modelLabelUseIconForReasoningModels !== MODEL_LABEL_ICON_REASONING_MODEL.OFF;
const chipIconRemoved = config.modelLabelRemoveCpuIcon;
if ($label.text() !== modelLabel) {
$label.attr('data-model-description', JSON.stringify(modelDescription));
$label.text(modelLabel);
$label.addClass(extraClasses);
}
// Reasoning model icon
if (config.modelLabelUseIconForReasoningModels !== MODEL_LABEL_ICON_REASONING_MODEL.OFF) {
const prevReasoningModelIcon = $el.find(`.${reasoningModelCls}`);
const noReasoningIconAndModelIsNotReasoningModel = prevReasoningModelIcon.length === 0 && !isReasoningModel;
const reasoningIconAndModelIsReasoningModel = prevReasoningModelIcon.length > 0 && isReasoningModel;
if (noReasoningIconAndModelIsNotReasoningModel || reasoningIconAndModelIsReasoningModel) {
if (noReasoningIconAndModelIsNotReasoningModel) {
$el.addClass(notReasoningModelCls);
}
if (reasoningIconAndModelIsReasoningModel) {
$el.removeClass(notReasoningModelCls);
}
return;
}
if (prevReasoningModelIcon.length === 0) {
const iconUrl = getLucideIconUrl(config.modelLabelUseIconForReasoningModels.toLowerCase());
const $icon = jq(`

`);
if (config.modelLabelReasoningModelIconGold) {
$icon.addClass(iconColorGoldCls);
}
$el.prepend($icon);
}
const $reasoningModelIcon = $el.find(`.${reasoningModelCls}`);
if (isReasoningModel) {
$reasoningModelIcon.css({ display: 'inline-block' });
if (config.modelLabelStyle === MODEL_LABEL_STYLE.JUST_TEXT) {
$reasoningModelIcon.addClass(iconColorGrayCls);
} else if (config.modelLabelStyle === MODEL_LABEL_STYLE.BUTTON_CYAN) {
$reasoningModelIcon.addClass(iconColorCyanCls);
} else if (config.modelLabelStyle === MODEL_LABEL_STYLE.BUTTON_SUBTLE) {
$reasoningModelIcon.addClass(iconColorGrayCls);
} else if (config.modelLabelStyle === MODEL_LABEL_STYLE.BUTTON_WHITE) {
$reasoningModelIcon.addClass(iconColorWhiteCls);
}
} else {
$reasoningModelIcon.remove();
}
} // End of reasoning model icon
});
};
const handleHideDiscoverButton = () => {
const config = loadConfigOrDefault();
if (!config.hideDiscoverButton) return;
const $iconsInLeftPanel = PP.getIconsInLeftPanel().find('a[href="/discover"]');
$iconsInLeftPanel.hide();
};
const handleCustomModelPopover = () => {
const config = loadConfigOrDefault();
const mode = config.customModelPopover;
if (mode === CUSTOM_MODEL_POPOVER_MODE.OFF) return;
const $modelSelectionList = PP.getModelSelectionList();
if ($modelSelectionList.length === 0) return;
const processedAttr = 'ph-processed-custom-model-popover';
if ($modelSelectionList.attr(processedAttr)) return;
$modelSelectionList.attr(processedAttr, true);
$modelSelectionList.nthParent(2).css({ maxHeight: 'initial' });
const $reasoningDelim = $modelSelectionList.children(".sm\\:px-sm.relative");
const markListItemAsReasoningModel = (el) => {
const $el = jq(el);
const $icon = jq('
![]()
', {
src: getLucideIconUrl(config.modelLabelUseIconForReasoningModels.toLowerCase()),
alt: 'Reasoning model',
class: reasoningModelCls,
}).css({ marginLeft: '0px' });
$el.find('.default,.super').parent().find('>.font-sans').first().prepend($icon);
};
const modelSelectionListType = PP.getModelSelectionListType($modelSelectionList);
if (config.modelLabelUseIconForReasoningModels !== MODEL_LABEL_ICON_REASONING_MODEL.OFF) {
if (modelSelectionListType === 'new') {
const $delimIndex = $modelSelectionList.children().index($reasoningDelim);
$modelSelectionList.children().slice($delimIndex + 1).each((_idx, el) => {
markListItemAsReasoningModel(el);
});
} else {
$modelSelectionList
.children()
.filter((_idx, rEl) => jq(rEl).find('span').text().includes('Reasoning'))
.each((_idx, el) => markListItemAsReasoningModel(el));
}
}
const $delims = $modelSelectionList.children(".sm\\:mx-sm");
const removeAllDelims = () => {
$delims.hide();
$reasoningDelim.hide();
};
const removeAllModelDescriptions = () => {
$modelSelectionList.find('div.light.text-textOff').hide();
$modelSelectionList.find('.group\\/item > .relative > .gap-sm').css({ alignItems: 'center' });
};
if (mode === CUSTOM_MODEL_POPOVER_MODE.COMPACT_LIST) {
removeAllDelims();
removeAllModelDescriptions();
return;
}
if (mode === CUSTOM_MODEL_POPOVER_MODE.SIMPLE_LIST) {
// it is already a list, we forced the height to grow
return;
}
$modelSelectionList.css({
display: 'grid',
gridTemplateColumns: '1fr 1fr',
gap: mode === CUSTOM_MODEL_POPOVER_MODE.COMPACT_GRID ? '0px' : '10px',
'grid-auto-rows': 'min-content',
});
if (mode === CUSTOM_MODEL_POPOVER_MODE.COMPACT_GRID) {
removeAllDelims();
removeAllModelDescriptions();
}
$delims.hide();
$reasoningDelim.css({ gridColumn: 'span 2', });
};
const mainCaptionAppliedCls = genCssName('mainCaptionApplied');
const handleMainCaptionHtml = () => {
const config = loadConfigOrDefault();
if (!config.mainCaptionHtml) return;
if (PP.getMainCaption().hasClass(mainCaptionAppliedCls)) return;
PP.setMainCaptionHtml(config.mainCaptionHtml);
PP.getMainCaption().addClass(mainCaptionAppliedCls);
};
const handleCustomJs = () => {
const config = loadConfigOrDefault();
if (!config.customJs) return;
try {
// Use a static key to ensure we only run once per page load
const dataKey = 'data-' + genCssName('custom-js-applied');
if (!jq('body').attr(dataKey)) {
jq('body').attr(dataKey, true);
// Use Function constructor to evaluate the JS code
const customJsFn = new Function(config.customJs);
customJsFn();
}
} catch (error) {
console.error('Error executing custom JS:', error);
}
};
const handleCustomCss = () => {
const config = loadConfigOrDefault();
if (!config.customCss) return;
try {
// Check if custom CSS has already been applied
const dataKey = 'data-' + genCssName('custom-css-applied');
if (!jq('head').attr(dataKey)) {
jq('head').attr(dataKey, true);
const styleElement = jq('')
.addClass(customCssAppliedCls)
.text(config.customCss);
jq('head').append(styleElement);
}
} catch (error) {
console.error('Error applying custom CSS:', error);
}
};
const handleCustomWidgetsHtml = () => {
const config = loadConfigOrDefault();
if (!config.customWidgetsHtml) return;
try {
// Check if custom widgets have already been applied
const dataKey = 'data-' + genCssName('custom-widgets-html-applied');
if (!jq('body').attr(dataKey)) {
jq('body').attr(dataKey, true);
const widgetContainer = jq('
')
.addClass(customWidgetsHtmlAppliedCls)
.html(config.customWidgetsHtml);
PP.getPromptAreaWrapperOfNewThread().after(widgetContainer);
}
} catch (error) {
console.error('Error applying custom widgets HTML:', error);
}
};
const handleHideSideMenuLabels = () => {
const config = loadConfigOrDefault();
if (!config.hideSideMenuLabels) return;
const $sideMenu = PP.getLeftPanel();
if ($sideMenu.hasClass(sideMenuLabelsHiddenCls)) return;
$sideMenu.addClass(sideMenuLabelsHiddenCls);
};
const work = () => {
handleModalCreation();
handleTopSettingsButtonInsertion();
handleTopSettingsButtonSetup();
handleSettingsInit();
handleLeftSettingsButtonSetup();
handleExtraSpaceBellowLastAnswer();
handleHideDiscoverButton();
handleHideSideMenuLabels();
const regex = /^https:\/\/www\.perplexity\.ai\/search\/?.*/;
const currentUrl = jq(location).attr('href');
const matchedCurrentUrlAsSearchPage = regex.test(currentUrl);
// debugLog("currentUrl", currentUrl);
// debugLog("matchedCurrentUrlAsSearchPage", matchedCurrentUrlAsSearchPage);
if (matchedCurrentUrlAsSearchPage) {
handleSearchPage();
}
};
const fastWork = () => {
handleCustomModelPopover();
handleSlimLeftMenu();
handleHideHomeWidgets();
applySideMenuHiding();
replaceIconsInMenu();
handleModelLabel();
handleMainCaptionHtml();
handleCustomJs();
handleCustomCss();
handleCustomWidgetsHtml();
};
const fontUrls = {
Roboto: 'https://fonts.cdnfonts.com/css/roboto',
Montserrat: 'https://fonts.cdnfonts.com/css/montserrat',
Lato: 'https://fonts.cdnfonts.com/css/lato',
Oswald: 'https://fonts.cdnfonts.com/css/oswald-4',
Raleway: 'https://fonts.cdnfonts.com/css/raleway-5',
'Ubuntu Mono': 'https://fonts.cdnfonts.com/css/ubuntu-mono',
Nunito: 'https://fonts.cdnfonts.com/css/nunito',
Poppins: 'https://fonts.cdnfonts.com/css/poppins',
'Playfair Display': 'https://fonts.cdnfonts.com/css/playfair-display',
Merriweather: 'https://fonts.cdnfonts.com/css/merriweather',
'Fira Sans': 'https://fonts.cdnfonts.com/css/fira-sans',
Quicksand: 'https://fonts.cdnfonts.com/css/quicksand',
Comfortaa: 'https://fonts.cdnfonts.com/css/comfortaa-3',
'Almendra': 'https://fonts.cdnfonts.com/css/almendra',
'Enchanted Land': 'https://fonts.cdnfonts.com/css/enchanted-land',
'Cinzel Decorative': 'https://fonts.cdnfonts.com/css/cinzel-decorative',
'Orbitron': 'https://fonts.cdnfonts.com/css/orbitron',
'Exo 2': 'https://fonts.cdnfonts.com/css/exo-2',
'Chakra Petch': 'https://fonts.cdnfonts.com/css/chakra-petch',
'Open Sans Condensed': 'https://fonts.cdnfonts.com/css/open-sans-condensed',
'Saira Condensed': 'https://fonts.cdnfonts.com/css/saira-condensed',
Inter: 'https://cdn.jsdelivr.net/npm/@fontsource/inter@4.5.0/index.min.css',
};
const loadFont = (fontName) => {
const fontUrl = fontUrls[fontName];
debugLog('loadFont', { fontName, fontUrl });
if (fontUrl) {
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = fontUrl;
document.head.appendChild(link);
}
};
const setupFixImageGenerationOverlay = () => {
const config = loadConfigOrDefault();
if (config.fixImageGenerationOverlay) {
setInterval(handleFixImageGenerationOverlay, 250);
}
};
(function () {
if (loadConfigOrDefault()?.enableDebug) {
enableDebugMode();
}
debugLog('TAGS_PALETTES', TAGS_PALETTES);
if (loadConfigOrDefault()?.debugTagsMode) {
enableTagsDebugging();
}
'use strict';
jq("head").append(``);
setupTags();
setupFixImageGenerationOverlay();
const mainInterval = setInterval(work, 1000);
const fastInterval = setInterval(fastWork, 100);
window.ph = {
stopWork: () => { clearInterval(mainInterval); clearInterval(fastInterval); },
work,
fastWork,
jq,
showPerplexityHelperSettingsModal,
enableTagsDebugging: () => { debugTags = true; },
disableTagsDebugging: () => { debugTags = false; },
};
loadFont(loadConfigOrDefault().tagFont);
console.log(`%c${userscriptName}%c\n %cTiartyos%c & %cmonnef%c\n ... loaded`,
'color: #aaffaa; font-size: 1.5rem; background-color: rgba(0, 0, 0, 0.5); padding: 2px;',
'',
'color: #6b02ff; font-weight: bold; background-color: rgba(0, 0, 0, 0.5); padding: 2px;',
'',
'color: #aa2cc3; font-weight: bold; background-color: rgba(0, 0, 0, 0.5); padding: 2px;',
'',
'');
console.log('to show settings use:\nph.showPerplexityHelperSettingsModal()');
}());