File: /homepages/34/d890102484/htdocs/sites/tesoftV2/wp-content/plugins/hyve-lite/build/backend/index.js
!function(){var e,t={779:function(e,t,n){"use strict";var a=n(609),r=window.wp.domReady,i=n.n(r),s=window.wp.element,l=window.wp.data;const o={route:"home",hasLoaded:!1,settings:{},processed:[],hasAPI:Boolean(window.hyve.hasAPIKey),isQdrantActive:Boolean(window.hyve.isQdrantActive),totalChunks:0},c={setRoute(e){return{type:"SET_ROUTE",route:e}},setLoading(){return{type:"HAS_LOADED"}},setSettings(e){return{type:"SET_SETTINGS",settings:e}},setSetting(e,t){return{type:"SET_SETTING",key:e,value:t}},setHasAPI(e){return{type:"SET_HAS_API",hasAPI:e}},setTotalChunks(e){return{type:"SET_TOTAL_CHUNKS",totalChunks:e}},setQdrantStatus(e){return{type:"SET_QDRANT_STATUS",isQdrantActive:e}}},u={getRoute(e){return e.route},hasLoaded(e){return e.hasLoaded},getSettings(e){return e.settings},hasAPI(e){return e.hasAPI},getTotalChunks(e){return e.totalChunks},hasReachedLimit(e){return hyve.chunksLimit<=Number(e.totalChunks)&&!Boolean(hyve.isQdrantActive)},isQdrantActive(e){return e.isQdrantActive}},d=(0,l.createReduxStore)("hyve",{reducer:(e=o,t)=>{switch(t.type){case"SET_ROUTE":return{...e,route:t.route};case"HAS_LOADED":return{...e,hasLoaded:!0};case"SET_SETTINGS":return{...e,settings:t.settings};case"SET_SETTING":return{...e,settings:{...e.settings,[t.key]:t.value}};case"SET_HAS_API":return{...e,hasAPI:t.hasAPI};case"SET_TOTAL_CHUNKS":return{...e,totalChunks:t.totalChunks};case"SET_QDRANT_STATUS":return{...e,isQdrantActive:t.isQdrantActive};default:return e}},actions:c,selectors:u});(0,l.register)(d);var h=window.wp.i18n,m=window.wp.apiFetch,p=n.n(m),f=window.wp.components,y=window.wp.hooks,v=window.wp.primitives,g=n(848),w=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(v.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),b=(0,g.jsx)(v.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)(v.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z"})}),_=(0,g.jsx)(v.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)(v.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})}),E=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(v.Path,{fillRule:"evenodd",d:"M8.95 11.25H4v1.5h4.95v4.5H13V18c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75h-2.55v-7.5H13V9c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3c-1.1 0-2 .9-2 2v.75H8.95v4.5ZM14.5 15v3c0 .3.2.5.5.5h3c.3 0 .5-.2.5-.5v-3c0-.3-.2-.5-.5-.5h-3c-.3 0-.5.2-.5.5Zm0-6V6c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5Z",clipRule:"evenodd"})}),x=(0,g.jsxs)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,g.jsx)(v.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,g.jsx)(v.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),N=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,g.jsx)(v.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})}),S=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(v.Path,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"})}),k=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(v.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})}),I=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(v.Path,{d:"M12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zM3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 8.75a1.5 1.5 0 01.167 2.99c-.465.052-.917.44-.917 1.01V14h1.5v-.845A3 3 0 109 10.25h1.5a1.5 1.5 0 011.5-1.5zM11.25 15v1.5h1.5V15h-1.5z"})});const{setRoute:C}=(0,l.dispatch)("hyve"),B=[{label:(0,h.__)("Sessions","hyve-lite"),value:hyve?.stats?.threads,description:(0,h.__)("Unique chat sessions created by your users.","hyve-lite")},{label:(0,h.__)("Messages","hyve-lite"),value:hyve?.stats?.messages,description:(0,h.__)("Total messages exchanged between users and Hyve.","hyve-lite")},{label:(0,h.__)("Knowledge Base","hyve-lite"),value:Boolean(hyve.isQdrantActive)?hyve?.stats?.totalChunks:`${hyve?.stats?.totalChunks} / ${hyve?.chunksLimit}`,description:(0,h.__)("Current knowledge base chunks used.","hyve-lite"),action:{label:(0,h.__)("Need more storage?","hyve-lite"),action:()=>C("integrations"),condition:!Boolean(hyve.isQdrantActive)&&400<hyve?.stats?.totalChunks}}],A=()=>{const{setRoute:e}=(0,l.useDispatch)("hyve"),t=[{label:(0,h.__)("Knowledge Base","hyve-lite"),description:(0,h.__)("In Knowledge Base, view and remove any Posts/Pages added to Hyve from the chat's data source.","hyve-lite"),icon:b,action:()=>e("data")},{label:(0,h.__)("Personalize","hyve-lite"),description:(0,h.__)("Customize Hyve's behavior and appearance to better suit your website and brand.","hyve-lite"),icon:k,action:()=>e("settings")},{label:(0,h.__)("Need help?","hyve-lite"),description:(0,h.__)("Check out our documentation or contact support for assistance.","hyve-lite"),icon:I,action:()=>window?.open(window?.hyve?.docs,"_blank")}];return(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Dashboard","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("h2",{className:"text-xl py-2"},(0,h.__)("Overview","hyve-lite")),(0,a.createElement)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-3 mt-4"},B.map((({label:e,value:t,description:n,action:r})=>(0,a.createElement)("div",{key:e,className:"bg-white overflow-hidden shadow border-[0.5px] border-gray-300 border-solid rounded-md"},(0,a.createElement)("div",{className:"px-4 py-5 sm:p-6"},(0,a.createElement)("dl",null,(0,a.createElement)("dt",{className:"text-sm leading-5 font-medium text-gray-500 truncate"},e),(0,a.createElement)("dd",{className:"my-1 text-2xl leading-9 font-semibold"},t),(0,a.createElement)("dt",{className:"text-xs text-gray-500"},n),r&&r?.condition&&(0,a.createElement)("dt",{className:"text-xs pt-1 text-blue-500 cursor-pointer",onClick:r?.action},r?.label))))))),(0,a.createElement)("h2",{className:"text-xl pt-6 pb-2"},(0,h.__)("Get Started","hyve-lite")),(0,a.createElement)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-3 my-4"},t.map((({label:e,description:t,icon:n,action:r})=>(0,a.createElement)(f.Button,{key:e,className:"bg-white h-auto text-left overflow-hidden shadow border-[0.5px] border-gray-300 border-solid rounded-md cursor-pointer",onClick:r},(0,a.createElement)("div",{className:"px-4 py-5 sm:p-6"},(0,a.createElement)("dl",null,(0,a.createElement)("dt",{className:"w-8"},n),(0,a.createElement)("dt",{className:"text-sm leading-5 font-medium py-4"},e," →"),(0,a.createElement)("dt",{className:"text-xs font-medium text-gray-500"},t))))))))))};var P=window.wp.url,D=({posts:e,isLoading:t,hasMore:n,onFetch:r,actions:i})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"flex flex-col"},(0,a.createElement)("div",{className:"bg-gray-50 px-6 py-3 text-left text-xs text-gray-700 uppercase"},(0,a.createElement)("div",{className:"flex"},(0,a.createElement)("div",{className:"w-1/6"},(0,h.__)("ID","hyve-lite")),(0,a.createElement)("div",{className:"flex-1"},(0,h.__)("Title","hyve-lite")),(0,a.createElement)("div",{className:"w-1/6 flex justify-center"},(0,h.__)("Action","hyve-lite")))),(0,a.createElement)("div",{className:"flex flex-col"},e?.map((e=>(0,a.createElement)("div",{key:e.ID,className:"flex items-center bg-white px-6 py-4 border-b text-sm text-gray-500"},(0,a.createElement)("div",{className:"w-1/6"},e.ID),(0,a.createElement)("div",{className:"flex-1 text-left rtl:text-right overflow-hidden"},(0,a.createElement)("span",{className:"max-w-full text-ellipsis overflow-hidden"},e.title)),(0,a.createElement)("div",{className:"text-center flex gap-4"},i?.map((t=>(0,a.createElement)(f.Button,{key:t?.label,variant:t?.variant||"primary",onClick:()=>t?.onClick(e.ID),disabled:t?.isBusy.includes(e.ID)||t?.isDisabled,isBusy:t?.isBusy.includes(e.ID),isDestructive:t?.isDestructive,className:"w-20 justify-center"},t?.label))))))),!e.length&&!t&&(0,a.createElement)("div",{className:"flex justify-center py-4"},(0,h.__)("No data found.","hyve-lite")))),t&&(0,a.createElement)("div",{className:"flex justify-center pt-8"},(0,a.createElement)(f.Spinner,null)),n&&(0,a.createElement)("div",{className:"flex justify-center pt-8"},(0,a.createElement)(f.Button,{variant:"secondary",onClick:r},(0,h.__)("Load More","hyve-lite")))),T=n(802),L=n.n(T);const{createNotice:j}=(0,l.dispatch)("core/notices"),U={hate:{label:(0,h.__)("Hate Speech","hyve-lite"),description:(0,h.__)("Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment.","hyve-lite"),default:.7},"hate/threatening":{label:(0,h.__)("Hate Speech/Threatening","hyve-lite"),description:(0,h.__)("Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste.","hyve-lite"),default:.6},harassment:{label:(0,h.__)("Harassment","hyve-lite"),description:(0,h.__)("Content that expresses, incites, or promotes harassing language towards any target.","hyve-lite"),default:.7},"harassment/threatening":{label:(0,h.__)("Harassment/Threatening","hyve-lite"),description:(0,h.__)("Harassment content that also includes violence or serious harm towards any target.","hyve-lite"),default:.6},"self-harm":{label:(0,h.__)("Self-Harm","hyve-lite"),description:(0,h.__)("Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders.","hyve-lite"),default:.5},"self-harm/intent":{label:(0,h.__)("Self-Harm with Intent","hyve-lite"),description:(0,h.__)("Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders.","hyve-lite"),default:.5},"self-harm/instructions":{label:(0,h.__)("Self-Harm Instructions","hyve-lite"),description:(0,h.__)("Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts.","hyve-lite"),default:.5},sexual:{label:(0,h.__)("Sexual Content","hyve-lite"),description:(0,h.__)("Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness).","hyve-lite"),default:.8},"sexual/minors":{label:(0,h.__)("Sexual Content Involving Minors","hyve-lite"),description:(0,h.__)("Sexual content that includes an individual who is under 18 years old.","hyve-lite"),default:.5},violence:{label:(0,h.__)("Violence","hyve-lite"),description:(0,h.__)("Content that depicts death, violence, or physical injury.","hyve-lite"),default:.7},"violence/graphic":{label:(0,h.__)("Graphic Violence","hyve-lite"),description:(0,h.__)("Content that depicts death, violence, or physical injury in graphic detail.","hyve-lite"),default:.8}},M=async({post:e={},type:t="core",params:n={},onSuccess:a=(()=>{}),onError:r=(()=>{})})=>{let i;try{if(i="knowledge"===t?await p()({path:e.ID?`${window.hyve.api}/knowledge/${e.ID}`:`${window.hyve.api}/knowledge`,method:"POST",data:{data:e,...n}}):"link"===t?await p()({path:`${window.hyve.api}/link`,method:"POST",data:{data:e,...n}}):await p()({path:`${window.hyve.api}/data`,method:"POST",data:{data:e,...n}}),i.error)throw i;j("success",(0,h.__)("Post has been updated.","hyve-lite"),{type:"snackbar",isDismissible:!0}),a()}catch(e){j("error",e.error,{type:"snackbar",isDismissible:!0}),r(e)}},R=e=>new Intl.DateTimeFormat("en-GB",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(e)).replace(",",""),O=(e,t)=>{const n=new URL(e);return n.searchParams.set("utm_campaign",t),n.toString()};var H=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(v.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})}),F=({post:e,type:t="",isOpen:n,onClose:r,onSuccess:i=(()=>{})})=>{const[l,o]=(0,s.useState)(!1);return n&&e?.review?(0,a.createElement)(f.Modal,{title:(0,h.sprintf)((0,h.__)("Failed Moderation: %s","hyve-lite"),e?.title||(0,h.__)("Untitled","hyve-lite")),onRequestClose:r,shouldCloseOnClickOutside:!1,className:"md:max-w-3xl md:w-full"},(0,a.createElement)("p",{className:"pb-4"},(0,h.__)("The content of the post listed here could not be added or updated due to non-compliance with content policies. Review these to understand the limitations and possibly modify content to align with required standards.","hyve-lite")),(0,a.createElement)("p",{className:"pb-4"},(0,h.__)("The following content was flagged for:","hyve-lite")),e&&Object.keys(e.review).map((t=>(0,a.createElement)("div",{key:t,className:"flex items-center gap-4 bg-white px-6 py-4 border-b text-sm text-gray-500"},(0,a.createElement)("div",{className:"flex items-center max-w-48 w-48"},(0,a.createElement)("h4",{className:"overflow-hidden text-ellipsis block text-nowrap"},U[t].label),(0,a.createElement)(f.Button,{icon:H,showTooltip:!0,isPressed:!1,label:U[t].description,className:"focus:!shadow-none"})),(0,a.createElement)("div",{className:"flex-1 text-left rtl:text-right overflow-hidden"},(0,a.createElement)("div",{className:"w-full bg-gray-200 rounded-full h-2.5 dark:bg-gray-700"},(0,a.createElement)("div",{className:"bg-blue-600 h-2.5 rounded-full",style:{width:`${Math.floor(100*e.review[t])}%`}}))),(0,a.createElement)("div",{className:"w-2/8 text-center flex"},(0,a.createElement)("span",null,Math.floor(100*e.review[t]),"%"))))),(0,a.createElement)("p",{className:"pt-4"},(0,h.__)("Occasionally, OpenAI's Moderation system may incorrectly flag content as a violation—these are false positives. Such errors can occur because automated systems sometimes lack the necessary context to interpret nuances accurately. If your content is flagged but you believe it adheres to the guidelines, please manually review it. Should you determine it does not violate the content policies, you can click the button below to override the moderation decision.","hyve-lite")),(0,a.createElement)("div",{className:"flex"},(0,a.createElement)(f.Button,{variant:"secondary",className:"mt-4 ml-auto",disabled:l,isBusy:l,onClick:async()=>{o(!0),await M({post:e,type:t,params:{action:"override"},onSuccess:()=>{r(),i()}}),o(!1)}},(0,h.__)("Override Moderation","hyve-lite")))):null};const V=["attachment"];let z=window.hyve.postTypes.filter((e=>!V.includes(e.value)));z.unshift({label:(0,h.__)("All","hyve-lite"),value:"any"});var q=({refresh:e,setAddPost:t})=>{const[n,r]=(0,s.useState)({}),[i,o]=(0,s.useState)([]),[c,u]=(0,s.useState)(!1),[d,m]=(0,s.useState)(!0),[y,v]=(0,s.useState)([]),[g,w]=(0,s.useState)(!1),[b,_]=(0,s.useState)(null),[E,x]=(0,s.useState)({type:"any",search:""}),{setTotalChunks:N}=(0,l.useDispatch)("hyve"),S=(0,l.useSelect)((e=>e("hyve").hasReachedLimit())),k=async()=>{m(!0);const e=L()(E),t=await p()({path:(0,P.addQueryArgs)(`${window.hyve.api}/data`,{offset:n[e]?.length||0,...E})});m(!1),r({...n,[e]:(n[e]||[]).concat(t.posts)}),u(t.more),N(t?.totalChunks)};(0,s.useEffect)((()=>{const e=setTimeout((()=>k()),1e3);return()=>clearTimeout(e)}),[E]);const I=(e,t)=>{x({...E,[e]:t})};return(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,null,(0,a.createElement)("div",{className:"items-center gap-4 flex shrink-0 h-12 px-4 py-0 border-b-[#ddd] border-b border-solid"},(0,a.createElement)(f.Button,{icon:"arrow-left-alt",hideLabel:!0,label:(0,h.__)("Back","hyve-lite"),onClick:()=>t(!1)}),(0,a.createElement)("h3",null,(0,h.__)("Add Data","hyve-lite"))),(0,a.createElement)(f.PanelRow,null,S&&(0,a.createElement)(f.Notice,{status:"warning",isDismissible:!1},(0,h.__)("You have reached the limit of posts that can be added to the Knowledge Base. Please delete existing posts if you wish to add more.","hyve-lite")),(0,a.createElement)("p",{className:"py-4"},(0,h.__)("Select posts that are informative, engaging, and relevant. These will be the building blocks that empower your chat assistant to deliver precise and helpful responses. Whether it is answering FAQs or diving into detailed explanations, the content you choose here will shape how effectively your assistant interacts with users.","hyve-lite")),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)("div",{className:"flex gap-4 pb-2"},(0,a.createElement)("div",{className:"w-1/4"},(0,a.createElement)(f.SelectControl,{label:(0,h.__)("Post Type","hyve-lite"),hideLabelFromVision:!0,className:"h-10",options:z,onChange:e=>I("type",e)})),(0,a.createElement)("div",{className:"w-3/4"},(0,a.createElement)(f.SearchControl,{label:(0,h.__)("Search for Posts","hyve-lite"),value:E.search,onChange:e=>I("search",e)}))),(0,a.createElement)(D,{posts:n[L()(E)]?.filter((e=>!i.includes(e.ID)))||[],isLoading:d,hasMore:c,onFetch:k,actions:[{label:(0,h.__)("Add","hyve-lite"),isBusy:y,onClick:async t=>{v((e=>[...e,t]));const a=n[L()(E)].find((e=>e.ID===t));await M({post:a,onSuccess:()=>{v((e=>e.filter((e=>e!==t)))),o((e=>[...e,t])),e()},onError:e=>{if("content_failed_moderation"===e?.code&&void 0!==e.review){const t={...a,review:e.review};_(t),w(!0)}v((e=>e.filter((e=>e!==t))))}})},isDisabled:S}]}))))),(0,a.createElement)(F,{post:b,isOpen:g,onClose:()=>{w(!1),v((e=>e.filter((e=>e!==b.ID))))},onSuccess:()=>{w(!1),v((e=>e.filter((e=>e!==b.ID)))),o((e=>[...e,b.ID]))}}))},Q=({title:e,description:t,campaign:n,children:r})=>(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4 relative"},r,(0,a.createElement)("div",{className:"w-full h-full absolute bg-white/75 flex justify-center items-center top-0"},(0,a.createElement)("div",{className:"flex flex-col items-center gap-2 p-6 rounded-lg bg-white shadow-lg"},(0,a.createElement)("div",{className:"text-xl font-bold"},e),(0,a.createElement)("p",null,t),(0,a.createElement)(f.Button,{variant:"primary",className:"mt-2",target:"_blank",href:O(window?.hyve?.pro,n)},(0,h.__)("Get Hyve Pro!","hyve-lite")))));const K=[{ID:1,title:(0,h.__)("Halloween Limited Time Deal Information","hyve-lite")},{ID:2,title:(0,h.__)("What to do if my order is missing an item?","hyve-lite")},{ID:3,title:(0,h.__)("How do I return an item?","hyve-lite")},{ID:4,title:(0,h.__)("How do I track my order?","hyve-lite")},{ID:5,title:(0,h.__)("How do I change my delivery address?","hyve-lite")},{ID:6,title:(0,h.__)("How do I cancel my order?","hyve-lite")}];const $=Array.from({length:5},((e,t)=>({id:t+1,title:`https://example.com/page${t+1}`})));var G=window.lodash;const Y={1:{url:"https://example.com/sitemap.xml",status:"queued"},2:{url:"https://example.com/sitemap.xml",status:"completed"},3:{url:"https://example.com/sitemap.xml",status:"completed"}};const W=[{question:(0,h.__)("How do I reset my password?","hyve-lite"),count:5},{question:(0,h.__)("How do I change my email address?","hyve-lite"),count:3},{question:(0,h.__)("How do I update my payment method?","hyve-lite"),count:2},{question:(0,h.__)("How do I cancel my subscription?","hyve-lite"),count:1},{question:(0,h.__)("How do I change my plan?","hyve-lite"),count:1},{question:(0,h.__)("How do I update my billing information?","hyve-lite"),count:1}];var Z=n(942),J=n.n(Z);const X=({onClick:e})=>(0,a.createElement)(f.Button,{onClick:e,className:"flex items-center justify-center p-4 h-auto w-full text-base font-normal text-gray-900 hover:text-gray-900 hover:bg-gray-100 border-t-gray-300 border-t-[0.5px] border-solid"},(0,a.createElement)("div",{className:"flex flex-row gap-1"},(0,h.__)("Load more","hyve-lite")));var ee=(0,g.jsx)(v.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,g.jsx)(v.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),te=({value:e,max:t=100,className:n})=>{const r=0<t?Math.round(e/t*100):0,i=J()("w-full h-5 border rounded-md border-solid bg-white border-light-gray relative overflow-hidden",n);return(0,a.createElement)("div",{className:i,role:"progressbar","aria-valuemin":"0","aria-valuemax":t,"aria-valuenow":e},(0,a.createElement)("div",{className:"absolute left-0 h-full bg-blue-500",style:{width:`${r}%`}}))};const ne=()=>(0,a.createElement)(Q,{title:(0,h.__)("Suggested Questions is a Premium feature","hyve-lite"),description:(0,h.__)("Get the conversation started with suggested questions. Upgrade now!","hyve-lite"),campaign:"suggested-questions-settings"},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.BaseControl,{label:(0,h.__)("Suggested Questions","hyve-lite")},(0,a.createElement)("p",{className:"components-base-control__help text-xs not-italic text-[rgb(117,117,117)] mt-[calc(8px)] mb-[revert]"},(0,h.__)("These questions will be displayed in the chat to get the conversation started.","hyve-lite")),(0,a.createElement)("div",{className:"overflow-y-auto max-h-96 flex flex-col gap-4"},Array.from({length:3}).map(((e,t)=>(0,a.createElement)(f.TextControl,{key:t,value:"",placeholder:(0,h.__)("e.g. Do you ship to Europe?","hyve-lite"),className:"flex-1",onChange:()=>{}})))))));const ae=[{label:(0,h.__)("Chat Background","hyve-lite"),value:"chat_background",default:"#ffffff"},{label:(0,h.__)("Assistant Background","hyve-lite"),value:"assistant_background",default:"#ecf1fb"},{label:(0,h.__)("User Background","hyve-lite"),value:"user_background",default:"#1155cc"},{label:(0,h.__)("Icon Background","hyve-lite"),value:"icon_background",default:"#1155cc"}];const re={home:{label:(0,h.__)("Dashboard","hyve-lite"),icon:w,component:()=>{const e=(0,l.useSelect)((e=>e("hyve").hasAPI())),{setRoute:t}=(0,l.useDispatch)("hyve");return e?(0,a.createElement)(A,null):(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4 relative"},(0,a.createElement)(A,null),(0,a.createElement)("div",{className:"w-full h-full absolute bg-white/75 flex justify-center items-center top-0"},(0,a.createElement)("div",{className:"flex flex-col items-center max-w-lg gap-2 p-6 rounded-lg bg-white shadow-lg"},(0,a.createElement)("p",{className:"py-2"},(0,h.__)("Welcome to Hyve! Designed to seamlessly integrate AI chat into your WordPress site, this plugin allows you to craft a personalized chat experience using your own posts and pages. Enjoy engaging with your website visitors through Hyve!","hyve-lite")),(0,a.createElement)("p",{className:"py-2"},(0,h.__)("To begin using the Hyve plugin, you'll need an OpenAI API key. This key enables Hyve to communicate with OpenAI's powerful language models, ensuring you get the best possible responses.","hyve-lite")),(0,a.createElement)("div",{className:"flex gap-4"},(0,a.createElement)(f.Button,{variant:"primary",className:"mt-2",onClick:()=>t("advanced")},(0,h.__)("Setup API Key","hyve-lite")),(0,a.createElement)(f.Button,{variant:"secondary",className:"mt-2",href:window?.hyve?.docs,target:"_blank"},(0,h.__)("Documentation","hyve-lite"))))))},disabled:!1},data:{label:(0,h.__)("Knowledge Base","hyve-lite"),icon:b,children:{data:{label:(0,h.__)("Knowledge Base","hyve-lite"),component:()=>{const[e,t]=(0,s.useState)(null),n=(0,y.applyFilters)("hyve.data",ie);if(e){const{component:r}=n[e];return(0,a.createElement)(r,{setView:t})}return(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Knowledge Base","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("A list of all the content that has been added to the Knowledge Base. It's the foundation that supports your chat assistant, enabling it to provide accurate and insightful responses.","hyve-lite")),(0,a.createElement)("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2 my-4"},Object.keys(n).map((e=>{const{label:r,description:i,icon:s,isPro:l=!1}=n[e];return(0,a.createElement)(f.Button,{key:r,className:"bg-white h-auto text-left overflow-hidden shadow border-[0.5px] border-gray-300 border-solid rounded-md cursor-pointer",onClick:()=>t(e)},(0,a.createElement)("div",{className:"px-4 py-5 w-full sm:p-6"},(0,a.createElement)("dl",null,(0,a.createElement)("dt",{className:"flex flex-row justify-between"},(0,a.createElement)("div",{className:"w-8"},s),l&&(0,a.createElement)("div",{className:"text-xs h-6 py-1 px-3 bg-blue-500 text-white uppercase font-bold rounded-full"},(0,h.__)("Pro","hyve-lite"))),(0,a.createElement)("dt",{className:"text-sm leading-5 font-medium py-4"},r," →"),(0,a.createElement)("dt",{className:"text-xs font-medium text-gray-500"},i))))}))))))}},update:{label:(0,h.__)("Requires Update","hyve-lite"),component:()=>{const[e,t]=(0,s.useState)([]),[n,r]=(0,s.useState)(!1),[i,o]=(0,s.useState)(!1),[c,u]=(0,s.useState)([]),[d,m]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),{setTotalChunks:g}=(0,l.useDispatch)("hyve"),w=async()=>{o(!0);const n=await p()({path:(0,P.addQueryArgs)(`${window.hyve.api}/data`,{offset:e?.length||0,status:"pending"})});o(!1),t([...e,...n.posts]),r(n.more),g(n?.totalChunks)};return(0,s.useEffect)((()=>{w()}),[]),(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Updated","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("Here, you'll see posts that have been updated since their addition to the Knowledge Base. This page allows you to review these updates and decide if you want to refresh the knowledge your assistant relies on.","hyve-lite")),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)(D,{posts:e||[],isLoading:i,hasMore:n,onFetch:w,actions:[{label:(0,h.__)("Update","hyve-lite"),isBusy:c,onClick:async n=>{u((e=>[...e,n]));const a=e.find((e=>e.ID===n));await M({post:a,params:{action:"update"},onSuccess:()=>{u((e=>e.filter((e=>e!==n)))),t((e=>e.filter((e=>e.ID!==n))))},onError:e=>{if("content_failed_moderation"===e?.code&&void 0!==e.review){const t={...a,review:e.review};v(t),m(!0)}u((e=>e.filter((e=>e!==n))))}})}}]}))))),(0,a.createElement)(F,{post:y,isOpen:d,onClose:()=>{m(!1),u((e=>e.filter((e=>e!==y.ID))))},onSuccess:()=>{m(!1),u((e=>e.filter((e=>e!==y.ID)))),t((e=>e.filter((e=>e.ID!==y.ID))))}}))}},flagged:{label:(0,h.__)("Failed Moderation","hyve-lite"),component:()=>{const[e,t]=(0,s.useState)([]),[n,r]=(0,s.useState)(!1),[i,o]=(0,s.useState)(!1),[c,u]=(0,s.useState)([]),[d,m]=(0,s.useState)(!1),[y,v]=(0,s.useState)(null),{setTotalChunks:g}=(0,l.useDispatch)("hyve"),w=async()=>{o(!0);const n=await p()({path:(0,P.addQueryArgs)(`${window.hyve.api}/data`,{offset:e?.length||0,status:"moderation"})});o(!1),t([...e,...n.posts]),r(n.more),g(n?.totalChunks)};return(0,s.useEffect)((()=>{w()}),[]),(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Failed Moderation","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("On this page, you'll find posts and pages that could not be added or updated due to non-compliance with content policies. Review these to understand the limitations and possibly modify content to align with required standards. You can also adjust the moderation threshold in the Settings.","hyve-lite")),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)(D,{posts:e||[],isLoading:i,hasMore:n,onFetch:w,actions:[{label:(0,h.__)("More Info","hyve-lite"),isBusy:c,variant:"secondary",onClick:t=>{const n=e.find((e=>e.ID===t));m(!0),v(n)}},{label:(0,h.__)("Update","hyve-lite"),isBusy:c,onClick:async n=>{u((e=>[...e,n]));const a=e.find((e=>e.ID===n));await M({post:a,params:{action:"update"},onSuccess:()=>{u((e=>e.filter((e=>e!==n)))),t((e=>e.filter((e=>e.ID!==n))))},onError:e=>{if("content_failed_moderation"===e?.code&&void 0!==e.review){const t={...a,review:e.review};v(t),m(!0)}u((e=>e.filter((e=>e!==n))))}})}}]}))))),(0,a.createElement)(F,{post:y,isOpen:d,onClose:()=>{m(!1),u((e=>e.filter((e=>e!==y.ID))))},onSuccess:()=>{t((e=>e.filter((e=>e.ID!==y.ID)))),u((e=>e.filter((e=>e!==y.ID))))}}))}},faq:{label:(0,h.__)("FAQ","hyve-lite"),component:()=>(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("FAQ","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("The FAQ captures frequently asked questions that went unanswered by our chatbot, providing you with a valuable insight into what your users are seeking. This feature allows you to review these queries and decide whether to incorporate them into your bot's knowledge base. By actively updating your FAQ, you can continuously refine your chatbot's ability to address user needs effectively and enhance their interactive experience. These aren't updated instantly.","hyve-lite")),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)(Q,{title:(0,h.__)("FAQ is a Premium feature","hyve-lite"),description:(0,h.__)("Review unanswered questions, enhance your bot's knowledge base, and refine your users' interactive experience. Upgrade now!","hyve-lite"),campaign:"faq-feature"},(0,a.createElement)("div",{className:"flex flex-col"},(0,a.createElement)("div",{className:"bg-gray-50 px-6 py-3 text-left text-xs text-gray-700 uppercase"},(0,a.createElement)("div",{className:"flex"},(0,a.createElement)("div",{className:"flex-1"},(0,h.__)("Title","hyve-lite")),(0,a.createElement)("div",{className:"w-1/6"},(0,h.__)("Count","hyve-lite")),(0,a.createElement)("div",{className:"w-1/6 flex justify-center"},(0,h.__)("Action","hyve-lite")))),(0,a.createElement)("div",{className:"flex flex-col"},W?.map(((e,t)=>(0,a.createElement)("div",{key:t,className:"flex items-center bg-white px-6 py-4 border-b text-sm text-gray-500"},(0,a.createElement)("div",{className:"flex-1 text-left rtl:text-right overflow-hidden"},(0,a.createElement)("span",{className:"max-w-full text-ellipsis overflow-hidden"},e.question)),(0,a.createElement)("div",{className:"w-1/6"},e.count),(0,a.createElement)("div",{className:"w-1/6 text-center flex gap-4"},(0,a.createElement)(f.Button,{variant:"secondary",onClick:()=>{},className:"w-20 justify-center"},(0,h.__)("Delete","hyve-lite")),(0,a.createElement)(f.Button,{variant:"primary",onClick:()=>{},className:"w-20 justify-center"},(0,h.__)("Add","hyve-lite"))))))))))))),isPro:!0}}},messages:{label:(0,h.__)("Messages","hyve-lite"),icon:_,component:()=>{const[e,t]=(0,s.useState)([]),[n,r]=(0,s.useState)(null),[i,l]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!1),[u,d]=(0,s.useState)(!0),m=async()=>{d(!0);const n=await p()({path:(0,P.addQueryArgs)(`${window.hyve.api}/threads`,{offset:e?.length||0})});d(!1),t(e.concat(n.posts)),l(n.more)};return(0,s.useEffect)((()=>{m()}),[]),(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},o&&(0,a.createElement)(f.Modal,{onRequestClose:()=>c(!1),className:"md:max-w-3xl md:w-full overflow-hidden"},(0,a.createElement)(Q,{title:(0,h.__)("Message History is a Premium feature","hyve-lite"),description:(0,h.__)("Upgrade to Hyve Premium to unlock entire Message History feature and many more.","hyve-lite"),campaign:"messages-feature"},(0,a.createElement)("img",{className:"border-t-gray-300 border-t-[0.5px] border-x-0 border-b-0 border-solid",src:`${window?.hyve?.assets?.images}threads.png`}))),(0,a.createElement)(f.Panel,{header:(0,h.__)("Messages","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("Here you can see an history of all the messages between Hyve and your users.","hyve-lite")),u&&!e?.length&&(0,a.createElement)("div",{className:"flex justify-center items-center h-52 border-[0.5px] border-gray-300 border-solid"},(0,a.createElement)(f.Spinner,null)),!u&&!e?.length&&(0,a.createElement)("div",{className:"flex justify-center items-center h-52 border-[0.5px] border-gray-300 border-solid"},(0,a.createElement)("p",{className:"text-xs"},(0,h.__)("Messsages between Hyve and your users will appear here","hyve-lite"))),(!u&&e&&0<e.length||e&&0<e.length)&&(0,a.createElement)("div",{className:"grid grid-cols-6 relative border-[0.5px] border-gray-300 border-solid"},(!u||e&&0<e.length)&&(0,a.createElement)("div",{className:"col-span-6 xl:col-span-2 border-r-gray-300 border-r-[0.5px] border-solid max-h-[672px] overflow-scroll"},e?.map(((e,t)=>(0,a.createElement)(f.Button,{key:e.ID,onClick:()=>r(e),className:J()("flex items-center p-4 h-auto w-full text-base font-normal text-gray-900 hover:text-gray-900 hover:bg-gray-100",{"bg-gray-100 hover:text-gray-900":n?.ID===e.ID,"border-t-gray-300 border-t-[0.5px] border-solid":0!==t})},(0,a.createElement)("div",{className:"flex flex-col items-start gap-1"},(0,a.createElement)("span",{className:"text-sm overflow-hidden text-ellipsis text-left"},e.title),(0,a.createElement)("span",{className:"text-xs text-gray-500"},R(e.date)))))),i&&(0,y.applyFilters)("hyve.messages.load-more",(0,a.createElement)(X,{onClick:()=>c(!0)}),u,m)),(0,a.createElement)("div",{className:"flex flex-col col-span-6 xl:col-span-4 p-4 max-h-[672px]"},!n&&(0,a.createElement)("div",{className:"flex justify-center w-full h-full items-center"},(0,a.createElement)("p",{className:"text-xs"},(0,h.__)("Select a message to view the conversation","hyve-lite"))),n&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"flex justify-between pb-3 border-b-gray-300 border-b-[0.5px] border-solid"},(0,a.createElement)("h2",{className:"text-xs font-semibold"},(0,h.__)("Thread ID","hyve-lite")),(0,a.createElement)("p",{className:"text-xs text-gray-500"},n?.thread_id?.replace("thread_",""))),(0,a.createElement)("div",{className:"overflow-scroll"},n?.thread&&0<n?.thread?.length&&n?.thread.map(((e,t)=>{const n=R(1e3*e.time);return"bot"===e.sender?(0,a.createElement)("div",{key:t,className:"text-black max-w-[75%] min-w-[50%] flex flex-col items-start mr-auto my-3.5"},(0,a.createElement)("p",{className:"hyve-chat-message text-[13px] flex flex-col w-full break-words bg-[#ecf1fb] justify-start m-0 p-2.5 rounded-md",dangerouslySetInnerHTML:{__html:e.message}}),(0,a.createElement)("time",{className:"text-[10px] text-black p-1"},n)):"user"===e.sender?(0,a.createElement)("div",{key:t,className:"max-w-[75%] min-w-[50%] text-[white] flex flex-col items-end ml-auto my-3.5"},(0,a.createElement)("p",{className:"hyve-chat-message text-[13px] flex flex-col w-full break-words bg-[#1155cc] justify-end m-0 p-2.5 rounded-md"},e.message),(0,a.createElement)("time",{className:"text-[10px] text-black p-1"},n)):null})))))))))}},integrations:{label:(0,h.__)("Integrations","hyve-lite"),icon:E,children:{integrations:{label:(0,h.__)("Qdrant","hyve-lite"),component:()=>{var e,t;const n=(0,l.useSelect)((e=>e("hyve").getSettings())),r=(0,l.useSelect)((e=>e("hyve").isQdrantActive())),{setSetting:i,setQdrantStatus:o}=(0,l.useDispatch)("hyve"),{createNotice:c}=(0,l.useDispatch)("core/notices"),[u,d]=(0,s.useState)(!1),[m,y]=(0,s.useState)(!1),[v,g]=(0,s.useState)([]),w=async()=>{try{const e=await p()({path:`${window.hyve.api}/qdrant`});if(e.error)throw new Error(e.error);o(Boolean(e.status)),g(e.migration),e.migration?.in_progress&&setTimeout(w,1e4)}catch(e){c("error",e,{type:"snackbar",isDismissible:!0})}};return(0,s.useEffect)((()=>{w()}),[]),(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Qdrant Integration","hyve-lite")},!r&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("Use Qdrant to increase the Knowledge Base limit of Hyve. By integrating Qdrant, you can manage larger datasets and improve query performance for your website. To integrate Qdrant with your application, you'll need an API key and endpoint.","hyve-lite")),(0,a.createElement)("p",{className:"pt-0 pb-4"},(0,h.__)("Qdrant offers a free plan that supports thousands of data chunks, making it an excellent choice for most use cases without incurring additional costs.","hyve-lite")),(0,a.createElement)(f.ExternalLink,{href:window.hyve?.qdrant_docs,className:"text-blue-600"},(0,h.__)("Learn more about Qdrant","hyve-lite"))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.TextControl,{label:(0,h.__)("API Key","hyve-lite"),type:"password",value:n.qdrant_api_key||"",disabled:u,onChange:e=>i("qdrant_api_key",e)})),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.TextControl,{label:(0,h.__)("API Endpoint","hyve-lite"),type:"url",value:n.qdrant_endpoint||"",disabled:u,onChange:e=>i("qdrant_endpoint",e)})),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.Button,{variant:"primary",isBusy:u,disabled:u,className:"mt-2",onClick:async()=>{d(!0);try{const e=await p()({path:`${window.hyve.api}/settings`,method:"POST",data:{data:n}});if(e.error)throw new Error(e.error);await w(),c("success",(0,h.__)("Settings saved.","hyve-lite"),{type:"snackbar",isDismissible:!0})}catch(e){c("error",e,{type:"snackbar",isDismissible:!0})}d(!1)}},(0,h.__)("Connect","hyve-lite")))),r&&Boolean(v?.in_progress)&&(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("Migration in progress. Please wait while we process your data. This may take a couple of minutes.","hyve-lite")),(0,a.createElement)(te,{value:null!==(e=v?.current)&&void 0!==e?e:0,max:null!==(t=v?.total)&&void 0!==t?t:100})),r&&!Boolean(v?.in_progress)&&(0,a.createElement)(a.Fragment,null,m&&(0,a.createElement)(f.Modal,{title:(0,h.__)("Are you sure you want to disconnect Qdrant?","hyve-lite"),onRequestClose:()=>y(!1),size:"medium"},(0,a.createElement)("p",{className:"pt-2 pb-4"},(0,h.__)("If you proceed, all the data associated with this website will be deleted from Qdrant, and all the posts exceeding the Knowledge Base limit will be removed from the Knowledge Base.","hyve-lite")),(0,a.createElement)(f.Button,{variant:"primary",isDestructive:!0,isBusy:u,disabled:u,onClick:async()=>{d(!0);try{const e=await p()({path:`${window.hyve.api}/qdrant`,method:"POST"});if(e.error)throw new Error(e.error);o(!1),c("success",(0,h.__)("Qdrant disconnected.","hyve-lite"),{type:"snackbar",isDismissible:!0})}catch(e){c("error",e,{type:"snackbar",isDismissible:!0})}d(!1)}},(0,h.__)("Disconnect","hyve-lite"))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"pb-2 flex flex-row items-center"},(0,a.createElement)(f.Icon,{icon:ee,size:24,className:"fill-green-600 mr-2"}),(0,h.__)("Qdrant is connected and ready to use.","hyve-lite")),(0,a.createElement)(f.Button,{variant:"primary",isDestructive:!0,className:"mt-2",onClick:()=>y(!0)},(0,h.__)("Disconnect","hyve-lite"))))))}}}},settings:{label:(0,h.__)("Settings","hyve-lite"),icon:x,children:{settings:{label:(0,h.__)("General","hyve-lite"),component:()=>{const e=(0,l.useSelect)((e=>e("hyve").getSettings())),{setSetting:t}=(0,l.useDispatch)("hyve"),{createNotice:n}=(0,l.useDispatch)("core/notices"),[r,i]=(0,s.useState)(!1);return(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("General Settings","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,isBlock:!0,label:(0,h.__)("Enable Chat","hyve-lite"),value:Boolean(e.chat_enabled),onChange:e=>t("chat_enabled",Boolean(e))},(0,a.createElement)(f.__experimentalToggleGroupControlOption,{"aria-label":(0,h.__)("Enable Chat","hyve-lite"),label:(0,h.__)("Enable","hyve-lite"),showTooltip:!0,value:!0}),(0,a.createElement)(f.__experimentalToggleGroupControlOption,{"aria-label":(0,h.__)("Enable Chat","hyve-lite"),label:(0,h.__)("Disable","hyve-lite"),showTooltip:!0,value:!1}))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.TextControl,{label:(0,h.__)("Welcome Message","hyve-lite"),help:(0,h.__)("This message will be displayed when the chat is opened.","hyve-lite"),value:e.welcome_message||"",disabled:r,onChange:e=>t("welcome_message",e)})),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.TextControl,{label:(0,h.__)("Default Message","hyve-lite"),help:(0,h.__)("This message will return when the chat is unable to find an answer.","hyve-lite"),value:e.default_message||"",disabled:r,onChange:e=>t("default_message",e)})),(0,y.applyFilters)("hyve.suggestedQuestions",(0,a.createElement)(ne,null),r,e,t),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.Button,{variant:"primary",isBusy:r,disabled:r,className:"mt-2",onClick:async()=>{i(!0);try{const t=await p()({path:`${window.hyve.api}/settings`,method:"POST",data:{data:e}});if(t.error)throw new Error(t.error);n("success",(0,h.__)("Settings saved.","hyve-lite"),{type:"snackbar",isDismissible:!0})}catch(e){n("error",e,{type:"snackbar",isDismissible:!0})}i(!1)}},(0,h.__)("Save","hyve-lite")))))}},appearance:{label:(0,h.__)("Appearance","hyve-lite"),component:()=>(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Appearance Settings","hyve-lite")},(0,a.createElement)(Q,{title:(0,h.__)("Appearance customization is a Premium feature","hyve-lite"),description:(0,h.__)("Customize the look and feel of your chat box with our Premium subscription. Upgrade now!","hyve-lite"),campaign:"appearance-settings"},(0,a.createElement)(f.PanelRow,null,ae.map((e=>(0,a.createElement)(f.BaseControl,{key:e.value,label:e.label},(0,a.createElement)(f.ColorPalette,{colors:[],value:e.default,onChange:()=>{}}))))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.Button,{variant:"primary",className:"mt-2",onClick:()=>{}},(0,h.__)("Save","hyve-lite")))))),disabled:!0,isPro:!0},assistant:{label:(0,h.__)("Assistant","hyve-lite"),component:()=>{const e=(0,l.useSelect)((e=>e("hyve").getSettings())),{setSetting:t}=(0,l.useDispatch)("hyve"),{createNotice:n}=(0,l.useDispatch)("core/notices"),[r,i]=(0,s.useState)(!1);return(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Assistant Settings","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.SelectControl,{label:(0,h.__)("Model","hyve-lite"),help:(0,h.__)("What model to use for Chat.","hyve-lite"),options:[{label:(0,h.__)("GPT 4o Mini","hyve-lite"),value:"gpt-4o-mini"},{label:(0,h.__)("GPT 3.5 Turbo 0125","hyve-lite"),value:"gpt-3.5-turbo-0125"}],value:e.model,disabled:r,onChange:e=>t("chat_model",e)})),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.RangeControl,{label:(0,h.__)("Temperature","hyve-lite"),help:(0,h.__)("What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. We generally recommend altering this or temperature but not both.","hyve-lite"),initialPosition:e.temperature||1,max:2,min:.1,step:.1,value:e.temperature||1,disabled:r,onChange:e=>t("temperature",e)})),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.RangeControl,{label:(0,h.__)("Top P","hyve-lite"),help:(0,h.__)("What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.","hyve-lite"),initialPosition:e.top_p||1,max:1,min:.1,step:.1,value:e.top_p||1,disabled:r,onChange:e=>t("top_p",e)})),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.Button,{variant:"primary",isBusy:r,disabled:r,className:"mt-2",onClick:async()=>{i(!0);try{const t=await p()({path:`${window.hyve.api}/settings`,method:"POST",data:{data:e}});if(t.error)throw new Error(t.error);n("success",(0,h.__)("Settings saved.","hyve-lite"),{type:"snackbar",isDismissible:!0})}catch(e){n("error",e,{type:"snackbar",isDismissible:!0})}i(!1)}},(0,h.__)("Save","hyve-lite")))))},disabled:!0},moderation:{label:(0,h.__)("Moderation","hyve-lite"),component:()=>{const e=(0,l.useSelect)((e=>e("hyve").getSettings())),{setSetting:t}=(0,l.useDispatch)("hyve"),{createNotice:n}=(0,l.useDispatch)("core/notices"),[r,i]=(0,s.useState)(!1);return(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Moderation Settings","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("With the moderation functionality, you can check whether your content is potentially harmful. Users can use it to identify content that might be harmful and take action.","hyve-lite")),(0,a.createElement)("p",{className:"pt-2 pb-4"},(0,h.__)("Occasionally, OpenAI's Moderation system may incorrectly flag content as a violation—these are false positives. Such errors can occur because automated systems sometimes lack the necessary context to interpret nuances accurately. If your content is flagged but you believe it adheres to the guidelines, please manually review it. Should you determine it does not violate the content policies, you can also override the moderation decisions.","hyve-lite")),Object.keys(U).map((n=>(0,a.createElement)(f.RangeControl,{key:n,label:U[n].label,help:U[n].description,initialPosition:e?.moderation_threshold?.[n]/100||.5,max:1,min:0,step:.1,value:e?.moderation_threshold?.[n]/100,disabled:r,allowReset:!0,resetFallbackValue:U[n].default,className:"py-4",onChange:a=>{return r=n,i=a,void t("moderation_threshold",{...e.moderation_threshold,[r]:100*Number(i)});var r,i}})))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.Button,{variant:"primary",isBusy:r,disabled:r,className:"mt-2",onClick:async()=>{i(!0);try{const t=await p()({path:`${window.hyve.api}/settings`,method:"POST",data:{data:e}});if(t.error)throw new Error(t.error);n("success",(0,h.__)("Settings saved.","hyve-lite"),{type:"snackbar",isDismissible:!0})}catch(e){n("error",e,{type:"snackbar",isDismissible:!0})}i(!1)}},(0,h.__)("Save","hyve-lite")))))},disabled:!0},advanced:{label:(0,h.__)("Advanced","hyve-lite"),component:()=>{const e=(0,l.useSelect)((e=>e("hyve").getSettings())),{setHasAPI:t,setSetting:n}=(0,l.useDispatch)("hyve"),{createNotice:r}=(0,l.useDispatch)("core/notices"),[i,o]=(0,s.useState)(!1);return(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Advanced","hyve-lite")},(0,a.createElement)(f.PanelRow,null,(0,a.createElement)(f.BaseControl,{help:(0,h.__)("This plugin requires an OpenAI API key to function properly.","hyve-lite")},(0,a.createElement)(f.TextControl,{label:(0,h.__)("API Key","hyve-lite"),type:"password",value:e.api_key||"",disabled:i,onChange:e=>n("api_key",e)})),(0,a.createElement)(f.ExternalLink,{href:"https://platform.openai.com/api-keys",className:"flex mb-2 items-centertext-sm text-blue-600"},(0,h.__)("Get an API key","hyve-lite")),(0,a.createElement)(f.Button,{variant:"primary",isBusy:i,disabled:i,className:"mt-2",onClick:async()=>{o(!0);try{const n=await p()({path:`${window.hyve.api}/settings`,method:"POST",data:{data:e}});if(n.error)throw new Error(n.error);e.api_key?t(!0):t(!1),r("success",(0,h.__)("Settings saved.","hyve-lite"),{type:"snackbar",isDismissible:!0})}catch(e){r("error",e,{type:"snackbar",isDismissible:!0})}o(!1)}},(0,h.__)("Save","hyve-lite")))))},disabled:!1}}}},ie={posts:{label:(0,h.__)("WordPress","hyve-lite"),description:(0,h.__)("Import your WordPress content into the Knowledge Base.","hyve-lite"),icon:N,component:({setView:e})=>{const[t,n]=(0,s.useState)([]),[r,i]=(0,s.useState)(!1),[o,c]=(0,s.useState)(!0),[u,d]=(0,s.useState)([]),[m,y]=(0,s.useState)(!1),{createNotice:v}=(0,l.useDispatch)("core/notices"),{setTotalChunks:g}=(0,l.useDispatch)("hyve"),w=async()=>{c(!0);const e=await p()({path:(0,P.addQueryArgs)(`${window.hyve.api}/data`,{offset:t?.length||0,status:"included"})});c(!1),n(t.concat(e.posts)),i(e.more),g(e?.totalChunks)};return(0,s.useEffect)((()=>{w()}),[]),m?(0,a.createElement)(q,{refresh:w,setAddPost:y}):(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,null,(0,a.createElement)("div",{className:"items-center gap-4 flex shrink-0 h-12 px-4 py-0 border-b-[#ddd] border-b border-solid"},(0,a.createElement)(f.Button,{icon:"arrow-left-alt",hideLabel:!0,label:(0,h.__)("Back","hyve-lite"),onClick:()=>e(null)}),(0,a.createElement)("h3",null,(0,h.__)("WordPress Posts","hyve-lite"))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("All the content from your WordPress site that has been added to the Knowledge Base.","hyve-lite")),(0,a.createElement)("div",{className:"w-full flex justify-end"},(0,a.createElement)(f.Button,{variant:"primary",onClick:()=>y(!0)},(0,h.__)("Add Posts","hyve-lite"))),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)(D,{posts:t,isLoading:o,hasMore:r,onFetch:w,actions:[{label:(0,h.__)("Remove","hyve-lite"),isBusy:u,variant:"secondary",isDestructive:!0,onClick:async e=>{d([...u,e]),await p()({path:(0,P.addQueryArgs)(`${window.hyve.api}/data`,{id:e}),method:"DELETE"}),n(t.filter((t=>t.ID!==e))),v("success",(0,h.__)("Post has been removed.","hyve-lite"),{type:"snackbar",isDismissible:!0})}}]})))))}},custom:{label:(0,h.__)("Custom Data","hyve-lite"),description:(0,h.__)("Add custom data to your Knowledge Base.","hyve-lite"),icon:b,component:({setView:e})=>(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,null,(0,a.createElement)("div",{className:"items-center gap-4 flex shrink-0 h-12 px-4 py-0 border-b-[#ddd] border-b border-solid"},(0,a.createElement)(f.Button,{icon:"arrow-left-alt",hideLabel:!0,label:(0,h.__)("Back","hyve-lite"),onClick:()=>e(null)}),(0,a.createElement)("h3",null,(0,h.__)("Custom Data","hyve-lite"))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("Custom Data allows you to privately feed specific data directly into your chat bot without displaying this information on your public website. With this, you can equip your bot with unique, specialized knowledge that aligns with your business needs and customer queries.","hyve-lite")),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)(Q,{title:(0,h.__)("Custom Data is a Premium feature","hyve-lite"),description:(0,h.__)("Privately feed specific data directly into your chatbot, equipping specialized knowledge that aligns with your business needs and customer queries. Upgrade now!","hyve-lite"),campaign:"custom-data-feature"},(0,a.createElement)("div",{className:"flex gap-4 pb-4 flex-col"},(0,a.createElement)("div",{className:"w-full"},(0,a.createElement)(f.SearchControl,{label:(0,h.__)("Search for Posts","hyve-lite"),value:"",onChange:()=>{}})),(0,a.createElement)("div",{className:"w-full flex justify-end"},(0,a.createElement)(f.Button,{variant:"primary",onClick:()=>{}},(0,h.__)("Add Data","hyve-lite")))),(0,a.createElement)(D,{posts:K,isLoading:!1,hasMore:!1,onFetch:()=>{},actions:[{label:(0,h.__)("Edit","hyve-lite"),isBusy:[],onClick:()=>{},isDisabled:!1}]})))))),isPro:!0},url:{label:(0,h.__)("Website URL","hyve-lite"),description:(0,h.__)("Crawl URLs to add content to the Knowledge Base.","hyve-lite"),icon:S,component:({setView:e})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,null,(0,a.createElement)("div",{className:"items-center gap-4 flex shrink-0 h-12 px-4 py-0 border-b-[#ddd] border-b border-solid"},(0,a.createElement)(f.Button,{icon:"arrow-left-alt",hideLabel:!0,label:(0,h.__)("Back","hyve-lite"),onClick:()=>e(null)}),(0,a.createElement)("h3",null,(0,h.__)("Website URL","hyve-lite"))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)('This page allows you to add URLs to the Knowledge Base. You can add URLs to the Knowledge Base by entering the URL in the field below and clicking the "Crawl URL" button.',"hyve-lite")),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)(Q,{title:(0,h.__)("URL Crawling is a Premium feature","hyve-lite"),description:(0,h.__)("Use this tool to crawl a website and add its content to the Knowledge Base using the sitemap. Upgrade now!","hyve-lite"),campaign:"website-crawling-feature"},(0,a.createElement)("div",{className:"flex gap-4 pb-4 flex-col"},(0,a.createElement)("div",{className:"flex w-full items-end gap-4"},(0,a.createElement)(f.TextControl,{label:(0,h.__)("Website URL","hyve-lite"),placeholder:"https://",type:"url",className:"w-full",value:"",onChange:()=>{}}),(0,a.createElement)(f.Button,{variant:"secondary",onClick:()=>{}},(0,h.__)("Crawl URL","hyve-lite")))),(0,a.createElement)(D,{posts:$||[],isLoading:!1,hasMore:!1,onFetch:()=>{},actions:[{label:(0,h.__)("Delete","hyve-lite"),onClick:()=>{},isBusy:[],variant:"secondary",isDestructive:!0}]}))))))),isPro:!0},sitemap:{label:(0,h.__)("Sitemap","hyve-lite"),description:(0,h.__)("Add a sitemap to the Knowledge Base.","hyve-lite"),icon:E,component:({setView:e})=>(0,a.createElement)(a.Fragment,null,(0,a.createElement)("div",{className:"col-span-6 xl:col-span-4"},(0,a.createElement)(f.Panel,null,(0,a.createElement)("div",{className:"items-center gap-4 flex shrink-0 h-12 px-4 py-0 border-b-[#ddd] border-b border-solid"},(0,a.createElement)(f.Button,{icon:"arrow-left-alt",hideLabel:!0,label:(0,h.__)("Back","hyve-lite"),onClick:()=>e(null)}),(0,a.createElement)("h3",null,(0,h.__)("Sitemap","hyve-lite"))),(0,a.createElement)(f.PanelRow,null,(0,a.createElement)("p",{className:"py-4"},(0,h.__)("Use this tool to crawl a website and add its content to the Knowledge Base using the sitemap.","hyve-lite")),(0,a.createElement)("div",{className:"relative pt-4 pb-8 overflow-x-auto"},(0,a.createElement)(Q,{title:(0,h.__)("Sitemap Crawling is a Premium feature","hyve-lite"),description:(0,h.__)("Use this tool to crawl a website and add its content to the Knowledge Base using the sitemap. Upgrade now!","hyve-lite"),campaign:"sitemap-crawling-feature"},(0,a.createElement)("div",{className:"flex gap-4 pb-4 flex-col"},(0,a.createElement)("div",{className:"w-full flex justify-end"},(0,a.createElement)(f.Button,{variant:"primary",onClick:()=>{}},(0,h.__)("Add Sitemap","hyve-lite")))),(0,a.createElement)("div",{className:"flex flex-col"},(0,a.createElement)("div",{className:"bg-gray-50 px-6 py-3 text-left text-xs text-gray-700 uppercase"},(0,a.createElement)("div",{className:"flex"},(0,a.createElement)("div",{className:"flex-1"},(0,h.__)("Sitemap URL","hyve-lite")),(0,a.createElement)("div",{className:"w-1/6"},(0,h.__)("Status","hyve-lite")),(0,a.createElement)("div",{className:"w-1/6 flex justify-center"},(0,h.__)("Action","hyve-lite")))),(0,a.createElement)("div",{className:"flex flex-col"},Object.keys(Y).map((e=>(0,a.createElement)("div",{key:e,className:"flex items-center bg-white px-6 py-4 border-b text-sm text-gray-500"},(0,a.createElement)("div",{className:"flex-1 text-left rtl:text-right overflow-hidden"},(0,a.createElement)("span",{className:"max-w-full text-ellipsis overflow-hidden"},Y[e].url)),(0,a.createElement)("div",{className:"w-1/6"},(0,G.capitalize)(Y[e].status)),(0,a.createElement)("div",{className:"w-1/6 flex justify-center"},(0,a.createElement)(f.Button,{onClick:()=>{},variant:"secondary",className:"w-20 justify-center"},(0,h.__)("Details","hyve-lite")))))))))))))),isPro:!0}};var se=(0,g.jsx)(v.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)(v.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),le=()=>{const e=(0,l.useSelect)((e=>e("hyve").getRoute())),t=(0,l.useSelect)((e=>e("hyve").hasAPI())),{setRoute:n}=(0,l.useDispatch)("hyve"),r=(0,y.applyFilters)("hyve.route",re);return(0,a.createElement)("div",{className:"col-span-6 xl:col-span-2"},(0,a.createElement)(f.Panel,{header:(0,h.__)("Menu","hyve-lite")},(0,a.createElement)("div",{className:"max-w-2xl mx-auto"},(0,a.createElement)("aside",{"aria-label":"Sidebar"},(0,a.createElement)("div",{className:"px-3 py-4 overflow-y-auto rounded bg-white"},(0,a.createElement)("ul",{className:"space-y-2"},Object.keys(r).map((i=>(0,a.createElement)("li",{key:i},(0,a.createElement)(f.Button,{onClick:()=>n(i),disabled:!t&&!1!==r[i]?.disabled,className:J()("flex items-center p-2 h-16 w-full text-base font-normal text-gray-900 hover:text-gray-900 rounded-lg hover:bg-gray-100",{"bg-gray-100 hover:text-gray-900":e===i})},(0,a.createElement)(f.Icon,{icon:r[i].icon,className:"w-6 h-6 text-gray-500 transition duration-75"}),(0,a.createElement)("span",{className:"ml-3"},r[i].label),r[i].children&&(0,a.createElement)(f.Icon,{icon:se,className:"w-6 h-6 ml-auto text-gray-500 transition duration-75"})),(r[i]?.children&&i===e||r[i]?.children&&Object.keys(r[i]?.children).includes(e))&&(0,a.createElement)("ul",{className:"py-2 space-y-2"},Object.keys(r[i].children).map((s=>(0,a.createElement)("li",{key:s},(0,a.createElement)(f.Button,{onClick:()=>n(s),disabled:!t&&!1!==r[i].children[s]?.disabled,className:J()("flex items-center justify-between w-full h-12 p-2 text-base font-normal text-gray-900 hover:text-gray-900 transition duration-75 rounded-lg group hover:bg-gray-100 pl-11",{"bg-gray-100 hover:text-gray-900":e===s})},r[i].children[s].label,r[i].children[s].isPro&&(0,a.createElement)("div",{className:"text-xs py-1 px-3 bg-blue-500 text-white uppercase font-bold rounded-full"},(0,h.__)("Pro","hyve-lite"))))))))))))))),t&&!window?.hyve?.license&&(0,a.createElement)(a.Fragment,null,(0,a.createElement)("br",null),(0,a.createElement)(f.Panel,null,(0,a.createElement)("div",{className:"flex flex-col items-center justify-center py-8 px-4 rounded-lg"},(0,a.createElement)("div",{className:"text-center"},(0,a.createElement)("h3",{className:"text-lg font-semibold text-gray-800"},(0,h.__)("Upgrade to Premium","hyve-lite")),(0,a.createElement)("p",{className:"text-sm text-gray-500"},(0,h.__)("Unlock powerful features and enhance your chatbot experience.","hyve-lite"))),(0,a.createElement)(f.Button,{variant:"primary",className:"mt-4",target:"_blank",href:O(window?.hyve?.pro,"sidebar-banner")},(0,h.__)("Learn More","hyve-lite"))))))},oe=window.wp.notices,ce=()=>{const e=(0,l.useSelect)((e=>e(oe.store).getNotices().filter((e=>"snackbar"===e.type))),[]),{removeNotice:t}=(0,l.useDispatch)(oe.store);return(0,a.createElement)(f.SnackbarList,{className:"edit-site-notices",notices:e,onRemove:t})},ue=()=>{const e=(0,l.useSelect)((e=>e("hyve").hasLoaded())),t=(0,l.useSelect)((e=>e("hyve").getRoute())),{setSettings:n,setLoading:r,setRoute:i}=(0,l.useDispatch)("hyve");(0,s.useEffect)((()=>{(async()=>{const e=await p()({path:`${window.hyve.api}/settings`});n(e),r();const t=new Event("themeisle:banner:init");document.dispatchEvent(t)})();const e=new URLSearchParams(window.location.search).get("nav");e&&i(e)}),[]);const o=(0,y.applyFilters)("hyve.route",re),c=Object.keys(o).reduce(((e,t)=>(o[t].component&&(e[t]=o[t].component),o[t].children&&Object.keys(o[t].children).forEach((n=>{e[n]=o[t].children[n].component})),e)),{})[t]||null;return(0,a.createElement)(a.Fragment,null,!e&&(0,a.createElement)("div",{className:"flex items-center justify-center absolute w-full h-screen z-10 bg-white"},(0,a.createElement)(f.Spinner,null)),(0,a.createElement)("div",{className:"mx-auto max-w-screen-2xl p-4 md:p-6 2xl:p-10"},(0,a.createElement)("div",{id:"tsdk_banner",class:"hyve-banner mb-4 md:mb-6 2xl:mb-10 hidden"}),(0,a.createElement)("div",{className:"mx-auto max-w-270"},(0,a.createElement)("div",{className:"grid grid-cols-6 gap-8"},(0,a.createElement)(le,null),c&&(0,a.createElement)(c,null)))),(0,a.createElement)(ce,null))};window.hyveComponents={},window.hyveComponents.PostsTable=D,window.hyveComponents.PostModal=({action:e,post:t,onClose:n})=>{const[r,i]=(0,s.useState)({...t}),[o,c]=(0,s.useState)(!1),[u,d]=(0,s.useState)(!1),{createNotice:m}=(0,l.useDispatch)("core/notices"),y="edit"===e;return u?(0,a.createElement)(F,{post:r,type:"knowledge",isOpen:u,onClose:()=>{d(!1)},onSuccess:()=>{n(!0),d(!1)}}):(0,a.createElement)(f.Modal,{title:y?(0,h.__)("Edit Data","hyve-lite"):(0,h.__)("Add Data","hyve-lite"),onRequestClose:()=>n(!1),shouldCloseOnOverlayClick:!0,isOpen:!0,className:"md:max-w-3xl md:w-full"},(0,a.createElement)("div",{className:"flex flex-col gap-4"},(0,a.createElement)(f.TextControl,{label:(0,h.__)("Title","hyve-lite"),value:r?.title||"",disabled:o,onChange:e=>{i({...r,title:e})}}),(0,a.createElement)(f.TextareaControl,{label:(0,h.__)("Content","hyve-lite"),value:r?.content||"",rows:8,disabled:o,maxLength:4e3,onChange:e=>{i({...r,content:e})}}),(0,a.createElement)("div",{className:"flex"},y&&(0,a.createElement)(f.Button,{variant:"tertiary",isDestructive:!0,disabled:o,isBusy:o,onClick:async()=>{c(!0);const e=await p()({path:`${window.hyve.api}/knowledge/${r.ID}`,method:"POST",headers:{"X-HTTP-Method-Override":"DELETE"}});if(e.error)return m("error",e.error,{type:"snackbar",isDismissible:!0}),void c(!1);m("success",(0,h.__)("Post has been deleted.","hyve-lite"),{type:"snackbar",isDismissible:!0}),n(!0)}},(0,h.__)("Delete","hyve-lite")),(0,a.createElement)(f.Button,{variant:"primary",className:"ml-auto",disabled:o||!r.title||!r.content,isBusy:o,onClick:async()=>{c(!0),await M({post:r,type:"knowledge",onSuccess:()=>{n(!0),c(!1)},onError:e=>{if("content_failed_moderation"===e?.code&&void 0!==e.review){const t={...r,review:e.review};i(t),d(!0)}c(!1)}})}},y?(0,h.__)("Save","hyve-lite"):(0,h.__)("Add","hyve-lite")))))},i()((()=>{(0,s.createRoot)(document.getElementById("hyve-options")).render((0,a.createElement)(ue,null))}))},802:function(e){e.exports=function e(t,n,a){function r(s,l){if(!n[s]){if(!t[s]){if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}l=n[s]={exports:{}},t[s][0].call(l.exports,(function(e){return r(t[s][1][e]||e)}),l,l.exports,e,t,n,a)}return n[s].exports}for(var i=void 0,s=0;s<a.length;s++)r(a[s]);return r}({1:[function(e,t,n){(function(a,r,i,s,l,o,c,u,d){"use strict";var h=e("crypto");function m(e,t){var n;return void 0===(n="passthrough"!==(t=y(e,t)).algorithm?h.createHash(t.algorithm):new w).write&&(n.write=n.update,n.end=n.update),g(t,n).dispatch(e),n.update||n.end(""),n.digest?n.digest("buffer"===t.encoding?void 0:t.encoding):(e=n.read(),"buffer"!==t.encoding?e.toString(t.encoding):e)}(n=t.exports=m).sha1=function(e){return m(e)},n.keys=function(e){return m(e,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},n.MD5=function(e){return m(e,{algorithm:"md5",encoding:"hex"})},n.keysMD5=function(e){return m(e,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var p=h.getHashes?h.getHashes().slice():["sha1","md5"],f=(p.push("passthrough"),["buffer","hex","binary","base64"]);function y(e,t){var n={};if(n.algorithm=(t=t||{}).algorithm||"sha1",n.encoding=t.encoding||"hex",n.excludeValues=!!t.excludeValues,n.algorithm=n.algorithm.toLowerCase(),n.encoding=n.encoding.toLowerCase(),n.ignoreUnknown=!0===t.ignoreUnknown,n.respectType=!1!==t.respectType,n.respectFunctionNames=!1!==t.respectFunctionNames,n.respectFunctionProperties=!1!==t.respectFunctionProperties,n.unorderedArrays=!0===t.unorderedArrays,n.unorderedSets=!1!==t.unorderedSets,n.unorderedObjects=!1!==t.unorderedObjects,n.replacer=t.replacer||void 0,n.excludeKeys=t.excludeKeys||void 0,void 0===e)throw new Error("Object argument required.");for(var a=0;a<p.length;++a)p[a].toLowerCase()===n.algorithm.toLowerCase()&&(n.algorithm=p[a]);if(-1===p.indexOf(n.algorithm))throw new Error('Algorithm "'+n.algorithm+'" not supported. supported values: '+p.join(", "));if(-1===f.indexOf(n.encoding)&&"passthrough"!==n.algorithm)throw new Error('Encoding "'+n.encoding+'" not supported. supported values: '+f.join(", "));return n}function v(e){if("function"==typeof e)return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(e))}function g(e,t,n){function a(e){return t.update?t.update(e,"utf8"):t.write(e,"utf8")}return n=n||[],{dispatch:function(t){return this["_"+(null===(t=e.replacer?e.replacer(t):t)?"null":typeof t)](t)},_object:function(t){var r,s=Object.prototype.toString.call(t),l=/\[object (.*)\]/i.exec(s);if(l=(l=l?l[1]:"unknown:["+s+"]").toLowerCase(),0<=(s=n.indexOf(t)))return this.dispatch("[CIRCULAR:"+s+"]");if(n.push(t),void 0!==i&&i.isBuffer&&i.isBuffer(t))return a("buffer:"),a(t);if("object"===l||"function"===l||"asyncfunction"===l)return s=Object.keys(t),e.unorderedObjects&&(s=s.sort()),!1===e.respectType||v(t)||s.splice(0,0,"prototype","__proto__","constructor"),e.excludeKeys&&(s=s.filter((function(t){return!e.excludeKeys(t)}))),a("object:"+s.length+":"),r=this,s.forEach((function(n){r.dispatch(n),a(":"),e.excludeValues||r.dispatch(t[n]),a(",")}));if(!this["_"+l]){if(e.ignoreUnknown)return a("["+l+"]");throw new Error('Unknown object type "'+l+'"')}this["_"+l](t)},_array:function(t,r){r=void 0!==r?r:!1!==e.unorderedArrays;var i=this;if(a("array:"+t.length+":"),!r||t.length<=1)return t.forEach((function(e){return i.dispatch(e)}));var s=[];return r=t.map((function(t){var a=new w,r=n.slice();return g(e,a,r).dispatch(t),s=s.concat(r.slice(n.length)),a.read().toString()})),n=n.concat(s),r.sort(),this._array(r,!1)},_date:function(e){return a("date:"+e.toJSON())},_symbol:function(e){return a("symbol:"+e.toString())},_error:function(e){return a("error:"+e.toString())},_boolean:function(e){return a("bool:"+e.toString())},_string:function(e){a("string:"+e.length+":"),a(e.toString())},_function:function(t){a("fn:"),v(t)?this.dispatch("[native]"):this.dispatch(t.toString()),!1!==e.respectFunctionNames&&this.dispatch("function-name:"+String(t.name)),e.respectFunctionProperties&&this._object(t)},_number:function(e){return a("number:"+e.toString())},_xml:function(e){return a("xml:"+e.toString())},_null:function(){return a("Null")},_undefined:function(){return a("Undefined")},_regexp:function(e){return a("regex:"+e.toString())},_uint8array:function(e){return a("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint8clampedarray:function(e){return a("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},_int8array:function(e){return a("int8array:"),this.dispatch(Array.prototype.slice.call(e))},_uint16array:function(e){return a("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},_int16array:function(e){return a("int16array:"),this.dispatch(Array.prototype.slice.call(e))},_uint32array:function(e){return a("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},_int32array:function(e){return a("int32array:"),this.dispatch(Array.prototype.slice.call(e))},_float32array:function(e){return a("float32array:"),this.dispatch(Array.prototype.slice.call(e))},_float64array:function(e){return a("float64array:"),this.dispatch(Array.prototype.slice.call(e))},_arraybuffer:function(e){return a("arraybuffer:"),this.dispatch(new Uint8Array(e))},_url:function(e){return a("url:"+e.toString())},_map:function(t){return a("map:"),t=Array.from(t),this._array(t,!1!==e.unorderedSets)},_set:function(t){return a("set:"),t=Array.from(t),this._array(t,!1!==e.unorderedSets)},_file:function(e){return a("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},_blob:function(){if(e.ignoreUnknown)return a("[blob]");throw Error('Hashing Blob objects is currently not supported\n(see https://github.com/puleos/object-hash/issues/26)\nUse "options.replacer" or "options.ignoreUnknown"\n')},_domwindow:function(){return a("domwindow")},_bigint:function(e){return a("bigint:"+e.toString())},_process:function(){return a("process")},_timer:function(){return a("timer")},_pipe:function(){return a("pipe")},_tcp:function(){return a("tcp")},_udp:function(){return a("udp")},_tty:function(){return a("tty")},_statwatcher:function(){return a("statwatcher")},_securecontext:function(){return a("securecontext")},_connection:function(){return a("connection")},_zlib:function(){return a("zlib")},_context:function(){return a("context")},_nodescript:function(){return a("nodescript")},_httpparser:function(){return a("httpparser")},_dataview:function(){return a("dataview")},_signal:function(){return a("signal")},_fsevent:function(){return a("fsevent")},_tlswrap:function(){return a("tlswrap")}}}function w(){return{buf:"",write:function(e){this.buf+=e},end:function(e){this.buf+=e},read:function(){return this.buf}}}n.writeToStream=function(e,t,n){return void 0===n&&(n=t,t={}),g(t=y(e,t),n).dispatch(e)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(e,t,n){(function(e,t,a,r,i,s,l,o,c){!function(e){"use strict";var t="undefined"!=typeof Uint8Array?Uint8Array:Array,n="+".charCodeAt(0),a="/".charCodeAt(0),r="0".charCodeAt(0),i="a".charCodeAt(0),s="A".charCodeAt(0),l="-".charCodeAt(0),o="_".charCodeAt(0);function c(e){return(e=e.charCodeAt(0))===n||e===l?62:e===a||e===o?63:e<r?-1:e<r+10?e-r+26+26:e<s+26?e-s:e<i+26?e-i+26:void 0}e.toByteArray=function(e){var n,a;if(0<e.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.length,i=(r="="===e.charAt(r-2)?2:"="===e.charAt(r-1)?1:0,new t(3*e.length/4-r)),s=0<r?e.length-4:e.length,l=0;function o(e){i[l++]=e}for(n=0;n<s;n+=4,0)o((16711680&(a=c(e.charAt(n))<<18|c(e.charAt(n+1))<<12|c(e.charAt(n+2))<<6|c(e.charAt(n+3))))>>16),o((65280&a)>>8),o(255&a);return 2==r?o(255&(a=c(e.charAt(n))<<2|c(e.charAt(n+1))>>4)):1==r&&(o((a=c(e.charAt(n))<<10|c(e.charAt(n+1))<<4|c(e.charAt(n+2))>>2)>>8&255),o(255&a)),i},e.fromByteArray=function(e){var t,n,a,r,i=e.length%3,s="";function l(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,a=e.length-i;t<a;t+=3)s+=l((r=n=(e[t]<<16)+(e[t+1]<<8)+e[t+2])>>18&63)+l(r>>12&63)+l(r>>6&63)+l(63&r);switch(i){case 1:s=(s+=l((n=e[e.length-1])>>2))+l(n<<4&63)+"==";break;case 2:s=(s=(s+=l((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+l(n>>4&63))+l(n<<2&63)+"="}return s}}(void 0===n?this.base64js={}:n)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,a,r,i,s,l,o,c,u){var d=e("base64-js"),h=e("ieee754");function r(e,t,n){if(!(this instanceof r))return new r(e,t,n);var a,i,s,l,o=typeof e;if("base64"===t&&"string"==o)for(e=(l=e).trim?l.trim():l.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==o)a=I(e);else if("string"==o)a=r.byteLength(e,t);else{if("object"!=o)throw new Error("First argument needs to be a number, array or string.");a=I(e.length)}if(r._useTypedArrays?i=r._augment(new Uint8Array(a)):((i=this).length=a,i._isBuffer=!0),r._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(C(l=e)||r.isBuffer(l)||l&&"object"==typeof l&&"number"==typeof l.length)for(s=0;s<a;s++)r.isBuffer(e)?i[s]=e.readUInt8(s):i[s]=e[s];else if("string"==o)i.write(e,0,t);else if("number"==o&&!r._useTypedArrays&&!n)for(s=0;s<a;s++)i[s]=0;return i}function m(e,t,n,a){var r;if(a||(M("boolean"==typeof n,"missing or invalid endian"),M(null!=t,"missing offset"),M(t+1<e.length,"Trying to read beyond buffer length")),!((a=e.length)<=t))return n?(r=e[t],t+1<a&&(r|=e[t+1]<<8)):(r=e[t]<<8,t+1<a&&(r|=e[t+1])),r}function p(e,t,n,a){var r;if(a||(M("boolean"==typeof n,"missing or invalid endian"),M(null!=t,"missing offset"),M(t+3<e.length,"Trying to read beyond buffer length")),!((a=e.length)<=t))return n?(t+2<a&&(r=e[t+2]<<16),t+1<a&&(r|=e[t+1]<<8),r|=e[t],t+3<a&&(r+=e[t+3]<<24>>>0)):(t+1<a&&(r=e[t+1]<<16),t+2<a&&(r|=e[t+2]<<8),t+3<a&&(r|=e[t+3]),r+=e[t]<<24>>>0),r}function f(e,t,n,a){if(a||(M("boolean"==typeof n,"missing or invalid endian"),M(null!=t,"missing offset"),M(t+1<e.length,"Trying to read beyond buffer length")),!(e.length<=t))return 32768&(a=m(e,t,n,!0))?-1*(65535-a+1):a}function y(e,t,n,a){if(a||(M("boolean"==typeof n,"missing or invalid endian"),M(null!=t,"missing offset"),M(t+3<e.length,"Trying to read beyond buffer length")),!(e.length<=t))return 2147483648&(a=p(e,t,n,!0))?-1*(4294967295-a+1):a}function v(e,t,n,a){return a||(M("boolean"==typeof n,"missing or invalid endian"),M(t+3<e.length,"Trying to read beyond buffer length")),h.read(e,t,n,23,4)}function g(e,t,n,a){return a||(M("boolean"==typeof n,"missing or invalid endian"),M(t+7<e.length,"Trying to read beyond buffer length")),h.read(e,t,n,52,8)}function w(e,t,n,a,r){if(r||(M(null!=t,"missing value"),M("boolean"==typeof a,"missing or invalid endian"),M(null!=n,"missing offset"),M(n+1<e.length,"trying to write beyond buffer length"),L(t,65535)),!((r=e.length)<=n))for(var i=0,s=Math.min(r-n,2);i<s;i++)e[n+i]=(t&255<<8*(a?i:1-i))>>>8*(a?i:1-i)}function b(e,t,n,a,r){if(r||(M(null!=t,"missing value"),M("boolean"==typeof a,"missing or invalid endian"),M(null!=n,"missing offset"),M(n+3<e.length,"trying to write beyond buffer length"),L(t,4294967295)),!((r=e.length)<=n))for(var i=0,s=Math.min(r-n,4);i<s;i++)e[n+i]=t>>>8*(a?i:3-i)&255}function _(e,t,n,a,r){r||(M(null!=t,"missing value"),M("boolean"==typeof a,"missing or invalid endian"),M(null!=n,"missing offset"),M(n+1<e.length,"Trying to write beyond buffer length"),j(t,32767,-32768)),e.length<=n||w(e,0<=t?t:65535+t+1,n,a,r)}function E(e,t,n,a,r){r||(M(null!=t,"missing value"),M("boolean"==typeof a,"missing or invalid endian"),M(null!=n,"missing offset"),M(n+3<e.length,"Trying to write beyond buffer length"),j(t,2147483647,-2147483648)),e.length<=n||b(e,0<=t?t:4294967295+t+1,n,a,r)}function x(e,t,n,a,r){r||(M(null!=t,"missing value"),M("boolean"==typeof a,"missing or invalid endian"),M(null!=n,"missing offset"),M(n+3<e.length,"Trying to write beyond buffer length"),U(t,34028234663852886e22,-34028234663852886e22)),e.length<=n||h.write(e,t,n,a,23,4)}function N(e,t,n,a,r){r||(M(null!=t,"missing value"),M("boolean"==typeof a,"missing or invalid endian"),M(null!=n,"missing offset"),M(n+7<e.length,"Trying to write beyond buffer length"),U(t,17976931348623157e292,-17976931348623157e292)),e.length<=n||h.write(e,t,n,a,52,8)}n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),r.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.isBuffer=function(e){return!(null==e||!e._isBuffer)},r.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=A(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=P(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw new Error("Unknown encoding")}return n},r.concat=function(e,t){if(M(C(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new r(0);if(1===e.length)return e[0];if("number"!=typeof t)for(i=t=0;i<e.length;i++)t+=e[i].length;for(var n=new r(t),a=0,i=0;i<e.length;i++){var s=e[i];s.copy(n,a),a+=s.length}return n},r.prototype.write=function(e,t,n,a){isFinite(t)?isFinite(n)||(a=n,n=void 0):(c=a,a=t,t=n,n=c),t=Number(t)||0;var i,s,l,o,c=this.length-t;switch((!n||c<(n=Number(n)))&&(n=c),a=String(a||"utf8").toLowerCase()){case"hex":i=function(e,t,n,a){n=Number(n)||0;var i=e.length-n;(!a||i<(a=Number(a)))&&(a=i),M((i=t.length)%2==0,"Invalid hex string"),i/2<a&&(a=i/2);for(var s=0;s<a;s++){var l=parseInt(t.substr(2*s,2),16);M(!isNaN(l),"Invalid hex string"),e[n+s]=l}return r._charsWritten=2*s,s}(this,e,t,n);break;case"utf8":case"utf-8":s=this,l=t,o=n,i=r._charsWritten=D(A(e),s,l,o);break;case"ascii":case"binary":i=function(e,t,n,a){return r._charsWritten=D(function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}(t),e,n,a)}(this,e,t,n);break;case"base64":s=this,l=t,o=n,i=r._charsWritten=D(P(e),s,l,o);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=function(e,t,n,a){return r._charsWritten=D(function(e){for(var t,n,a=[],r=0;r<e.length;r++)t=(n=e.charCodeAt(r))>>8,n%=256,a.push(n),a.push(t);return a}(t),e,n,a)}(this,e,t,n);break;default:throw new Error("Unknown encoding")}return i},r.prototype.toString=function(e,t,n){var a,r,i,s,l=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):l.length)===t)return"";switch(e){case"hex":a=function(e,t,n){var a=e.length;(!t||t<0)&&(t=0),(!n||n<0||a<n)&&(n=a);for(var r="",i=t;i<n;i++)r+=B(e[i]);return r}(l,t,n);break;case"utf8":case"utf-8":a=function(e,t,n){var a="",r="";n=Math.min(e.length,n);for(var i=t;i<n;i++)e[i]<=127?(a+=T(r)+String.fromCharCode(e[i]),r=""):r+="%"+e[i].toString(16);return a+T(r)}(l,t,n);break;case"ascii":case"binary":a=function(e,t,n){var a="";n=Math.min(e.length,n);for(var r=t;r<n;r++)a+=String.fromCharCode(e[r]);return a}(l,t,n);break;case"base64":r=l,s=n,a=0===(i=t)&&s===r.length?d.fromByteArray(r):d.fromByteArray(r.slice(i,s));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":a=function(e,t,n){for(var a=e.slice(t,n),r="",i=0;i<a.length;i+=2)r+=String.fromCharCode(a[i]+256*a[i+1]);return r}(l,t,n);break;default:throw new Error("Unknown encoding")}return a},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.copy=function(e,t,n,a){if(t=t||0,(a=a||0===a?a:this.length)!==(n=n||0)&&0!==e.length&&0!==this.length){M(n<=a,"sourceEnd < sourceStart"),M(0<=t&&t<e.length,"targetStart out of bounds"),M(0<=n&&n<this.length,"sourceStart out of bounds"),M(0<=a&&a<=this.length,"sourceEnd out of bounds"),a>this.length&&(a=this.length);var i=(a=e.length-t<a-n?e.length-t+n:a)-n;if(i<100||!r._useTypedArrays)for(var s=0;s<i;s++)e[s+t]=this[s+n];else e._set(this.subarray(n,n+i),t)}},r.prototype.slice=function(e,t){var n=this.length;if(e=k(e,n,0),t=k(t,n,n),r._useTypedArrays)return r._augment(this.subarray(e,t));for(var a=t-e,i=new r(a,void 0,!0),s=0;s<a;s++)i[s]=this[s+e];return i},r.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},r.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},r.prototype.readUInt8=function(e,t){if(t||(M(null!=e,"missing offset"),M(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return this[e]},r.prototype.readUInt16LE=function(e,t){return m(this,e,!0,t)},r.prototype.readUInt16BE=function(e,t){return m(this,e,!1,t)},r.prototype.readUInt32LE=function(e,t){return p(this,e,!0,t)},r.prototype.readUInt32BE=function(e,t){return p(this,e,!1,t)},r.prototype.readInt8=function(e,t){if(t||(M(null!=e,"missing offset"),M(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){return f(this,e,!0,t)},r.prototype.readInt16BE=function(e,t){return f(this,e,!1,t)},r.prototype.readInt32LE=function(e,t){return y(this,e,!0,t)},r.prototype.readInt32BE=function(e,t){return y(this,e,!1,t)},r.prototype.readFloatLE=function(e,t){return v(this,e,!0,t)},r.prototype.readFloatBE=function(e,t){return v(this,e,!1,t)},r.prototype.readDoubleLE=function(e,t){return g(this,e,!0,t)},r.prototype.readDoubleBE=function(e,t){return g(this,e,!1,t)},r.prototype.writeUInt8=function(e,t,n){n||(M(null!=e,"missing value"),M(null!=t,"missing offset"),M(t<this.length,"trying to write beyond buffer length"),L(e,255)),t>=this.length||(this[t]=e)},r.prototype.writeUInt16LE=function(e,t,n){w(this,e,t,!0,n)},r.prototype.writeUInt16BE=function(e,t,n){w(this,e,t,!1,n)},r.prototype.writeUInt32LE=function(e,t,n){b(this,e,t,!0,n)},r.prototype.writeUInt32BE=function(e,t,n){b(this,e,t,!1,n)},r.prototype.writeInt8=function(e,t,n){n||(M(null!=e,"missing value"),M(null!=t,"missing offset"),M(t<this.length,"Trying to write beyond buffer length"),j(e,127,-128)),t>=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},r.prototype.writeInt16LE=function(e,t,n){_(this,e,t,!0,n)},r.prototype.writeInt16BE=function(e,t,n){_(this,e,t,!1,n)},r.prototype.writeInt32LE=function(e,t,n){E(this,e,t,!0,n)},r.prototype.writeInt32BE=function(e,t,n){E(this,e,t,!1,n)},r.prototype.writeFloatLE=function(e,t,n){x(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){x(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){N(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){N(this,e,t,!1,n)},r.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,M("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),M(t<=n,"end < start"),n!==t&&0!==this.length){M(0<=t&&t<this.length,"start out of bounds"),M(0<=n&&n<=this.length,"end out of bounds");for(var a=t;a<n;a++)this[a]=e}},r.prototype.inspect=function(){for(var e=[],t=this.length,a=0;a<t;a++)if(e[a]=B(this[a]),a===n.INSPECT_MAX_BYTES){e[a+1]="...";break}return"<Buffer "+e.join(" ")+">"},r.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(r._useTypedArrays)return new r(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t<n;t+=1)e[t]=this[t];return e.buffer};var S=r.prototype;function k(e,t,n){return"number"!=typeof e?n:t<=(e=~~e)?t:0<=e||0<=(e+=t)?e:0}function I(e){return(e=~~Math.ceil(+e))<0?0:e}function C(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function A(e){for(var t=[],n=0;n<e.length;n++){var a=e.charCodeAt(n);if(a<=127)t.push(e.charCodeAt(n));else for(var r=n,i=(55296<=a&&a<=57343&&n++,encodeURIComponent(e.slice(r,n+1)).substr(1).split("%")),s=0;s<i.length;s++)t.push(parseInt(i[s],16))}return t}function P(e){return d.toByteArray(e)}function D(e,t,n,a){for(var r=0;r<a&&!(r+n>=t.length||r>=e.length);r++)t[r+n]=e[r];return r}function T(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function L(e,t){M("number"==typeof e,"cannot write a non-number as a number"),M(0<=e,"specified a negative value for writing an unsigned value"),M(e<=t,"value is larger than maximum value for type"),M(Math.floor(e)===e,"value has a fractional component")}function j(e,t,n){M("number"==typeof e,"cannot write a non-number as a number"),M(e<=t,"value larger than maximum allowed value"),M(n<=e,"value smaller than minimum allowed value"),M(Math.floor(e)===e,"value has a fractional component")}function U(e,t,n){M("number"==typeof e,"cannot write a non-number as a number"),M(e<=t,"value larger than maximum allowed value"),M(n<=e,"value smaller than minimum allowed value")}function M(e,t){if(!e)throw new Error(t||"Failed assertion")}r._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=S.get,e.set=S.set,e.write=S.write,e.toString=S.toString,e.toLocaleString=S.toString,e.toJSON=S.toJSON,e.copy=S.copy,e.slice=S.slice,e.readUInt8=S.readUInt8,e.readUInt16LE=S.readUInt16LE,e.readUInt16BE=S.readUInt16BE,e.readUInt32LE=S.readUInt32LE,e.readUInt32BE=S.readUInt32BE,e.readInt8=S.readInt8,e.readInt16LE=S.readInt16LE,e.readInt16BE=S.readInt16BE,e.readInt32LE=S.readInt32LE,e.readInt32BE=S.readInt32BE,e.readFloatLE=S.readFloatLE,e.readFloatBE=S.readFloatBE,e.readDoubleLE=S.readDoubleLE,e.readDoubleBE=S.readDoubleBE,e.writeUInt8=S.writeUInt8,e.writeUInt16LE=S.writeUInt16LE,e.writeUInt16BE=S.writeUInt16BE,e.writeUInt32LE=S.writeUInt32LE,e.writeUInt32BE=S.writeUInt32BE,e.writeInt8=S.writeInt8,e.writeInt16LE=S.writeInt16LE,e.writeInt16BE=S.writeInt16BE,e.writeInt32LE=S.writeInt32LE,e.writeInt32BE=S.writeInt32BE,e.writeFloatLE=S.writeFloatLE,e.writeFloatBE=S.writeFloatBE,e.writeDoubleLE=S.writeDoubleLE,e.writeDoubleBE=S.writeDoubleBE,e.fill=S.fill,e.inspect=S.inspect,e.toArrayBuffer=S.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(n,a,r,i,s,l,o,c,u){r=e("buffer").Buffer;var d=new r(4);d.fill(0),t.exports={hash:function(e,t,n,a){for(var i=t(function(e,t){e.length%4!=0&&(n=e.length+(4-e.length%4),e=r.concat([e,d],n));for(var n,a=[],i=t?e.readInt32BE:e.readInt32LE,s=0;s<e.length;s+=4)a.push(i.call(e,s));return a}(e=r.isBuffer(e)?e:new r(e),a),8*e.length),s=(t=a,new r(n)),l=t?s.writeInt32BE:s.writeInt32LE,o=0;o<i.length;o++)l.call(s,i[o],4*o,!0);return s}}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(e,t,n){(function(t,a,r,i,s,l,o,c,u){r=e("buffer").Buffer;var d=e("./sha"),h=e("./sha256"),m=e("./rng"),p={sha1:d,sha256:h,md5:e("./md5")},f=64,y=new r(f);function v(e,t){var n=p[e=e||"sha1"],a=[];return n||g("algorithm:",e,"is not yet supported"),{update:function(e){return r.isBuffer(e)||(e=new r(e)),a.push(e),e.length,this},digest:function(e){var i=r.concat(a);return i=t?function(e,t,n){r.isBuffer(t)||(t=new r(t)),r.isBuffer(n)||(n=new r(n)),t.length>f?t=e(t):t.length<f&&(t=r.concat([t,y],f));for(var a=new r(f),i=new r(f),s=0;s<f;s++)a[s]=54^t[s],i[s]=92^t[s];return n=e(r.concat([a,n])),e(r.concat([i,n]))}(n,t,i):n(i),a=null,e?i.toString(e):i}}}function g(){var e=[].slice.call(arguments).join(" ");throw new Error([e,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}y.fill(0),n.createHash=function(e){return v(e)},n.createHmac=v,n.randomBytes=function(e,t){if(!t||!t.call)return new r(m(e));try{t.call(this,void 0,new r(m(e)))}catch(e){t(e)}};var w,b=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],_=function(e){n[e]=function(){g("sorry,",e,"is not implemented yet")}};for(w in b)_(b[w])}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(e,t,n){(function(n,a,r,i,s,l,o,c,u){var d=e("./helpers");function h(e,t){e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;for(var n=1732584193,a=-271733879,r=-1732584194,i=271733878,s=0;s<e.length;s+=16){var l=n,o=a,c=r,u=i;n=p(n,a,r,i,e[s+0],7,-680876936),i=p(i,n,a,r,e[s+1],12,-389564586),r=p(r,i,n,a,e[s+2],17,606105819),a=p(a,r,i,n,e[s+3],22,-1044525330),n=p(n,a,r,i,e[s+4],7,-176418897),i=p(i,n,a,r,e[s+5],12,1200080426),r=p(r,i,n,a,e[s+6],17,-1473231341),a=p(a,r,i,n,e[s+7],22,-45705983),n=p(n,a,r,i,e[s+8],7,1770035416),i=p(i,n,a,r,e[s+9],12,-1958414417),r=p(r,i,n,a,e[s+10],17,-42063),a=p(a,r,i,n,e[s+11],22,-1990404162),n=p(n,a,r,i,e[s+12],7,1804603682),i=p(i,n,a,r,e[s+13],12,-40341101),r=p(r,i,n,a,e[s+14],17,-1502002290),n=f(n,a=p(a,r,i,n,e[s+15],22,1236535329),r,i,e[s+1],5,-165796510),i=f(i,n,a,r,e[s+6],9,-1069501632),r=f(r,i,n,a,e[s+11],14,643717713),a=f(a,r,i,n,e[s+0],20,-373897302),n=f(n,a,r,i,e[s+5],5,-701558691),i=f(i,n,a,r,e[s+10],9,38016083),r=f(r,i,n,a,e[s+15],14,-660478335),a=f(a,r,i,n,e[s+4],20,-405537848),n=f(n,a,r,i,e[s+9],5,568446438),i=f(i,n,a,r,e[s+14],9,-1019803690),r=f(r,i,n,a,e[s+3],14,-187363961),a=f(a,r,i,n,e[s+8],20,1163531501),n=f(n,a,r,i,e[s+13],5,-1444681467),i=f(i,n,a,r,e[s+2],9,-51403784),r=f(r,i,n,a,e[s+7],14,1735328473),n=y(n,a=f(a,r,i,n,e[s+12],20,-1926607734),r,i,e[s+5],4,-378558),i=y(i,n,a,r,e[s+8],11,-2022574463),r=y(r,i,n,a,e[s+11],16,1839030562),a=y(a,r,i,n,e[s+14],23,-35309556),n=y(n,a,r,i,e[s+1],4,-1530992060),i=y(i,n,a,r,e[s+4],11,1272893353),r=y(r,i,n,a,e[s+7],16,-155497632),a=y(a,r,i,n,e[s+10],23,-1094730640),n=y(n,a,r,i,e[s+13],4,681279174),i=y(i,n,a,r,e[s+0],11,-358537222),r=y(r,i,n,a,e[s+3],16,-722521979),a=y(a,r,i,n,e[s+6],23,76029189),n=y(n,a,r,i,e[s+9],4,-640364487),i=y(i,n,a,r,e[s+12],11,-421815835),r=y(r,i,n,a,e[s+15],16,530742520),n=v(n,a=y(a,r,i,n,e[s+2],23,-995338651),r,i,e[s+0],6,-198630844),i=v(i,n,a,r,e[s+7],10,1126891415),r=v(r,i,n,a,e[s+14],15,-1416354905),a=v(a,r,i,n,e[s+5],21,-57434055),n=v(n,a,r,i,e[s+12],6,1700485571),i=v(i,n,a,r,e[s+3],10,-1894986606),r=v(r,i,n,a,e[s+10],15,-1051523),a=v(a,r,i,n,e[s+1],21,-2054922799),n=v(n,a,r,i,e[s+8],6,1873313359),i=v(i,n,a,r,e[s+15],10,-30611744),r=v(r,i,n,a,e[s+6],15,-1560198380),a=v(a,r,i,n,e[s+13],21,1309151649),n=v(n,a,r,i,e[s+4],6,-145523070),i=v(i,n,a,r,e[s+11],10,-1120210379),r=v(r,i,n,a,e[s+2],15,718787259),a=v(a,r,i,n,e[s+9],21,-343485551),n=g(n,l),a=g(a,o),r=g(r,c),i=g(i,u)}return Array(n,a,r,i)}function m(e,t,n,a,r,i){return g((t=g(g(t,e),g(a,i)))<<r|t>>>32-r,n)}function p(e,t,n,a,r,i,s){return m(t&n|~t&a,e,t,r,i,s)}function f(e,t,n,a,r,i,s){return m(t&a|n&~a,e,t,r,i,s)}function y(e,t,n,a,r,i,s){return m(t^n^a,e,t,r,i,s)}function v(e,t,n,a,r,i,s){return m(n^(t|~a),e,t,r,i,s)}function g(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return d.hash(e,h,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(e,n,a,r,i,s,l,o,c){t.exports=function(e){for(var t,n=new Array(e),a=0;a<e;a++)!(3&a)&&(t=4294967296*Math.random()),n[a]=t>>>((3&a)<<3)&255;return n}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(n,a,r,i,s,l,o,c,u){var d=e("./helpers");function h(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,a,r,i=Array(80),s=1732584193,l=-271733879,o=-1732584194,c=271733878,u=-1009589776,d=0;d<e.length;d+=16){for(var h=s,f=l,y=o,v=c,g=u,w=0;w<80;w++){i[w]=w<16?e[d+w]:p(i[w-3]^i[w-8]^i[w-14]^i[w-16],1);var b=m(m(p(s,5),(b=l,a=o,r=c,(n=w)<20?b&a|~b&r:!(n<40)&&n<60?b&a|b&r|a&r:b^a^r)),m(m(u,i[w]),(n=w)<20?1518500249:n<40?1859775393:n<60?-1894007588:-899497514));u=c,c=o,o=p(l,30),l=s,s=b}s=m(s,h),l=m(l,f),o=m(o,y),c=m(c,v),u=m(u,g)}return Array(s,l,o,c,u)}function m(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function p(e,t){return e<<t|e>>>32-t}t.exports=function(e){return d.hash(e,h,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(n,a,r,i,s,l,o,c,u){function d(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function h(e,t){var n,a=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),r=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),i=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var s,l,o=0;o<e.length;o+=16){for(var c=r[0],u=r[1],h=r[2],m=r[3],y=r[4],v=r[5],g=r[6],w=r[7],b=0;b<64;b++)i[b]=b<16?e[b+o]:d(d(d((l=i[b-2],p(l,17)^p(l,19)^f(l,10)),i[b-7]),(l=i[b-15],p(l,7)^p(l,18)^f(l,3))),i[b-16]),n=d(d(d(d(w,p(l=y,6)^p(l,11)^p(l,25)),y&v^~y&g),a[b]),i[b]),s=d(p(s=c,2)^p(s,13)^p(s,22),c&u^c&h^u&h),w=g,g=v,v=y,y=d(m,n),m=h,h=u,u=c,c=d(n,s);r[0]=d(c,r[0]),r[1]=d(u,r[1]),r[2]=d(h,r[2]),r[3]=d(m,r[3]),r[4]=d(y,r[4]),r[5]=d(v,r[5]),r[6]=d(g,r[6]),r[7]=d(w,r[7])}return r}var m=e("./helpers"),p=function(e,t){return e>>>t|e<<32-t},f=function(e,t){return e>>>t};t.exports=function(e){return m.hash(e,h,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(e,t,a,r,i,s,l,o,c){n.read=function(e,t,n,a,r){var i,s,l=8*r-a-1,o=(1<<l)-1,c=o>>1,u=-7,d=n?r-1:0,h=n?-1:1;for(r=e[t+d],d+=h,i=r&(1<<-u)-1,r>>=-u,u+=l;0<u;i=256*i+e[t+d],d+=h,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=a;0<u;s=256*s+e[t+d],d+=h,u-=8);if(0===i)i=1-c;else{if(i===o)return s?NaN:1/0*(r?-1:1);s+=Math.pow(2,a),i-=c}return(r?-1:1)*s*Math.pow(2,i-a)},n.write=function(e,t,n,a,r,i){var s,l,o=8*i-r-1,c=(1<<o)-1,u=c>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,h=a?0:i-1,m=a?1:-1;for(i=t<0||0===t&&1/t<0?1:0,t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-s))<1&&(s--,a*=2),2<=(t+=1<=s+u?d/a:d*Math.pow(2,1-u))*a&&(s++,a/=2),c<=s+u?(l=0,s=c):1<=s+u?(l=(t*a-1)*Math.pow(2,r),s+=u):(l=t*Math.pow(2,u-1)*Math.pow(2,r),s=0));8<=r;e[n+h]=255&l,h+=m,l/=256,r-=8);for(s=s<<r|l,o+=r;0<o;e[n+h]=255&s,h+=m,s/=256,o-=8);e[n+h-m]|=128*i}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(e,t,n){(function(e,n,a,r,i,s,l,o,c){var u,d,h;function m(){}(e=t.exports={}).nextTick=(d="undefined"!=typeof window&&window.setImmediate,h="undefined"!=typeof window&&window.postMessage&&window.addEventListener,d?function(e){return window.setImmediate(e)}:h?(u=[],window.addEventListener("message",(function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0<u.length&&u.shift()())}),!0),function(e){u.push(e),window.postMessage("process-tick","*")}):function(e){setTimeout(e,0)}),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=m,e.addListener=m,e.once=m,e.off=m,e.removeListener=m,e.removeAllListeners=m,e.emit=m,e.binding=function(e){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(e){throw new Error("process.chdir is not supported")}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)},20:function(e,t,n){"use strict";var a=n(609),r=Symbol.for("react.element"),i=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function o(e,t,n){var a,o={},c=null,u=null;for(a in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,a)&&!l.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===o[a]&&(o[a]=t[a]);return{$$typeof:r,type:e,key:c,ref:u,props:o,_owner:s.current}}t.jsx=o,t.jsxs=o},848:function(e,t,n){"use strict";e.exports=n(20)},609:function(e){"use strict";e.exports=window.React},942:function(e,t){var n;!function(){"use strict";var a={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return r.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)a.call(e,n)&&e[n]&&(t=s(t,n));return t}function s(e,t){return t?e?e+" "+t:e+t:e}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()}},n={};function a(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,a),i.exports}a.m=t,e=[],a.O=function(t,n,r,i){if(!n){var s=1/0;for(u=0;u<e.length;u++){n=e[u][0],r=e[u][1],i=e[u][2];for(var l=!0,o=0;o<n.length;o++)(!1&i||s>=i)&&Object.keys(a.O).every((function(e){return a.O[e](n[o])}))?n.splice(o--,1):(l=!1,i<s&&(s=i));if(l){e.splice(u--,1);var c=r();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,r,i]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={57:0,350:0};a.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,i,s=n[0],l=n[1],o=n[2],c=0;if(s.some((function(t){return 0!==e[t]}))){for(r in l)a.o(l,r)&&(a.m[r]=l[r]);if(o)var u=o(a)}for(t&&t(n);c<s.length;c++)i=s[c],a.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return a.O(u)},n=self.webpackChunkhyve_lite=self.webpackChunkhyve_lite||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var r=a.O(void 0,[350],(function(){return a(779)}));r=a.O(r)}();