const sdkStyleSheet = document.createElement('style'); sdkStyleSheet.innerText = ` .sdk--container { position: fixed; bottom: 42px; right: 42px; width: 64px; height: 64px; z-index: 9999; color: white; border-radius: 50%; font-family: 'Noto Sans', Roboto, Arial, sans-serif; } .sdk--container.sdk--has-external-link { display: flex; justify-content: space-between; align-items: center; } .sdk--container.sdk--expanded .sdk--bot-container { border-left: 2px solid #000; } .sdk--bot-container { order: 1; flex-grow: 1; display: flex; flex-direction: column; height: 100%; } .sdk--container.sdk--has-external-link.sdk--expanded .sdk--bot-container { max-width: 550px; width: 60%; } .sdk--container.sdk--has-external-link.sdk--expanded .sdk--external-link-container { flex-grow: 3; } .sdk--external-link-container { width: 40%; height: 100%; background-color: #FFF; } .sdk--container iframe { width: 100% !important; height: 100%; border: 0; } .sdk--container.sdk--expanded { height: 90%; width: 60%; min-width: 500px; bottom: 5px; right: 5px; border-radius: 0; border-top-left-radius: 20px; background-color: #2C77C5; color: white; box-shadow: -1px -1px 4px 1px #000000, 1px -1px 4px 1px #000000; overflow: hidden; } .sdk--container.sdk--expanded.transition { transition-property: width, height; transition-duration: 0.2s; transition-timing-function: ease-in-out; } .sdk--a-expand-collapse { background: url('https://sadik.ai/static/logo-64.png'); width: 64px; height: 64px; background-size: contain; background-repeat: no-repeat; background-position: center; display: inline-block; } .sdk--container.sdk--expanded .sdk--a-expand-collapse, .sdk--container.sdk--expanded .sdk--a-close { width: 30px; height: 24px; float: right; } .sdk--container.sdk--expanded .sdk--a-expand-collapse { background: #2C77C5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 -960 960 960' width='24'%3E%3Cpath fill='white' d='m136-80-56-56 264-264H160v-80h320v320h-80v-184L136-80Zm344-400v-320h80v184l264-264 56 56-264 264h184v80H480Z'/%3E%3C/svg%3E") no-repeat; } .sdk--container.sdk--expanded .sdk--a-close { background: #2C77C5 url("data:image/svg+xml,%3Csvg%20viewBox%3D%220%200%2024%2024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20fill%3D%22none%22%20stroke%3D%22%23ffffff%22%3E%3Cg%20id%3D%22SVGRepo_bgCarrier%22%20stroke-width%3D%220%22%3E%3C%2Fg%3E%3Cg%20id%3D%22SVGRepo_tracerCarrier%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3C%2Fg%3E%3Cg%20id%3D%22SVGRepo_iconCarrier%22%3E%20%3Cg%20stroke%3D%22%23ffffff%22%20stroke-width%3D%222%22%3E%20%3Cpath%20d%3D%22M21%2012C21%2016.9706%2016.9706%2021%2012%2021C7.02944%2021%203%2016.9706%203%2012C3%207.02944%207.02944%203%2012%203C16.9706%203%2021%207.02944%2021%2012Z%22%3E%3C%2Fpath%3E%20%3Cpath%20stroke-linecap%3D%22round%22%20d%3D%22M9%2015L15%209M15%2015L9%209%22%3E%3C%2Fpath%3E%20%3C%2Fg%3E%20%3C%2Fg%3E%3C%2Fsvg%3E") no-repeat; } .sdk--header { font-size: 16px; text-align: center; margin: 10px 5px; order: 1; } .sdk--title { display: inline-block; } .sdk--container.sdk--collapsed .sdk--main, .sdk--container.sdk--collapsed .sdk--external-link-container, .sdk--container.sdk--collapsed .sdk--title, .sdk--container.sdk--collapsed .sdk--disclaimer { display: none !important; } .sdk--main { width: 100%; margin: 0; display: flex; flex-direction: column-reverse; height: calc(100% - 73px); overflow-x: hidden; background-color: #fff; order: 2; flex-grow: 1; } .sdk--disclaimer { font-size: 10px; display: block; padding: 0 7px 7px; order: 3; margin-top: -5px; background-color: #2C77C5; } .sdk--disclaimer a { color: white; font-weight: bold; } .sdk--hidden { display: none !important; } .sdk--pdf-logo { width: 24px; margin-bottom: -7px; margin-left: 5px; } .sdk--pdf-link { display: inline-block; } .sdk--container.sdk--expanded .sdk--resize-handle { position: absolute; left: 0; top: calc(50% - 12.5px); width: 70px; height: 25px; z-index: 10; display: flex; justify-content: space-between; align-items: center; background-color: #2C77C5; padding: 5px; border-radius: 0 10px 10px 0; } .sdk--container.sdk--expanded .sdk--resize-handle:hover { background-color:rgb(62, 144, 231); } .sdk--container.sdk--expanded .sdk--resizer { cursor: col-resize; background-color: #2C77C5; height: 100%; width: 5px; } .sdk--unselectable { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } `; document.head.appendChild(sdkStyleSheet); const sdkBodyMarkup = document.createElement('div'); sdkBodyMarkup.className = 'sdk--container sdk--collapsed'; sdkBodyMarkup.id = 'sdk--container'; sdkBodyMarkup.innerHTML = `
This is an AI-bot created at sadik.ai and may provide inaccurate information, user discretion required.

PDF Boss

`; document.body.append(sdkBodyMarkup); [...document.getElementsByTagName('a')].forEach(function(a) { if (a.href.includes('.pdf') && !a.href.includes('embed-bot-')) { a.insertAdjacentHTML('afterend', ``); } }); document.querySelectorAll('.sdk--resizer')[0].addEventListener('mousedown', function(e) { startX = e.clientX; startY = e.clientY; startWidth = parseInt(document.defaultView.getComputedStyle(sdkBodyMarkup).width, 10); document.documentElement.addEventListener('mousemove', sdkDoDrag, false); document.documentElement.addEventListener('mouseup', sdkStopDrag, false); }); function sdkDoDrag(e) { document.getElementsByName('sdk--preview-iframe')[0].style.pointerEvents = 'none'; sdkBodyMarkup.style.width = (startWidth - e.clientX + startX) + 'px'; document.getElementsByTagName('body')[0].classList.add('sdk--unselectable'); } function sdkStopDrag(e) { document.documentElement.removeEventListener('mousemove', sdkDoDrag, false); document.documentElement.removeEventListener('mouseup', sdkStopDrag, false); document.getElementsByName('sdk--preview-iframe')[0].style.pointerEvents = 'auto'; document.getElementsByTagName('body')[0].classList.remove('sdk--unselectable'); } window.addEventListener('blur', function() { sdkStopDrag(); });