MCPcopy Index your code
hub / github.com/google/adk-python / P2

Function P2

src/google/adk/cli/browser/main-3CUQG2IN.js:431–431  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

429.jse-color-picker-button.svelte-13mgyo6:not(.jse-readonly) {
430 cursor: pointer;
431}`);var DIA=TA('<button type="button"></button>');function vIA(i,e){Jt(e,!1);var A=cA(void 0,!0),t=cA(void 0,!0),{openAbsolutePopup:n}=s1("absolute-popup"),o=K(e,"path",9),a=K(e,"value",9),r=K(e,"readOnly",9),s=K(e,"onPatch",9),l=K(e,"focus",9);function g(u){s()([{op:"replace",path:xt(o()),value:u}]),C()}function C(){l()()}KA(()=>Y(a()),()=>{N(A,vq(a()))}),KA(()=>(Y(r()),Y(a())),()=>{N(t,r()?"Color ".concat(a()):"Click to open a color picker")}),Vn(),di(!0);var d,B=DIA();Le(()=>{var u;d=Ci(B,1,"jse-color-picker-button svelte-13mgyo6",null,d,{"jse-readonly":r()}),wg(B,"background: ".concat((u=c(A))!==null&&u!==void 0?u:"")),jn(B,"title",c(t)),jn(B,"aria-label",c(t))}),De("click",B,function(u){var E,f;if(!r()){var m=u.target,v=m.getBoundingClientRect().top,S=((E=(f=Ip(m))===null||f===void 0?void 0:f.innerHeight)!==null&&E!==void 0?E:0)-v<300&&v>300,k={color:a(),onChange:g,showOnTop:S};n(yIA,k,{anchor:m,closeOnOuterClick:!0,onClose:C,offsetTop:18,offsetLeft:-8,height:300})}}),sA(i,B),Yt()}var a_=1e3,Z4=100,fw=100,jw=2e4,Jh=[{start:0,end:Z4}],bIA=1048576,MIA=1048576,r_=10485760,s_="Insert or paste contents, enter [ insert a new array, enter { to insert a new object, or start typing to insert a new value",Ix="Open context menu (Click here, right click on the selection, or use the context menu button or Ctrl+Q)",Ud="hover-insert-inside",mw="hover-insert-after",Fj="hover-collection",l_="valid",Lj="repairable",wC=336,yC=260,J4=100,Gj={[pg.asc]:"ascending",[pg.desc]:"descending"};function Tq(i){for(var e=rF(i,r=>r.start),A=[e[0]],t=0;t<e.length;t++){var n=A.length-1,o=A[n],a=e[t];a.start<=o.end?A[n]={start:Math.min(o.start,a.start),end:Math.max(o.end,a.end)}:A.push(a)}return A}function F_(i){return Vw(i)+Z4}function Vw(i){return Math.floor(i/Z4)*Z4}function L_(i){return!!i&&(i.type==="space"||i.space===!0)}function P2(i){return!!i&&(i.type==="separator"||i.separator===!0)}function Kj(i){return!!i&&i.type==="label"&&typeof i.text=="string"}function pC(i){return!!i&&typeof i.onClick=="function"}function vh(i){return!!i&&i.type==="dropdown-button"&&pC(i.main)&&Array.isArray(i.items)}function Uj(i){return!!i&&i.type==="row"&&Array.isArray(i.items)}function Tj(i){return!!i&&i.type==="column"&&Array.isArray(i.items)}function Oj(i){return Jn(i)&&Jn(i.parseError)}function SIA(i){return Jn(i)&&Array.isArray(i.validationErrors)}function kIA(i){return Jn(i)&&Array.isArray(i.path)&&typeof i.message=="string"&&"severity"in i}function _IA(i){return Jn(i)&&kIA(i)&&typeof i.isChildError=="boolean"}function xIA(i){return Jn(i)&&typeof i.action=="function"&&Jn(i.props)}function Il(i){return i!==void 0&&i.type==="object"}function cr(i){return i!==void 0&&i.type==="array"}function Bx(i){return i!==void 0&&i.type==="value"}function iI(i){return Il(i)||cr(i)}function Oq(i){return i!==void 0&&Array.isArray(i.searchResults)}function qw(i){return!!i&&i.type==="tree"}function Jj(i){return!!i&&i.type==="text"}function Yj(i){return!!i&&i.type==="mode"}function G_(i){var{json:e,expand:A}=i,t=(function(n){var{json:o,factory:a}=n;return Array.isArray(o)?a.createArrayDocumentState():Jn(o)?a.createObjectDocumentState():o!==void 0?a.createValueDocumentState():void 0})({json:e,factory:Qx});return A&&t?Bc(e,t,[],A):t}function hx(){var{expanded:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{expanded:!1};return{type:"array",expanded:i,visibleSections:Jh,items:[]}}function Ex(){var{expanded:i}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{expanded:!1};return{type:"object",expanded:i,properties:{}}}var Qx={createObjectDocumentState:Ex,createArrayDocumentState:hx,createValueDocumentState:function(){return{type:"value"}}};function Jq(i,e,A,t){var{createObjectDocumentState:n,createArrayDocumentState:o,createValueDocumentState:a}=t;return(function r(s,l,g){if(Array.isArray(s)){var C=cr(l)?l:o();if(g.length===0)return C;var d=Or(g[0]),B=r(s[d],C.items[d],g.slice(1));return qr(C,["items",g[0]],B)}if(Jn(s)){var u=Il(l)?l:n();if(g.length===0)return u;var E=g[0],f=r(s[E],u.properties[E],g.slice(1));return qr(u,["properties",E],f)}return Bx(l)?l:a()})(i,e,A)}function Tl(i,e){return X4(i,e,arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],(A,t)=>{if(A!==void 0&&t!==void 0)return Array.isArray(A)?cr(t)?t:hx({expanded:!!iI(t)&&t.expanded}):Jn(A)?Il(t)?t:Ex({expanded:!!iI(t)&&t.expanded}):Bx(t)?t:void 0},()=>!0)}function X4(i,e,A,t,n){var o=t(i,e,A);if(Array.isArray(i)&&cr(o)&&n(o)){var a=[];return ux(i,o.visibleSections,s=>{var l=A.concat(String(s)),g=X4(i[s],o.items[s],l,t,n);g!==void 0&&(a[s]=g)}),Mj(a,o.items)?o:Fe(Fe({},o),{},{items:a})}if(Jn(i)&&Il(o)&&n(o)){var r={};return Object.keys(i).forEach(s=>{var l=A.concat(s),g=X4(i[s],o.properties[s],l,t,n);g!==void 0&&(r[s]=g)}),Mj(Object.values(r),Object.values(o.properties))?o:Fe(Fe({},o),{},{properties:r})}return o}function ux(i,e,A){e.forEach(t=>{var{start:n,end:o}=t;bq(n,Math.min(i.length,o),A)})}function $4(i,e){for(var A=i,t=[],n=0;n<e.length;){if(Array.isArray(A)){var o=e[n];t.push("items",o),A=A[Or(o)]}else{if(!Jn(A))throw new Error("Cannot convert path: Object or Array expected at index ".concat(n));var a=e[n];t.push("properties",a),A=A[a]}n++}return t}function Bc(i,e,A,t){for(var n=e,o=function(r){var s=A.slice(0,r);n=AE(i,n,s,(l,g)=>{var C=iI(g)&&!g.expanded?Fe(Fe({},g),{},{expanded:!0}):g;return cr(C)?(function(d,B){if((function(f,m){return f.some(v=>m>=v.start&&m<v.end)})(d.visibleSections,B))return d;var u=Vw(B),E={start:u,end:F_(u)};return Fe(Fe({},d),{},{visibleSections:Tq(d.visibleSections.concat(E))})})(C,Or(A[r])):C})},a=0;a<A.length;a++)o(a);return AE(i,n,A,(r,s)=>(function(l,g,C,d){return X4(l,g,C,(B,u,E)=>Array.isArray(B)&&d(E)?cr(u)?u.expanded?u:Fe(Fe({},u),{},{expanded:!0}):hx({expanded:!0}):Jn(B)&&d(E)?Il(u)?u.expanded?u:Fe(Fe({},u),{},{expanded:!0}):Ex({expanded:!0}):u,B=>iI(B)&&B.expanded)})(r,s,[],t))}function Hj(i,e,A,t){return AE(i,e,A,(n,o)=>t?(function(a,r,s){return X4(a,r,s,(l,g)=>zj(g),()=>!0)})(n,o,A):zj(o))}function zj(i){return cr(i)&&i.expanded?Fe(Fe({},i),{},{expanded:!1,visibleSections:Jh}):Il(i)&&i.expanded?Fe(Fe({},i),{},{expanded:!1}):i}function Yq(i,e,A){var t={json:i,documentState:e},n=A.reduce((o,a)=>({json:ol(o.json,[a]),documentState:RIA(o.json,o.documentState,a)}),t);return{json:n.json,documentState:Tl(n.json,n.documentState)}}function RIA(i,e,A){if(oM(A))return Pj(i,e,A,void 0);if(aM(A))return jj(i,e,A);if(B6(A)){var t=al(i,A.path),n=m0(i,e,t);return n?I5(i,e,t,{type:"value",enforceString:n}):e}return h6(A)||u2(A)?(function(o,a,r){if(u2(r)&&r.from===r.path)return a;var s=a,l=al(o,r.from),g=Q0(o,s,l);return u2(r)&&(s=jj(o,s,{path:r.from})),s=Pj(o,s,{path:r.path},g),s})(i,e,A):e}function Q0(i,e,A){try{return $e(e,$4(i,A))}catch(t){return}}function px(i,e,A,t,n){var o=Jq(i,e,A,n);return Su(o,$4(i,A),a=>{var r=$e(i,A);return t(r,a)})}function I5(i,e,A,t){return(function(n,o,a,r,s){var l=Jq(n,o,a,s);return qr(l,$4(n,a),r)})(i,e,A,t,Qx)}function AE(i,e,A,t){return px(i,e,A,t,Qx)}function Pj(i,e,A,t){var n=al(i,A.path),o=e;return o=AE(i,o,an(n),(a,r)=>{if(!cr(r))return r;var s=Or(Ji(n)),{items:l,visibleSections:g}=r;return Fe(Fe({},r),{},{items:s<l.length?qdA(l,s,t!==void 0?[t]:Array(1)):l,visibleSections:Hq(g,s,1)})}),I5(i,o,n,t)}function jj(i,e,A){var t=al(i,A.path),n=an(t),o=$e(i,n);return Array.isArray(o)?AE(i,e,n,(a,r)=>{if(!cr(r))return r;var s=Or(Ji(t)),{items:l,visibleSections:g}=r;return Fe(Fe({},r),{},{items:l.slice(0,s).concat(l.slice(s+1)),visibleSections:Hq(g,s,-1)})}):(function(a,r,s){var l=$4(a,s);return Fr(r,l)?cd(r,$4(a,s)):r})(i,e,t)}function Hq(i,e,A){return(function(t){for(var n=t.slice(0),o=1;o<n.length;)n[o-1].end===n[o].start&&(n[o-1]={start:n[o-1].start,end:n[o].end},n.splice(o)),o++;return n})(i.map(t=>({start:t.start>e?t.start+A:t.start,end:t.end>e?t.end+A:t.end})))}function m0(i,e,A){var t,n=$e(i,A),o=Q0(i,e,A),a=Bx(o)?o.enforceString:void 0;return typeof a=="boolean"?a:typeof(t=n)=="string"&&typeof cE(t,JSON)!="string"}function hp(i,e){var A=arguments.length>2&&arguments[2]!==void 0&&arguments[2],t=i.indexOf(e);return t!==-1?A?i.slice(t):i.slice(t+1):[]}function fx(i,e){var A=[];return(function t(n,o,a){A.push(a),sa(n)&&cr(o)&&o.expanded&&ux(n,o.visibleSections,r=>{t(n[r],o.items[r],a.concat(String(r)))}),Ea(n)&&Il(o)&&o.expanded&&Object.keys(n).forEach(r=>{t(n[r],o.properties[r],a.concat(r))})})(i,e,[]),A}function zq(i,e){var A=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2],t=[];return(function n(o,a){t.push({path:a,type:hc.value});var r=Q0(i,e,a);if(o&&iI(r)&&r.expanded){if(A&&t.push({path:a,type:hc.inside}),sa(o)){var s=cr(r)?r.visibleSections:Jh;ux(o,s,l=>{var g=a.concat(String(l));n(o[l],g),A&&t.push({path:g,type:hc.after})})}Ea(o)&&Object.keys(o).forEach(l=>{var g=a.concat(l);t.push({path:g,type:hc.key}),n(o[l],g),A&&t.push({path:g,type:hc.after})})}})(i,[]),t}function g_(i,e,A){var t=fx(i,e),n=t.map(xt).indexOf(xt(A));if(n!==-1&&n<t.length-1)return t[n+1]}function nI(i,e,A){var t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:10240;return Bc(i,e,A,ZdA({json:$e(i,A)},t)?Y4:mx)}function c_(i,e,A){var t=Q0(i,e,A);return iI(t)&&t.expanded?e:nI(i,e,A)}function Y4(i){return i.length===0||i.length===1&&i[0]==="0"}function K_(i){return i.length===0}function mx(){return!0}function Kw(){return!1}function hl(i){return i&&i.type===fo.after||!1}function nr(i){return i&&i.type===fo.inside||!1}function Cr(i){return i&&i.type===fo.key||!1}function bn(i){return i&&i.type===fo.value||!1}function bo(i){return i&&i.type===fo.multi||!1}function B5(i){return bo(i)&&Ui(i.focusPath,i.anchorPath)}function Ap(i){return bo(i)||hl(i)||nr(i)||Cr(i)||bn(i)}function C_(i){return i&&i.type===fo.text||!1}function a1(i,e){var A=[];return(function(t,n,o){if(n){var a=qd(n),r=Qt(n);if(Ui(a,r))return o(a);if(t!==void 0){var s=jq(a,r);if(a.length===s.length||r.length===s.length)return o(s);var l=vs(a,r),g=DC(t,l),C=n1(t,l),d=kC(t,l,g),B=kC(t,l,C);if(!(d===-1||B===-1)){var u=$e(t,s);if(Ea(u)){for(var E=Object.keys(u),f=d;f<=B;f++){var m=o(s.concat(E[f]));if(m!==void 0)return m}return}if(sa(u)){for(var v=d;v<=B;v++){var S=o(s.concat(String(v)));if(S!==void 0)return S}return}throw new Error("Failed to create selection")}}}})(i,e,t=>{A.push(t)}),A}function Pq(i){return nr(i)?i.path:an(Qt(i))}function DC(i,e){if(!bo(e))return e.path;var A=kC(i,e,e.anchorPath);return kC(i,e,e.focusPath)<A?e.focusPath:e.anchorPath}function n1(i,e){if(!bo(e))return e.path;var A=kC(i,e,e.anchorPath);return kC(i,e,e.focusPath)>A?e.focusPath:e.anchorPath}function Vj(i,e,A){var t=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(A){var n=t?Qt(A):DC(i,A),o=(function(s,l,g){var C=fx(s,l),d=C.map(xt),B=xt(g),u=d.indexOf(B);if(u!==-1&&u>0)return C[u-1]})(i,e,n);if(t)return nr(A)||hl(A)?o!==void 0?vs(n,n):void 0:o!==void 0?vs(qd(A),o):void 0;if(hl(A)||nr(A))return en(n);if(Cr(A)){if(o===void 0||o.length===0)return;var a=an(o),r=$e(i,a);return Array.isArray(r)||An(o)?en(o):NC(o)}return bn(A),o!==void 0?en(o):void 0}}function qj(i,e,A,t){if(!A)return{caret:void 0,previous:void 0,next:void 0};var n=zq(i,e,t),o=n.findIndex(a=>Ui(a.path,Qt(A))&&String(a.type)===String(A.type));return{caret:o!==-1?n[o]:void 0,previous:o!==-1&&o>0?n[o-1]:void 0,next:o!==-1&&o<n.length-1?n[o+1]:void 0}}function bh(i,e){for(var A=fx(i,e),t=0;t<A.length-1&&A[t+1].length>A[t].length;)t++;var n=A[t];return n===void 0||n.length===0||Array.isArray($e(i,an(n)))?en(n):NC(n)}function eE(i,e){if(e.length===1){var A=Tc(e);if(A.op==="replace")return en(al(i,A.path))}if(!An(e)&&e.every(a=>a.op==="move")){var t=Tc(e),n=e.slice(1);if((h6(t)||u2(t))&&t.from!==t.path&&n.every(a=>(h6(a)||u2(a))&&a.from===a.path))return NC(al(i,t.path))}var o=e.filter(a=>a.op!=="test"&&a.op!=="remove"&&(a.op!=="move"||a.from!==a.path)&&typeof a.path=="string").map(a=>al(i,a.path));if(!An(o))return{type:fo.multi,anchorPath:Tc(o),focusPath:Ji(o)}}function jq(i,e){for(var A=0;A<i.length&&A<e.length&&i[A]===e[A];)A++;return i.slice(0,A)}function Ww(i){return Cr(i)||bn(i)||B5(i)}function Wj(i,e){return Ww(e)&&ua($e(i,Qt(e)))?Qt(e):an(Qt(e))}function v0(i,e){if(i.length<e.length)return!1;for(var A=0;A<e.length;A++)if(i[A]!==e[A])return!1;return!0}function p0(i){if(gr(i)){var{type:e,path:A}=i;return{type:e,path:A}}return i}function NC(i){return{type:fo.key,path:i}}function wx(i,e){return{type:fo.key,path:i,edit:!0,initialValue:e}}function en(i){return{type:fo.value,path:i}}function Zw(i,e){return{type:fo.value,path:i,edit:!0,initialValue:e}}function FC(i){return{type:fo.inside,path:i}}function SC(i){return{type:fo.after,path:i}}function vs(i,e){var A=jq(i,e),t=i.length>A.length&&e.length>A.length;return{type:fo.multi,anchorPath:t?A.concat(i[A.length]):A,focusPath:t?A.concat(e[A.length]):A}}function Vq(i,e,A,t){if(Cr(e))return String(Ji(e.path));if(bn(e)){var n=$e(i,e.path);return typeof n=="string"?n:t.stringify(n,null,A)}if(bo(e)){if(An(e.focusPath))return t.stringify(i,null,A);var o=Pq(e),a=$e(i,o);if(Array.isArray(a)){if(B5(e)){var r=$e(i,e.focusPath);return t.stringify(r,null,A)}return a1(i,e).map(s=>{var l=$e(i,s);return"".concat(t.stringify(l,null,A),",")}).join(`
432`)}return a1(i,e).map(s=>{var l=Ji(s),g=$e(i,s);return"".concat(t.stringify(l),": ").concat(t.stringify(g,null,A),",")}).join(`
433`)}}function gr(i){return(Cr(i)||bn(i))&&i.edit===!0}function Lh(i){return Cr(i)||bn(i)||bo(i)}function ww(i){return Cr(i)||bn(i)||B5(i)}function U_(i){switch(i.type){case hc.key:return NC(i.path);case hc.value:return en(i.path);case hc.after:return SC(i.path);case hc.inside:return FC(i.path)}}function Zj(i,e){switch(i){case fo.key:return NC(e);case fo.value:return en(e);case fo.after:return SC(e);case fo.inside:return FC(e);case fo.multi:case fo.text:return vs(e,e)}}function yw(i,e,A){if(e)return ep(i,e,A)||v0(bo(e)?an(e.focusPath):e.path,A)?e:void 0}function ep(i,e,A){if(i===void 0||!e)return!1;if(Cr(e)||nr(e)||hl(e))return Ui(e.path,A);if(bn(e))return v0(A,e.path);if(bo(e)){var t=DC(i,e),n=n1(i,e),o=an(e.focusPath);if(!v0(A,o)||A.length<=o.length)return!1;var a=kC(i,e,t),r=kC(i,e,n),s=kC(i,e,A);return s!==-1&&s>=a&&s<=r}return!1}function kC(i,e,A){var t=an(e.focusPath);if(!v0(A,t)||A.length<=t.length)return-1;var n=A[t.length],o=$e(i,t);if(Ea(o))return Object.keys(o).indexOf(n);if(sa(o)){var a=Or(n);if(a<o.length)return a}return-1}function Qt(i){return bo(i)?i.focusPath:i.path}function qd(i){return bo(i)?i.anchorPath:i.path}function wc(){for(var i=[],e=arguments.length,A=new Array(e),t=0;t<e;t++)A[t]=arguments[t];for(var n of A)if(typeof n=="string"&&i.push(n),n&&typeof n=="object")for(var o in n)Object.hasOwnProperty.call(n,o)&&n[o]&&i.push(o);return i.join(" ")}function qq(i,e,A){return wc("jse-value","jse-"+sx(i,A),{"jse-url":d5(i),"jse-empty":typeof i=="string"&&i.length===0,"jse-table-cell":e===xa.table})}oi(`/* over all fonts, sizes, and colors */
434/* "consolas" for Windows, "menlo" for Mac with fallback to "monaco", 'Ubuntu Mono' for Ubuntu */

Callers 4

p5Function · 0.85
qeFunction · 0.85
hAFunction · 0.85
eAFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected