1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3758],{76489:function(e,t){"use strict";t.parse=function(e,t){if("string"!=typeof e)throw TypeError("argument str must be a string");for(var n={},r=e.split(";"),a=(t||{}).decode||i,s=0;s<r.length;s++){var o=r[s],l=o.indexOf("=");if(!(l<0)){var c=o.substring(0,l).trim();if(void 0==n[c]){var u=o.substring(l+1,o.length).trim();'"'===u[0]&&(u=u.slice(1,-1)),n[c]=function(e,t){try{return t(e)}catch(t){return e}}(u,a)}}}return n},t.serialize=function(e,t,i){var a=i||{},s=a.encode||n;if("function"!=typeof s)throw TypeError("option encode is invalid");if(!r.test(e))throw TypeError("argument name is invalid");var o=s(t);if(o&&!r.test(o))throw TypeError("argument val is invalid");var l=e+"="+o;if(null!=a.maxAge){var c=a.maxAge-0;if(isNaN(c)||!isFinite(c))throw TypeError("option maxAge is invalid");l+="; Max-Age="+Math.floor(c)}if(a.domain){if(!r.test(a.domain))throw TypeError("option domain is invalid");l+="; Domain="+a.domain}if(a.path){if(!r.test(a.path))throw TypeError("option path is invalid");l+="; Path="+a.path}if(a.expires){if("function"!=typeof a.expires.toUTCString)throw TypeError("option expires is invali
1d");l+="; Expires="+a.expires.toUTCString()}if(a.httpOnly&&(l+="; HttpOnly"),a.secure&&(l+="; Secure"),a.sameSite)switch("string"==typeof a.sameSite?a.sameSite.toLowerCase():a.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw TypeError("option sameSite is invalid")}return l};var i=decodeURIComponent,n=encodeURIComponent,r=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/},47041:function(e,t,i){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)0>t.indexOf(n[r])&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i};Object.defineProperty(t,"__esModule",{value:!0}),t.checkCookies=t.hasCookie=t.removeCookies=t.deleteCookie=t.setCookies=t.setCookie=t.getCookie=t.getCookies=void 0;var a=i(76489),s=function(){return"undefined"!=typeof window},o=function(e){void 0===e&&(e="");try{var t=JSON.stringify(e);return/^[\{\[]/.test(t)?t:e}catch(t){return e}};t.getCookies=function(e){if(e&&(t=e.req),!s())return t&&t.cookies?t.cookies:t&&t.headers&&t.headers.cookie?(0,a.parse)(t.headers.cookie):{};for(var t,i={},n=document.cookie?document.cookie.split("; "):[],r=0,o=n.length;r<o;r++){var l=n[r].split("="),c=l.slice(1).join("=");i[l[0]]=c}return i},t.getCookie=function(e,i){var n,r=(0,t.getCookies)(i)[e];if(void 0!==r)return"true"===(n=r?r.replace(/(%[0-9A-Z]{2}
1)+/g,decodeURIComponent):r)||"false"!==n&&("undefined"!==n?"null"===n?null:n:void 0)},t.setCookie=function(e,t,i){if(i){var l,c,u,d=i.req,p=i.res,h=r(i,["req","res"]);c=d,u=p,l=h}var m=(0,a.serialize)(e,o(t),n({path:"/"},l));if(s())document.cookie=m;else if(u&&c){var x=u.getHeader("Set-Cookie");if(Array.isArray(x)||(x=x?[String(x)]:[]),u.setHeader("Set-Cookie",x.concat(m)),c&&c.cookies){var f=c.cookies;""===t?delete f[e]:f[e]=o(t)}if(c&&c.headers&&c.headers.cookie){var f=(0,a.parse)(c.headers.cookie);""===t?delete f[e]:f[e]=o(t),c.headers.cookie=Object.entries(f).reduce(function(e,t){return e.concat("".concat(t[0],"=").concat(t[1],";"))},"")}}},t.setCookies=function(e,i,n){return console.warn("[WARN]: setCookies was deprecated. It will be deleted in the new version. Use setCookie instead."),(0,t.setCookie)(e,i,n)},t.deleteCookie=function(e,i){return(0,t.setCookie)(e,"",n(n({},i),{maxAge:-1}))},t.removeCookies=function(e,i){return console.warn("[WARN]: removeCookies was deprecated. It will be deleted in the new version. Use deleteCookie instead."),(0,t.deleteCookie)(e,i)},t.hasCookie=function(e,i){return!!e&&(0,t.getCookies)(i).hasOwnProperty(e)},t.checkCookies=function(e,i){return console.warn("[WARN]: checkCookies was deprecated. It will be deleted in the new version. Use hasCookie instead."),(0,t.hasCookie)(e,i)}},86599:function(e,t,i){"use strict";i.d(t,{Z:function(){return h}}),i(67294);var n=i(47886),r=i.n(n),a=i(41664),s=i.n(a),o=i(41879),l=i(28093),c=i.n(l),u=i(11163),d=i(85893),p=()=>{let e=(0,u.useRouter)();return(0,d.jsxs)("div",{className:c().outer,children:[(0,d.jsx)("h1",{className:c().title,children:"Admin navigation"}),(0,d.jsxs)("ul",{className:c().nav,children:[(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.index,children:"Index"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.users.allUsers,children:"Users"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.plans.allPlans,children:"Plans"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.uiChallenge.index,children:"Ui Challenge"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.projects.index,children:"Projects"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.questions.index,children:"Questions"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.evaluations.index,children:"Evaluations"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.newestFeedbackComments.index,children:"Newest feedback comments"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.newestComments.index,children:"Newest comments"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.newestReports.index,children:"Newest reported comments"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.assetLibrary.index,children:"Asset library"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.aiTools.tools,children:"Ai tools"})})]}),e.asPath.includes(o.jk.admin.aiTools.path)&&(0,d.jsxs)("ul",{className:"".concat(c().nav," ").concat(c().aiToolsNav),children:[(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.aiTools.tools,children:"Tools"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.aiTools.useCases,children:"Usecases"})}),(0,d.jsx)("li",{children:(0,d.jsx)(s(),{href:o.jk.admin.aiTools.guides,children:"Guides"})})]})]})},h=e=>{let{children:t,isAdmin:i}=e;return(0,d.jsxs)(d.Fragment,{children:[i&&(0,d.jsx)(p,{}),(0,d.jsx)("div",{className:r().mainWrapper,children:t})]})}},47538:function(e,t,i){"use strict";i.d(t,{Z:function(){return p}});var n=i(8307),r=i(4730),a=i(67294),s=i(37650),o=i.n(s),l=i(85893);let c=["name","label","type","placeholder","setValue","initialValue","error","dataTestId","userLayoutStyle"];function u(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function d(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?u(Object(i),!0).forEach(function(t){(0,n.Z)(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}var p=e=>{let{name:t,label:i,type:n,placeholder:s,setValue:u,initialValue:p,error:h,dataTestId:m,userLayoutStyle:x}=e,f=(0,r.Z)(e,c),{0:j,1:g}=(0,a.useState)(p||"");(0,a.useEffect)(()=>{u&&u(j)},[p]);let y=e=>{g(e.currentTarget.value),u(e.currentTarget.value)};return(0,l.jsxs)("div",{className:o().inputContainer,children:[(0,l.jsx)("label",{htmlFor:t,className:o().inputLabel,children:i}),(0,l.jsx)("input",d(d({type:n,placeholder:s,onChange:e=>y(e),value:j,className:"".concat(o().input," ").concat(x?o().userLayout:""),id:t,name:t},f),{},{"data-test-id":m})),(0,l.jsx)("span",{className:"".concat(o().errorMessage," ").concat(h?o().show:""),"data-test-id":"input-error-message",children:h&&h})]})}},62728:function(e,t,i){"use strict";i.d(t,{Z:function(){return o}});var n=i(67294),r=i(11883),a=i.n(r),s=i(85893),o=e=>{let{tags:t,setTags:i,label:r="For example: minimal, blue, gradient, ui, mobile"}=e,o=(0,n.useRef)(null),l=e=>{let n=[...t];n.splice(e,1),i(n)},c=e=>{t.length<10&&!t.find(t=>t.toLowerCase()===e.toLowerCase())&&i([...t,e]),o.current&&(o.current.value="")};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:a()["input-tag"],children:(0,s.jsxs)("ul",{className:a()["input-tag__tags"],children:[t.map((e,t)=>(0,s.jsxs)("li",{children:[e,(0,s.jsx)("button",{type:"button",onClick:()=>{l(t)},children:"+"})]},e)),(0,s.jsx)("li",{className:a()["input-tag__tags__input"],children:(0,s.jsx)("input",{type:"text",onKeyDown:e=>{let i=e.currentTarget.value.trim();i&&("Enter"===e.key||","===e.key||"Tab"===e.key)?(e.preventDefault(),c(i)):"Backspace"!==e.key||i||l(t.length-1)},ref:o})})]})}),(0,s.jsx)("h4",{children:r})]})}},31473:function(e,t,i){"use strict";var n=i(42758);t.Z=n.Z},45891:function(e,t,i){"use strict";i.r(t),i.d(t,{__N_SSP:function(){return m},default:function(){return x}});var n=i(67294),r=i(33299),a=i(11163),s=i(31473),o=i(86599),l=i(47538),c=i(62728),u=i(63523),d=i(41879),p=i(49067),h=i(85893),m=!0;function x(){let e=(0,a.useRouter)(),{data:t}=(0,r.useSession)(),{0:i,1:m}=(0,n.useState)(""),{0:x,1:f}=(0,n.useState)(""),{0:j,1:g}=(0,n.useState)(""),{0:y,1:v}=(0,n.useState)(""),{0:_,1:k}=(0,n.useState)(""),{0:b,1:w}=(0,n.useState)([]),{0:C,1:T}=(0,n.useState)(""),{0:S,1:N}=(0,n.useState)([]),{0:O,1:E}=(0,n.useState)([]),{0:P,1:L}=(0,n.useState)([]),{0:A,1:Z}=(0,n.useState)(""),{0:U,1:V}=(0,n.useState)(null),{0:I,1:R}=(0,n.useState)([]),W=async n=>{n.preventDefault();try{let n=new FormData;n.append("name",i),n.append("summary",x),n.append("type",j),n.append("cost",y),n.append("freeVersion",_),n.append("toolUrl",A),n.append("about",C),n.append("contentTypes",JSON.stringify(b)),n.append("canDo",JSON.stringify(S)),n.append("cantDo",JSON.stringify(O)),n.append("versionHistory",JSON.stringify(P)),n.append("videoTutorials",JSON.stringify(I)),U&&n.append("image",U,U.name);let r=await u.xi.post(d.AX.admin.aiTools.tools.create,n,{headers:{"Content-Type":"multipart/form-data",Authorization:"Bearer ".concat(null==t?void 0:t.accessToken)}});201===r.status&&((0,p.TG)("Tool created!"),e.push(d.jk.admin.aiTools.tools))}catch(e){console.log("Error creating tool:",e),(0,p.Vw)(null==e?void 0:e.message)}};return(0,h.jsx)(s.Z,{transparentNav:"basicNav",children:(0,h.jsx)(o.Z,{isAdmin:!0,children:(0,h.jsxs)("main",{className:"container",children:[(0,h.jsx)("h1",{style:{margin:"0 0 24px 0"},children:"Create AI Tool"}),(0,h.jsxs)("form",{onSubmit:W,children:[(0,h.jsx)("div",{style:{margin:"20px 0 0 0"},children:(0,h.jsx)(l.Z,{name:"toolName",label:"Tool Name",type:"text",placeholder:"e.g. Chat GPT",initialValue:i,setValue:m,required:!0})}),(0,h.jsx)("div",{style:{margin:"20px 0 0 0"},children:(0,h.jsx)(l.Z,{name:"toolUrl",label:"Tool Website URL",type:"text",placeholder:"https://example.com",initialValue:A,setValue:Z})}),(0,h.jsx)("div",{className:"inputWrap",style:{margin:"20px 0 0 0"},children:(0,h.jsxs)("label",{htmlFor:"image",children:[(0,h.jsx)("span",{style:{margin:"0 0 20px",display:"inline-block"},children:"Logo Image"}),(0,h.jsx)("br",{}),(0,h.jsx)("input",{name:"image",type:"file",placeholder:"image",id:"image",onCh
1ange:e=>{var t;null!==(t=e.target)&&void 0!==t&&t.files&&V(e.target.files[0])}}),(0,h.jsx)("br",{}),U&&(0,h.jsx)("img",{src:URL.createObjectURL(U),alt:"Tool logo",style:{maxWidth:"100px",marginTop:"10px"}})]})}),(0,h.jsx)("div",{style:{margin:"20px 0 0 0"},children:(0,h.jsx)(l.Z,{name:"summary",label:"Summary",type:"text",placeholder:"ChatGPT was the first well known LLM that jumpstarted the whole AI revolution.",initialValue:x,setValue:f,required:!0})}),(0,h.jsx)("div",{style:{margin:"20px 0 0 0"},children:(0,h.jsx)(l.Z,{name:"type",label:"Type",type:"text",placeholder:"e.g. LLM",initialValue:j,setValue:g})}),(0,h.jsx)("div",{style:{margin:"20px 0 0 0"},children:(0,h.jsx)(l.Z,{name:"cost",label:"Cost",type:"text",placeholder:"e.g. â¬23/month",initialValue:y,setValue:v})}),(0,h.jsx)("div",{style:{margin:"20px 0 0 0"},children:(0,h.jsx)(l.Z,{name:"freeVersion",label:"Free Version",type:"text",placeholder:"e.g. Limited",initialValue:_,setValue:k})}),(0,h.jsx)("div",{style:{margin:"60px 0 60px 0",maxWidth:"360px"},children:(0,h.jsx)(c.Z,{tags:b,setTags:w,label:"Content Types (e.g. Text, Images). Press enter to add a new tag."})}),(0,h.jsx)("br",{}),(0,h.jsx)("button",{type:"submit",children:"Create Tool"})]})]})})})}},25058:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/ai-tools/tools/create",function(){return i(45891)}])},28093:function(e){e.exports={outer:"adminNav_outer__ZUbZB",title:"adminNav_title__Lr_gB",nav:"adminNav_nav__ZI1EA",aiToolsNav:"adminNav_aiToolsNav__25evq"}},47886:function(e){e.exports={mainWrapper:"layoutStyle_mainWrapper__E7aiM"}},37650:function(e){e.exports={inputContainer:"inputText_inputContainer__Eb94w",inputLabel:"inputText_inputLabel__rrbto",input:"inputText_input__8OLTA",userLayout:"inputText_userLayout__Ci_9J",errorMessage:"inputText_errorMessage__artEJ",show:"inputText_show__8epN2"}},11883:function(e){e.exports={"input-tag":"textareaWithTags_input-tag__PbIod","input-tag__tags":"textareaWithTags_input-tag__tags___hlA5","input-tag__tags__input":"textareaWithTags_input-tag__tags__input__bSR8p"}}},function(e){e.O(0,[2758,2888,9774,179],function(){return e(e.s=25058)}),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.