@yoast/ai-insights-client 1.4.36 → 1.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1291,5 +1291,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1291
1291
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wL(e,t){if(e){if(typeof e=="string")return Jm(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jm(e,t):void 0}}function Jm(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function SL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function CL(e){if(Array.isArray(e))return e}var _L=function(){var t,n=dn(),r=Fa(),i=Gt(),s=z.useState(),o=Eo(s,2),a=o[0],l=o[1],u=z.useState(!1),c=Eo(u,2),d=c[0],f=c[1],h=z.useState({name:"",url:"",description:"",language:"en",isLocal:!1,country:"",region:""}),g=Eo(h,2),m=g[0],p=g[1],v=z.useState(null),b=Eo(v,2),S=b[0],C=b[1],x=e4({mutation:{onSuccess:function(){var A=bL(ff().m(function D(H){var Q;return ff().w(function(F){for(;;)switch(F.n){case 0:return Q=H.data.id,F.n=1,Promise.all([i.invalidateQueries({queryKey:Lu()}),i.invalidateQueries({queryKey:Yn()})]);case 1:Q&&r.setBrandId(Q),H!=null&&H.status&&H.status>=200&&H.status<300&&Q&&(r.setBrandId(Q),l(Q));case 2:return F.a(2)}},D)}));function M(D){return A.apply(this,arguments)}return M}(),onError:function(){f(!1)}}}),k=x.mutate,w=x.isPending,_=x.error,O=Gi({query:{enabled:!!a,select:function(M){var D=M.data;return D==null?void 0:D.brands},refetchInterval:function(M){var D;return((M==null||(D=M.state)===null||D===void 0||(D=D.data)===null||D===void 0||(D=D.data)===null||D===void 0?void 0:D.brands)||[]).find(function(H){return H.id===a})?!1:2*1e3}}}),E=O.data;z.useEffect(function(){a&&E!==null&&E!==void 0&&E.find(function(A){return A.id===a})&&n("/setup/".concat(a,"/queries"),{replace:!0})},[a,E,n]);var T=function(M,D){p(function(H){return Xm(Xm({},H),{},tx({},M,D))})},j=function(M){if(M.preventDefault(),C(null),m.description.length>250){C("Your brand description is too long. Please keep it within the 250-character limit."),f(!1);return}f(!0);var D=m.url;D&&!/^https?:\/\//i.test(D)&&(D="https://".concat(D)),k({data:{name:m.name,url:D,description:m.description,focusLanguage:m.language,country:m.country,regionOrCity:m.region}})};function B(A){return Qr(A)==="object"&&A!==null&&"response"in A&&Qr(A.response)==="object"&&A.response!==void 0&&"data"in A.response}var R=B(_)?_.response.data.errors:void 0;return y.jsxs("form",{onSubmit:j,children:[y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(P.Title,{size:"2",children:"Brand info"}),!!_&&y.jsx(P.Alert,{variant:"error",title:"Error",isVisible:!!_,children:y.jsx("ul",{children:R&&Qr(R)==="object"?Object.entries(R).flatMap(function(A){var M=Eo(A,2),D=M[0],H=M[1];return Array.isArray(H)?H.map(function(Q,F){return y.jsx("li",{children:Q},"".concat(D,"-").concat(F))}):null}):"There was an error creating the brand."})}),S&&y.jsx(P.Alert,{variant:"error",title:"Error",isVisible:!!S,children:y.jsx("ul",{children:y.jsx("li",{children:"Your brand description is too long. Please keep it within the 250-character limit."})})}),y.jsx(P.TextField,{id:"name",label:"Brand name",value:m.name,onChange:function(A){return T("name",A.target.value)}}),y.jsx(P.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:m.url,onChange:function(A){return T("url",A.target.value)}}),y.jsxs("div",{id:"brand-description-textarea",children:[y.jsx(P.TextareaField,{id:"brand-description",label:"Brand description",value:m.description,onChange:function(A){var M=A.target.value;T("description",M)},...m.description.length>250?{validation:{variant:"error",message:"Your brand description is too long. Please keep it within the 250-character limit."}}:{},placeholder:"e.g. We design eco-friendly yoga mats for busy professionals who want sustainable gear that’s durable, stylish and kind to the planet."}),y.jsxs("div",{className:"yst-flex yst-mt-1",children:[y.jsxs("div",{className:"yst-flex-grow yst-flex-col",children:[m.description.length>250&&y.jsx("div",{className:"yst-text-red-500 yst-mb-2",children:"Your brand description is too long. Please keep it within the 250-character limit."}),"Tell us about your brand: what you do, who it’s for and what makes it special."]}),y.jsxs("div",{className:Oe("yst-text-xs yst-mt-[-4px] yst-ml-6",{"yst-text-slate-500":m.description.length<=250,"yst-text-red-500":m.description.length>250}),children:[m.description.length,"/250"]})]})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(P.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:m.language,onChange:function(A){return T("language",A)},options:mL.map(function(A){return{label:A.label,value:A.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Ha,{}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(P.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"Specify a location to enhance the accuracy of the analysis."}),y.jsx(P.Autocomplete,{className:"yst-max-w-sm",id:"country-select",label:"Target country (optional)",value:m.country,nullable:!0,placeholder:"Select...",onChange:function(A){return T("country",A)},onQueryChange:function(){},selectedLabel:((t=Qm.find(function(A){return A.value===m.country}))===null||t===void 0?void 0:t.label)||"",children:Qm.map(function(A){return y.jsx(P.Autocomplete.Option,{value:A.value,children:A.label},A.value)})}),m.country&&y.jsx(P.TextField,{id:"region",label:"Target city, state, or region (optional)",value:m.region,onChange:function(A){return T("region",A.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
|
|
1292
1292
|
example: California, Bavaria, or Paris.`})]}),y.jsx(ex,{onBack:function(){return n(-1)},buttonText:"Generate queries",isButtonDisabled:w||!!a||d,isLoading:w||!!a})]})};const kL=Object.freeze(Object.defineProperty({__proto__:null,default:_L},Symbol.toStringTag,{value:"Module"})),ep=e=>I.createElement("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},I.createElement("path",{d:"M3.33284 2V4.66667M1.99951 3.33333H4.66618M3.99951 11.3333V14M2.66618 12.6667H5.33284M8.66618 2L10.19 6.57143L13.9995 8L10.19 9.42857L8.66618 14L7.14237 9.42857L3.33284 8L7.14237 6.57143L8.66618 2Z",stroke:"url(#paint0_linear_3891_2757)",strokeWidth:1.33333,strokeLinecap:"round",strokeLinejoin:"round"}),I.createElement("defs",null,I.createElement("linearGradient",{id:"paint0_linear_3891_2757",x1:1.99951,y1:2,x2:15.3308,y2:3.72773,gradientUnits:"userSpaceOnUse"},I.createElement("stop",{stopColor:"#A61E69"}),I.createElement("stop",{offset:1,stopColor:"#6366F1"}))));function xa(e){"@babel/helpers - typeof";return xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(e)}function OL(e){return PL(e)||AL(e)||nx(e)||EL()}function EL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1293
1293
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AL(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function PL(e){if(Array.isArray(e))return gf(e)}function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tp(Object(n),!0).forEach(function(r){TL(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function TL(e,t,n){return(t=ML(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ML(e){var t=jL(e,"string");return xa(t)=="symbol"?t:t+""}function jL(e,t){if(xa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hf(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return nn(b,"_invoke",function(S,C,x){var k,w,_,O=0,E=x||[],T=!1,j={p:0,n:0,v:e,a:B,f:B.bind(e,4),d:function(A,M){return k=A,w=0,_=e,j.n=M,o}};function B(R,A){for(w=R,_=A,t=0;!T&&O&&!M&&t<E.length;t++){var M,D=E[t],H=j.p,Q=D[2];R>3?(M=Q===A)&&(_=D[(w=D[4])?5:(w=3,3)],D[4]=D[5]=e):D[0]<=H&&((M=R<2&&H<D[1])?(w=0,j.v=A,j.n=D[1]):H<Q&&(M=R<3||D[0]>A||A>Q)&&(D[4]=R,D[5]=A,j.n=Q,w=0))}if(M||R>1)return o;throw T=!0,A}return function(R,A,M){if(O>1)throw TypeError("Generator is already running");for(T&&A===1&&B(A,M),w=A,_=M;(t=w<2?e:_)||!T;){k||(w?w<3?(w>1&&(j.n=-1),B(w,_)):j.n=_:j.v=_);try{if(O=2,k){if(w||(R="next"),t=k[R]){if(!(t=t.call(k,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,w<2&&(w=0)}else w===1&&(t=k.return)&&t.call(k),w<2&&(_=TypeError("The iterator does not provide a '"+R+"' method"),w=1);k=e}else if((t=(T=j.n<0)?_:S.call(C,j))!==o)break}catch(D){k=e,w=1,_=D}finally{O=1}}return{value:t,done:T}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(nn(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,u):(h.__proto__=u,nn(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=u,nn(d,"constructor",u),nn(u,"constructor",l),l.displayName="GeneratorFunction",nn(u,i,"GeneratorFunction"),nn(d),nn(d,i,"Generator"),nn(d,r,function(){return this}),nn(d,"toString",function(){return"[object Generator]"}),(hf=function(){return{w:s,m:f}})()}function nn(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}nn=function(o,a,l,u){if(a)i?i(o,a,{value:l,enumerable:!u,configurable:!u,writable:!u}):o[a]=l;else{var c=function(f,h){nn(o,f,function(g){return this._invoke(f,h,g)})};c("next",0),c("throw",1),c("return",2)}},nn(e,t,n,r)}function np(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function $L(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){np(s,r,i,o,a,"next",l)}function a(l){np(s,r,i,o,a,"throw",l)}o(void 0)})}}function ui(e,t){return IL(e)||LL(e,t)||nx(e,t)||DL()}function DL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1294
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nx(e,t){if(e){if(typeof e=="string")return gf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gf(e,t):void 0}}function gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function LL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function IL(e){if(Array.isArray(e))return e}var is=5,Fo="Generating...",RL="Re-generating...",NL=100,FL=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],BL=Array.from({length:is},function(e,t){return{id:"query-".concat(t),text:Fo,isRegenerating:!0}}),qL=function(){var t,n=xu(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=dn(),o=Gt(),a=z.useState(BL),l=ui(a,2),u=l[0],c=l[1],d=z.useState(!1),f=ui(d,2),h=f[0],g=f[1],m=z.useState([]),p=ui(m,2),v=p[0],b=p[1],S=z.useState([]),C=ui(S,2),x=C[0],k=C[1],w=z.useState(!1),_=ui(w,2),O=_[0],E=_[1],T=z.useState(null),j=ui(T,2),B=j[0],R=j[1],A=z.useState(!1),M=ui(A,2),D=M[0],H=M[1],Q=g4(r||"",{query:{enabled:!!r}}),F=Q.data,G=Q.isRefetching,ie=Q.isError,ae=Q.refetch,N=Jl(r||"",{query:{enabled:!!r}}),le=N.data,te=z.useCallback(function(ue){var W;if(!(le!=null&&(W=le.data)!==null&&W!==void 0&&W.name))return!1;var ne=le.data.name.toLowerCase().trim();return ne?ue.toLowerCase().includes(ne):!1},[le==null||(t=le.data)===null||t===void 0?void 0:t.name]),me=z.useCallback(function(){return u.some(function(ue){return te(ue.text)})},[u,te]),J=function(){H(!1)},Ce=function(){H(!1),r&&oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})},ge=function(){H(!1);var W=u.findIndex(function(ne){return te(ne.text)});W!==-1&&setTimeout(function(){var ne=document.getElementById("query-text-".concat(W));ne&&(ne.focus(),ne.select())},NL)},ze=c4({mutation:{onSuccess:function(){var ue=$L(hf().m(function ne(ee){return hf().w(function(we){for(;;)switch(we.n){case 0:if(R(null),!(ee!=null&&ee.status&&ee.status>=200&&ee.status<300)){we.n=2;break}return we.n=1,Promise.all([o.invalidateQueries({queryKey:Tf(r||"")}),o.invalidateQueries({queryKey:Yn()})]);case 1:s(i);case 2:return we.a(2)}},ne)}));function W(ne){return ue.apply(this,arguments)}return W}(),onError:function(W){var ne,ee;if((W==null||(ne=W.response)===null||ne===void 0||(ne=ne.data)===null||ne===void 0?void 0:ne.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var we=(W==null||(ee=W.response)===null||ee===void 0||(ee=ee.data)===null||ee===void 0?void 0:ee.message)||(W==null?void 0:W.message)||"An unexpected error occurred.";R(we)}}}),oe=ze.mutate,He=ze.isPending;z.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),z.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var W=F.data.queries.slice(0,is);c(W.map(function(ne,ee){return{id:"query-".concat(ee),text:ne,isRegenerating:!1}})),k(F.data.queries.slice(is))}else ie&&(c(Array.from({length:is},function(ne,ee){return{id:"query-".concat(ee),text:"",isRegenerating:!1}})),k([]))},[F,ie]),z.useEffect(function(){var ue;if(O&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!G){var W=F.data.queries.slice(0,is),ne=v.map(Number);c(function(ee){return ee.map(function(we,gt){var Se=ne.indexOf(gt);return Pr(Pr({},we),{},{text:Se>=0&&W[Se]?W[Se]:we.text,isRegenerating:!1})})}),E(!1),b([])}},[F,G,O,v]);var lt=z.useCallback(function(ue,W){var ne=new Set(W);return x.filter(function(ee){return!ne.has(ee)}).slice(0,ue)},[x]),dt=z.useMemo(function(){return G||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Fo&&!ie||ue.text.trim()===""})||h},[G,u,h,ie]),Ne=G||u.some(function(ue){return ue.text===Fo})&&!ie,Fe=z.useCallback(function(ue){var W=ue.toString();b(function(ne){return ne.includes(W)?ne.filter(function(ee){return ee!==W}):[].concat(OL(ne),[W])})},[]),Y=z.useCallback(function(ue,W){c(function(ne){return ne.map(function(ee,we){return we===ue?Pr(Pr({},ee),{},{text:W}):ee})})},[]),Pe=function(){g(!h),b([])},tt=z.useCallback(function(){if(!(G||v.length===0)){c(function(ee){return ee.map(function(we,gt){return Pr(Pr({},we),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ee){return ee.text}),W=v.length,ne=lt(W,ue);ne.length===W?(c(function(ee){return ee.map(function(we,gt){var Se=v.indexOf(gt.toString());return Se>=0?Pr(Pr({},we),{},{text:ne[Se],isRegenerating:!1}):we})}),k(function(ee){var we=new Set(ne);return ee.filter(function(gt){return!we.has(gt)})}),b([])):(E(!0),ae())}},[G,v,ae,u,lt]),$e=z.useCallback(function(ue){if(ue.preventDefault(),!!r){if(me()){H(!0);return}oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})}},[r,u,oe,me]);return y.jsxs("div",{children:[B&&y.jsx(P.Alert,{className:"yst-mb-4",variant:"error",children:B}),y.jsxs("form",{onSubmit:$e,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(P.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(P.Button,{size:"small",variant:"secondary",onClick:Pe,children:"Done"}),y.jsxs(P.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:G,disabled:G||v.length===0,children:[y.jsx(ep,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(P.Button,{size:"small",variant:"secondary",onClick:Pe,className:"yst-gap-1.5",disabled:Ne,children:[y.jsx(q4,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:u.length===0?FL.map(function(ue,W){return y.jsx("div",{className:Oe("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(P.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(W))}):u.slice(0,is).map(function(ue,W){var ne=ue.isRegenerating?ue.text===Fo?Fo:RL:ue.text;return y.jsx("div",{className:Oe("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[h&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(P.Checkbox,{id:"query-regenerate-".concat(W),name:"query-regenerate-".concat(W),value:W.toString(),checked:v.includes(W.toString()),onChange:function(){return Fe(W)},disabled:G})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(P.TextField,{id:"query-text-".concat(W),label:"Query ".concat(W+1),type:"text",value:ne,onChange:function(ee){ue.isRegenerating||Y(W,ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,maxLength:255,validation:te(ue.text)?{variant:"warning",message:"For the best results, avoid using the brand name."}:void 0})})]})},ue.id)})}),y.jsx(ex,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(P.Modal,{isOpen:D,onClose:J,position:"center",as:"div",children:y.jsx(P.Modal.Panel,{children:y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:y.jsx(s2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),y.jsxs(P.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(P.Button,{onClick:Ce,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(ep,{}),"Run analysis anyway"]}),y.jsx(P.Button,{variant:"primary",onClick:ge,children:"Review and edit queries"})]})]})]})})})]})};const zL=Object.freeze(Object.defineProperty({__proto__:null,default:qL},Symbol.toStringTag,{value:"Module"}));var HL=["min","max","progress","className"];function UL(e,t){if(e==null)return{};var n,r,i=GL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rx=z.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=UL(e,HL),a=z.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:Oe(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});rx.displayName="ProgressBarGradient";var es=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],ix=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<es.length;u++)if(r<=es[u].threshold)return es[u];return es[es.length-1]},a=o();return y.jsxs("div",{className:Oe("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?y.jsx(P.Spinner,{}):y.jsx(d2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(rx,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:es.map(function(l){return y.jsx("span",{children:y.jsx(Nu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};ix.propTypes={progress:$d.number,className:$d.string};var KL=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},VL=function(){var t,n,r,i=dn(),s=Gt(),o=xu(),a=Rn(),l=a.brandId,u=o.brandId||l,c=Jl(u,{query:{enabled:!!u,select:function(C){var x=C.data;return x}}}),d=c.data,f=N5(u,"latest",{query:{enabled:!!u,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return KL(k==null?void 0:k.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);z.useEffect(function(){var S=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&h7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),z.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!S2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var S=80/p,C=v*S;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(ix,{progress:b}),y.jsx(Ha,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,x=S.id,k=S.query,w=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return y.jsxs("div",{className:Oe("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[w===!0?y.jsx(d2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(P.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(P.Button,{as:ti,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const WL=Object.freeze(Object.defineProperty({__proto__:null,default:VL},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=FA;exports.setApiBaseUrl=Zv;
|
|
1294
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nx(e,t){if(e){if(typeof e=="string")return gf(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gf(e,t):void 0}}function gf(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function LL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function IL(e){if(Array.isArray(e))return e}var is=5,Fo="Generating...",RL="Re-generating...",NL=100,FL=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],BL=Array.from({length:is},function(e,t){return{id:"query-".concat(t),text:Fo,isRegenerating:!0}}),qL=function(){var t,n=xu(),r=n.brandId,i="/setup/".concat(r,"/analysis"),s=dn(),o=Gt(),a=z.useState(BL),l=ui(a,2),u=l[0],c=l[1],d=z.useState(!1),f=ui(d,2),h=f[0],g=f[1],m=z.useState([]),p=ui(m,2),v=p[0],b=p[1],S=z.useState([]),C=ui(S,2),x=C[0],k=C[1],w=z.useState(!1),_=ui(w,2),O=_[0],E=_[1],T=z.useState(null),j=ui(T,2),B=j[0],R=j[1],A=z.useState(!1),M=ui(A,2),D=M[0],H=M[1],Q=g4(r||"",{query:{enabled:!!r}}),F=Q.data,G=Q.isRefetching,ie=Q.isError,ae=Q.refetch,N=Jl(r||"",{query:{enabled:!!r}}),le=N.data,te=z.useCallback(function(ue){var W;if(!(le!=null&&(W=le.data)!==null&&W!==void 0&&W.name))return!1;var ne=le.data.name.toLowerCase().trim();return ne?ue.toLowerCase().includes(ne):!1},[le==null||(t=le.data)===null||t===void 0?void 0:t.name]),me=z.useCallback(function(){return u.some(function(ue){return te(ue.text)})},[u,te]),J=function(){H(!1)},Ce=function(){H(!1),r&&oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})},ge=function(){H(!1);var W=u.findIndex(function(ne){return te(ne.text)});W!==-1&&setTimeout(function(){var ne=document.getElementById("query-text-".concat(W));ne&&(ne.focus(),ne.select())},NL)},ze=c4({mutation:{onSuccess:function(){var ue=$L(hf().m(function ne(ee){return hf().w(function(we){for(;;)switch(we.n){case 0:if(R(null),!(ee!=null&&ee.status&&ee.status>=200&&ee.status<300)){we.n=2;break}return we.n=1,Promise.all([o.invalidateQueries({queryKey:Tf(r||"")}),o.invalidateQueries({queryKey:Yn()})]);case 1:s(i);case 2:return we.a(2)}},ne)}));function W(ne){return ue.apply(this,arguments)}return W}(),onError:function(W){var ne,ee;if((W==null||(ne=W.response)===null||ne===void 0||(ne=ne.data)===null||ne===void 0?void 0:ne.message)==="Cannot update queries for a brand that has existing analyses."){s(i,{replace:!0});return}var we=(W==null||(ee=W.response)===null||ee===void 0||(ee=ee.data)===null||ee===void 0?void 0:ee.message)||(W==null?void 0:W.message)||"An unexpected error occurred.";R(we)}}}),oe=ze.mutate,He=ze.isPending;z.useEffect(function(){r||s("/setup",{replace:!0})},[r,s]),z.useEffect(function(){var ue;if(F!=null&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)){var W=F.data.queries.slice(0,is);c(W.map(function(ne,ee){return{id:"query-".concat(ee),text:ne,isRegenerating:!1}})),k(F.data.queries.slice(is))}else ie&&(c(Array.from({length:is},function(ne,ee){return{id:"query-".concat(ee),text:"",isRegenerating:!1}})),k([]))},[F,ie]),z.useEffect(function(){var ue;if(O&&F!==null&&F!==void 0&&(ue=F.data)!==null&&ue!==void 0&&ue.queries&&Array.isArray(F.data.queries)&&!G){var W=F.data.queries.slice(0,is),ne=v.map(Number);c(function(ee){return ee.map(function(we,gt){var Se=ne.indexOf(gt);return Pr(Pr({},we),{},{text:Se>=0&&W[Se]?W[Se]:we.text,isRegenerating:!1})})}),E(!1),b([])}},[F,G,O,v]);var lt=z.useCallback(function(ue,W){var ne=new Set(W);return x.filter(function(ee){return!ne.has(ee)}).slice(0,ue)},[x]),dt=z.useMemo(function(){return G||u.length===0||u.some(function(ue){return ue.isRegenerating||ue.text===Fo&&!ie||ue.text.trim()===""})||h},[G,u,h,ie]),Ne=G||u.some(function(ue){return ue.text===Fo})&&!ie,Fe=z.useCallback(function(ue){var W=ue.toString();b(function(ne){return ne.includes(W)?ne.filter(function(ee){return ee!==W}):[].concat(OL(ne),[W])})},[]),Y=z.useCallback(function(ue,W){c(function(ne){return ne.map(function(ee,we){return we===ue?Pr(Pr({},ee),{},{text:W}):ee})})},[]),Pe=function(){g(!h),b([])},tt=z.useCallback(function(){if(!(G||v.length===0)){c(function(ee){return ee.map(function(we,gt){return Pr(Pr({},we),{},{isRegenerating:v.includes(gt.toString())})})});var ue=u.map(function(ee){return ee.text}),W=v.length,ne=lt(W,ue);ne.length===W?(c(function(ee){return ee.map(function(we,gt){var Se=v.indexOf(gt.toString());return Se>=0?Pr(Pr({},we),{},{text:ne[Se],isRegenerating:!1}):we})}),k(function(ee){var we=new Set(ne);return ee.filter(function(gt){return!we.has(gt)})}),b([])):(E(!0),ae())}},[G,v,ae,u,lt]),$e=z.useCallback(function(ue){if(ue.preventDefault(),!!r){if(me()){H(!0);return}oe({brandId:r,data:{queries:u.map(function(W){return W.text})}})}},[r,u,oe,me]);return y.jsxs("div",{children:[B&&y.jsx(P.Alert,{className:"yst-mb-4",variant:"error",children:B}),y.jsxs("form",{onSubmit:$e,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(P.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Oe("yst-flex yst-gap-2",h?"yst-justify-end":"yst-justify-start"),children:h?y.jsxs(y.Fragment,{children:[y.jsx(P.Button,{size:"small",variant:"secondary",onClick:Pe,children:"Done"}),y.jsxs(P.Button,{variant:"secondary",size:"small",onClick:tt,className:"yst-gap-1",isLoading:G,disabled:G||v.length===0,children:[y.jsx(ep,{"aria-hidden":"true"}),"Regenerate selected queries"]})]}):y.jsxs(P.Button,{size:"small",variant:"secondary",onClick:Pe,className:"yst-gap-1.5",disabled:Ne,children:[y.jsx(q4,{}),"Select queries to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:u.length===0?FL.map(function(ue,W){return y.jsx("div",{className:Oe("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(P.SkeletonLoader,{children:ue||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(W))}):u.slice(0,is).map(function(ue,W){var ne=ue.isRegenerating?ue.text===Fo?Fo:RL:ue.text;return y.jsx("div",{className:Oe("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[h&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(P.Checkbox,{id:"query-regenerate-".concat(W),name:"query-regenerate-".concat(W),value:W.toString(),checked:v.includes(W.toString()),onChange:function(){return Fe(W)},disabled:G})}),y.jsx("div",{className:"yst-flex-1",children:y.jsx(P.TextField,{id:"query-text-".concat(W),label:"Query ".concat(W+1),type:"text",value:ne,onChange:function(ee){ue.isRegenerating||Y(W,ee.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:ue.isRegenerating,required:!0,maxLength:255,validation:te(ue.text)?{variant:"warning",message:"For more accurate insights, avoid using your brand name in the query."}:void 0})})]})},ue.id)})}),y.jsx(ex,{buttonText:"Run analysis (~ 5 minutes)",isButtonDisabled:dt,isLoading:He})]}),y.jsx(P.Modal,{isOpen:D,onClose:J,position:"center",as:"div",children:y.jsx(P.Modal.Panel,{children:y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-amber-100",children:y.jsx(s2,{className:"yst-h-6 yst-w-6 yst-text-amber-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(P.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(P.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:"Brand name detected in your queries"})}),y.jsxs(P.Modal.Container.Content,{className:"yst-mb-6 yst-space-y-3",children:[y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"We found your brand name in one or more of your queries. Using your brand name in queries often show more mentions and more positive sentiment, which can skew your results."}),y.jsx("p",{className:"yst-text-sm yst-text-slate-600",children:"For more balanced results, remove your brand name or make the queries more general."})]}),y.jsxs(P.Modal.Container.Footer,{className:"yst-flex yst-justify-end yst-gap-3",children:[y.jsxs(P.Button,{onClick:Ce,variant:"secondary",className:"yst-gap-1.5",disabled:He,isLoading:He,children:[y.jsx(ep,{}),"Run analysis anyway"]}),y.jsx(P.Button,{variant:"primary",onClick:ge,children:"Review and edit queries"})]})]})]})})})]})};const zL=Object.freeze(Object.defineProperty({__proto__:null,default:qL},Symbol.toStringTag,{value:"Module"}));var HL=["min","max","progress","className"];function UL(e,t){if(e==null)return{};var n,r,i=GL(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GL(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rx=z.forwardRef(function(e,t){var n=e.min,r=e.max,i=e.progress,s=e.className,o=UL(e,HL),a=z.useMemo(function(){var u=Math.max(0,r-n);if(u===0)return 0;var c=(i-n)/u*100;return Math.max(0,Math.min(100,c))},[n,r,i]),l=Math.min(Math.max(i,n),r);return y.jsx("div",{ref:t,role:"progressbar","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":"".concat(Math.round(a),"%"),className:Oe(s),...o,children:y.jsx("div",{className:"yst-relative yst-h-2 yst-w-full yst-overflow-hidden yst-rounded-full yst-bg-slate-200/40",children:y.jsx("div",{className:"yst-absolute yst-left-0 yst-top-0 yst-h-full yst-rounded-full yst-bg-[linear-gradient(97.38deg,_#A61E69_0%,_#6366F1_100%)] yst-transition-[width] yst-duration-300 yst-ease-out",style:{width:"".concat(a,"%")}})})})});rx.displayName="ProgressBarGradient";var es=[{labelAbove:"Running queries...",label:"Running queries",threshold:99},{labelAbove:"Done!",label:"Building analysis",threshold:100}],ix=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var u=0;u<es.length;u++)if(r<=es[u].threshold)return es[u];return es[es.length-1]},a=o();return y.jsxs("div",{className:Oe("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-center yst-gap-2",children:[r<100?y.jsx(P.Spinner,{}):y.jsx(d2,{className:"yst-text-green-400"}),y.jsx("span",{className:"yst-text-sm yst-font-medium yst-italic",children:a.labelAbove})]}),y.jsx(rx,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:es.map(function(l){return y.jsx("span",{children:y.jsx(Nu,{disabled:a.label!==l.label,children:l.label})},l.label)})})]})};ix.propTypes={progress:$d.number,className:$d.string};var KL=function(t){switch(t){case"pending":case"processing":return 2*1e3;case"completed":return!1;default:return 10*1e3}},VL=function(){var t,n,r,i=dn(),s=Gt(),o=xu(),a=Rn(),l=a.brandId,u=o.brandId||l,c=Jl(u,{query:{enabled:!!u,select:function(C){var x=C.data;return x}}}),d=c.data,f=N5(u,"latest",{query:{enabled:!!u,select:function(C){var x=C.data;return x},refetchInterval:function(C){var x,k=C==null||(x=C.state)===null||x===void 0||(x=x.data)===null||x===void 0?void 0:x.data;return KL(k==null?void 0:k.status)}}}),h=f.data,g=h==null?void 0:h.id,m=g?"/brands/".concat(u,"/analysis/").concat(g):"/brands/".concat(u);z.useEffect(function(){var S=(h==null?void 0:h.status)==="pending"||(h==null?void 0:h.status)==="processing"||(h==null?void 0:h.status)==="completed";d!=null&&d.nextScheduledAnalysis&&h!==null&&h!==void 0&&h.status&&h7(d.nextScheduledAnalysis,5)&&!S&&i("/brands/".concat(u),{replace:!0})},[d==null?void 0:d.nextScheduledAnalysis,u,i,h==null?void 0:h.status]),z.useEffect(function(){((d==null?void 0:d.setupStatus)==="completed"||(d==null?void 0:d.setupStatus)==="scheduledFirstAnalysis"&&d!==null&&d!==void 0&&d.firstNextAnalysisOpportunity&&!S2(d.firstNextAnalysisOpportunity,2))&&i(m,{replace:!0})},[d==null?void 0:d.firstNextAnalysisOpportunity,d==null?void 0:d.setupStatus,m,i]);var p=d==null||(t=d.queries)===null||t===void 0?void 0:t.length,v=(h==null||(n=h.completedQueries)===null||n===void 0?void 0:n.length)||0,b=function(){if(p&&p>0){var S=80/p,C=v*S;return(h==null?void 0:h.status)==="completed"?100:Math.round(Math.min(C,80))}return 0}();return y.jsxs("div",{children:[y.jsxs("div",{className:"yst-space-y-8",children:[y.jsx(ix,{progress:b}),y.jsx(Ha,{}),y.jsx("div",{className:"yst-space-y-8",children:d==null||(r=d.queries)===null||r===void 0?void 0:r.map(function(S){var C,x=S.id,k=S.query,w=x&&(h==null||(C=h.completedQueries)===null||C===void 0?void 0:C.includes(x));return y.jsxs("div",{className:Oe("yst-flex yst-items-center yst-justify-between yst-gap-3"),children:[w===!0?y.jsx(d2,{className:"yst-h-5 yst-w-5 yst-text-green-400"}):y.jsx(P.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:k})]},"result-item-".concat(k))})})]}),y.jsx("div",{className:"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem] yst-mt-8 yst-flex yst-justify-end yst-gap-4 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(P.Button,{as:ti,to:m,onClick:function(S){if(b!==100){S.preventDefault();return}s.clear()},disabled:b!==100,children:"Continue →"})})]})};const WL=Object.freeze(Object.defineProperty({__proto__:null,default:VL},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=FA;exports.setApiBaseUrl=Zv;
|
|
1295
1295
|
//# sourceMappingURL=ai-insights-client.cjs.js.map
|