PageSourceSearch

https://ad-intelligence-59ba7.web.app/chunk-O6MTGPT6.js

js ad-intelligence-59ba7.web.app collected 2026-10-03 12:16:16 UTC 50,485 bytes, 126 lines download raw bytes

1import{a as ft}from"./chunk-NSWNTHNA.js";import"./chunk-CETPSGRP.js";import{a as ut}from"./chunk-G34RTASZ.js";import"./chunk-DNHT7TIJ.js";import"./chunk-AG4QL2DO.js";import"./chunk-TBV4UZNX.js";import"./chunk-G3NM4LJ6.js";import{c as lt,h as pt}from"./chunk-7RA2IJ2E.js";import"./chunk-7FHUT3JE.js";import{a as rt,b as ct}from"./chunk-ORG6X553.js";import{a as et}from"./chunk-SV45VXJJ.js";import"./chunk-HUJARPMZ.js";import"./chunk-PU5YZGKQ.js";import"./chunk-OLHHGXZN.js";import"./chunk-DBA44QWQ.js";import{a as Ve}from"./chunk-3GDD2Y6P.js";import{m as H}from"./chunk-WDXC2KYD.js";import"./chunk-ONZKB5CH.js";import"./chunk-T4ZSFXYG.js";import{b as $e}from"./chunk-P47ABIHR.js";import"./chunk-53PDRIEQ.js";import"./chunk-QMZE6H57.js";import{b as dt}from"./chunk-UUZAEKOK.js";import{d as j}from"./chunk-OYWHTECT.js";import{a as Qe,b as Ze}from"./chunk-B6ML3TBS.js";import"./chunk-7VPF77TY.js";import{a as F}from"./chunk-4SSS2OJZ.js";import"./chunk-3XIPWIBB.js";import{b as qe,c as We,e as Xe}from"./chunk-WAWFYPMX.js";import{a as ot,b as at}from"./chunk-7MQTEMAJ.js";import"./chunk-HTCLQCOU.js";import"./chunk-6XPI5QYW.js";import"./chunk-YWMD53KQ.js";import"./chunk-A6AWQOXQ.js";import{C as st,c as tt,h as nt,l as it}from"./chunk-PJ5GV7IK.js";import{i as Le,o as Ne,q as Ke,w as Ge,x as Ue}from"./chunk-EDUSMAQY.js";import{Ab as $,Bb as V,Cb as Ae,Da as N,Fb as Oe,Gb as xe,Hb as ke,Ib as Re,Pa as te,Rb as B,Sb as Pe,Tb as Me,Ub as De,Xa as C,Ya as d,Za as l,_a as Ce,f as ve,fb as G,ha as Ie,ia as m,jb as I,k as _,lb as A,p as y,pb as Ee,q as v,qb as Se,rb as we,xa as Te,xb as U,zb as p}from"./chunk-FFQQO7O7.js";import{F as ee,G as he,L as me,Ra as be,Wb as ye,_a as _e,_b as w,n as Z}from"./chunk-ID4WHIPA.js";import{C as Ye,D as Fe,F as je,G as He,H as ze,J as Je,M as Y,O as ne,u as Be}from"./chunk-QUA7QOZA.js";import"./chunk-C6Q5SG76.js";var gt="@firebase/ai",se="1.4.1";var M="AI",ht="us-central1",Nt="https://firebasevertexai.googleapis.com",Kt="v1beta",mt=se,Gt="gl-js",Ut=180*1e3;var bt=["user","model","function","system"];var pe=(function(t){return t.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",t.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",t.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",t.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH",t.HARM_SEVERITY_UNSUPPORTED="HARM_SEVERITY_UNSUPPORTED",t})(pe||{});var oe=(function(t){return t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.OTHER="OTHER",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t})(oe||{});var O={VERTEX_AI:"VERTEX_AI",GOOGLE_AI:"GOOGLE_AI"};var J=class{constructor(e){this.backendType=e}},R=class extends J{constructor(){super(O.GOOGLE_AI)}},D=class extends J{constructor(e=ht){super(O.VERTEX_AI),e?this.location=e:this.location=ht}};var ae=class{constructor(e,n,i,s){this.app=e,this.backend=n;let o=s?.getImmediate({optional:!0}),a=i?.getImmediate({optional:!0});this.auth=a||null,this.appCheck=o||null,n instanceof D?this.location=n.location:this.location=""}_delete(){return Promise.resolve()}};var u=class t extends Be{constructor(e,n,i){let s=M,o=`${s}/${e}`,a=`${s}: ${n} (${o})`;super(e,a),this.code=e,this.customErrorData=i,Error.captureStackTrace&&Error.captureStackTrace(this,t),Object.setPrototypeOf(this,t.prototype),this.toString=()=>a}};function $t(t){if(t instanceof R)return`${M}/googleai`;if(t instanceof D)return`${M}/vertexai/${t.location}`;throw new u("error",`Invalid backend: ${JSON.stringify(t.backendType)}`)}function Vt(t){let e=t.split("/");if(e[0]!==M)throw new u("error",`Invalid instance identifier, unknown prefix '${e[0]}'`);switch(e[1]){case"vertexai":let i=e[2];if(!i)throw new u("error",`Invalid instance identifier, unknown location '${t}'`);return new D(i);case"googleai":return new R;default:throw new u("error",`Invalid instance identifier string: '${t}'`)}}var re=class t{constructor(e,n){var i,s,o,a,r,g;if(!((s=(i=e.app)===null||i===void 0?void 0:i.options)===null||s===void 0)&&s.apiKey)if(!((a=(o=e.app)===null||o===void 0?void 0:o.options)===null||a===void 0)&&a.projectId)if(!((g=(r=e.app)===null||r===void 0?void 0:r.options)===null||g===void 0)&&g.appId){if(this._apiSettings={apiKey:e.app.options.apiKey,project:e.app.options.projectId,appId:e.app.options.appId,automaticDataCollectionEnabled:e.app.automaticDataCollectionEnabled,location:e.location,backend:e.backend},Je(e.app)&&e.app.settings.appCheckToken){let c=e.app.settings.appCheckToken;this._apiSettings.getAppCheckToken=()=>Promise.resolve({token:c})}
1else e.appCheck&&(this._apiSettings.getAppCheckToken=()=>e.appCheck.getToken());e.auth&&(this._apiSettings.getAuthToken=()=>e.auth.getToken()),this.model=t.normalizeModelName(n,this._apiSettings.backend.backendType)}else throw new u("no-app-id",'The "appId" field is empty in the local Firebase config. Firebase AI requires this field to contain a valid app ID.');else throw new u("no-project-id",'The "projectId" field is empty in the local Firebase config. Firebase AI requires this field to contain a valid project ID.');else throw new u("no-api-key",'The "apiKey" field is empty in the local Firebase config. Firebase AI requires this field to contain a valid API key.')}static normalizeModelName(e,n){return n===O.GOOGLE_AI?t.normalizeGoogleAIModelName(e):t.normalizeVertexAIModelName(e)}static normalizeGoogleAIModelName(e){return`models/${e}`}static normalizeVertexAIModelName(e){let n;return e.includes("/")?e.startsWith("models/")?n=`publishers/google/${e}`:n=e:n=`publishers/google/models/${e}`,n}};var k=new je("@firebase/vertexai");var X=(function(t){return t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.PREDICT="predict",t})(X||{}),q=class{constructor(e,n,i,s,o){this.model=e,this.task=n,this.apiSettings=i,this.stream=s,this.requestOptions=o}toString(){let e=new URL(this.baseUrl);return e.pathname=`/${this.apiVersion}/${this.modelPath}:${this.task}`,e.search=this.queryParams.toString(),e.toString()}get baseUrl(){var e;return((e=this.requestOptions)===null||e===void 0?void 0:e.baseUrl)||Nt}get apiVersion(){return Kt}get modelPath(){if(this.apiSettings.backend instanceof R)return`projects/${this.apiSettings.project}/${this.model}`;if(this.apiSettings.backend instanceof D)return`projects/${this.apiSettings.project}/locations/${this.apiSettings.backend.location}/${this.model}`;throw new u("error",`Invalid backend: ${JSON.stringify(this.apiSettings.backend)}`)}get queryParams(){let e=new URLSearchParams;return this.stream&&e.set("alt","sse"),e}};function Bt(){let t=[];return t.push(`${Gt}/${mt}`),t.push(`fire/${mt}`),t.join(" ")}async function Yt(t){let e=new Headers;if(e.append("Content-Type","application/json"),e.append("x-goog-api-client",Bt()),e.append("x-goog-api-key",t.apiSettings.apiKey),t.apiSettings.automaticDataCollectionEnabled&&e.append("X-Firebase-Appid",t.apiSettings.appId),t.apiSettings.getAppCheckToken){let n=await t.apiSettings.getAppCheckToken();n&&(e.append("X-Firebase-AppCheck",n.token),n.error&&k.warn(`Unable to obtain a valid App Check token: ${n.error.message}`))}if(t.apiSettings.getAuthToken){let n=await t.apiSettings.getAuthToken();n&&e.append("Authorization",`Firebase ${n.accessToken}`)}return e}async function Ft(t,e,n,i,s,o){let a=new q(t,e,n,i,o);return{url:a.toString(),fetchOptions:{method:"POST",headers:await Yt(a),body:s}}}async function ue(t,e,n,i,s,o){let a=new q(t,e,n,i,o),r,g;try{let c=await Ft(t,e,n,i,s,o),f=o?.timeout!=null&&o.timeout>=0?o.timeout:Ut,h=new AbortController;if(g=setTimeout(()=>h.abort(),f),c.fetchOptions.signal=h.signal,r=await fetch(c.url,c.fetchOptions),!r.ok){let S="",T;try{let E=await r.json();S=E.error.message,E.error.details&&(S+=` ${JSON.stringify(E.error.details)}`,T=E.error.details)}catch{}throw r.status===403&&T.some(E=>E.reason==="SERVICE_DISABLED")&&T.some(E=>{var P,L;return(L=(P=E.links)===null||P===void 0?void 0:P[0])===null||L===void 0?void 0:L.description.includes("Google developers console API activation")})?new u("api-not-enabled",`The Firebase AI SDK requires the Firebase AI API ('firebasevertexai.googleapis.com') to be enabled in your Firebase project. Enable this API by visiting the Firebase Console at https://console.firebase.google.com/project/${a.apiSettings.project}/genai/ and clicking "Get started". If you enabled this API recently, wait a few minutes for the action to propagate to our systems and then retry.`,{status:r.status,statusText:r.statusText,errorDetails:T}):new u("fetch-error",`Error fetching from ${a}: [${r.status} ${r.statusText}] ${S}`,{status:r.status,statusText:r.statusText,errorDetails:T})}}catch(c){let f=c;throw c.code!=="fetch-error"&&c.code!=="api-not-enabled"&&c instanceof Error&&(f=ne
1w u("error",`Error fetching from ${a.toString()}: ${c.message}`),f.stack=c.stack),f}finally{g&&clearTimeout(g)}return r}function W(t){return t.candidates&&!t.candidates[0].hasOwnProperty("index")&&(t.candidates[0].index=0),jt(t)}function jt(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&k.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),z(t.candidates[0]))throw new u("response-error",`Response error: ${x(t)}. Response body stored in error.response`,{response:t});return Ht(t)}else if(t.promptFeedback)throw new u("response-error",`Text not available. ${x(t)}`,{response:t});return""},t.inlineDataParts=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&k.warn(`This response had ${t.candidates.length} candidates. Returning data from the first candidate only. Access response.candidates directly to use the other candidates.`),z(t.candidates[0]))throw new u("response-error",`Response error: ${x(t)}. Response body stored in error.response`,{response:t});return Jt(t)}else if(t.promptFeedback)throw new u("response-error",`Data not available. ${x(t)}`,{response:t})},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&k.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),z(t.candidates[0]))throw new u("response-error",`Response error: ${x(t)}. Response body stored in error.response`,{response:t});return zt(t)}else if(t.promptFeedback)throw new u("response-error",`Function call not available. ${x(t)}`,{response:t})},t}function Ht(t){var e,n,i,s;let o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(let a of(s=(i=t.candidates)===null||i===void 0?void 0:i[0].content)===null||s===void 0?void 0:s.parts)a.text&&o.push(a.text);return o.length>0?o.join(""):""}function zt(t){var e,n,i,s;let o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(let a of(s=(i=t.candidates)===null||i===void 0?void 0:i[0].content)===null||s===void 0?void 0:s.parts)a.functionCall&&o.push(a.functionCall);if(o.length>0)return o}function Jt(t){var e,n,i,s;let o=[];if(!((n=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||n===void 0)&&n.parts)for(let a of(s=(i=t.candidates)===null||i===void 0?void 0:i[0].content)===null||s===void 0?void 0:s.parts)a.inlineData&&o.push(a);if(o.length>0)return o}var qt=[oe.RECITATION,oe.SAFETY];function z(t){return!!t.finishReason&&qt.includes(t.finishReason)}function x(t){var e,n,i;let s="";if((!t.candidates||t.candidates.length===0)&&t.promptFeedback)s+="Response was blocked",!((e=t.promptFeedback)===null||e===void 0)&&e.blockReason&&(s+=` due to ${t.promptFeedback.blockReason}`),!((n=t.promptFeedback)===null||n===void 0)&&n.blockReasonMessage&&(s+=`: ${t.promptFeedback.blockReasonMessage}`);else if(!((i=t.candidates)===null||i===void 0)&&i[0]){let o=t.candidates[0];z(o)&&(s+=`Candidate was blocked due to ${o.finishReason}`,o.finishMessage&&(s+=`: ${o.finishMessage}`))}return s}function Tt(t){var e,n;if((e=t.safetySettings)===null||e===void 0||e.forEach(i=>{if(i.method)throw new u("unsupported","SafetySetting.method is not supported in the the Gemini Developer API. Please remove this property.")}),!((n=t.generationConfig)===null||n===void 0)&&n.topK){let i=Math.round(t.generationConfig.topK);i!==t.generationConfig.topK&&(k.warn("topK in GenerationConfig has been rounded to the nearest integer to match the format for requests to the Gemini Developer API."),t.generationConfig.topK=i)}return t}function fe(t){return{candidates:t.candidates?Xt(t.candidates):void 0,prompt:t.promptFeedback?Qt(t.promptFeedback):void 0,usageMetadata:t.usageMetadata}}function Wt(t,e){return{generateContentRequest:Object.assign({model:e},t)}}function Xt(t){let e=[],n;return e&&t.forEach(i=>{var s;let o;if(i.citationMetadata&&(o={citations:i.citationMetadata.citationSources}),i.safetyRatings&&(n=i.safetyRatings.map(r=>{var g,c,f;return Object.assign(Object.assign({},r),{severity:(g=r.severity)!==null&&g!==void 0?g:pe.HARM_SEVERITY_UNSUPPORTED,probabilityScore:(c=r.probabilityScore)!==null&&c!==void 0?c:0,severityScore:(f=r.severityScore)!==null&&f!==void 0?f:0})})),!((s=i.content)===null||s===void 0)&&s.parts.some(r=>r?.videoMetadata))throw new u("unsupported","Part.videoMetadata is not supported in the Gemini Developer API. Please remove this property.");let a={index:i.index,content:i.content,finishReason:i.finishReason,finishMessage:i.finishMessage,safetyRatings:n,citationMetadata:o,groundingMetadata:i.groundingMetadata};e.push(a)}),e}function Qt(t){let e=[];
1return t.safetyRatings.forEach(i=>{var s,o,a;e.push({category:i.category,probability:i.probability,severity:(s=i.severity)!==null&&s!==void 0?s:pe.HARM_SEVERITY_UNSUPPORTED,probabilityScore:(o=i.probabilityScore)!==null&&o!==void 0?o:0,severityScore:(a=i.severityScore)!==null&&a!==void 0?a:0,blocked:i.blocked})}),{blockReason:t.blockReason,safetyRatings:e,blockReasonMessage:t.blockReasonMessage}}var _t=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function Zt(t,e){let n=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),i=nn(n),[s,o]=i.tee();return{stream:tn(s,e),response:en(o,e)}}async function en(t,e){let n=[],i=t.getReader();for(;;){let{done:s,value:o}=await i.read();if(s){let a=sn(n);return e.backend.backendType===O.GOOGLE_AI&&(a=fe(a)),W(a)}n.push(o)}}function tn(t,e){return he(this,arguments,function*(){let i=t.getReader();for(;;){let{value:s,done:o}=yield ee(i.read());if(o)break;let a;e.backend.backendType===O.GOOGLE_AI?a=W(fe(s)):a=W(s),yield yield ee(a)}})}function nn(t){let e=t.getReader();return new ReadableStream({start(i){let s="";return o();function o(){return e.read().then(({value:a,done:r})=>{if(r){if(s.trim()){i.error(new u("parse-failed","Failed to parse stream"));return}i.close();return}s+=a;let g=s.match(_t),c;for(;g;){try{c=JSON.parse(g[1])}catch{i.error(new u("parse-failed",`Error parsing JSON response: "${g[1]}`));return}i.enqueue(c),s=s.substring(g[0].length),g=s.match(_t)}return o()})}}})}function sn(t){let e=t[t.length-1],n={promptFeedback:e?.promptFeedback};for(let i of t)if(i.candidates)for(let s of i.candidates){let o=s.index||0;if(n.candidates||(n.candidates=[]),n.candidates[o]||(n.candidates[o]={index:s.index}),n.candidates[o].citationMetadata=s.citationMetadata,n.candidates[o].finishReason=s.finishReason,n.candidates[o].finishMessage=s.finishMessage,n.candidates[o].safetyRatings=s.safetyRatings,s.content&&s.content.parts){n.candidates[o].content||(n.candidates[o].content={role:s.content.role||"user",parts:[]});let a={};for(let r of s.content.parts){if(r.text!==void 0){if(r.text==="")continue;a.text=r.text}if(r.functionCall&&(a.functionCall=r.functionCall),Object.keys(a).length===0)throw new u("invalid-content","Part should have at least one property, but there are none. This is likely caused by a malformed response from the backend.");n.candidates[o].content.parts.push(a)}}}return n}async function Ct(t,e,n,i){t.backend.backendType===O.GOOGLE_AI&&(n=Tt(n));let s=await ue(e,X.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(n),i);return Zt(s,t)}async function Et(t,e,n,i){t.backend.backendType===O.GOOGLE_AI&&(n=Tt(n));let s=await ue(e,X.GENERATE_CONTENT,t,!1,JSON.stringify(n),i),o=await on(s,t);return{response:W(o)}}async function on(t,e){let n=await t.json();return e.backend.backendType===O.GOOGLE_AI?fe(n):n}function St(t){if(t!=null){if(typeof t=="string")return{role:"system",parts:[{text:t}]};if(t.text)return{role:"system",parts:[t]};if(t.parts)return t.role?t:{role:"system",parts:t.parts}}}function ce(t){let e=[];
1if(typeof t=="string")e=[{text:t}];else for(let n of t)typeof n=="string"?e.push({text:n}):e.push(n);return an(e)}function an(t){let e={role:"user",parts:[]},n={role:"function",parts:[]},i=!1,s=!1;for(let o of t)"functionResponse"in o?(n.parts.push(o),s=!0):(e.parts.push(o),i=!0);if(i&&s)throw new u("invalid-content","Within a single message, FunctionResponse cannot be mixed with other type of Part in the request for sending chat message.");if(!i&&!s)throw new u("invalid-content","No Content is provided for sending chat message.");return i?e:n}function ie(t){let e;return t.contents?e=t:e={contents:[ce(t)]},t.systemInstruction&&(e.systemInstruction=St(t.systemInstruction)),e}var yt=["text","inlineData","functionCall","functionResponse"],rn={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall"],system:["text"]},vt={user:["model"],function:["model"],model:["user","function"],system:[]};function cn(t){let e=null;for(let n of t){let{role:i,parts:s}=n;if(!e&&i!=="user")throw new u("invalid-content",`First Content should be with role 'user', got ${i}`);if(!bt.includes(i))throw new u("invalid-content",`Each item should include role field. Got ${i} but valid roles are: ${JSON.stringify(bt)}`);
1if(!Array.isArray(s))throw new u("invalid-content","Content should have 'parts' but property with an array of Parts");if(s.length===0)throw new u("invalid-content","Each Content should have at least one part");let o={text:0,inlineData:0,functionCall:0,functionResponse:0};for(let r of s)for(let g of yt)g in r&&(o[g]+=1);let a=rn[i];for(let r of yt)if(!a.includes(r)&&o[r]>0)throw new u("invalid-content",`Content with role '${i}' can't contain '${r}' part`);if(e&&!vt[i].includes(e.role))throw new u("invalid-content",`Content with role '${i}' can't follow '${e.role}'. Valid previous roles: ${JSON.stringify(vt)}`);e=n}}var It="SILENT_ERROR",de=class{constructor(e,n,i,s){this.model=n,this.params=i,this.requestOptions=s,this._history=[],this._sendPromise=Promise.resolve(),this._apiSettings=e,i?.history&&(cn(i.history),this._history=i.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e){var n,i,s,o,a;await this._sendPromise;let r=ce(e),g={safetySettings:(n=this.params)===null||n===void 0?void 0:n.safetySettings,generationConfig:(i=this.params)===null||i===void 0?void 0:i.generationConfig,tools:(s=this.params)===null||s===void 0?void 0:s.tools,toolConfig:(o=this.params)===null||o===void 0?void 0:o.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,contents:[...this._history,r]},c={};return this._sendPromise=this._sendPromise.then(()=>Et(this._apiSettings,this.model,g,this.requestOptions)).then(f=>{var h,S;if(f.response.candidates&&f.response.candidates.length>0){this._history.push(r);let T={parts:((h=f.response.candidates)===null||h===void 0?void 0:h[0].content.parts)||[],role:((S=f.response.candidates)===null||S===void 0?void 0:S[0].content.role)||"model"};this._history.push(T)}else{let T=x(f.response);T&&k.warn(`sendMessage() was unsuccessful. ${T}. Inspect response object for details.`)}c=f}),await this._sendPromise,c}async sendMessageStream(e){var n,i,s,o,a;await this._sendPromise;let r=ce(e),g={safetySettings:(n=this.params)===null||n===void 0?void 0:n.safetySettings,generationConfig:(i=this.params)===null||i===void 0?void 0:i.generationConfig,tools:(s=this.params)===null||s===void 0?void 0:s.tools,toolConfig:(o=this.params)===null||o===void 0?void 0:o.toolConfig,systemInstruction:(a=this.params)===null||a===void 0?void 0:a.systemInstruction,contents:[...this._history,r]},c=Ct(this._apiSettings,this.model,g,this.requestOptions);return this._sendPromise=this._sendPromise.then(()=>c).catch(f=>{throw new Error(It)}).then(f=>f.response).then(f=>{if(f.candidates&&f.candidates.length>0){this._history.push(r);let h=Object.assign({},f.candidates[0].content);h.role||(h.role="model"),this._history.push(h)}else{let h=x(f);h&&k.warn(`sendMessageStream() was unsuccessful. ${h}. Inspect response object for details.`)}}).catch(f=>{f.message!==It&&k.error(f)}),c}};async function dn(t,e,n,i){let s="";if(t.backend.backendType===O.GOOGLE_AI){let a=Wt(n,e);s=JSON.stringify(a)}else s=JSON.stringify(n);return(await ue(e,X.COUNT_TOKENS,t,!1,s,i)).json()}var le=class extends re{constructor(e,n,i){super(e,n.model),this.generationConfig=n.generationConfig||{},this.safetySettings=n.safetySettings||[],this.tools=n.tools,this.toolConfig=n.toolConfig,this.systemInstruction=St(n.systemInstruction),this.requestOptions=i||{}}async generateContent(e){let n=ie(e);return Et(this._apiSettings,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction},n),this.requestOptions)}async generateContentStream(e){let n=ie(e);return Ct(this._apiSettings,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction},n),this.requestOptions)}startChat(e){return new de(this._apiSettings,this.model,Object.assign({tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,generationConfig:this.generationConfig,safetySettings:this.safetySettings},e),this.requestOptions)}async countTokens(e){let n=ie(e);return dn(this._apiSettings,this.model,n)}};function wt(t=Y(),e={backend:new R}){t=Ye(t);let n=ze(t,M),i=$t(e.backend);return n.getImmediate({identifier:i})}function At(t,e,n){if(!e.model)throw new u("no-model","Must provide a model name. Example: getGenerativeModel({ model: 'my-model-name' })");return new le(t,e,n)}function ln(){He(new Fe(M,(t,{instanceIdentifier:e})=>
1{if(!e)throw new u("error","AIService instance identifier is undefined.");let n=Vt(e),i=t.getProvider("app").getImmediate(),s=t.getProvider("auth-internal"),o=t.getProvider("app-check-internal");return new ae(i,n,s,o)},"PUBLIC").setMultipleInstances(!0)),ne(gt,se),ne(gt,se,"esm2017")}ln();var Q=class t{firestoreService=_(H);authService=_(F);orgService=_(j);get model(){let e=Y(),n=wt(e,{backend:new R});return At(n,{model:"gemini-2.0-flash"})}async parseTask(e,n=[],i=[],s=[]){let o=new Date().toISOString().split("T")[0],a=new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),g=`${`You are a top 1% Kanban Task Intelligence Assistant designed to create exceptionally clear, useful, low-friction tasks from messy human input.
2
3Your job is to turn anything the user types or says into the best possible Kanban task with minimal effort required from the user.
4
5CORE GOAL
6Convert raw input into a Kanban task that is instantly understandable, actionable, and useful inside a board view and detailed task view.
7
8PRIMARY UX PRINCIPLES
91. Minimize mental load.
102. Make the title instantly scannable.
113. Preserve important context.
124. Infer intent intelligently.
135. Never force the user to rewrite their thoughts.
146. Clean up messy input without losing meaning.
157. Make the task ready for action immediately.
168. Do not create vague or generic tasks.
179. Prefer clarity over cleverness.
1810. Act like the user is busy and should not have to explain themselves twice.
1911. Strip out all meta-instructions or voice-command artifacts! For example, if the user says "create a to do", "add a task", "new item", ignore those phrases. Voice dictates usually end with 'done', 'stop', 'period', or 'end'. You MUST completely strip these artifacts out.
20
21TASK CREATION LOGIC
22
23STEP 1: CLASSIFY THE INPUT
24Determine whether the input is primarily a customer message, internal note, dictated audio, or mixed.
25
26STEP 2: DETERMINE THE MAIN ACTION
27Infer the primary task. Focus on the most important actionable outcome, not the raw wording.
28
29STEP 3: WRITE THE TITLE
30- Must be specific, scannable, and reflect actual work.
31- Start with a verb. Capitalize the first letter. No trailing punctuation.
32- Use as many words/characters as needed to fully capture the context. Do NOT arbitrarily cut the title short.
33- Summarize tightly, but preserve all necessary identifiers (e.g., client names, specific issues). Offload deep details to description.
34
35STEP 4: WRITE THE DESCRIPTION
36- If CUSTOMER MESSAGE: Preserve in full or near-full. Keep wording/tone/context. Include sender/time if present.
37- If INTERNAL NOTE: Rewrite into a clean, detailed, readable task description. Expand shorthand, correct grammar.
38- If AUDIO/TRANSCRIPT: Rewrite heavily for clarity. Remove filler/noise. Turn rambling into a coherent brief.
39- If MIXED: Preserve external text, rewrite internal notes cleanly.
40- If the title captures the entire task, write out the action as a proper sentence in the description.
41
42STEP 5: PRESERVE HIGH-VALUE CONTEXT & DO NOT INVENT
43Keep names, dates, concerns, next steps. Never fabricate deadlines, promises, or facts.
44
45STEP 6: ENTITY RESOLUTION AND LINKING
46When the input mentions a person, client, lead, company, contact, or email address, attach the Kanban card to the correct record.
47Resolution priority: 1. Clients 2. Leads.
48If the same person/company exists in both Clients and Leads, always link to Clients and ignore Leads. 
49Use the strongest identifier: email > full name > company name > known alias.
50
51Available Clients: ${JSON.stringify(i.map(c=>({id:c.id,name:c.name,email:c.email})))}
52Available Leads: ${JSON.stringify(s.map(c=>({id:c.id,name:c.name,email:c.email})))}
53
54Identify "linkedClientIds" and "linkedLeadIds" from the above lists if matched. Do this silently.
55
56STEP 7: STRUCTURED OUTPUT
57Return the final output ONLY using the exact XML tags below. Do not add explanations or commentary outside of the tags.
58
59<TITLE>...</TITLE>
60<DESCRIPTION>
61...
62</DESCRIPTION>
63<STATUS>todo</STATUS> (detect from input: 'backlog', 'todo', 'in_progress', 'complete')
64<PRIORITY>medium</PRIORITY> (one of: low, medium, high, urgent)
65<TASK_TYPE>Client Response</TASK_TYPE> (one of: Client Response, Analysis, Follow-up, Build, Review, Fix, other)
66<TAGS>tag1, tag2</TAGS> (comma separated)
67<DUE_DATE>null</DUE_DATE> (YYYY-MM-DD or null. Today is ${a} (${o}))
68<CLIENT_IDS>id1, id2</CLIENT_IDS> (comma separated matched Client IDs)
69<LEAD_IDS></LEAD_IDS> (comma separated matched Lead IDs)
70
71EXAMPLES
72
73Example 1
74Input:
75kkflores29
76
77Apr 09, 9:00 PM
78I also wanted to take some time to review the report before I responded. I really appreciate you putting this together.
79
80I did notice that a large portion of our sales are currently coming from ads, and ACOS is still relatively high, which I understand is expected at this stage while we\u2019re gathering data.
81
82I\u2019d love to get your perspective on how you\u2019re planning to optimize performance from here. Specifically, how we can start improving efficiency (ACOS) while also building more organic traction over time.
83
84Appreciate your help on this! Just give me the next steps you need from me and I\u2019ll get it done (:
85
86Output:
87<TITLE>
87Respond to kkflores29 about ACOS efficiency</TITLE>
88<DESCRIPTION>
89kkflores29
90
91Apr 09, 9:00 PM
92I also wanted to take some time to review the report before I responded. I really appreciate you putting this together.
93
94I did notice that a large portion of our sales are currently coming from ads, and ACOS is still relatively high, which I understand is expected at this stage while we\u2019re gathering data.
95
96I\u2019d love to get your perspective on how you\u2019re planning to optimize performance from here. Specifically, how we can start improving efficiency (ACOS) while also building more organic traction over time.
97
98Appreciate your help on this! Just give me the next steps you need from me and I\u2019ll get it done (:
99</DESCRIPTION>
100<STATUS>todo</STATUS>
101<PRIORITY>high</PRIORITY>
102<TASK_TYPE>Client Response</TASK_TYPE>
103<TAGS>ACOS, Optimization</TAGS>
104<DUE_DATE>null</DUE_DATE>
105<CLIENT_IDS></CLIENT_IDS>
106<LEAD_IDS></LEAD_IDS>
107
108Example 2
109Input:
110need to check why spend dropped maybe campaign budget maybe impressions dead maybe listing issue too look at last 7 and 30 days and tell client what happened
111
112Output:
113<TITLE>Investigate spend drop and prepare client update</TITLE>
114<DESCRIPTION>
115Review why ad spend dropped by checking possible causes including campaign budget limitations, impression decline, and potential listing issues. Compare performance across the last 7 days and 30 days, identify the most likely drivers, and prepare a clear explanation for the client.
116</DESCRIPTION>
117<STATUS>todo</STATUS>
118<PRIORITY>high</PRIORITY>
119<TASK_TYPE>Analysis</TASK_TYPE>
120<TAGS>Troubleshooting, Spend</TAGS>
121<DUE_DATE>null</DUE_DATE>
122<CLIENT_IDS></CLIENT_IDS>
123<LEAD_IDS></LEAD_IDS>
124`}
125
126User input: "${e}"`;try{let f=(await this.model.generateContent(g)).response.text().trim(),h=(b,Dt="")=>{let Lt=new RegExp(`<${b}>([\\s\\S]*?)</${b}>`,"i"),ge=f.match(Lt);return ge?ge[1].trim():Dt},S=h("TITLE","Untitled Task"),T=h("DESCRIPTION",""),E=h("STATUS","todo"),P=h("PRIORITY","medium").toLowerCase(),L=["low","medium","high","urgent"].includes(P)?P:"medium",kt=h("TASK_TYPE","other"),Rt=h("TAGS","").split(",").map(b=>b.trim()).filter(b=>!!b),K=h("DUE_DATE","null");(K.toLowerCase()==="null"||!K)&&(K=null);let Pt=h("CLIENT_IDS","").split(",").map(b=>b.trim()).filter(b=>!!b),Mt=h("LEAD_IDS","").split(",").map(b=>b.trim()).filter(b=>!!b);return S==="Untitled Task"&&!f.toUpperCase().includes("<TITLE>")?{title:e.slice(0,100),description:f,status:"todo",priority:"medium",taskType:"other",tags:[],dueDate:null,linkedClientIds:[],linkedLeadIds:[]}:{title:S,description:T,status:E,priority:L,taskType:kt,tags:Rt,dueDate:K,linkedClientIds:Pt,linkedLeadIds:Mt}}catch(c){return console.error("[KanbanAI] Parse failed, using fallback:",c),{title:e.slice(0,80),description:e.length>80?e:"",status:"todo",priority:"medium",taskType:"other",tags:[],dueDate:null,linkedClientIds:[],linkedLeadIds:[]}}}async saveTask(e,n,i,s,o){let a=Array.from(new Set([...e.linkedClientIds||[],...o?.clientIds||[]])),r=Array.from(new Set([...e.linkedLeadIds||[],...o?.leadIds||[]])),g=o?.teamMemberIds||[],c={id:"",accountId:n,title:e.title,description:e.description,status:e.status,priority:e.priority,order:-Date.now(),dueDate:e.dueDate||void 0,visibleToClient:!1,logToChangeLog:!0,changeLogVisibility:"internal",type:e.taskType||"other",tags:e.tags||[],relatedCampaignIds:[],relatedAsins:[],goalIds:[],executedBy:"user",createdByUserId:i,assigneeUserId:s||void 0,associations:{clientIds:a,leadIds:r,teamMemberIds:g},createdAt:new Date().toISOString()};return await this.firestoreService.upsertKanbanCard(c),c.title}static \u0275fac=function(n){return new(n||t)};static \u0275prov=ve({token:t,factory:t.\u0275fac,providedIn:"root"})};var un=["inputEl"];function fn(t,e){t&1&&(d(0,"span",19)(1,"mat-icon"),p(2,"smart_toy"),l()())}function gn(t,e){t&1&&(d(0,"mat-icon"),p(1,"keyboard_arrow_down"),l())}function hn(t,e){t&1&&(d(0,"div",20),p(1," Press "),d(2,"kbd"),p(3,"Enter"),l(),p(4," to parse \xB7 Say "),d(5,"strong"),p(6,'"done"'),l(),p(7," to add directly "),l())}function mn(t,e){t&1&&(d(0,"div",21),Ce(1,"mat-progress-spinner",22),d(2,"span"),p(3,"Parsing your task..."),l()())}function bn(t,e){if(t&1&&(d(0,"div",28)(1,"span",29),p(2,"\u{1F4C5} Due"),l(),d(3,"span",36),p(4),B(5,"date"),l()()),t&2){let n=A(2);m(4),$(Me(5,1,n.parsed.dueDate,"MMM d, y"))}}function _n(t,e){if(t&1&&(d(0,"div",28)(1,"span",29),p(2,"\u{1F4DD} Notes"),l(),d(3,"span",37),p(4),B(5,"slice"),l()()),t&2){let n=A(2);
126m(4),Ae("",De(5,2,n.parsed.description,0,100),"",n.parsed.description.length>100?"...":"")}}function yn(t,e){if(t&1){let n=G();d(0,"div",23)(1,"div",24)(2,"mat-icon",25),p(3,"check_circle"),l(),d(4,"span"),p(5,"Here's what I got:"),l(),d(6,"button",26),I("click",function(){y(n);let s=A();return v(s.openFullEditor())}),p(7,"Edit in full form"),l()(),d(8,"div",27)(9,"div",28)(10,"span",29),p(11,"\u{1F4CC} Title"),l(),d(12,"span",30),p(13),l()(),d(14,"div",28)(15,"span",29),p(16,"\u{1F4CB} Status"),l(),d(17,"span",31),p(18),l()(),d(19,"div",28)(20,"span",29),p(21,"\u{1F3F3} Priority"),l(),d(22,"span",31),p(23),B(24,"titlecase"),l()(),N(25,bn,6,4,"div",32)(26,_n,6,6,"div",32),l(),d(27,"div",33)(28,"button",34),I("click",function(){y(n);let s=A();return v(s.reset())}),d(29,"mat-icon"),p(30,"refresh"),l(),p(31," Try again "),l(),d(32,"button",35),I("click",function(){y(n);let s=A();return v(s.addToKanban())}),d(33,"mat-icon"),p(34,"add_task"),l(),p(35),l()()()}if(t&2){let n=A();m(13),$(n.parsed.title),m(4),te("data-status",n.parsed.status),m(),V(" ",n.getStatusLabel(n.parsed.status)," "),m(4),te("data-priority",n.parsed.priority),m(),V(" ",Pe(24,9,n.parsed.priority)," "),m(2),C("ngIf",n.parsed.dueDate),m(),C("ngIf",n.parsed.description),m(6),C("disabled",n.isSaving),m(3),V(" ",n.isSaving?"Adding...":"Add to Kanban"," ")}}function vn(t,e){if(t&1){let n=G();d(0,"div",38)(1,"div",39),p(2,"Try saying:"),l(),d(3,"div",40),I("click",function(){y(n);let s=A();return v(s.tryExample("Create a backlog task to review keyword strategy for Honey Comb, high priority"))}),p(4,' "Create a backlog, review keyword strategy for Honey Comb, high priority" '),l(),d(5,"div",40),I("click",function(){y(n);let s=A();return v(s.tryExample("To do: follow up with Rick about invoice, due tomorrow"))}),p(6,' "To do: follow up with Rick about invoice, due tomorrow" '),l(),d(7,"div",40),I("click",function(){y(n);let s=A();return v(s.tryExample("In progress task - updating ad copy for Everyday Beauty, urgent, due in 3 days"))}),p(8,' "In progress: updating ad copy, urgent, due in 3 days" '),l()()}}var Ot=["save it","add it","add task","create it","that's it","submit task","create task","save task"],xt=class t{destroy$=new Z;inputChange$=new Z;aiService=_(Q);authService=_(F);orgService=_(j);accountService=_(dt);snackBar=_(Qe);dialog=_(lt);firestoreService=_(H);accessService=_(et);crmService=_(ut);inputEl;isOpen=!1;userInput="";parsed=null;isLoading=!1;isSaving=!1;isRecording=!1;speechSupported=!1;recognition=null;userId="";userEmail="";orgId="";accountId="";orgMembers=[];availableAccounts=[];availableClients=[];availableLeads=[];defaultAccountId="AGENCY";baseDictationText="";silenceTimeout=null;assistantContextLoaded=!1;ngOnInit(){this.speechSupported="SpeechRecognition"in window||"webkitSpeechRecognition"in window,this.authService.user$.pipe(w(this.destroy$)).subscribe(e=>{this.userId=e?.uid||"",this.userEmail=e?.email||""}),this.orgService.currentOrgId$.pipe(w(this.destroy$)).subscribe(e=>{this.orgId=e||""}),this.accountService.currentAccount$.pipe(w(this.destroy$)).subscribe(e=>{this.accountId=e?.id||""}),this.accessService.permissions$.pipe(w(this.destroy$)).subscribe(e=>{this.defaultAccountId=e.canAccessAgency?"AGENCY":this.accountId||""}),this.inputChange$.pipe(be(2500),_e(),w(this.destroy$)).subscribe(e=>{e&&e.trim().length>10&&!this.parsed&&this.parseText(e)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.stopVoice()}onDocumentClick(e){}loadAssistantContext(){this.assistantContextLoaded||(this.assistantContextLoaded=!0,this.orgService.currentOrgId$.pipe(ye(e=>e?this.orgService.getMembers(e):me([])),w(this.destroy$)).subscribe(e=>{this.orgMembers=e||[]}),this.accountService.activeAccounts$.pipe(w(this.destroy$)).subscribe(e=>{this.availableAccounts=e.map(n=>({id:n.id,name:n.name}))}),this.crmService.clients$.pipe(w(this.destroy$)).subscribe(e=>{this.availableClients=(e||[]).map(n=>({id:n.id,name:n.name,email:n.email}))}),this.crmService.leads$.pipe(w(this.destroy$)).subscribe(e=>{this.availableLeads=(e||[]).map(n=>({id:n.id,name:n.company||n.name,email:n.email}))}))}togglePanel(){this.isOpen=!this.isOpen,this.isOpen?(this.loadAssistantContext(),setTimeout(()=>this.inputEl?.nativeElement.focus(),300),!this.isRecording&&this.speechSupported&&this.startVoice()):this.stopVoice()}onInputChange(e){let n=e.toLowerCase().trim();if(Ot.some(i=>n.endsWith(i))&&this.parsed){this.addToKanban();return}this.inputChange$.next(e)}onEnter(e){if(e.preventDefault(),!this.userInput.trim())return;let n=this.userInput.toLowerCase().trim();if(Ot.some(i=>n.endsWith(i)||n===i)&&this.parsed){this.addToKanban();return}this.parseText(this.userInput)}async parseText(e){if(!(!e.trim()||this.isLoading)){this.isLoading=!0,this.parsed=null;try{this.parsed=await this.aiService.parseTask(e,this.availableAccounts,this.availableClients,this.availableLeads)}catch(n){console.error("[KanbanAI Component] Parse error:",n),this.snackBar.open("Could not parse task. Please try again.","",{duration:3e3})}finally{this.isLoading=!1}}}async addToKanban(){if(!this.parsed||this.isSaving)return;this.isSaving=!0;let e=this.defaultAccountId,n={clientIds:this.parsed.linkedClientIds||[],leadIds:this.parsed.linkedLeadIds||[],teamMemberIds:[]};try{await this.aiService.saveTask(this.parsed,e,this.userId,void 0,n),this.snackBar.open(`\u2713 "${this.parsed.title}" added to Kanban`,"View",{duration:4e3,panelClass:"ai-success-snack"}),this.reset(),this.isOpen=!1}catch(i){console.error("[KanbanAI] Save error:",i),this.snackBar.open("Failed to add task. Please try again.","",{duration:4e3})}finally{this.isSaving=!1}}openFullEditor(){if(!this.parsed)return;let e={defaultStatus:this.parsed.status,userId:this.userId,userEmail:this.userEmail,orgMembers:this.orgMembers},n=this.dialog.open(ft,{width:"650px",data:e});n.afterOpened().subscribe(()=>{let i=n.componentInstance;i.title=this.parsed.title,i.description=this.parsed.description,i.status=this.parsed.status,i.priority=this.parsed.priority,i.showDesc=!!this.parsed.description,this.parsed.dueDate&&(i.dueDate=new Date(this.parsed.dueDate+"T12:00:00")),this.parsed.linkedClientIds&&this.parsed.linkedClientIds.length>0&&(i.selectedClientIds=[...this.parsed.linkedClientIds]),this.parsed.linkedLeadIds&&this.parsed.linkedLeadIds.length>0&&(i.selectedLeadIds=[...this.parsed.linkedLeadIds])}),n.afterClosed().subscribe(async i=>{if(i){this.isSaving=!0;let s=this.defaultAccountId;
126try{let o={id:"",accountId:s,title:i.title,description:i.description,status:i.status,priority:i.priority,dueDate:i.dueDate?i.dueDate.toISOString().split("T")[0]:void 0,assigneeUserId:i.assigneeUserId||void 0,associations:i.associations,visibleToClient:!1,logToChangeLog:!0,changeLogVisibility:"internal",type:this.parsed.taskType||"other",tags:this.parsed.tags||[],relatedCampaignIds:[],relatedAsins:[],goalIds:[],executedBy:"user",createdByUserId:this.userId,createdAt:new Date().toISOString()};await this.firestoreService.upsertKanbanCard(o),this.snackBar.open(`\u2713 "${i.title}" added to Kanban`,"",{duration:3e3}),this.reset(),this.isOpen=!1}catch(o){console.error("[KanbanAI] Dialog save error:",o),this.snackBar.open("Failed to add task.","",{duration:4e3})}finally{this.isSaving=!1}}})}reset(){this.userInput="",this.baseDictationText="",this.parsed=null,this.isLoading=!1,this.isSaving=!1}tryExample(e){this.userInput=e,this.parseText(e)}toggleVoice(){this.isRecording?this.stopVoice():this.startVoice()}startVoice(){let e=window.SpeechRecognition||window.webkitSpeechRecognition;if(e){this.baseDictationText=this.userInput.trim()?this.userInput.trim()+" ":"",this.recognition=new e,this.recognition.lang="en-US",this.recognition.interimResults=!0,this.recognition.continuous=!0,this.restartSilenceTimeout(),this.recognition.onresult=n=>{this.restartSilenceTimeout();let i=Array.from(n.results).map(s=>s[0].transcript).join("");this.userInput=this.baseDictationText+i,this.onInputChange(this.userInput)},this.recognition.onend=()=>{this.silenceTimeout&&clearTimeout(this.silenceTimeout),this.isRecording=!1,this.userInput.trim()&&this.parseText(this.userInput)},this.recognition.onerror=()=>{console.warn("Kanban AI Mic: Could not start or audio error. (Might be in use by Action Journal)"),this.isRecording=!1};try{this.recognition.start(),this.isRecording=!0}catch(n){console.warn("Microphone is already in use by another feature.",n),this.isRecording=!1}}}stopVoice(){this.silenceTimeout&&(clearTimeout(this.silenceTimeout),this.silenceTimeout=null),this.recognition&&(this.recognition.stop(),this.recognition=null),this.isRecording=!1}restartSilenceTimeout(){this.silenceTimeout&&clearTimeout(this.silenceTimeout),this.silenceTimeout=setTimeout(()=>{this.isRecording&&(this.stopVoice(),this.snackBar.open("Mic auto-paused due to 45s of silence.","",{duration:3e3}),this.userInput.trim()&&this.parseText(this.userInput))},45e3)}getStatusLabel(e){return{backlog:"Backlog",todo:"To Do",in_progress:"In Progress",complete:"Complete"}[e]||e}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Te({type:t,selectors:[["app-kanban-ai-assistant"]],viewQuery:function(n,i){if(n&1&&Ee(un,5),n&2){let s;Se(s=we())&&(i.inputEl=s.first)}},hostBindings:function(n,i){n&1&&I("click",function(o){return i.onDocumentClick(o)},Ie)},decls:29,vars:18,consts:[["inputEl",""],["id","kanban-ai-fab","matTooltipPosition","left",1,"ai-fab",3,"click","matTooltip"],["class","ai-fab-icon",4,"ngIf"],[4,"ngIf"],[1,"ai-panel",3,"click"],[1,"ai-panel-header"],[1,"ai-panel-title"],[1,"ai-avatar"],[1,"ai-name"],[1,"ai-subtitle"],["mat-icon-button","",1,"ai-close-btn",3,"click"],[1,"ai-input-area"],[1,"ai-input-row"],["placeholder",'Try: "Create a to do for updating ads for Honey Comb, due in 2 days, high priority"',"rows","3",1,"ai-textarea",3,"ngModelChange","keydown.enter","ngModel"],[1,"ai-mic-btn",3,"click","matTooltip","disabled"],["class","ai-hint",4,"ngIf"],["class","ai-loading",4,"ngIf"],["class","ai-parsed",4,"ngIf"],["class","ai-examples",4,"ngIf"],[1,"ai-fab-icon"],[1,"ai-hint"],[1,"ai-loading"],["diameter","24","mode","indeterminate"],[1,"ai-parsed"],[1,"ai-parsed-header"],[1,"ai-check-icon"],[1,"ai-edit-link",3,"click"],[1,"ai-fields"],[1,"ai-field"],[1,"ai-field-label"],[1,"ai-field-value","title-value"],[1,"ai-field-chip"],["class","ai-field",4,"ngIf"],[1,"ai-parsed-actions"],["mat-button","",1,"ai-reset-btn",3,"click"],["mat-flat-button","",1,"ai-confirm-btn",3,"click","disabled"],[1,"ai-field-value"],[1,"ai-field-value","desc-preview"],[1,"ai-examples"],[1,"ai-examples-title"],[1,"ai-example-pill",3,"click"]],template:function(n,i){if
126(n&1){let s=G();d(0,"button",1),I("click",function(){return y(s),v(i.togglePanel())}),N(1,fn,3,0,"span",2)(2,gn,2,0,"mat-icon",3),l(),d(3,"div",4),I("click",function(a){return y(s),v(a.stopPropagation())}),d(4,"div",5)(5,"div",6)(6,"div",7)(7,"mat-icon"),p(8,"smart_toy"),l()(),d(9,"div")(10,"div",8),p(11,"Kanban Assistant"),l(),d(12,"div",9),p(13,"Describe a task \u2014 I'll handle the rest"),l()()(),d(14,"button",10),I("click",function(){return y(s),v(i.togglePanel())}),d(15,"mat-icon"),p(16,"close"),l()()(),d(17,"div",11)(18,"div",12)(19,"textarea",13,0),ke("ngModelChange",function(a){return y(s),xe(i.userInput,a)||(i.userInput=a),v(a)}),I("ngModelChange",function(a){return y(s),v(i.onInputChange(a))})("keydown.enter",function(a){return y(s),v(i.onEnter(a))}),p(21,"            "),l(),d(22,"button",14),I("click",function(){return y(s),v(i.toggleVoice())}),d(23,"mat-icon"),p(24),l()()(),N(25,hn,8,0,"div",15),l(),N(26,mn,4,0,"div",16)(27,yn,36,11,"div",17)(28,vn,9,0,"div",18),l()}n&2&&(U("panel-open",i.isOpen),C("matTooltip",i.isOpen?"":"Kanban AI Assistant \u2014 Add a task with voice or text"),m(),C("ngIf",!i.isOpen),m(),C("ngIf",i.isOpen),m(),U("visible",i.isOpen),m(16),Oe("ngModel",i.userInput),m(3),U("recording",i.isRecording),C("matTooltip",Re(i.isRecording?"Pause recording":i.userInput?"Resume speaking":"Speak your task"))("disabled",!i.speechSupported),m(2),$(i.isRecording?"pause_circle":"mic"),m(),C("ngIf",!i.parsed&&!i.isLoading),m(),C("ngIf",i.isLoading),m(),C("ngIf",i.parsed&&!i.isLoading),m(),C("ngIf",!i.parsed&&!i.isLoading&&!i.userInput))},dependencies:[Ue,Le,st,tt,nt,it,at,ot,Xe,We,qe,Ve,$e,Ze,pt,ct,rt,Ge,Ne,Ke],styles:[".ai-fab[_ngcontent-%COMP%]{position:fixed;bottom:84px;right:24px;width:52px;height:52px;border-radius:50%;border:none;background:linear-gradient(135deg,#6366f1,#4f46e5);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 20px #6366f173,0 2px 8px #00000026;z-index:1050;transition:all .25s cubic-bezier(.34,1.56,.64,1)}.ai-fab[_ngcontent-%COMP%]:hover{transform:scale(1.1);box-shadow:0 6px 28px #6366f18c,0 3px 10px #0003}.ai-fab.panel-open[_ngcontent-%COMP%]{background:#e2e8f0;color:#64748b;box-shadow:0 2px 8px #0000001f;transform:none}.ai-fab-icon[_ngcontent-%COMP%]{display:flex;align-items:center;animation:_ngcontent-%COMP%_pulse-ring 2.5s ease-in-out infinite}@keyframes _ngcontent-%COMP%_pulse-ring{0%,to{transform:scale(1)}50%{transform:scale(1.08)}}.ai-panel[_ngcontent-%COMP%]{position:fixed;bottom:148px;right:24px;width:380px;background:#fff;border-radius:20px;box-shadow:0 20px 60px #00000029,0 4px 16px #6366f11f;z-index:1049;opacity:0;transform:translateY(20px) scale(.97);pointer-events:none;transition:all .28s cubic-bezier(.34,1.56,.64,1);overflow:hidden;border:1.5px solid rgba(99,102,241,.12);max-height:80vh;overflow-y:auto}.ai-panel.visible[_ngcontent-%COMP%]{opacity:1;transform:translateY(0) scale(1);pointer-events:all}.ai-panel-header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:16px 16px 12px;background:linear-gradient(135deg,#6366f1,#4f46e5);color:#fff}.ai-panel-title[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px}.ai-avatar[_ngcontent-%COMP%]{width:38px;height:38px;border-radius:50%;background:#fff3;display:flex;align-items:center;justify-content:center}.ai-avatar[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:22px;color:#fff}.ai-name[_ngcontent-%COMP%]{font-size:14px;font-weight:700}.ai-subtitle[_ngcontent-%COMP%]{font-size:11px;opacity:.8}.ai-close-btn[_ngcontent-%COMP%]{color:#fffc!important}.ai-input-area[_ngcontent-%COMP%]{padding:14px 14px 0}.ai-input-row[_ngcontent-%COMP%]{display:flex;gap:8px;align-items:flex-start}.ai-textarea[_ngcontent-%COMP%]{flex:1;border:1.5px solid #e2e8f0;border-radius:10px;padding:10px 12px;font-size:13px;line-height:1.5;color:#1e293b;resize:none;outline:none;font-family:inherit;background:#f8fafc;transition:border-color .2s}.ai-textarea[_ngcontent-%COMP%]:focus{border-color:#6366f1;background:#fff;box-shadow:0 0 0 3px #6366f11a}.ai-mic-btn[_ngcontent-%COMP%]{width:40px;height:40px;border-radius:50%;border:none;background:#f1f5f9;cursor:pointer;display:flex;align-items:center;justify-content:center;color:#6366f1;transition:all .2s;flex-shrink:0;margin-top:1px}.ai-mic-btn[_ngcontent-%COMP%]:hover{background:#eef2ff}.ai-mic-btn.recording[_ngcontent-%COMP%]{background:#fef2f2;color:#ef4444;animation:_ngcontent-%COMP%_mic-pulse 1s ease-in-out infinite}.ai-mic-btn[_ngcontent-%COMP%]:disabled{opacity:.4;cursor:not-allowed}@keyframes _ngcontent-%COMP%_mic-pulse{0%,to{transform:scale(1)}50%{transform:scale(1.08)}}.ai-hint[_ngcontent-%COMP%]{font-size:11px;color:#94a3b8;padding:6px 4px 8px;display:flex;gap:4px;align-items:center}.ai-hint[_ngcontent-%COMP%]   kbd[_ngcontent-%COMP%]{background:#f1f5f9;border:1px solid #e2e8f0;border-radius:4px;padding:1px 5px;font-size:10px;font-family:inherit;color:#475569}.ai-loading[_ngcontent-%COMP%]{display:flex;align-items:center;gap:10px;padding:16px 14px;color:#6366f1;font-size:13px;font-weight:500}.ai-parsed[_ngcontent-%COMP%]{padding:12px 14px 0}.ai-parsed-header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;margin-bottom:10px;font-size:13px;font-weight:600;color:#0f172a}.ai-check-icon[_ngcontent-%COMP%]{color:#10b981;font-size:18px}.ai-edit-link[_ngcontent-%COMP%]{margin-left:auto;font-size:11px;color:#6366f1;background:none;border:none;cursor:pointer;text-decoration:underline;font-family:inherit;padding:0}.ai-fields[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px}.ai-field[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:8px}.ai-field-label[_ngcontent-%COMP%]{font-size:11px;color:#94a3b8;min-width:70px;padding-top:2px;white-space:nowrap}.ai-field-value[_ngcontent-%COMP%]{font-size:13px;color:#1e293b;font-weight:500;line-height:1.4}.title-value[_ngcontent-%COMP%]{font-weight:600}.desc-preview[_ngcontent-%COMP%]{font-size:12px;color:#64748b;font-weight:400}.ai-field-chip[_ngcontent-%COMP%]{font-size:11px;font-weight:600;padding:2px 10px;border-radius:12px;display:inline-block}[data-status=backlog][_ngcontent-%COMP%]{background:#f1f5f9;color:#64748b}[data-status=todo][_ngcontent-%COMP%]{background:#eff6ff;color:#1d4ed8}[data-status=in_progress][_ngcontent-%COMP%]{background:#fffbeb;color:#b45309}[data-status=complete][_ngcontent-%COMP%], [data-priority=low][_ngcontent-%COMP%]{background:#f0fdf4;color:#15803d}[data-priority=medium][_ngcontent-%COMP%]{background:#fff7ed;color:#c2410c}[data-priority=high][_ngcontent-%COMP%]{background:#fef2f2;color:#b91c1c}[data-priority=urgent][_ngcontent-%COMP%]{background:#f5f3ff;color:#6d28d9}.ai-parsed-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;
126gap:8px;margin-top:14px;padding:12px 0;border-top:1px solid #f1f5f9}.ai-reset-btn[_ngcontent-%COMP%]{color:#94a3b8!important;font-size:12px!important}.ai-confirm-btn[_ngcontent-%COMP%]{background:linear-gradient(135deg,#6366f1,#4f46e5)!important;color:#fff!important;font-weight:600;font-size:13px;border-radius:8px;gap:4px}.ai-confirm-btn[_ngcontent-%COMP%]   mat-icon[_ngcontent-%COMP%]{font-size:16px;height:16px;width:16px}.ai-examples[_ngcontent-%COMP%]{padding:10px 14px 14px}.ai-examples-title[_ngcontent-%COMP%]{font-size:11px;color:#94a3b8;margin-bottom:8px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}.ai-example-pill[_ngcontent-%COMP%]{font-size:12px;color:#6366f1;background:#eef2ff;border-radius:8px;padding:8px 10px;margin-bottom:6px;cursor:pointer;line-height:1.4;border:1px solid #e0e7ff;transition:background .15s;font-style:italic}.ai-example-pill[_ngcontent-%COMP%]:hover{background:#e0e7ff}"]})};export{xt as KanbanAiAssistantComponent};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.