react-semaphor 0.1.449 → 0.1.454
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.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +119 -112
- package/dist/appearance/index.cjs +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/brand-studio/index.cjs +4 -4
- package/dist/brand-studio/index.js +15 -13
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +39 -2131
- package/dist/chunks/{analyze-result-contract-T-0Ntzys.js → analyze-result-contract-BbRJ-C06.js} +1 -1
- package/dist/chunks/{analyze-result-contract-BHb7sUUW.cjs → analyze-result-contract-LPDNldic.cjs} +1 -1
- package/dist/chunks/canonical-result-keys-BA0HCP4e.cjs +1 -0
- package/dist/chunks/canonical-result-keys-D6avdjpA.js +467 -0
- package/dist/chunks/color-CJvdlFM_.js +2162 -0
- package/dist/chunks/color-CyB5o13F.cjs +4 -0
- package/dist/chunks/{common-types-CQ6SHfLk.cjs → common-types-C57kJ59w.cjs} +1 -1
- package/dist/chunks/{common-types-B7Jk3Rtj.js → common-types-H51FLKB7.js} +1 -1
- package/dist/chunks/contracts-CoCOpd_i.js +11 -0
- package/dist/chunks/contracts-CtB2VONT.cjs +1 -0
- package/dist/chunks/dashboard-briefing-launcher-Dwj1i7lr.cjs +26 -0
- package/dist/chunks/{dashboard-briefing-launcher-DCHiEkLE.js → dashboard-briefing-launcher-SYroFdae.js} +86 -84
- package/dist/chunks/{dashboard-controls-DwRFCcHV.js → dashboard-controls-1LpeU2sz.js} +15 -13
- package/dist/chunks/{dashboard-controls-CaFioayc.cjs → dashboard-controls-CpFoh7-A.cjs} +1 -1
- package/dist/chunks/dashboard-date-comparison-definition-Ces4alFm.cjs +1 -0
- package/dist/chunks/{dashboard-date-comparison-definition-Ba-clViK.js → dashboard-date-comparison-definition-DC3ekV2S.js} +1 -1
- package/dist/chunks/{dashboard-json-WoILbfTe.js → dashboard-json-D-T-sQxU.js} +25 -23
- package/dist/chunks/dashboard-json-DwSQopc_.cjs +1 -0
- package/dist/chunks/edit-dashboard-visual-BEmoQAET.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-ciFhxqaI.js → edit-dashboard-visual-DqxUq4Bs.js} +6925 -6947
- package/dist/chunks/editor-action-buttons-18r2xwei.cjs +16 -0
- package/dist/chunks/{editor-action-buttons-BPo_45pM.js → editor-action-buttons-B2l3WIRC.js} +41 -39
- package/dist/chunks/format-types-CFHQoIuk.js +1350 -0
- package/dist/chunks/format-types-PSZZ7hG8.cjs +1 -0
- package/dist/chunks/index-Bn5wlkHt.cjs +4 -0
- package/dist/chunks/index-ByFbacH7.cjs +1 -0
- package/dist/chunks/index-CACdoqu3.js +318 -0
- package/dist/chunks/index-CLB_NGZ8.cjs +1392 -0
- package/dist/chunks/index-Ca784dpx.js +3714 -0
- package/dist/chunks/{index-CPuawpXJ.js → index-DAoS4BNU.js} +48514 -48484
- package/dist/chunks/index-DSKR3nKn.js +421 -0
- package/dist/chunks/index-F25jnH0p.cjs +1 -0
- package/dist/chunks/matrix-result-contract-CofATICL.js +437 -0
- package/dist/chunks/matrix-result-contract-zamd9euI.cjs +1 -0
- package/dist/chunks/pivot-header-presentation-DhyQXxKq.cjs +4 -0
- package/dist/chunks/pivot-header-presentation-ckYOQ4aZ.js +557 -0
- package/dist/chunks/{pivot-result-identity-CDLRT-YG.cjs → pivot-result-identity-Bb4EixVN.cjs} +1 -1
- package/dist/chunks/{pivot-result-identity-CwJWpKI7.js → pivot-result-identity-DU1v-5Xk.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-DmcF1ris.cjs +1 -0
- package/dist/chunks/pivot-result-lifecycle-sjzIOpvp.js +1641 -0
- package/dist/chunks/raw-temporal-contract-BtjH_G-d.cjs +1 -0
- package/dist/chunks/raw-temporal-contract-CxncLze5.js +64 -0
- package/dist/chunks/report-preferences-dialog-BgSvlDXa.cjs +1 -0
- package/dist/chunks/report-preferences-dialog-DDc2WUa0.js +723 -0
- package/dist/chunks/{report-runtime-context-C8LZFsqV.cjs → report-runtime-context-DqxS4wbi.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-bCy3CVzK.js → report-runtime-context-SM6YO61_.js} +5 -5
- package/dist/chunks/saved-temporal-bucket-format-CFfWXRl9.cjs +1 -0
- package/dist/chunks/saved-temporal-bucket-format-SGAV0ivR.js +922 -0
- package/dist/chunks/{switch-BXet-Sno.js → switch-BeZW-HnS.js} +4350 -5249
- package/dist/chunks/switch-D-CCcfhc.cjs +138 -0
- package/dist/chunks/temporal-bucket-5UYEotyQ.js +810 -0
- package/dist/chunks/temporal-bucket-DHY1y9lq.cjs +1 -0
- package/dist/chunks/temporal-bucket-authoring-K1kE6R_z.js +222 -0
- package/dist/chunks/temporal-bucket-authoring-o3Emn05L.cjs +1 -0
- package/dist/chunks/{temporal-bucket-contract-ChDBWX8I.cjs → temporal-bucket-contract-D2-93DGr.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-contract-_F6vNhhH.js → temporal-bucket-contract-D5d-xEl3.js} +1 -1
- package/dist/chunks/{token-types-BdQ8kHBm.cjs → token-types-D7CaaI80.cjs} +1 -1
- package/dist/chunks/{token-types-BHR58aTy.js → token-types-GbxRUozo.js} +1 -1
- package/dist/chunks/{update-policy-BxvYMYz0.cjs → update-policy-BmiOd0PB.cjs} +1 -1
- package/dist/chunks/{update-policy-g0rCQ9BM.js → update-policy-hednMF-0.js} +1 -1
- package/dist/chunks/validators-BDYprKI9.cjs +1 -0
- package/dist/chunks/{validators-Cs74WVie.js → validators-DEmd8Sin.js} +1561 -1197
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +35 -32
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +78 -77
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +29 -30
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +21 -21
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +156 -140
- package/dist/index.cjs +1 -1
- package/dist/index.js +157 -155
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +81 -11
- package/dist/types/briefings.d.ts +727 -19
- package/dist/types/dashboard-assistant.d.ts +37 -17
- package/dist/types/dashboard-authoring.d.ts +61 -14
- package/dist/types/dashboard.d.ts +137 -12
- package/dist/types/data-app-builder.d.ts +28 -2
- package/dist/types/data-app-codegen-node.d.ts +29 -3
- package/dist/types/data-app-codegen.d.ts +29 -3
- package/dist/types/data-app-sdk-adapters.d.ts +28 -2
- package/dist/types/data-app-sdk-validation.d.ts +51 -7
- package/dist/types/data-app-sdk.d.ts +55 -10
- package/dist/types/format-utils.d.ts +190 -3
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/main.d.ts +128 -33
- package/dist/types/shared.d.ts +14 -12
- package/dist/types/surfboard.d.ts +138 -13
- package/dist/types/types.d.ts +117 -23
- package/dist/types/value-format-preferences.d.ts +3 -0
- package/package.json +2 -1
- package/dist/chunks/card-config-utils-15sRtebL.cjs +0 -1
- package/dist/chunks/card-config-utils-BYZ5MJOh.js +0 -16
- package/dist/chunks/catalog-field-grounding-Bnx-3tE0.cjs +0 -1
- package/dist/chunks/catalog-field-grounding-S2jKwKGD.js +0 -100
- package/dist/chunks/dashboard-briefing-launcher-DDgDr2s3.cjs +0 -26
- package/dist/chunks/dashboard-date-comparison-definition-DZq0htjG.cjs +0 -1
- package/dist/chunks/dashboard-input-contract-DSt8dGzP.js +0 -18
- package/dist/chunks/dashboard-input-contract-DV3cshjz.cjs +0 -1
- package/dist/chunks/dashboard-json-CYtvwtvj.cjs +0 -1
- package/dist/chunks/edit-dashboard-visual-DwKcvlsF.cjs +0 -177
- package/dist/chunks/editor-action-buttons-BVmsk0Aj.cjs +0 -16
- package/dist/chunks/format-types-CSv0V7mm.cjs +0 -1
- package/dist/chunks/format-types-DZGgYj39.js +0 -1663
- package/dist/chunks/index-CJdxSyQq.js +0 -2578
- package/dist/chunks/index-DPv8_Ild.cjs +0 -1395
- package/dist/chunks/index-DRlMUglg.cjs +0 -4
- package/dist/chunks/metric-comparison-97zHGEx5.js +0 -387
- package/dist/chunks/metric-comparison-CUAJ8n4y.cjs +0 -1
- package/dist/chunks/pivot-result-lifecycle-BBabQ_da.js +0 -914
- package/dist/chunks/pivot-result-lifecycle-DPc0ANwk.cjs +0 -4
- package/dist/chunks/presentation-execution-BLfPTGX_.js +0 -637
- package/dist/chunks/presentation-execution-BTV-Q43g.cjs +0 -1
- package/dist/chunks/report-preferences-dialog-D9ZCGh9l.js +0 -691
- package/dist/chunks/report-preferences-dialog-DaqTEcac.cjs +0 -1
- package/dist/chunks/switch-Cjk6G06r.cjs +0 -138
- package/dist/chunks/temporal-bucket-BnPxGrAi.js +0 -446
- package/dist/chunks/temporal-bucket-authoring-CPTwHzvs.cjs +0 -1
- package/dist/chunks/temporal-bucket-authoring-CgOuakGW.js +0 -205
- package/dist/chunks/temporal-bucket-pMnV-4Nj.cjs +0 -1
- package/dist/chunks/temporal-result-owner-6peubmhU.js +0 -443
- package/dist/chunks/temporal-result-owner-f6-i65Fb.cjs +0 -1
- package/dist/chunks/validators-9D4KBqKD.cjs +0 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";const J=require("./x-B6ghREd2.cjs"),v=require("react"),s=require("./switch-D-CCcfhc.cjs"),f=require("./index-CLB_NGZ8.cjs"),e=require("react/jsx-runtime");require("./saved-temporal-bucket-format-CFfWXRl9.cjs");require("./validators-BDYprKI9.cjs");require("./analyze-result-contract-LPDNldic.cjs");require("../value-format-preferences/index.cjs");const ge=require("./search-BqqhaMx9.cjs"),Fe=require("./index-Bn5wlkHt.cjs"),Se=require("./save-3dYRmehL.cjs");/**
|
|
2
|
+
* @license lucide-react v0.453.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Ve=J.createLucideIcon("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
|
|
7
|
+
* @license lucide-react v0.453.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const je=J.createLucideIcon("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/**
|
|
12
|
+
* @license lucide-react v0.453.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const ke=J.createLucideIcon("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);function Ie(r){const[a,l]=v.useState(null),[n,d]=v.useState(null),u=f.useEnsureReactGlobals();return v.useEffect(()=>{if(!r||r.trim()===""){l(null),d(null);return}if(!u)return;(async()=>{try{if(!r.startsWith("http://")&&!r.startsWith("https://"))throw new Error(`Invalid URL format: ${r}`);try{new URL(r)}catch{throw new Error(`Invalid URL: ${r}`)}const p=`${r.endsWith("/")?r:`${r}/`}index.js`;try{if(!(await fetch(p,{method:"HEAD"})).ok)throw new Error(`Module not found at ${p}`)}catch{}const C=await import(p);if(typeof C.useChartStore!="function")throw new Error("useChartStore is not a function");l(()=>C.useChartStore),d(null)}catch(x){const p=x instanceof Error?x.message:"Unknown error";console.error("Failed to load remote chart store:",p),d(p),l(null)}})()},[r,u]),a}function Te(r,a){if(r.length===0)return"";const l=r.find(n=>{var d,u;return((d=n.customCardPreferences)==null?void 0:d.visualType)==="multiple"||!!((u=n.customCardPreferences)!=null&&u.dataInputCardIds)});if(l)return l.id;if(a){const n=r.find(d=>d.id===a);if(n){const d=n.tabTitle;if(d=="All__Header")return r[0].id;if(d&&d.endsWith("__Header")){const m=d.split("__")[0],x=r.find(p=>p.tabTitle===m);return x?x.id:r[0].id}return a}}return r[0].id}const Le=r=>{if(!r||!("detailTableBackup"in r))return r;const{detailTableBackup:a,...l}=r;return l};async function be(r,a,l,n,d="Opening library visual..."){if(!a||!l)throw new Error("Missing auth token or visual ID");const u=["resource-by-id","visual",l],m=n.getQueryData(u);if(m)return console.log("Using cached visual data for:",l),{data:m,fromCache:!0};console.log("Fetching visual data from network for:",l);const x=f.ue.loading(d,{position:"top-center"});try{const p=await fetch(`${r}/management/v1/visuals/${l}`,{headers:{Authorization:`Bearer ${a}`}});if(!p.ok)throw new Error("Failed to load visual");const C=await p.json();return n.setQueryData(u,C),f.ue.dismiss(x),{data:C,fromCache:!1}}catch(p){throw f.ue.dismiss(x),p}}function Ne(r){if(typeof r=="string")return JSON.parse(r);if(typeof r=="object")return r;throw new Error("Invalid frame object format")}function Ae(r,a){var u,m;const l=(r==null?void 0:r.frameObject)??((u=r==null?void 0:r.visual)==null?void 0:u.frameObject);if(!l)return!1;const n=Ne(l);if(!(n!=null&&n.cards)||n.cards.length===0)return!1;const d=(m=n.cards)==null?void 0:m.find(x=>x.id===n.activeCardId);return d?(f.setupEditorWithCard({...a,frame:n,card:d,visualId:(r==null?void 0:r.id)||n.visualId}),!0):!1}function _e(){const r=s.useEditorStore(n=>{var d;return((d=n.card.customCardPreferences)==null?void 0:d.url)||""}),a=Ie(r);return{getUpdatedFrame:v.useCallback(()=>{var T;f.flushPendingEditorDrafts();const{frame:n,card:d,isDevMode:u,isShowingVisual:m,selectedSchemaName:x,selectedDatamodelId:p,selectedDatabaseName:C,selectedTableName:y,selectedConnectionId:g}=s.useEditorStore.getState(),S=d.sql,D=(T=a==null?void 0:a.getState())==null?void 0:T.settings,k=s.buildSavedEditorCard(d,{isDevMode:u,cardSql:S,isShowingVisual:m,selectedSchemaName:x,selectedDatamodelId:p,selectedDatabaseName:C,selectedTableName:y,selectedConnectionId:g,remoteChartSettings:D,stripConfig:Le}),E=n.cards.map(O=>O.id===d.id?k:O);return{...n,cards:E,activeCardId:Te(E,n.activeCardId)}},[a])}}function ae(){const{authToken:r,tokenProps:a}=f.useSemaphorContext(),l=f.useQueryClient(),n=f.useAddFrameWithFreshSemanticExecutionPayload(),d=f.useSelectedVisual(),{selectVisual:u}=f.useManagementActions(),{setFrame:m,setCard:x,setIsDevMode:p,initializeModeDrafts:C,setActiveTabCardId:y,updateDataSource:g,setQueryResultColumns:S,setSelectedConnectionId:D,setSelectedDatabaseName:k,setSelectedSchemaName:E,setSelectedTableName:T,setSelectedDatamodelId:O,setFilterValues:$,setInlineFilterValuesMap:U,setApplyFilters:R,clearEditorContext:W}=s.useEditorActions(),{setIsDashboardEditing:F,setIsVisualEditing:o,setSelectedFrameId:w,clearSelectedFrameId:Q}=s.useDashboardActions(),B=s.useDashboardStore(A=>A.selectedSheetId),Y=s.useDashboardStore(A=>A.selectedFrameId),H=s.useDashboardStore(A=>A.dashboard),X=s.useDashboardStore(A=>A.filterValues),q=s.useDashboardStore(A=>A.inlineFilterValuesMap),K=f.useVisualById((d==null?void 0:d.id)||"",{enabled:!!(d!=null&&d.id)&&!!(r!=null&&r.accessToken)}),Z=v.useCallback(async A=>{try{u(A),Q(),W();const{data:V,fromCache:P}=await be(a.apiServiceUrl,(r==null?void 0:r.accessToken)||"",A.id,l,"Opening library visual...");if(!Ae(V,{setFrame:m,setCard:x,setIsDevMode:p,initializeModeDrafts:C,setActiveTabCardId:y,updateDataSource:g,setQueryResultColumns:S,setSelectedConnectionId:D,setSelectedDatabaseName:k,setSelectedSchemaName:E,setSelectedTableName:T,setSelectedDatamodelId:O,setFilterValues:$,setInlineFilterValuesMap:U,setApplyFilters:R,setIsDashboardEditing:F,setIsVisualEditing:o,dashboard:H,selectedSheetId:B,selectedFrameId:Y,filterValues:X,inlineFilterValuesMap:q}))throw new Error("Failed to setup editor with visual data");return{success:!0,fromCache:P}}catch(V){return console.error("Error editing visual:",V),{success:!1,error:"Failed to load visual for editing"}}},[r==null?void 0:r.accessToken,a.apiServiceUrl,l,u,m,x,F,o,p,C,y,g,S,D,k,E,T,O,$,U,R,W,Q,H,B,Y,X,q]),ne=v.useCallback(async A=>{var P;const V=_=>(f.ue.error(_),{success:!1,error:_});try{if(u(A),!B)return V("No sheet selected. Please select a sheet first.");const{data:_,fromCache:oe}=await be(a.apiServiceUrl,(r==null?void 0:r.accessToken)||"",A.id,l,"Adding visual to dashboard..."),re=(_==null?void 0:_.frameObject)??((P=_==null?void 0:_.visual)==null?void 0:P.frameObject);if(!re)return V("Visual has no frame data");const z=Ne(re);if(!(z!=null&&z.cards)||z.cards.length===0)return V("Visual frame is malformed");const te={...f.cloneLinkedFrameWithSourceMapping(z),visualId:A.id};return await n(B,te,"end"),F(!0),w(te.id),{success:!0,fromCache:oe}}catch(_){return console.error("Error adding visual:",_),V(_ instanceof Error?_.message:"Failed to add visual to dashboard")}},[r==null?void 0:r.accessToken,a.apiServiceUrl,l,u,B,F,w,n]);return{visual:K.data,isLoading:K.isLoading,isError:K.isError,error:K.error,handleEditLibraryVisual:Z,handleAddLibraryVisual:ne,getUpdatedFrame:_e().getUpdatedFrame,refetch:K.refetch}}function qe(){const r=s.useEditorStore(m=>m.card.dataSource),{setSelectedConnectionId:a,setSelectedDatabaseName:l,setSelectedSchemaName:n,setSelectedTableName:d,setSelectedDatamodelId:u}=s.useEditorActions();v.useEffect(()=>{var D;if(!r)return;const{tableName:m,schemaName:x,databaseName:p,connectionId:C}=f.extractTableMetadata(r),y=(D=r.selectedEntities)==null?void 0:D[0],S=(y==null?void 0:y.type)==="model"&&"id"in y?y.id:"";a(C||""),l(p||""),n(x||""),d(m||""),u(S)},[r,a,l,n,d,u])}function Be(r,a){return{...r,sql:"",python:"",config:void 0,customCfg:"",preferences:{},interactionConfig:void 0,linkedInteractionTargetOverrides:void 0,dynamicCardPreferences:void 0,customCardPreferences:a?r.customCardPreferences:void 0,visualizationMode:"builtin",type:a?r.type:"bar"}}function Ee(){const{setTempQueryData:r}=s.useEditorActions(),a=f.useQueryClient(),l=s.useEditorStore(U=>U.tempQueryData),n=s.useEditorStore(U=>U.card),d=f.useEffectiveEditorCardType(),u=v.useMemo(()=>d!==n.type?{...n,type:d}:n,[n,d]),{queryKey:m}=f.useEditorCardQuery(u),{setCardSql:x,setSqlGen:p,setCardPython:C,setCardCustomCfg:y,setCardPreferences:g,clearQueryConfig:S,setCardConfig:D,setCardType:k,setFrame:E,setCard:T,setActiveTabCardId:O}=s.useEditorActions();function $(){var Q,B,Y,H;const U=a.getQueryData(m);l!=null&&l.queryData||r({queryKey:m,queryData:U}),a.setQueryData(m,null),a.removeQueries({queryKey:m,exact:!0}),x(""),p({}),S(),D(void 0),C(""),y(""),g({});const R=s.useEditorStore.getState().frame,W=s.useEditorStore.getState().card,F=Fe.findCustomVisualConfigCard(R,W),o=((Q=F==null?void 0:F.customCardPreferences)==null?void 0:Q.visualType)==="multiple"||!!((B=F==null?void 0:F.customCardPreferences)!=null&&B.dataInputCardIds)||(((Y=F==null?void 0:F.customCardPreferences)==null?void 0:Y.minInputs)||0)>1||(((H=F==null?void 0:F.customCardPreferences)==null?void 0:H.maxInputs)||0)>1,w=Be(W,o);E({...R,cards:R.cards.map(X=>X.id===w.id?w:X)}),O(w.id),T(w),o||k("bar")}return $}function Me({type:r,isLinked:a,className:l,showLabel:n=!1,showLocal:d=!1}){const u=s.useDashboardStore(E=>E.selectedFrameId),m=f.useManagementStore(E=>E.selectedVisual),x=s.useEditorStore(E=>E.frame);let p;if(r)p=r;else if(a!==void 0)p=a?"linked":"library";else if(!!!(x!=null&&x.visualId||m!=null&&m.id)&&u)p="local";else if(m&&!u)p="library";else if(x!=null&&x.visualId&&u)p="linked";else if(m!=null&&m.id&&u)p="library";else return null;if(p==="local"&&!d)return null;const C={local:"border-slate-200/70 bg-slate-50/80 text-slate-700 shadow-sm hover:bg-slate-100/80 dark:border-slate-700 dark:bg-slate-900/70 dark:text-slate-200 dark:hover:bg-slate-800/80",linked:"border-purple-200/70 bg-gradient-to-r from-purple-50/50 to-purple-100/30 text-purple-900 shadow-sm hover:from-purple-100/60 hover:to-purple-100/50 hover:shadow-md dark:border-purple-800/50 dark:from-purple-950/40 dark:to-purple-900/30 dark:text-purple-100 dark:hover:from-purple-950/60 dark:hover:to-purple-900/50",library:"border-blue-200/70 bg-gradient-to-r from-blue-50/50 to-blue-100/30 text-blue-900 shadow-sm hover:from-blue-100/60 hover:to-blue-100/50 hover:shadow-md dark:border-blue-800/50 dark:from-blue-950/40 dark:to-blue-900/30 dark:text-blue-100 dark:hover:from-blue-950/60 dark:hover:to-blue-900/50"},y={local:"Local to this dashboard: Changes made here only affect this dashboard copy.",linked:"Linked to library: Changes made here update the library visual and all linked instances.",library:"Library visual: Share and reuse this visual across multiple dashboards."},g={local:"border-slate-200 bg-slate-50 text-slate-900 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100",linked:"border-purple-200 bg-purple-50 text-purple-900 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-100",library:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"},S={local:"fill-slate-50 dark:fill-slate-900",linked:"fill-purple-50 dark:fill-purple-950",library:"fill-blue-50 dark:fill-blue-950"},D={local:e.jsx("span",{className:"h-2 w-2 rounded-full bg-current/70"}),linked:e.jsx(ke,{className:"h-3.5 w-3.5"}),library:e.jsx(je,{className:"h-3.5 w-3.5"})},k={local:"Local",linked:"Linked",library:"Library"};return e.jsx(s.TooltipProvider,{children:e.jsxs(s.Tooltip,{delayDuration:300,children:[e.jsx(s.TooltipTrigger,{asChild:!0,children:e.jsxs(f.Badge,{variant:"outline",className:s.cn("cursor-help select-none transition-all",C[p],l),children:[D[p],n&&e.jsx("span",{className:"ml-1 text-xs font-medium leading-none",children:k[p]})]})}),e.jsxs(s.TooltipContent,{side:"bottom",className:s.cn("max-w-xs",g[p]),children:[e.jsx(s.TooltipArrow,{className:S[p]}),e.jsx("p",{children:y[p]})]})]})})}function we(r){const{control:a,onChange:l}=r;return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(s.Label,{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Label"}),e.jsx(s.Input,{size:"xs",value:a.label,placeholder:"Control label",onChange:n=>l(n.target.value)})]})}function Oe(r){const{currentStep:a,labels:l}=r;return e.jsx("div",{className:"sticky top-0 z-10 -mx-1 border-b border-border/60 bg-background/95 px-1 pb-2.5 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85",children:e.jsx("div",{className:"flex flex-wrap items-center gap-2 sm:gap-2.5",children:l.map((n,d)=>{const u=d+1,m=u===a,x=u<a;return e.jsxs(v.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:s.cn("flex h-5 w-5 items-center justify-center rounded-full border text-[10px] font-medium tabular-nums",m?"border-foreground bg-foreground text-background":x?"border-foreground/30 bg-foreground/10 text-foreground":"border-border/60 bg-background text-muted-foreground"),children:u}),e.jsx("span",{className:s.cn("text-[12px]",m?"font-medium text-foreground":"text-muted-foreground"),children:n})]}),d<l.length-1?e.jsx("span",{className:"h-px w-4 bg-border/60 sm:w-6","aria-hidden":"true"}):null]},n)})})})}function se(r){const{secondary:a,tertiary:l,primary:n}=r;return e.jsxs("div",{className:"sticky bottom-0 z-10 -mx-1 flex justify-end gap-2 border-t bg-background/95 px-1 pb-1 pt-3 backdrop-blur supports-[backdrop-filter]:bg-background/85",children:[a,l,n]})}function Ue(r){const{control:a,scope:l,detail:n}=r;return e.jsxs("div",{className:"flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5",children:[e.jsx(f.CircleCheck,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground"}),e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("div",{className:"text-[13px] font-medium text-foreground",children:a.label}),e.jsxs("div",{className:"text-[12px] text-muted-foreground",children:[s.getFriendlyTypeOption(a.type).label," ·"," ",s.getControlOptionPreview(a)," ·"," ",s.getPlacementLabel(l,a.placement)]}),n?e.jsx("div",{className:"text-[12px] text-muted-foreground",children:n}):null]})]})}function ye(r){const{control:a,defaultValue:l,availableFieldChoices:n,availableMetricChoices:d,previewControlDefinitions:u,previewControlValues:m,onControlChange:x,onLabelChange:p,onDefaultValueChange:C,onBack:y,onNext:g,nextDisabled:S}=r;return e.jsxs("div",{className:"space-y-3",children:[e.jsx(we,{control:a,onChange:p}),e.jsx(f.ControlDefinitionOptionsEditor,{control:a,availableFieldChoices:n,availableMetricChoices:d,previewControlDefinitions:u,previewControlValues:m,controlLifecycle:"create",onChange:x}),e.jsx(f.ControlDefaultValueEditor,{control:a,value:l,onChange:C,allowNoDefault:!0,allowCardDefault:!0,hint:"This is the value viewers will see first.",previewControlDefinitions:u,previewControlValues:m}),e.jsx(se,{secondary:e.jsx(s.Button,{type:"button",variant:"outline",size:"xs",onClick:y,children:"Back"}),primary:e.jsx(s.Button,{type:"button",size:"xs",onClick:g,disabled:S,children:"Next"})})]})}const ze=new Set(["grain_selector","aggregation_selector","field_selector","metric_selector"]);function ve(r){const{text:a,ariaLabel:l}=r,[n,d]=v.useState(!1);return e.jsxs("button",{type:"button","aria-label":l,onClick:async()=>{try{await navigator.clipboard.writeText(a),d(!0),setTimeout(()=>d(!1),1200)}catch(u){console.error("Failed to copy",u)}},className:"group flex w-full items-center justify-between gap-2 rounded-control bg-muted/40 px-2 py-1 text-left transition-colors hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:outline-none",children:[e.jsx("code",{className:"min-w-0 truncate font-mono text-[12px] text-foreground",children:a}),e.jsx("span",{className:"shrink-0 text-[11px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100",children:n?"Copied":"Click to copy"})]})}function Ce(r){const{control:a,scope:l,createdReference:n,explorerContent:d,sqlDescription:u,summaryDetail:m,onBack:x,onCancel:p,onDone:C}=r,y=ze.has(a.type),g=n.match(/\[\[param\.(.+?)\]\]/),S=g?`{{ param('${g[1]}') }}`:"";return e.jsxs("div",{className:"space-y-4",children:[e.jsx(Ue,{control:a,scope:l,detail:m}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[13px] font-medium text-foreground",children:"How cards use this control"}),e.jsxs("div",{className:"divide-y divide-border/60 overflow-hidden rounded-control border border-border/60",children:[y?e.jsxs("div",{className:"space-y-1 px-3 py-2.5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Explorer cards"}),e.jsx("div",{className:"text-[12px] text-muted-foreground",children:d})]}):null,e.jsxs("div",{className:"space-y-1.5 px-3 py-2.5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"SQL cards"}),e.jsx(ve,{text:n,ariaLabel:"Copy SQL control reference"}),S?e.jsx(ve,{text:S,ariaLabel:"Copy Jinja control reference"}):null,e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[u," ",e.jsx("a",{href:"https://docs.semaphor.cloud/docs/concepts/template-expressions",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Template expressions docs"}),"."]})]})]})]}),e.jsx(se,{secondary:e.jsx(s.Button,{type:"button",variant:"outline",size:"xs",onClick:x,children:"Back"}),tertiary:e.jsx(s.Button,{type:"button",variant:"outline",size:"xs",onClick:p,children:"Cancel"}),primary:e.jsx(s.Button,{type:"button",size:"xs",onClick:C,children:"Done"})})]})}function Re(r){const a=s.createBlankControl(r.scope,r.existingControls,r.reservedIds),l=r.type===a.type?{...a,label:s.DEFAULT_LABEL_BY_TYPE[r.type]}:{...s.applyControlTypeChange({controls:[{...a,label:s.DEFAULT_LABEL_BY_TYPE[r.type]}],controlId:a.id,nextType:r.type}).controls[0],label:s.DEFAULT_LABEL_BY_TYPE[r.type]};return{step:2,control:l,defaultValue:s.getDefaultValueForType(l,void 0)}}function Qe({scope:r,controls:a,reservedControlIds:l,defaultValues:n,onChange:d,emptyMessage:u,initialCreateFlow:m=!1,usageByControlId:x,availableFieldChoices:p,availableMetricChoices:C,structuralParticipants:y,structuralParticipantIdsByControlId:g,card:S,allowedControlTypes:D,onCreateFlowActiveChange:k,onCreateFlowComplete:E}){const T=v.useMemo(()=>new Set(l||[]),[l]),O=s.getPlacementOptionsForScope(r),$=s.getDefaultPlacement(r),[U,R]=v.useState(null),[W,F]=v.useState(null),[o,w]=v.useState(()=>m?{step:1,control:s.createBlankControl(r,a,Array.from(T))}:null),Q=v.useRef({}),B=v.useRef(void 0),Y=v.useRef(m),H=v.useMemo(()=>{const t=s.getFriendlyControlTypeOptions({scope:r,card:S});if(!D)return t;const c=new Set(D);return t.filter(i=>c.has(i.value))},[D,S,r]),X=v.useCallback(t=>{const c=s.getFriendlyControlTypeOptions({scope:r,card:S,includeType:D?void 0:t});if(!D)return c;const i=new Set(D);return c.filter(h=>i.has(h.value))},[D,S,r]),q=v.useCallback(t=>r==="dashboard"&&(t==="field_selector"||t==="metric_selector"),[r]),K=v.useMemo(()=>o?s.getEligibleParticipantsForStructuralControl(y||[],o.control.type):[],[o,y]),Z=v.useMemo(()=>{if(!o)return{fields:p||[],metrics:C||[]};if(!q(o.control.type))return{fields:p||[],metrics:C||[]};const t=o.selectedCardIds||[],c=s.getCompatibleStructuralChoiceCatalog({controlType:o.control.type,participants:y||[],selectedCardIds:t});return{fields:o.control.type==="field_selector"?c.choices.map(i=>({option:i,target:c.fieldTargetMap[i.value]})):[],metrics:o.control.type==="metric_selector"?c.choices.map(i=>({option:i,target:c.metricTargetMap[i.value]})):[]}},[p,C,o,q,y]);v.useEffect(()=>{k==null||k(!!o)},[o,k]),v.useEffect(()=>{const t=m&&!Y.current;Y.current=m,t&&(w({step:1,control:s.createBlankControl(r,a,Array.from(T))}),F(null),R(null))},[a,m,T,r]);const ne=t=>{if(!q(t.type))return{fields:p||[],metrics:C||[]};const c=(g==null?void 0:g[t.id])||[];if(c.length===0)return{fields:p||[],metrics:C||[]};const i=s.getCompatibleStructuralChoiceCatalog({controlType:t.type,participants:y||[],selectedCardIds:c});return{fields:t.type==="field_selector"?i.choices.map(h=>({option:h,target:i.fieldTargetMap[h.value]})):[],metrics:t.type==="metric_selector"?i.choices.map(h=>({option:h,target:i.metricTargetMap[h.value]})):[]}},A=t=>{if(!q(t.control.type))return{nextControl:t.control,cardBindingsById:void 0};const c=(g==null?void 0:g[t.control.id])||[],i=s.getCompatibleStructuralChoiceCatalog({controlType:t.control.type,participants:y||[],selectedCardIds:t.nextSelectedCardIds}),h=s.reconcileStructuralControlChoices({control:t.control,choices:i.choices}),j=Object.fromEntries(c.filter(N=>!t.nextSelectedCardIds.includes(N)).map(N=>[N,void 0]));return t.nextSelectedCardIds.length>0&&h.source.kind==="manual"&&h.source.options.length>0&&Object.assign(j,s.buildStructuralControlBindingsForParticipants({control:h,participants:y||[],selectedCardIds:t.nextSelectedCardIds})),{nextControl:h,cardBindingsById:j}},V=v.useCallback((t,c=n,i={type:"update"})=>{const h=t.map(j=>(s.resolveAuthoringControlDefaultValue({control:j,defaultValues:c}),s.syncSqlQueryControlExecutionRequirement(j)));d(h,c,i)},[n,d]),P=(t,c)=>{const i=a.find(L=>L.id===t);let h=a.map(L=>L.id!==t?L:c(L));const j=h.find(L=>L.id===t);let N,b;if(j&&r==="dashboard"&&(j.type==="field_selector"||j.type==="metric_selector")){const L=(g==null?void 0:g[j.id])||[],ee=A({control:j,nextSelectedCardIds:L});h=h.map(G=>G.id===t?ee.nextControl:G),N=ee.cardBindingsById,b=[j.id]}else if(i&&r==="dashboard"&&(i.type==="field_selector"||i.type==="metric_selector")){const L=(g==null?void 0:g[i.id])||[];N=Object.fromEntries(L.map(ee=>[ee,void 0])),b=[i.id]}const I=h.find(L=>L.id===t);let M=n;if(i&&I){const L=s.resolveAuthoringControlDefaultValue({control:i,defaultValues:n});i.source.kind==="manual"&&I.source.kind==="sql_query"&&(Q.current[t]=L);const ee=L===void 0&&i.source.kind==="sql_query"&&I.source.kind==="manual"?Q.current[t]:L,G=s.getNextEditedControlDefaultValue({previousControl:i,nextControl:I,currentDefaultValue:ee});I.source.kind==="manual"&&(Q.current[t]=G),n&&(M={...n},G===void 0?delete M[t]:M[t]=G),h=h.map(xe=>xe.id===t?{...I,defaultValue:G}:xe)}V(h,M,{type:"update",cardBindingsById:N,affectedBindingControlIds:b})},_=(t,c)=>{if(!c.trim())return;const i=f.normalizeDashboardInputVariableName(c);if(i===t||T.has(i)||a.some(N=>N.id===i&&N.id!==t))return;const h=a.map(N=>N.id===t?{...N,id:i}:N);if(!n){V(h,void 0,{type:"rename",oldId:t,newId:i});return}const j={...n};Object.prototype.hasOwnProperty.call(j,t)&&(j[i]=j[t],delete j[t]),V(h,j,{type:"rename",oldId:t,newId:i})},oe=t=>{const c=a.filter(h=>h.id!==t);if(!n){V(c,void 0,{type:"remove",controlId:t});return}const i={...n};delete i[t],V(c,i,{type:"remove",controlId:t})},re=v.useCallback(()=>{B.current=void 0,w({step:1,control:s.createBlankControl(r,a,Array.from(T))}),F(null),R(null)},[a,T,r]),z=t=>{w(c=>c&&(()=>{const i=t(c.control);c.control.source.kind==="manual"&&i.source.kind==="sql_query"&&(B.current=c.defaultValue);const h=c.defaultValue===void 0&&c.control.source.kind==="sql_query"&&i.source.kind==="manual"?B.current:c.defaultValue,j=s.getNextEditedControlDefaultValue({previousControl:c.control,nextControl:i,currentDefaultValue:h});return i.source.kind==="manual"&&(B.current=j),{...c,control:i,defaultValue:j}})())},te=t=>{w(c=>c&&(c.control.source.kind==="manual"&&(B.current=t),{...c,defaultValue:t}))},le=(()=>{if(!o)return!1;if(o.step===2&&q(o.control.type))return(o.selectedCardIds||[]).length>0;if(o.step!==2&&o.step!==3||!o.control.label.trim())return!1;const c=o.control.source.kind==="sql_query"?o.control:s.ensureManualSource(o.control);if(c.source.kind==="manual"&&(s.needsManualOptions(c)&&c.source.options.length===0||c.source.options.some(h=>h.label.trim().length===0||h.value.trim().length===0)))return!1;if(c.source.kind==="sql_query"){const{connectionId:i,sql:h,valueColumn:j}=c.source;return i.trim().length>0&&h.trim().length>0&&j.trim().length>0}return s.hasConcreteDefaultValue(s.getDefaultValueForType(c,o.defaultValue))})(),pe=()=>{var N;if(!o)return;const t=s.ensureManualSource(o.control),c=s.deriveUniqueControlId({label:t.label,fallbackId:t.id,existingControls:a,reservedIds:Array.from(T)}),i={...t,id:c},h=r==="dashboard"&&(i.type==="field_selector"||i.type==="metric_selector")&&((N=o.selectedCardIds)!=null&&N.length)?s.buildStructuralControlBindingsForParticipants({control:i,participants:y||[],selectedCardIds:o.selectedCardIds}):void 0,j=s.getDefaultValueForType(i,o.defaultValue);w({step:r==="dashboard"&&(i.type==="field_selector"||i.type==="metric_selector")?4:3,control:i,defaultValue:j,createdControlId:c,selectedCardIds:o.selectedCardIds,cardBindingsById:h})},ie=v.useCallback(()=>{w(null)},[]),me=v.useCallback(()=>{if(!(o!=null&&o.createdControlId)){w(null);return}const t=o.control,c=o.createdControlId,i=s.getDefaultValueForType(t,o.defaultValue);if(n){const h={...n};i===void 0?delete h[c]:h[c]=i,V([...a,{...t,defaultValue:i}],h,{type:"add",cardBindingsById:o.cardBindingsById})}else V([...a,{...t,defaultValue:i}],void 0,{type:"add",cardBindingsById:o.cardBindingsById});F(c),w(null),E==null||E()},[a,o,n,V,E]),De=o?q(o.control.type)?["Choose type","Select cards","Configure","Finish"]:["Choose type","Configure","Finish"]:[],fe=o!=null&&o.createdControlId?`[[param.${o.createdControlId}]]`:o?`[[param.${s.slugifyControlValue(o.control.label)||o.control.id}]]`:"",de=s.buildAuthoringPreviewControlValues({controls:a,defaultValues:n}),ce=o?[...a,o.control]:a,he=o?s.buildAuthoringPreviewControlValues({controls:ce,defaultValues:n,overrides:[{controlId:o.control.id,value:o.defaultValue}]}):de;return e.jsxs("div",{className:"space-y-4",children:[o?e.jsxs("div",{className:"space-y-4 pb-1",children:[e.jsx(Oe,{currentStep:o.step,labels:De}),o.step===1&&(()=>{const t=new Set(["grain_selector","aggregation_selector","field_selector","metric_selector"]),c=new Set(["date","text"]),i=H.filter(N=>!t.has(N.value)&&!c.has(N.value)),h=H.filter(N=>t.has(N.value)),j=N=>e.jsxs("button",{type:"button",className:"rounded-control border border-border/60 bg-background px-3 py-2.5 text-left transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:outline-none",onClick:()=>w(Re({scope:r,existingControls:a,reservedIds:Array.from(T),type:N.value})),children:[e.jsx("div",{className:"text-[13px] font-medium text-foreground",children:N.label}),e.jsx("p",{className:"mt-0.5 text-[12px] text-muted-foreground",children:N.description})]},N.value);return e.jsxs("div",{className:"space-y-4",children:[r==="card"&&(S==null?void 0:S.sql)==null?e.jsx("p",{className:"text-[12px] text-muted-foreground",children:"Explorer cards support displayed metric, group by field, aggregation, and time grain controls here."}):null,i.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Input controls"}),e.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:i.map(j)})]}),h.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Data-driven controls"}),e.jsx("div",{className:"grid gap-1.5 sm:grid-cols-2",children:h.map(j)})]}),e.jsx(se,{secondary:e.jsx(s.Button,{type:"button",variant:"outline",size:"xs",onClick:ie,children:"Back to controls"})})]})})(),o.step===2&&q(o.control.type)&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(we,{control:o.control,onChange:t=>z(c=>({...c,label:t}))}),e.jsx("p",{className:"text-[12px] text-muted-foreground",children:"Choose which cards should respond to this shared control."})]}),K.length===0?e.jsx("div",{className:"rounded-control border border-border/60 bg-muted/30 px-3 py-2.5 text-[12px] text-muted-foreground",children:"No eligible cards are available yet. Add compatible metrics or group-by fields to cards first."}):e.jsx("div",{className:"space-y-1 rounded-control border border-border/60 bg-background p-2",children:K.map(t=>{const c=(o.selectedCardIds||[]).includes(t.cardId);return e.jsxs("label",{className:"flex items-start gap-2 rounded-control px-1.5 py-1 text-[13px] hover:bg-muted/40",children:[e.jsx(f.Checkbox,{checked:c,onCheckedChange:i=>w(h=>h&&{...h,selectedCardIds:i===!0?[...h.selectedCardIds||[],t.cardId]:(h.selectedCardIds||[]).filter(j=>j!==t.cardId)})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-foreground",children:t.title}),e.jsx("div",{className:"text-[12px] text-muted-foreground",children:o.control.type==="field_selector"?`${t.fieldChoices.length} compatible group-by fields`:`${t.metricChoices.length} compatible metrics`})]})]},t.cardId)})}),e.jsx(se,{secondary:e.jsx(s.Button,{type:"button",variant:"outline",size:"xs",onClick:()=>w(t=>t&&{...t,step:1,selectedCardIds:[]}),children:"Back"}),primary:e.jsx(s.Button,{type:"button",size:"xs",onClick:()=>w(t=>t&&{...t,step:3}),disabled:!le,children:"Next"})})]}),o.step===2&&!q(o.control.type)&&e.jsx(ye,{control:o.control,defaultValue:o.defaultValue,availableFieldChoices:Z.fields,availableMetricChoices:Z.metrics,previewControlDefinitions:ce,previewControlValues:he,onControlChange:t=>z(()=>t),onLabelChange:t=>z(c=>({...c,label:t})),onDefaultValueChange:te,onBack:()=>w(t=>t&&{...t,step:1}),onNext:pe,nextDisabled:!le}),o.step===3&&q(o.control.type)&&e.jsx(ye,{control:o.control,defaultValue:o.defaultValue,availableFieldChoices:Z.fields,availableMetricChoices:Z.metrics,previewControlDefinitions:ce,previewControlValues:he,onControlChange:t=>z(()=>t),onLabelChange:t=>z(c=>({...c,label:t})),onDefaultValueChange:te,onBack:()=>w(t=>t&&{...t,step:2}),onNext:pe,nextDisabled:!le}),o.step===3&&!q(o.control.type)&&e.jsx(Ce,{control:o.control,scope:r,createdReference:fe,explorerContent:e.jsxs(e.Fragment,{children:["Open the card and use"," ",e.jsx("span",{className:"font-medium text-foreground",children:"Settings → Controls"})," ","to choose what this control changes."]}),sqlDescription:"Reference this control directly in the SQL editor.",onBack:()=>w(t=>t&&{...t,step:2}),onCancel:ie,onDone:me}),o.step===4&&q(o.control.type)&&e.jsx(Ce,{control:o.control,scope:r,createdReference:fe,summaryDetail:e.jsxs(e.Fragment,{children:["Used by ",(o.selectedCardIds||[]).length," selected card",(o.selectedCardIds||[]).length===1?"":"s"]}),explorerContent:e.jsx(e.Fragment,{children:"Selected cards have been set up to respond to this control automatically."}),sqlDescription:"SQL cards can still reference this control directly in the SQL editor.",onBack:()=>w(t=>t&&{...t,step:3}),onCancel:ie,onDone:me})]}):null,!o&&a.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-sm text-muted-foreground",children:u}):null,!o&&a.map(t=>{const c=ne(t),i=x==null?void 0:x[t.id],h=s.resolveAuthoringControlDefaultValue({control:t,defaultValues:n}),j=W===t.id,N="inline-flex shrink-0 items-center rounded-[4px] border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground";return e.jsxs("div",{className:"rounded-control border border-border/60",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[e.jsxs("button",{type:"button",className:"flex min-w-0 flex-1 items-start gap-2 rounded-control text-left focus:outline-none focus-visible:bg-muted/40",onClick:()=>F(b=>b===t.id?null:t.id),children:[j?e.jsx(J.ChevronDown,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}):e.jsx(ge.ChevronRight,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{className:"truncate text-[13px] font-medium text-foreground",children:t.label||"Untitled control"}),e.jsx("span",{className:N,children:s.getFriendlyTypeOption(t.type).label}),e.jsx("span",{className:N,children:s.getPlacementLabel(r,t.placement)})]}),e.jsxs("div",{className:"mt-0.5 text-[12px] text-muted-foreground",children:[s.getControlOptionPreview(t),i!=null&&i.status?` · ${i.status}`:""]})]})]}),e.jsx(s.Button,{type:"button",size:"xs",variant:"ghost",className:"h-7 w-7 shrink-0 p-0 text-muted-foreground",onClick:()=>oe(t.id),"aria-label":`Remove ${t.label}`,children:e.jsx(f.Trash2,{className:"h-3.5 w-3.5"})})]}),j&&e.jsxs("div",{className:"space-y-4 border-t border-border/60 px-3 py-3",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(s.Label,{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Label"}),e.jsx(s.Input,{size:"xs",value:t.label,placeholder:"Control label",onChange:b=>P(t.id,I=>({...I,label:b.target.value}))})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(s.Label,{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Type"}),e.jsxs(s.Select,{value:t.type,onValueChange:b=>{const I=s.applyControlTypeChange({controls:a,controlId:t.id,nextType:b,defaultValues:n});V(I.controls,I.defaultValues)},children:[e.jsx(s.SelectTrigger,{size:"xs",children:e.jsx(s.SelectValue,{})}),e.jsx(s.SelectContent,{children:X(t.type).map(b=>e.jsx(s.SelectItem,{value:b.value,children:b.label},b.value))})]})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(s.Label,{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Show in"}),e.jsxs(s.Select,{value:t.placement||$,onValueChange:b=>P(t.id,I=>({...I,placement:b})),children:[e.jsx(s.SelectTrigger,{size:"xs",children:e.jsx(s.SelectValue,{})}),e.jsx(s.SelectContent,{children:O.map(b=>e.jsx(s.SelectItem,{value:b.value,children:b.label},b.value))})]})]})]}),q(t.type)?e.jsx(f.StructuralParticipantSelector,{type:t.type,participants:s.getEligibleParticipantsForStructuralControl(y||[],t.type).map(b=>({cardId:b.cardId,title:b.title,choiceCount:t.type==="field_selector"?b.fieldChoices.length:b.metricChoices.length})),selectedCardIds:(g==null?void 0:g[t.id])||[],onChange:b=>{const I=A({control:t,nextSelectedCardIds:b}),M=a.map(L=>L.id===t.id?I.nextControl:L);V(M,n,{type:"update",cardBindingsById:I.cardBindingsById})}}):null,e.jsx(f.ControlDefinitionOptionsEditor,{control:t,availableFieldChoices:c.fields,availableMetricChoices:c.metrics,previewControlDefinitions:a,previewControlValues:de,controlLifecycle:"edit",onChange:b=>P(t.id,()=>b)}),t.initialValueStrategy==="saved_default"&&e.jsx(f.ControlDefaultValueEditor,{control:t,value:h,allowNoDefault:!0,allowCardDefault:!0,previewControlDefinitions:a,previewControlValues:de,onChange:b=>{const I=a.map(M=>M.id===t.id?{...M,defaultValue:b}:M);if(t.source.kind==="manual"&&(Q.current[t.id]=b),n){const M={...n};b===void 0?delete M[t.id]:M[t.id]=b,V(I,M);return}V(I,void 0)}}),e.jsxs(f.Collapsible,{open:U===t.id,onOpenChange:b=>R(b?t.id:null),children:[e.jsx(f.CollapsibleTrigger,{asChild:!0,children:e.jsxs(s.Button,{type:"button",variant:"ghost",size:"xs",className:"-ml-2 gap-1 text-muted-foreground hover:text-foreground",children:[U===t.id?e.jsx(J.ChevronDown,{className:"h-3.5 w-3.5"}):e.jsx(ge.ChevronRight,{className:"h-3.5 w-3.5"}),"Advanced"]})}),e.jsxs(f.CollapsibleContent,{className:"space-y-3 pt-2",children:[e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(s.Label,{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Variable name"}),e.jsx(f.ControlIdInput,{controlId:t.id,onCommit:b=>_(t.id,b)},t.id)]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(s.Label,{className:"text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground",children:"Initial value"}),e.jsxs(s.Select,{value:t.initialValueStrategy,onValueChange:b=>P(t.id,I=>({...I,initialValueStrategy:b})),children:[e.jsx(s.SelectTrigger,{size:"xs",children:e.jsx(s.SelectValue,{})}),e.jsx(s.SelectContent,{children:s.INITIAL_VALUE_STRATEGY_OPTIONS.map(b=>e.jsx(s.SelectItem,{value:b.value,children:b.label},b.value))})]})]})]}),e.jsx(f.ControlVisibilitySettings,{control:t,onChange:b=>P(t.id,()=>b)})]})]})]})]},t.id)}),!o&&e.jsxs(s.Button,{type:"button",variant:"outline",size:"xs",onClick:re,children:[e.jsx(f.Plus,{className:"h-3.5 w-3.5"}),"Add control"]})]})}function Pe(r){const{open:a,onOpenChange:l,initialCreateFlowActive:n=!1,dismissMode:d="passive"}=r,u=a!==void 0,[m,x]=v.useState(!1),[p,C]=v.useState(n),y=u?a:m,g=v.useCallback(k=>{!k&&p&&d==="passive"||(u||x(k),k||C(!1),l==null||l(k))},[u,p,d,l]),S=v.useCallback(()=>{u||x(!1),C(!1),l==null||l(!1)},[u,l]);v.useEffect(()=>{y||C(!1)},[y]);const D=v.useCallback(k=>{p&&k.preventDefault()},[p]);return{forceClose:S,handleOpenChange:g,isCreateFlowActive:p,preventPassiveDismissDuringCreate:D,resolvedOpen:y,setIsCreateFlowActive:C}}function ue(r){const a=s.getDynamicFrameSaveIssue(r);return a?(f.ue.error(a),!1):!0}function $e({className:r,variant:a="outline"}){const l=s.useEditorStore(u=>u.onSave),{getUpdatedFrame:n}=ae();function d(){const u=n();ue(u)&&(l==null||l(u))}return e.jsxs(s.Button,{onClick:d,className:r,size:"xs",variant:a,children:[e.jsx(s.Check,{className:"h-3.5 w-3.5"}),"Accept"]})}function Ye({className:r,variant:a="default"}){const l=f.useQueryClient(),[n,d]=v.useState(!1),{setIsVisualEditing:u}=s.useDashboardActions(),{getUpdatedFrame:m}=ae(),x=f.useSelectedVisual(),p=s.useEditorStore(g=>g.frame),C=f.useUpdateVisualMutation(),y=()=>{const g=m();if(!ue(g))return;const S=(p==null?void 0:p.visualId)||(x==null?void 0:x.id);if(!S){f.ue.error("No visual to save");return}d(!0),C.mutate({visualId:S,data:{frameObject:g}},{onSuccess:()=>{d(!1),f.ue.success("Visual updated successfully"),l.invalidateQueries({queryKey:["resource-by-id","visual",S],exact:!0})},onError:()=>{d(!1),f.ue.error("Failed to update visual")}})};return e.jsx(s.Button,{onClick:y,className:r,size:"xs",variant:a,children:n?e.jsxs(e.Fragment,{children:[e.jsx(s.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving"]}):e.jsxs(e.Fragment,{children:[e.jsx(Se.Save,{className:"h-3.5 w-3.5"}),"Save to Library"]})})}function He({className:r}){const a=f.useQueryClient(),[l,n]=v.useState(!1),d=f.useSelectedVisual(),u=s.useEditorStore(k=>k.frame),m=s.useDashboardStore(k=>k.selectedSheetId),x=s.useDashboardStore(k=>k.dashboard),{updateFrame:p,setIsVisualEditing:C}=s.useDashboardActions(),{getUpdatedFrame:y}=ae(),g=f.useUpdateVisualMutation(),S=f.useResolveExistingFrameSemanticExecutionPayload(),D=async()=>{if(!m){f.ue.error("No sheet selected");return}const k=(u==null?void 0:u.visualId)||(d==null?void 0:d.id);if(!k){f.ue.error("No visual to update");return}n(!0);try{const E=y();if(!ue(E)){n(!1);return}const T={...E,visualId:k},O=s.findDashboardFrameById(x,T.id),$=await S(T,{previousFrame:O});await g.mutateAsync({visualId:k,data:{frameObject:E}}),p(m,T,{semanticExecutionPayload:$}),a.invalidateQueries({queryKey:["visuals"]}),a.invalidateQueries({queryKey:["visual",k]}),f.ue.success("Saved to library and applied locally"),setTimeout(()=>{C(!1)},300)}catch(E){console.error("Failed to save and apply:",E),f.ue.error(E instanceof Error?E.message:"Failed to save and apply changes")}finally{n(!1)}};return e.jsx(s.Button,{onClick:D,className:r,size:"xs",variant:"default",disabled:l,children:l?e.jsxs(e.Fragment,{children:[e.jsx(s.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Se.Save,{className:"h-3.5 w-3.5"}),"Save & Apply"]})})}function Ke({className:r}){const{setTempQueryData:a,setSqlGen:l}=s.useEditorActions(),n=f.useQueryClient(),d=s.useEditorStore(g=>g.tempQueryData),u=s.useEditorStore(g=>g.onClose),m=s.useEditorStore(g=>g.card),x=f.useEffectiveEditorCardType(),p=v.useMemo(()=>x!==m.type?{...m,type:x}:m,[m,x]),{queryKey:C}=f.useEditorCardQuery(p);function y(){if(d){const{queryKey:g,queryData:S}=d;g&&S&&n.setQueryData(g,S)}l({}),u==null||u()}return e.jsxs(s.Button,{onClick:y,className:r,size:"xs",variant:"outline",children:[e.jsx(J.X,{className:"h-3.5 w-3.5"}),"Close"]})}function We({label:r="Clear",variant:a="secondary",className:l}={}){const n=Ee();return e.jsxs(s.Button,{onClick:n,className:l,size:"xs",variant:a,children:[e.jsx(J.X,{className:"h-3.5 w-3.5"}),r]})}exports.ControlDefinitionListEditor=Qe;exports.EditorAcceptButton=$e;exports.EditorCancelButton=Ke;exports.EditorClearButton=We;exports.FilterX=Ve;exports.Library=je;exports.Link2=ke;exports.VisualBadge=Me;exports.VisualSaveAndApplyButton=He;exports.VisualSaveButton=Ye;exports.useCreateFlowOverlayState=Pe;exports.useEditorClearAction=Ee;exports.useSyncLegacyEditorState=qe;exports.useVisualUtils=ae;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { c as Te, C as je, X as Ze } from "./x-CXDkqdur.js";
|
|
2
2
|
import { useState as H, useEffect as ie, useCallback as U, useMemo as oe, useRef as ke, Fragment as ht } from "react";
|
|
3
|
-
import { E as de, z as _e, u as J, D as z, a4 as bt, Q as gt, V as yt, W as vt, c as fe, Y as xt, a5 as Ct, a6 as kt, a7 as pe, a8 as Re, a9 as Qe, aa as Se, ab as Ne, ac as St, ad as $e, ae as Nt, af as wt, ag as me, ah as Dt, ai as Pe, B as L, aj as et, ak as tt, al as rt, O as ne, Z as at, _ as we, $ as De, a0 as Ee, a1 as Fe, a2 as Ie, am as st, an as Et, ao as Ft, ap as We, aq as It, ar as He, as as Vt, at as Ve, d as Tt, L as nt, au as _t, av as At } from "./switch-
|
|
4
|
-
import { b7 as Lt, az as qt, b8 as ce, b9 as Mt, ba as Ae, bb as Ot, bc as zt, bd as Ut, aG as B, be as Bt, bf as jt, bg as Rt, bh as ot, bi as lt,
|
|
3
|
+
import { E as de, z as _e, u as J, D as z, a4 as bt, Q as gt, V as yt, W as vt, c as fe, Y as xt, a5 as Ct, a6 as kt, a7 as pe, a8 as Re, a9 as Qe, aa as Se, ab as Ne, ac as St, ad as $e, ae as Nt, af as wt, ag as me, ah as Dt, ai as Pe, B as L, aj as et, ak as tt, al as rt, O as ne, Z as at, _ as we, $ as De, a0 as Ee, a1 as Fe, a2 as Ie, am as st, an as Et, ao as Ft, ap as We, aq as It, ar as He, as as Vt, at as Ve, d as Tt, L as nt, au as _t, av as At } from "./switch-BeZW-HnS.js";
|
|
4
|
+
import { b7 as Lt, az as qt, b8 as ce, b9 as Mt, ba as Ae, bb as Ot, bc as zt, bd as Ut, aG as B, be as Bt, bf as jt, bg as Rt, bh as ot, bi as lt, u as Qt, bj as $t, bk as Pt, bl as Wt, bm as Ht, bn as it, bo as dt, bp as Kt, bq as Yt, br as Gt, bs as Xt, bt as Jt, aZ as Zt, bu as er, bv as tr, bw as ct, bx as rr } from "./index-DAoS4BNU.js";
|
|
5
5
|
import { jsx as r, jsxs as p, Fragment as re } from "react/jsx-runtime";
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
6
|
+
import "./saved-temporal-bucket-format-SGAV0ivR.js";
|
|
7
|
+
import "./validators-DEmd8Sin.js";
|
|
8
|
+
import "./analyze-result-contract-BbRJ-C06.js";
|
|
8
9
|
import "../value-format-preferences/index.js";
|
|
9
10
|
import { C as Ke } from "./search-BHsQIWBV.js";
|
|
11
|
+
import { f as ar } from "./index-Ca784dpx.js";
|
|
10
12
|
import { S as ut } from "./save-DgMfP0j8.js";
|
|
11
13
|
/**
|
|
12
14
|
* @license lucide-react v0.453.0 - ISC
|
|
@@ -14,7 +16,7 @@ import { S as ut } from "./save-DgMfP0j8.js";
|
|
|
14
16
|
* This source code is licensed under the ISC license.
|
|
15
17
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
18
|
*/
|
|
17
|
-
const
|
|
19
|
+
const Ir = Te("FilterX", [
|
|
18
20
|
["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
|
|
19
21
|
["path", { d: "m22 3-5 5", key: "12jva0" }],
|
|
20
22
|
["path", { d: "m17 3 5 5", key: "k36vhe" }]
|
|
@@ -363,7 +365,7 @@ function Le() {
|
|
|
363
365
|
refetch: X.refetch
|
|
364
366
|
};
|
|
365
367
|
}
|
|
366
|
-
function
|
|
368
|
+
function Vr() {
|
|
367
369
|
const t = z((m) => m.card.dataSource), {
|
|
368
370
|
setSelectedConnectionId: a,
|
|
369
371
|
setSelectedDatabaseName: o,
|
|
@@ -422,7 +424,7 @@ function pr() {
|
|
|
422
424
|
queryKey: m,
|
|
423
425
|
queryData: R
|
|
424
426
|
}), a.setQueryData(m, null), a.removeQueries({ queryKey: m, exact: !0 }), h(""), u({}), x(), D(void 0), v(""), y(""), b({});
|
|
425
|
-
const $ = z.getState().frame, Z = z.getState().card, E =
|
|
427
|
+
const $ = z.getState().frame, Z = z.getState().card, E = ar($, Z), n = ((P = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : P.visualType) === "multiple" || !!((M = E == null ? void 0 : E.customCardPreferences) != null && M.dataInputCardIds) || (((Y = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : Y.minInputs) || 0) > 1 || (((G = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : G.maxInputs) || 0) > 1, w = ur(Z, n);
|
|
426
428
|
N({
|
|
427
429
|
...$,
|
|
428
430
|
cards: $.cards.map(
|
|
@@ -432,14 +434,14 @@ function pr() {
|
|
|
432
434
|
}
|
|
433
435
|
return K;
|
|
434
436
|
}
|
|
435
|
-
function
|
|
437
|
+
function Tr({
|
|
436
438
|
type: t,
|
|
437
439
|
isLinked: a,
|
|
438
440
|
className: o,
|
|
439
441
|
showLabel: s = !1,
|
|
440
442
|
showLocal: i = !1
|
|
441
443
|
}) {
|
|
442
|
-
const c = J((N) => N.selectedFrameId), m =
|
|
444
|
+
const c = J((N) => N.selectedFrameId), m = Qt((N) => N.selectedVisual), h = z((N) => N.frame);
|
|
443
445
|
let u;
|
|
444
446
|
if (t)
|
|
445
447
|
u = t;
|
|
@@ -484,7 +486,7 @@ function Ir({
|
|
|
484
486
|
};
|
|
485
487
|
return /* @__PURE__ */ r(gt, { children: /* @__PURE__ */ p(yt, { delayDuration: 300, children: [
|
|
486
488
|
/* @__PURE__ */ r(vt, { asChild: !0, children: /* @__PURE__ */ p(
|
|
487
|
-
|
|
489
|
+
$t,
|
|
488
490
|
{
|
|
489
491
|
variant: "outline",
|
|
490
492
|
className: fe(
|
|
@@ -574,7 +576,7 @@ function he(t) {
|
|
|
574
576
|
function fr(t) {
|
|
575
577
|
const { control: a, scope: o, detail: s } = t;
|
|
576
578
|
return /* @__PURE__ */ p("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
|
|
577
|
-
/* @__PURE__ */ r(
|
|
579
|
+
/* @__PURE__ */ r(tr, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
|
|
578
580
|
/* @__PURE__ */ p("div", { className: "min-w-0 space-y-0.5", children: [
|
|
579
581
|
/* @__PURE__ */ r("div", { className: "text-[13px] font-medium text-foreground", children: a.label }),
|
|
580
582
|
/* @__PURE__ */ p("div", { className: "text-[12px] text-muted-foreground", children: [
|
|
@@ -777,7 +779,7 @@ function br(t) {
|
|
|
777
779
|
defaultValue: me(o, void 0)
|
|
778
780
|
};
|
|
779
781
|
}
|
|
780
|
-
function
|
|
782
|
+
function _r({
|
|
781
783
|
scope: t,
|
|
782
784
|
controls: a,
|
|
783
785
|
reservedControlIds: o,
|
|
@@ -992,7 +994,7 @@ function Vr({
|
|
|
992
994
|
}, A = (e, d) => {
|
|
993
995
|
if (!d.trim())
|
|
994
996
|
return;
|
|
995
|
-
const l =
|
|
997
|
+
const l = er(d);
|
|
996
998
|
if (l === e || V.has(l) || a.some(
|
|
997
999
|
(S) => S.id === l && S.id !== e
|
|
998
1000
|
))
|
|
@@ -1247,7 +1249,7 @@ function Vr({
|
|
|
1247
1249
|
className: "flex items-start gap-2 rounded-control px-1.5 py-1 text-[13px] hover:bg-muted/40",
|
|
1248
1250
|
children: [
|
|
1249
1251
|
/* @__PURE__ */ r(
|
|
1250
|
-
|
|
1252
|
+
Pt,
|
|
1251
1253
|
{
|
|
1252
1254
|
checked: d,
|
|
1253
1255
|
onCheckedChange: (l) => w(
|
|
@@ -1453,7 +1455,7 @@ function Vr({
|
|
|
1453
1455
|
className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
|
|
1454
1456
|
onClick: () => ge(e.id),
|
|
1455
1457
|
"aria-label": `Remove ${e.label}`,
|
|
1456
|
-
children: /* @__PURE__ */ r(
|
|
1458
|
+
children: /* @__PURE__ */ r(Wt, { className: "h-3.5 w-3.5" })
|
|
1457
1459
|
}
|
|
1458
1460
|
)
|
|
1459
1461
|
] }),
|
|
@@ -1524,7 +1526,7 @@ function Vr({
|
|
|
1524
1526
|
] })
|
|
1525
1527
|
] }),
|
|
1526
1528
|
q(e.type) ? /* @__PURE__ */ r(
|
|
1527
|
-
|
|
1529
|
+
Ht,
|
|
1528
1530
|
{
|
|
1529
1531
|
type: e.type,
|
|
1530
1532
|
participants: Qe(
|
|
@@ -1585,12 +1587,12 @@ function Vr({
|
|
|
1585
1587
|
}
|
|
1586
1588
|
),
|
|
1587
1589
|
/* @__PURE__ */ p(
|
|
1588
|
-
|
|
1590
|
+
Kt,
|
|
1589
1591
|
{
|
|
1590
1592
|
open: R === e.id,
|
|
1591
1593
|
onOpenChange: (g) => $(g ? e.id : null),
|
|
1592
1594
|
children: [
|
|
1593
|
-
/* @__PURE__ */ r(
|
|
1595
|
+
/* @__PURE__ */ r(Yt, { asChild: !0, children: /* @__PURE__ */ p(
|
|
1594
1596
|
L,
|
|
1595
1597
|
{
|
|
1596
1598
|
type: "button",
|
|
@@ -1603,12 +1605,12 @@ function Vr({
|
|
|
1603
1605
|
]
|
|
1604
1606
|
}
|
|
1605
1607
|
) }),
|
|
1606
|
-
/* @__PURE__ */ p(
|
|
1608
|
+
/* @__PURE__ */ p(Gt, { className: "space-y-3 pt-2", children: [
|
|
1607
1609
|
/* @__PURE__ */ p("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
1608
1610
|
/* @__PURE__ */ p("div", { className: "flex flex-col gap-1.5", children: [
|
|
1609
1611
|
/* @__PURE__ */ r(ne, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
|
|
1610
1612
|
/* @__PURE__ */ r(
|
|
1611
|
-
|
|
1613
|
+
Xt,
|
|
1612
1614
|
{
|
|
1613
1615
|
controlId: e.id,
|
|
1614
1616
|
onCommit: (g) => A(e.id, g)
|
|
@@ -1642,7 +1644,7 @@ function Vr({
|
|
|
1642
1644
|
] })
|
|
1643
1645
|
] }),
|
|
1644
1646
|
/* @__PURE__ */ r(
|
|
1645
|
-
|
|
1647
|
+
Jt,
|
|
1646
1648
|
{
|
|
1647
1649
|
control: e,
|
|
1648
1650
|
onChange: (g) => W(e.id, () => g)
|
|
@@ -1666,14 +1668,14 @@ function Vr({
|
|
|
1666
1668
|
size: "xs",
|
|
1667
1669
|
onClick: ue,
|
|
1668
1670
|
children: [
|
|
1669
|
-
/* @__PURE__ */ r(
|
|
1671
|
+
/* @__PURE__ */ r(Zt, { className: "h-3.5 w-3.5" }),
|
|
1670
1672
|
"Add control"
|
|
1671
1673
|
]
|
|
1672
1674
|
}
|
|
1673
1675
|
)
|
|
1674
1676
|
] });
|
|
1675
1677
|
}
|
|
1676
|
-
function
|
|
1678
|
+
function Ar(t) {
|
|
1677
1679
|
const {
|
|
1678
1680
|
open: a,
|
|
1679
1681
|
onOpenChange: o,
|
|
@@ -1711,7 +1713,7 @@ function qe(t) {
|
|
|
1711
1713
|
const a = At(t);
|
|
1712
1714
|
return a ? (B.error(a), !1) : !0;
|
|
1713
1715
|
}
|
|
1714
|
-
function
|
|
1716
|
+
function Lr({
|
|
1715
1717
|
className: t,
|
|
1716
1718
|
variant: a = "outline"
|
|
1717
1719
|
}) {
|
|
@@ -1734,7 +1736,7 @@ function _r({
|
|
|
1734
1736
|
}
|
|
1735
1737
|
);
|
|
1736
1738
|
}
|
|
1737
|
-
function
|
|
1739
|
+
function qr({
|
|
1738
1740
|
className: t,
|
|
1739
1741
|
variant: a = "default"
|
|
1740
1742
|
}) {
|
|
@@ -1784,10 +1786,10 @@ function Ar({
|
|
|
1784
1786
|
}
|
|
1785
1787
|
);
|
|
1786
1788
|
}
|
|
1787
|
-
function
|
|
1789
|
+
function Mr({
|
|
1788
1790
|
className: t
|
|
1789
1791
|
}) {
|
|
1790
|
-
const a = ce(), [o, s] = H(!1), i = Ae(), c = z((k) => k.frame), m = J((k) => k.selectedSheetId), h = J((k) => k.dashboard), { updateFrame: u, setIsVisualEditing: v } = _e(), { getUpdatedFrame: y } = Le(), b = ct(), x =
|
|
1792
|
+
const a = ce(), [o, s] = H(!1), i = Ae(), c = z((k) => k.frame), m = J((k) => k.selectedSheetId), h = J((k) => k.dashboard), { updateFrame: u, setIsVisualEditing: v } = _e(), { getUpdatedFrame: y } = Le(), b = ct(), x = rr();
|
|
1791
1793
|
return /* @__PURE__ */ r(
|
|
1792
1794
|
L,
|
|
1793
1795
|
{
|
|
@@ -1847,7 +1849,7 @@ function Lr({
|
|
|
1847
1849
|
}
|
|
1848
1850
|
);
|
|
1849
1851
|
}
|
|
1850
|
-
function
|
|
1852
|
+
function Or({ className: t }) {
|
|
1851
1853
|
const { setTempQueryData: a, setSqlGen: o } = de(), s = ce(), i = z((b) => b.tempQueryData), c = z((b) => b.onClose), m = z((b) => b.card), h = ot(), u = oe(() => h !== m.type ? { ...m, type: h } : m, [m, h]), { queryKey: v } = lt(u);
|
|
1852
1854
|
function y() {
|
|
1853
1855
|
if (i) {
|
|
@@ -1870,7 +1872,7 @@ function qr({ className: t }) {
|
|
|
1870
1872
|
}
|
|
1871
1873
|
);
|
|
1872
1874
|
}
|
|
1873
|
-
function
|
|
1875
|
+
function zr({
|
|
1874
1876
|
label: t = "Clear",
|
|
1875
1877
|
variant: a = "secondary",
|
|
1876
1878
|
className: o
|
|
@@ -1891,18 +1893,18 @@ function Mr({
|
|
|
1891
1893
|
);
|
|
1892
1894
|
}
|
|
1893
1895
|
export {
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1896
|
+
_r as C,
|
|
1897
|
+
Lr as E,
|
|
1898
|
+
Ir as F,
|
|
1897
1899
|
sr as L,
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1900
|
+
Tr as V,
|
|
1901
|
+
Or as a,
|
|
1902
|
+
qr as b,
|
|
1903
|
+
Mr as c,
|
|
1902
1904
|
nr as d,
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
+
Ar as e,
|
|
1906
|
+
Vr as f,
|
|
1905
1907
|
pr as g,
|
|
1906
|
-
|
|
1908
|
+
zr as h,
|
|
1907
1909
|
Le as u
|
|
1908
1910
|
};
|