dsql-admin/dsql-app/.local_dist/static/chunks/8261-3c3582fc434ee275.js
Benjamin Toby e0a030f10d Updates
2025-01-13 09:00:21 +01:00

1 line
12 KiB
JavaScript

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8261],{489:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({clientId:e,redirectUrl:t,setLoading:n,scopes:i}){n&&n(!0);let a=i?i.join("%20"):"read:user",o=`https://github.com/login/oauth/authorize?client_id=${e}&scope=${a}&redirect_uri=${t}`;window.location.assign(o)}},8557:function(e,t){let n;var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(a,o){function r(e){try{u(i.next(e))}catch(e){o(e)}}function l(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(r,l)}u((i=i.apply(e,t||[])).next())})};function a({google:e,clientId:t,setLoading:n,triggerPrompt:i}){return setTimeout(()=>{null==n||n(!1)},3e3),new Promise((n,a)=>{e.accounts.oauth2.initTokenClient({client_id:t,scope:"email profile",callback:function(e){n(e.access_token)}}).requestAccessToken(),i&&e.accounts.id.prompt(function(e){console.log(e)})})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return i(this,void 0,void 0,function*(){var t,i;null===(t=e.setLoading)||void 0===t||t.call(e,!0);let o=yield new Promise((t,i)=>{n=setInterval(()=>{let i=window.google;i&&(window.clearInterval(n),t(a(Object.assign(Object.assign({},e),{google:i}))))},500)});return null===(i=e.setLoading)||void 0===i||i.call(e,!1),o})},t.googleLogin=a},7946:function(e,t,n){var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(a,o){function r(e){try{u(i.next(e))}catch(e){o(e)}}function l(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(r,l)}u((i=i.apply(e,t||[])).next())})},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return i(this,void 0,void 0,function*(){try{let t;let n=localStorage.getItem("user");try{t=JSON.parse(n||"")}catch(e){console.log(e)}if(!t)return!1;let i=(0,o.default)(),a=(null==i?void 0:i.datasquirel_social_id)&&"string"==typeof i.datasquirel_social_id&&!i.datasquirel_social_id.match(/^null$/i)?i.datasquirel_social_id:null;return localStorage.setItem("user","{}"),localStorage.removeItem("csrf"),document.cookie="datasquirel_social_id=null;samesite=strict;path=/",yield new Promise((t,n)=>{if(!a||(null==a?void 0:a.match(/^null$/i)))t(!0);else{let n=null==e?void 0:e.googleClientId;if(n){let e=document.createElement("script");e.src="https://accounts.google.com/gsi/client",e.className="social-script-tag",document.body.appendChild(e),e.onload=function(e){let i=window.google;i&&(i.accounts.id.initialize({client_id:n}),i.accounts.id.revoke(a,e=>{console.log(e.error),t(!0)}))}}else t(!0)}})}catch(e){return!1}})};let o=a(n(2406))},1335:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let a=i(n(8753)),o=i(n(4715)),r=i(n(1168)),l=i(n(8557)),u=i(n(489)),c=i(n(7946)),s=i(n(1028)),d=i(n(1028)),f=i(n(4727)),h=i(n(8168)),p=i(n(834)),y=i(n(8226)),g=i(n(4567)),m={imageInputToBase64:o.default,imageInputFileToBase64:a.default,inputFileToBase64:r.default},v={google:{getAccessToken:l.default},github:{getAccessToken:u.default},logout:c.default},_={serializeQuery:f.default,serializeCookies:h.default,EJSON:p.default,numberfy:y.default,slugify:g.default},w={fetchApi:s.default,clientFetch:d.default};t.default={media:m,auth:v,fetch:w,utils:_}},8753:function(e,t){var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(a,o){function r(e){try{u(i.next(e))}catch(e){o(e)}}function l(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(r,l)}u((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return n(this,arguments,void 0,function*({imageInputFile:e,maxWidth:t,imagePreviewNode:n}){try{let i,a,o=e.name.replace(/\..*/,""),r=document.createElement("canvas"),l=e.type,u=t||null,c=URL.createObjectURL(e),s=new Image;return s.src=c,i=yield new Promise((e,t)=>{s.onerror=function(){URL.revokeObjectURL(this.src),console.log("Cannot load image")},s.onload=function(t){let i=t.target;if(URL.revokeObjectURL(i.src),u){let e=u/s.naturalWidth;r.width=s.naturalWidth<u?s.naturalWidth:u,r.height=s.naturalWidth<u?s.naturalHeight:s.naturalHeight*e}else r.width=s.naturalWidth,r.height=s.naturalHeight;let a=r.getContext("2d");null==a||a.drawImage(s,0,0,r.width,r.height);let o=r.toDataURL(l,.95);n&&(n.src=o),e(o)}}),a=yield new Promise((e,t)=>{r.toBlob(t=>{e(null==t?void 0:t.size)},l,.95)}),{imageBase64:null==i?void 0:i.replace(/.*?base64,/,""),imageBase64Full:i,imageName:o,imageSize:a}}catch(e){return console.log("Image Processing Error! =>",e.message),{imageBase64:void 0,imageBase64Full:void 0,imageName:void 0,imageSize:void 0}}})}},4715:function(e,t){var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(a,o){function r(e){try{u(i.next(e))}catch(e){o(e)}}function l(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(r,l)}u((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return n(this,arguments,void 0,function*({imageInput:e,maxWidth:t,mimeType:n}){var i,a;try{let o,r=document.querySelector("[data-imagepreview='image']"),l=null===(i=e.files)||void 0===i?void 0:i[0].name.replace(/\..*/,""),u=n||"image/jpeg",c=t||null,s=null===(a=e.files)||void 0===a?void 0:a[0],d=s?URL.createObjectURL(s):void 0,f=new Image;if(d)return f.src=d,{imageBase64:null==(o=yield new Promise((e,t)=>{f.onerror=function(){URL.revokeObjectURL(this.src),window.alert("Cannot load image!")},f.onload=function(t){let n=t.target;URL.revokeObjectURL(n.src);let i=document.createElement("canvas");if(c){let e=c/f.naturalWidth;i.width=f.naturalWidth<c?f.naturalWidth:c,i.height=f.naturalWidth<c?f.naturalHeight:f.naturalHeight*e}else i.width=f.naturalWidth,i.height=f.naturalHeight;let a=i.getContext("2d");null==a||a.drawImage(f,0,0,i.width,i.height);let o=i.toDataURL(u,.95);r&&document.querySelectorAll("[data-imagepreview='image']").forEach(e=>{e.src=o}),e(o)}}))?void 0:o.replace(/.*?base64,/,""),imageBase64Full:o,imageName:l};return{}}catch(e){return console.log("Image Processing Error! =>",e.message),{}}})}},1168:function(e,t){var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(a,o){function r(e){try{u(i.next(e))}catch(e){o(e)}}function l(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(r,l)}u((i=i.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return n(this,arguments,void 0,function*({inputFile:e,allowedRegex:t}){var n;if(!(null===(n=null==e?void 0:e.type)||void 0===n?void 0:n.match(t||/image\/*|\/pdf/)))return window.alert(`We currently don't support ${e.type} file types. Support is coming soon. For now we support only images and PDFs.`),{fileName:e.name};try{let t=e.name.replace(/\..*/,""),n=yield new Promise((t,n)=>{var i=new FileReader;i.readAsDataURL(e),i.onload=function(){var e;t(null===(e=i.result)||void 0===e?void 0:e.toString())},i.onerror=function(e){console.log("Error: ",e.message)}});return{fileBase64:null==n?void 0:n.replace(/.*?base64,/,""),fileBase64Full:n,fileName:t,fileSize:e.size,fileType:e.type}}catch(t){return console.log("File Processing Error! =>",t.message),{fileName:e.name}}})}},2406:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){let e=document.cookie;if(!e||"string"!=typeof e)return null;let t=e.split(";"),n={};return t.forEach(e=>{let[t,i]=e.split("=");t&&"string"==typeof t&&(n[t.replace(/^ +| +$/,"")]=i&&"string"==typeof i?i.replace(/^ +| +$/,""):null)}),n}},834:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default={parse:function(e,t){if(e){if("object"==typeof e)return e;if("string"==typeof e)try{return JSON.parse(e,t)}catch(e){return}}},stringify:function(e,t,n){try{return JSON.stringify(e,t||void 0,n)}catch(e){return}}}},8226:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){try{let n=Number(e);if("number"!=typeof n||isNaN(n))return 0;if(t)return Number(n.toFixed(t));return Math.round(n)}catch(e){return console.log(`Numberfy ERROR: ${e.message}`),0}}},8168:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({cookies:e}){let t=[];for(let n=0;n<e.length;n++){let i=e[n],a=`${i.name}=${i.value}`;i.maxAge&&(a+=`;Max-Age=${i.maxAge}`),i.path&&(a+=`;Path=${i.path}`),i.domain&&(a+=`;Domain=${i.domain}`),i.secure&&(a+=";Secure"),i.httpOnly&&(a+=";HttpOnly"),i.sameSite&&(a+=`;SameSite=${i.sameSite}`),i.expires&&(a+=`;expires=${i.expires}`),i.priority&&(a+=`;priority=${i.priority}`),t.push(a)}return t}},4727:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){let t="?";if("object"!=typeof e)return console.log("Invalid Query type"),t;if(Array.isArray(e))return console.log("Query is an Array. This is invalid."),t;if(!e)return console.log("No Query provided."),t;let n=Object.keys(e),i=[];return n.forEach(t=>{if(!t||!e[t])return;let n=e[t];if("object"==typeof n){let e=a.default.stringify(n);i.push(`${t}=${encodeURIComponent(String(e))}`)}else"string"==typeof n||"number"==typeof n?i.push(`${t}=${encodeURIComponent(n)}`):i.push(`${t}=${String(n)}`)}),t+=i.join("&")};let a=i(n(834))},4567:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){try{return String(e).trim().toLowerCase().replace(/ {2,}/g," ").replace(/ /g,"-").replace(/[^a-z0-9]/g,"-").replace(/-{2,}/g,"-").replace(/^-/,"").replace(/-$/,"")}catch(e){return console.log(`Slugify ERROR: ${e.message}`),""}}},7216:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},5014:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["path",{d:"M8 7h6",key:"1f0q6e"}],["path",{d:"M8 11h8",key:"vwpz6n"}]])},9140:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])},2894:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("FileKey2",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v6",key:"rc0qvx"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"4",cy:"16",r:"2",key:"1ehqvc"}],["path",{d:"m10 10-4.5 4.5",key:"7fwrp6"}],["path",{d:"m9 11 1 1",key:"wa6s5q"}]])},9508:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},9753:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]])},1915:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]])},7273:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])},5922:(e,t,n)=>{n.d(t,{A:()=>i});let i=(0,n(5737).A)("ShieldEllipsis",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}]])}}]);