@kudoai/chatgpt.js 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- localStorage.alertQueue=JSON.stringify([]),localStorage.notifyProps=JSON.stringify({queue:{topRight:[],bottomRight:[],bottomLeft:[],topLeft:[]}});const x={openAIaccessToken:{},endpoints:{assets:"https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@5e57ddb8c85f3d394b688a4ecef1c3363119be04",openAI:{session:"https://chatgpt.com/api/auth/session",chats:"https://chatgpt.com/backend-api/conversations",chat:"https://chatgpt.com/backend-api/conversation",share_create:"https://chatgpt.com/backend-api/share/create",share:"https://chatgpt.com/backend-api/share",instructions:"https://chatgpt.com/backend-api/user_system_messages"}},actAs:function(a){return new Promise((o,r)=>{const s=new XMLHttpRequest;s.open("GET","https://raw.githubusercontent.com/KudoAI/chat-prompts/main/dist/personas.min.json",!0),s.send(),s.onload=()=>{if(200!==s.status)return r("🤖 chatgpt.js >> Request failed. Cannot retrieve prompts data.");var e=JSON.parse(s.responseText).personas;if(a){var t=e.find(e=>e.title.toLowerCase()==a.toLowerCase());if(!t)return r(`🤖 chatgpt.js >> Persona '${a}' was not found!`);x.send(t.prompt,"click"),console.info(`Loading ${a} persona...`),x.isIdle().then(()=>{console.info("Persona activated!")})}else{console.log("\n%c🤖 chatgpt.js personas\n","font-family: sans-serif ; font-size: xxx-large ; font-weight: bold");for(const n of e)console.log("%c"+n.title,"font-family: monospace ; font-size: larger ;")}return o()}})},activateDarkMode:function(){document.documentElement.classList.replace("light","dark"),document.documentElement.style.colorScheme="dark",localStorage.setItem("theme","dark")},activateLightMode:function(){document.documentElement.classList.replace("dark","light"),document.documentElement.style.colorScheme="light",localStorage.setItem("theme","light")},alert:function(e,t,n,o,r){const s=x.isDarkMode()?"dark":"light",a=x.browser.isMobile(),i=document.createElement("div"),c=(i.id=Math.floor(1e6*x.randomFloat())+Date.now(),i.classList.add("chatgpt-modal"),document.createElement("div")),l=document.createElement("h2"),u=document.createElement("p");var d=20231203;let g=document.querySelector("#chatgpt-modal-style");(!g||parseInt(g.getAttribute("last-updated"),10)<d)&&(g||((g=document.createElement("style")).id="chatgpt-modal-style",g.setAttribute("last-updated",d.toString()),document.head.append(g)),g.innerText=".chatgpt-modal {position: fixed ; top: 0 ; left: 0 ; width: 100% ; height: 100% ;background-color: rgba(67, 70, 72, 0) ;transition: background-color 0.05s ease ;display: flex ; justify-content: center ; align-items: center ; z-index: 9999 }.chatgpt-modal > div {opacity: 0 ; transform: translateX(-2px) translateY(5px) ; max-width: 75vw ; word-wrap: break-word ;transition: opacity 0.1s cubic-bezier(.165,.84,.44,1), transform 0.2s cubic-bezier(.165,.84,.44,1) ;"+`background-color: ${"dark"==s?"black":"white"} ;`+("dark"!=s?"border: 1px solid rgba(0, 0, 0, 0.3) ;":"")+"padding: 20px ; margin: 12px 23px ; border-radius: 15px ; box-shadow: 0 30px 60px rgba(0, 0, 0, .12) ; -webkit-user-select: none ; -moz-user-select: none ; -ms-user-select: none ; user-select: none ; }.chatgpt-modal h2 { margin-bottom: 9px }"+`.chatgpt-modal a { color: ${"dark"==s?"#00cfff":"#1e9ebb"}}`+".chatgpt-modal.animated > div { opacity: 1 ; transform: translateX(0) translateY(0) }@keyframes alert-zoom-fade-out { 0% { opacity: 1 ; transform: scale(1) }50% { opacity: 0.25 ; transform: scale(1.05) }100% { opacity: 0 ; transform: scale(1.35) }}.modal-buttons { display: flex ; justify-content: flex-end ; margin: 20px -5px -3px 0 ;"+(a?"flex-direction: column-reverse":"")+"}.chatgpt-modal button {"+`margin-left: ${a?0:10}px ; padding: ${a?15:4}px 18px ; border-radius: 15px ;`+(a?"margin-top: 5px ; margin-bottom: 3px ;":"")+`border: 1px solid ${"dark"==s?"white":"black"}}`+".primary-modal-btn {"+`border: 1px solid ${"dark"==s?"white":"black"} ;`+`background: ${"dark"==s?"white":"black"} ;`+`color: ${"dark"==s?"black":"white"}}`+".chatgpt-modal button:hover { color: #3d5d71 ; border-color: #6d9cb9 ;background-color: "+("dark"==s?"#00cfff":"#9cdaff")+";box-shadow: 2px 1px "+("dark"==s?"54px #00cfff":"30px #9cdaff")+"}.modal-close-btn {cursor: pointer ; width: 29px ; height: 29px ; border-radius: 17px ;float: right ; position: relative ; right: -6px ; top: -5px }.modal-close-btn svg { margin: 10px }"+`.modal-close-btn:hover { background-color: #f2f2f2${"dark"==s?"00":""}}`+".chatgpt-modal .checkbox-group { display: flex ; margin-top: -18px }.chatgpt-modal .checkbox-group label {font-size: .7rem ; margin: -.04rem 0 0px .3rem ;"+`color: ${"dark"==s?"#e1e1e1":"#1e1e1e"}}`+'.chatgpt-modal input[type="checkbox"] { transform: scale(0.7) ;'+`border: 1px solid ${"dark"==s?"white":"black"}}`+'.chatgpt-modal input[type="checkbox"]:checked {'+`border: 1px solid ${"dark"==s?"white":"black"} ;`+'background-color: black ; position: inherit }.chatgpt-modal input[type="checkbox"]:focus { outline: none ; box-shadow: none }'),l.innerText=e||"",u.innerText=t||"",x.renderHTML(u);const p=document.createElement("div");p.classList.add("modal-buttons"),n&&(n=Array.isArray(n)?n:[n]).forEach(e=>{var t=document.createElement("button");t.textContent=e.name.replace(/[_-]\w/g,e=>e.slice(1).toUpperCase()).replace(/([A-Z])/g," $1").replace(/^\w/,e=>e.toUpperCase()),t.addEventListener("click",()=>{v(),e()}),p.insertBefore(t,p.firstChild)});d=document.createElement("button"),d.textContent=n?"Dismiss":"OK",p.insertBefore(d,p.firstChild),p.lastChild.classList.add("primary-modal-btn"),e=document.createElement("div");if(o){e.classList.add("checkbox-group");const w=o,b=document.createElement("input");b.type="checkbox",b.addEventListener("change",w);t=document.createElement("label");t.addEventListener("click",()=>{b.checked=!b.checked,w()}),t.textContent=w.name.charAt(0).toUpperCase()+w.name.slice(1).replace(/([A-Z])/g,(e,t)=>" "+t.toLowerCase()).replace(/\b(\w+)nt\b/gi,"$1n't").trim(),e.append(b),e.append(t)}n=document.createElement("div"),n.title="Close",n.classList.add("modal-close-btn"),o=document.createElementNS("http://www.w3.org/2000/svg","svg"),o.setAttribute("height","10px"),o.setAttribute("viewBox","0 0 14 14"),o.setAttribute("fill","none"),t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("fill-rule","evenodd"),t.setAttribute("clip-rule","evenodd"),t.setAttribute("fill",x.isDarkMode()?"white":"black"),t.setAttribute("d","M13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976312 12.6834 -0.0976312 12.2929 0.292893L7 5.58579L1.70711 0.292893C1.31658 -0.0976312 0.683417 -0.0976312 0.292893 0.292893C-0.0976312 0.683417 -0.0976312 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976312 12.6834 -0.0976312 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711Z"),o.append(t),n.append(o),[n,l,u,p,e].forEach(e=>{c.append(e)}),c.style.width=`${r||458}px`,i.append(c),document.body.append(i);let f=JSON.parse(localStorage.alertQueue);f.push(i.id),localStorage.alertQueue=JSON.stringify(f),i.style.display="none",1===f.length&&(i.style.display="",setTimeout(()=>{i.style.backgroundColor=`rgba(67, 70, 72, ${"dark"==s?.62:.1})`,i.classList.add("animated")},100));const m=e=>{(e.target==e.currentTarget||e.target instanceof SVGPathElement)&&v()},h=e=>{if([" ","Spacebar","Enter","Return","Escape","Esc"].includes(e.key)||[32,13,27].includes(e.keyCode))for(const n of f){var t=document.getElementById(n);if(t&&"none"!==t.style.display)return void(e.key.includes("Esc")||27==e.keyCode?v():([" ","Spacebar","Enter","Return"].includes(e.key)||[32,13].includes(e.keyCode))&&(t=t.querySelector(".modal-buttons").lastChild)&&(t.click(),e.preventDefault()))}},y=[i,n,o,d],v=(y.forEach(e=>{e.addEventListener("click",m)}),document.addEventListener("keydown",h),()=>{i.style.backgroundColor="transparent",c.style.animation="alert-zoom-fade-out 0.075s ease-out",setTimeout(()=>{if(i.remove(),(f=JSON.parse(localStorage.alertQueue)).shift(),localStorage.alertQueue=JSON.stringify(f),y.forEach(e=>{e.removeEventListener("click",m)}),document.removeEventListener("keydown",h),0<f.length){const e=document.getElementById(f[0]);setTimeout(()=>{e.style.display="",setTimeout(()=>{e.classList.add("animated")},100)},500)}},50)});return i.id},askAndGetReply:async function(e){return x.send(e),await x.isIdle(),x.getChatData("active","msg","chatgpt","latest")},autoRefresh:{activate:function(e){if(this.isActive)console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh already active!");else{const n=this,o=(this.toggle.refreshFrame(),t=>{var e=Math.max(2,Math.floor(21*x.randomFloat()-10));n.isActive=setTimeout(()=>{var e=document.querySelector('script[src*="_ssgManifest.js"]');document.querySelector("#refresh-frame").src=e.src+"?"+Date.now(),console.log("↻ ChatGPT >> ["+n.nowTimeStamp()+"] ChatGPT session refreshed"),o(t)},1e3*(t+e))});o(e?parseInt(e,10):30),console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh activated"),navigator.userAgent.includes("Chrome")&&void 0!==document.hidden&&document.addEventListener("visibilitychange",this.toggle.beacons)}},deactivate:function(){this.isActive?(this.toggle.refreshFrame(),document.removeEventListener("visibilitychange",this.toggle.beacons),clearTimeout(this.isActive),this.isActive=null,console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh de-activated")):console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh already inactive!")},nowTimeStamp:function(){var e=new Date,t=e.getHours()%12||12;let n=e.getMinutes(),o=e.getSeconds();n<10&&(n="0"+n),o<10&&(o="0"+o);e=e.getHours()<12?"AM":"PM";return t+":"+n+":"+o+" "+e},toggle:{beacons:function(){x.autoRefresh.beaconID?(clearInterval(x.autoRefresh.beaconID),x.autoRefresh.beaconID=null,console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Beacons de-activated")):(x.autoRefresh.beaconID=setInterval(()=>{navigator.sendBeacon("https://httpbin.org/post",new Uint8Array),console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Beacon sent")},9e4),console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Beacons activated"))},refreshFrame:function(){let e=document.querySelector("#refresh-frame");e?e.remove():(e=Object.assign(document.createElement("iframe"),{id:"refresh-frame",style:"display: none"}),document.head.prepend(e))}}},browser:{isLightMode:function(){return window.matchMedia?.("(prefers-color-scheme: light)")?.matches},isDarkMode:function(){return window.matchMedia?.("(prefers-color-scheme: dark)")?.matches},isChromium:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Chromium")},isChrome:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Chrome")},isEdge:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Edge")},isBrave:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Brave")},isFirefox:function(){return navigator.userAgent.includes("Firefox")},isFullScreen:function(){var e=navigator.userAgent;return e.includes("Chrome")?window.matchMedia("(display-mode: fullscreen)").matches:e.includes("Firefox")?window.fullScreen:/MSIE|rv:/.test(e)?document.msFullscreenElement:document.webkitIsFullScreen},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}},clearChats:async function(){return new Promise((n,o)=>{x.getAccessToken().then(e=>{const t=new XMLHttpRequest;t.open("PATCH",x.endpoints.openAI.chats,!0),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Authorization","Bearer "+e),t.onload=()=>{if(200!==t.status)return o("🤖 chatgpt.js >> Request failed. Cannot clear chats.");console.info("Chats successfully cleared"),n()},t.send(JSON.stringify({is_visible:!1}))}).catch(e=>o(new Error(e.message)))})},code:{execute:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Display the output as if you were terminal:\n\n"+e),console.info("Executing code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},extract:function(e){var t=e.match(/(?<=```.*\n)[\s\S]*?(?=```)/g);return t?t[t.length-1]:e},isIdle:async function(){await new Promise(t=>{!function e(){document.querySelector("div[data-message-author-role]")?t(!0):setTimeout(e,200)}()}),await new Promise(n=>{!function e(){var t=document.querySelectorAll("div[data-message-author-role]");"assistant"==t[t.length-1].dataset.messageAuthorRole?n(!0):setTimeout(e,200)}()});const n=await new Promise(n=>{!function e(){var t=document.querySelectorAll('div[data-message-author-role="assistant"]'),t=t[t.length-1];t.querySelector("pre")?n(t):setTimeout(e,200)}()});return Promise.race([new Promise(t=>{!function e(){n.querySelector("pre").nextElementSibling?t(!0):setTimeout(e,200)}()}),x.isIdle()])},minify:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Minify the following code:\n\n"+e),console.info("Minifying code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},obfuscate:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Obfuscate the following code:\n\n"+e),console.info("Obfuscating code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},refactor:async function(e,t){if(!e)return console.error("Code (1st) argument not supplied. Pass some code!");for(let e=0;e<arguments.length;e++)if("string"!=typeof arguments[e])return console.error(`Argument ${e+1} must be a string.`);return x.send("Refactor the following code for "+(t||"brevity")+":\n\n"+e),console.info("Refactoring code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))},review:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Review the following code for me:\n\n"+e),console.info("Reviewing code..."),await x.isIdle(),x.getChatData("active","msg","chatgpt","latest")):console.error("Code argument not supplied. Pass some code!")},unminify:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Unminify the following code.:\n\n"+e),console.info("Unminifying code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},write:async function(e,t){if(!e)return console.error("Prompt (1st) argument not supplied. Pass a prompt!");if(!t)return console.error("outputLang (2nd) argument not supplied. Pass a language!");for(let e=0;e<arguments.length;e++)if("string"!=typeof arguments[e])return console.error(`Argument ${e+1} must be a string.`);return x.send(e+"\n\nWrite this as code in "+t),console.info("Writing code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))}},continue:function(){x.response.continue()},detectLanguage:async function(e){return e?"string"!=typeof e?console.error("Text argument must be a string!"):(x.send("Detect the language of the following text:\n\n"+e+"\n\nOnly respond with the name of the language"),console.info("Reviewing text..."),await x.isIdle(),x.getChatData("active","msg","chatgpt","latest")):console.error("Text argument not supplied. Pass some text!")},executeCode:function(){x.code.execute()},exportChat:async function(e,t){e=e?Number.isInteger(e)||/^\d+$/.test(e)?parseInt(e,10):e:"active",t=t.toLowerCase()||"html",console.info("Generating transcript...");let o="",n;if(/te?xt/.test(t)){var r=new Date,s=r.getDate().toString().padStart(2,"0"),a=(r.getMonth()+1).toString().padStart(2,"0"),i=r.getFullYear(),c=r.getHours().toString().padStart(2,"0"),r=r.getMinutes().toString().padStart(2,"0");if(n=`ChatGPT_${s}-${a}-${i}_${c}-${r}.txt`,"active"==e&&/\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/.test(window.location.href)){s=document.querySelectorAll("main > div > div > div > div > div > div[class*=group]");if(0===s.length)return console.error("Chat is empty!");const l=[];let n=!0;s.forEach(e=>{var t=n?"USER":"CHATGPT",e=(n=!n,Array.from(e.childNodes).map(e=>e.innerText).join("\n\n").replace("Copy code",""));l.push(t+": "+e)}),o=l.join("\n\n")}else for(const u of await x.getChatData(e,"msg","both","all"))o=(o+=`USER: ${u.user}
1
+ localStorage.alertQueue=JSON.stringify([]),localStorage.notifyProps=JSON.stringify({queue:{topRight:[],bottomRight:[],bottomLeft:[],topLeft:[]}});const x={openAIaccessToken:{},endpoints:{assets:"https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@da5d03f07129ba9bbce1dc7f352457c29e1df587",openAI:{session:"https://chatgpt.com/api/auth/session",chats:"https://chatgpt.com/backend-api/conversations",chat:"https://chatgpt.com/backend-api/conversation",share_create:"https://chatgpt.com/backend-api/share/create",share:"https://chatgpt.com/backend-api/share",instructions:"https://chatgpt.com/backend-api/user_system_messages"}},actAs:function(a){return new Promise((o,r)=>{const s=new XMLHttpRequest;s.open("GET","https://raw.githubusercontent.com/KudoAI/chat-prompts/main/dist/personas.min.json",!0),s.send(),s.onload=()=>{if(200!==s.status)return r("🤖 chatgpt.js >> Request failed. Cannot retrieve prompts data.");var e=JSON.parse(s.responseText).personas;if(a){var t=e.find(e=>e.title.toLowerCase()==a.toLowerCase());if(!t)return r(`🤖 chatgpt.js >> Persona '${a}' was not found!`);x.send(t.prompt,"click"),console.info(`Loading ${a} persona...`),x.isIdle().then(()=>{console.info("Persona activated!")})}else{console.log("\n%c🤖 chatgpt.js personas\n","font-family: sans-serif ; font-size: xxx-large ; font-weight: bold");for(const n of e)console.log("%c"+n.title,"font-family: monospace ; font-size: larger ;")}return o()}})},activateDarkMode:function(){document.documentElement.classList.replace("light","dark"),document.documentElement.style.colorScheme="dark",localStorage.setItem("theme","dark")},activateLightMode:function(){document.documentElement.classList.replace("dark","light"),document.documentElement.style.colorScheme="light",localStorage.setItem("theme","light")},alert:function(e,t,n,o,r){const s=x.isDarkMode()?"dark":"light",a=x.browser.isMobile(),i=document.createElement("div"),c=(i.id=Math.floor(1e6*x.randomFloat())+Date.now(),i.classList.add("chatgpt-modal"),document.createElement("div")),l=document.createElement("h2"),u=document.createElement("p");var d=20231203;let g=document.querySelector("#chatgpt-modal-style");(!g||parseInt(g.getAttribute("last-updated"),10)<d)&&(g||((g=document.createElement("style")).id="chatgpt-modal-style",g.setAttribute("last-updated",d.toString()),document.head.append(g)),g.innerText=".chatgpt-modal {position: fixed ; top: 0 ; left: 0 ; width: 100% ; height: 100% ;background-color: rgba(67, 70, 72, 0) ;transition: background-color 0.05s ease ;display: flex ; justify-content: center ; align-items: center ; z-index: 9999 }.chatgpt-modal > div {opacity: 0 ; transform: translateX(-2px) translateY(5px) ; max-width: 75vw ; word-wrap: break-word ;transition: opacity 0.1s cubic-bezier(.165,.84,.44,1), transform 0.2s cubic-bezier(.165,.84,.44,1) ;"+`background-color: ${"dark"==s?"black":"white"} ;`+("dark"!=s?"border: 1px solid rgba(0, 0, 0, 0.3) ;":"")+"padding: 20px ; margin: 12px 23px ; border-radius: 15px ; box-shadow: 0 30px 60px rgba(0, 0, 0, .12) ; -webkit-user-select: none ; -moz-user-select: none ; -ms-user-select: none ; user-select: none ; }.chatgpt-modal h2 { margin-bottom: 9px }"+`.chatgpt-modal a { color: ${"dark"==s?"#00cfff":"#1e9ebb"}}`+".chatgpt-modal.animated > div { opacity: 1 ; transform: translateX(0) translateY(0) }@keyframes alert-zoom-fade-out { 0% { opacity: 1 ; transform: scale(1) }50% { opacity: 0.25 ; transform: scale(1.05) }100% { opacity: 0 ; transform: scale(1.35) }}.modal-buttons { display: flex ; justify-content: flex-end ; margin: 20px -5px -3px 0 ;"+(a?"flex-direction: column-reverse":"")+"}.chatgpt-modal button {"+`margin-left: ${a?0:10}px ; padding: ${a?15:4}px 18px ; border-radius: 15px ;`+(a?"margin-top: 5px ; margin-bottom: 3px ;":"")+`border: 1px solid ${"dark"==s?"white":"black"}}`+".primary-modal-btn {"+`border: 1px solid ${"dark"==s?"white":"black"} ;`+`background: ${"dark"==s?"white":"black"} ;`+`color: ${"dark"==s?"black":"white"}}`+".chatgpt-modal button:hover { color: #3d5d71 ; border-color: #6d9cb9 ;background-color: "+("dark"==s?"#00cfff":"#9cdaff")+";box-shadow: 2px 1px "+("dark"==s?"54px #00cfff":"30px #9cdaff")+"}.modal-close-btn {cursor: pointer ; width: 29px ; height: 29px ; border-radius: 17px ;float: right ; position: relative ; right: -6px ; top: -5px }.modal-close-btn svg { margin: 10px }"+`.modal-close-btn:hover { background-color: #f2f2f2${"dark"==s?"00":""}}`+".chatgpt-modal .checkbox-group { display: flex ; margin-top: -18px }.chatgpt-modal .checkbox-group label {font-size: .7rem ; margin: -.04rem 0 0px .3rem ;"+`color: ${"dark"==s?"#e1e1e1":"#1e1e1e"}}`+'.chatgpt-modal input[type="checkbox"] { transform: scale(0.7) ;'+`border: 1px solid ${"dark"==s?"white":"black"}}`+'.chatgpt-modal input[type="checkbox"]:checked {'+`border: 1px solid ${"dark"==s?"white":"black"} ;`+'background-color: black ; position: inherit }.chatgpt-modal input[type="checkbox"]:focus { outline: none ; box-shadow: none }'),l.innerText=e||"",u.innerText=t||"",x.renderHTML(u);const p=document.createElement("div");p.classList.add("modal-buttons"),n&&(n=Array.isArray(n)?n:[n]).forEach(e=>{var t=document.createElement("button");t.textContent=e.name.replace(/[_-]\w/g,e=>e.slice(1).toUpperCase()).replace(/([A-Z])/g," $1").replace(/^\w/,e=>e.toUpperCase()),t.addEventListener("click",()=>{v(),e()}),p.insertBefore(t,p.firstChild)});d=document.createElement("button"),d.textContent=n?"Dismiss":"OK",p.insertBefore(d,p.firstChild),p.lastChild.classList.add("primary-modal-btn"),e=document.createElement("div");if(o){e.classList.add("checkbox-group");const w=o,b=document.createElement("input");b.type="checkbox",b.addEventListener("change",w);t=document.createElement("label");t.addEventListener("click",()=>{b.checked=!b.checked,w()}),t.textContent=w.name.charAt(0).toUpperCase()+w.name.slice(1).replace(/([A-Z])/g,(e,t)=>" "+t.toLowerCase()).replace(/\b(\w+)nt\b/gi,"$1n't").trim(),e.append(b),e.append(t)}n=document.createElement("div"),n.title="Close",n.classList.add("modal-close-btn"),o=document.createElementNS("http://www.w3.org/2000/svg","svg"),o.setAttribute("height","10px"),o.setAttribute("viewBox","0 0 14 14"),o.setAttribute("fill","none"),t=document.createElementNS("http://www.w3.org/2000/svg","path");t.setAttribute("fill-rule","evenodd"),t.setAttribute("clip-rule","evenodd"),t.setAttribute("fill",x.isDarkMode()?"white":"black"),t.setAttribute("d","M13.7071 1.70711C14.0976 1.31658 14.0976 0.683417 13.7071 0.292893C13.3166 -0.0976312 12.6834 -0.0976312 12.2929 0.292893L7 5.58579L1.70711 0.292893C1.31658 -0.0976312 0.683417 -0.0976312 0.292893 0.292893C-0.0976312 0.683417 -0.0976312 1.31658 0.292893 1.70711L5.58579 7L0.292893 12.2929C-0.0976312 12.6834 -0.0976312 13.3166 0.292893 13.7071C0.683417 14.0976 1.31658 14.0976 1.70711 13.7071L7 8.41421L12.2929 13.7071C12.6834 14.0976 13.3166 14.0976 13.7071 13.7071C14.0976 13.3166 14.0976 12.6834 13.7071 12.2929L8.41421 7L13.7071 1.70711Z"),o.append(t),n.append(o),[n,l,u,p,e].forEach(e=>{c.append(e)}),c.style.width=`${r||458}px`,i.append(c),document.body.append(i);let f=JSON.parse(localStorage.alertQueue);f.push(i.id),localStorage.alertQueue=JSON.stringify(f),i.style.display="none",1===f.length&&(i.style.display="",setTimeout(()=>{i.style.backgroundColor=`rgba(67, 70, 72, ${"dark"==s?.62:.1})`,i.classList.add("animated")},100));const m=e=>{(e.target==e.currentTarget||e.target instanceof SVGPathElement)&&v()},h=e=>{if([" ","Spacebar","Enter","Return","Escape","Esc"].includes(e.key)||[32,13,27].includes(e.keyCode))for(const n of f){var t=document.getElementById(n);if(t&&"none"!==t.style.display)return void(e.key.includes("Esc")||27==e.keyCode?v():([" ","Spacebar","Enter","Return"].includes(e.key)||[32,13].includes(e.keyCode))&&(t=t.querySelector(".modal-buttons").lastChild)&&(t.click(),e.preventDefault()))}},y=[i,n,o,d],v=(y.forEach(e=>{e.addEventListener("click",m)}),document.addEventListener("keydown",h),()=>{i.style.backgroundColor="transparent",c.style.animation="alert-zoom-fade-out 0.075s ease-out",setTimeout(()=>{if(i.remove(),(f=JSON.parse(localStorage.alertQueue)).shift(),localStorage.alertQueue=JSON.stringify(f),y.forEach(e=>{e.removeEventListener("click",m)}),document.removeEventListener("keydown",h),0<f.length){const e=document.getElementById(f[0]);setTimeout(()=>{e.style.display="",setTimeout(()=>{e.classList.add("animated")},100)},500)}},50)});return i.id},askAndGetReply:async function(e){return x.send(e),await x.isIdle(),x.getChatData("active","msg","chatgpt","latest")},autoRefresh:{activate:function(e){if(this.isActive)console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh already active!");else{const n=this,o=(this.toggle.refreshFrame(),t=>{var e=Math.max(2,Math.floor(21*x.randomFloat()-10));n.isActive=setTimeout(()=>{var e=document.querySelector('script[src*="_ssgManifest.js"]');document.querySelector("#refresh-frame").src=e.src+"?"+Date.now(),console.log("↻ ChatGPT >> ["+n.nowTimeStamp()+"] ChatGPT session refreshed"),o(t)},1e3*(t+e))});o(e?parseInt(e,10):30),console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh activated"),navigator.userAgent.includes("Chrome")&&void 0!==document.hidden&&document.addEventListener("visibilitychange",this.toggle.beacons)}},deactivate:function(){this.isActive?(this.toggle.refreshFrame(),document.removeEventListener("visibilitychange",this.toggle.beacons),clearTimeout(this.isActive),this.isActive=null,console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh de-activated")):console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Auto refresh already inactive!")},nowTimeStamp:function(){var e=new Date,t=e.getHours()%12||12;let n=e.getMinutes(),o=e.getSeconds();n<10&&(n="0"+n),o<10&&(o="0"+o);e=e.getHours()<12?"AM":"PM";return t+":"+n+":"+o+" "+e},toggle:{beacons:function(){x.autoRefresh.beaconID?(clearInterval(x.autoRefresh.beaconID),x.autoRefresh.beaconID=null,console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Beacons de-activated")):(x.autoRefresh.beaconID=setInterval(()=>{navigator.sendBeacon("https://httpbin.org/post",new Uint8Array),console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Beacon sent")},9e4),console.log("↻ ChatGPT >> ["+x.autoRefresh.nowTimeStamp()+"] Beacons activated"))},refreshFrame:function(){let e=document.querySelector("#refresh-frame");e?e.remove():(e=Object.assign(document.createElement("iframe"),{id:"refresh-frame",style:"display: none"}),document.head.prepend(e))}}},browser:{isLightMode:function(){return window.matchMedia?.("(prefers-color-scheme: light)")?.matches},isDarkMode:function(){return window.matchMedia?.("(prefers-color-scheme: dark)")?.matches},isChromium:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Chromium")},isChrome:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Chrome")},isEdge:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Edge")},isBrave:function(){return!!JSON.stringify(navigator.userAgentData?.brands)?.includes("Brave")},isFirefox:function(){return navigator.userAgent.includes("Firefox")},isFullScreen:function(){var e=navigator.userAgent;return e.includes("Chrome")?window.matchMedia("(display-mode: fullscreen)").matches:e.includes("Firefox")?window.fullScreen:/MSIE|rv:/.test(e)?document.msFullscreenElement:document.webkitIsFullScreen},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}},clearChats:async function(){return new Promise((n,o)=>{x.getAccessToken().then(e=>{const t=new XMLHttpRequest;t.open("PATCH",x.endpoints.openAI.chats,!0),t.setRequestHeader("Content-Type","application/json"),t.setRequestHeader("Authorization","Bearer "+e),t.onload=()=>{if(200!==t.status)return o("🤖 chatgpt.js >> Request failed. Cannot clear chats.");console.info("Chats successfully cleared"),n()},t.send(JSON.stringify({is_visible:!1}))}).catch(e=>o(new Error(e.message)))})},code:{execute:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Display the output as if you were terminal:\n\n"+e),console.info("Executing code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},extract:function(e){var t=e.match(/(?<=```.*\n)[\s\S]*?(?=```)/g);return t?t[t.length-1]:e},isIdle:async function(){await new Promise(t=>{!function e(){document.querySelector("div[data-message-author-role]")?t(!0):setTimeout(e,200)}()}),await new Promise(n=>{!function e(){var t=document.querySelectorAll("div[data-message-author-role]");"assistant"==t[t.length-1].dataset.messageAuthorRole?n(!0):setTimeout(e,200)}()});const n=await new Promise(n=>{!function e(){var t=document.querySelectorAll('div[data-message-author-role="assistant"]'),t=t[t.length-1];t.querySelector("pre")?n(t):setTimeout(e,200)}()});return Promise.race([new Promise(t=>{!function e(){n.querySelector("pre").nextElementSibling?t(!0):setTimeout(e,200)}()}),x.isIdle()])},minify:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Minify the following code:\n\n"+e),console.info("Minifying code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},obfuscate:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Obfuscate the following code:\n\n"+e),console.info("Obfuscating code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},refactor:async function(e,t){if(!e)return console.error("Code (1st) argument not supplied. Pass some code!");for(let e=0;e<arguments.length;e++)if("string"!=typeof arguments[e])return console.error(`Argument ${e+1} must be a string.`);return x.send("Refactor the following code for "+(t||"brevity")+":\n\n"+e),console.info("Refactoring code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))},review:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Review the following code for me:\n\n"+e),console.info("Reviewing code..."),await x.isIdle(),x.getChatData("active","msg","chatgpt","latest")):console.error("Code argument not supplied. Pass some code!")},unminify:async function(e){return e?"string"!=typeof e?console.error("Code argument must be a string!"):(x.send("Unminify the following code.:\n\n"+e),console.info("Unminifying code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))):console.error("Code argument not supplied. Pass some code!")},write:async function(e,t){if(!e)return console.error("Prompt (1st) argument not supplied. Pass a prompt!");if(!t)return console.error("outputLang (2nd) argument not supplied. Pass a language!");for(let e=0;e<arguments.length;e++)if("string"!=typeof arguments[e])return console.error(`Argument ${e+1} must be a string.`);return x.send(e+"\n\nWrite this as code in "+t),console.info("Writing code..."),await x.isIdle(),x.code.extract(await x.getChatData("active","msg","chatgpt","latest"))}},continue:function(){x.response.continue()},detectLanguage:async function(e){return e?"string"!=typeof e?console.error("Text argument must be a string!"):(x.send("Detect the language of the following text:\n\n"+e+"\n\nOnly respond with the name of the language"),console.info("Reviewing text..."),await x.isIdle(),x.getChatData("active","msg","chatgpt","latest")):console.error("Text argument not supplied. Pass some text!")},executeCode:function(){x.code.execute()},exportChat:async function(e,t){e=e?Number.isInteger(e)||/^\d+$/.test(e)?parseInt(e,10):e:"active",t=t.toLowerCase()||"html",console.info("Generating transcript...");let o="",n;if(/te?xt/.test(t)){var r=new Date,s=r.getDate().toString().padStart(2,"0"),a=(r.getMonth()+1).toString().padStart(2,"0"),i=r.getFullYear(),c=r.getHours().toString().padStart(2,"0"),r=r.getMinutes().toString().padStart(2,"0");if(n=`ChatGPT_${s}-${a}-${i}_${c}-${r}.txt`,"active"==e&&/\/\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/.test(window.location.href)){s=document.querySelectorAll("main > div > div > div > div > div > div[class*=group]");if(0===s.length)return console.error("Chat is empty!");const l=[];let n=!0;s.forEach(e=>{var t=n?"USER":"CHATGPT",e=(n=!n,Array.from(e.childNodes).map(e=>e.innerText).join("\n\n").replace("Copy code",""));l.push(t+": "+e)}),o=l.join("\n\n")}else for(const u of await x.getChatData(e,"msg","both","all"))o=(o+=`USER: ${u.user}
2
2
 
3
3
  `)+`CHATGPT: ${u.chatgpt}
4
4
 
package/docs/README.md CHANGED
@@ -45,13 +45,13 @@
45
45
  [![](https://img.shields.io/github/stars/KudoAI/chatgpt.js?label=Stars&color=af68ff&logo=github&logoColor=white&labelColor=464646&style=for-the-badge)](https://github.com/KudoAI/chatgpt.js/stargazers)
46
46
  [![](https://img.shields.io/badge/License-MIT-green.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge)](https://github.com/KudoAI/chatgpt.js/blob/main/LICENSE.md)
47
47
  [![](https://img.shields.io/github/commit-activity/m/KudoAI/chatgpt.js?label=Commits&logo=github&logoColor=white&labelColor=464646&style=for-the-badge)](https://github.com/KudoAI/chatgpt.js/commits/main)
48
- ![](https://img.shields.io/badge/Clones-2K/month-869da0?logo=github&logoColor=white&labelColor=464646&style=for-the-badge)
49
- [![](https://img.shields.io/github/size/KudoAI/chatgpt.js/dist/chatgpt.min.js?branch=v3.0.1&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge)](https://github.com/KudoAI/chatgpt.js/tree/v3.0.1/dist/chatgpt.min.js)
48
+ ![](https://img.shields.io/badge/Clones-326/month-869da0?logo=github&logoColor=white&labelColor=464646&style=for-the-badge)
49
+ [![](https://img.shields.io/github/size/KudoAI/chatgpt.js/dist/chatgpt.min.js?branch=v3.0.2&label=Minified%20Size&logo=databricks&logoColor=white&labelColor=464646&color=ff69b4&style=for-the-badge)](https://github.com/KudoAI/chatgpt.js/tree/v3.0.2/dist/chatgpt.min.js)
50
50
  [![](https://img.shields.io/codefactor/grade/github/kudoai/chatgpt.js?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=1acc6c&style=for-the-badge)](https://www.codefactor.io/repository/github/kudoai/chatgpt.js)
51
51
  [![](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dkudoai_chatgpt.js%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=gold)](https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=kudoai_chatgpt.js)
52
52
  [![](https://img.shields.io/badge/Mentioned_in-Awesome-cca8c4?logo=awesomelists&logoColor=white&labelColor=464646&style=for-the-badge)](https://github.com/sindresorhus/awesome-chatgpt#javascript)
53
53
  [![](https://img.shields.io/badge/Featured_on-Product_Hunt-ff6154?logo=producthunt&logoColor=white&labelColor=464646&style=for-the-badge)](https://www.producthunt.com/posts/chatgpt-js)
54
- ![](https://img.shields.io/badge/jsDelivr_Requests-1,500,000+-2bbbd8.svg?logo=jsdelivr&logoColor=white&labelColor=464646&style=for-the-badge)
54
+ ![](https://img.shields.io/badge/jsDelivr_Requests-2,000,000+-2bbbd8.svg?logo=jsdelivr&logoColor=white&labelColor=464646&style=for-the-badge)
55
55
 
56
56
  </div>
57
57
 
@@ -84,7 +84,7 @@
84
84
 
85
85
  ```js
86
86
  (async () => {
87
- await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.1/dist/chatgpt.min.js');
87
+ await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.2/dist/chatgpt.min.js');
88
88
  // Your code here...
89
89
  })();
90
90
  ```
@@ -93,7 +93,7 @@
93
93
 
94
94
  ```js
95
95
  var xhr = new XMLHttpRequest();
96
- xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.1/dist/chatgpt.min.js');
96
+ xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.2/dist/chatgpt.min.js');
97
97
  xhr.onload = function () {
98
98
  if (xhr.status === 200) {
99
99
  var chatgptJS = document.createElement('script');
@@ -115,7 +115,7 @@ function yourCode() {
115
115
 
116
116
  ```js
117
117
  ...
118
- // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.1/dist/chatgpt.min.js
118
+ // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.2/dist/chatgpt.min.js
119
119
  // ==/UserScript==
120
120
 
121
121
  // Your code here...
@@ -190,7 +190,7 @@ chatgpt.get('reply', 'last');
190
190
 
191
191
  Each call equally fetches the last response. If you think it works, it probably will... so just type it!
192
192
 
193
- If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.0.1/docs/USERGUIDE.md), or simply submit an [issue](https://github.com/KudoAI/chatgpt.js/issues) or [PR](https://github.com/KudoAI/chatgpt.js/pulls) and it will be integrated, ezpz!
193
+ If it didn't, check out the extended [userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.0.2/docs/USERGUIDE.md), or simply submit an [issue](https://github.com/KudoAI/chatgpt.js/issues) or [PR](https://github.com/KudoAI/chatgpt.js/pulls) and it will be integrated, ezpz!
194
194
 
195
195
  <img height=8px width="100%" src="https://media.chatgptjs.org/images/separators/gradient-aqua.png?78210a7">
196
196
 
@@ -204,7 +204,7 @@ https://github.com/KudoAI/chatgpt.js/assets/10906554/f53c740f-d5e0-49b6-ae02-3b3
204
204
 
205
205
  #
206
206
 
207
- ### <img src="https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png" width=20> [AmazonGPT](https://amazongpt.kudoai.com)
207
+ ### <img src="https://amazongpt.kudoai.com/assets/images/icons/amazongpt/black-gold-teal/icon48.png" width=20> [AmazonGPT](https://amazongpt.kudoai.com) &nbsp;<a href="https://devpost.com/software/amazongpt" target="_blank" rel="noopener"><img height=20 src="https://amazongpt.kudoai.com/assets/images/badges/wolfram-award/gold-badge.png" style="margin:0 0 -2px 5px"></a>
208
208
 
209
209
  > Add AI to Amazon shopping.
210
210
  <br>[Install](https://greasyfork.org/scripts/500663-amazongpt) /
@@ -260,7 +260,7 @@ https://github.com/KudoAI/chatgpt.js/assets/10906554/f53c740f-d5e0-49b6-ae02-3b3
260
260
  [Readme](https://docs.googlegpt.io/#readme) /
261
261
  [Discuss](https://github.googlegpt.io/discussions)
262
262
 
263
- ### <img width=23 src="https://media.chatgptjs.org/images/icons/platforms/thunderbird/icon32.png?313a9c5"> [ThunderAI](https://micz.it/thunderdbird-addon-thunderai/) &nbsp;<a href="https://addons.thunderbird.net/thunderbird/addon/thunderai/reviews"><picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/badges/5-star/blue-stars.png?0943672"><img width=92 alt="[Rated 5-stars]" src="https://media.chatgptjs.org/images/badges/5-star/yellow-stars-in-white-pill.png?0943672"></picture></a>
263
+ ### <img width=23 src="https://media.chatgptjs.org/images/icons/platforms/thunderbird/icon32.png?313a9c5"> [ThunderAI](https://micz.it/thunderdbird-addon-thunderai/) &nbsp;<a href="https://addons.thunderbird.net/thunderbird/addon/thunderai/reviews" target="_blank" rel="noopener"><picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://media.chatgptjs.org/images/badges/5-star/blue-stars.png?0943672"><img width=92 alt="[Rated 5-stars]" src="https://media.chatgptjs.org/images/badges/5-star/yellow-stars-in-white-pill.png?0943672"></picture></a>
264
264
 
265
265
  > Use ChatGPT in Thunderbird to enhance you emails, even with a free account!
266
266
  <br>[Install](https://addons.thunderbird.net/thunderbird/addon/thunderai/) /
@@ -325,6 +325,9 @@ This library exists thanks to code, translations, issues & ideas from the follow
325
325
  [![](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/61795?first-contrib=2024.5.9-update-css-selector-for-getregeneratebutton&h=47&w=47&mask=circle&maxage=7d "@micz")](https://github.com/micz)
326
326
  [![](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/17583722?first-contrib=2024.5.17-chrome-starter-manifest-matches-outdated-alert&h=47&w=47&mask=circle&maxage=7d "@imranaalam")](https://github.com/imranaalam)
327
327
  [![](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/50076933?first-contrib=2024.6.22-code.isidle-request&h=47&w=47&mask=circle&maxage=7d "@grayfallstown")](https://github.com/grayfallstown)
328
+ [![](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/155944537?first-contrib=2024.8.27-sidebar-update-testing&h=47&w=47&mask=circle&maxage=7d "@svan-b")](https://github.com/svan-b)
329
+ [![](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/u/74002352?first-contrib=2024.8.28-sidebar-update-testing&h=47&w=47&mask=circle&maxage=7d "@Jeff-Zzh")](https://github.com/Jeff-Zzh)
330
+
328
331
  [![](https://images.weserv.nl/?url=https://avatars.githubusercontent.com/in/29110&h=47&w=47&mask=circle&maxage=7d "Dependabot")](https://github.com/dependabot)
329
332
  <a href="https://chatgpt.com"><picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/chatgpt/black-on-white/icon189.png?h=46&w=46&mask=circle&maxage=7d"><img src="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/chatgpt/white-on-black/icon189.png?h=46&w=46&mask=circle&maxage=7d" title="ChatGPT"></picture></a>
330
333
  <a href="https://poe.com"><picture><source type="image/png" media="(prefers-color-scheme: dark)" srcset="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/poe/w-purple-blue-stripes/black-on-white/icon175.png?h=46&w=46&mask=circle&maxage=7d"><img src="https://images.weserv.nl/?url=https://cdn.jsdelivr.net/gh/KudoAI/chatgpt.js@main/media/images/icons/platforms/poe/w-purple-blue-stripes/white-on-black/icon175.png?h=46&w=46&mask=circle&maxage=7d" title="Poe"></picture></a>
@@ -358,7 +361,7 @@ This library exists thanks to code, translations, issues & ideas from the follow
358
361
  <div align="center">
359
362
 
360
363
  **[Releases](https://github.com/KudoAI/chatgpt.js/releases)** /
361
- [Userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.0.1/docs/USERGUIDE.md) /
364
+ [Userguide](https://github.com/KudoAI/chatgpt.js/blob/v3.0.2/docs/USERGUIDE.md) /
362
365
  [Discuss](https://github.com/KudoAI/chatgpt.js/discussions) /
363
366
  <a href="#--------------------------------------------------------------------------------english---------简体中文---------繁體中文---------日本---------한국인---------हिंदी---------नेपाली---------deutsch---------español---------français---------italiano---------nederlands---------português---------việt----">Back to top ↑</a>
364
367
 
package/docs/USERGUIDE.md CHANGED
@@ -150,7 +150,7 @@
150
150
 
151
151
  ```js
152
152
  (async () => {
153
- await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.1/dist/chatgpt.min.js');
153
+ await import('https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.2/dist/chatgpt.min.js');
154
154
  // Your code here...
155
155
  })();
156
156
  ```
@@ -159,7 +159,7 @@
159
159
 
160
160
  ```js
161
161
  var xhr = new XMLHttpRequest();
162
- xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.1/dist/chatgpt.min.js');
162
+ xhr.open('GET', 'https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.2/dist/chatgpt.min.js');
163
163
  xhr.onload = function () {
164
164
  if (xhr.status === 200) {
165
165
  var chatgptJS = document.createElement('script');
@@ -181,7 +181,7 @@ function yourCode() {
181
181
 
182
182
  ```js
183
183
  ...
184
- // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.1/dist/chatgpt.min.js
184
+ // @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@3.0.2/dist/chatgpt.min.js
185
185
  // ==/UserScript==
186
186
 
187
187
  // Your code here...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kudoai/chatgpt.js",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Client-side JavaScript library for ChatGPT",
5
5
  "author": {
6
6
  "name": "KudoAI & contributors",
@@ -64,11 +64,11 @@
64
64
  "url": "https://github.com/sponsors/KudoAI"
65
65
  },
66
66
  "devDependencies": {
67
- "@adamlui/minify.js": "^1.8.1",
67
+ "@adamlui/minify.js": "^1.8.3",
68
68
  "@adamlui/scss-to-css": "^1.10.3",
69
69
  "docsify-cli": "^4.4.4",
70
- "eslint": "^9.5.0",
71
- "eslint-plugin-json": "^4.0.0",
72
- "husky": "^9.1.0"
70
+ "eslint": "^9.9.1",
71
+ "eslint-plugin-json": "^4.0.1",
72
+ "husky": "^9.1.5"
73
73
  }
74
74
  }