import{S as zn,V as ht,a as Ze,b as Vi,c as Gi,g as xa,h as Wn}from"./chunk-LRQZDNOT.js";import{C as va,G as Lr,P as et,T as ee,X as Da,a as ra,aa as Xn,b as na,c as Pn,d as oa,e as ia}from"./chunk-7AT2MAST.js";import{Aa as ya,Ae as Gn,De as jn,Fe as Ie,Ga as Ia,Ha as Ta,Me as kn,Na as Sa,Ne as Ct,Oe as ft,Q as ua,Qa as _a,Qe as Te,Ra as Aa,Sa as Ra,Se as La,Xa as Fa,b as oe,d as Ui,db as D,e as se,h as Se,ib as ye,k as de,n as bt,t as Me}from"./chunk-2YDBBK6X.js";import{e as ma}from"./chunk-OGUQS3P5.js";import{D as Ma,H as Ba,M as Va,N as Ua,O as Ga,P as ja,S as xr,a as k,o as vr,r as Pa}from"./chunk-FAVDUOPA.js";import{d as Bi,h as ji,j as Kn,q as Hn,s as wa,t as Yn}from"./chunk-6JGC3K3R.js";import{Z as De,_ as Qe,d as Je,e as Pi,g as Mi,h as Ln,w as vn}from"./chunk-PDEHFL4P.js";import{c as Na,d as xu}from"./chunk-LBA7D2MT.js";import{Bc as gt,Dc as Oa,E as Zi,Ec as Be,Gc as Bn,Ic as Vn,Jc as Un,Tb as ba,V as Pe,Va as aa,Yb as ga,_b as Ca,a as xn,ea as wn,ga as Nn,ha as ea,ia as ta,ja as $e,jc as fa,lc as ha,qb as Mn,va as ue,vc as Ea}from"./chunk-E5OZNRXW.js";import{H as Fr,V as da,Z as pa,d as Ji,g as Ne,ga as ca,j as Qi}from"./chunk-NIIKGMTW.js";import{a as V,b as Xi,c as Dn,d as zi,e as we,f as Or,g as qi,k as $i,p as la,r as sa}from"./chunk-JNFCSGXY.js";import{L as Ar,N as xi,T as On,U as Fn,V as Di,X as wi,zb as Ni}from"./chunk-CM53JYAM.js";import{M as Yi,a as ki,d as Ki,j as Wi,u as Hi}from"./chunk-QQMGWRTG.js";import{a as G}from"./chunk-NBPO6TLV.js";import{e as Rr,f as q,k as le,p as me}from"./chunk-4CA2PWQJ.js";import{$d as Cr,$e as gi,Ae as re,Bg as Li,Ce as fe,D as c,Df as pe,Dg as Tt,E as R,Ef as It,Gd as Fe,Gf as ne,Hb as si,Ie as Ii,If as _i,Jb as vu,Je as Ti,Kf as Ai,Lf as he,Nc as d,Nf as Ri,O as ii,Pa as mt,T as Lu,Xa as li,Yg as vi,Ze as bi,_ as ct,_e as An,_g as Rn,a as T,aa as hn,ae as Ce,b as f,ba as ai,bf as ze,cf as Ci,ch as h,d as Tr,ef as fi,f as Ru,fb as En,fe as Ye,ff as fr,fg as ve,gf as hr,gg as P,hd as H,hf as hi,hg as Ee,id as Oe,ie as mi,if as yt,ig as Oi,j as oi,jf as qe,jg as Fi,k as x,kd as ui,kg as ce,la as o,le as Xe,lf as A,lg as xe,m as pt,ma as O,md as di,me as Le,mg as Er,n as $,nd as pi,ng as Sr,od as gr,oe as yi,p as Cn,pf as Ei,pg as B,q as br,qe as _n,qg as F,rf as Si,s as Ou,sd as ge,t as fn,u as Fu,ud as ci,ug as _r,v as He,xg as L,yd as Sn}from"./chunk-63KZMW3E.js";var _c=Ru((Gv,bn)=>{d();(function(){typeof bn=="object"&&bn.exports?bn.exports=e:this.LRUCache=e;function i(p,y){return Object.prototype.hasOwnProperty.call(p,y)}function r(){return 1}function e(p){if(!(this instanceof e))return new e(p);typeof p=="number"&&(p={max:p}),p||(p={}),this._max=p.max,(!this._max||typeof this._max!="number"||this._max<=0)&&(this._max=1/0),this._lengthCalculator=p.length||r,typeof this._lengthCalculator!="function"&&(this._lengthCalculator=r),this._allowStale=p.stale||!1,this._maxAge=p.maxAge||null,this._dispose=p.dispose,this.reset()}Object.defineProperty(e.prototype,"max",{set:function(p){(!p||typeof p!="number"||p<=0)&&(p=1/0),this._max=p,this._length>this._max&&l(this)},get:function(){return this._max},enumerable:!0}),Object.defineProperty(e.prototype,"lengthCalculator",{set:function(p){if(typeof p!="function"){this._lengthCalculator=r,this._length=this._itemCount;for(var y in this._cache)this._cache[y].length=1}else{this._lengthCalculator=p,this._length=0;for(var y in this._cache)this._cache[y].length=this._lengthCalculator(this._cache[y].value),this._length+=this._cache[y].length}this._length>this._max&&l(this)},get:function(){return this._lengthCalculator},enumerable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0}),Object.defineProperty(e.prototype,"itemCount",{get:function(){return this._itemCount},enumerable:!0}),e.prototype.forEach=function(p,y){y=y||this;for(var I=0,b=this._itemCount,C=this._mru-1;C>=0&&I<b;C--)if(this._lruList[C]){I++;var E=this._lruList[C];n(this,E)&&(u(this,E),this._allowStale||(E=void 0)),E&&p.call(y,E.value,E.key,this)}},e.prototype.keys=function(){for(var p=new Array(this._itemCount),y=0,I=this._mru-1;I>=0&&y<this._itemCount;I--)if(this._lruList[I]){var b=this._lruList[I];p[y++]=b.key}return p},e.prototype.values=function(){for(var p=new Array(this._itemCount),y=0,I=this._mru-1;I>=0&&y<this._itemCount;I--)if(this._lruList[I]){var b=this._lruList[I];p[y++]=b.value}return p},e.prototype.reset=function(){if(this._dispose&&this._cache)for(var p in this._cache)this._dispose(p,this._cache[p].value);this._cache=Object.create(null),this._lruList=Object.create(null),this._mru=0,this._lru=0,this._length=0,this._itemCount=0},e.prototype.dump=function(){return this._cache},e.prototype.dumpLru=function(){return this._lruList},e.prototype.set=function(p,y,I){I=I||this._maxAge;var b=I?Date.now():0;if(i(this._cache,p))return this._dispose&&this._dispose(p,this._cache[p].value),this._cache[p].now=b,this._cache[p].maxAge=I,this._cache[p].value=y,this.get(p),!0;var C=this._lengthCalculator(y),E=new m(p,y,this._mru++,C,b,I);return E.length>this._max?(this._dispose&&this._dispose(p,y),!1):(this._length+=E.length,this._lruList[E.lu]=this._cache[p]=E,this._itemCount++,this._length>this._max&&l(this),!0)},e.prototype.has=function(p){if(!i(this._cache,p))return!1;var y=this._cache[p];return!n(this,y)},e.prototype.get=function(p){return t(this,p,!0)},e.prototype.peek=function(p){return t(this,p,!1)},e.prototype.pop=function(){var p=this._lruList[this._lru];return u(this,p),p||null},e.prototype.del=function(p){u(this,this._cache[p])};function t(p,y,I){var b=p._cache[y];return b&&(n(p,b)?(u(p,b),p._allowStale||(b=void 0)):I&&a(p,b),b&&(b=b.value)),b}function n(p,y){if(!y||!y.maxAge&&!p._maxAge)return!1;var I=!1,b=Date.now()-y.now;return y.maxAge?I=b>y.maxAge:I=p._maxAge&&b>p._maxAge,I}function a(p,y){s(p,y),y.lu=p._mru++,p._lruList[y.lu]=y}function l(p){for(;p._lru<p._mru&&p._length>p._max;)u(p,p._lruList[p._lru])}function s(p,y){for(delete p._lruList[y.lu];p._lru<p._mru&&!p._lruList[p._lru];)p._lru++}function u(p,y){y&&(p._dispose&&p._dispose(y.key,y.value),p._length-=y.length,p._itemCount--,delete p._cache[y.key],s(p,y))}function m(p,y,I,b,C,E){this.key=p,this.value=y,this.lu=I,this.length=b,this.now=C,E&&(this.maxAge=E)}})()});d();ai();var wc=1e3,Du=3,wu=["Person","Assignee","Assigned To","Manager","Owner","Creator","Author","Reporter","Employee","User","Reported By","DRI","EM","PM"].map(i=>i.toLowerCase());function Wa(i){return["collaborator","multiCollaborator"].includes(i)}function Ha(i){return wu.includes(i.trim().toLowerCase())}function ka(i){return(i==null?void 0:i[0])&&/^[A-Z]*$/.test(i[0])}function Nu(i){let r=i.split(" ");return r.length===2&&ka(r[0])&&ka(r[1])}function Pu({value:i,type:r,typeOptions:e,appInterface:t}){if(La({cellValue:i,type:r,typeOptions:e},t).length>1)return null;let a=Ct({cellValue:i,type:r,typeOptions:e},t);return a?a&&(ct(a)||Nu(a)):null}function Ya({isPrimaryColumn:i,name:r,typeOptions:e,type:t,appInterface:n,values:a}){return i||Wa(t)||a.filter(s=>!Kn({cellValue:s,type:t,typeOptions:e})).length>Du||!Ha(r)?null:"collaborator"}function Nc(i){return Ha(i)?"collaborator":null}function Pc({isPrimaryColumn:i,typeOptions:r,type:e,appInterface:t,otherColumnValues:n,newValue:a}){if(i||Wa(e))return null;let l=s=>Kn({cellValue:s,type:e,typeOptions:r});return l(a)||n.some(s=>!l(s))?null:Pu({type:e,typeOptions:r,value:a,appInterface:t})?"collaborator":null}d();h();h();R();$();d();Cn();O();d();O();var Mu={V0:0};var Et=o.object({version:o.enum(Mu),folderPath:o.string(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),Xa=o.object(f(T({},Et.shape),{baseUrl:o.url(),shouldSyncFolders:o.boolean().optional(),label:o.string().optional()})).passthrough();d();Cn();O();d();O();var za=o.dict(o.tableId(),o.union([o.object({doesTableExist:o.enum([!0]),tableName:o.string()}),o.object({doesTableExist:o.enum([!1])})]));var Ja=(e=>(e[e.V0=0]="V0",e[e.V1=1]="V1",e))(Ja||{}),St=o.object({version:o.enum(Ja).optional(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),Qa=o.object(f(T({},St.shape),{applicationId:o.applicationId().sensitivity("LOW_INTERNAL"),tableId:o.tableId().sensitivity("LOW_INTERNAL"),viewId:o.viewId().sensitivity("LOW_INTERNAL"),viewType:o.enum(Je),viewName:o.string(),rowUnit:o.enum(Bn).optional(),applicationTransactionNumber:o.integer().nonNegative(),isTimeDependent:o.boolean().optional(),label:o.string().optional(),applicationChangeHookId:o.applicationChangeHookId().optional(),perChangeHookTransactionNumberForNextPayload:o.integer().positive().nullable().optional(),rawSourceSchema:o.object({columns:o.array(o.object(f(T({},k.shape),{isEditableFromSync:o.boolean().optional()})))}).optional().passthrough(),realTimeSyncConsecutiveFallbackToFullTableSyncCount:o.integer().nonNegative().optional(),shouldSyncLinkedRecordsForSource:o.boolean().optional(),shouldAllowEditingLinkedRecordsFromSyncForSource:o.boolean().optional(),syncLinkedRecordsSharedViewMetadataForSource:Pi.optional(),infoForSyncLinkedRecordsByForeignTableIdForSource:za.optional(),syncLinkedRecordsSourceColumnJsonById:o.dict(o.columnId(),k).optional(),allSourceForeignKeyColumnJsonById:o.dict(o.columnId(),k).optional()})).passthrough();function Zc(i,r){return i.applicationId===r.applicationId&&i.tableId===r.tableId}d();h();O();var Bu={V0:0};var _t=o.object({version:o.enum(Bu),primaryFieldId:o.string().refine(i=>!0),uniqueIds:o.array(o.string())}).passthrough(),Za=_t.extend({label:o.string().optional(),columnInfoByExternalFieldId:o.dict(o.string().refine(i=>!0),o.object(P(k.shape,["name","type","typeOptions"]))).refine(i=>!0)}).passthrough(),om=o.object({apiEndpointUrl:o.string(),apiEndpointSyncId:o.string()}).passthrough(),im="No API requests received";d();O();var At=o.object({siteId:o.string().refine(gt(/([a-z0-9]+-)+[a-z0-9]+/)),filterId:o.string().refine(gt(/[0-9]+/)),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),$a=o.object(f(T({},At.shape),{siteBaseUrl:o.url(),filterName:o.string(),filterJql:o.string(),filterViewUrl:o.url(),fieldMetadataByFieldKey:o.dict(o.string(),o.object({}).passthrough()),columnIdByFieldKey:o.dict(o.string(),o.string()),label:o.string().optional()})).passthrough();d();O();d();d();O();var Vu=o.object({self:o.string().optional(),accountId:o.string().optional(),emailAddress:o.string().optional(),name:o.string().optional(),displayName:o.string().optional(),timeZone:o.string().optional()}).passthrough(),Tm=o.object({atlassianJiraProfile:Vu}).passthrough(),bm=o.object({id:o.string(),url:o.string(),name:o.string(),scopes:o.array(o.string()),avatarUrl:o.string()}).passthrough(),el=o.object({type:o.string(),custom:o.string().optional(),customId:o.number().optional(),items:o.string().optional(),system:o.string().optional(),configuration:o.dict(o.string(),o.any()).optional()}).passthrough(),tl=o.object({id:o.string().optional(),name:o.string().optional(),key:o.string().optional(),schema:el.optional().passthrough()}).passthrough(),gm=o.object({add:o.any(),copy:o.any(),edit:o.any(),remove:o.any(),set:o.any()}),Cm=o.object({id:o.string().optional(),key:o.string().optional()}).passthrough(),qn=o.object({key:o.string().optional(),name:o.string(),required:o.boolean(),schema:el,allowedValues:o.array(o.any()).optional(),operations:o.array(o.string()),hasDefaultValue:o.boolean().optional(),autoCompleteUrl:o.string().optional(),defaultValue:o.any()}).passthrough(),rl=o.object({id:o.string().optional(),name:o.string().optional(),fields:o.dict(o.string(),qn).optional(),subtask:o.boolean().optional()}).passthrough(),Uu=o.object({key:o.string().optional(),issuetypes:o.array(rl).optional()}).passthrough(),fm=o.object({projects:o.array(Uu).optional()}).passthrough(),hm=o.object({baseUrl:o.url().optional(),versionNumbers:o.array(o.integer()).optional()}).passthrough(),Gu=o.object({id:o.string().optional(),name:o.string(),jql:o.string().optional(),viewUrl:o.string().optional()}).passthrough(),Em=o.object({isLast:o.boolean().optional(),values:o.array(Gu).optional()}).passthrough();var Sm=o.object({values:o.array(o.object({id:o.string().optional(),name:o.string().optional(),key:o.string().optional(),archived:o.boolean().optional(),deleted:o.boolean().optional()}).passthrough()).optional(),isLast:o.boolean().optional(),startAt:o.number().optional(),maxResults:o.number().optional()}).passthrough(),_m=o.object({id:o.string().optional(),name:o.string().optional(),key:o.string().optional(),archived:o.boolean().optional(),deleted:o.boolean().optional(),issueTypes:o.array(rl).optional()}).passthrough(),Am=o.object({id:o.string(),statuses:o.array(o.object({id:o.string().optional(),name:o.string().optional()}).passthrough())}).passthrough(),ju=o.object({id:o.string().optional(),key:o.string().optional(),fields:o.dict(o.string(),o.any()).optional()}).passthrough(),Rm=o.object({total:o.number().optional(),issues:o.array(ju).optional()}).passthrough(),Om=o.object({transitions:o.array(o.object({id:o.string().optional(),to:o.object({id:o.string().optional(),name:o.string().optional()}).passthrough().optional()}).passthrough()).optional()}).passthrough();var ku={V0:0,V1:1},Rt=o.object({version:o.enum(ku),filterId:o.string().refine(gt(/[0-9]+/)),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),nl=o.object(f(T({},Rt.shape),{siteBaseUrl:o.url(),filterName:o.string(),filterJql:o.string(),filterViewUrl:o.url(),fieldMetadataByFieldKey:o.union([o.dict(o.string(),qn),o.dict(o.string(),tl)]),columnIdByFieldKey:o.dict(o.string(),o.string()),label:o.string().optional()})).passthrough();d();O();var Ku={V0:0,V1:1},Ot=o.object({version:o.enum(Ku),organizationName:o.string(),project:o.string(),workItemType:o.string(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),Wu=o.dict(o.string(),o.object({type:o.string(),isIdentity:o.boolean().optional(),isPicklist:o.boolean().optional(),isPicklistSuggested:o.boolean().optional(),readOnly:o.boolean().optional(),picklistId:o.string().optional()})),ol=o.object(f(T({},Ot.shape),{label:o.string().optional(),projectName:o.string(),fieldMetadataByReferenceName:Wu})).passthrough();d();O();d();O();var Ft=o.object({id:o.string(),name:o.string(),url:o.string(),type:o.enum(["file","folder"])}),Jn=(e=>(e.USER_CANCELLED="userCancelled",e.COULD_NOT_OPEN_POPUP_WINDOW="couldNotOpenPopupWindow",e))(Jn||{}),Km=o.object({err:o.enum(Jn).optional(),value:Ft.optional()}).refine(i=>i.err&&i.value?{success:!1,errors:['Both "err" and "value" are set']}:!i.err&&!i.value?{success:!1,errors:['Neither of "err" and "value" are set']}:{success:!0}),Wm=o.object({err:o.enum(Jn).optional(),value:o.union([o.array(Ft),Ft]).optional()}).refine(i=>i.err&&i.value?{success:!1,errors:['Both "err" and "value" are set']}:!i.err&&!i.value?{success:!1,errors:['Neither of "err" and "value" are set']}:{success:!0});var Hu={V0:0,V1:1},Lt=o.object({rootFolderReference:Ft,version:o.enum(Hu).optional(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),il=o.object(f(T({},Lt.shape),{label:o.string().optional(),shouldSyncFolders:o.boolean().optional()})).passthrough();d();O();d();h();R();O();d();h();O();var vt=(t=>(t.TEXT="text",t.NUMBER="number",t.TIMESTAMP="timestamp",t))(vt||{}),Dr=o.number().refine(i=>ge(i));var $m=o.object({id:Dr,name:o.string(),type:o.enum(vt)});d();h();R();O();var xt={"+":{operandTypes:["number","number"],outputType:"number",documentation:{definition:"number1 + number2",summary:"Returns the sum of two numbers",example:"1 + 1 => 2"}},"-":{operandTypes:["number","number"],outputType:"number",documentation:{definition:"number1 - number2",summary:"Subtracts number2 from number1",example:"1 - 1 => 0"}},"*":{operandTypes:["number","number"],outputType:"number",documentation:{definition:"number1 * number2",summary:"Returns the result of the multiplication of two numbers",example:"1 - 1 => 0"}},"/":{operandTypes:["number","number"],outputType:"number",documentation:{definition:"number1 / number2",summary:"Divide number1 by number2",example:"4 / 2 => 2"}},CEILING:{operandTypes:["number"],outputType:"number",documentation:{definition:"CEILING(number)",summary:"Returns the smallest integer value that is bigger than or equal to a number",example:"CEILING(1.5) => 2"}},FLOOR:{operandTypes:["number"],outputType:"number",documentation:{definition:"FLOOR(number)",summary:"Returns the largest integer value that is less than or equal to a number",example:"FLOOR(1.5) => 1"}},CONCAT:{operandTypes:["text"],outputType:"text",repeatLastArg:!0,documentation:{definition:"CONCAT(string1, [string2, ...])",summary:"Joins together the text arguments into a single text value.",example:'CONCAT(name, " - ", date)'}},LOWER:{operandTypes:["text"],outputType:"text",documentation:{definition:"LOWER(string)",summary:"Returns the lowercase of the string",example:"LOWER('ABC') => 'abc'"}},LEFT:{operandTypes:["text","number"],outputType:"text",documentation:{definition:"LEFT(string, howMany)",summary:"Extracts howMany characters from the beginning of the string",example:"LEFT('ABC', 1) => 'A'"}},LENGTH:{operandTypes:["text"],outputType:"number",documentation:{definition:"LENGTH(string)",summary:"Returns the length of a string",example:"LENGTH('ABC') => 3"}},REPLACE:{operandTypes:["text","text","text"],outputType:"text",documentation:{definition:"REPLACE(string, sub_string, new_value)",summary:"Replaces the sub_string with new_value in a string",example:"REPLACE('ABCA', 'A', 'X') => 'XBCX'"}},RIGHT:{operandTypes:["text","number"],outputType:"text",documentation:{definition:"RIGHT(string, howMany)",summary:"Extracts howMany characters from the end of the string",example:"RIGHT('ABC', 1) => 'C'"}}},iy=F(xt);c.assert.isTrueType();var Qn=o.number().refine(i=>ge(i)),Zn=[o.object({type:o.enum(["column"]),columnId:Dr}),o.object({type:o.enum(["derived"]),columnId:Qn})],al=o.union(Zn),ll=o.lazy(()=>o.union([o.object({type:o.enum(["constant"]),columnType:o.enum(["text"]),input:o.string()}),o.object({type:o.enum(["constant"]),columnType:o.enum(["number"]),input:o.number()}),o.object({type:o.enum(["column"]),columnId:Dr}),o.object({type:o.enum(["derived"]),columnId:Qn}),o.object({type:o.enum(["formula"]),formulaName:o.enum(F(xt)),columnInputs:o.array(ll)})])),sl=o.object({id:Qn,name:o.string(),formulaName:o.enum(F(xt)),columnInputs:o.array(ll)});c.assert.isTrueType();function $n(i,r,e=new Map){let t=a=>{var l;switch(a.type){case"constant":return a.columnType;case"column":{let s=i.get(a.columnId);return s?s.type:null}case"derived":return(l=e.get(a.columnId))!=null?l:null;case"formula":return n(a);default:throw new A(a)}},n=a=>{let l=xt[a.formulaName];if(a.columnInputs.length<l.operandTypes.length)return null;for(let s=0;s<a.columnInputs.length;s++){let u;if(s>=l.operandTypes.length){if(!l.repeatLastArg)return null;u=l.operandTypes[l.operandTypes.length-1]}else u=l.operandTypes[s];if(c.assert.isNotUndefinedOrNull(u),t(a.columnInputs[s])!==u)return null}return l.outputType};for(let a of r){if(e.has(a.id))return!1;let l=n(a);if(l===null)return!1;e.set(a.id,l)}return!0}function ay(i){return"formulaName"in i}d();h();h();O();var dl=["isEmpty","isNotEmpty"],wr={text:["=","!="],number:["=","!=",">",">=","<","<="],timestamp:["=","!=",">",">=","<","<="]};function eo(i){return dl.includes(i)}function Xu(i,r){if(!i)return!1;if(eo(r.operator))return r.value===null;if(r.value===null||!wr[i].includes(r.operator))return!1;switch(i){case"text":return!0;case"number":return!Number.isNaN(parseFloat(r.value));case"timestamp":return!Number.isNaN(Date.parse(r.value));default:throw new A(i)}}function to(i,r,e){return Fe.every(e.filters,t=>{var n,a;return"conjunction"in t?to(i,r,t):Xu((a=t.type==="column"?(n=i.get(t.columnId))==null?void 0:n.type:r.get(t.columnId))!=null?a:null,t)})}function zu(i){let r=Cr.default(i.filters.map(e=>"conjunction"in e?zu(e):!eo(e.operator)&&!e.value?null:e));return{conjunction:i.conjunction,filters:r}}var qu=o.union(Zn.map(i=>i.extend({operator:o.enum([...dl,...wr.text,...wr.number,...wr.timestamp]),value:o.string().nullable()}))),ro=o.lazy(()=>o.object({conjunction:o.enum(Ne),filters:o.array(o.union([qu,ro]))}));var pl=o.object({derivedColumns:o.array(sl),selectColumnOrDerivedColumnIds:o.array(al),filters:ro,limit:o.number().optional()});c.assert.isTrueType();function Ly(i,r,e){let t=new Map,n=new Set;for(let l of r.selectColumnOrDerivedColumnIds)if(l.type==="column"){let{columnId:s}=l;if(!i.has(s))return{err:"first query has invalid column id"};t.set(s,i.get(s))}else n.add(l.columnId);let a=new Map;if(!$n(i,r.derivedColumns,a))return{err:"first query derived columns do not typecheck"};for(let l of a.keys())n.has(l)||a.delete(l);if(!$n(t,e.derivedColumns,a))return{err:"second query derived columns do not typecheck"};for(let l of e.derivedColumns)n.add(l.id);for(let l of e.selectColumnOrDerivedColumnIds)if(l.type==="column"){if(!t.has(l.columnId))return{err:"second query returning hidden column"}}else if(!n.has(l.columnId))return{err:"second query returning hidden derived column"};return to(t,a,e.filters)?{value:{derivedColumns:[...r.derivedColumns,...e.derivedColumns],selectColumnOrDerivedColumnIds:e.selectColumnOrDerivedColumnIds,filters:{conjunction:"and",filters:[r.filters,e.filters]},limit:e.limit}}:{err:"second query filtering on hidden column"}}var Ju={V0:0},Dt=o.object({publishedDatasetId:o.publishedDatasetId(),additionalQuery:pl.optional()}),cl=o.object(f(T({version:o.enum(Ju),label:o.string(),primaryFieldId:o.string().refine(i=>!0).optional()},Dt.shape),{lastUpdateTimeMicroseconds:o.number().optional()})).passthrough();d();h();O();vu();var wt=o.object({primaryField:o.string().refine(i=>!0),uniqueIds:o.array(o.string()),emailCustomPrefix:o.string(),region:o.enum(si).optional()}).passthrough(),ml=wt.extend({label:o.string().optional(),columnInfoByExternalFieldId:o.dict(o.string().refine(i=>!0),o.object(P(k.shape,["name","type","typeOptions"]))).refine(i=>!0)}).passthrough(),jy=o.object({emailSyncId:o.string(),emailAddressSuffix:o.string()}).passthrough(),ky=o.object({headerRow:o.array(o.string()),dataRows:o.array(o.array(o.string())),range:o.string(),headersOfEmptyCols:o.array(o.string()).optional()}).passthrough(),Ky=o.object({emailAddress:o.string()}).passthrough();var Wy="No emails received";d();O();var Qu={V0:0},Nt=o.object({version:o.enum(Object.values(Qu)),repoId:o.string().min(1),filters:o.object({milestone:o.string().min(1).optional(),state:o.string().min(1).optional(),assignee:o.string().min(1).optional(),creator:o.string().min(1).optional(),mentioned:o.string().min(1).optional(),labels:o.array(o.string().min(1)).optional(),since:o.dateTimeIsoString().optional()}).optional(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),yl=o.object(f(T({},Nt.shape),{label:o.string().optional(),repoNameWithOwner:o.string().min(1)})).passthrough(),zy=o.object({id:o.integer().positive(),html_url:o.url(),title:o.string(),number:o.integer().positive(),state:o.string(),labels:o.array(o.object({node_id:o.string().min(1),name:o.string()}).passthrough()),locked:o.boolean(),assignees:o.array(o.object({login:o.string()}).passthrough()),milestone:o.object({node_id:o.string().min(1),title:o.string()}).passthrough().nullable(),comments:o.integer().nonNegative(),created_at:o.dateTimeIsoString(),updated_at:o.dateTimeIsoString(),closed_at:o.dateTimeIsoString().nullable(),body:o.string().nullable(),user:o.object({login:o.string()}).passthrough()}).passthrough();d();O();var Zu={V0:0},Pt=o.object({version:o.enum(Zu),repoId:o.string().min(1),state:o.string().min(1),since:o.dateTimeIsoString(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),Il=o.object(f(T({},Pt.shape),{label:o.string().optional(),repoNameWithOwner:o.string().min(1)})).passthrough(),$y=o.object({id:o.integer().positive(),html_url:o.url(),title:o.string(),number:o.integer().positive(),state:o.string(),labels:o.array(o.object({node_id:o.string().min(1),name:o.string()}).passthrough()),locked:o.boolean(),draft:o.boolean(),assignees:o.array(o.object({login:o.string()}).passthrough()),requested_reviewers:o.array(o.object({login:o.string()}).passthrough()),requested_teams:o.array(o.object({node_id:o.string().min(1),name:o.string()}).passthrough()),milestone:o.object({node_id:o.string().min(1),title:o.string()}).passthrough().nullable(),merge_commit_sha:o.string().min(1).nullable(),created_at:o.dateTimeIsoString(),updated_at:o.dateTimeIsoString(),closed_at:o.dateTimeIsoString().nullable(),merged_at:o.dateTimeIsoString().nullable(),body:o.string().nullable(),user:o.object({login:o.string()}).passthrough()}).passthrough(),eI=o.object({id:o.integer().positive(),html_url:o.url(),title:o.string(),number:o.integer().positive(),state:o.string(),labels:o.array(o.object({node_id:o.string().min(1),name:o.string()}).passthrough()),locked:o.boolean(),draft:o.boolean(),assignees:o.array(o.object({login:o.string()}).passthrough()),requested_reviewers:o.array(o.object({login:o.string()}).passthrough()),requested_teams:o.array(o.object({node_id:o.string().min(1),name:o.string()}).passthrough()),milestone:o.object({node_id:o.string().min(1),title:o.string()}).passthrough().nullable(),merge_commit_sha:o.string().min(1).nullable(),created_at:o.dateTimeIsoString(),updated_at:o.dateTimeIsoString(),closed_at:o.dateTimeIsoString().nullable(),merged_at:o.dateTimeIsoString().nullable(),body:o.string().nullable(),user:o.object({login:o.string()}).passthrough(),head:o.object({ref:o.string()}).passthrough()}).passthrough();d();O();var Tl=(e=>(e.V0="v0",e.V1="v1",e))(Tl||{}),Mt=o.object({calendarId:o.string(),syncRangeStart:o.dateTimeIsoString(),syncRangeEnd:o.dateTimeIsoString(),version:o.enum(Tl).optional(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),bl=o.object(f(T({},Mt.shape),{calendarName:o.string(),label:o.string().optional(),timezone:o.string().optional().nullable()})).passthrough();d();O();var $u={V0:0,V1:1},Bt=o.object({rootFolderReference:va,version:o.enum($u).optional(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),gl=o.object(f(T({},Bt.shape),{label:o.string().optional(),shouldSyncFolders:o.boolean().optional()})).passthrough();d();O();var Cl=(r=>(r[r.V0=0]="V0",r))(Cl||{}),Vt=o.object({version:o.enum(Cl),calendarId:o.string(),syncRangeStart:o.dateTimeIsoString(),syncRangeEnd:o.dateTimeIsoString(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),fl=o.object(f(T({},Vt.shape),{calendarName:o.string(),isPersonalMicrosoftAccount:o.boolean(),label:o.string().optional()})).passthrough();d();O();var ed={V0:0};var td=o.object({id:o.string(),parentId:o.string().optional(),parent:o.object({id:o.string().optional()}).optional().passthrough(),type:o.string(),data:o.object({content:o.string().optional(),title:o.string().optional()}).passthrough().optional(),style:o.object({fillColor:o.string().optional()}).passthrough().optional(),createdAt:o.dateTimeIsoString(),createdBy:o.object({id:o.string(),type:o.string()}).passthrough(),modifiedAt:o.dateTimeIsoString(),modifiedBy:o.object({id:o.string(),type:o.string()}).passthrough()}).passthrough(),gI=o.object({limit:o.number(),size:o.number(),cursor:o.string().optional(),data:o.array(td)}).passthrough(),CI=o.object({id:o.number(),name:o.string(),email:o.string()}).passthrough(),Ut=o.object({version:o.enum(ed),boardId:o.string(),frameIds:o.array(o.string()).optional(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),hl=o.object(f(T({},Ut.shape),{boardName:o.string(),label:o.string().optional()})).passthrough();d();O();var El=(r=>(r.V0="v0",r))(El||{}),Gt=o.object({version:o.enum(El).optional(),primaryFieldId:o.string().refine(i=>!0).optional(),enterpriseAccountId:o.enterpriseAccountId().optional()}).passthrough(),Sl=o.object(f(T({},Gt.shape),{label:o.string().optional()})).passthrough();d();O();d();O();var FI=o.object({active:o.enum([!0]),scope:o.string(),client_id:o.string(),username:o.string(),sub:o.string(),token_type:o.enum(["access_token","refresh_token"]),exp:o.number(),iat:o.number(),nbf:o.number()}),LI=o.object({access_token:o.string(),signature:o.string(),scope:o.string(),instance_url:o.string(),id:o.string(),token_type:o.enum(["Bearer"]),issued_at:o.string()}),vI=o.array(o.object({id:o.string(),name:o.string()}).passthrough()),no=o.object({dataType:o.string(),label:o.string()}).passthrough(),tt=o.object({reportMetadata:o.object({id:o.string(),name:o.string(),detailColumns:o.array(o.string()),sortBy:o.array(o.object({sortColumn:o.string(),sortOrder:o.enum(["Asc","Desc"])}).passthrough()),reportFormat:o.string(),reportBooleanFilter:o.string().nullable(),reportFilters:o.array(o.object({column:o.string(),filterType:o.string(),operator:o.string(),value:o.string()}).passthrough()),groupingsDown:o.array(o.object({name:o.string(),sortOrder:o.enum(["Asc","Desc"])}).passthrough()),groupingsAcross:o.array(o.object({name:o.string(),sortOrder:o.enum(["Asc","Desc"])}).passthrough()),buckets:o.array(o.object({}).passthrough()).optional(),crossFilters:o.array(o.object({}).passthrough()).optional().nullable(),reportType:o.object({type:o.string(),label:o.string()}).passthrough()}).passthrough(),reportExtendedMetadata:o.object({detailColumnInfo:o.dict(o.string(),no),groupingColumnInfo:o.dict(o.string(),no)}).passthrough(),reportTypeMetadata:o.object({categories:o.array(o.object({columns:o.dict(o.string(),no)}).passthrough()),objectRelationships:o.array(o.object({primaryEntityField:o.string()}).passthrough()).optional()}).passthrough()}).passthrough(),xI=o.object({id:o.string(),status:o.string(),requestDate:o.dateTimeIsoString()}).passthrough(),Nr=o.lazy(()=>o.union([o.object({groupings:o.array(Nr),key:o.string(),label:o.string(),value:o.any()}).passthrough(),o.object({groupings:o.array(Nr)}).passthrough()])),DI=o.object({attributes:o.object({status:o.string().optional(),errorMessage:o.string().optional().nullable()}).passthrough(),allData:o.boolean().nullable(),reportMetadata:tt.shape.reportMetadata.nullable(),reportExtendedMetadata:tt.shape.reportExtendedMetadata.nullable(),reportTypeMetadata:tt.shape.reportTypeMetadata.optional(),factMap:o.dict(o.string(),o.object({rows:o.array(o.object({dataCells:o.array(o.object({label:o.string(),escapedLabel:o.string().optional(),value:o.any()}).passthrough())}).passthrough())}).passthrough()).nullable(),groupingsDown:o.union([Nr,o.null()]),groupingsAcross:o.union([Nr,o.null()])}).passthrough(),wI=o.object({sobjects:o.array(o.object({name:o.string(),label:o.string(),createable:o.boolean(),updateable:o.boolean()}).passthrough())}).passthrough(),rd=o.object({name:o.string(),label:o.string(),length:o.number(),createable:o.boolean(),updateable:o.boolean(),nillable:o.boolean(),type:o.string(),referenceTo:o.array(o.string()),picklistValues:o.array(o.object({label:o.string().nullable(),value:o.string()}).passthrough())}).passthrough(),NI=o.object({name:o.string(),label:o.string(),fields:o.array(rd)}).passthrough(),PI=o.object({id:o.string(),success:o.boolean()}).passthrough(),MI=o.object({totalSize:o.number(),done:o.boolean(),records:o.array(o.dict(o.string(),o.any())),nextRecordsUrl:o.string().optional().nullable()}).passthrough(),BI=o.object({timezone:o.string().optional().nullable()}).passthrough();var _l=(e=>(e.V0="v0",e.V1="v1",e))(_l||{}),jt=o.object({reportId:o.string(),primaryField:o.string().refine(i=>!0).optional(),uniqueIdField:o.string().optional(),version:o.enum(_l).optional()}).passthrough(),Al=jt.extend({salesforceInstanceUrl:o.string(),reportMetadata:tt.extend({reportTypeMetadata:tt.shape.reportTypeMetadata.optional()}),lastSyncedTime:o.dateTimeIsoString().nullable(),numRowsInLastSync:o.number().optional(),label:o.string().optional()}).passthrough();d();O();var Rl=(e=>(e.TABLE="table",e.VIEW="view",e))(Rl||{});var nd={V0:0},kt=o.object({warehouseName:o.string(),databaseName:o.string(),schemaName:o.string(),modelType:o.enum(Rl),modelName:o.string(),uniqueColumnName:o.string(),version:o.enum(nd),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),Ol=o.object(f(T({},kt.shape),{label:o.string().optional()})).passthrough(),HI=o.object({syncRecordLimitIfModelExceedsLimit:o.number().nullable(),doesModelContainOrderByClause:o.boolean()}).passthrough();d();O();var od={V0:0};var Kt=o.object({version:o.enum(od),viewId:o.string(),uniqueIdFields:o.array(o.string()),primaryFieldId:o.string().refine(i=>!0)}).passthrough(),Fl=o.object(f(T({},Kt.shape),{viewName:o.string(),viewUrl:o.url(),label:o.string().optional()})).passthrough();d();O();var id={V0:0};var Wt=o.object({version:o.enum(id),viewId:o.string(),uniqueIdFields:o.array(o.string()),primaryFieldId:o.string().refine(i=>!0)}).passthrough(),Ll=o.object(f(T({},Wt.shape),{viewName:o.string(),viewUrl:o.url(),label:o.string().optional()})).passthrough();d();O();var ad={V0:0};var oo=o.object({version:o.enum(ad),reportUrl:o.string().optional(),primaryFieldId:o.string().refine(i=>!0),uniqueIdFields:o.array(o.string()).min(1)}).passthrough(),vl=oo.extend({label:o.string().optional()}).passthrough();d();O();var ld={V0:0};var sd=o.object({id:o.number(),type:o.string(),title:o.string(),active:o.boolean(),removable:o.boolean(),position:o.number(),system_field_options:o.array(o.object({name:o.string(),value:o.string()}).passthrough()).optional(),custom_field_options:o.array(o.object({name:o.string(),value:o.string()}).passthrough()).optional()}).passthrough(),Ht=o.object({version:o.enum(ld),viewId:o.string(),primaryFieldId:o.string().refine(i=>!0).optional()}).passthrough(),xl=o.object(f(T({},Ht.shape),{viewName:o.string(),subdomain:o.string(),ticketFields:o.array(sd),label:o.string().optional()})).passthrough();d();var Yt=(y=>(y.CREATE="create",y.REMOVE="remove",y.ADD_NEW_SOURCE="addNewSource",y.REAUTHENTICATE="reauthenticate",y.RECONFIGURE="reconfigure",y.MANUAL_SYNC="manualSync",y.AUTOMATIC_SYNC="automaticSync",y.TWO_WAY_SYNC="twoWaySync",y.ERROR_FALLBACK="errorFallback",y.TWO_WAY_SYNC_FORCE_FULL_SYNC="twoWaySyncForceFullSync",y.REAL_TIME_SYNC="realTimeSync",y))(Yt||{});var ie=o.string().refine(i=>!0);var kT=o.object({latestTransactionNumber:o.number(),latestBaseTransactionNumber:o.number().optional(),earliestCommitTimestamp:o.dateTimeIsoString().nullable(),externalTableSyncTargetTimestampsByApplicationExternalTableSyncId:o.dict(o.string(),o.array(o.dateTimeIsoString())).optional()}),KT=o.object({updatedCellValue:Be,updateTimestamp:o.dateTimeIsoString(),isSaveInProgress:o.boolean().optional()}).refine(i=>!0),io=(e=>(e.SYNC="sync",e.COPY="copy",e))(io||{}),ud=o.object({cellValueByExternalFieldId:o.dict(ie,Be),externalResourceId:o.string()}),WT=o.object({convertedExternalResources:o.array(ud),warning:o.string().optional()}),HT=o.union([St,At,Rt,Mt,Bt,jt,Lt,wt,Vt,Nt,Pt,Ht,Ut,Kt,Wt,Et,_t,kt,Gt,Dt,Ot]),Nl=o.union([Qa,$a,nl,bl,gl,Al,il,ml,fl,yl,Il,xl,hl,Fl,Ll,Xa,Za,Ol,Sl,vl,cl,ol]).sensitivity("HIGH_CUSTOMER_DATA"),Pr="all",Mr=o.union([o.enum([Pr]),o.array(ie)]),Pl=o.object({canEdit:o.boolean(),canCreate:o.boolean(),canDelete:o.boolean()}),Xt=o.object({columnInfoByExternalFieldId:o.dict(ie,k.pick(["name","type","typeOptions"])).refine(i=>!0),unsupportedFieldNameById:o.dict(ie,o.string()),primaryColumnExternalFieldId:ie,metadata:Nl,defaultSelectedExternalFieldIds:Mr.optional(),editableExternalFieldIds:o.array(ie),twoWaySyncPermissions:Pl.optional()}).passthrough(),YT=o.union([Xt,o.enum(["error"])]);var Br=(n=>(n.SYNCED="synced",n.DESTROYED="unavailable",n.UNMAPPED="unmapped",n.UNSUPPORTED_TYPE="unsupportedType",n))(Br||{}),dd=o.object({id:o.string(),name:o.string(),state:o.enum(Br),destroyActionId:o.actionId().optional(),destroyedColumnId:o.columnId().optional()});var Ve=(e=>(e.NEVER="never",e.AUTOMATIC="automatic",e))(Ve||{}),pd=(e=>(e.DELETE_RECORDS="deleteRecords",e.LEAVE_RECORDS="leaveRecords",e))(pd||{}),Ue=(t=>(t.NONE="none",t.EDIT="edit",t.CREATE="create",t))(Ue||{}),cd=o.union([o.enum([Pr]),o.array(o.columnId())]),ao=o.object({isImplicitView:o.boolean(),mainSharedViewSourceTableId:o.tableId()}),md=o.object({dataSourceType:o.enum(de).sensitivity("LOW_INTERNAL"),externalAccountId:o.externalAccountId().nullable().sensitivity("LOW_INTERNAL"),externalFieldIdByColumnId:o.dict(o.columnId(),ie).sensitivity("HIGH_CUSTOMER_DATA"),lastKnownColumnIdByExternalFieldId:o.dict(ie,o.columnId()).sensitivity("HIGH_CUSTOMER_DATA").refine(i=>!0),authoritativeColumnIds:cd.sensitivity("LOW_INTERNAL"),syncFrequency:o.enum(Ve).sensitivity("LOW_INTERNAL"),shouldSyncRowDeletions:o.boolean().sensitivity("LOW_INTERNAL"),shouldSkipRowInsertions:o.boolean().optional().sensitivity("LOW_INTERNAL"),editSourceRecordPermissionLevel:o.enum(Ue).optional().sensitivity("LOW_INTERNAL"),selectedExternalFieldIds:Mr.sensitivity("HIGH_CUSTOMER_DATA"),schemaMetadata:Nl.parseAsJsonForEtl(),columnInfoByExternalFieldId:o.dict(ie,k.pick(["name","type","typeOptions"])).optional().sensitivity("HIGH_CUSTOMER_DATA"),editableExternalFieldIds:o.array(ie).optional().sensitivity("HIGH_CUSTOMER_DATA"),twoWaySyncPermissions:Pl.optional().sensitivity("LOW_INTERNAL"),syncedLinkedTablesInfo:ao.optional().sensitivity("LOW_INTERNAL")});var rt=(t=>(t.PENDING_SYNC="pendingSync",t.SYNCED="synced",t.ERROR="error",t))(rt||{});var Vr=(g=>(g.GENERIC_TIMEOUT="genericTimeout",g.GENERIC_UPDATE_FAILURE="genericUpdateFailure",g.MULTI_SOURCE_SYNC_UPDATE_FAILURE="multiSourceSyncUpdateFailure",g.GENERIC_SYNC_WARNING="genericSyncWarning",g.DATA_SOURCE_UNAVAILABLE="dataSourceUnavailable",g.PRIMARY_FIELD_ERROR="primaryFieldError",g.UPDATE_SOURCE_RECORD_ERROR="updateSourceRecordError",g.SYNC_CONFIG_INVALID_ERROR="syncConfigInvalidError",g.REAUTHENTICATION_REQUIRED="reauthenticationRequired",g.INVALID_EXTERNAL_ACCOUNT="invalidExternalAccount",g.INVALID_INPUTS_RECEIVED="invalidInputsReceived",g.INSUFFICIENT_PERMISSIONS="insufficientPermissions",g.MISSING_OAUTH_CREDENTIAL="missingOauthCredential",g.DEPRECATED_UPGRADE_REQUIRED="upgradeRequired",g.EXCEEDS_MAX_SYNCED_TABLES_PER_BASE="exceedsMaxSyncedTablesPerBase",g.UNSUPPORTED_PREMIUM_SYNC_INTEGRATION="unsupportedPremiumSyncIntegration",g.AUTOMATIC_SYNC_UNSUPPORTED="automaticSyncUnsupported",g.EXCEEDS_MAX_SYNC_INTEGRATIONS_PER_WORKSPACE="exceedsMaxSyncIntegrationsPerWorkspace",g.EXCEEDS_MAX_SYNC_SOURCES_PER_TABLE="exceedsMaxSyncSourcesPerTable",g.EXCEEDS_MAX_SYNC_TARGETS_PER_SOURCE_APPLICATION="exceedsMaxSyncTargetsPerSourceApplication",g.ENTERPRISE_RESTRICTED_SYNC_SOURCE="enterpriseRestrictedSyncSource",g.ENTERPRISE_RESTRICTED_ATTACHMENTS_WARNING="enterpriseRestrictedAttachmentsWarning",g.EXCEEDED_ROW_LIMIT="exceededRowLimit",g.EXCEEDED_COLUMN_LIMIT="exceededColumnLimit",g.EXCEEDED_SELECT_OPTION_LIMIT="exceededSelectOptionLimit",g.AIRTABLE_SHARED_VIEW_SYNCING_NOT_ENABLED="airtableSharedViewSyncingNotEnabled",g.AIRTABLE_SHARED_VIEW_SYNCING_DISALLOWED_BY_ENTERPRISE_ACCOUNT="airtableSharedViewSyncingDisallowedByEnterpriseAccount",g.AIRTABLE_SHARED_VIEW_EMAIL_DOMAIN_MISMATCH="airtableSharedViewEmailDomainMismatch",g.AIRTABLE_SHARED_VIEW_DISALLOWED_EMAIL_DOMAIN_ENTERPRISE_WIDE_FLEXIBLE="airtableSharedViewDisallowedEmailDomainEnterpriseWideFlexible",g.AIRTABLE_SHARED_VIEW_DISALLOWED_EMAIL_DOMAIN_ENTERPRISE_WIDE_STRICT="airtableSharedViewDisallowedEmailDomainEnterpriseWideStrict",g.AIRTABLE_SHARED_VIEW_EMAIL_UNVERIFIED="airtableSharedViewEmailUnverified",g.AIRTABLE_SHARED_VIEW_PASSWORD_REQUIRED="airtableSharedViewPasswordRequired",g.AIRTABLE_SHARED_VIEW_INVALID_SHARE="airtableSharedViewInvalidShare",g.AIRTABLE_SHARED_VIEW_INVALID_TARGET="airtableSharedViewInvalidTarget",g.AIRTABLE_SHARED_VIEW_RATE_LIMITED="airtableSharedViewRateLimited",g.CHANGE_HOOK_PAYLOAD_ERROR="changeHookPayloadError",g.CHANGE_HOOK_PAYLOAD_OUT_OF_ORDER="changeHookPayloadOutOfOrder",g.CHANGE_HOOK_PAYLOAD_OPERATIONS_UNPROCESSABLE="changeHookPayloadOperationsUnprocessable",g.CHANGE_HOOK_PAYLOAD_INVALID="changeHookPayloadInvalid",g.ATLASSIAN_API_ERROR="atlassianApiError",g.ATLASSIAN_API_INVALID_RESPONSE="atlassianApiInvalidResponse",g.ATLASSIAN_JIRA_SERVER_API_ERROR="atlassianJiraServerApiError",g.ATLASSIAN_JIRA_SERVER_API_INVALID_RESPONSE="atlassianJiraServerApiInvalidResponse",g.GOOGLE_API_ERROR="googleApiError",g.GOOGLE_API_INVALID_RESPONSE="googleApiInvalidResponse",g.GOOGLE_CALENDAR_INVALID_DATES="googleCalendarInvalidDates",g.GOOGLE_DRIVE_FILE_TRASHED="googleDriveFileTrashed",g.SALESFORCE_API_ERROR="salesforceApiError",g.SALESFORCE_INVALID_API_RESPONSE="salesforceInvalidApiResponse",g.SALESFORCE_REPORT_EXECUTION_ERROR="salesforceReportExecutionError",g.BOX_API_ERROR="boxApiError",g.BOX_API_INVALID_RESPONSE="boxApiInvalidResponse",g.MICROSOFT_API_ERROR="microsoftApiError",g.GITHUB_API_ERROR="githubApiError",g.ZENDESK_API_ERROR="zendeskApiError",g.MIRO_API_ERROR="miroApiError",g.EMAILED_CSV_NO_EMAILS_RECEIVED="emailedCsvNoEmailsReceived",g.EMAILED_CSV_NO_CSV_ATTACHMENTS_RECEIVED="emailedCsvNoCsvAttachmentsReceived",g.EMAILED_CSV_API_INVALID_RESPONSE="emailedCsvApiInvalidResponse",g.EMAILED_CSV_API_ERROR="emailedCsvApiError",g.EMAILED_CSV_INVALID_CSV="emailedCsvInvalidCsv",g.API_ENDPOINT_NO_CSVS_RECEIVED="apiEndpointNoCsvsReceived",g.API_ENDPOINT_INVALID_S3_RESPONSE="apiEndpointInvalidS3Response",g.API_ENDPOINT_API_ERROR="apiEndpointApiError",g.API_ENDPOINT_INVALID_CSV="apiEndpointInvalidCsv",g.TABLEAU_API_ERROR="tableauApiError",g.SNOWFLAKE_API_ERROR="snowflakeApiError",g.WORKDAY_API_ERROR="workdayApiError",g.WORKDAY_MISSING_REPORT_URL="workdayMissingReportUrl",g.ADOBE_EXPERIENCE_MANAGER_API_ERROR="adobeExperienceManagerApiError",g.UNIQUE_IDS_ERROR="uniqueIdsError",g.AZURE_DEV_OPS_API_ERROR="azureDevOpsApiError",g.AZURE_DEV_OPS_NO_WORK_ITEMS_FOUND="azureDevOpsNoWorkItemsFound",g))(Vr||{}),XT=["exceedsMaxSyncedTablesPerBase","unsupportedPremiumSyncIntegration","exceedsMaxSyncIntegrationsPerWorkspace","exceedsMaxSyncSourcesPerTable"];var lo={genericTimeout:{defaultErrorMessage:"The sync attempt timed out",isUserError:!1},genericUpdateFailure:{defaultErrorMessage:"Unable to sync new data",isUserError:!1},multiSourceSyncUpdateFailure:{defaultErrorMessage:"Unable to convert data type from source table",isUserError:!0},dataSourceUnavailable:{defaultErrorMessage:"Data source is unavailable",isUserError:!1},syncConfigInvalidError:{defaultErrorMessage:"The sync configuration was invalid and could not be updated",isUserError:!0},insufficientPermissions:{defaultErrorMessage:"Insufficient permissions",isUserError:!1},missingOauthCredential:{defaultErrorMessage:"Missing OAuth Credential",isUserError:!1},upgradeRequired:{defaultErrorMessage:"This sync is exceeding the workspace plan limits",isUserError:!0},exceedsMaxSyncedTablesPerBase:{defaultErrorMessage:"This table exceeds the synced tables per base limit",isUserError:!0},unsupportedPremiumSyncIntegration:{defaultErrorMessage:"This integration is not supported by your workspace plan",isUserError:!0},automaticSyncUnsupported:{defaultErrorMessage:"Automatic sync is not supported on your current plan.",isUserError:!0},exceedsMaxSyncIntegrationsPerWorkspace:{defaultErrorMessage:"This sync exceeds the sync integrations per workspace limit",isUserError:!0},exceedsMaxSyncSourcesPerTable:{defaultErrorMessage:"This sync exceeds the sync sources per table limit",isUserError:!0},exceedsMaxSyncTargetsPerSourceApplication:{defaultErrorMessage:"The source application has reached its maximum allowed number of synced targets",isUserError:!0},enterpriseRestrictedSyncSource:{defaultErrorMessage:"This sync integration is disallowed by your organization",isUserError:!0},enterpriseRestrictedAttachmentsWarning:{defaultErrorMessage:"Some attachments were not synced because your organization has file type restrictions enabled",isUserError:!1},genericSyncWarning:{defaultErrorMessage:"The sync was successful, but warnings were generated",isUserError:!0},primaryFieldError:{defaultErrorMessage:"The original primary field is no longer available",isUserError:!0},updateSourceRecordError:{defaultErrorMessage:"The source record could not be updated",isUserError:!0},invalidExternalAccount:{defaultErrorMessage:"The external account associated with this sync is invalid",isUserError:!0},invalidInputsReceived:{defaultErrorMessage:"The inputs provided are not valid",isUserError:!0},reauthenticationRequired:{defaultErrorMessage:"The sync source needs to be reconnected. Reconnect to resume syncing.",isUserError:!0},exceededRowLimit:{defaultErrorMessage:"This table has too many records, so no new records can be synced",isUserError:!0},exceededColumnLimit:{defaultErrorMessage:"This table has too many fields, so no new fields can be synced",isUserError:!0},exceededSelectOptionLimit:{defaultErrorMessage:"A field in this table has too many select options, so no new select options can be synced",isUserError:!0},airtableSharedViewSyncingNotEnabled:{defaultErrorMessage:"Syncing has been disabled for the source shared view",isUserError:!0},airtableSharedViewSyncingDisallowedByEnterpriseAccount:{defaultErrorMessage:"Syncing has been disabled because the source organization has sync restrictions enabled",isUserError:!0},airtableSharedViewEmailDomainMismatch:{defaultErrorMessage:"The source shared view is restricted to users with a specific email domain",isUserError:!0},airtableSharedViewDisallowedEmailDomainEnterpriseWideFlexible:{defaultErrorMessage:`The source enterprise account has restricted shares to enterprise
                email domains by default. Restrictions can be removed in this source\u2019s share view menu`,isUserError:!0},airtableSharedViewDisallowedEmailDomainEnterpriseWideStrict:{defaultErrorMessage:`The source enterprise account has prevented users outside of enterprise
                email domains from accessing shared links`,isUserError:!0},airtableSharedViewEmailUnverified:{defaultErrorMessage:"Syncing has been disabled because your email address must be verified first",isUserError:!0},airtableSharedViewPasswordRequired:{defaultErrorMessage:"Valid password required to sync from shared view",isUserError:!0},airtableSharedViewInvalidShare:{defaultErrorMessage:"The shared view is not valid",isUserError:!0},airtableSharedViewInvalidTarget:{defaultErrorMessage:"Unable to sync source shared view to this table",isUserError:!0},airtableSharedViewRateLimited:{defaultErrorMessage:"Source shared view temporarily unavailable due to rate limiting",isUserError:!0},changeHookPayloadError:{defaultErrorMessage:"Change hook payload had an error state",isUserError:!1},changeHookPayloadOutOfOrder:{defaultErrorMessage:"Payload had a smaller base transaction number than the last payload",isUserError:!1},changeHookPayloadOperationsUnprocessable:{defaultErrorMessage:"The series of operations described by the change hook payloads does not describe a coherent set of operations",isUserError:!1},changeHookPayloadInvalid:{defaultErrorMessage:"Change hook payload is invalid for sync",isUserError:!1},atlassianApiError:{defaultErrorMessage:"The Atlassian API returned an error",isUserError:!0},atlassianApiInvalidResponse:{defaultErrorMessage:"The Atlassian API returned an invalid response",isUserError:!0},atlassianJiraServerApiError:{defaultErrorMessage:"The Jira Server API returned an error",isUserError:!0},atlassianJiraServerApiInvalidResponse:{defaultErrorMessage:"The Jira Server API returned an invalid response",isUserError:!0},googleApiError:{defaultErrorMessage:"The Google API returned an error",isUserError:!0},googleApiInvalidResponse:{defaultErrorMessage:"The Google API returned an invalid response",isUserError:!0},googleCalendarInvalidDates:{defaultErrorMessage:"Start date must be before end date",isUserError:!0},googleDriveFileTrashed:{defaultErrorMessage:"This item was trashed",isUserError:!0},salesforceApiError:{defaultErrorMessage:"The Salesforce API returned an error",isUserError:!0},salesforceInvalidApiResponse:{defaultErrorMessage:"The Salesforce API returned an invalid response",isUserError:!0},salesforceReportExecutionError:{defaultErrorMessage:"The report could not be executed. Check if you still have permission to view the report",isUserError:!0},boxApiError:{defaultErrorMessage:"The Box API returned an error",isUserError:!0},boxApiInvalidResponse:{defaultErrorMessage:"The Box API returned an invalid response",isUserError:!0},microsoftApiError:{defaultErrorMessage:"The Microsoft API returned an error",isUserError:!0},githubApiError:{defaultErrorMessage:"The Github API returned an error",isUserError:!0},zendeskApiError:{defaultErrorMessage:"The Zendesk API returned an error",isUserError:!0},miroApiError:{defaultErrorMessage:"The Miro API returned an error",isUserError:!0},emailedCsvNoEmailsReceived:{defaultErrorMessage:"No emails received",isUserError:!1},emailedCsvNoCsvAttachmentsReceived:{defaultErrorMessage:"No CSV attachments received",isUserError:!1},emailedCsvApiInvalidResponse:{defaultErrorMessage:"The email API returned an invalid response",isUserError:!1},emailedCsvApiError:{defaultErrorMessage:"The email API returned an error",isUserError:!1},emailedCsvInvalidCsv:{defaultErrorMessage:"The CSV is invalid",isUserError:!1},apiEndpointNoCsvsReceived:{defaultErrorMessage:"No API requests received",isUserError:!1},apiEndpointInvalidS3Response:{defaultErrorMessage:"The API returned an error",isUserError:!1},apiEndpointApiError:{defaultErrorMessage:"The API returned an error",isUserError:!1},apiEndpointInvalidCsv:{defaultErrorMessage:"The CSV is invalid",isUserError:!1},tableauApiError:{defaultErrorMessage:"The Tableau API returned an error",isUserError:!0},adobeExperienceManagerApiError:{defaultErrorMessage:"The Adobe Experience Manager API returned an error",isUserError:!0},snowflakeApiError:{defaultErrorMessage:"The Snowflake API returned an error",isUserError:!0},workdayApiError:{defaultErrorMessage:"The Workday API returned an error",isUserError:!0},workdayMissingReportUrl:{defaultErrorMessage:"Missing Workday report url",isUserError:!0},uniqueIdsError:{defaultErrorMessage:"A unique id is no longer available",isUserError:!0},azureDevOpsApiError:{defaultErrorMessage:"Azure DevOps API returned an error",isUserError:!0},azureDevOpsNoWorkItemsFound:{defaultErrorMessage:"No Work Items found for the selected Work Item Type",isUserError:!0}},Ur=o.object({errorCode:o.enum(Vr),message:o.string().nullable(),consecutiveFailureNumber:o.integer().nonNegative()}),Dl=o.object({id:o.externalTableSyncId(),dataSourceConfig:md,syncState:o.enum(rt),externalFieldInfoByFieldId:o.dict(ie,dd).refine(i=>!0),lastAttemptStartTime:o.dateTimeIsoString().nullable(),lastSuccessTime:o.dateTimeIsoString().nullable()}),zT=o.union([Dl.extend({lastFailureTime:o.dateTimeIsoString(),lastFailureInfo:Ur}),Dl.extend({lastFailureTime:o.null(),lastFailureInfo:o.null()})]).refine(i=>!0),yd=o.dict(o.columnId(),o.externalTableSyncIdOrTableId()),so=o.object({shouldSyncLinkedRecords:o.boolean()}),Id=o.object({type:o.enum(V),typeOptions:ea}),wl=o.object({syncState:o.enum(rt),lastAttemptStartTime:o.dateTimeIsoString().nullable(),lastSuccessTime:o.dateTimeIsoString().nullable(),deletedTime:o.dateTimeIsoString().nullable().optional(),authoritativeSourceIdByColumnId:yd,columnConfigByColumnId:o.dict(o.columnId(),Id),metadata:o.object({syncFrequency:o.enum(Ve),shouldSyncRowDeletions:o.boolean(),editSourceRecordPermissionLevel:o.enum(Ue),syncLinkedRecordsTargetConfig:so.optional()}),resyncTime:o.dateTimeIsoString().nullable()}),qT=o.union([wl.extend({lastFailureTime:o.dateTimeIsoString(),lastFailureInfo:Ur}),wl.extend({lastFailureTime:o.null(),lastFailureInfo:o.null()})]);function uo(i){var r,e;return(e=(r=lo[i])==null?void 0:r.defaultErrorMessage)!=null?e:"Unknown error, please try again"}var JT={errorCode:"reauthenticationRequired",message:uo("reauthenticationRequired")};var QT=o.object({a:o.enum(de),b:o.externalTableSyncId(),c:o.applicationId(),d:o.externalAccountId(),e:o.dateTimeIsoString(),f:o.string(),g:o.attachmentId(),h:o.string(),i:o.enum(Yt).optional()});var ZT=new Set(["text","multilineText","number","multiSelect","select","date","phone","multipleAttachment","checkbox","barcode","rating","richText"]);function Gr(i){return i.message?i.message:uo(i.errorCode)}function Db(i){var r,e;return(e=(r=lo[i])==null?void 0:r.isUserError)!=null?e:!1}function bd({externalTableSyncById:i,targetConfig:r,columnId:e}){let t=Object.values(i).some(n=>{let{dataSourceConfig:a}=n;return L(a.externalFieldIdByColumnId,e)});return!t&&_r(i)>0&&r?c.id.isTableId(r.authoritativeSourceIdByColumnId[e]):t}function wb({externalTableSyncById:i,targetConfig:r,columnId:e}){if(!r||!bd({externalTableSyncById:i,targetConfig:r,columnId:e}))return!1;let t=r.authoritativeSourceIdByColumnId[e];return!c.id.isTableId(t)}function Nb(i,r){return Object.values(i).some(e=>e.dataSourceConfig.dataSourceType==="airtableSharedView"&&e.dataSourceConfig.schemaMetadata.tableId===r)}function gd(i){return i==="genericSyncWarning"||i==="enterpriseRestrictedAttachmentsWarning"}function Pb(i,r){var e,t,n;switch(i.errorCode){case"airtableSharedViewPasswordRequired":return r?"Password doesn\u2019t match. Please try again":null;case"airtableSharedViewSyncingNotEnabled":return"The currently selected shared view doesn\u2019t allow data to be synced. Please choose a different source or change the shared view settings";case"airtableSharedViewSyncingDisallowedByEnterpriseAccount":return"Syncing of the selected shared view is disallowed by its source enterprise account";case"airtableSharedViewEmailDomainMismatch":return`${(e=i.message)!=null?e:Gr(i)}. Please choose a different shared view`;case"airtableSharedViewInvalidShare":return`${(t=i.message)!=null?t:Gr(i)}. Please choose a different shared view`;case"airtableSharedViewInvalidTarget":return`${(n=i.message)!=null?n:Gr(i)}. Please choose a shared view from a different base`;default:return Gr(i)}}function Mb(){return{selectedExternalFieldIds:Pr,syncFrequency:"automatic",shouldSyncRowDeletions:!0,editSourceRecordPermissionLevel:"none"}}var Bb=20,Vb=20,Ub=50;function Gb(i){let r=new Set(Object.values(i).map(e=>e.syncState));return c.assert(r.size>0),r.has("error")?"error":r.has("pendingSync")?"pendingSync":"synced"}function jb(i){let r=new Set(Object.values(i).map(e=>e.syncState));if(c.assert(r.size>0),r.has("error")){let e=Object.values(i).filter(n=>n.syncState==="error"),t=e.filter(n=>{var a;return gd((a=n.lastFailureInfo)==null?void 0:a.errorCode)});return e.length===t.length?"syncedWithWarnings":"error"}return r.has("pendingSync")?"pendingSync":"synced"}function kb(i,r){let e=Cd(i,r);return c.assert(e!==null,"could not find columnId last mapped to externalFieldId",{externalTableSyncId:i.id,externalFieldId:r}),e}function Cd(i,r){var n;return(n=i.dataSourceConfig.lastKnownColumnIdByExternalFieldId[r])!=null?n:null}function Kb(i,r){let e=fd(i,r);return c.assert(e!==null,"could not find fieldId last mapped to column",{externalTableSyncId:i.id,columnId:r}),e}function fd(i,r){let e=i.dataSourceConfig,t=e.externalFieldIdByColumnId[r];if(t!==void 0)return t;let n=e.lastKnownColumnIdByExternalFieldId;for(let[a,l]of B(n))if(r===l)return a;return null}function hd(i){switch(i){case"airtableSharedView":return St;case"atlassianJira":return At;case"googleCalendar":return Mt;case"organizationClaimList":return Gt;case"googleDrive":return Bt;case"salesforce":return jt;case"box":return Lt;case"emailedCsv":return wt;case"microsoftOutlookCalendar":return Vt;case"githubIssues":return Nt;case"githubPullRequests":return Pt;case"zendesk":return Ht;case"miro":return Ut;case"atlassianJiraServer":return Rt;case"tableauOnline":return Kt;case"tableauServer":return Wt;case"adobeExperienceManager":return Et;case"apiEndpoint":return _t;case"workday":return oo;case"snowflake":return kt;case"github":throw new x("Trying to getSchemaIdentifier for deprecated type github");case"dataTable":return Dt;case"azureDevOps":return Ot;default:throw new A(i)}}function Wb(i,r){var n;let e=hd(i),t=Object.keys((n=e.shape)!=null?n:{});return P(r,t)}function Ml(i,r){let{editSourceRecordPermissionLevel:e}=i.dataSourceConfig;switch(e){case void 0:case"none":return!1;case"edit":return ue(r,"edit");case"create":return ue(r,"create");default:throw new A(e)}}var Hb="Sync Source";function Yb(i){return Li(i,r=>i[r].name.trim())}function Xb(i,r,e){let t=e.name.trim();return i[t]!==void 0?i[t].id:e.id in r?e.id:null}function zb(i,r){return r===null?new Set(i).add("airtableSharedView"):new Set(i.filter(e=>e!=="airtableSharedView").slice(0,r)).add("airtableSharedView")}function qb(i,r){return r===null?!0:i.filter(t=>t!=="airtableSharedView").length<r}var Jb={syncingInProgress:{defaultMessage:[{type:0,value:"Syncing\u2026"}],id:"kCMxxs"}};d();h();d();h();d();function mo(i){switch(i){case"form":return"form";case"grid":return"grid";case"calendar":return"calendar";case"gallery":return"gallery";case"kanban":return"kanban";case"timeline":return"timeline";case"levels":return"levels";case"block":return"block";default:throw new A(i)}}d();d();$();var yo=class{shouldShowHiddenColumnsInDetailViewByDefault(){return!1}canHaveCoverColumn(){return!1}getCoverColumnMetadata(r){throw new x("called getCoverColumnMetadata on an invalid view type")}canUserWithPermissionLevelCreateView(r,e){return e?ue(r,"comment"):ue(r,"edit")}canHidePrimaryColumn(){return!1}canMovePrimaryColumn(){return!1}canShowComputedColumns(){return!0}canBeExported(){return!0}canBeShared(){return!0}canBePrinted(){return!0}canViewSharesIncludeHiddenColumns(){return!0}canViewSharesAllowEditingRecords(){return!0}isUsableInSlackConfiguration(){return!1}canBeSynced(){return!1}areFiltersSupported(){return!0}getColumnOrder(r){return r.columnOrder}},K=yo;var Io=class extends K{shouldShowHiddenColumnsInDetailViewByDefault(){return!1}isUsableInSlackConfiguration(){return!0}canBeCreatedInExternallySyncedTables(){return!0}canBeCreatedInPackageConstructionApplication(){return!1}shouldViewSharesIncludeBlocks(){return!0}canUserWithPermissionLevelCreateView(r,e){return super.canUserWithPermissionLevelCreateView(r,e)}canViewSharesAllowEditingRecords(){return!1}canBePrinted(){return!1}},Bl=Io;d();var To=class extends K{canBeCreatedInExternallySyncedTables(){return!0}canBeCreatedInPackageConstructionApplication(){return!0}shouldShowHiddenColumnsInDetailViewByDefault(){return!0}canHidePrimaryColumn(){return!0}canHaveCoverColumn(){return!0}getCoverColumnMetadata(r){var a,l;let e=(l=(a=r.metadata)==null?void 0:a.calendar)!=null?l:{},{coverColumnId:t,coverFitType:n}=e;return{coverColumnId:t,coverFitType:n}}isUsableInSlackConfiguration(){return!0}},Vl=To;d();d();h();d();h();d();h();d();h();d();R();Lu();var Ed=!1;function Sd(i,r,e,t){if(typeof i!="string"&&typeof i!="number")return null;let n={sn:i};if(typeof r=="string")n.fmt=[r];else if(Array.isArray(r)){for(let a of r)if(typeof a!="string")return null;n.fmt=r}else if(r!=null)return null;if(typeof e=="string")n.lcl=e;else if(e!=null)return null;return t&&(n.iss=!0),JSON.stringify(n)}var zt=class i{constructor(r,e=!1){this._moment=r,this._isImmutableFormulaMomentObject=!0,this._skipCostlyAsserts=ii()||Ed,this._memoizedWeeks=void 0,this._dateStringAtTimeOfParse=void 0,this.isCreatedForDateFieldWithNonUTCTimezone=e}static createFromSafeString(r,e){if(e){let t=e.get(r);if(t!=null)return t;let n=new i(G(r));return e.set(r,n),n}else return new i(G(r))}static createFromUnsafeString(r,e,t){let n=e!==null;if(t&&e===null){let a=t.get(r);if(a!=null)return a;let l=new i(Fr.momentFromUnsafeString(r,e),n);return t.set(r,l),l}else return new i(Fr.momentFromUnsafeString(r,e),n)}static createFromUnsafeUserInput(r,e,t,n,a,l){let s;if(typeof r=="number")s=r;else if(typeof r=="string")s=r.slice(0,Di);else return null;let u=l.toDateString();function m(){let y=Fr.momentFromUnsafeLocaleOrNull({stringSafeForMomentOrNumber:s,formats:e,locale:t,isStrict:n,defaultDate:l}),I=y?new i(y):null;return I&&I.setDateStringAtTimeOfParse(u),I}if(a){let y=Sd(r,e,t,n);if(y!==null){let I=a.get(y);if(I!==void 0){if(I===null)return I;if(u===I.getDateStringAtTimeOfParse())return I}let b=m();return a.set(y,b),b}}return m()}setDateStringAtTimeOfParse(r){this._dateStringAtTimeOfParse=r}getDateStringAtTimeOfParse(){return this._dateStringAtTimeOfParse}checkedAccess(r){if(this._skipCostlyAsserts)return r(this._moment);{let e=this._moment.clone(),t=r(this._moment);return c.assert.strictEqual(e.toISOString(),this._moment.toISOString()),c.assert.strictEqual(e.toString(),this._moment.toString()),c.assert.deepEqual(e.creationData(),this._moment.creationData()),t}}isEqualTo(r){return!!r&&r.toISOString()===this._moment.toISOString()&&r.toString()===this._moment.toString()}withMutation(r){let e=this._moment.clone();return r(e),new i(e,this.isCreatedForDateFieldWithNonUTCTimezone)}withLocale(r){if(this._moment.locale()===r)return this;if(this._memoizedLocaleArg!==void 0&&this._memoizedLocaleMoment!==void 0&&this._memoizedLocaleArg===r)return this._memoizedLocaleMoment;let e=this.withMutation(t=>t.locale(r));return r!==void 0&&typeof r=="string"&&(this._memoizedLocaleArg=r,this._memoizedLocaleMoment=e),e}withTimezone(r){if(this._memoizedTimezoneArg!==void 0&&this._memoizedTimezoneMoment!==void 0&&this._memoizedTimezoneArg===r)return this._memoizedTimezoneMoment;let e=this.withMutation(t=>t.tz(r));return r!==void 0&&typeof r=="string"&&(this._memoizedTimezoneArg=r,this._memoizedTimezoneMoment=e),e}dateTimeFormat(r){if(this._memoizedDateTimeFormatArg!==void 0&&this._memoizedDateTimeFormatString!==void 0&&this._memoizedDateTimeFormatArg===r)return this._memoizedDateTimeFormatString;let e=this.checkedAccess(t=>t.format(r));return r!==void 0&&typeof r=="string"&&(this._memoizedDateTimeFormatArg=r,this._memoizedDateTimeFormatString=e),e}withDateAdd(r,e){if(this._memoizedDateAddNumberArg!==void 0&&this._memoizedDateAddUnitArg!==void 0&&this._memoizedDateAddMoment!==void 0&&this._memoizedDateAddNumberArg===r&&this._memoizedDateAddUnitArg===e)return this._memoizedDateAddMoment;if(r===0)return this;let t=this.withMutation(n=>n.add(r,e));return r!==void 0&&e!==void 0&&typeof e=="string"&&(this._memoizedDateAddNumberArg=r,this._memoizedDateAddUnitArg=e,this._memoizedDateAddMoment=t),t}weeks(){return this._memoizedWeeks!==void 0?this._memoizedWeeks:(this._memoizedWeeks=this.checkedAccess(r=>r.weeks()),this._memoizedWeeks)}isValid(){return this._moment.isValid()}toISOString(){return this._memoizedToISOString!==void 0?this._memoizedToISOString:(this._memoizedToISOString=this._moment.toISOString(),this._memoizedToISOString)}toJSON(){return this._moment.toJSON()}toString(){return this._moment.toString()}toDate(){return this._moment.toDate()}};function jr(i){return i!=null&&i instanceof zt}d();h();var J={error:"#ERROR"},Ad=1e3*60*60*24;function Ul(i,r){var n,a;let e;if(r===void 0)return{};if(typeof r=="string"){let l=(a=(n=i==null?void 0:i.holidayDateStringSetCacheByTimezoneAndHolidayString)==null?void 0:n.UTC)==null?void 0:a[r];if(l)return l;e=r.split(",")}else return J;let t={};for(let l of e){let s=new Date(l);if(s.setMinutes(s.getMinutes()+s.getTimezoneOffset()),Oe.default(s.getTime()))return ve.default(i,["holidayDateStringSetCacheByTimezoneAndHolidayString","UTC",r],J),J;{let u=s.getDay();u!==0&&u!==6&&(t[jl(s)]=!0)}}return ve.default(i,["holidayDateStringSetCacheByTimezoneAndHolidayString","UTC",r],t),t}function Gl(i,r,e){var a,l;let t;if(e===void 0)return{};if(typeof e=="string"){let s=(l=(a=i==null?void 0:i.holidayDateStringSetCacheByTimezoneAndHolidayString)==null?void 0:a[r])==null?void 0:l[e];if(s)return s;t=e.split(",")}else return J;let n={};for(let s of t){let u=G.tz(s,r);if(u.isValid()){let m=u.day();m!==0&&m!==6&&(n[kl(u)]=!0)}else return ve.default(i,["holidayDateStringSetCacheByTimezoneAndHolidayString",r,e],J),J}return ve.default(i,["holidayDateStringSetCacheByTimezoneAndHolidayString",r,e],n),n}function Rd(i,r){var n,a;if(r===void 0)return[];if(typeof r=="string"){let l=(a=(n=i==null?void 0:i.holidayDateSortedListOfStringsCacheByTimezoneAndHolidayString)==null?void 0:n.UTC)==null?void 0:a[r];if(l)return l}else return J;let e=Ul(i,r),t;return e===J?t=J:t=Object.keys(e).sort(),ve.default(i,["holidayDateSortedListOfStringsCacheByTimezoneAndHolidayString","UTC",r],t),t}function Od(i,r,e){var a,l;if(e===void 0)return[];if(typeof e=="string"){let s=(l=(a=i==null?void 0:i.holidayDateSortedListOfStringsCacheByTimezoneAndHolidayString)==null?void 0:a[r])==null?void 0:l[e];if(s)return s}else return J;let t=Gl(i,r,e),n;return t===J?n=J:n=Object.keys(t).sort(),ve.default(i,["holidayDateSortedListOfStringsCacheByTimezoneAndHolidayString",r,e],n),n}function jl(i){let r=`0${i.getMonth()}`,e=`0${i.getDate()}`;return`${i.getFullYear()}-${r.substring(r.length-2)}-${e.substring(e.length-2)}`}function kl(i){let r=`0${i.month()}`,e=`0${i.date()}`;return`${i.year()}-${r.substring(r.length-2)}-${e.substring(e.length-2)}`}var Fd={ERROR_OBJECT:J,LENGTH_OF_DAY_MILLIS:Ad,buildHolidayUTCDateStringSet:Ul,buildHolidayDateStringSet:Gl,buildHolidayUTCDateSortedListOfStrings:Rd,buildHolidayDateSortedListOfStrings:Od,getUTCDateStringFromDate:jl,getDateStringFromMoment:kl},_=Fd;R();function Kl(i,r){return(e,t,n)=>{var s;let a;try{a=r(e)}catch{return _.ERROR_OBJECT}let l=parseFloat(t);if(Oe.default(l)||!isFinite(l))return _.ERROR_OBJECT;if(n===void 0||typeof n=="string"){if(ui.default(a))return vd(i,a,l,n);let u=a.checkedAccess(p=>p.clone()),m=Ld(i,u,l,n);if(G.isMoment(m)){let p=(s=m.tz())!=null?s:null;return zt.createFromUnsafeString(m.toISOString(),p,null)}return m}return _.ERROR_OBJECT}}function Ld(i,r,e,t){if(!r.isValid())return _.ERROR_OBJECT;if(e===0)return r;let n=r.tz();n===void 0&&(c.logger.warn("Missing workday start date timezone, falling back to UTC"),n="UTC");let a=_.buildHolidayDateStringSet(i,n,t),l=_.buildHolidayDateSortedListOfStrings(i,n,t);if(a===_.ERROR_OBJECT||l===_.ERROR_OBJECT)return _.ERROR_OBJECT;c.assert(Array.isArray(l),"sortedHolidaysList"),e=e>=0?Math.floor(e):Math.ceil(e);let s=Math.floor(e/5);Math.abs(s)>=1&&(e>=0?s-=1:s+=1);let u=s*7,m=r.clone().add(u,"days"),p=!1,y=Kr(l,_.getDateStringFromMoment(r),_.getDateStringFromMoment(m),p),I=e>=0?1:-1,b=e-s*5+I*y,C=0,E=Math.abs(b);for(;C<E;){m.add(I,"days");let v=m.day();v===0||v===6||L(a,_.getDateStringFromMoment(m))||C++}return m}function vd(i,r,e,t){let n=new Date(r);if(Oe.default(n.getTime()))return _.ERROR_OBJECT;if(e===0)return n.toJSON();n.setMinutes(n.getMinutes()+n.getTimezoneOffset());let a=_.buildHolidayUTCDateStringSet(i,t),l=_.buildHolidayUTCDateSortedListOfStrings(i,t);if(a===_.ERROR_OBJECT||l===_.ERROR_OBJECT)return _.ERROR_OBJECT;c.assert(Array.isArray(l),"sortedHolidaysList"),e=e>=0?Math.floor(e):Math.ceil(e);let s=Math.floor(e/5);Math.abs(s)>=1&&(e>=0?s-=1:s+=1);let u=s*7,m=new Date(n);m.setDate(n.getDate()+u);let p=!1,y=Kr(l,_.getUTCDateStringFromDate(n),_.getUTCDateStringFromDate(m),p),I=e>=0?1:-1,b=e-s*5+I*y,C=0,E=Math.abs(b);for(;C<E;){m.setDate(m.getDate()+I);let v=m.getDay();v===0||v===6||L(a,_.getUTCDateStringFromDate(m))||C++}return m.setMinutes(m.getMinutes()-m.getTimezoneOffset()),m.toJSON()}function Ng(i,r){return(e,t,n)=>{let a,l;try{a=r(e),l=r(t)}catch{return _.ERROR_OBJECT}return n===void 0||typeof n=="string"?jr(a)?!jr(l)||a.checkedAccess(s=>s.tz())!==l.checkedAccess(s=>s.tz())?_.ERROR_OBJECT:xd(i,a.checkedAccess(s=>s.clone()),l.checkedAccess(s=>s.clone()),n):jr(l)?_.ERROR_OBJECT:Dd(i,a,l,n):_.ERROR_OBJECT}}function xd(i,r,e,t){if(!r.isValid()||!e.isValid())return _.ERROR_OBJECT;r.startOf("day"),e.startOf("day");let n=r.isSameOrBefore(e)?1:-1;n<0&&([r,e]=[e,r]);let a=r.day();a===0?r.date(r.date()+1):a===6&&r.date(r.date()+2);let l=e.day();if(l===0?e.date(e.date()-2):l===6&&e.date(e.date()-1),r.isAfter(e))return 0;let s=e.diff(r,"days",!0),u=r.day()<=e.day()?Math.floor(s/7):Math.ceil(s/7),m=s-2*u+1,p=r.tz();p===void 0&&(c.logger.warn("Missing workday diff start date timezone, falling back to UTC"),p="UTC");let y=_.buildHolidayDateStringSet(i,p,t),I=_.buildHolidayDateSortedListOfStrings(i,p,t);if(y===_.ERROR_OBJECT||I===_.ERROR_OBJECT)return _.ERROR_OBJECT;c.assert(Array.isArray(I),"sortedHolidaysList");let b=!0,C=Kr(I,_.getDateStringFromMoment(r),_.getDateStringFromMoment(e),b);return(m-C)*n}function Dd(i,r,e,t){let n=new Date(r),a=new Date(e);if(Oe.default(n.getTime())||Oe.default(a.getTime()))return _.ERROR_OBJECT;n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),a.setMinutes(a.getMinutes()+a.getTimezoneOffset()),n.setHours(0,0,0,0),a.setHours(0,0,0,0);let l=_.buildHolidayUTCDateStringSet(i,t),s=_.buildHolidayUTCDateSortedListOfStrings(i,t);if(l===_.ERROR_OBJECT||s===_.ERROR_OBJECT)return _.ERROR_OBJECT;c.assert(Array.isArray(s),"sortedHolidaysList");let u=a.getTime()-n.getTime()>=0?1:-1;u<0&&([n,a]=[a,n]);let m=n.getDay();m===0?n.setDate(n.getDate()+1):m===6&&n.setDate(n.getDate()+2);let p=a.getDay();p===0?a.setDate(a.getDate()-2):p===6&&a.setDate(a.getDate()-1),n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),a.setMinutes(a.getMinutes()-a.getTimezoneOffset());let y=(a.getTime()-n.getTime())/_.LENGTH_OF_DAY_MILLIS;if(y<0)return 0;n.setMinutes(n.getMinutes()+n.getTimezoneOffset()),a.setMinutes(a.getMinutes()+a.getTimezoneOffset());let I=n.getDay(),b=a.getDay(),C=I<=b?Math.floor(y/7):Math.ceil(y/7),E=y-2*C+1,v=!0,w=Kr(s,_.getUTCDateStringFromDate(n),_.getUTCDateStringFromDate(a),v);return(E-w)*u}function Kr(i,r,e,t){let n=kr(i,r,0,i.length),a=kr(i,e,0,i.length);if(r<e){let l=i[n];return n===a?l===void 0?0:t?r<=l&&l<=e?1:0:r<l&&l<=e?1:0:l===void 0?a-n:t?r<=l?a-n+1:a-n:r<l?a-n+1:a-n}else{let l=i[a];if(a===n)return l===void 0?0:t?e<=l&&l<=r?1:0:e<=l&&l<r?1:0;{let s;return t?s=n+1:i[n]===r?s=n:s=n+1,l!==void 0&&e<=l?s-a:s-a-1}}}function kr(i,r,e,t){if(t-e===1){let l=i[t];return l!==void 0&&r>=l?t:e}let n=Math.floor((e+t)/2),a=i[n];return a===void 0?n:a&&a<r?kr(i,r,n,t):a>r?kr(i,r,e,n):n}He();function bo(i,r){switch(r){case"date":return gr(i)&&"specialValue"in i&&i.specialValue===ga;default:return!1}}var Wl=function(r,{type:e,typeOptions:t},n){var a;switch(e){case"date":if(bo(r,e)){let l=Ie.getNormalizedDateColumnTypeOptions("date",t),s=n&&n.seedDateForDynamicDateFields?G(n.seedDateForDynamicDateFields):G(),u=pa(l,G().locale());if(s=u!==null?s.locale(u):s,ca(s,l),l.isDateTime||(s=s.hours(0).minutes(0).seconds(0).milliseconds(0)),r.offset)if(n&&n.skipWeekends){let p=Kl({holidayDateSortedListOfStringsCacheByTimezoneAndHolidayString:{},holidayDateStringSetCacheByTimezoneAndHolidayString:{}},y=>y)(s.toISOString(),r.offset.numUnits.toString());if(typeof p!="string")throw new Error("Issue computing workdays, likely invalid holidays.");s=G(p)}else s.add(r.offset.numUnits,r.offset.offsetUnit);return da(s,t,{userLocale:u,timeZone:(a=t==null?void 0:t.timeZone)!=null?a:"UTC"})}return r;default:return r}};$();O();function wd(i){switch(i){case"text":case"number":case"select":case"multiSelect":case"date":case"collaborator":case"multiCollaborator":case"checkbox":return!0;case"multilineText":case"foreignKey":case"phone":case"multipleAttachment":case"formula":case"rollup":case"count":case"lookup":case"autoNumber":case"barcode":case"rating":case"richText":case"button":case"asyncText":case"manualSort":case"computation":return!1;default:throw new A(i)}}function Nd(i){return wd(i)?i==="date"?Ca.optional().nullable():i==="collaborator"?ba.optional().nullable():i==="multiCollaborator"?fa.optional().nullable():Ea[i]:o.null().optional()}function Pd({type:i,typeOptions:r}){return i==="text"||i==="number"?r!=null&&r.useDependableDefaultValueBehavior?"dependable":"legacyLooseyGoosey":"dependable"}function rC(i){let r=e(i);if(r===void 0)return;return r.cellValue;function e({type:t,typeOptions:n,cellValue:a}){switch(t){case"multiSelect":{if(a===null)return{type:t,cellValue:a};let l=yi(F(n.choices),a!=null?a:[]);return l.length>0?{type:t,cellValue:l}:void 0}case"select":return a===null?{type:t,cellValue:null}:n.choices[a]?{type:t,cellValue:a}:void 0;case"text":case"multilineText":case"number":case"foreignKey":case"date":case"phone":case"multipleAttachment":case"checkbox":case"formula":case"rollup":case"count":case"lookup":case"autoNumber":case"barcode":case"rating":case"richText":case"button":case"asyncText":case"manualSort":case"computation":case"collaborator":case"multiCollaborator":return a==null?{type:t,cellValue:a}:Nd(t).validateObj(a).success?{type:t,cellValue:a}:void 0;default:throw new A(t)}}}function Hl(i,r=void 0,e=!1){let t=i.default;if(t!=null&&t!==""){if(!e&&Pd(i)==="legacyLooseyGoosey")return;if(i.type==="date"&&bo(t,i.type)&&(t=Wl(t,{type:i.type,typeOptions:i.typeOptions})),["collaborator","multiCollaborator"].includes(i.type)&&Ia(t,i.type))if(r)t=Ta(t,{id:r},i.type);else return;return t}}d();h();d();var be=new Set,Md={text:new Set(["text","number","multiSelect","select","foreignKey","date","phone","checkbox","formula","rollup","count","lookup","autoNumber","manualSort","barcode","collaborator","multiCollaborator","rating","button"]),multilineText:new Set(["multilineText","number","multiSelect","select","foreignKey","date","phone","checkbox","formula","rollup","count","lookup","autoNumber","manualSort","barcode","collaborator","multiCollaborator","rating","button","richText","computation"]),number:new Set(["number","checkbox","count","autoNumber","rating"]),multiSelect:new Set(["multiSelect"]),select:new Set(["select"]),foreignKey:be,date:new Set(["date"]),phone:new Set(["phone"]),multipleAttachment:new Set(["multipleAttachment"]),checkbox:new Set(["checkbox"]),formula:be,rollup:be,count:be,lookup:be,autoNumber:be,barcode:new Set(["barcode"]),collaborator:new Set(["collaborator"]),multiCollaborator:new Set(["multiCollaborator"]),rating:new Set(["rating"]),richText:new Set(["richText"]),button:new Set(["button"]),asyncText:be,computation:be,manualSort:be};function Bd(i){return Md[i]}R();He();var Vd=function(r,n){var a=n,{includeInactiveSyncs:e}=a,t=Tr(a,["includeInactiveSyncs"]);if(!r.externalTableSyncTargetApplicationInfoByApplicationId)return Er(r.syncTargetChangeTimeByTargetApplicationIdThenExternalTableSyncId,u=>new Set(F(u)));let{externalTableSyncTargetApplicationInfoByApplicationId:l}=r,s={};for(let[u,{isApplicationDeleted:m,isParentWorkspaceDeleted:p,externalTableSyncTargetTableInfoByTableId:y}]of B(l)){if(!e&&(m||p))continue;let I=new Set;for(let{isTableDeleted:b,externalTableSyncTargetSyncInfoByExternalTableSyncId:C}of Object.values(y))if(!(!e&&b))for(let[E,{isSyncDeleted:v}]of B(C))!e&&v||I.add(E);I.size>0&&(s[u]=I)}return s};function yC(i,r){return _r(Vd(i,r))}function Yl(i){return i.syncState==="synced"?!1:i.syncState==="error"?!0:!(i.lastFailureTime===null||i.lastSuccessTime&&i.lastSuccessTime>i.lastFailureTime)}var IC=new Set(["text","multilineText","number","multiSelect","select","date","phone","multipleAttachment","checkbox","barcode","collaborator","multiCollaborator","rating","richText"]);function TC({externalTableSyncById:i,syncSourceMetadata:r}){return i?Object.values(i).some(e=>e.dataSourceConfig.dataSourceType==="airtableSharedView"&&e.dataSourceConfig.schemaMetadata.applicationId===r.applicationId&&e.dataSourceConfig.schemaMetadata.tableId===r.tableId&&e.dataSourceConfig.schemaMetadata.viewId===r.viewId):!1}function bC(i){return i!==void 0&&i.isImplicitShare!==!0}d();me();He();var Wr=function(){return le("twoWaySyncCreateDelete")},Xl=function(){return le("twoWaySyncCreateDelete")},Hr=function(){return Wr()&&le("twoWaySyncForms")};d();var zl={invalidFieldType:{defaultMessage:[{type:0,value:"This field type can\u2019t be edited in a synced table."}],id:"w5usgx"},invalidBillingPlan:{defaultMessage:[{type:0,value:"Upgrade to Enterprise to edit synced tables."}],id:"ymxxAP"},invalidSyncFrequency:{defaultMessage:[{type:0,value:"To edit this cell, update this table\u2019s sync configuration so that changes sync automatically."}],id:"xsewSD"},syncRowDeletionsDisabled:{defaultMessage:[{type:0,value:"To edit this cell, update this table\u2019s sync configuration so that records are deleted when deleted or hidden in the source."}],id:"TNSTPs"},insufficientUserEditPermissions:{defaultMessage:[{type:0,value:"You don\u2019t have permission to edit synced records in this table."}],id:"ZS4mY3"},fieldDoesNotExistOnAllSources:{defaultMessage:[{type:0,value:"Cells in this field can\u2019t be edited because the field doesn\u2019t exist in every sync source."}],id:"bFlTjO"},fieldDoesNotExistOnSource:{defaultMessage:[{type:0,value:"This field can\u2019t be edited because it doesn\u2019t exist on the external source."}],id:"SgFsiX"},fieldIsNotEditableOnAllSources:{defaultMessage:[{type:0,value:"This field can\u2019t be edited because at least one sync source doesn\u2019t allow it to be edited."}],id:"XSyfyh"},fieldIsNotEditableOnSource:{defaultMessage:[{type:0,value:"This field is synced from a source that doesn\u2019t allow it to be edited."}],id:"SGLe+E"},fieldIsNotEditableOnSourceWithForeignKeyCondition:{defaultMessage:[{type:0,value:"This cell cannot be edited because it is synced from a linked record field that has selection conditions."}],id:"xR/yJY"},fieldTypeDoesNotMatchSource:{defaultMessage:[{type:0,value:"This field can\u2019t be edited because its type in the source base does not match its type in this table."}],id:"i7QGDX"},sourceReauthenticationRequired:{defaultMessage:[{type:0,value:"To edit this cell, reaunthenticate this table\u2019s sync source in the sync configuration."}],id:"xS2nlr"},invalidColumnLockPermission:{defaultMessage:[{type:0,value:"This field is configured so "},{type:1,value:"descriptionOfWhoCanUpdateCell"},{type:0,value:" can edit it"}],id:"c1B4Ic"}},ql={invalidBillingPlan:{defaultMessage:[{type:0,value:"Creating "},{type:1,value:"rowUnits"},{type:0,value:" in synced tables requires an Enterprise plan. Contact your organization admin to upgrade."}],id:"zubso7"},invalidSyncFrequency:{defaultMessage:[{type:0,value:"To create a new "},{type:1,value:"rowUnit"},{type:0,value:", update this table\u2019s sync configuration so that changes sync automatically."}],id:"QyNtK7"},syncRowDeletionsDisabled:{defaultMessage:[{type:0,value:"To create a new "},{type:1,value:"rowUnit"},{type:0,value:", update this table\u2019s sync configuration so that records are deleted when deleted or hidden in the source."}],id:"LQU4Kg"},insufficientUserEditPermissions:{defaultMessage:[{type:0,value:"You don\u2019t have permission to create synced "},{type:1,value:"rowUnits"},{type:0,value:" in this table."}],id:"TUHKeA"},sourceReauthenticationRequired:{defaultMessage:[{type:0,value:"To create a new "},{type:1,value:"rowUnit"},{type:0,value:", reaunthenticate this table\u2019s sync source in the sync configuration."}],id:"fvzoq/"},featureFlagOff:{defaultMessage:[{type:0,value:"You can\u2019t create a new "},{type:1,value:"rowUnit"},{type:0,value:" because this table is synced from an external source."}],id:"DJM2gw"},syncSourceDoesNotAllowRecordCreation:{defaultMessage:[{type:0,value:"New "},{type:1,value:"rowUnit"},{type:0,value:" can\u2019t be created because this table\u2019s sync source has disabled record creation."}],id:"iusAF1"},isMultiSourceSync:{defaultMessage:[{type:0,value:"New "},{type:1,value:"rowUnit"},{type:0,value:" can\u2019t be created because this table has multiple sync sources."}],id:"Em+grD"}},Jl={invalidBillingPlan:{defaultMessage:[{type:0,value:"Deleting "},{type:1,value:"rowUnits"},{type:0,value:" in synced tables requires an Enterprise plan. Contact your organization admin to upgrade."}],id:"LdH1Zb"},invalidSyncFrequency:{defaultMessage:[{type:0,value:"To delete this "},{type:1,value:"rowUnit"},{type:0,value:", update this table\u2019s sync configuration so that changes sync automatically."}],id:"OM0HdH"},syncRowDeletionsDisabled:{defaultMessage:[{type:0,value:"To delete this new "},{type:1,value:"rowUnit"},{type:0,value:", update this table\u2019s sync configuration so that records are deleted when deleted or hidden in the source."}],id:"IXwAbV"},insufficientUserEditPermissions:{defaultMessage:[{type:0,value:"This "},{type:1,value:"rowUnit"},{type:0,value:" can\u2019t be deleted because you don\u2019t have permission to create or edit synced records in this table."}],id:"M0tIkB"},sourceReauthenticationRequired:{defaultMessage:[{type:0,value:"To delete this "},{type:1,value:"rowUnit"},{type:0,value:", reaunthenticate this table\u2019s sync source in the sync configuration."}],id:"DECkZ6"},featureFlagOff:{defaultMessage:[{type:0,value:"You can\u2019t delete this "},{type:1,value:"rowUnit"},{type:0,value:" because this table is synced from an external source."}],id:"lwtPu+"},syncSourcesDoNotAllowRecordDeletion:{defaultMessage:[{type:0,value:"This "},{type:1,value:"rowUnit"},{type:0,value:" can\u2019t be deleted because this table\u2019s sync source has disabled record deletion."}],id:"zRz42d"}};me();R();He();d();function Ql(i,r){return go(i,r)?Jt(i,r!=null&&r.shouldCheckIfFormSubmitterIsAllowedToIgnoreLockLevel?{shouldCheckIfFormSubmitterIsAllowedToIgnoreLockLevel:!0}:void 0):!1}function go(i,r){return Co(i,r)===void 0}function Co(i,r){var n;let{type:e}=i.getTypeAndTypeOptionsLive();if(we(e)&&(e!=="manualSort"||!(r!=null&&r.isForManualSortEdits)))return"COLUMN_IS_COMPUTED";if(fo(i,r!=null&&r.isInColumnMenuContext?{isInColumnMenuContext:!0}:void 0))return"COLUMN_IS_NOT_EDITABLE_IN_SYNC_SOURCES";if(i.isSymmetricColumnOfCollaboratorLive())return"COLUMN_IS_SYMMETRIC_TO_COLLABORATOR";if(((n=i.getLockLive())==null?void 0:n.lockLevelToUpdateCells)==="lockedByPackageInstallation")return"COLUMN_IS_LOCKED_BY_PACKAGE_INSTALLATION"}function Jt(i,r){let e=i.getParentTable().getParentApplication().getCurrentSessionUserId(),t=i.getParentTable().getParentApplication().getCurrentUserPermissionLevelInContextLive(),n=i.getParentTable().getParentApplication().getCurrentUserGroupPermissionsInContextLive();return ee.canUpdateCells(i.getLockLive(),e,t,n,r)}function fo(i,r){return Qt(i,r)!==null}function Wd(i,r){return le("twoWaySyncPricingGating")?i.has("twoWaySync")||L(r,"twoWaySyncPricingOverride"):!0}function ho(i){var u;let r=i.getExternalTableSyncByIdLive(),e=Object.values(r);if(e.length===0)return c.logger.error("externalTableSyncById is empty but should be a synced table",{productArea:"two-way-sync"}),null;let t=i.getParentApplication(),n=t.getBillingPlanLive();if(!Wd(n==null?void 0:n.premiumFeaturesSet,t.getWorkspaceTagValueByNameLive()))return"invalidBillingPlan";let l=e[0];if(l.dataSourceConfig.syncFrequency==="never")return"invalidSyncFrequency";if(l.dataSourceConfig.shouldSyncRowDeletions===!1)return"syncRowDeletionsDisabled";let s=i.getParentApplication().getCurrentUserPermissionLevelInContextLive();if(!Ml(l,s))return"insufficientUserEditPermissions";for(let m of Object.values(r))if(Yl(m)&&((u=m.lastFailureInfo)==null?void 0:u.errorCode)==="reauthenticationRequired")return"sourceReauthenticationRequired";return null}function Eo(i,r){let e=i.id,{type:t}=i.getTypeAndTypeOptionsLive(),a=i.getParentTable().getExternalTableSyncByIdLive();if(!i.isExternallySyncedLive())return null;if(we(t))return"invalidFieldType";let l=Object.keys(a).length>1;for(let s of Object.values(a)){let{externalFieldIdByColumnId:u,editableExternalFieldIds:m,columnInfoByExternalFieldId:p}=s.dataSourceConfig,y=u[e];if(!y)return l?"fieldDoesNotExistOnAllSources":"fieldDoesNotExistOnSource";if(!m||!m.includes(y))return zd(t,y,s.dataSourceConfig,i)?"fieldIsNotEditableOnSourceWithForeignKeyCondition":l?"fieldIsNotEditableOnAllSources":"fieldIsNotEditableOnSource";if(!p||t!==p[y].type)return"fieldTypeDoesNotMatchSource"}return!Jt(i)&&!(r!=null&&r.isInColumnMenuContext)?"invalidColumnLockPermission":null}function Qt(i,r){if(!i.isExternallySyncedLive())return null;let e=ho(i.getParentTable());return di(e)?e:Eo(i,r)}function Zl(i,r,e){let t=Qt(i,e);if(t){let n=ee.getShortDescriptionOfWhoCanUpdateCells(i.getLockLive());return r.formatMessage(zl[t],{descriptionOfWhoCanUpdateCell:n})}return null}var Hd=function(r){var a;if(!r.isExternallySyncedLive())return null;if(!Wr())return"featureFlagOff";let e=ho(r);if(e!==null)return e;let t=r.getExternalTableSyncByIdLive();return Object.keys(t).length>1?"isMultiSourceSync":(a=Object.values(t)[0].dataSourceConfig.twoWaySyncPermissions)!=null&&a.canCreate?null:"syncSourceDoesNotAllowRecordCreation"};function af({tableModel:i,intl:r,rowUnit:e,legacyMessageIfFeatureFlagIsOff:t}){let n=Hd(i);return n?n==="featureFlagOff"&&t?t:r.formatMessage(ql[n],{rowUnit:Vn(e!=null?e:"record",r),rowUnits:Un(e!=null?e:"record",r)}):null}function Yd(i){if(!i.isExternallySyncedLive())return null;if(!Xl())return"featureFlagOff";let r=ho(i);if(r!==null)return r;let e=i.getExternalTableSyncByIdLive();return Object.values(e).some(t=>{var n;return!((n=t==null?void 0:t.dataSourceConfig.twoWaySyncPermissions)!=null&&n.canDelete)})?"syncSourcesDoNotAllowRecordDeletion":null}function lf({tableModel:i,intl:r,rowUnit:e}){let t=Yd(i);return t?r.formatMessage(Jl[t],{rowUnit:Vn(e!=null?e:"record",r),rowUnits:Un(e!=null?e:"record",r)}):null}function sf(i){var r,e;return((r=i==null?void 0:i.dataSourceConfig)==null?void 0:r.editableExternalFieldIds)&&((e=i==null?void 0:i.dataSourceConfig)==null?void 0:e.editableExternalFieldIds.length)>0}function uf(i,r,e){if(!i||i.filterSet.length===0)return!0;let t=D.getDefaultCellValuesByColumnIdForNewRow(r,i,s=>""),n=G().utcOffset(0).toDate();return new et({cellDataProvider:{getCellValue:(s,u)=>{var m,p;return(p=t[u])!=null?p:Hl((m=r[u])!=null?m:{})}},columnTypeAndTypeOptionsById:r,filters:i,context:{getVirtualClockTime:()=>n},appInterface:e,shouldExcludeInactiveFilters:!0}).getFilteredRowIdsSet([c.id.generateRowId()]).size===1}function Xd(i){var e,t;if(!Wr())return!1;let r=Object.values(i);return r.length===1&&!!((t=(e=r[0])==null?void 0:e.dataSourceConfig.twoWaySyncPermissions)!=null&&t.canCreate)}function df(i){return Hr()&&Xd(i)}function pf(i,r){return i==="airtableSharedView"?!0:i==="atlassianJira"?(c.assert.isNotNull(r,"applicationContext must be provided for jira"),Wn("atlassianJiraTwoWaySync",r)):i==="azureDevOps"?(c.assert.isNotNull(r,"applicationContext must be provided for azure dev ops"),Wn("azureDevOpsTwoWaySync",r)):!1}function zd(i,r,e,t){if(i!=="foreignKey"||e.dataSourceType!=="airtableSharedView"||!t.isNativelySyncedLive())return!1;let n=e.schemaMetadata.rawSourceSchema;if(!n)return!1;let a=n.columns;for(let l of a)if(l.id===r&&l.type==="foreignKey"){let s=l.typeOptions;return!!s.viewIdForRecordSelection||s.filtersForRecordSelection===null}return!1}var So=class extends K{canUserWithPermissionLevelCreateView(r,e){return ue(r,"edit")}canHidePrimaryColumn(){return!0}canMovePrimaryColumn(){return!0}canShowComputedColumns(){return!1}canBeExported(){return!1}canViewSharesIncludeHiddenColumns(){return!1}canViewSharesAllowEditingRecords(){return!1}canBeCreatedInExternallySyncedTables(){return Hr()}canBeCreatedInPackageConstructionApplication(){return!0}canBePrinted(){return!1}areFiltersSupported(){return!1}},$l=So;d();var _o=class extends K{shouldShowHiddenColumnsInDetailViewByDefault(){return!0}canHaveCoverColumn(){return!0}getCoverColumnMetadata(r){var a,l;let e=(l=(a=r.metadata)==null?void 0:a.gallery)!=null?l:{},{coverColumnId:t,coverFitType:n}=e;return{coverColumnId:t,coverFitType:n}}isUsableInSlackConfiguration(){return!0}canBeCreatedInPackageConstructionApplication(){return!0}canBeCreatedInExternallySyncedTables(){return!0}},es=_o;d();var Ao=class extends K{isUsableInSlackConfiguration(){return!0}canBeSynced(){return!0}canBeCreatedInExternallySyncedTables(){return!0}canBeCreatedInPackageConstructionApplication(){return!0}},ts=Ao;d();var Ro=class extends K{shouldShowHiddenColumnsInDetailViewByDefault(){return!0}canHaveCoverColumn(){return!0}getCoverColumnMetadata(r){var a,l;let e=(l=(a=r.metadata)==null?void 0:a.kanban)!=null?l:{},{coverColumnId:t,coverFitType:n}=e;return{coverColumnId:t,coverFitType:n}}isUsableInSlackConfiguration(){return!0}canBeCreatedInExternallySyncedTables(){return!0}canBeCreatedInPackageConstructionApplication(){return!0}},rs=Ro;d();var Yr=class extends K{canBeCreatedInExternallySyncedTables(){return!0}canBeCreatedInPackageConstructionApplication(){return!0}canBeShared(){return!1}canBeExported(){return!0}canViewSharesAllowEditingRecords(){return!1}canHidePrimaryColumn(){return!0}canMovePrimaryColumn(){return!0}getColumnOrder(r){var t,n;let e=(n=(t=r.metadata)==null?void 0:t.levels)==null?void 0:n.levelsConfig;return e?Xn(e,Yn).map(a=>({columnId:a,visibility:!0})):r.columnOrder}};d();var Oo=class extends K{canBeCreatedInExternallySyncedTables(){return!0}canBeCreatedInPackageConstructionApplication(){return!0}shouldShowHiddenColumnsInDetailViewByDefault(){return!0}canHidePrimaryColumn(){return!0}canHaveCoverColumn(){return!0}getCoverColumnMetadata(r){var a,l;let e=(l=(a=r.metadata)==null?void 0:a.timeline)!=null?l:{},{coverColumnId:t,coverFitType:n}=e;return{coverColumnId:t,coverFitType:n}}},ns=Oo;var qd={form:$l,grid:ts,calendar:Vl,gallery:es,kanban:rs,timeline:ns,levels:Yr,block:Bl},j=Er(qd,i=>new i),Jd={getApiViewType(i){return mo(i)},shouldShowHiddenColumnsInDetailViewByDefault(i){return j[i].shouldShowHiddenColumnsInDetailViewByDefault()},canHaveCoverColumn(i){return j[i].canHaveCoverColumn()},getCoverColumnMetadata(i,r){return j[i].getCoverColumnMetadata(r)},canUserWithPermissionLevelCreateView(i,r,e){return j[i].canUserWithPermissionLevelCreateView(r,e)},canHidePrimaryColumn(i){return j[i].canHidePrimaryColumn()},canMovePrimaryColumn(i){return j[i].canMovePrimaryColumn()},canShowComputedColumns(i){return j[i].canShowComputedColumns()},canBeExported(i){return j[i].canBeExported()},canBeShared(i){return j[i].canBeShared()},canBePrinted(i){return j[i].canBePrinted()},canViewSharesIncludeHiddenColumns(i){return j[i].canViewSharesIncludeHiddenColumns()},canViewSharesAllowEditingRecords(i){return j[i].canViewSharesAllowEditingRecords()},isUsableInSlackConfiguration(i){return j[i].isUsableInSlackConfiguration()},canBeSynced(i){return j[i].canBeSynced()},canBeCreatedInExternallySyncedTables(i){return j[i].canBeCreatedInExternallySyncedTables()},canBeCreatedInPackageConstructionApplication(i){return j[i].canBeCreatedInPackageConstructionApplication()},areFiltersSupported(i){return j[i].areFiltersSupported()},doesViewHaveVisList(i){return i!=="form"&&i!=="levels"},getColumnOrder(i,r){return j[i].getColumnOrder(r)}},os=Jd;d();d();R();var Qd=1e3,Fo=class{constructor(){this._batchByResultString={enabled:{},disabled:{}},this._flushTimeoutId=null}scheduleLog(r,e,t="client"){var s,u,m;if(!window||(sa||la).test((u=(s=window.location)==null?void 0:s.hostname)!=null?u:""))return;let a=e?"enabled":"disabled",l=this._batchByResultString[a];l[r]=((m=l[r])!=null?m:0)+1,!this._flushTimeoutId&&(this._flushTimeoutId=window.setTimeout(()=>{for(let[p,y]of Object.entries(this._batchByResultString.enabled))c.stats.incrementBy("airtable.feature_flag_v1.is_feature_enabled_check",y,{caller:t,feature_name:p,result:"enabled"});for(let[p,y]of Object.entries(this._batchByResultString.disabled))c.stats.incrementBy("airtable.feature_flag_v1.is_feature_enabled_check",y,{caller:t,feature_name:p,result:"disabled"});this._reset()},Qd))}_reset(){this._batchByResultString={enabled:{},disabled:{}},this._flushTimeoutId=null}},Zd=new Fo,is=Zd;Fu();He();var $d=function(r){return ep(r,"client")},Lo=null;function ep(i,r){if(!Ni||!fn())return!1;Lo===null&&(Lo=new Set(fn().enabledFeatureNames));let e=Lo.has(i);return is.scheduleLog(i,e,r),e}var as=$d;d();h();d();h();d();me();var tp=new Set(["plnzGZqStklQTNNnB","plnl8MriMpYFb8oii","plnwZEBv35j93RG4N","plnj5EfbE4NRqSQjb","plnpCw7LWLVJPvrr8","plnOOWikqE8GWfcFW","pln2Zo5BLc4I7lEZ9","plnkffc2Pq2NHrHXE","plnGY4VjPA6vYPHlc","plnNccBEgopbvmU3L","plnP7vAjAh03uRPPI","plna8njPAOKDqH2Wj","plnTVMY6xT66DJmJZ","plnKEfLI8tx3VVa6O","plnNYbUtH10wpYABR","pln9FeKdtIbqeC6S2","plnAxbur2VO7WICc9","plnRC6O7M6fC1ToXF","plnMBc3Mm4PnJoBTm","plnDHjfN59YLiKd9T",xr.SKP_2021_STUDENT_24MONTH_PRO_TRIAL_PLAN_ID,xr.SKP_2021_MONTHLY_PRO_STARTER_PACK_PLAN_ID,xr.SKP_2021_ANNUAL_PRO_STARTER_PACK_PLAN_ID]);function rp(i){return tp.has(i)||q("allowUserAccessToPremiumTrialFeatures")}var ls=rp;li();me();var ss=Tt({free:[],plus:["automaticSyncedTables","premiumForms","fieldManager"],starter:["personalViews","newSelectColors","blocksGridLayout","checkboxAndRatingColorAndIconStyles","ganttView","timelineView","dateDependencies","foreignKeyFiltersForRecordSelection","recordColoring","percentProgressBarColoring","lightBaseColors","dustyBaseColors","calendarDateRange","calendarMultiDateField","passwordAndEmailDomainShares","formFieldDataValidation","fieldAndTableLocking","workflowsCustomScriptAction","externalAccountTwilioOutput","outlookProRollout","viewSections","externalTableSyncBox","externalTableSyncGoogleDrive","externalTableSyncGoogleCalendar","externalTableSyncOutlookCalendar","externalTableSyncGithubIssues","externalTableSyncGithubPullRequests","externalTableSyncMiro","externalTableSyncAirtableSharedView","editableSyncedTables","prioritySupport","requestNewSyncType","externalAccountGoogleCompileDoc","externalAccountClearbit","insights","workspaceRestrictionsInviteCreation","pageBundleRestrictionsInviteCreation","interfaceOnlyCollaborators","interfaceDesignerPivotTableElement"],pro:[],business:["increasedInviteEmailLimits","externalAccountSalesforce","externalTableSyncSalesforce","externalTableSyncTableauOnline","twoWaySync","workspaceRestrictionsShareCreation","fieldManagerDependencyDetails","externalTableSyncJira","externalAccountAtlassianJiraCloud","externalTableSyncEmailedCsv","externalTableSyncZendesk","externalTableSyncApiEndpoint","externalTableSyncOrganizationClaimList","externalTableSyncAzureDevOps","conditionalPageElements","publishedDatasets","advancedDateDependencies"],enterprise:["externalAccountAtlassianJiraServer","changeHooksApi","externalTableSyncAtlassianJiraServer","externalTableSyncTableauServer","externalTableSyncAdobeExperienceManager","externalTableSyncSnowflake","externalTableSyncWorkday","shareFormWithEnterpriseDomains","externalTableSyncDataTable","packageLibrary"]}),op=Object.freeze(B(ss).reduce((i,[r,e])=>[...i,{billingPlanGrouping:r,features:new Set(e)}],[]).sort((i,r)=>mt[i.billingPlanGrouping]-mt[r.billingPlanGrouping])),ip=Object.freeze(["workflowsCustomScriptAction","premiumForms"]),ap=Object.freeze(["workflowsCustomScriptAction"]),lp=Object.freeze(["externalTableSyncGoogleCalendar","externalTableSyncBox","externalTableSyncGoogleDrive","externalTableSyncOutlookCalendar","externalTableSyncGithubIssues","externalTableSyncGithubPullRequests","externalTableSyncZendesk","externalTableSyncMiro"]),sp=Object.freeze(["externalAccountAtlassianJiraServer","externalAccountSalesforce"]),up=Object.freeze(["externalTableSyncGoogleCalendar","externalTableSyncGoogleDrive","externalTableSyncBox","externalTableSyncOutlookCalendar","externalTableSyncGithubIssues","externalTableSyncGithubPullRequests","externalTableSyncZendesk","externalTableSyncMiro"]),dp=Object.freeze(["externalTableSyncAirtableSharedView"]),pp=Object.freeze(["externalTableSyncJira","externalTableSyncEmailedCsv","externalTableSyncApiEndpoint","externalAccountAtlassianJiraCloud"]),cp=(i,r,e)=>{let t=mt[r],n=[];for(let[s,u]of Object.entries(ss))t>=mt[s]&&fe(n,u);return e!==null&&e>0&&!ls(i)&&!q("allowUserAccessToPremiumTrialFeatures")&&(n=Ce.default(n,ip)),vr(i)&&(n=Ce.default(n,ap)),Ma(i)&&(n=Xe(n,lp)),Ba(i)&&(n=Xe(n,sp)),ja(i)&&(n=Xe(n,up)),Ga(i)&&(n=Xe(n,dp)),(r==="pro"||r==="starter")&&!Pa(i)&&(n=Xe(n,pp)),n};function us(i,r){return cp(i.id,i.grouping,null).includes(r)}function Ih(i){for(let r of op)if(r.features.has(i))return r.billingPlanGrouping;return null}d();li();var mp=Object.freeze({airtableSharedView:{billingPlanFeature:"externalTableSyncAirtableSharedView",billingPlanGrouping:"free"},dataTable:{billingPlanFeature:"externalTableSyncDataTable",billingPlanGrouping:"enterprise"},atlassianJiraServer:{billingPlanFeature:"externalTableSyncAtlassianJiraServer",billingPlanGrouping:"enterprise"},salesforce:{billingPlanFeature:"externalTableSyncSalesforce",billingPlanGrouping:"business"},atlassianJira:{billingPlanFeature:"externalTableSyncJira",billingPlanGrouping:"pro"},azureDevOps:{billingPlanFeature:"externalTableSyncAzureDevOps",billingPlanGrouping:"business"},googleCalendar:{billingPlanFeature:"externalTableSyncGoogleCalendar",billingPlanGrouping:"free"},organizationClaimList:{billingPlanFeature:"externalTableSyncOrganizationClaimList",billingPlanGrouping:"business"},googleDrive:{billingPlanFeature:"externalTableSyncGoogleDrive",billingPlanGrouping:"free"},box:{billingPlanFeature:"externalTableSyncBox",billingPlanGrouping:"free"},emailedCsv:{billingPlanFeature:"externalTableSyncEmailedCsv",billingPlanGrouping:"pro"},microsoftOutlookCalendar:{billingPlanFeature:"externalTableSyncOutlookCalendar",billingPlanGrouping:"free"},githubIssues:{billingPlanFeature:"externalTableSyncGithubIssues",billingPlanGrouping:"free"},githubPullRequests:{billingPlanFeature:"externalTableSyncGithubPullRequests",billingPlanGrouping:"free"},zendesk:{billingPlanFeature:"externalTableSyncZendesk",billingPlanGrouping:"free"},miro:{billingPlanFeature:"externalTableSyncMiro",billingPlanGrouping:"free"},tableauOnline:{billingPlanFeature:"externalTableSyncTableauOnline",billingPlanGrouping:"business"},tableauServer:{billingPlanFeature:"externalTableSyncTableauServer",billingPlanGrouping:"enterprise"},github:{billingPlanGrouping:"free"},adobeExperienceManager:{billingPlanFeature:"externalTableSyncAdobeExperienceManager",billingPlanGrouping:"enterprise"},apiEndpoint:{billingPlanFeature:"externalTableSyncApiEndpoint",billingPlanGrouping:"pro"},snowflake:{billingPlanFeature:"externalTableSyncSnowflake",billingPlanGrouping:"enterprise"},workday:{billingPlanFeature:"externalTableSyncWorkday",billingPlanGrouping:"enterprise"}}),yp=Object.freeze({airtableSharedView:{billingPlanFeature:"externalTableSyncAirtableSharedView",billingPlanGrouping:"pro"},dataTable:{billingPlanFeature:"externalTableSyncDataTable",billingPlanGrouping:"enterprise"},atlassianJiraServer:{billingPlanFeature:"externalTableSyncAtlassianJiraServer",billingPlanGrouping:"enterprise"},salesforce:{billingPlanFeature:"externalTableSyncSalesforce",billingPlanGrouping:"business"},atlassianJira:{billingPlanFeature:"externalTableSyncJira",billingPlanGrouping:"business"},azureDevOps:{billingPlanFeature:"externalTableSyncAzureDevOps",billingPlanGrouping:"business"},googleCalendar:{billingPlanFeature:"externalTableSyncGoogleCalendar",billingPlanGrouping:"pro"},googleDrive:{billingPlanFeature:"externalTableSyncGoogleDrive",billingPlanGrouping:"pro"},box:{billingPlanFeature:"externalTableSyncBox",billingPlanGrouping:"pro"},emailedCsv:{billingPlanFeature:"externalTableSyncEmailedCsv",billingPlanGrouping:"business"},microsoftOutlookCalendar:{billingPlanFeature:"externalTableSyncOutlookCalendar",billingPlanGrouping:"pro"},githubIssues:{billingPlanFeature:"externalTableSyncGithubIssues",billingPlanGrouping:"pro"},githubPullRequests:{billingPlanFeature:"externalTableSyncGithubPullRequests",billingPlanGrouping:"pro"},zendesk:{billingPlanFeature:"externalTableSyncZendesk",billingPlanGrouping:"business"},miro:{billingPlanFeature:"externalTableSyncMiro",billingPlanGrouping:"pro"},tableauOnline:{billingPlanFeature:"externalTableSyncTableauOnline",billingPlanGrouping:"business"},tableauServer:{billingPlanFeature:"externalTableSyncTableauServer",billingPlanGrouping:"enterprise"},github:{billingPlanGrouping:"pro"},adobeExperienceManager:{billingPlanFeature:"externalTableSyncAdobeExperienceManager",billingPlanGrouping:"enterprise"},apiEndpoint:{billingPlanFeature:"externalTableSyncApiEndpoint",billingPlanGrouping:"business"},snowflake:{billingPlanFeature:"externalTableSyncSnowflake",billingPlanGrouping:"enterprise"},organizationClaimList:{billingPlanFeature:"externalTableSyncOrganizationClaimList",billingPlanGrouping:"business"},workday:{billingPlanFeature:"externalTableSyncWorkday",billingPlanGrouping:"enterprise"}});function ds(i,r){return r?yp[i]:mp[i]}me();R();function nt(i,r){return r==="premiumForms"?Ip(i,null):(c.assert.notStrictEqual(r,"workflowsCustomScriptAction"),i.premiumFeaturesSet.has(r))}function Ip(i,r){let e=r!=null,t=as("enablePremiumFormsForTrialUsers")||Rr("premiumFormsForTrialUsers");return vr(i.id)?t:e&&t?!0:Tp(i,"premiumForms",r)}function Tp(i,r,e){return i.premiumFeaturesSet.has(r)?!0:e?!Va(e.nextBillingPlan.id)&&us(e.nextBillingPlan,r):!1}function Dh(i,r){let e=Ua(i.id),{billingPlanFeature:t}=ds(r,e);return!t||nt(i,t)}function bp(i,r){let e=zn.getBillingRestrictionInfo(r);return!e||nt(i,e.premiumFeatureName)}function wh(i,r,e){if(bp(i,r))return!0;if(e){let t=zn.getBillingRestrictionInfo(r);if(!t)return!0;let n=L(e,"grandfatheredAccessToPremiumWorkflows"),a=["externalAccountAtlassianJiraCloud","externalAccountAtlassianJiraServer","externalAccountSalesforce"].includes(t.premiumFeatureName);if(n&&a)return!0}return!1}d();xu();d();h();d();d();h();R();var _e=class{constructor(r){if(this._orderedIds=[],this._modelsById={},r)for(let e of r)this.add(e)}getIds(){return this._orderedIds}getModels(){return this._orderedIds.map(r=>this._modelsById[r])}each(r){[...this._orderedIds].forEach((e,t)=>{let n=this._modelsById[e];r(n,t)})}map(r){return this._orderedIds.map((e,t)=>{let n=this._modelsById[e];return r(n,t)})}every(r){return this._orderedIds.every((e,t)=>{let n=this._modelsById[e];return r(n,t)})}some(r){return this._orderedIds.some((e,t)=>{let n=this._modelsById[e];return r(n,t)})}find(r){let e=fr(this._orderedIds,(t,n)=>{let a=this._modelsById[t];return r(a,n)});return e?this._modelsById[e]:null}filter(r){let e=this._orderedIds.filter((n,a)=>{let l=this._modelsById[n];return r(l,a)});return yt(e,n=>this._modelsById[n])}findById(r){c.assert.isObjectId(r,"findById requires a valid targetId, which {targetId} is not",{_debug:r});let e=this._modelsById[r];return e===void 0?null:e}findByIndex(r){c.assert.isNumber(r,"invalid index ({fieldValue}) passed to findByIndex",{fieldValue:JSON.stringify(r)});let e=this._orderedIds[r];c.assert.isNotUndefined(e,"find by index within valid collection range");let t=this._modelsById[e];return c.assert(t,"findByIndex model"),t}indexOf(r){return this.indexOfId(r.getId())}indexOfId(r){return this._orderedIds.indexOf(r)}moveFromIndexToIndex(r,e){c.assert.isNumber(r,"invalid fromIndex ({fieldValue}) passed to moveFromIndexToIndex",{fieldValue:JSON.stringify(r)}),c.assert.isNumber(e,"invalid toIndex ({fieldValue}) passed to moveFromIndexToIndex",{fieldValue:JSON.stringify(r)}),this._orderedIds.splice(e,0,this._orderedIds.splice(r,1)[0])}getLength(){return this._orderedIds.length}add(r,e){let t=r.getId();e&&typeof e.atIndex=="number"?this._orderedIds.splice(e.atIndex,0,t):this._orderedIds.push(t),this._modelsById[t]=r,r.bind("willDestroy",this.remove,this)}remove(r){let e=this.indexOf(r);e===void 0||e===-1||(this._orderedIds.splice(e,1),delete this._modelsById[r.getId()],r.unbind("willDestroy",this.remove,this))}};var $t=class extends _e{getGroupLevelByColumnIdIfExists(r){return this.find(e=>e.getColumnId()===r)}hasGroupLevelWithColumnId(r){return!!this.getGroupLevelByColumnIdIfExists(r)}hasGroupLevelWithAnyColumnId(r){return r.some(e=>this.hasGroupLevelWithColumnId(e))}hasAnyGroupLevelsWithComputedColumn(){return this.some(r=>r.getColumnModel().isComputed())}canCurrentUserUpdateCellsInAllGroupLevelColumns(){return this.every(r=>r.getColumnModel().canCurrentUserUpdateCells())}getDefaultCellValuesByColumnIdForGroupPath(r){let e={};return r.forEach((t,n)=>{let l=this.findByIndex(n).getColumnModel();l.isComputed()||(e[l.id]=t)}),e}serializeForSync(){return this.map(e=>({id:e.id,columnId:e.getColumnId(),order:e.getOrderType(),emptyGroupState:e.shouldShowEmptyGroups()?"shown":"hidden"}))}serializeForGroupAssigner(){return this.map(e=>({id:e.id,columnId:e.getColumnId(),order:e.getOrderType(),emptyGroupState:e.getEmptyGroupState(),groupingOptions:e.getGroupingOptions()}))}};d();d();R();function gp(i){return i?cs(!!i.shouldAutoSort,i.sortSet.length):!1}function cs(i,r){return i&&r>0}function Cp(i){return i.map(r=>f(T({},r),{id:c.id.generateSortId()}))}var fp={isAutoSortActive:gp,isAutoSortActiveImpl:cs,addSortIdsToPageElementQuerySorts:Cp},ms=fp;var er=class extends _e{constructor(e,t){super(e);this._shouldAutoSort=t}addPrimarySort(e){this.add(e,{atIndex:0})}getSortByColumnIdIfExists(e){return this.find(t=>t.getColumnId()===e)}serialize(){return{sortSet:this.map(t=>({id:t.id,columnId:t.getColumnId(),ascending:t.isAscending()})),shouldAutoSort:this._shouldAutoSort}}setShouldAutoSort(e){this._shouldAutoSort=e}shouldAutoSort(){return this._shouldAutoSort}isAutoSortActive(){return ms.isAutoSortActiveImpl(this.shouldAutoSort(),this.getLength())}};d();h();d();function*ot(i,r){if(i)for(let e of D.getAllFilterObjsReachableFromRootFiltersObj(i)){let t=r.getColumnByIdIfExists(e.columnId);if(!t)continue;D.isFilterActive(e,t.getTypeAndTypeOptions())&&(yield e)}}function Xr(i,r){return Array.from(ot(i,r)).length}function ys(i,r){return!Fe.isEmpty(ot(i,r))}function nE(i,r){return Xr(i,r)!==Array.from(i?D.getAllFilterObjsReachableFromRootFiltersObj(i):[]).length}function Is(i,r,e){return Fe.some(ot(i,r),t=>t.columnId===e)}function Ts(i,r,e){return Fe.some(ot(i,r),t=>e.includes(t.columnId))}function bs(i,r){return Fe.some(ot(i,r),e=>r.getColumnById(e.columnId).isComputed())}d();h();R();function vo(i,r,e){let t=!1,n=0,a=null;function l(){n++,a&&a()}return queueMicrotask(()=>{t||e()}),new Ui({get:()=>n,addListener:s=>{c.assert(a===null),a=s,t=!0,i(l)},removeListener:s=>{c.assert(a===s),a=null,r(l),e()}})}var tr=class{constructor(r,e){this._map=new Map;this._createValue=r,this._getKey=e}get(...r){let e=this._getKey(...r),t=this._map.get(e);if(t)return t;let n=this._createValue(()=>this._map.delete(e),...r);return this._map.set(e,n),n}get size(){return this._map.size}},gs=Symbol("liveSubscriptionsByEvent");function hp(i){let r=i[gs];if(!r){let e=i;r=new tr((t,n)=>{let a=vi(n);return vo(l=>e[`bindTo${a}`](l),l=>e[`unbindFrom${a}`](l),t)},t=>t),i[gs]=r}return r}function M(i,...r){let e=hp(i);for(let t of r)e.get(t).live()}var Cs=Symbol("liveSubscriptionsByUserPrefEvent");function Ep(i){let r=i[Cs];return r||(r=new tr((e,t)=>vo(n=>i.bindToPrefChange(t,n),n=>i.unbindFromPrefChange(t,n),e),e=>e),i[Cs]=r),r}function sE(i,...r){let e=Ep(i);for(let t of r)e.get(t).live()}var fs=Symbol("liveSubscriptionsByCellEvent");function Sp(i){let r=i[fs];return r||(r=new tr((e,t,n,a)=>vo(l=>i.bindToCellEvent(t,n,a,l),l=>i.unbindFromCellEvent(t,n,a,l),e),(e,t,n)=>`${e}~${t}~${n}`),i[fs]=r),r}function uE(i,r,e,t){Sp(i).get(r,e,t).live()}d();h();d();h();var zr=class extends _e{serialize(){let r=this.map(e=>e.serialize());return r.length===0?null:r}getLastColorDefinition(){let r=this.getLength();return r===0?null:this.findByIndex(r-1)}getSingleSelectColumnIdThatAllColorDefinitionsMirror(){var n;if(this.getActiveColorDefinitionCount()<2)return null;let r=this.map(a=>a.getColumnIdIfMirroringASingleSelectColumn()),e=Cr.default(r);return e.length!==r.length?null:(n=Le(e)[0])!=null?n:null}getActiveColorDefinitionCount(){let r=0;return this.each(e=>{e.isActive()&&r++}),r}};d();d();d();d();function hs(i,r,e,t={}){let n=e[i.columnId];if(!n)return{isValid:!1,reason:"deleted"};let{shouldAllowDynamicCurrentUser:a,shouldAllowEmptyDateModeValues:l,filterComparisonToCellValueOpts:s}=t,u={filterValidationAppInterface:r,column:n,filter:i,opts:{shouldAllowDynamicCurrentUser:a,shouldAllowEmptyDateModeValues:l,shouldAllowFilterComparisonToCellValue:s==null?void 0:s.shouldAllowFilterComparisonToCellValue}},m=s!=null&&s.shouldAllowFilterComparisonToCellValue?f(T({},u),{shouldValidateFilterValueFromDynamicCellValue:!0,getColumnTypeAndTypeOptions:s.getColumnTypeAndTypeOptionsFromComparisonTable}):u;return D.validateFilter(m).isValid?{isValid:!0}:{isValid:!1,reason:"invalid"}}function Es(i,r,e,t={}){return D.transformFiltersObj(e,a=>{let{isValid:l}=hs(a,i,r,t);return l?a:null})}function qr(i,r,e={}){let t=r.getParentApplication().getUserScopedAppInterface(),n=r.getColumnsByIdForFiltererOrSorter(),u=e,{filterComparisonToCellValueOpts:a}=u,l=Tr(u,["filterComparisonToCellValueOpts"]),s=_p(a);return Es(t,n,i,f(T({},l),{filterComparisonToCellValueOpts:s}))}function _p(i){return i!=null&&i.shouldAllowFilterComparisonToCellValue?{shouldAllowFilterComparisonToCellValue:!0,getColumnTypeAndTypeOptionsFromComparisonTable:(r,e)=>{var t;return(t=i.comparisonTableModel.getColumnByIdIfExists(e))==null?void 0:t.getTypeAndTypeOptions()}}:void 0}function rr(i,r,e={}){var a;if(!i)return!1;let t=qr(i,r,e);return((a=t==null?void 0:t.filterSet)!=null?a:[]).length>0}d();h();var Ss=i=>nt(i,"newSelectColors"),xo=i=>Ss(i)?ki:Yi;function _s(i,r){let e=Ci(r,l=>{var s;return(s=l.color)!=null?s:Ki}),t=l=>{var s;return(s=e[l])!=null?s:0},n=Si(i.map(t));return i.filter(l=>t(l)===n)}function DE(i,r){var n;let e=xo(i),t=_s(e,r);return(n=gi.default(t))!=null?n:e[0]}function wE(i,r){var n;let e=xo(i);return(n=_s(e,r)[0])!=null?n:e[0]}var As={shouldShowAllSelectColorOptions:Ss,getSelectColorOptions:xo};d();h();d();h();d();R();function Jr(){c.console.logGreen(`The above 422 status code on the previous network request is expected behavior and not an issue to flag.
The "error" status is used by the server to communicate that the user needs to confirm the operation before proceeding.`)}d();h();d();h();h();Cn();R();O();var Rp=0,YE=o.object({schemaVersion:o.enum([Rp]),tableCount:o.number(),syncedTableCount:o.number().optional(),standaloneColumnCount:o.number(),pageBundleCount:o.number(),workflowCount:o.number(),overallViewCount:o.number(),overallColumnCount:o.number()}).sensitivity("LOW_INTERNAL");var Op=o.object({type:o.enum(["column"]),columnDisplayType:o.enum(xn)}),Fp=o.object({type:o.enum(["setOfColumns"]),columnDisplayTypes:o.array(o.enum(xn))}),Lp=o.object({type:o.enum(["table"])}),vp=o.object({type:o.enum(["setOfTables"])}),xp=o.object({type:o.enum(["application"]),applicationColor:o.enum(Hi),applicationIcon:o.enum(ji).nullable(),applicationDescription:o.string().nullable()}),XE=o.object({column:Op.optional(),table:Lp.optional(),setOfColumns:Fp.optional(),setOfTables:vp.optional(),application:xp.optional()});function Dp(i,r){if(c.id.isTableId(i))return c.id.isPackageTableId(r);if(c.id.isColumnId(i))return c.id.isPackageColumnId(r);if(c.id.isViewId(i))return c.id.isPackageViewId(r);if(c.id.isViewSectionId(i))return c.id.isPackageViewSectionId(r);if(c.id.isExternalTableSyncId(i))return c.id.isPackageExternalTableSyncId(r);if(c.id.isPageBundleId(i))return c.id.isPackagePageBundleId(r);if(c.id.isPageId(i))return c.id.isPackagePageId(r);if(c.id.isWorkflowId(i))return c.id.isPackageWorkflowId(r);if(c.id.isWorkflowSectionId(i))return c.id.isPackageWorkflowSectionId(r);if(c.id.isRowTemplateId(i))return c.id.isPackageRowTemplateId(r);if(c.id.isWorkflowTriggerConnectionId(i))return c.id.isPackageWorkflowTriggerConnectionId(r);throw new A(i)}var zE=o.dict(o.objectId(),o.packageModelId(),{preserveRawSchema:!0}).refine(i=>B(i).every(([r,e])=>c.id.isPackageableModelId(r)&&Dp(r,e))),Rs=(u=>(u.COLUMN="column",u.TABLE="table",u.SET_OF_COLUMNS="setOfColumns",u.SET_OF_TABLES="setOfTables",u.APPLICATION="application",u.SOURCE="source",u.SOLUTIONS_APPLICATION="solutionsApplication",u.FEATURE_KIT="featureKit",u))(Rs||{});function qE(i){switch(i){case"column":return"column";case"table":return"table";case"setOfColumns":return"setOfColumns";case"setOfTables":return"setOfTables";case"application":return"application";default:throw new A(i)}}function Qr(i,r){return Object.values(i.getPackageInstallationsByIdLive()).filter(e=>!e.getIsSourcePackageInstallation()&&L(e.getPackageModelIdByTargetApplicationModelIdLive(),r))}function wp(i,r){return Object.values(i.getPackageInstallationsByIdLive()).filter(e=>e.getIsSourcePackageInstallation()&&L(e.getPackageModelIdByTargetApplicationModelIdLive(),r))}function $E(i,r){return Qr(i,r).length>0}function eS(i,r){return Qr(i,r).some(e=>e.getInstallationType()==="featureKit")}function Os(i,r){return wp(i,r).length>0}function Np(i,r){return Qr(i,r).filter(e=>{let t=i.getPackageByIdLive(e.getPackageId());return e.getLatestPackageReleaseIdIfUpdateIsAvailableLive(t)!==null})}function tS(i,r){var y,I,b,C;let e=Qr(i,r),t=e.length>0,n=e.filter(E=>E.isFeatureKitPackage()),a=null;for(let E of n){let v=i.getFeatureKitInstallationByIdLive();for(let w of Object.values(v))if(w.getPackageInstallationIdLive()===E.id){a=w;break}}let l=(I=(y=e[0])==null?void 0:y.getInstallationType())!=null?I:null,s=Np(i,r).length>0,u=e.filter(E=>E.isSolutionsPackage()),m=u.length,p=(C=(b=u[0])==null?void 0:b.getNameLive())!=null?C:null;return{isInstalledByAnyPackage:t,firstInstallationType:l,isUpdateAvailable:s,solutionsPackageCount:m,firstSolutionsPackageName:p,managedByFeatureKitInstallation:a}}d();h();d();var nr=class{constructor(r){this._edgesBySourceObjectId=he(r)}getAllEdgesBySourceObjectId(){return this._edgesBySourceObjectId}getEdgesBySourceObjectId(r){return this._edgesBySourceObjectId[r]}getSourceObjectIds(){return F(this._edgesBySourceObjectId)}};d();h();h();R();function Do({type:i,typeOptions:r}){switch(i){case"multipleAttachment":return!0;case"lookup":return r.resultType==="multipleAttachment";case"text":case"multilineText":case"number":case"multiSelect":case"select":case"foreignKey":case"date":case"phone":case"checkbox":case"formula":case"rollup":case"count":case"autoNumber":case"barcode":case"collaborator":case"multiCollaborator":case"rating":case"richText":case"button":case"asyncText":case"manualSort":case"computation":return!1;default:throw new A(i)}}function cS(i){switch(c.assert(Do(i)),i.type){case"multipleAttachment":return i.cellValue===null?[]:i.cellValue;case"lookup":{let r=[];if(i.cellValue===null)return[];for(let e of xe(i.cellValue.valuesByForeignRowId)){let t=e;if(t!==null)for(let n of t)r.push(n)}return r}default:throw new A(i)}}d();h();$();function Zr({type:i,typeOptions:r}){switch(i){case"select":case"checkbox":case"collaborator":case"rating":return!0;case"formula":return $e({type:i,typeOptions:r})==="select";case"text":case"multilineText":case"number":case"multiSelect":case"foreignKey":case"date":case"phone":case"multipleAttachment":case"rollup":case"count":case"lookup":case"autoNumber":case"barcode":case"multiCollaborator":case"richText":case"button":case"asyncText":case"manualSort":case"computation":return!1;default:throw new A(i)}}function Fs(i,r){return e(i).finiteValues;function e({type:t,typeOptions:n}){var a;switch(t){case"select":return{type:t,finiteValues:n.choiceOrder};case"checkbox":return{type:t,finiteValues:[!0]};case"collaborator":{let l=bt.getOrderedUserObjs(r.getUserInfoById());return{type:t,finiteValues:l.filter(s=>!$i(s.id)).map(s=>s.id)}}case"rating":return{type:t,finiteValues:_i.default(1,n.max+1)};case"formula":if($e({type:t,typeOptions:n})==="select")return{type:t,finiteValues:(a=n.choiceOrder)!=null?a:[]};case"text":case"multilineText":case"number":case"multiSelect":case"foreignKey":case"date":case"phone":case"multipleAttachment":case"rollup":case"count":case"lookup":case"autoNumber":case"barcode":case"multiCollaborator":case"richText":case"button":case"asyncText":case"manualSort":case"computation":throw new x("Finite values are not supported");default:throw new A(t)}}}d();h();function Ls({originalColumnConfig:i,targetColumnConfig:r}){let e=i.type,t=r.type;if(e==="text"&&t==="multilineText"||e==="multilineText"&&t==="text"||e==="collaborator"&&t==="multiCollaborator")return!1;if(e==="select"&&t==="select"||e==="select"&&t==="multiSelect"||e==="multiSelect"&&t==="multiSelect"){let n=i.typeOptions||{},a=r.typeOptions||{};return Ce.default(ce(n.choices),ce(a.choices)).length>0}return Or(e)?!1:e!==t}En();d();h();d();h();d();h();$();var $r=class{constructor(r,e){this._externalTableSyncId=r.id,this._externalTableSyncInfo=he(r),this._tableId=e}getMetadata(){var r;return{syncFrequency:this._externalTableSyncInfo.dataSourceConfig.syncFrequency,editSourceRecordPermissionLevel:(r=this._externalTableSyncInfo.dataSourceConfig.editSourceRecordPermissionLevel)!=null?r:"none",shouldSyncRowDeletions:this._externalTableSyncInfo.dataSourceConfig.shouldSyncRowDeletions}}getAuthoritativeColumnIds(){let r=this._externalTableSyncInfo.dataSourceConfig.authoritativeColumnIds;return r!=="all"?r:F(this._externalTableSyncInfo.dataSourceConfig.externalFieldIdByColumnId)}getExternalFieldIdByColumnId(){return this._externalTableSyncInfo.dataSourceConfig.externalFieldIdByColumnId}getLastKnownColumnIdByExternalFieldId(){return this._externalTableSyncInfo.dataSourceConfig.lastKnownColumnIdByExternalFieldId}getExternalFieldInfoByFieldId(){return this._externalTableSyncInfo.externalFieldInfoByFieldId}getSelectedExternalFieldIds(){return this._externalTableSyncInfo.dataSourceConfig.selectedExternalFieldIds}getMappedColumnIds(){return F(this._externalTableSyncInfo.dataSourceConfig.externalFieldIdByColumnId)}isAuthoritativeForAllColumns(){return this._externalTableSyncInfo.dataSourceConfig.authoritativeColumnIds==="all"}getLastAttemptedStartTime(){var r;return(r=this._externalTableSyncInfo.lastAttemptStartTime)!=null?r:null}getExternalTableSyncId(){return this._externalTableSyncId}getExternalFieldLastMappedToColumnOrNull(r){let e=this._externalTableSyncInfo.dataSourceConfig.externalFieldIdByColumnId[r];if(e!==void 0)return e;for(let[t,n]of B(this._externalTableSyncInfo.dataSourceConfig.lastKnownColumnIdByExternalFieldId))if(r===n)return t;return null}getSourceColumnSchema(r){var n;let e=this.getExternalFieldLastMappedToColumnOrNull(r);if(e===null)return{err:pt("columnId is not mapped to a field for source",{columnId:r})};let t=(n=this._externalTableSyncInfo.dataSourceConfig.columnInfoByExternalFieldId)==null?void 0:n[e];return t===void 0?{err:pt("sourceColumnSchema does not exist",{columnId:r,externalFieldId:e})}:{value:{sourceColumnSchema:t,externalFieldId:e}}}getDataSourceType(){return this._externalTableSyncInfo.dataSourceConfig.dataSourceType}isExternalFieldIdSynced(r){var e;return((e=this._externalTableSyncInfo.externalFieldInfoByFieldId[r])==null?void 0:e.state)==="synced"}};R();var en=class i{constructor(r,e,t,n){this._externalTableSyncInfoManagerById=t,this._applicationId=r,this._tableId=e,this._firstExternalTableSyncId=n}static create(r,e,t){var l;let n=new Map(B(t).map(([s,u])=>[s,new $r(u,e)])),a=(l=F(t)[0])!=null?l:null;return new i(r,e,n,a)}getFirstExternalTableSyncInfoManager(){var r;return this._firstExternalTableSyncId&&(r=this._externalTableSyncInfoManagerById.get(this._firstExternalTableSyncId))!=null?r:null}getAllExternalTableSyncInfoManagersById(){return this._externalTableSyncInfoManagerById}getExternalTableSyncInfoManager(r){var t;let e=(t=this._externalTableSyncInfoManagerById.get(r))!=null?t:null;return c.assert.isNotUndefinedOrNull(e,"expected etsInfoManager to not be null",{externalTableSyncId:r}),e}containsSourceThatIsAuthoritativeForAllColumns(){for(let[r,e]of this._externalTableSyncInfoManagerById)if(e.isAuthoritativeForAllColumns())return this._externalTableSyncInfoManagerById.size>1&&c.logger.error("External Table Sync Config Manager: Sync has authoritativeColumnIds set to all but is not the only source",{tableId:this._tableId,externalTableSyncId:r}),!0;return!1}getAuthoritativeSourceIdByColumnId(){let r={};for(let[e,t]of this._externalTableSyncInfoManagerById)for(let n of t.getAuthoritativeColumnIds())r[n]=e;return r}};R();$();d();var or=class i{constructor(r,e,t,n){this._applicationId=r,this._tableId=e,this._targetConfig=he(t),this._externalTableSyncInfoByIdManager=n}static create(r,e,t,n){return new i(r,e,t,en.create(r,e,n))}getAuthoritativeSourceIdByColumnId(){let r=this._externalTableSyncInfoByIdManager.getAuthoritativeSourceIdByColumnId();for(let[e,t]of B(this._targetConfig.authoritativeSourceIdByColumnId))c.id.isTableId(t)&&(r[e]=t);return r}getTableId(){return this._tableId}containsSourceThatIsAuthoritativeForAllColumns(){return this._externalTableSyncInfoByIdManager.containsSourceThatIsAuthoritativeForAllColumns()}getAuthoritativeColumnsForSourceId(r){return F(Ee(this._targetConfig.authoritativeSourceIdByColumnId,e=>e===r))}getAuthoritativeColumnIdsForTarget(){return F(Ee(this._targetConfig.authoritativeSourceIdByColumnId,r=>r===this._tableId))}getAuthoritativeSourceForColumnId(r){let e=this._targetConfig.authoritativeSourceIdByColumnId[r];return e!=null?e:null}isFieldTypeCustomized(r){let e=this.getAuthoritativeSourceForColumnId(r);return c.id.isTableId(e)}getExternalFieldIdsMappedToColumnId(r){let e=new Map;for(let[t,n]of this._externalTableSyncInfoByIdManager.getAllExternalTableSyncInfoManagersById()){let a=n.getExternalFieldLastMappedToColumnOrNull(r);a&&e.set(t,a)}return e}getExternalTableSyncInfoManager(r){return this._externalTableSyncInfoByIdManager.getExternalTableSyncInfoManager(r)}getColumnInfoByColumnId(){return this._targetConfig.columnConfigByColumnId}getAuthoritativeColumnConfigForColumn(r){let t=this.getAuthoritativeSourceIdByColumnId()[r];if(t===void 0)return{value:{authoritativeSourceType:"unsyncedColumn"}};if(c.id.isTableId(t)){let u=this._targetConfig.columnConfigByColumnId[r];return u===void 0?{err:pt("target config does not contain column id",{tableId:t,columnId:r})}:{value:{authoritativeSourceType:"table",columnInfo:u}}}let a=this._externalTableSyncInfoByIdManager.getExternalTableSyncInfoManager(t).getSourceColumnSchema(r);if(a.err)return a;let{sourceColumnSchema:l,externalFieldId:s}=a.value;return{value:{authoritativeSourceType:"syncSource",authoritativeSourceId:t,externalFieldId:s,columnInfo:l}}}};me();R();d();h();O();var XS="SYNC_COLUMN_STOPS_AFTER_CONFIG_UPDATE",zS="COLUMN_TYPE_FROM_RICH_TEXT_TO_MULTI_TEXT",qS="GENERIC_COLUMN_CONFIG_UPDATE_DATA_ALTERATION",vs="COLUMN_CONFIG_UPDATE_WARNING",Pp=o.object({rowTemplateId:o.rowTemplateId(),columnId:o.columnId(),cellObject:Da}),Mp=o.object({skipColumnConfigExternalSyncWarning:o.boolean().optional(),skipColumnConfigChangeWarning:o.boolean().optional()}).optional(),JS=o.object(f(T({},P(k.shape,"type","typeOptions","default")),{activeViewId:o.viewId().optional().nullable(),schemaDependenciesCheckParams:o.object({columnUpdateSkipWarningPrefs:Mp}).optional()})),QS=o.object(f(T({},P(k.shape,"type","typeOptions","default")),{cellValuesByRowId:o.dict(o.rowId(),Be).optional().nullable(),summaryBarConfigsByViewId:o.object({}).passthrough().optional().nullable(),formFieldVisiblityByViewId:o.dict(o.viewId(),o.boolean()).optional().nullable(),formFieldOptionObjByViewId:o.dict(o.viewId(),Hn).optional().nullable(),formFieldsWhichReferenceColumnByViewIdThenColumnId:o.dict(o.viewId(),o.dict(o.columnId(),Hn)).optional().nullable(),formerRowTemplateCellObjectData:o.array(Pp).optional(),formerSymmetricEmbeddingConfigIdIfExists:o.embeddingConfigId().optional().nullable()}));d();h();me();d();O();var xs=new Set(["text","multilineText","number","multiSelect","select","date","phone","checkbox","barcode","rating","richText","foreignKey"]),wo=o.object({item:Oa}),Bp=wo.extend({operationType:o.enum(["add"]),targetIndex:o.integer().nonNegative().optional()}),Vp=wo.extend({operationType:o.enum(["remove"])}),Up=wo.extend({operationType:o.enum(["move"]),targetIndex:o.integer().nonNegative()}),Ds=[Bp,Vp,Up],o_=o.union(Ds),Gp=Ds.map(i=>i.extend({item:o.string()})),i_=o.union(Gp);d();h();d();var No=function(i){let{type:r,typeOptions:e}=i.getTypeAndTypeOptionsLive();return r==="date"&&!(e!=null&&e.isDateTime)},Ns=function(i){let{type:r,typeOptions:e}=i.getTypeAndTypeOptionsLive();return r==="number"&&(e==null?void 0:e.format)==="durationInDays"},Ps=function(i){let{type:r,typeOptions:e}=i.getTypeAndTypeOptionsLive();return r==="foreignKey"&&(e==null?void 0:e.foreignTableId)===i.getParentTable().id},d_=function(i){return No(i)||Ns(i)||Ps(i)};function jp(i,r){let{startDateColumnId:e,endDateColumnId:t,durationColumnId:n,dependencyColumnId:a}=r,l=i.getColumnByIdIfExistsLive(e);if(l===null||!No(l))return!1;let s=i.getColumnByIdIfExistsLive(t);if(s===null||!No(s))return!1;let u=i.getColumnByIdIfExistsLive(n);if(u===null||!Ns(u))return!1;if(a){let m=i.getColumnByIdIfExistsLive(a);if(m===null||!Ps(m))return!1}return!0}function Ms(i,r){return r.startColumnId===i.startDateColumnId&&r.endColumnId===i.endDateColumnId}function p_(i,r,e){return jp(i,r)&&Ms(r,e)}d();h();function kp(i,r){return i?i.some(e=>e.startColumnId===r||e.endColumnId===r):!1}function Kp(i,r){if(!i)return i;let e=i.filter(t=>t.startColumnId!==r&&t.endColumnId!==r);return e.length>0?e:null}function Wp(i,r){if(!i)return!0;for(let e of i)if(!r(e.startColumnId)||typeof e.endColumnId=="string"&&!r(e.endColumnId))return!1;return!0}function Hp(i,r){if(!i)return i;let e=i.filter(t=>typeof t.endColumnId=="string"?r(t.endColumnId)&&r(t.startColumnId):r(t.startColumnId));return e.length>0?e:null}function Bs(i,r){let e=r[i.startColumnId],t=!!e&&Ie.isColumnEligibleForCalendar(e);if(t&&i.endColumnId){let n=r[i.endColumnId];return!!n&&Ie.isColumnEligibleForCalendar(n)&&e.id!==n.id&&Yp(e,n)}else return t}function Yp(i,r){let e=["isDateTime","timeZone"],t=Ie.getNormalizedDateColumnTypeOptions(i.type,i.typeOptions),n=Ie.getNormalizedDateColumnTypeOptions(r.type,r.typeOptions);return H.default(P(t,e),P(n,e))}function Xp(i,r){let e=i.findIndex(n=>n.startColumnId===r);if(e!==-1)return e;let t=i.findIndex(n=>n.endColumnId===r);return t!==-1?t:null}function zp(i,r){let e=[],t=new Set;for(let n of i)if(Bs(n,r)){let{startColumnId:a,endColumnId:l}=n;if(!t.has(a)){t.add(a);let s={columnId:a,order:"ascending",groupingOptions:{shouldNormalizeToSingleValueOrNull:!0}};e.push(s)}if(l&&!t.has(l)){t.add(l);let s={columnId:l,order:"ascending",groupingOptions:{shouldNormalizeToSingleValueOrNull:!0}};e.push(s)}}return e}var qp={doRangesContainColumnId:kp,getRangesWithoutColumnId:Kp,everyColumnIdInRanges:Wp,filterRanges:Hp,isDateColumnRangeValid:Bs,getRangeIndexForColumnIdIfExists:Xp,getRawGroupLevelsForDateColumnsIfValid:zp},Jp=qp;function tn(i,r,{includeHiddenColumnsUsedForColorization:e=!1,primaryColumnId:t}={}){let n=r.getColorConfigObjIfExists();return r.isColumnIdVisible(i)||r.hasGroupLevelWithColumnId(i)||e&&n!==null&&ye.isColorConfigDependentOnColumn(n,i)||t===i}function Qp(i,r,e){return tn(i,r)||e.includeHiddenColumns}function Zp(i,r,e,t){var s,u;if(!Qp(i.id,r,e))return{isEligibleForEditing:!1,reason:"notIncludedInView"};let n=!1,l=["collaborator","multiCollaborator"].includes(i.type)&&(t==null?void 0:t.isTwoWaySyncCollaboratorFieldEnabled)||xs.has(i.type);return(s=e.metadata)!=null&&s.canBeSynced&&((u=e.metadata)!=null&&u.shouldAllowEditingRecordsFromSync)&&!l&&(n=!0),n||!i.canAnyUserEverUpdateCells()?{isEligibleForEditing:!1,reason:"notEditable"}:i.canUpdateCellsInSharedViewBasedOnColumnLock()?{isEligibleForEditing:!0}:{isEligibleForEditing:!1,reason:"locked"}}function Vs(i,r,e,t){var s,u,m,p,y,I;if(!((s=e.metadata)!=null&&s.shouldAllowEditingRecords))return!1;let{isEligibleForEditing:n}=Zp(i,r,e,{isTwoWaySyncCollaboratorFieldEnabled:t==null?void 0:t.isTwoWaySyncCollaboratorFieldEnabled});if(!n)return!1;let a=(m=(u=e.metadata)==null?void 0:u.columnSettingsOverrideForAllColumns)==null?void 0:m.isEditable;if(a!==void 0)return a;let l=(I=(y=(p=e.metadata)==null?void 0:p.columnSettingsByColumnId)==null?void 0:y[i.id])==null?void 0:I.isEditable;return l!==void 0?l:!1}function U_(i){if(i){if(i.enterpriseSyncRestriction)return{shouldRestrictSyncToEnterprise:i.enterpriseSyncRestriction==="restrictedToEnterprise"||i.enterpriseSyncRestriction==="restrictedToEnterpriseGrid",enterpriseSyncRestriction:i.enterpriseSyncRestriction};if(typeof i.shouldRestrictSyncToEnterprise=="boolean")return{shouldRestrictSyncToEnterprise:i.shouldRestrictSyncToEnterprise}}}function G_(i){function r(e){return{shouldRestrictSyncToEnterprise:e,enterpriseSyncRestriction:e?"restrictedToEnterprise":"unrestricted"}}if(i.enterpriseSyncRestriction)switch(i.enterpriseSyncRestriction){case"unrestricted":return r(!0);case"restrictedToEnterprise":case"restrictedToEnterpriseGrid":return r(!1);default:throw new A(i.enterpriseSyncRestriction)}else{let e=!i.shouldRestrictSyncToEnterprise;return le("writeEnterpriseSyncRestrictionEnumToShareMetadata")?r(e):{shouldRestrictSyncToEnterprise:e}}}function Us(i,r){var e;return(e=i==null?void 0:i[r])!=null?e:null}function ir(i,r){return i.type===r}var Po=class extends Vi{constructor(e,t){var a;let n=T({name:"",description:"",type:"text",default:null,typeOptions:null,lock:null},e);c.assert(n.name!=="","column has blank name"),n.typeOptions=n.typeOptions||null,c.assert(gr(n.typeOptions)||n.typeOptions===null,"type options should be an object or null"),(n.default===void 0||typeof n.default=="string"&&ci(n.default))&&(n.default=null);super("column",(a=n.id)!=null?a:null,t);this._pendingType=null,this._pendingTypeOptions=null,this._name=n.name,this._description=n.description,this._type=n.type,this._typeOptions=n.typeOptions,this._default=n.default,this._lock=n.lock,this._initialCreatedTime=new se(n.initialCreatedTime),this._initialCreatedByUserId=new se(n.initialCreatedByUserId),this._lastModifiedTime=new se(n.lastModifiedTime),this._lastModifiedByUserId=new se(n.lastModifiedByUserId)}_generateModelId(){return c.id.generateColumnId()}_shouldSyncDestroy(){return!0}_serialize({getDefault:e,getType:t,getTypeOptions:n,getName:a,getDescription:l}){let s=e(),u=s===void 0?null:s,m=n(),p=m===void 0?null:m;return{id:this.id,name:a(),description:this.description,type:t(),default:u,typeOptions:p}}serialize(){return this._serialize({getDefault:()=>this.defaultValue,getType:()=>this.type,getTypeOptions:()=>this.typeOptions,getName:()=>this.name,getDescription:()=>this.description})}serializeLive(){return this._serialize({getDefault:this.getDefaultLive.bind(this),getType:this.getTypeLive.bind(this),getTypeOptions:this.getTypeOptionsLive.bind(this),getName:this.getNameLive.bind(this),getDescription:this.getDescriptionLive.bind(this)})}isPrimitive(){return Xi(this.type)}isComputed(){return we(this.type)}isRelational(){return zi(this.type)}isSymmetricColumnOfCollaborator(){return oe(()=>this.isSymmetricColumnOfCollaboratorLive())}isSymmetricColumnOfCollaboratorLive(){var l;let{type:e,typeOptions:t}=this.getTypeAndTypeOptionsLive();if(e!=="foreignKey")return!1;let n=t;if(!n.symmetricColumnId)return!1;let a=(l=this.getParentTable().getParentApplication().getTableByIdIfExistsLive(n.foreignTableId))==null?void 0:l.getColumnByIdIfExistsLive(n.symmetricColumnId);return!!a&&qi(a.getTypeLive())}isTextType(){return ra(this.type)}isNumberType(){return na(this.getTypeAndTypeOptions())}isFormulaic(){return Dn(this.type)}isEphemeral(){return Or(this.type)}isForeignKeyTypeWithAiMatching(){let{type:e,typeOptions:t}=this.getTypeAndTypeOptions();return e!=="foreignKey"?!1:!!t.aiMatchingOptions}isFormulaicColumnInError(){return Dn(this.type)?Oi(this.typeOptions,"formulaError"):!1}isFormulaicColumnInErrorLive(){return M(this,"typeOrTypeOptionsChange"),this.isFormulaicColumnInError()}isExternallySynced(){return this.getParentTable().isColumnExternallySynced(this.id)}isNativelySynced(){return this.getParentTable().isColumnNativelySynced(this.id)}getAirtableSharedViewSourceColumnsInfoIfExists(){return this.getParentTable().getAirtableSharedViewSourceColumnsInfoForSyncedColumnIfExists(this.id)}convertToSyncedLinkedRecordColumnFromUser(e){this.syncCrudAction("updateToSyncedForeignKeyColumn",{foreignTableId:e})}isEditDisabledDueToSync(e){return oe(()=>fo(this,e))}isExternallySyncedLive(){return M(this.getParentTable(),"externalTableSyncChange"),this.isExternallySynced()}isNativelySyncedLive(){return M(this.getParentTable(),"externalTableSyncChange"),this.isNativelySynced()}isStandaloneColumnPackageInstallationLive(){let e=this.getParentTable().getParentApplication().getPackageInstallationsById(),t=this.id;return Object.values(e).some(n=>{var a;return(a=n.getStandaloneColumnIdsIfOnlyContainsStandaloneColumnsLive())==null?void 0:a.includes(t)})}getStandaloneColumnPackageInstallationIfExistsLive(){var n;let e=this.getParentTable().getParentApplication().getPackageInstallationsById(),t=this.id;return(n=Object.values(e).find(a=>{var l;return(l=a.getStandaloneColumnIdsIfOnlyContainsStandaloneColumnsLive())==null?void 0:l.includes(t)}))!=null?n:null}getSourceStandaloneColumnPackageInstallationIfExistsLive(){let e=this.getStandaloneColumnPackageInstallationIfExistsLive();return!e||!e.getIsSourcePackageInstallation()?null:e}getAttachmentColumnAttachmentRestrictions(){return this.type==="multipleAttachment"?this.getParentTable().getParentApplication().getAttachmentRestrictions():void 0}isAttachmentColumnRestrictingUploads(){return this.type==="multipleAttachment"&&this.getParentTable().getParentApplication().isRestrictingAttachmentUploads()}isAttachmentColumnType(){return Do(this.getTypeAndTypeOptions())}hasFiniteValues(){return Zr(this.getTypeAndTypeOptions())}shouldShowInSortDialogs(){return this.type!=="button"}canBeGrouped(){return oa(this.getTypeAndTypeOptions())}_getApplicationIdIfWorkspaceDescendant(){return this.getParentTable().applicationId}getParentTable(){return this.getParentModel()}canCurrentUserDestroyColumn(){return!this.isPrimaryColumn()&&!this.isExternallySynced()&&!this.isSymmetricColumnOfCollaborator()&&this.getParentTable().getParentApplication().canCurrentUserEditSchema()&&ee.canDestroyColumn(this.lock,Qe(),this.getParentTable().getParentApplication().getCurrentUserPermissionLevelInContext())}canCurrentUserEditType(){let e=oe(()=>Os(this.getParentTable().getParentApplication(),this.id)),t=this.getParentTable().getExternalTableSyncTargetConfigurationIfExists(),n=!1;t&&(n=or.create(this.getParentTable().getParentApplication().id,this.getParentTable().id,t,{}).isFieldTypeCustomized(this.id));let a=this.type==="foreignKey"&&!n;return(!this.isExternallySynced()||q("externalTableSyncFieldCustomization")&&!a)&&(!e||q("packagesPlatformAllowPublishedColumnTypeChange"))&&!this.isSymmetricColumnOfCollaborator()&&this.getParentTable().getParentApplication().canCurrentUserEditSchema()&&ee.canEditType(this.lock,Qe(),this.getParentTable().getParentApplication().getCurrentUserPermissionLevelInContext())}canCurrentUserEditTypeOptions(){let e=this.getParentTable().getExternalTableSyncTargetConfigurationIfExists(),t=!1;e&&(t=or.create(this.getParentTable().getParentApplication().id,this.getParentTable().id,e,{}).isFieldTypeCustomized(this.id));let n=this.type==="foreignKey"&&!t;return(!this.isExternallySynced()||q("externalTableSyncFieldCustomization")&&!n)&&!this.isSymmetricColumnOfCollaborator()&&this.getParentTable().getParentApplication().canCurrentUserEditSchema()&&ee.canEditTypeOptions(this.lock,Qe(),this.getParentTable().getParentApplication().getCurrentUserPermissionLevelInContext())}getCellValueForRowId(e){return this.getParentTable().getCellValue(e,this.id)}getCellValueWithColumnTypeAndTypeOptionsForRowId(e){return this.getParentTable().getCellValueWithColumnTypeAndTypeOptions(e,this)}isPrimaryColumn(){var e;return((e=this.getParentTable().primaryColumnId)!=null?e:null)===this.id}isPrimaryColumnLive(){return this.getParentTable().getPrimaryColumnIdIfExistsLive()===this.id}canBePrimaryColumn(){return Pn(this.getTypeAndTypeOptions())}canBePrimaryColumnLive(){return Pn(this.getTypeAndTypeOptionsLive())}getNameLive(){return M(this,"nameChange"),this.name}getDescriptionLive(){return M(this,"descriptionChange"),this.description}getLockLive(){return M(this,"lockChange"),this.lock}getShortDescriptionOfWhoCanUpdateCells(){return this.isExternallySynced()?"nobody":ee.getShortDescriptionOfWhoCanUpdateCells(this.lock)}getPackageInstallationsWhichLockOperationsLive(e){var a,l,s,u;M(this,"lockChange");let t=this.getParentTable().getParentApplication().getPackageInstallationsById(),n=this.lock;return Le([...e.includes("destroyColumn")?(a=n==null?void 0:n.packageInstallationIdsForDestroyColumn)!=null?a:[]:[],...e.includes("editType")?(l=n==null?void 0:n.packageInstallationIdsForEditType)!=null?l:[]:[],...e.includes("editTypeOptions")?(s=n==null?void 0:n.packageInstallationIdsForEditTypeOptions)!=null?s:[]:[],...e.includes("updateCells")?(u=n==null?void 0:n.packageInstallationIdsForUpdateCells)!=null?u:[]:[]]).map(m=>t[m]).filter(pi)}getTypeLive(){return M(this,"typeOrTypeOptionsChange"),this.type}getPendingType(){return this._pendingType}getTypeOrPendingType(){return this._pendingType||this.type}getTypeOrPendingTypeLive(){return M(this,"typeOrTypeOptionsChange","pendingTypeOrTypeOptionsChange","pendingTypeOrTypeOptionsClear"),this._pendingType||this.type}getTypeOptions(){return this._typeOptions}getTypeOptionsLive(){return M(this,"typeOrTypeOptionsChange"),this._typeOptions}getTypeOptionsOrPendingTypeOptions(){return this._pendingTypeOptions||this._typeOptions}getTypeOptionsOrPendingTypeOptionsLive(){return M(this,"typeOrTypeOptionsChange","pendingTypeOrTypeOptionsChange","pendingTypeOrTypeOptionsClear"),this._pendingTypeOptions||this._typeOptions}getTypeAndTypeOptions(){return{type:this.type,typeOptions:this.typeOptions}}getTypeAndTypeOptionsLive(){return M(this,"typeOrTypeOptionsChange"),{type:this.type,typeOptions:this.typeOptions}}getTypeOption(e){let t=this.typeOptions;return Us(t,e)}getTypeOptionOrPendingTypeOption(e){let t=this.getTypeOptionsOrPendingTypeOptions();return Us(t,e)}getDefault(){return this._default}getDefaultLive(){return M(this,"defaultChange"),this.getDefault()}getConfig(){return{type:this.type,typeOptions:this._typeOptions,default:this._default}}getConfigWithColumnName(){return T({name:this.name},this.getConfig())}getDisplayType(){return wn({type:this.getTypeOrPendingType(),typeOptions:this.getTypeOptionsOrPendingTypeOptions()})}getDisplayTypeLive(){return wn({type:this.getTypeOrPendingTypeLive(),typeOptions:this.getTypeOptionsOrPendingTypeOptionsLive()})}getDisplayNameForDisplayType(e){return Nn({type:this.getTypeOrPendingType(),typeOptions:this.getTypeOptionsOrPendingTypeOptions()},e)}getDisplayNameForDisplayTypeLive(e){return Nn({type:this.getTypeOrPendingTypeLive(),typeOptions:this.getTypeOptionsOrPendingTypeOptionsLive()},e)}getFormulaicResultType(){return $e(this.getTypeAndTypeOptions())}getFormulaicResultTypeLive(){return $e(this.getTypeAndTypeOptionsLive())}setNameFromServer(e){this._name=e,this._triggerNameChange(e),this.getParentTable().triggerColumnNameChanged(this)}setDescriptionFromUser(e,{integrationId:t=null,blockId:n=null,onSuccess:a=ne.default}={}){if(e===this.description){a();return}this._description=e,this._triggerDescriptionChange(e),this.syncCrudAction("updateDescription",{description:e},{integrationId:t,blockId:n,onSuccessfulResponseAndPushPayload:a})}setDescriptionFromServer(e){this._description=e,this._triggerDescriptionChange(e)}willTargetConfigCauseDataAlteration(e){return Ls({originalColumnConfig:this.getTypeAndTypeOptions(),targetColumnConfig:{type:e.type,typeOptions:e.typeOptions}})&&!this.getParentTable().isEveryCellInColumnDefinitelyEmptyOfVisibleContent(this.id)}doesNewConfigRequireUpdate(e){let t=this.type,n=this.getDefault(),a=this.typeOptions||{},l=["createdAsPrimaryKeyForPeopleTable"],s=e.type,u=e.default,m=e.typeOptions||{},p=t!==s,y=!H.default(n,u),I=!H.default(Sr(a,...l),m);return p||y||I}createChoiceAndUpdateCellInRow(e,t,n){var m;let a=this.id,l=this.type;c.assert.isTrue(ya(l)),c.assert.isTrue(!this.isExternallySynced()||q("externalTableSyncFieldCustomization"));let s=this.typeOptions;s.choiceOrder.push(e.id),s.choices[e.id]=e;let u=this.getParentTable();if(u.onColumnTypeOrTypeOptionsChange(a),this._triggerTypeOrTypeOptionsChange(l,s),u.triggerColumnTypeOrTypeOptionsChanged(this),l==="select")u.replaceCellValueFromUserAndDoNotSync(t,a,e.id);else{let p=(m=u.getCellValue(t,a))!=null?m:[];ha.isObjValid(p)&&u.replaceCellValueFromUserAndDoNotSync(t,a,[...p,e.id])}this.syncCrudAction("createChoiceAndUpdateCellInRow",{choiceObj:e,rowId:t,pageElementId:n})}setNameAndConfigFromUser(e,t,{integrationId:n=null,blockId:a=null,onFailNameValidation:l=ne.default,onFailConfigValidation:s=ne.default,onSuccess:u=ne.default,handleConfigUpdateWarnings:m}={}){this.setNameFromUser(e,{integrationId:n,blockId:a,onFailValidation:l,onPassValidation:()=>{if(this.getParentTable().triggerColumnNameOrConfigChange(this),this._triggerNameChange(e.trim()),this.getParentTable().triggerColumnNameChanged(this),this.isExternallySynced()&&!q("externalTableSyncFieldCustomization")){u();return}t?this.setConfigFromUser(t,{integrationId:n,blockId:a,onFailConfigValidation:s,onSuccess:u,handleConfigUpdateWarnings:m}):u()},silent:!0,sync:!0})}setConfigFromUser(e,{integrationId:t=null,blockId:n=null,onFailConfigValidation:a=ne.default,onSuccess:l=ne.default,forceSyncToTheServer:s=!1,handleConfigUpdateWarnings:u}={}){let m=this.type,p=this.typeOptions,y=e.type,I=e.typeOptions;if(s)this.getParentTable().onColumnTypeOrTypeOptionsChange(this.id),this._triggerTypeOrTypeOptionsChange(y,I),this.getParentTable().triggerColumnTypeOrTypeOptionsChanged(this);else if(!this.doesNewConfigRequireUpdate(e)){l();return}let b=m!==y,C=!H.default(p,I);if(m==="autoNumber"&&y==="autoNumber"){l();return}this._pendingType=y,this._pendingTypeOptions=I||null,(b||C)&&(this._triggerPendingTypeOrTypeOptionsChange(),this.getParentTable().triggerColumnPendingTypeOrTypeOptionsChanged(this));let E=()=>{this._pendingType===y&&this._pendingTypeOptions===I&&(this._pendingType=null,this._pendingTypeOptions=null,(b||C)&&this._triggerPendingTypeOrTypeOptionsClear())},v=pe.default(e);if(this.getParentTable().hasActiveView()&&(v.activeViewId=this.getParentTable().getActiveViewId()),u){let w=this.getParentTable().getParentApplication().getHyperbaseModel().getCurrentSessionUser();v.schemaDependenciesCheckParams={columnUpdateSkipWarningPrefs:{skipColumnConfigExternalSyncWarning:w.getPref("shouldSkipColumnConfigExternalSyncWarning"),skipColumnConfigChangeWarning:w.getPref("shouldSkipColumnConfigChangeWarning")}}}this.syncCrudAction("updateConfig",v,{integrationId:t,blockId:n,onError:w=>{if(E(),w.error&&w.error.type&&w.error.message){if(u&&w.error.type===vs){Jr();let U=w.error.details;U.hasDependencyCheckWarning&&this.getParentTable().getParentApplication().getCachedDependencyGraph().setDependencyGraph(new nr(U.dependencyCheckWarningData.applicationDependencyGraphEdgesBySourceObjectId)),u(U)}else a(w.error.message);return{wasErrorHandled:!0}}return{wasErrorHandled:!1}},onSuccessfulResponseAndPushPayload:()=>{E(),l()}})}setConfigFromServer(e,t,n,a,l,s){let u=this.type,m=this.getDefault(),p=this.typeOptions,y=e.type,I=e.default,b=e.typeOptions;this._type=y,this._default=I,this._typeOptions=b;let C=u!==y,E=!H.default(m,I),v=!H.default(p,b),w=this.id;for(let[U,Q]of B(t))this.getParentTable().replaceCellValueFromServer(U,w,Q,a,l,{isForColumnConfigUpdate:s});for(let[U,Q]of B(n)){let X=this.getParentTable().getRowTemplateIfExists(U);X&&X.updateCellObject(w,Q,{fromServer:!0,isForColumnChange:!0})}(C||v)&&(this.getParentTable().onColumnTypeOrTypeOptionsChange(w,u,y),this._triggerTypeOrTypeOptionsChange(y,b),this.getParentTable().triggerColumnTypeOrTypeOptionsChanged(this)),E&&this._triggerDefaultChange(I)}setLockFromUser(e){H.default(e,this.lock)||(this._lock=e,this._triggerLockChange(e),this.getParentTable().triggerColumnLockChanged(this),this.syncCrudAction("updateLock",{lock:e}))}setLockFromServer(e){this._lock=e,this._triggerLockChange(e),this.getParentTable().triggerColumnLockChanged(this)}setInitialCreatedByUserIdFromServer(e){this._initialCreatedByUserId.set(e)}setInitialCreatedTimeFromServer(e){this._initialCreatedTime.set(e)}setInitialTypeOptionsFromServer(e){let t=!H.default(this._typeOptions,e);if(this._typeOptions=e,t){let n=this.type;this.getParentTable().onColumnTypeOrTypeOptionsChange(this.id,n,n),this._triggerTypeOrTypeOptionsChange(n,e),this.getParentTable().triggerColumnTypeOrTypeOptionsChanged(this)}}setLastModifiedByUserIdFromServer(e){this._lastModifiedByUserId.set(e)}setLastModifiedTimeFromServer(e){this._lastModifiedTime.set(e)}canCurrentUserEditNameLive(){return this.getParentTable().getParentApplication().canCurrentUserEditSchema()&&ee.canEditName(this.getLockLive(),Qe(),this.getParentTable().getParentApplication().getCurrentUserPermissionLevelInContext())}canCurrentUserEditDescriptionLive(){return this.getParentTable().getParentApplication().canCurrentUserEditSchema()&&ee.canEditDescription(this.getLockLive(),Qe(),this.getParentTable().getParentApplication().getCurrentUserPermissionLevelInContext())}setNameFromUser(e,{integrationId:t=null,blockId:n=null,onPassValidation:a=ne.default,onFailValidation:l=ne.default,silent:s=!1,sync:u=!0}={}){if(e!==this.name){let m=e.trim(),p=this.validateName(m);return p.pass?(this._name=m,s||this._triggerNameChange(m),u&&this.syncCrudAction("updateName",{name:m},{integrationId:t,blockId:n}),a(),!0):(l(p.error),!1)}else return a(),!0}validateName(e){return this.name.trim().toLowerCase()!==e.trim().toLowerCase()?this.getParentTable().validateNewColumnName(e):{pass:!0}}suggestColumnTypeFromName(e){return Ya({isPrimaryColumn:this.isPrimaryColumn(),name:e,type:this.type,typeOptions:this.typeOptions,appInterface:this.getParentTable().getParentApplication().getUserScopedAppInterface(),values:this.getParentTable().getLoadedCellValuesForColumn(this.id)})}canAnyUserEverUpdateCells(){return oe(()=>go(this))}getReasonForNonEditableCellsIfExists(e){return oe(()=>Co(this,e))}canCurrentUserUpdateCells(e){return oe(()=>Ql(this,e))}canCurrentUserUpdateCellsEvenInEditableShare(e){var n;let t=this.getParentTable().getParentApplication().getHyperbaseModel().getCurrentSessionShareObjIfExists();return t&&Mi(t)&&((n=t.metadata)!=null&&n.shouldAllowEditingRecords)?Vs(this,this.getParentTable().getQueryFromActiveViewOrDefaultView(),t,{isTwoWaySyncCollaboratorFieldEnabled:xa("twoWaySyncCollaboratorField",Gi(this.getParentTable().getParentApplication().id,"twoWaySyncCollaboratorField"))}):this.canCurrentUserUpdateCells()}getReasonIfSyncedColumnIsNonEditable(e){return oe(()=>Zl(this,e))}getReasonCodeIfSyncedColumnIsNonEditable(){return oe(()=>Qt(this))}getReasonCodeIfSyncedColumnIsNonEditableDueToColumnConfig(){return oe(()=>Eo(this))}isLockedToUpdateCellsFromCurrentUser(){let e=oe(()=>Jt(this));return this.getParentTable().getParentApplication().canCurrentUserEditData()&&this.canAnyUserEverUpdateCells()&&!e}canUpdateCellsInSharedViewBasedOnColumnLock(){let e=this.getParentTable().getParentApplication(),t=e.getCurrentSessionUserId(),n=e.getCurrentUserPermissionLevelInContext(),a=e.getCurrentUserGroupPermissionsInContext();return ee.canUpdateCells(this.lock,t,n,a,{sharedViewOrFormPrivilegesContext:"sharedView"})}async fetchPreviewForColumnConversionToSelectAsync(e){return await De.sequentialGetAsync("column",this.id,"fetchPreviewForColumnConversionToSelect",{newType:e},{applicationId:this.getParentTable().applicationId})}getInitialCreatedByUserIdLive(){return this._initialCreatedByUserId.live()}getLastModifiedByInfoLive(){return{lastModifiedByUserId:this._lastModifiedByUserId.live(),lastModifiedTime:this._lastModifiedTime.live()}}destroyFromServer(){this.destroy({fromServer:!0})}destroy(e={}){let t=this.id;this.getParentTable().onColumnDestroy(t),super.destroy(e)}destroyFromUserWithSchemaDependenciesCheck({checkForNonEmptyCellValues:e,onValidationFailure:t,onSuccess:n}){this.syncCrudAction("destroy",{checkSchemaDependencies:!0,checkForNonEmptyCellValues:e},{onError:a=>{var l;if(a.error&&a.error.type){if(a.error.type==="SCHEMA_DEPENDENCIES_VALIDATION_FAILED")return Jr(),(l=a.error.details)!=null&&l.applicationDependencyGraphEdgesBySourceObjectId&&this.getParentTable().getParentApplication().getCachedDependencyGraph().setDependencyGraph(new nr(a.error.details.applicationDependencyGraphEdgesBySourceObjectId)),t(a.error.type);if(a.error.type==="NON_EMPTY_CELL_VALUES")return Jr(),t(a.error.type)}return{wasErrorHandled:!1}},onSuccessfulResponseAndPushPayload:()=>{this.destroyFromServer(),n()}})}get tableId(){return this.getParentTable().id}get applicationId(){return this.getParentTable().getParentApplication().id}get name(){return this._name}get description(){return this._description}get type(){return this._type}get typeOptions(){return this._typeOptions}get defaultValue(){return this._default}get lock(){return this._lock}get initialCreatedTime(){return this._initialCreatedTime.getWithoutListening()}get initialCreatedByUserId(){return this._initialCreatedByUserId.getWithoutListening()}get lastModifiedTime(){return this._lastModifiedTime.getWithoutListening()}get lastModifiedByUserId(){return this._lastModifiedByUserId.getWithoutListening()}};Po._eventBindings=["pendingTypeOrTypeOptionsChange","pendingTypeOrTypeOptionsClear","typeOrTypeOptionsChange","defaultChange","nameChange","descriptionChange","lockChange"];function _A(i){let{type:r,typeOptions:e}=i;return r==="multiSelect"||r==="multiCollaborator"||r==="foreignKey"&&e.relationship==="many"}d();h();d();h();h();R();function ec(i,r){let e=[];if(r===null)return e;function t(n){for(let a=0;a<n.length;a++){let l=n[a];if(e.push(a),l.id===r||l.type==="nested"&&t(l.filterSet))return!0;e.pop()}return!1}return t(i.filterSet)?e:null}function z(i,r){let e=ec(i,r);return c.assert(e!==null,"filterId not found in tree",{filterId:r}),e}function ar(i){return"filterSet"in i}function ks(i){return"type"in i||"columnId"in i}function Mo(i){return!ks(i)}function Ks(i){let r=Ye.default(i.filterSet);if(r){let e=r;if(r.type==="nested"){let t=Ks(r);t&&(e=t)}return e}else return null}function NA(i){var e;if(!i)return null;let r=Ks(i);return(e=r==null?void 0:r.id)!=null?e:null}function tc(i){if(!i)return 0;let r=0;for(let e of i.filterSet)if(e.type==="nested"){let t=tc(e);t>r&&(r=t)}return r+1}function PA(i,r,e){if(!i)return!1;let t=z(i,e);if(r===null)return!0;let n=i.filterSet;for(let a of t.slice(0,t.length-1)){let l=n[a];if(c.assert((l==null?void 0:l.type)==="nested","expected every element of path to be a nested filter"),l.id===r)return!0;n=l.filterSet}return!1}function Ae(i,r){if(r.length===0)return i;let e=Ye.default(r),t=i.filterSet;for(let n of r.slice(0,r.length-1)){let a=t[n];c.assert((a==null?void 0:a.type)==="nested","expected every element of path to be a nested filter",{filterId:a==null?void 0:a.id}),t=a.filterSet}return t[e]}function Ws(i){var r;switch(i.type){case void 0:case"columnComparison":return 0;case"nested":{let e=i.filterSet.map(Ws);return((r=Ei(e))!=null?r:0)+1}default:throw new A(i)}}function Bo(i,r,e,t){for(let l of r){let s=Ws(l),u=e.length+1;if(s+u>On)return{pass:!1,error:`Filter conditions can only be nested ${On} levels deep`}}let n=i.filterSet;for(let l of e){let s=n[l];c.assert((s==null?void 0:s.type)==="nested"),n=s.filterSet}return n.length+r.length<=Fn?{pass:!0}:{pass:!1,error:`${e.length===0?"The top-level set of conditions":"This condition group"} can only have ${Fn} children`}}function Vo(i,r,e,t){return c.assert.isTrue(Bo(i,[r],e,t).pass),ht(i,n=>{let a=n.filterSet;for(let l of e){let s=a[l];c.assert((s==null?void 0:s.type)==="nested"),a=s.filterSet}a.splice(t!=null?t:a.length,0,r)})}function Hs(i,r,e,t=null){let n=z(i,e);return Bo(i,r,n,t)}function Uo(i,r,e,t=null){let n=z(i,e);return Vo(i,r,n,t)}function Ys(i,r,e){let t=z(i,e);c.assert(t.length>0);let n=Ye.default(t);return Vo(i,r,t.slice(0,t.length-1),n)}function Go(i,r,e){let t=z(i,e);c.assert(t.length>0);let n=Ye.default(t);return Vo(i,r,t.slice(0,t.length-1),n+1)}function jo(i,r){c.assert(r.length>0);let e=[],t=i;e.push(t.filterSet.length);for(let s of r.slice(0,r.length-1)){let u=t.filterSet[s];c.assert(ar(u)),t=u,e.push(t.filterSet.length)}let n=r.length-1,a=r.slice(0,n+1),l=a.pop();return ht(i,s=>{let u=Ae(s,a);c.assert(ar(u)),u.filterSet.splice(l,1)})}function Xs(i,r){let e=z(i,r);return jo(i,e)}function rc(i,r,e,t){let n=z(i,r),a=z(i,e),l=Ae(i,n);if(c.assert(ks(l)),l.type==="nested"&&a.length>=n.length){let s=!0;for(let u=0;u<n.length;u++)if(a[u]!==n[u]){s=!1;break}if(s)return{pass:!1,error:"Can\u02BCt move an expression to its own descendant"}}return H.default(n.slice(0,-1),a)?{pass:!0}:Bo(i,[l],a,t)}function zs(i,r,e,t){let n=z(i,r),a=Ae(i,n);c.assert(!Mo(a));let l=jo(i,n);return Uo(l,a,e,t)}function MA(i,r,e){let t=z(i,e),n=Ae(i,t.slice(0,t.length-1)),a=Mo(n)?null:n.id;return rc(i,r,a,Ye.default(t)+1)}function qs(i,r,e){let t=z(i,r),n=Ae(i,t);c.assert(!Mo(n));let a=jo(i,t);return Go(a,n,e)}function Js(i,r){if(!i)return"and";let e=z(i,r),t=Ae(i,e);return c.assert(ar(t)),t.conjunction}function Qs(i,r,e){let t=z(i,r);return ht(i,n=>{let a=Ae(n,t);c.assert(ar(a)),a.conjunction=e})}function rn(i,r,e){let t=z(i,r);c.assert(t.length>0);let n=t.pop();return ht(i,a=>{let l=Ae(a,t);c.assert(ar(l));let s=l.filterSet,u=s[n];c.assert((u==null?void 0:u.type)===void 0||u.type==="columnComparison"),s[n]=e(u)})}R();var it=class{constructor({filtersObj:r,parentTable:e,comparisonTable:t,getDefaultColumnIdForNewFilterObjs:n,onChangeFromUser:a,maxFilterCount:l,shouldAllowDynamicCurrentUser:s,shouldAllowEmptyDateModeValues:u,shouldAllowFilterComparisonToCellValue:m}){this._isInImmediateChange=!1;this._parentTable=e,this._comparisonTable=t!=null?t:null,this._filtersObj=new se(Tt(It.default(r))),this._isInImmediateChange=!1,this._getDefaultColumnIdForNewFilterObjs=n,this._onChangeFromUser=p=>{this._isInImmediateChange||a(p)},this._maxFilterCount=l!=null?l:Ar,this._shouldAllowDynamicCurrentUser=!!s,this._shouldAllowEmptyDateModeValues=!!u,this._shouldAllowFilterComparisonToCellValue=!!m}getParentTable(){return this._parentTable}getComparisonTable(){return this._comparisonTable}getFiltersObj(){let r=this._filtersObj.getWithoutListening();return It.default(r)}getFiltersObjLive(){let r=this._filtersObj.live();return It.default(r)}getMaxFilterCount(){return this._maxFilterCount}shouldAllowDynamicCurrentUser(){return this._shouldAllowDynamicCurrentUser}shouldAllowEmptyDateModeValues(){return this._shouldAllowEmptyDateModeValues}shouldAllowFilterComparisonToCellValue(){return this._shouldAllowFilterComparisonToCellValue}getFilterComparisonToCellValueOpts(){return this._shouldAllowFilterComparisonToCellValue?{shouldAllowFilterComparisonToCellValue:!0,comparisonTableModel:this._comparisonTable}:void 0}setOnChangeFromUser(r){this._onChangeFromUser=r}setGetDefaultColumnIdForNewFilterObjs(r){this._getDefaultColumnIdForNewFilterObjs=r}setImmediatelyFromRaw(r){this._filtersObj.set(Tt(It.default(r)))}setFromRaw(r){this._setFromUser(()=>r)}startImmediateChange(){this._isInImmediateChange=!0}endImmediateChange(){this._isInImmediateChange=!1}canAddNewEmptyFilterForColumns(r,e){return this._canAddNewEmptyFilterForColumns(this.getFiltersObj(),r,e)}canAddNewEmptyFilterForColumnsLive(r,e){return this._canAddNewEmptyFilterForColumns(this.getFiltersObjLive(),r,e)}_canAddNewEmptyFilterForColumns(r,e,t){let n=e.map(({columnId:a,filterId:l})=>this._getNewFilterObjForColumnId(a,l));return this._canInsert(n,t!=null?t:null,r)}canAddNewEmptyFilterForDefaultColumn({parentId:r}={parentId:null}){let e=this._getDefaultColumnIdForNewFilterObjs();return e?this.canAddNewEmptyFilterForColumns([{columnId:e}],r):{pass:!1,error:"Cannot filter on fields"}}canAddNewEmptyFilterForDefaultColumnLive({parentId:r}={parentId:null}){let e=this._getDefaultColumnIdForNewFilterObjs();return e?this.canAddNewEmptyFilterForColumnsLive([{columnId:e}],r):{pass:!1,error:"Cannot filter on fields"}}canAddNewEmptyGroup(r){return this._canAddNewEmptyGroup(this.getFiltersObj(),r)}canAddNewEmptyGroupLive(r){return this._canAddNewEmptyGroup(this.getFiltersObjLive(),r)}_canAddNewEmptyGroup(r,e){let t={id:c.id.generateFilterId(),type:"nested",conjunction:"and",filterSet:[]};return this._canInsert([t],e,r)}getFilterOperatorConfigs(r,e){let t=this._parentTable.getColumnById(r);return Sa(t.getTypeAndTypeOptions(),{shouldRequireSupportsFilterComparisonToCellValue:e==null?void 0:e.shouldRequireSupportsFilterComparisonToCellValue,disallowForeignKeyFilterComparisonValueType:this._getShouldDisallowForeignKeyFilterComparisonValueType(),disallowCollaboratorFilterComparisonValueType:this._getShouldDisallowCollaboratorFilterComparisonValueType()})}_getShouldDisallowForeignKeyFilterComparisonValueType(){return this._parentTable.getParentApplication().isPackageConstructionApplication()}_getShouldDisallowCollaboratorFilterComparisonValueType(){return!!(this._parentTable.getParentApplication().isPackageConstructionApplication()&&!this.shouldAllowDynamicCurrentUser())}addNewEmptyFilterForDefaultColumn({parentId:r}={parentId:null}){let e=this._getDefaultColumnIdForNewFilterObjs();c.assert(e!==void 0,"expected at least one column id");let t=this._getNewFilterObjForColumnId(e);return this.insertExpression(t,r),t.id}addNewEmptyFilterForColumn(r,e,t){let n=this._getNewFilterObjForColumnId(r,e);this.insertExpression(n,t!=null?t:null)}addNewEmptyFilterForColumns(r){this.startImmediateChange();for(let{columnId:e,filterId:t,parentId:n}of r)this.addNewEmptyFilterForColumn(e,t,n);this.endImmediateChange(),this._onChangeFromUser(this.getFiltersObj())}addNewEmptyFilterGroup(r,e,t){e||(e=Js(this.getFiltersObj(),r)==="and"?"or":"and");let n={id:t!=null?t:c.id.generateFilterId(),type:"nested",conjunction:e,filterSet:[]};return this.insertExpression(n,r),n.id}insertExpression(r,e,t=null){this._setFromUser(n=>n===null?(c.assert(e===null,"tried to insert into non-existant parent"),{filterSet:[r],conjunction:"and"}):Uo(n,r,e,t))}insertBefore(r,e){this._setFromUser(t=>(c.assert(t!==null,"tried to insert before a non-existant expression"),Ys(t,r,e)))}insertAfter(r,e){this._setFromUser(t=>(c.assert(t!==null,"tried to insert into after non-existant filter"),Go(t,r,e)))}removeExpression(r){this._setFromUser(e=>{c.assert(e!==null,"tried to remove non-existant filter");let t=Xs(e,r);return t.filterSet.length!==0?t:null})}moveExpression(r,e,t){this._setFromUser(n=>(c.assert(n!==null,"tried to move non-existant filter"),zs(n,r,e,t)))}moveAfter(r,e){this._setFromUser(t=>(c.assert(t!==null,"tried to move non-existant filter"),qs(t,r,e)))}updateConjunction(r,e){this._setFromUser(t=>(c.assert(t!==null,"tried to update non-existant filter"),Qs(t,r,e)))}updateFilterColumnAndOperator(r,e,t=!0){this._setFromUser(n=>(c.assert(n!==null,"tried to update non-existant filter"),rn(n,r,a=>{var C;let{columnId:l,operator:s,value:u}=a,m=(C=e.columnId)!=null?C:l,p;e.operator?p=e.operator:p=this._getDefaultOperatorForColumnId(m,s,t);let y=this._getComparisonValueType(m,p),I=e.filterValue;if(I===void 0){let E=this._getComparisonValueType(l,s),v=this._parentTable.getColumnById(m).getTypeAndTypeOptions(),w=D.shouldResetFilterValueOnUpdate({oldColumnId:l,oldComparisonValueType:E,oldValue:u,newColumnId:m,newColumnTypeAndTypeOptions:v,newOperator:p,newComparisonValueType:y}),U=this.shouldAllowFilterComparisonToCellValue()&&D.isFilterValueFromDynamicCellValue(u)&&this._doColumnAndOperatorSupportFilterComparisonToDynamicCellValue(m,p);I=w?this._getDefaultComparisonValue({columnId:m,operator:p,shouldNewFilterValueBeFromDynamicCellValue:U}):u}return f(T({},a),{columnId:m,operator:p,value:I,operatorOptions:void 0})})))}updateFilterValue(r,e){this._setFromUser(t=>(c.assert(t!==null,"tried to update non-existant filter"),rn(t,r,n=>f(T({},n),{value:e}))))}updateOperatorOptions(r,e){this._setFromUser(t=>(c.assert(t!==null,"tried to update non-existant filter"),rn(t,r,n=>f(T({},n),{operatorOptions:e}))))}clear(){this._setFromUser(()=>null)}clearInvalidFilters(){this._setFromUser(r=>r!==null?qr(r,this._parentTable,{shouldAllowDynamicCurrentUser:this._shouldAllowDynamicCurrentUser,shouldAllowEmptyDateModeValues:this._shouldAllowEmptyDateModeValues,filterComparisonToCellValueOpts:this.getFilterComparisonToCellValueOpts()}):r)}_canInsert(r,e,t,n=null){t||c.assert(e===null,"can only insert at top level if filtersObj is empty");let a=D.countFilterObjsReachableFromRootFiltersObj({conjunction:"and",filterSet:r}),l=D.countFilterObjsReachableFromRootFiltersObjIfExists(t);return a>0&&l>=this.getMaxFilterCount()?{pass:!1,error:"Already at the maximum number of filter conditions"}:l+a>=this.getMaxFilterCount()?{pass:!1,error:`Can only add ${Ri(this.getMaxFilterCount()-l,"condition")} before reaching the maximum number of filter conditions`}:Hs(t!=null?t:{conjunction:"and",filterSet:[]},r,e,n)}_setFromUser(r){let e=r(this.getFiltersObj());this.setImmediatelyFromRaw(e),this._onChangeFromUser(e)}_getNewFilterObjForColumnId(r,e){let t=this._getDefaultOperatorForColumnId(r),n=this._getDefaultComparisonValue({columnId:r,operator:t,shouldNewFilterValueBeFromDynamicCellValue:!1});return{id:e!=null?e:c.id.generateFilterId(),columnId:r,operator:t,value:n}}_getDefaultOperatorForColumnId(r,e,t){let n=this._parentTable.getColumnById(r),a=this.getFilterOperatorConfigs(r),l=Aa(n.getTypeAndTypeOptions(),e,t);if(!L(a,l)){let s=F(a)[0];return c.assert(s),s}return l}_getDefaultComparisonValue({columnId:r,operator:e,shouldNewFilterValueBeFromDynamicCellValue:t}){let n=this.getComparisonTable();if(t&&n)return{tableId:n.id,columnId:null,rowId:null};let a=this._parentTable.getColumnById(r);return Ra(e,a.getTypeAndTypeOptions())}_getComparisonValueType(r,e){let t=this._parentTable.getColumnById(r);return _a(e,t.getTypeAndTypeOptions())}_doColumnAndOperatorSupportFilterComparisonToDynamicCellValue(r,e){let t=this._parentTable.getColumnById(r);return D.doColumnAndOperatorSupportFilterComparisonToDynamicCellValue(t.getTypeAndTypeOptions(),e)}};R();var Ge=class extends Ze{constructor(e,t,n,a){var u;let l=e?e.id:null;super(l,t);let s=e?P(e,["conjunction","filterSet"]):null;if(this._filters=new it({filtersObj:s,parentTable:this.getParentQuery().getParentTable(),getDefaultColumnIdForNewFilterObjs:()=>this.getParentQuery().isDataLoaded()?this.getParentQuery().getFirstPreferablyVisibleColumnIdNotInError():void 0,onChangeFromUser:a?()=>a(this):()=>this._onFilterChangeFromUser(),maxFilterCount:wi}),this._color=(u=e==null?void 0:e.color)!=null?u:n(),!rr(this._filters.getFiltersObj(),this.getParentQuery().getParentTable())&&this.getParentQuery().isDataLoaded()){let m=t.getFirstPreferablyVisibleColumnIdNotInError();c.assert.isNotUndefined(m,"color config should only be constructed when there is a valid column id"),this._filters.startImmediateChange(),this._filters.addNewEmptyFilterForColumn(m),this._filters.endImmediateChange()}}_onFilterChangeFromUser(){rr(this._filters.getFiltersObj(),this.getParentQuery().getParentTable())?this.getParentQuery().afterColorConfigChangeFromUser():this.getParentQuery().removeColorDefinitionFromUser(this,{viaFilterDestroy:!0})}_generateModelId(){return c.id.generateColorDefinitionId()}getParentQuery(){return this.getParentModel()}getColor(){return this._color}setColor(e){this._color=e}isActive(){return Xr(this._filters.getFiltersObj(),this.getParentQuery().getParentTable())>0}getFilters(){return this._filters}getColumnIdIfMirroringASingleSelectColumn(){let e=this._filters.getFiltersObj(),t=Array.from(e?D.getAllFilterObjsReachableFromRootFiltersObj(e):[]);if(t.length!==1)return null;let n=t[0],a=this.getParentQuery().getParentTable().getColumnById(n.columnId);if(n.operator==="="&&ir(a,"select")){let l=a.typeOptions,s=n.value,u=s?l.choices[s].color:null;if(this._color===u)return a.id}return null}serialize(){var n;let e=(n=this._filters.getFiltersObj())!=null?n:{conjunction:"and",filterSet:[]};return f(T({},e),{id:this.id,color:this.getColor()})}};R();var lr=class{constructor(r,e,t){if(this._queryModel=e,r!==null)switch(this._type=r.type,r.type){case"selectColumn":this._selectColumnId=r.selectColumnId;break;case"colorDefinitions":this._defaultColor=r.defaultColor||null,this._setColorDefinitionsCollectionFromRaw(r.colorDefinitions,t?n=>!rr(n.getFilters().getFiltersObj(),e.getParentTable())&&(n.destroy(),this.getColorDefinitionsCollection().getLength()===0)?t(null):t(this):void 0);break;case"byDateColumnRange":break;default:throw new A(r)}}isActive(){let r=this.getType();return!!(r==="selectColumn"||r==="byDateColumnRange"||r==="colorDefinitions"&&(this.getColorDefinitionsCollection().getActiveColorDefinitionCount()>0||this.getDefaultColor()))}isDependentOnColumn(r){return ye.isColorConfigDependentOnColumn(this.serialize(),r)}isDependentOnAnyColumn(r){return ye.isColorConfigDependentOnAnyColumn(this.serialize(),r)}getSingleSelectColumnIdThatAllColorDefinitionsMirror(){return this._type!=="colorDefinitions"?null:this.getColorDefinitionsCollection().getSingleSelectColumnIdThatAllColorDefinitionsMirror()}_setColorDefinitionsCollectionFromRaw(r,e){let t=[];if(r)for(let n of r)this._validateRawColorDefinition(n),t.push(new Ge(n,this._queryModel,()=>this.getNextColorConditionDefaultColor(),e));else t.push(new Ge(null,this._queryModel,()=>this.getNextColorConditionDefaultColor(),e));this._colorDefinitionsCollection=new zr(t)}_validateRawColorDefinition(r){for(let e of D.getAllFilterObjsReachableFromRootFiltersObj(r))this._queryModel.validateRawFilter(e)}getColorDefinitionsCollection(){return c.assert(this._colorDefinitionsCollection),this._colorDefinitionsCollection}getColorDefinitionsCollectionIfExists(){return this._colorDefinitionsCollection}addColorDefinition(r){if(!this._colorDefinitionsCollection)this._setColorDefinitionsCollectionFromRaw(r?[r]:null);else{let e=this._colorDefinitionsCollection;r?(this._validateRawColorDefinition(r),e.add(new Ge(r,this._queryModel,()=>this.getNextColorConditionDefaultColor()))):e.add(new Ge(null,this._queryModel,()=>this.getNextColorConditionDefaultColor()))}}getColorsUsedByColorDefinitionsConfig(){return this.mapColorDefinitions(r=>r.getColor())}getNextColorConditionDefaultColor(){let r=As.getSelectColorOptions(this._queryModel.getParentApplication().getBillingPlan()),e=this.getColorsUsedByColorDefinitionsConfig();return ye.getNextColorDefaultColor(r,e)}getSelectColumnId(){return this._selectColumnId}setSelectColumnId(r){this._selectColumnId=r}getType(){return this._type}setType(r){this._type=r}getDefaultColor(){return this._defaultColor}setDefaultColor(r){this._defaultColor=r}mapColorDefinitions(r){let e=this._colorDefinitionsCollection;return e==null?[]:e.map(r)}clearSelectColumnId(){this._selectColumnId=null}clearColorDefinitions(){this._colorDefinitionsCollection=null}clearDefaultColor(){this._defaultColor=null}serialize(){let r=this.getColorDefinitionsCollectionIfExists();return{type:this.getType(),selectColumnId:this.getSelectColumnId(),colorDefinitions:r?r.serialize():null,defaultColor:this.getDefaultColor()}}};d();h();d();var nn=class extends Ze{constructor(e,t,n){super(e||null,n);this._columnId=t}getParentQuery(){return this.getParentModel()}getColumnId(){return this._columnId}setColumnId(e){this._columnId=e}getColumnModel(){return this.getParentQuery().getParentTable().getColumnById(this._columnId)}};R();var sr=class extends nn{constructor(e,t){let n,a,l,s="hidden",u={},m=!1;if(e===null){let p=t.getFirstAvailableGroupLevelColumn();c.assert(p,"Invalid group level column, maybe there were no more available columns?"),a=p.id,l="ascending"}else c.assert(e.columnId,"group level obj passed to GroupLevel must have a column id"),n=e.id,a=e.columnId,l=e.order,e.emptyGroupState!==void 0&&(s=e.emptyGroupState),e.shouldHideGroupCounts!==void 0&&(m=e.shouldHideGroupCounts),L(e,"groupingOptions")&&e.groupingOptions&&(u=e.groupingOptions);super(n,a,t);this._orderType=l,this._groupingOptions=u,this._emptyGroupState=s,this._shouldHideGroupCounts=m}_generateModelId(){return c.id.generateGroupLevelId()}getOrderType(){return this._orderType}setOrderType(e){this._orderType=e}getGroupingOptions(){return this._groupingOptions}shouldShowEmptyGroups(){return this._emptyGroupState==="shown"}setShouldShowEmptyGroups(e){this._emptyGroupState=e?"shown":"hidden"}getEmptyGroupState(){return this._emptyGroupState}shouldHideGroupCounts(){return this._shouldHideGroupCounts}};d();h();En();R();$();d();d();h();R();var te=class{constructor(r,e){this._rowOrColumn=r,this._idPropName=`${r}Id`,this._visibilityObjArray=e,this._initSupplementalDataStructuresBasedOnVisibilityObjArray()}_initSupplementalDataStructuresBasedOnVisibilityObjArray(){this._overallIndicesById={},this._visibleIds=[],this._visibleIndicesById={};let r=0;this._visibilityObjArray.forEach((e,t)=>{let n=e[this._idPropName];this._overallIndicesById[n]=t,e.visibility&&(this._visibleIds.push(n),this._visibleIndicesById[n]=r,r++)})}getOverallCount(){return this._visibilityObjArray.length}getVisibleCount(){return this._visibleIds.length}containsId(r){return L(this._overallIndicesById,r)}isIdVisible(r){return L(this._visibleIndicesById,r)}isEmptyGroup(){return this._visibleIds.length===0}getOverallIndexById(r){var e;return(e=this._overallIndicesById[r])!=null?e:null}getVisibleIndexById(r){var e;return(e=this._visibleIndicesById[r])!=null?e:null}getIdAtOverallIndex(r){return this._visibilityObjArray[r][this._idPropName]}getIdAtVisibleIndex(r){return c.assert.isNonNegativeInt(r),this._visibleIds[r]}getFirstVisibleId(){return this.getIdAtVisibleIndex(0)}getLastVisibleId(){if(this.getVisibleCount()!==0)return this.getIdAtVisibleIndex(this.getVisibleCount()-1)}getOverallGroupedIndexById(r){return this.getOverallIndexById(r)}getVisibleGroupedIndexById(r){return this.getVisibleIndexById(r)}getIdAtOverallGroupedIndex(r){return this.getIdAtOverallIndex(r)}getIdAtVisibleGroupedIndex(r){return this.getIdAtVisibleIndex(r)}getVisibleIdsGroupedForBlocks(){return null}getVisibleIdsGroupedRecursively(r=!0){return null}getSortedGroupedIdsRecursively(r){c.assert(!1,"FlatVisListBase does not implement group sorting")}recalculateCountsAndIndicesRecursive(){}eachId(r){for(let e of this._visibilityObjArray)r(e[this._idPropName])}eachVisibleId(r){for(let e of this._visibleIds)r(e)}eachHiddenId(r){for(let e of F(this._overallIndicesById))this.isIdVisible(e)||r(e)}eachVisibleIdInGroupedOrder(r){this.eachVisibleId(r)}getVisibleIds(){return pe.default(this._visibleIds)}addIdToEnd(r,e){this._addIdToEnd(r,e)}_addIdToEnd(r,e){let t=this._visibilityObjArray.length,n={[this._idPropName]:r,visibility:e};if(this._visibilityObjArray.push(n),this._overallIndicesById[r]=t,e){let a=this._visibleIds.length;this._visibleIds.push(r),this._visibleIndicesById[r]=a}}addIdsWithVisibilitiesToEnd(r){this._addIdsWithVisibilitiesToEnd(r)}_addIdsWithVisibilitiesToEnd(r){for(let e of r)this._addIdToEnd(e[this._idPropName],e.visibility)}addIdToTargetOverallIndex(r,e,t){c.assert.isNonNegativeInt(t),this._addIdToEnd(r,e),this.moveIdsToTargetOverallIndex([r],t)}removeMultipleIds(r){if(r.length===0)return;let e=ze.default(r,s=>this._overallIndicesById[s]),t,n,a;for(a=0,t=this._overallIndicesById[e[0]];t<this._visibilityObjArray.length;t++)n=this._visibilityObjArray[t][this._idPropName],a<e.length&&n===e[a]?(delete this._overallIndicesById[n],this._visibilityObjArray.splice(t,1),a++,t--):this._overallIndicesById[n]-=a;let l=e.filter(s=>L(this._visibleIndicesById,s));if(l.length>0)for(a=0,t=this._visibleIndicesById[l[0]];t<this._visibleIds.length;t++)n=this._visibleIds[t],a<l.length&&n===l[a]?(delete this._visibleIndicesById[n],this._visibleIds.splice(t,1),a++,t--):this._visibleIndicesById[n]-=a}moveIdsToTargetVisibleIndex(r,e){c.assert.isNonNegativeInt(e),e>this._visibleIds.length&&(e=this._visibleIds.length);let t;if(e===0)t=0;else{let n=this._visibleIds[e-1];t=this._overallIndicesById[n]+1}this.moveIdsToTargetOverallIndex(r,t)}moveIdsToTargetOverallIndex(r,e){c.assert.isNonNegativeInt(e),e>this._visibilityObjArray.length&&(e=this._visibilityObjArray.length);let t=ze.default(r,m=>this._overallIndicesById[m]),n=new Set(t),a=[];for(let m of this._visibilityObjArray){let p=m[this._idPropName];n.has(p)||a.push(p)}let l=0;for(let m=0;m<e;m++){let p=this._visibilityObjArray[m][this._idPropName];n.has(p)&&l++}let s=e-l,u=a;u.splice(s,0,...t),this.reorderIds(u)}moveIdsToMultiTargetOverallFinalIndices(r){let e=[];for(let a of this._visibilityObjArray){let l=a[this._idPropName];L(r,l)||e.push(l)}let t=ze.default(F(r),a=>r[a]),n=e;for(let a of t){let l=r[a];n.splice(l,0,a)}this.reorderIds(n)}reorderIds(r){c.assert(r.length===this._visibilityObjArray.length,"unexpected reorderedIds length");let e=hi(this._visibilityObjArray,t=>t[this._idPropName]);this._visibilityObjArray.length=0;for(let t of r){let n=e[t];n&&this._visibilityObjArray.push(n)}this._initSupplementalDataStructuresBasedOnVisibilityObjArray()}showIds(r){let e=!1;for(let t of r)if(!L(this._visibleIndicesById,t)){let n=this._overallIndicesById[t];this._visibilityObjArray[n].visibility=!0,e=!0}e&&this._initSupplementalDataStructuresBasedOnVisibilityObjArray()}hideIds(r){let e=!1;for(let t of r)if(L(this._visibleIndicesById,t)){let n=this._overallIndicesById[t];this._visibilityObjArray[n].visibility=!1,e=!0}e&&this._initSupplementalDataStructuresBasedOnVisibilityObjArray()}hideAll(){for(let r of this._visibilityObjArray)r.visibility=!1;this._visibleIds=[],this._visibleIndicesById={}}};var on=class extends te{constructor(r){super("column",r)}};var ur=class extends Bi{constructor(e){super();this._tableModel=e,this._isDataLoaded=!1,this._columnOrder=null,this._columnVisList=null,this._columnsAwaitingShowColumnFromServer=new Set,this.showColumnFromUser=this.showColumnFromUser.bind(this),this.showAllColumnsFromUser=this.showAllColumnsFromUser.bind(this),this.hideColumnFromUser=this.hideColumnFromUser.bind(this),this.hideAllColumnsFromUser=this.hideAllColumnsFromUser.bind(this)}isDataLoaded(){return this._isDataLoaded}isDataLoadedLive(){return M(this,"dataLoaded","dataUnloaded"),this.isDataLoaded()}loadDataFromRaw(e){c.assert(e.columnOrder),this._isDataLoaded=!0,this._setColumnOrderFromRaw(e.columnOrder),Ti(()=>this._triggerDataLoaded())}unloadData(){this._columnOrder=null,this._columnVisList=null,this._columnsAwaitingShowColumnFromServer.clear(),this._isDataLoaded=!1,this._triggerDataUnloaded()}loadColumnOrderFromRaw(e){this._setColumnOrderFromRaw(e)}getHyperbaseModel(){return this.getParentApplication().getHyperbaseModel()}getParentWorkspace(){return this.getParentApplication().getParentWorkspace()}getParentApplication(){return this.getParentTable().getParentApplication()}getParentApplicationId(){return this.getParentApplication().id}getParentTable(){return this._tableModel}getParentTableId(){return this.getParentTable().id}isTrackingRows(){return!1}_setColumnOrderFromRaw(e){let t=e.map(n=>P(n,"columnId","visibility"));this._columnOrder=t,this._columnVisList=new on(t)}_isColumnVisListLoaded(){return!!this._columnVisList}_getColumnVisList(){return c.assert(this._columnVisList,"Expected columnVisList to be loaded before calling accessors"),this._columnVisList}isColumnOrderLoaded(){return!!this._columnOrder}getRawColumnOrderForAndroid(){return he(this._columnOrder)}eachColumnId(e){this._getColumnVisList().eachId(t=>{e(t)})}eachColumn(e){let t=this.getParentTable();this._getColumnVisList().eachId(n=>{let a=t.getColumnById(n);e(a)})}getColumns(){return this.mapColumns(e=>e)}getColumnsLive(){return M(this.getParentTable(),"columnCreatedFromUser","columnCreatedFromServer","columnDestroyedFromUser","columnDestroyedFromServer"),this.getColumns()}getColumnIds(){return this.mapColumns(e=>e.id)}mapColumns(e){let t=this.getParentTable(),n=Array(this._getColumnVisList().getOverallCount()),a=0;return this._getColumnVisList().eachId(l=>{let s=t.getColumnById(l);n[a]=e(s,a),a++}),n}eachHiddenColumn(e){let t=this.getParentTable();this._getColumnVisList().eachId(n=>{if(!this.isColumnIdVisible(n)){let a=t.getColumnById(n);e(a)}})}eachVisibleColumn(e){let t=this.getParentTable();this._getColumnVisList().eachVisibleId(n=>{let a=t.getColumnById(n);e(a)})}eachVisibleOrPrimaryColumn(e){let t=this.getParentTable(),n=this._getColumnVisList();if(!n.getVisibleIds().includes(t.getPrimaryColumnId())){let a=t.getColumnById(t.getPrimaryColumnId());e(a)}n.eachVisibleId(a=>{let l=t.getColumnById(a);e(l)})}getVisibleColumns(){let e=this.getParentTable(),t=[];return this._getColumnVisList().eachVisibleId(n=>{let a=e.getColumnByIdIfExists(n);a&&t.push(a)}),t}getVisibleColumnsLive(){return M(this,"columnOrderUpdated"),this.getVisibleColumns()}getHiddenColumns(){let e=this.getParentTable(),t=[];return this._getColumnVisList().eachHiddenId(n=>{let a=e.getColumnById(n);t.push(a)}),t}getHiddenColumnsLive(){return M(this,"columnOrderUpdated"),this.getHiddenColumns()}getColumnsOfType(e){let t=[];return this.eachColumn(n=>{n.type===e&&t.push(n)}),t}getVisibleColumnIds(){return this._getColumnVisList().getVisibleIds()}getVisibleColumnIdsLive(){return M(this,"columnsShown","columnsHidden","columnOrderUpdated","columnsShownFromUser","allColumnsShownFromUser","allColumnsHiddenFromUser","visibleColumnsMovedFromUser","visibleColumnsMovedFromServer"),this.getVisibleColumnIds()}getHiddenColumnIds(){let e=[];return this._getColumnVisList().eachId(t=>{this.isColumnIdVisible(t)||e.push(t)}),e}getColumnAtVisibleIndex(e){let t=this._columnVisList.getIdAtVisibleIndex(e);return this.getParentTable().getColumnById(t)}getColumnIdAtVisibleIndex(e){return this._columnVisList.getIdAtVisibleIndex(e)}getColumnIdAtOverallIndex(e){return this._columnVisList.getIdAtOverallIndex(e)}getLastVisibleColumnId(){return this._columnVisList.getLastVisibleId()}getFirstPreferablyVisibleColumnIdNotInError(){let e,t=n=>{if(e)return;let a=this.getParentTable().getColumnByIdIfExists(n);!a||a.isFormulaicColumnInError()||(e=a.id)};return this._getColumnVisList().eachVisibleId(t),e===void 0&&this._getColumnVisList().eachHiddenId(t),e}getOverallColumnCount(){return this._columnVisList.getOverallCount()}getVisibleColumnCount(){return this._columnVisList.getVisibleCount()}getHiddenColumnCount(){return this.getOverallColumnCount()-this.getVisibleColumnCount()}getVisibleColumnIndex(e){return this.getVisibleColumnIndexById(e)}getVisibleColumnIndexById(e){return this._columnVisList.getVisibleIndexById(e)}getOverallColumnIndexById(e){return this._columnVisList.getOverallIndexById(e)}getVisibleColumnIdOnOrBeforeOverallIndex(e){c.assert(e>=0),c.assert(e<this.getOverallColumnCount()),c.assert(this._columnVisList);for(let t=e;t>=0;t--){let n=this._columnVisList.getIdAtOverallIndex(t);if(this._columnVisList.isIdVisible(n))return n}throw new x("View has no visible columns on or before overall index",{indexNumber:e})}isColumnIdVisible(e){return this._columnVisList.isIdVisible(e)}isColumnIdVisibleLive(e){return M(this,"columnsShown","columnsHidden","columnsShownFromUser","allColumnsShownFromUser","allColumnsHiddenFromUser"),this.isColumnIdVisible(e)}getAdjacentColumnId(e,t,{includeHiddenColumnsAtEnd:n}={}){if(n)if(this.isColumnIdVisible(t)){let l=this.getAdjacentColumnId(e,t,{includeHiddenColumnsAtEnd:!1});if(l)return l;if(e==="left")return!1;if(this.getHiddenColumnCount()>0){let s=0;for(;this.isColumnIdVisible(this.getColumnIdAtOverallIndex(s));)s++;return this.getColumnIdAtOverallIndex(s)}else return!1}else{let l=this.getOverallColumnIndexById(t),s;if(e==="left"){for(s=l-1;s>=0&&this.isColumnIdVisible(this.getColumnIdAtOverallIndex(s));)s--;if(s<0)if(this.getVisibleColumnCount()>0){let u=this.getVisibleColumnCount()-1;return this.getColumnIdAtVisibleIndex(u)}else return!1}else{let u=this.getOverallColumnCount()-1;for(s=l+1;s<=u&&this.isColumnIdVisible(this.getColumnIdAtOverallIndex(s));)s++;if(s>u)return!1}return this.getColumnIdAtOverallIndex(s)}else{let a=this.getVisibleColumnIndexById(t),l;if(e==="left"){if(l=a-1,l<0)return!1}else{l=a+1;let s=this.getVisibleColumnCount()-1;if(l>s)return!1}return this.getColumnIdAtVisibleIndex(l)}}getEligibleColorConfigSelectColumns(){let e=[];return this.eachColumn(t=>{ia(t.getTypeAndTypeOptions())&&e.push(t)}),e}getEligibleCalendarDateColumns(){let e=[];return this.eachColumn(t=>{Ie.isColumnEligibleForCalendar(t.serialize())&&e.push(t)}),e}canHidePrimaryColumn(){return!1}canShowComputedColumns(){return!0}canCurrentUserEditSchema(){return this.getParentApplication().canCurrentUserEditSchema()}canCurrentUserUpdateLayoutLocally(){return this.canCurrentUserUpdateLayoutPersistently()}couldCurrentUserUpdateConfigPersistentlyWithPermissionLevel(){return this.canCurrentUserUpdateConfigPersistently()}canCurrentUserUpdateConfigLocally(){return this.canCurrentUserUpdateConfigPersistently()}canCurrentUserEditRowOrder(){return!1}showColumnFromUser(e){this._triggerColumnsShownFromUser([e]);let t=this._canShowColumnsOptimistically([e]);this.canCurrentUserUpdateConfigPersistently()&&this._syncShowOrHideColumns({columnIds:[e],visibility:!0},{didExecuteOptimistically:t}),t?(this._getColumnVisList().showIds([e]),this._triggerColumnOrderUpdated(),this._triggerColumnsShown([e],{didOriginateFromOwnClient:!0})):this._columnsAwaitingShowColumnFromServer.add(e)}showColumnsFromServer(e,{didOriginateFromOwnClient:t}){for(let n of e)this._columnsAwaitingShowColumnFromServer.delete(n);this._getColumnVisList().showIds(e),this._triggerColumnOrderUpdated(),this._triggerColumnsShown(e,{didOriginateFromOwnClient:t})}isColumnAwaitingShowColumnFromServer(e){return this._columnsAwaitingShowColumnFromServer.has(e)}areAnyColumnsAwaitingShowColumnFromServer(){return this._columnsAwaitingShowColumnFromServer.size>0}hideColumnFromUser(e){this.hideColumnsFromUser([e])}hideColumnsFromUser(e){this._getColumnVisList().hideIds(e),this._triggerColumnOrderUpdated(),this.canCurrentUserUpdateConfigPersistently()&&this._syncShowOrHideColumns({columnIds:e,visibility:!1},{didExecuteOptimistically:!0}),this._triggerColumnsHidden(e,{didOriginateFromOwnClient:!0})}hideColumnsFromServer(e,{didOriginateFromOwnClient:t}){this._getColumnVisList().hideIds(e),this._triggerColumnOrderUpdated(),this._triggerColumnsHidden(e,{didOriginateFromOwnClient:t})}showAllColumnsFromUser(){let e=[];this.eachHiddenColumn(n=>{!this.canShowComputedColumns()&&n.isComputed()||e.push(n.id)});let t=this._canShowColumnsOptimistically(e);this.canCurrentUserUpdateConfigPersistently()&&this._syncShowOrHideAllColumns({visibility:!0},{didExecuteOptimistically:t}),t&&(this._getColumnVisList().showIds(e),this._triggerColumnOrderUpdated(),this._triggerAllColumnsShownFromUser())}hideAllColumnsFromUser(){this._getColumnVisList().hideAll(),this.canHidePrimaryColumn()||this._getColumnVisList().showIds([this._getColumnVisList().getIdAtOverallIndex(0)]),this._triggerColumnOrderUpdated(),this.canCurrentUserUpdateConfigPersistently()&&this._syncShowOrHideAllColumns({visibility:!1},{didExecuteOptimistically:!0}),this._triggerAllColumnsHiddenFromUser()}moveColumnsToVisibleIndexFromUser(e,t){e.some(a=>this.getVisibleColumnIndexById(a)!==t)&&(this._getColumnVisList().moveIdsToTargetVisibleIndex(e,t),this._triggerColumnOrderUpdated(),this._syncMoveVisibleColumns({columnIds:e,targetVisibleIndex:t}),this._triggerVisibleColumnsMovedFromUser())}moveColumnToOverallIndexFromUser(e,t){this.getOverallColumnIndexById(e)!==t&&(this._getColumnVisList().moveIdsToTargetOverallIndex([e],t),this._triggerColumnOrderUpdated(),this._syncMoveOverallColumns({columnIds:[e],targetOverallIndex:t}),this.isColumnIdVisible(e)&&this._triggerVisibleColumnsMovedFromUser())}moveColumnsFromServer(e){this._getColumnVisList().moveIdsToMultiTargetOverallFinalIndices(e),this._triggerColumnOrderUpdated(),ce(e).some(a=>this.isColumnIdVisible(a))&&this._triggerVisibleColumnsMovedFromServer()}createColumnAsClone(e,{activeViewId:t,shouldDuplicateCells:n,afterVisibleColumnIndex:a=null}){let l=a===null?null:this.getOverallColumnIndexById(this.getColumnIdAtVisibleIndex(a)),s=c.id.generateColumnId();De.sequentialPost("column",s,"createAsClone",{tableId:this.getParentTable().id,activeViewId:t,columnIdToClone:e.id,shouldDuplicateCells:n,afterOverallColumnIndex:l},{applicationId:this.getParentApplicationId()}),this._triggerColumnDuplicated(s)}insertNewColumnIfLoaded(e,{visibility:t,index:n}){if(!this._isColumnVisListLoaded())return;let a=e.id;n!==void 0?this._getColumnVisList().addIdToTargetOverallIndex(a,t,n):this._getColumnVisList().addIdToEnd(a,t),this._triggerColumnOrderUpdated()}onParentApplicationAppBlanketChange(){}onParentWorkspaceBillingPlanChange(){}onParentTableColumnTypeOrTypeOptionsChange(e){}onParentTableDestroyedColumn(e){this._getColumnVisList().removeMultipleIds([e]),this._triggerColumnOrderUpdated()}bindToVisibleColumnsMovedFromUserOrServer(e){this.bindToVisibleColumnsMovedFromUser(e),this.bindToVisibleColumnsMovedFromServer(e)}unbindFromVisibleColumnsMovedFromUserOrServer(e){this.unbindFromVisibleColumnsMovedFromUser(e),this.unbindFromVisibleColumnsMovedFromServer(e)}};ur._eventBindings=["dataLoaded","dataUnloaded","columnsShown","columnsHidden","columnsShownFromUser","allColumnsShownFromUser","allColumnsHiddenFromUser","columnOrderUpdated","visibleColumnsMovedFromUser","visibleColumnsMovedFromServer","columnDuplicated","columnWidthChanged"];d();R();var at=class extends Ze{constructor(e,t){var s;let n,a,l;if(e===null){let u=t.getFirstAvailableSortColumn();c.assert(u,"Invalid sort column, maybe there were no more available sort columns?"),a=u.id,l=!0}else n=e.id,a=e.columnId,l=(s=e.ascending)!=null?s:!0;super(n!=null?n:null,t);this._columnId=a,this._isAscending=l}_generateModelId(){return c.id.generateSortId()}getParentTable(){return this.getParentModel().getParentTable()}getColumnId(){return this._columnId}setColumnId(e){this._columnId=e}getColumnModel(){return this.getParentModel().getParentTable().getColumnById(this._columnId)}isAscending(){return this._isAscending}setIsAscending(e){this._isAscending=e}};d();h();h();R();ai();function oO(i,r,e){let t={},n=i[r];c.assert(n&&n.isExternal&&ct(n.email));let a=hn(n.email);for(let[l,s]of B(i))(!s.isExternal||s.id===r)&&(t[l]=s),s.isExternal&&ct(s.email)&&hn(s.email)===a&&!e(s.email)&&(t[l]=s);return t}function an({type:i,typeOptions:r}){switch(i){case"multilineText":case"richText":return!0;case"collaborator":case"multiCollaborator":return!0;case"formula":case"rollup":case"count":case"lookup":case"button":{let e=ta(r);return an({type:e,typeOptions:r})}case"computation":{let e=Pe(r);return an(e)}case"text":case"number":case"multiSelect":case"select":case"foreignKey":case"date":case"phone":case"multipleAttachment":case"checkbox":case"autoNumber":case"barcode":case"rating":case"asyncText":case"manualSort":return!1;default:throw new A(i)}}me();d();h();d();d();h();h();d();R();$();d();R();$();Ou();var ln="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",dr=62,lt=new Uint8Array(128),pr=255;c.assert.strictEqual(ln.length,dr);lt.fill(pr);for(let i=0;i<dr;i++){let r=ln.charCodeAt(i);c.assert.strictEqual(lt[r],pr),lt[r]=i}var ae=br.OBJECT_ID_LENGTH,oc=new RegExp("^___"+br.OBJECT_ID_SUFFIX_PATTERN+"$"),ko=95,$s=new Array(ae),Ko=class{constructor(r){let e=r;if(e.length!==ae)throw new x(`offsetString: expecting length=${ae}, got length={actualCount}`,{actualCount:e.length});let t=new Array(ae);for(let n=3;n<ae;n++){let a=lt[e.charCodeAt(n)];if(a===pr)throw new x("offsetString: non-base-62 character at {indexNumber}",{indexNumber:n});t[n]=a}this._offsetStringDigitValues=t}clone(r){if(r.length!==ae)throw new x(`objectId: expecting length=${ae}, got length={actualCount}`,{actualCount:r.length});let e=r.substring(0,3);if(e==="usr"||e==="ugp"||e==="inv"||e==="att"||e==="sel"||e==="cmk")return r;let t=$s;t[0]=r.charCodeAt(0),t[1]=r.charCodeAt(1),t[2]=r.charCodeAt(2);let n=this._offsetStringDigitValues;for(let a=3;a<ae;a++){let l=r.charCodeAt(a),s=lt[l];if(s===pr)throw new x("objectId: non-base-62 character at {indexNumber}",{indexNumber:a});let u=(s+n[a])%dr;t[a]=ln.charCodeAt(u)}return String.fromCharCode.apply(null,t)}subtract(r){if(r.length!==ae)throw new x(`objectId: expecting length=${ae}, got length={actualCount}`,{actualCount:r.length});let e=$s;e[0]=ko,e[1]=ko,e[2]=ko;let t=this._offsetStringDigitValues;for(let n=3;n<ae;n++){let a=r.charCodeAt(n),l=lt[a];if(l===pr)throw new x("objectId: non-base-62 character at {indexNumber}",{indexNumber:n});let s=(l-t[n]+dr)%dr;e[n]=ln.charCodeAt(s)}return String.fromCharCode.apply(null,e)}static generateEntropyString(){return br.generateObjectId("___")}static assertValidEntropyString(r){return c.assert(oc.test(r)),r}},eu=Ko;var Wo=class i extends Lr{constructor({columnsById:e,appInterface:t,cellValueAccessorForSortOrGroupByColumnProvider:n,sorts:a,sorterCache:l}){var p;let s=P(t,["doesCollaboratorExist","getApplicationId","getForeignRowDisplayNameProvider"]);super(e,s,n);this._sorterCache=l!=null?l:null;let u=[];this._primarySort=null,this._appInterface=t,a&&(fe(u,a),u.length>0&&((p=u==null?void 0:u[0])!=null&&p.columnId)&&(this._primarySort=u[0])),u.length>0&&(u.some(y=>y.rowMetadataKey==="createdTime")||u.push({rowMetadataKey:"createdTime",ascending:!0}),u.some(y=>y.rowMetadataKey==="tiebreaker")||u.push({rowMetadataKey:"tiebreaker",ascending:!0})),this._comparisonContextsByKey={};for(let y of u)y.rowMetadataKey?this._comparisonContextsByKey[y.rowMetadataKey]={tiebreakerCache:new Map}:(this._comparisonContextsByKey[y.columnId]={},this._sorterCache!==null&&(this._comparisonContextsByKey[y.columnId].comparisonCache=this._sorterCache.getOrCreateComparisonCacheForColumn(y.columnId)));this._objectIdCloner=null;let m=this._appInterface.getSortTiebreakerKey();m!==null&&(this._objectIdCloner=new eu(m)),this._sortFunctions=u.map(y=>this._makeSortFunctionFromSortObj(y))}_makeSortFunctionFromSortObj(e){let t=e.ascending?1:-1;if(e.rowMetadataKey){let n=this._comparisonContextsByKey[e.rowMetadataKey];switch(e.rowMetadataKey){case"createdTime":return(a,l)=>t*i.compareRowsByCreatedTime(this._getRowCreatedTime(a),this._getRowCreatedTime(l));case"tiebreaker":return(a,l)=>t*this._compareRowsByTiebreaker(a,l,n);default:throw new A(e)}}else{let n=e.columnId,a=this._getColumnTypeAndTypeOptionsById(n);if(ic(a.type)&&this._sorterCache!==null){let u=this._sorterCache.getCachedPrimarySortResult(n);if(u!==null){let m=e.ascending!==u.isSortOrderAscending();return(p,y)=>{let I=u.getRankAfterPrimarySort(p),b=u.getRankAfterPrimarySort(y),C=I-b;return m?-C:C}}}let l=this._comparisonContextsByKey[n],s=this._getCellValueAccessorForSortOrGroupByColumn(n);return(u,m)=>{let p=s(u),y=s(m);return t*je({cellValueA:p,cellValueB:y,type:a.type,typeOptions:a.typeOptions},this._appInterface,l,u,m)}}}performPrimarySortAndStoreInSorterCache(e){if(e.length!==0&&(c.assert(this._sorterCache!==null,"This method may only be used if a sorterCache is provided."),this._primarySort!==null&&this._sorterCache.getCachedPrimarySortResult(this._primarySort.columnId)===null)){let t=e.slice();this._performPrimarySort(t)}}_performPrimarySort(e){c.assert(this._primarySort!==null,"The primary sort must be a SortObjWithOptionalId.");let t=this._sortFunctions[0].bind(this);e.sort(t);let n=0,a=0,l=[],s=this._getPrimarySortResultObjBuilder();s.setRankAfterPrimarySort(e[0],a);for(let m=1;m<e.length;m++)t(e[n],e[m])!==0&&(a++,m>n+1&&l.push([n,m]),n=m),s.setRankAfterPrimarySort(e[m],a);e.length>n+1&&l.push([n,e.length]);let u=s.getPrimarySortResultObj(e,l,this._primarySort.ascending);return this._sorterCache!==null&&this._sorterCache.setPrimarySortResult(this._primarySort.columnId,u),u}sortRows(e){if(this._sortFunctions.length===0)return e.slice();let t;if(this._primarySort===null)t=e.slice(),t.sort(this.compareRowsForSort.bind(this));else{let n=null;this._sorterCache!==null&&(n=this._sorterCache.getCachedPrimarySortResult(this._primarySort.columnId));let a=!1;if(n)a=this._primarySort.ascending!==n.isSortOrderAscending();else{let s=e.slice();if(s.length===0)return[];n=this._performPrimarySort(s)}let l=n.getRowIdsArrayAfterPrimarySort();if(a&&(l=l.slice().reverse()),n.getRunsInRowsArrayAfterPrimarySort().length>0){let s=n.getRunsInRowsArrayAfterPrimarySort();a&&(s=s.slice().reverse().map(([m,p])=>[l.length-p,l.length-m])),t=[];let u=0;for(let[m,p]of s)u<m&&fe(t,l.slice(u,m)),fe(t,l.slice(m,p).sort(this._compareRowsForSortWithoutPrimary.bind(this))),u=p;u<l.length&&fe(t,l.slice(u,l.length)),c.assert.strictEqual(l.length,t.length)}else c.assert.strictEqual(n.getRankAfterPrimarySort(l[l.length-1]),a?0:l.length-1),t=l.slice()}return t}getSortedIndexOfUnsortedRowInOtherwiseSortedArray(e,t,n,a){if(this._sortFunctions.length===0)return a;let l=e-1,s=p=>t(p<a?p:p+1),u=0,m=l;for(;u<m;){let p=u+Math.floor((m-u)/2);this.compareRowsForSort(n,s(p))<=0?m=p:u=p+1}return u}compareRowsForSort(e,t){for(let n of this._sortFunctions){let a=n(e,t);if(a!==0)return a}return 0}_compareRowsForSortWithoutPrimary(e,t){for(let n=1;n<this._sortFunctions.length;n++){let a=this._sortFunctions[n](e,t);if(a!==0)return a}return 0}static compareRowsByCreatedTime(e,t){return e<t?-1:e>t?1:0}_compareRowsByTiebreaker(e,t,n){let a=this._getTiebreakerForRow(e,n),l=this._getTiebreakerForRow(t,n);return a<l?-1:1}},Ho=class extends Wo{constructor({rowAndCellDataProvider:e,columnsById:t,sorts:n,appInterface:a,sorterCache:l}){super({columnsById:t,appInterface:a,cellValueAccessorForSortOrGroupByColumnProvider:s=>u=>e.getCellValue(u,s),sorts:n,sorterCache:l});this._rowAndCellDataProvider=e}_getRowCreatedTime(e){return this._rowAndCellDataProvider.getRowCreatedTime(e)}_getTiebreakerForRow(e,t){c.assert(t.tiebreakerCache!==void 0);let n=t.tiebreakerCache.get(e);if(n===void 0){let a=this._objectIdCloner;n=a!==null?a.subtract(e):e,t.tiebreakerCache.set(e,n)}return n}_getPrimarySortResultObjBuilder(){let e=new Map;return{setRankAfterPrimarySort:(t,n)=>{e.set(t,n)},getPrimarySortResultObj:(t,n,a)=>({getRunsInRowsArrayAfterPrimarySort:()=>n,getRankAfterPrimarySort:l=>{let s=e.get(l);return c.assert(s!==void 0),s},getRowIdsArrayAfterPrimarySort:()=>t,isSortOrderAscending:()=>a})}}};function ic(i){return!(i==="number"||i==="checkbox")}function je({cellValueA:i,cellValueB:r,type:e,typeOptions:t},n,a,l=null,s=null){if(e==="checkbox")return iu({cellValueA:i,cellValueB:r,type:e,typeOptions:t});if(e==="computation"){let u=Pe(t);return je({cellValueA:i,cellValueB:r,type:u.type,typeOptions:u.typeOptions},n,a,l,s)}return i===null&&r===null?0:i===null?-1:r===null?1:Y({cellValueA:i,cellValueB:r,type:e,typeOptions:t},n,a,l,s)}function Y({cellValueA:i,cellValueB:r,type:e,typeOptions:t},n,a,l=null,s=null){switch(e){case"text":case"multilineText":case"phone":return Se(i,r,"naturalSortTiebreakOnCase");case"number":return i-r;case"multiSelect":{let{valueA:u,valueB:m}=sn(a,l,s,()=>Te({cellValue:i,type:e,typeOptions:t},n,a),()=>Te({cellValue:r,type:e,typeOptions:t},n,a),"multi_select_column");return Se(u,m,"caseInsensitiveNaturalSort")}case"select":{let u=Gn(i,t,a),m=Gn(r,t,a);return u-m}case"foreignKey":return Yo({cellValueA:i,cellValueB:r,type:e,typeOptions:t},n,a,{shouldCheckTypeOptionsForReversing:!0});case"date":{let u=new Date(i),m=new Date(r);return u.getTime()-m.getTime()}case"multipleAttachment":{let u=Ct({cellValue:i,type:e,typeOptions:t},n),m=Ct({cellValue:r,type:e,typeOptions:t},n);return Y({cellValueA:u,cellValueB:m,type:"text",typeOptions:null},n,a,l,s)}case"checkbox":return iu({cellValueA:i,cellValueB:r,type:e,typeOptions:t});case"formula":{let u=re(i)?i[0]:i,m=re(r)?r[0]:r,p=Me.hasError(u),y=Me.hasError(m);if(p&&y)return Y({cellValueA:u.error,cellValueB:m.error,type:"text",typeOptions:null},n,a,l,s);if(p)return-1;if(y)return 1;let I=t.resultType;if(I==="text")return tu(i,r);if(I==="number")return nu(i,r,n,a);if(I==="date")return ou(i,r,n,a);if(I==="select")return ac(i,r,n,t,a);throw new x("The formulas should produce either text or numeric values")}case"rollup":{let u=Array.isArray(i)?i[0]:i,m=Array.isArray(r)?r[0]:r,p=!Array.isArray(u)&&u instanceof Object&&u.error,y=!Array.isArray(m)&&m instanceof Object&&m.error;if(p&&y)return Y({cellValueA:p,cellValueB:y,type:"text",typeOptions:null},n,a,l,s);if(p)return-1;if(y)return 1;let I=t.resultType;if(I==="text")return tu(i,r);if(I==="number")return nu(i,r,n,a);if(I==="date")return ou(i,r,n,a);throw new x("The formulas should produce either text or numeric values")}case"count":return Y({cellValueA:i,cellValueB:r,type:"number",typeOptions:{format:"integer"}},n,a,l,s);case"lookup":{let u=Me.hasErrorOrSpecialValue(i),m=Me.hasErrorOrSpecialValue(r);return u||m?Number(u)-Number(m):Xo(()=>_n(xe(i?i.valuesByForeignRowId:{})),()=>_n(xe(r?r.valuesByForeignRowId:{})),t,n,a,l,s)}case"autoNumber":return Y({cellValueA:i,cellValueB:r,type:"number",typeOptions:{format:"integer"}},n,a,l,s);case"barcode":{let u=ft({cellValue:i,type:e,typeOptions:t},n),m=ft({cellValue:r,type:e,typeOptions:t},n);return Y({cellValueA:u,cellValueB:m,type:"text",typeOptions:t},n,a,l,s)}case"collaborator":{let u=bt.getIndexForUserOrInviteIdForSort(i,n.getUserInfoById(),a),m=bt.getIndexForUserOrInviteIdForSort(r,n.getUserInfoById(),a);return u-m}case"multiCollaborator":{let u=Te({cellValue:i.map(p=>p),type:e,typeOptions:t},n,a),m=Te({cellValue:r.map(p=>p),type:e,typeOptions:t},n,a);return Se(u,m,"caseInsensitiveNaturalSort")}case"rating":return Y({cellValueA:i,cellValueB:r,type:"number",typeOptions:{format:"integer"}},n,a,l,s);case"richText":{let{valueA:u,valueB:m}=sn(a,l,s,()=>Mn.convertDeltaDocumentToPlainTextWithoutBlockOrListFormatting(i.documentValue,n),()=>Mn.convertDeltaDocumentToPlainTextWithoutBlockOrListFormatting(r.documentValue,n),"rich_text_column");return Se(u,m,"naturalSortTiebreakOnCase")}case"button":return Y({cellValueA:i.label,cellValueB:r.label,type:"text",typeOptions:null},n,a,l,s);case"asyncText":return Se(ft({type:e,typeOptions:t,cellValue:i},n),ft({type:e,typeOptions:t,cellValue:r},n),"naturalSortTiebreakOnCase");case"manualSort":return i===r?0:i<r?-1:1;case"computation":{let u=Pe(t);return Y({cellValueA:i,cellValueB:r,type:u.type,typeOptions:u.typeOptions},n,a,l,s)}default:throw new A(e)}}function iu({cellValueA:i,cellValueB:r}){let e=!!i;return e===!!r?0:e?1:-1}function Yo({cellValueA:i,cellValueB:r,typeOptions:e},t,n,{shouldCheckTypeOptionsForReversing:a}){let l,s;return a?(l=Te({cellValue:i,type:"foreignKey",typeOptions:e},t,n),s=Te({cellValue:r,type:"foreignKey",typeOptions:e},t,n)):(l=Te({cellValue:i,type:"foreignKey",typeOptions:f(T({},e),{unreversed:!0})},t,n),s=Te({cellValue:r,type:"foreignKey",typeOptions:f(T({},e),{unreversed:!0})},t,n)),Se(l,s,"naturalSortTiebreakOnCase")}function tu(i,r){return re(i)&&(i=i.toString()),re(r)&&(r=r.toString()),Se(i,r,"naturalSortTiebreakOnCase")}var ru={NaN:-2,"-Infinity":-1,Infinity:1};function nu(i,r,e,t,n=null,a=null){re(i)&&(i=i[0]||0),re(r)&&(r=r[0]||0);let l=Me.hasSpecialValue(i),s=Me.hasSpecialValue(r);if(l||s){let u=l?ru[i.specialValue]:0,m=s?ru[r.specialValue]:0;return u-m}return Y({cellValueA:i,cellValueB:r,type:"number",typeOptions:null},e,t,n,a)}function ou(i,r,e,t,n=null,a=null){let l=re(i)?i[0]:i,s=re(r)?r[0]:r;return je({cellValueA:l!=null?l:null,cellValueB:s!=null?s:null,type:"date",typeOptions:null},e,t,n,a)}function ac(i,r,e,t,n,a=null,l=null){let s=re(i)?i[0]:i,u=re(r)?r[0]:r;return je({cellValueA:s,cellValueB:u,type:"select",typeOptions:t},e,n,a,l)}function Xo(i,r,e,t,n,a=null,l=null){let s=e.resultType;if(s==="number"||s==="date"){let u=()=>{let I=An.default(i(),Sn);return I.length?I[0]:null},m=()=>{let I=An.default(r(),Sn);return I.length?I[0]:null},{valueA:p,valueB:y}=sn(n,a,l,u,m,"lookup_column_number");return je({cellValueA:p,cellValueB:y,type:"formula",typeOptions:e},t,n,a,l)}else{let u=()=>kn(i(),e,t,{isForSort:!0,comparisonContext:n}),m=()=>kn(r(),e,t,{isForSort:!0,comparisonContext:n}),{valueA:p,valueB:y}=sn(n,a,l,u,m,"lookup_column_text"),I={resultType:"text"};return Y({cellValueA:p,cellValueB:y,type:"formula",typeOptions:I},t,n,a,l)}}function sn(i,r,e,t,n,a){let l=i.comparisonCache;if(l===void 0)return{valueA:t(),valueB:n()};let s=r===null?t():l.getCacheValueForRow(r,a,t),u=e===null?n():l.getCacheValueForRow(e,a,n);return{valueA:s,valueB:u}}var au=Ho;function zo(i,r,{type:e,typeOptions:t},n,a,l){if(e==="computation"){let s=Pe(t);return zo(i,r,s,n,a,l)}if(i===null&&r===null)return 0;if(i===null)return-1;if(r===null)return 1;if(a&&a.shouldUseRawCellValue)return Y({cellValueA:i,cellValueB:r,type:e,typeOptions:t},n,l);switch(e){case"foreignKey":return Yo({cellValueA:i,cellValueB:r,type:e,typeOptions:t},n,l,{shouldCheckTypeOptionsForReversing:!1});case"lookup":return a.shouldNormalizeToSingleValueOrNull?je({cellValueA:i,cellValueB:r,type:"formula",typeOptions:t},n,l):Xo(()=>i,()=>r,t,n,l);default:return Y({cellValueA:i,cellValueB:r,type:e,typeOptions:t},n,l)}}R();var qo=class i extends Lr{constructor({rowAndCellDataProvider:e,columnsById:t,groupLevels:n,appInterface:a}){let l=P(a,["doesCollaboratorExist","getApplicationId","getForeignRowDisplayNameProvider"]);super(t,l,u=>m=>e.getCellValue(m,u));this._rowAndCellDataProvider=e,this._groupLevels=n,this._appInterface=a}static getGroupPathForRowId(e,t,n,a,l){return new i({rowAndCellDataProvider:a,columnsById:n,groupLevels:t,appInterface:e}).getGroupPathsByRowId([l])[l]}getEmptyGroupKeysOverride(){return this._groupLevels.map(e=>{let t=e.columnId,n=e.emptyGroupState==="shown";if(t&&n){let a=this._getColumnTypeAndTypeOptionsById(t);return Zr(a)?[null,...Fs(a,this._appInterface).map(u=>jn({cellValue:u,type:a.type,typeOptions:a.typeOptions},this._appInterface,e.groupingOptions||{},this._createEmptyComparisonContexts()[t]))]:null}else return null})}getGroupPathsByRowId(e){let t=this._createEmptyComparisonContexts(),n={};for(let a of e)n[a]=this._getGroupPathForRowId(a,t);return n}getGroupKeyComparators(){let e=this._createEmptyComparisonContexts();return yt(this._groupLevels,n=>{let a,l,s;if(n.isCreatedTime)a="date",l=null,s=e.createdTime;else{let m=n.columnId,p=this._getColumnTypeAndTypeOptionsById(m);a=p.type,l=p.typeOptions,s=e[m],c.assert(s)}let u=n.groupingOptions||{};return(m,p)=>{let y=zo(m,p,{type:a,typeOptions:l},this._appInterface,u,s);return y!==0&&(y=n.order==="ascending"?y:-1*y),y}})}_getGroupPathForRowId(e,t){return yt(this._groupLevels,a=>{let l,s,u,m;if(a.isCreatedTime)l="date",s=null,u=t.createdTime,m=this._rowAndCellDataProvider.getRowCreatedTime(e);else{let I=a.columnId,b=this._getColumnTypeAndTypeOptionsById(I);l=b.type,s=b.typeOptions,u=t[I],c.assert(u),m=this._getCellValueAccessorForSortOrGroupByColumn(I)(e)}let p=a.groupingOptions||{};return jn({cellValue:m,type:l,typeOptions:s},this._appInterface,p,u)})}_createEmptyComparisonContexts(){let e={};return qe(this._groupLevels,function(t){t.isCreatedTime?e.createdTime={}:e[t.columnId]={}}),e}},un=qo;R();d();h();R();$();var cr=class{constructor(r){this._colorConfig=r}},Jo=class extends cr{canColorByRowId(){return!0}getColorByRowId(r,e,t,n,a){let l=this._colorConfig.selectColumnId,s=n[l];c.assert(s);let u=s.typeOptions,m={};for(let p of e){let y=t.getCellValue(p,l);y&&(m[p]=ua(y,u))}return m}},Qo=class extends cr{canColorByRowId(){return!0}getColorByRowId(r,e,t,n,a){let l={},s=G().utcOffset(0).toDate(),u=new Set(e);for(let m of this._colorConfig.colorDefinitions){let p=D.validateFilters(a,r,(b,C)=>{if(r!==b)throw new x("row coloring does not support filters that read from multiple tables");return n[C]},m,{isFilterIdOptional:!0,shouldAllowMissingUserIds:!0});p.isValid||c.assert.fail("getColorByRowId: filter validation failed",{tableId:r,reason:p.reason}),new et({filters:m,cellDataProvider:t,columnTypeAndTypeOptionsById:n,context:{getVirtualClockTime:()=>s},appInterface:a,shouldExcludeInactiveFilters:!1}).getFilteredRowIdsSet(u).forEach(b=>{l[b]=m.color,u.delete(b)})}if(this._colorConfig.defaultColor)for(let m of u)l[m]=this._colorConfig.defaultColor;return l}},Zo=class extends cr{canColorByRowId(){return!1}getColorByRowId(r,e,t,n,a){throw new x("should never be called, because `canColorByRowId` returns false")}};function lu(i){switch(i.type){case"selectColumn":return new Jo(i);case"colorDefinitions":return new Qo(i);case"byDateColumnRange":return new Zo(i);default:throw new A(i)}}d();var dn=class extends te{constructor(r){super("row",r)}};d();d();R();$();d();h();R();d();var st=class{constructor(r,e){this._parentVisList=r,this._groupKeyComparator=e,this._showEmptyGroups=!1}initSubLists(r,e,t){this._groupKeysById={};let n={},a={},l=this._parentVisList.getIdPropName(),s=this._parentVisList instanceof ke?this._parentVisList.getGroupKeysToAlwaysShowOverrides():null;this._showEmptyGroups=s!==null&&s[t]!==null,this._showEmptyGroups?this._overallGroupKeyOrder=pe.default(s[t]).sort(this._groupKeyComparator):this._overallGroupKeyOrder=this._initGroupKeysFromGroupPaths(e,t);for(let u of this._overallGroupKeyOrder){let m=this.getGroupKeyStringForGroupKey(u);n[m]=[],a[m]={}}for(let u of r){let m=u[l],p=e[m][t],y=this.getGroupKeyStringForGroupKey(p);n[y].push(u),a[y][m]=e[m],this._groupKeysById[m]=p}this._subListsByGroupKeyString={};for(let u=0;u<this._overallGroupKeyOrder.length;u++){let m=this._overallGroupKeyOrder[u],p=this.getGroupKeyStringForGroupKey(m),y=n[p],I=a[p];this._createSubListForGroupKey(m,y,I)}this.recalculateCountsAndIndices()}_initGroupKeysFromGroupPaths(r,e){let t=[],n=new Set;for(let a of xe(r)){let l=a[e],s=this.getGroupKeyStringForGroupKey(l);n.has(s)||(t.push(l),n.add(s))}return t.sort(this._groupKeyComparator)}getVisibleEndPointLeafGroupPath(r){let e=this._visibleGroupKeyOrder[r==="start"?0:this._visibleGroupKeyOrder.length-1];if(this._parentVisList.isLastGroupLevel())return[e];let t=this.getSubListForGroupKey(e);return c.assert.isNotUndefined(t),t.getVisibleEndPointLeafGroupPath(r)}getVisibleAdjacentGroupPath(r,e){let[t,...n]=e,a=this._visibleGroupKeyOrder.indexOf(t),l=r==="up"?0:this._visibleGroupKeyOrder.length-1,s=r==="up"?-1:1;if(this._parentVisList.isLastGroupLevel())return c.assert.strictEqual(n.length,0),a===l?null:[this._visibleGroupKeyOrder[a+s]];let u=this.getSubListForGroupKey(t);c.assert.isNotUndefined(u);let p=u.getVisibleAdjacentGroupPath(r,n);if(p===null){if(a===l)return null;let y=this._visibleGroupKeyOrder[a+s],b=this.getSubListForGroupKey(y);return[y,...b.getVisibleEndPointLeafGroupPath(r==="up"?"end":"start")]}return[t,...p]}recalculateCountsAndIndices(){let r=0,e=0;this._firstOverallGroupedIndicesByGroupKeyString={},this._firstVisibleGroupedIndicesByGroupKeyString={},this._visibleGroupKeyOrder=[];let t=this._overallGroupKeyOrder;for(let n=0;n<t.length;n++){let a=t[n],l=this.getGroupKeyStringForGroupKey(a),s=this.getSubListForGroupKey(a);c.assert.isNotUndefined(s);let u=s.getOverallCount(),m=s.getVisibleCount();if((this._showEmptyGroups||m>0)&&this._visibleGroupKeyOrder.push(a),this._showEmptyGroups||u>0)this._firstOverallGroupedIndicesByGroupKeyString[l]=r,this._firstVisibleGroupedIndicesByGroupKeyString[l]=e,r+=u,e+=m;else if(this._overallGroupKeyOrder=mi.default(this._overallGroupKeyOrder,a),delete this._subListsByGroupKeyString[l],this._deleteSubListForGroupKeyListeners)for(let p of this._deleteSubListForGroupKeyListeners)p(a)}if(c.assert(r===this._parentVisList.getOverallCount(),"overall count"),c.assert(e===this._parentVisList.getVisibleCount(),"visible count"),this._afterSubVisListManagerRecalculatedCountsAndIndicesListeners)for(let n of this._afterSubVisListManagerRecalculatedCountsAndIndicesListeners)n()}recalculateCountsAndIndicesRecursive(){for(let r=0;r<this._overallGroupKeyOrder.length;r++){let e=this._overallGroupKeyOrder[r],t=this.getSubListForGroupKey(e);c.assert.isNotUndefined(t),t.recalculateCountsAndIndicesRecursive()}this.recalculateCountsAndIndices()}_createSubListForGroupKey(r,e,t){let n=this._parentVisList.constructSubList(r,e,t),a=this.getGroupKeyStringForGroupKey(r);if(this._subListsByGroupKeyString[a]=n,this._createSubListForGroupKeyListeners)for(let l of this._createSubListForGroupKeyListeners)l(r,n);return n}bindToCreateSubListForGroupKey(r){this._createSubListForGroupKeyListeners||(this._createSubListForGroupKeyListeners=new Set),this._createSubListForGroupKeyListeners.add(r)}unbindFromCreateSubListForGroupKey(r){var e;(e=this._createSubListForGroupKeyListeners)==null||e.delete(r)}bindToDeleteSubListForGroupKey(r){this._deleteSubListForGroupKeyListeners||(this._deleteSubListForGroupKeyListeners=new Set),this._deleteSubListForGroupKeyListeners.add(r)}unbindFromDeleteSubListForGroupKey(r){var e;(e=this._deleteSubListForGroupKeyListeners)==null||e.delete(r)}bindToAfterSubVisListManagerRecalculatedCountsAndIndices(r){this._afterSubVisListManagerRecalculatedCountsAndIndicesListeners||(this._afterSubVisListManagerRecalculatedCountsAndIndicesListeners=new Set),this._afterSubVisListManagerRecalculatedCountsAndIndicesListeners.add(r)}unbindFromAfterSubVisListManagerRecalculatedCountsAndIndices(r){var e;(e=this._afterSubVisListManagerRecalculatedCountsAndIndicesListeners)==null||e.delete(r)}_findInsertionIndexInGroupKeyOrderForGroupKey(r){let e=0,t=this._overallGroupKeyOrder.length-1;for(;e<=t;){let n=e+t>>1,a=this._overallGroupKeyOrder[n];this._groupKeyComparator(r,a)>0?e=n+1:t=n-1}return e}_addGroupKey(r){let e=this._findInsertionIndexInGroupKeyOrderForGroupKey(r);this._overallGroupKeyOrder.splice(e,0,r)}getGroupKeys(){return pe.default(this._overallGroupKeyOrder)}isIdInPartialGroupPath(r,e){if(r.length===0)return this._parentVisList.containsId(e);{let[t,...n]=r,a=this.getSubListForGroupKey(t);if(a)return n.length===0?a.containsId(e):a.isIdInPartialGroupPath(n,e)}return!1}getOverallGroupedIndexById(r){if(!L(this._groupKeysById,r))return null;let e=this.getSubListForId(r).getOverallGroupedIndexById(r);if(e===null)return null;let t=this.getGroupKeyForId(r),n=this._getFirstOverallGroupedIndexForGroupKey(t);return e+n}getVisibleGroupedIndexById(r){if(!L(this._groupKeysById,r))return null;let e=this.getSubListForId(r).getVisibleGroupedIndexById(r);if(e===null)return null;let t=this.getGroupKeyForId(r),n=this._getFirstVisibleGroupedIndexForGroupKey(t);return e+n}getIdAtOverallGroupedIndex(r){let e=this.findGroupKeyContainingGroupedIndex(this._firstOverallGroupedIndicesByGroupKeyString,r,this._overallGroupKeyOrder),t=this._getFirstOverallGroupedIndexForGroupKey(e),n=this.getSubListForGroupKey(e);c.assert.isNotUndefined(n);let a=r-t;return n.getIdAtOverallGroupedIndex(a)}getIdAtVisibleGroupedIndex(r){let e=this.findGroupKeyContainingGroupedIndex(this._firstVisibleGroupedIndicesByGroupKeyString,r,this._visibleGroupKeyOrder),t=this._getFirstVisibleGroupedIndexForGroupKey(e),n=this.getSubListForGroupKey(e);c.assert.isNotUndefined(n);let a=r-t;return n.getIdAtVisibleGroupedIndex(a)}getGroupPathForId(r){if(!L(this._groupKeysById,r))return!1;let e=this._groupKeysById[r];if(this._parentVisList.isLastGroupLevel())return[e];{let t=this.getSubListForGroupKey(e);c.assert.isNotUndefined(t);let a=t.getGroupPathForId(r);return c.assert(a!==!1,"restOfGroups"),a.unshift(e),a}}getValueByTraversingPartialGroupPath(r,e,t){if(r.length===0)return e==="getGroupKeys"?(c.assert(mr(this._parentVisList)),this._parentVisList.getGroupKeys()):(c.assert.notStrictEqual(e,"getGroupKeys"),this._parentVisList[e]());{let[n,...a]=r,l=this.getSubListForGroupKey(n);return l?a.length===0?e==="getGroupKeys"?(c.assert(mr(l)),l.getGroupKeys()):(c.assert.notStrictEqual(e,"getGroupKeys"),l[e]()):(c.assert(mr(l)),l.getValueByTraversingPartialGroupPath(a,e,t)):t}}eachIdByTraversingPartialGroupPath(r,e,t){if(r.length===0)this._parentVisList[e](t);else{let[n,...a]=r,l=this.getSubListForGroupKey(n);l&&(a.length===0?l[e](t):(c.assert(mr(l)),l.eachIdByTraversingPartialGroupPath(a,e,t)))}}getGroupKeyForId(r){return this._groupKeysById[r]}getSubListForId(r){let e=this.getGroupKeyForId(r),t=this.getSubListForGroupKey(e);return c.assert.isNotUndefined(t),t}eachVisibleIdInGroupedOrder(r){for(let e=0;e<this._overallGroupKeyOrder.length;e++){let t=this._overallGroupKeyOrder[e],n=this.getSubListForGroupKey(t);c.assert.isNotUndefined(n),n.eachVisibleIdInGroupedOrder(r)}}getVisibleIdsInGroupedOrder(){let r=[];return this.eachVisibleIdInGroupedOrder(e=>{r.push(e)}),r}getVisibleIdsGroupedForBlocks(){return this.getVisibleIdsGroupedRecursively(!1)}getVisibleIdsGroupedRecursively(r=!0){let e=this._parentVisList.isLastGroupLevel();return this._overallGroupKeyOrder.map(n=>{let a=this.getSubListForGroupKey(n);c.assert.isNotUndefined(a);let l=r?{groupKey:n,hasChildVisibleRecords:a.getVisibleCount()>0}:{};if(e)return T({visibleRecordIds:a.getVisibleIds(),groups:null},l);let s=a.getVisibleIdsGroupedRecursively(r);return c.assert.isNotNull(s),T({visibleRecordIds:null,groups:s},l)})}getSortedGroupedIdsRecursively(r){let e=r.map(t=>{if(t.groups!==null){let n=this.getSubListForGroupKey(t.groupKey);n&&(t.groups=n.getSortedGroupedIdsRecursively(t.groups))}return t});return e.sort((t,n)=>this._groupKeyComparator(t.groupKey,n.groupKey)),e}getVisibleIdsInGroupedOrderInGroupKeyRange(r,e){let t=[],n=this._findInsertionIndexInGroupKeyOrderForGroupKey(r);for(let a=n;a<this._overallGroupKeyOrder.length;a++){let l=this._overallGroupKeyOrder[a];if(this._groupKeyComparator(e,l)<=0)break;let u=this.getSubListForGroupKey(l);c.assert.isNotUndefined(u),u.eachVisibleIdInGroupedOrder(m=>{t.push(m)})}return t}getVisibleIdsWithGroupKey(r){let e=this.getSubListForGroupKey(r);if(e){let t=[];return e.eachVisibleIdInGroupedOrder(n=>{t.push(n)}),t}else return[]}getVisibleCountWithGroupKey(r){let e=this.getSubListForGroupKey(r);return e?e.getVisibleCount():0}findGroupKeyContainingGroupedIndex(r,e,t){t||(t=this._overallGroupKeyOrder);let n=0,a=t.length-1;for(;n<a-1;){let u=n+a>>1,m=t[u];r[this.getGroupKeyStringForGroupKey(m)]<=e?n=u:a=u-1}if(n===a-1){let u=t[n+1];if(r[this.getGroupKeyStringForGroupKey(u)]<=e)return u}let l=t[n];if(r[this.getGroupKeyStringForGroupKey(l)]<=e)return l}_getOrCreateSubListForGroupKey(r){let e=this.getSubListForGroupKey(r);return e||(e=this._createSubListForGroupKey(r,[],{}),this._addGroupKey(r)),e}addIdsWithVisibilitiesToGroupAtEnd(r,e){c.assert.isNonEmptyArray(e);let[t,...n]=e,a=this._getOrCreateSubListForGroupKey(t);this._parentVisList.isLastGroupLevel()?a.addIdsWithVisibilitiesToEnd(r):a.addIdsWithVisibilitiesToGroupAtEnd(r,n);let l=this._parentVisList.getIdPropName();this._updateGroupKeyForIds(t,r.map(s=>s[l])),this.recalculateCountsAndIndices()}removeMultipleIds(r){this._eachSubListWithIds(r,(e,t)=>{e!==void 0&&e.removeMultipleIds(t)});for(let e=0;e<r.length;e++){let t=r[e];delete this._groupKeysById[t]}this.recalculateCountsAndIndices()}moveIdsToTargetVisibleIndex(r,e){this._eachSubListWithIds(r,(t,n)=>{this._refreshIdOrderInSublist(t)})}moveIdsToTargetOverallIndex(r,e){this._eachSubListWithIds(r,(t,n)=>{this._refreshIdOrderInSublist(t)})}moveIdsToMultiTargetOverallFinalIndices(r){let e=F(r);this._eachSubListWithIds(e,(t,n)=>{this._refreshIdOrderInSublist(t)})}reorderIds(r){let e=Object.values(this._subListsByGroupKeyString);for(let t=0;t<e.length;t++){let n=e[t];this._refreshIdOrderInSublist(n)}}refreshIdOrderInAllSublists(){let r=Object.values(this._subListsByGroupKeyString);for(let e=0;e<r.length;e++){let t=r[e];this._refreshIdOrderInSublist(t)}}refreshIdOrderInSublistsWithIds(r){this._eachSubListWithIds(r,(e,t)=>{this._refreshIdOrderInSublist(e)})}_refreshIdOrderInSublist(r){let e=[];r.eachId(n=>{e.push(n)});let t=ze.default(e,n=>this._parentVisList.getOverallIndexById(n));r.reorderIds(t)}showIds(r){this._eachSubListWithIds(r,(e,t)=>{e.showIds(t)}),this.recalculateCountsAndIndices()}hideIds(r){this._eachSubListWithIds(r,(e,t)=>{e.hideIds(t)}),this.recalculateCountsAndIndices()}hideAll(){let r=Object.values(this._subListsByGroupKeyString);for(let e=0;e<r.length;e++)r[e].hideAll();this.recalculateCountsAndIndices()}setGroupPathForIds(r,e){let[t,...n]=e,a=this._getOrCreateSubListForGroupKey(t);this._eachSubListWithIds(r,(l,s)=>{if(l===a)this._parentVisList.isLastGroupLevel()||a.setGroupPathForIds(s,n);else{let u=this._getVisibilityObjectsForIds(s);l.removeMultipleIds(s),this._parentVisList.isLastGroupLevel()?a.addIdsWithVisibilitiesToEnd(u):a.addIdsWithVisibilitiesToGroupAtEnd(u,n),this._refreshIdOrderInSublist(a)}}),this._updateGroupKeyForIds(t,r),this.recalculateCountsAndIndices()}_getVisibilityObjectsForIds(r){let e=this._parentVisList.getIdPropName();return r.map(n=>({[e]:n,visibility:this._parentVisList.isIdVisible(n)}))}_eachSubListWithIds(r,e){let t=hr(r,n=>{let a=this.getGroupKeyForId(n);return this.getGroupKeyStringForGroupKey(a)});for(let[n,a]of B(t)){let l=this._subListsByGroupKeyString[n];e(l,a)}}_updateGroupKeyForIds(r,e){for(let t=0;t<e.length;t++){let n=e[t];this._groupKeysById[n]=r}}getGroupKeyStringForGroupKey(r){return JSON.stringify(r)}getSubListForGroupKey(r){let e=this.getGroupKeyStringForGroupKey(r);return this._subListsByGroupKeyString[e]}_getFirstOverallGroupedIndexForGroupKey(r){let e=this.getGroupKeyStringForGroupKey(r);return this._firstOverallGroupedIndicesByGroupKeyString[e]}_getFirstVisibleGroupedIndexForGroupKey(r){let e=this.getGroupKeyStringForGroupKey(r);return this._firstVisibleGroupedIndicesByGroupKeyString[e]}};var ke=class i extends te{constructor(e,t,n,a,l,s){super(e,n);this._groupKeyComparators=t,this._groupKeysToAlwaysShowOverrides=l,this._depth=s||0;let u=t[this._depth];this._subListManager=new st(this,u),this._subListManager.initSubLists(n,a,this._depth)}recalculateCountsAndIndicesRecursive(){this._subListManager.recalculateCountsAndIndicesRecursive()}constructSubList(e,t,n){return this.isLastGroupLevel()?new te(this._rowOrColumn,t):new i(this._rowOrColumn,this._groupKeyComparators,t,n,this._groupKeysToAlwaysShowOverrides,this._depth+1)}isFirstGroupLevel(){return this._depth===0}isLastGroupLevel(){return this._depth+1>=this._groupKeyComparators.length}getDepth(){return this._depth}getGroupKeys(){return this._subListManager.getGroupKeys()}getGroupKeysToAlwaysShowOverrides(){return this._groupKeysToAlwaysShowOverrides}getGroupKeysForPartialGroupPath(e){return this.getValueByTraversingPartialGroupPath(e,"getGroupKeys",[])}getOverallCountForPartialGroupPath(e){return this.getValueByTraversingPartialGroupPath(e,"getOverallCount",0)}getVisibleCountForPartialGroupPath(e){return this.getValueByTraversingPartialGroupPath(e,"getVisibleCount",0)}eachIdInPartialGroupPath(e,t){return this.eachIdByTraversingPartialGroupPath(e,"eachId",t)}eachVisibleIdInPartialGroupPath(e,t){return this.eachIdByTraversingPartialGroupPath(e,"eachVisibleId",t)}getValueByTraversingPartialGroupPath(e,t,n){return this._subListManager.getValueByTraversingPartialGroupPath(e,t,n)}eachIdByTraversingPartialGroupPath(e,t,n){this._subListManager.eachIdByTraversingPartialGroupPath(e,t,n)}isIdInPartialGroupPath(e,t){return this._subListManager.isIdInPartialGroupPath(e,t)}getOverallGroupedIndexById(e){return this._subListManager.getOverallGroupedIndexById(e)}getVisibleGroupedIndexById(e){return this._subListManager.getVisibleGroupedIndexById(e)}getIdAtOverallGroupedIndex(e){if(c.assert.isNonNegativeInt(e),!(e>=this.getOverallCount()))return this._subListManager.getIdAtOverallGroupedIndex(e)}getVisibleEndPointLeafGroupPath(e){return this._subListManager.getVisibleEndPointLeafGroupPath(e)}getVisibleAdjacentGroupPath(e,t){return this._subListManager.getVisibleAdjacentGroupPath(e,t)}getIdAtVisibleGroupedIndex(e){if(c.assert.isNonNegativeInt(e),!(e>=this.getVisibleCount()))return this._subListManager.getIdAtVisibleGroupedIndex(e)}getVisibleIdsGroupedForBlocks(){return this._subListManager.getVisibleIdsGroupedForBlocks()}getVisibleIdsGroupedRecursively(e=!0){return this._subListManager.getVisibleIdsGroupedRecursively(e)}getSortedGroupedIdsRecursively(e){return this._subListManager.getSortedGroupedIdsRecursively(e)}getFirstVisibleIdInGroupPath(e){return this.getValueByTraversingPartialGroupPath(e,"getFirstVisibleId",void 0)}getLastVisibleIdInGroupPath(e){return this.getValueByTraversingPartialGroupPath(e,"getLastVisibleId",void 0)}isEmptyGroupForGroupPath(e){return this.getValueByTraversingPartialGroupPath(e,"isEmptyGroup",!1)}getGroupPathForId(e){return this._subListManager.getGroupPathForId(e)}eachVisibleIdInGroupedOrder(e){this._subListManager.eachVisibleIdInGroupedOrder(e)}getGroupKeyForId(e){return this._subListManager.getGroupKeyForId(e)}getGroupKeyStringForGroupKey(e){return this._subListManager.getGroupKeyStringForGroupKey(e)}findGroupKeyContainingGroupedIndex(e,t){return this._subListManager.findGroupKeyContainingGroupedIndex(e,t)}getSubListForGroupKey(e){let t=this._subListManager.getSubListForGroupKey(e);return c.assert.isNotUndefined(t),t}bindToCreateSubListForGroupKey(e){this._subListManager.bindToCreateSubListForGroupKey(e)}unbindFromCreateSubListForGroupKey(e){this._subListManager.unbindFromCreateSubListForGroupKey(e)}bindToDeleteSubListForGroupKey(e){this._subListManager.bindToDeleteSubListForGroupKey(e)}unbindFromDeleteSubListForGroupKey(e){this._subListManager.unbindFromDeleteSubListForGroupKey(e)}bindToAfterSubVisListManagerRecalculatedCountsAndIndices(e){this._subListManager.bindToAfterSubVisListManagerRecalculatedCountsAndIndices(e)}unbindFromAfterSubVisListManagerRecalculatedCountsAndIndices(e){this._subListManager.unbindFromAfterSubVisListManagerRecalculatedCountsAndIndices(e)}addIdToEnd(e,t){throw new x("GroupedVisList requires a groupPath for all add methods")}addIdsWithVisibilitiesToEnd(e){throw new x("GroupedVisList requires a groupPath for all add methods")}addIdToTargetOverallIndex(e,t,n){throw new x("GroupedVisList requires a groupPath for all add methods")}addIdToGroupAtEnd(e,t,n){let a={[this._idPropName]:e,visibility:t};this.addIdsWithVisibilitiesToGroupAtEnd([a],n)}addIdsWithVisibilitiesToGroupAtEnd(e,t){super.addIdsWithVisibilitiesToEnd(e),this._subListManager.addIdsWithVisibilitiesToGroupAtEnd(e,t)}addIdToGroupAtTargetOverallIndex(e,t,n,a){this.addIdToGroupAtEnd(e,t,n),this.moveIdsToTargetOverallIndex([e],a)}addMultipleIdsToGroupAtTargetOverallIndex(e,t,n){this.addIdsWithVisibilitiesToGroupAtEnd(e,t);let a=e.map(l=>l[this._idPropName]);this.moveIdsToTargetOverallIndex(a,n)}addIdToGroupAtTargetVisibleIndex(e,t,n,a){this.addIdToGroupAtEnd(e,t,n),this.moveIdsToTargetVisibleIndex([e],a)}addMultipleIdsToGroupAtTargetVisibleIndex(e,t,n){this.addIdsWithVisibilitiesToGroupAtEnd(e,t);let a=e.map(l=>l[this._idPropName]);this.moveIdsToTargetVisibleIndex(a,n)}removeMultipleIds(e){super.removeMultipleIds(e),this._subListManager.removeMultipleIds(e)}moveIdsToTargetVisibleIndex(e,t){super.moveIdsToTargetVisibleIndex(e,t),this._subListManager.moveIdsToTargetVisibleIndex(e,t)}moveIdsToTargetOverallIndex(e,t){super.moveIdsToTargetOverallIndex(e,t),this._subListManager.moveIdsToTargetOverallIndex(e,t)}moveIdsToMultiTargetOverallFinalIndices(e){super.moveIdsToMultiTargetOverallFinalIndices(e),this._subListManager.moveIdsToMultiTargetOverallFinalIndices(e)}reorderIds(e){super.reorderIds(e),this._subListManager.reorderIds(e)}showIds(e){super.showIds(e),this._subListManager.showIds(e)}hideIds(e){super.hideIds(e),this._subListManager.hideIds(e)}hideAll(){super.hideAll(),this._subListManager.hideAll()}setGroupPathForIds(e,t){this._subListManager.setGroupPathForIds(e,t)}getIdPropName(){return this._idPropName}};function mr(i){return i instanceof ke}var pn=class extends ke{constructor(r,e,t,n=null){super("row",r,e,t,n)}};d();d();$();var cn=class extends te{constructor(e,t,n,a){super(e,n);this._subListManagers=[];for(let l=0;l<t.length;l++){let s=t[l];this._subListManagers[l]=new st(this,s),this._subListManagers[l].initSubLists(n,a,l)}}constructSubList(e,t,n){return new te(this._rowOrColumn,t)}isLastGroupLevel(){return!0}getVisibleIdsInGroupedOrder(e){return e>=this._subListManagers.length?[]:this._subListManagers[e].getVisibleIdsInGroupedOrder()}getVisibleIdsInGroupedOrderInGroupKeyRange(e,t,n){return e>=this._subListManagers.length?[]:this._subListManagers[e].getVisibleIdsInGroupedOrderInGroupKeyRange(t,n)}getVisibleIdsWithGroupKey(e,t){return e>=this._subListManagers.length?[]:this._subListManagers[e].getVisibleIdsWithGroupKey(t)}getVisibleCountWithGroupKey(e,t){return e>=this._subListManagers.length?0:this._subListManagers[e].getVisibleCountWithGroupKey(t)}addIdToEnd(e,t){throw new x("MultipleIndexedVisList requires a groupPath for all add methods")}addIdsWithVisibilitiesToEnd(e){throw new x("MultipleIndexedVisList requires a groupPath for all add methods")}addIdToTargetOverallIndex(e,t,n){throw new x("MultipleIndexedVisList requires a groupPath for all add methods")}addIdToGroupAtEnd(e,t,n){let a={[this._idPropName]:e,visibility:t};this.addIdsWithVisibilitiesToGroupAtEnd([a],n)}addIdsWithVisibilitiesToGroupAtEnd(e,t){super.addIdsWithVisibilitiesToEnd(e);for(let n=0;n<this._subListManagers.length;n++){let a=t.slice(n);this._subListManagers[n].addIdsWithVisibilitiesToGroupAtEnd(e,a)}}addIdToGroupAtTargetOverallIndex(e,t,n,a){this.addIdToGroupAtEnd(e,t,n),this.moveIdsToTargetOverallIndex([e],a)}addMultipleIdsToGroupAtTargetOverallIndex(e,t,n){this.addIdsWithVisibilitiesToGroupAtEnd(e,t);let a=e.map(l=>l[this._idPropName]);this.moveIdsToTargetOverallIndex(a,n)}addIdToGroupAtTargetVisibleIndex(e,t,n,a){this.addIdToGroupAtEnd(e,t,n),this.moveIdsToTargetVisibleIndex([e],a)}addMultipleIdsToGroupAtTargetVisibleIndex(e,t,n){this.addIdsWithVisibilitiesToGroupAtEnd(e,t);let a=e.map(l=>l[this._idPropName]);this.moveIdsToTargetVisibleIndex(a,n)}removeMultipleIds(e){super.removeMultipleIds(e);for(let t=0;t<this._subListManagers.length;t++)this._subListManagers[t].removeMultipleIds(e)}moveIdsToTargetVisibleIndex(e,t){super.moveIdsToTargetVisibleIndex(e,t);for(let n=0;n<this._subListManagers.length;n++)this._subListManagers[n].moveIdsToTargetVisibleIndex(e,t)}moveIdsToTargetOverallIndex(e,t){super.moveIdsToTargetOverallIndex(e,t);for(let n=0;n<this._subListManagers.length;n++)this._subListManagers[n].moveIdsToTargetOverallIndex(e,t)}moveIdsToMultiTargetOverallFinalIndices(e){super.moveIdsToMultiTargetOverallFinalIndices(e);for(let t=0;t<this._subListManagers.length;t++)this._subListManagers[t].moveIdsToMultiTargetOverallFinalIndices(e)}reorderIds(e){super.reorderIds(e);for(let t=0;t<this._subListManagers.length;t++)this._subListManagers[t].reorderIds(e)}showIds(e){super.showIds(e);for(let t=0;t<this._subListManagers.length;t++)this._subListManagers[t].showIds(e)}hideIds(e){super.hideIds(e);for(let t=0;t<this._subListManagers.length;t++)this._subListManagers[t].hideIds(e)}hideAll(){super.hideAll();for(let e=0;e<this._subListManagers.length;e++)this._subListManagers[e].hideAll()}setGroupPathForIds(e,t){for(let n=0;n<this._subListManagers.length;n++){let a=t.slice(n);this._subListManagers[n].setGroupPathForIds(e,a)}}getGroupKeyForId(e,t){return!this.containsId(t)||e>=this._subListManagers.length?!1:this._subListManagers[e].getGroupKeyForId(t)}getGroupPathForId(e){return this.containsId(e)?this._subListManagers.map(n=>n.getGroupKeyForId(e)):!1}getIdPropName(){return this._idPropName}};var mn=class extends cn{constructor(r,e,t){super("row",r,e,t)}};var yr=class yr extends ur{constructor(e){super(e);this._rowOrder=null,this._rowVisList=null,this._groupLevelsCollection=null,this._shouldGroupsUseMultipleIndices=!1,this._filters=new it({filtersObj:null,parentTable:this.getParentTable(),onChangeFromUser:()=>this._afterFilterChangeFromUser(),getDefaultColumnIdForNewFilterObjs:()=>this.getFirstPreferablyVisibleColumnIdNotInError(),maxFilterCount:Ar}),this._sortsCollection=null,this._colorConfig=null,this._colorByRowId=null}isDataLoaded(){return!!this._rowOrder}loadDataFromRaw(e){var t;c.assert(e.rowOrder),this._shouldGroupsUseMultipleIndices=(t=e.shouldGroupsUseMultipleIndices)!=null?t:!1,super.loadDataFromRaw(e),this._setGroupLevelsCollectionFromRaw(e.groupLevels),this._setRowOrderFromRaw(e.rowOrder),this._setFiltersFromRaw(e.filters),this._setSortsCollectionFromRaw(e.lastSortsApplied),this._setColorConfigFromRaw(e.colorConfig),e.colorByRowId&&this._setColorByRowIdFromRaw(e.colorByRowId),this._triggerRowOrderInitialized()}loadFiltersFromRaw(e){this._setFiltersFromRaw(e)}unloadData(){this._groupLevelsCollection=null,this._rowOrder=null,this._rowVisList=null,this._filters.setImmediatelyFromRaw(null),this._sortsCollection=null,super.unloadData()}isTrackingRows(){return!0}_canShowColumnsOptimistically(e){return this.canCurrentUserUpdateConfigPersistently()?this.getParentTable().isSliceLoaded({rowIds:this.getVisibleRowIds(),columnIds:e}):!0}_columnIdsNeededToShowRowsOptimistically(){let e=new Set(this._getColumnIdsLoadedByViewTypeEvenWhenColumnIsHidden());return this.getColumns().filter(t=>tn(t.getId(),this,{includeHiddenColumnsUsedForColorization:!0,primaryColumnId:this.getParentTable().getPrimaryColumnId()})||e.has(t.id)).map(t=>t.id)}getAdjacentCellRowAndColumnId(e,t,n,{includeHiddenColumnsAtEnd:a=!1}={}){if(e==="right"||e==="left"){let l=this.getAdjacentColumnId(e,n,{includeHiddenColumnsAtEnd:a})||n;return{rowId:t,columnId:l}}else return{rowId:this.getAdjacentRowId(e,t)||t,columnId:n}}canCurrentUserEditRowOrder(){return this.canCurrentUserUpdateConfigPersistently()&&!this.isAutoSortActive()}canCurrentUserMoveRowsBetweenGroups(){return this.isGrouped()&&this.getParentApplication().canCurrentUserEditData()&&this.getGroupLevelsCollection().canCurrentUserUpdateCellsInAllGroupLevelColumns()}shouldAllowRowCreation(){return this.getParentTable().canCurrentUserCreateRows()}shouldAllowRowDeletion(){return this.getParentTable().canCurrentUserDestroyRows()}getRawOrderedRowIdsWithoutGrouping(){return this._getRawRowOrder().map(n=>n.rowId)}_getRawRowOrder(){return c.assert(this._rowOrder),this._rowOrder}_getRowVisList(){return c.assert(this._rowVisList),this._rowVisList}_getRowVisListIfExists(){return this._rowVisList}getRowVisListForGridView(){return this._getRowVisList()}getRowVisListForCalendarView(){return this._getRowVisList()}replaceRowVisListForCalendarView(){this._replaceRowVisList()}_setRowOrderFromRaw(e){this.getParentApplication().getHyperbaseModel().isCurrentSessionPublicSharedApplicationOrBlockInstallation()&&(e=e.filter(t=>this.getParentTable().hasRowId(t.rowId))),this._rowOrder=e,this._replaceRowVisList()}async readRowOrderForForeignKeyCustomizationAsync(){return this.isDataLoaded()?this._rowOrder:await this.readRowOrderForForeignKeyCustomizationWhenDataIsUnavailableAsync()}_replaceRowVisList(){if(this.isGrouped()){let e=this.getGroupAssigner(),t=this._getGroupPathsByRowId(e),n=e.getGroupKeyComparators(),a=e.getEmptyGroupKeysOverride();this._shouldGroupsUseMultipleIndices?this._rowVisList=new mn(n,this._getRawRowOrder(),t):this._rowVisList=new pn(n,this._getRawRowOrder(),t,a)}else this._rowVisList=new dn(this._getRawRowOrder());this._triggerRowVisListReplaced()}getGroupAssigner(){return new un({appInterface:this.getParentApplication().getUserScopedAppInterface(),groupLevels:this.getGroupLevelsCollection().serializeForGroupAssigner(),rowAndCellDataProvider:this.getParentTable(),columnsById:this.getParentTable().getColumnsByIdForFiltererOrSorter()})}_getGroupPathsByRowId(e){let t=[],n=[];if(this._rowOrder)for(let{rowId:s,visibility:u}of this._rowOrder)u===!0?t.push(s):n.push(s);let a=e.getGroupPathsByRowId(t),l=Ai.default(this.getGroupLevelCount(),()=>null);for(let s of n)a[s]=l;return a}getGroupPathsByRowIdForAndroidIfExists(){return this._replaceRowVisList(),this.isGrouped()?this._getGroupPathsByRowId(this.getGroupAssigner()):null}getOverallRowCount(){return this._getRowVisList().getOverallCount()}getOverallRowCountIfRowVisListExists(){var e;return(e=this._getRowVisListIfExists())==null?void 0:e.getOverallCount()}getAllRowIdsIfExists(){var e,t;return(t=(e=this._rowOrder)==null?void 0:e.map(({rowId:n})=>n))!=null?t:null}getAllRowIds(){let e=this.getAllRowIdsIfExists();return c.assert.isNotNull(e),e}eachRowId(e){this._getRowVisList().eachId(t=>{e(t)})}eachVisibleRowId(e){this._getRowVisList().eachVisibleIdInGroupedOrder(e)}eachVisibleRowIdInFlatOrder(e){this._getRowVisList().eachVisibleId(e)}getVisibleRowIdsLive(){return M(this,"rowVisListReplaced","rowOrderUpdated"),this.getVisibleRowIds()}getVisibleRowIds(){let e=[];return this.eachVisibleRowId(t=>e.push(t)),e}containsVisibleRowId(e){return this._getRowVisList().isIdVisible(e)}getVisibleRowIdsInFlatOrder(){let e=[];return this.eachVisibleRowIdInFlatOrder(t=>e.push(t)),e}getRowIdAtVisibleFlatIndex(e){return this._rowVisList.getIdAtVisibleIndex(e)}getRowIdAtVisibleGroupedIndex(e){return this._rowVisList.getIdAtVisibleGroupedIndex(e)}getFirstVisibleRowId(){return this._rowVisList.getFirstVisibleId()}getLastVisibleRowId(){return this._rowVisList.getLastVisibleId()}getVisibleRowCount(){return this._rowVisList.getVisibleCount()}getVisibleRowCountIfRowVisListExists(){var e;return(e=this._getRowVisListIfExists())==null?void 0:e.getVisibleCount()}doesRowVisListExist(){return this._getRowVisListIfExists()!==null}getVisibleRowCountLive(){return M(this,"rowsShown","rowsHidden","rowVisListReplaced"),this._rowVisList.getVisibleCount()}getVisibleFlatRowIndexById(e){return this._rowVisList.getVisibleIndexById(e)}getVisibleGroupedRowIndexById(e){return this._rowVisList.getVisibleGroupedIndexById(e)}getOverallGroupedRowIndexById(e){return this._rowVisList.getOverallGroupedIndexById(e)}getOverallRowIndexById(e){return this._rowVisList.getOverallIndexById(e)}isRowIdVisible(e){return this._rowVisList.isIdVisible(e)}isRowIdVisibleLive(e){return M(this,"rowsShown","rowsHidden"),this.isRowIdVisible(e)}getCellValueLive(e,t){return this.getParentTable().getCellValueLive(e,t)}getCellValueWithColumnTypeAndTypeOptionsLive(e,t){let n=this.getCellValueLive(e,t.id),{type:a,typeOptions:l}=t.getTypeAndTypeOptionsLive();return{cellValue:n,type:a,typeOptions:l}}getVisibleIdsGroupedForBlocks(){return this._rowVisList.getVisibleIdsGroupedForBlocks()}getVisibleIdsGroupedRecursively(){return this._rowVisList.getVisibleIdsGroupedRecursively()}getVisibleIdsGroupedRecursivelyLive(){return M(this,"rowsChangedGroupPaths"),this.getVisibleIdsGroupedRecursively()}getSortedGroupedIdsRecursively(e){return this._rowVisList.getSortedGroupedIdsRecursively(e)}getAdjacentRowId(e,t){let n=this.getVisibleGroupedRowIndexById(t);if(n===null)return null;let a=this.getVisibleRowCount(),l=e==="up"?-1:1;for(let s=n+l;s>=0&&s<a;s+=l){let u=this.getRowIdAtVisibleGroupedIndex(s);if(!this.shouldSkipRowIdWhenSwitchingRows(u))return u}return null}shouldSkipRowIdWhenSwitchingRows(e){return!1}getVisibleRowIdsForSwitchingRows(){let e=this.getVisibleRowIds();return fi(e,t=>!this.shouldSkipRowIdWhenSwitchingRows(t))}moveRowsToGroupedIndexFromUser(e,t,n,a){let l=this.getRowIdAtVisibleGroupedIndex(t),s=this.getVisibleFlatRowIndexById(l);this.moveRowsFromUser(e,s,n,a)}moveRowsFromUser(e,t,n,a){let l=this.getRowIdAtVisibleFlatIndex(t),s=n==="after"?t+1:t,u=this.isGrouped()?this.getGroupPathForRowId(l):null;if(!e.some(y=>{let I=this.getVisibleFlatRowIndexById(y)!==s,b=this.isGrouped()&&!H.default(this.getGroupPathForRowId(y),u);return I||b}))return;this._getRowVisList().moveIdsToTargetVisibleIndex(e,s);let p={rowIds:e,targetVisibleIndex:s,newCellValuesByColumnId:void 0,moveAction:{placement:n,targetRowId:l}};if(this.isGrouped()&&this.canCurrentUserMoveRowsBetweenGroups()){this._getRowVisList().setGroupPathForIds(e,u);let y=this.getGroupLevelsCollection().getDefaultCellValuesByColumnIdForGroupPath(u);for(let I of e)qe(y,(b,C)=>{this.getParentTable().replaceCellValueFromUserAndDoNotSync(I,C,b,{origin:a})});p.newCellValuesByColumnId=y}this._syncMoveVisibleRows(p),this._triggerRowsMovedFromUser(e),this.isGrouped()&&this._triggerRowsChangedGroupPaths(e),this._triggerRowOrderUpdated()}moveRowsFromServer(e){this._getRowVisList().moveIdsToMultiTargetOverallFinalIndices(e),this._triggerRowsMovedFromServer(ce(e)),this._triggerRowOrderUpdated()}getCellValuesByRowIdThenColumnIdForGroupChange(e,t){let n=this.getGroupLevelsCollection().getDefaultCellValuesByColumnIdForGroupPath(t),a={};for(let l of e)a[l]=n;return a}moveRowsToGroupFromUser(e,t,n){this.getParentTable().setCellValuesFromUser({cellValuesByRowIdThenColumnId:this.getCellValuesByRowIdThenColumnIdForGroupChange(e,t),origin:n})}onParentTableAddMultipleRows(e,t){if(e.length>=200?(qe(e,({rowId:l,visibility:s,targetOverallIndex:u})=>{let m={rowId:l,visibility:s};c.assert(this._rowOrder),typeof u=="number"?this._rowOrder.splice(u,0,m):this._rowOrder.push(m)}),this._replaceRowVisList()):qe(e,({rowId:l,visibility:s,targetOverallIndex:u})=>{if(c.assert(ge(u)||u===null||u===void 0),this.isGrouped()){let m=this._getTargetGroupPathForRowIdFromCellValues(l);ge(u)?this._getRowVisList().addIdToGroupAtTargetOverallIndex(l,s,m,u):this._getRowVisList().addIdToGroupAtEnd(l,s,m)}else ge(u)?this._getRowVisList().addIdToTargetOverallIndex(l,s,u):this._getRowVisList().addIdToEnd(l,s)}),this.getColorConfigIfExists()){let l=e.map(({rowId:s})=>s);this._recalculateColorByRowIdIfDataLoaded({rowIds:l})}this._triggerRowOrderUpdated()}onParentTableDestroyedMultipleRows(e){this._getRowVisList().removeMultipleIds(e),this._triggerRowOrderUpdated()}showRowsFromServer(e){c.assert(this._doesRowVisListTrackHiddenRowIds()),this._getRowVisList().showIds(e),this._replaceRowVisList(),this._recalculateColorByRowIdIfDataLoaded({rowIds:e}),this._triggerRowsShown(e),this._triggerRowOrderUpdated()}hideRowsFromServer(e){c.assert(this._doesRowVisListTrackHiddenRowIds()),this._replaceRowVisList(),this._getRowVisList().hideIds(e),this._triggerRowsHidden(e),this._triggerRowOrderUpdated()}getCellCoord(e,t){return{row:this.getVisibleGroupedRowIndexById(e),column:this.getVisibleColumnIndexById(t)}}async addNewRowFromUserWithoutCheckingIfAllowedByBillingPlanAsync(e){let t=await this.getDefaultCellValuesByColumnIdGivenViewConfigAndColumnDefaultsAsync(e),n=T(T({},t),e==null?void 0:e.cellValuesByColumnId),a=this.getColumnIds(),{rowId:l}=this.getParentTable().addNewRowWithoutDefaultCellValuesFromUser(f(T({},e),{fromQueryModel:this,cellValuesByColumnId:n,loadedColumnIds:a}));return l}async addMultipleRowsFromUserWithoutCheckingIfAllowedByBillingPlanAsync(e){let t=await this.getDefaultCellValuesByColumnIdGivenViewConfigAndColumnDefaultsAsync();return this.getParentTable().addMultipleRowsWithoutDefaultCellValuesFromUser(e.map(n=>f(T({},n),{cellValuesByColumnId:T(T({},t),n.cellValuesByColumnId)})),{fromQueryModel:this})}areRowsLoadedAndEmpty(e){let t=this.getParentTable(),n=t.getNonComputedColumnIds();for(let a of e)for(let l of n)if(!t.isCellLoaded(a,l)||t.getCellValue(a,l)!==null)return!1;return!0}duplicateRowWithoutCheckingIfAllowedByBillingPlan(e,{duplicatedRowId:t=null,targetVisibleGroupedIndexIfDragged:n=null,beforeOrAfterIndexIfDragged:a=null,targetGroupPath:l=null,onSuccess:s,onError:u}={}){var ni;let m=this.getParentTable(),p=m.getColumnCollection().getModels(),y;m.isAllRowAndCellDataLoaded()||(p=p.filter(N=>m.isCellLoaded(e,N.id)),y=e);let I=p.filter(N=>!N.isComputed()||N.isFormulaic()).map(N=>N.id),C=(ni=m.getPartialRowJson(e,I).cellValuesByColumnId)!=null?ni:{},E=m.getPrimaryColumnId(),v=C[E];if(v&&m.getColumnById(m.getPrimaryColumnId()).isTextType()){let N=v+" copy";C[E]=N}let w=[];for(let N of F(C)){if(C[N]===void 0)continue;let Re=m.getColumnById(N);if(ir(Re,"richText")){let Z=pe.default(C[N]);Z.otDocumentId=c.id.generateOtDocumentId(),Z.revision=0,C[N]=Z}if(ir(Re,"multipleAttachment")){let Z=C[N],[Su,_u]=bi.default(Z,gn=>ma.isAttachmentObjValidIngestedAttachment(gn));for(let{filename:gn,type:Au}of _u)w.push({reason:aa,filename:gn,type:Au});C[N]=Su}}let U,Q,X;if(n!==null){c.assert.isNonNegativeInt(n),c.assert.isNotNull(a);let N=this.getRowIdAtVisibleGroupedIndex(n);U=this.getOverallRowIndexById(N),Q=a,X=this.isGrouped()?this.getGroupPathForRowId(N):null}else U=this.getOverallRowIndexById(e),Q="after",X=l;if(X){let N=this.getGroupLevelsCollection().getDefaultCellValuesByColumnIdForGroupPath(X);for(let[Re,Z]of Fi(N))C[Re]=Z}let W=Ee(C,(N,Re)=>{let Z=m.getColumnById(Re);return Z.isEphemeral()||Z.canCurrentUserUpdateCells()}),dt=Rr("interfaceDesignerUseNewUpdateFlowForInterfaceOnlyCollaborators")&&(this.getParentApplication().existsOnlyAsParentForDirectlySharedPageBundle()||!ue(this.getParentApplication().getCurrentUserPermissionLevelOutsideOfPageBundle(),"edit")),Ir={fromQueryModel:this,targetOverallRowIndex:U,rowId:t,insertBeforeOrAfterTargetRow:Q},Ke={serverShouldFillInMissingColumnsFromRowWithId:y,onError:u,onSuccessfulResponseAndPushPayload:N=>{s==null||s({skippedAttachments:N.data.skippedAttachments.concat(w)})}},{rowId:We,afterOverallRowIndex:Eu,pendingSyncRequestId:ri}=m.addNewRowWithoutDefaultCellValuesFromUser(T(f(T({},Ir),{cellValuesByColumnId:W,loadedColumnIds:p.map(N=>N.id),isUnsyncedRow:!1,shouldSkipCrudAction:dt}),dt?{}:Ke));if(dt){let N=Ee(W,(Re,Z)=>this.isColumnIdVisible(Z));c.assert(ri),m.submitCrudActionAfterAddingNewRowWithoutDefaultCellValuesFromUserOptimistically(T(f(T({},Ir),{rowId:We,afterOverallRowIndex:Eu,cellValuesByColumnId:N,pendingSyncRequestId:ri}),Ke))}return We}eachVisibleRowIdInPartialGroupPath(e,t){this._getRowVisList().eachVisibleIdInPartialGroupPath(e,t)}getVisibleRowIdsInPartialGroupPath(e){let t=[];return this._getRowVisList().eachVisibleIdInPartialGroupPath(e,n=>t.push(n)),t}getVisibleRowCountForPartialGroupPath(e){return this._rowVisList.getVisibleCountForPartialGroupPath(e)}isRowIdVisibleInPartialGroupPath(e,t){return this._rowVisList.isIdVisible(t)&&this._rowVisList.isIdInPartialGroupPath(e,t)}isGroupEmptyForGroupPath(e){return this._rowVisList.isEmptyGroupForGroupPath(e)}getFirstVisibleRowIdInGroupPath(e){return this._rowVisList.getFirstVisibleIdInGroupPath(e)}getLastVisibleRowIdInGroupPath(e){return this._rowVisList.getLastVisibleIdInGroupPath(e)}getVisibleAdjacentGroupPath(e,t){return this._rowVisList.getVisibleAdjacentGroupPath(e,t)}getGroupPathForRowId(e){return this._rowVisList.getGroupPathForId(e)}getGroupPathForRowIdLive(e){return M(this,"rowsChangedGroupPaths"),this.getGroupPathForRowId(e)}_getTargetGroupPathForRowIdFromCellValues(e){let t=this.getGroupLevelsCollection().serializeForGroupAssigner(),n=this.getParentTable().getColumnsByIdForFiltererOrSorter(),a=this.getParentTable();return un.getGroupPathForRowId(this.getParentApplication().getUserScopedAppInterface(),t,n,a,e)}_recalculateGroupPathForRowIds(e){if(e.length<200){let n=this.getGroupLevelsCollection().serializeForGroupAssigner(),a=this.getParentTable().getColumnsByIdForFiltererOrSorter(),l=this.getParentTable(),u=new un({appInterface:this.getParentApplication().getUserScopedAppInterface(),groupLevels:n,columnsById:a,rowAndCellDataProvider:l}).getGroupPathsByRowId(e),m=hr(e,y=>JSON.stringify(u[y])),p=this._getRowVisList();for(let y of Object.values(m))p.setGroupPathForIds(y,u[y[0]])}else this._replaceRowVisList();this._triggerRowsChangedGroupPaths(e)}getVisibleIndicesByIdForAndroid(){var e;return(e=this._rowVisList)==null?void 0:e._visibleIndicesById}_getRawFilters(){return this._filters.getFiltersObj()}_setFiltersFromRaw(e){this._filters.setImmediatelyFromRaw(e!=null?e:null)}getFilters(){return this._filters}validateRawFilter(e){let t=this.getParentTable().getColumnById(e.columnId),a=Fa(t.getTypeAndTypeOptions()).validateObj(e);a.success||c.console.log(a),c.assert(a.success)}addLocalFiltersFromQueryParametersFromUser(e,t){c.assert(!this.canCurrentUserUpdateConfigPersistently());let n=this._filters.getFiltersObj();if(!n||n.conjunction===t){for(let a of e)this._filters.insertExpression(a,null);this._filters.updateConjunction(null,t)}else this._filters.insertExpression({filterSet:e,conjunction:t,id:c.id.generateFilterId(),type:"nested"},null)}addNewEmptyFilterViaColumnConfigMenu(e){this._filters.addNewEmptyFilterForColumns(e.map(t=>({columnId:t}))),this._triggerFilterAddedFromUserViaColumnConfigMenu()}_afterFilterChangeFromUser(){this._syncFiltersAndRecalculateAllRowVisibilities()}updateFiltersFromServer(e){this._setFiltersFromRaw(e),this._triggerFiltersUpdatedFromServer()}_isCellDataLoadedForCalculatingFilters(e){return this._rowOrder!==null&&this.getParentTable().isSliceLoaded({rowIds:this.getAllRowIds(),columnIds:Array.from(D.getDependentColumnIds(e))})}_syncFiltersAndRecalculateAllRowVisibilities(){let e=this._getRawFilters(),t=this.getAllRowIdsIfExists(),n=!0;t===null&&(n=!1);let a;this.canCurrentUserUpdateConfigPersistently()&&(e&&!this._isCellDataLoadedForCalculatingFilters(e)?n=!1:t!==null&&(a=this._calculateRowVisibilityUpdates(t),this.getParentTable().isSliceLoaded({rowIds:a.rowIdsToShow,columnIds:this._columnIdsNeededToShowRowsOptimistically()})||(n=!1)),this._syncUpdateFilters({filters:e},{didExecuteOptimistically:n,onSuccessfulResponseAndPushPayload:()=>{n&&(c.assert.isNotNull(t),this._updateRowVisibilitiesFromUserIfSupported(this._calculateRowVisibilityUpdates(t)))}})),n&&(c.assert.isNotNull(t),a===void 0&&(a=this._calculateRowVisibilityUpdates(t)),this._updateRowVisibilitiesFromUserIfSupported(a)),this._triggerFiltersUpdatedFromUser(n)}onParentTableCellValueChange(e,t,{fromUser:n},a){var m;let l=(m=a==null?void 0:a.isForColumnConfigUpdate)!=null?m:!1,s=Is(this._filters.getFiltersObj(),this.getParentTable(),t);n&&s&&this._recalculateRowVisibilitiesAfterCellValueChangeFromUserIfSupported([e]),!l&&this.isGrouped()&&this.getGroupLevelsCollection().hasGroupLevelWithColumnId(t)&&this.containsVisibleRowId(e)&&this._recalculateGroupPathForRowIds([e]);let u=this.getColorConfigIfExists();u&&u.isDependentOnColumn(t)&&this.containsVisibleRowId(e)&&this._recalculateColorByRowIdIfDataLoaded({rowIds:[e]})}onParentTableMultiCellValuesChange(e,t,{fromUser:n}){let a=Ts(this._filters.getFiltersObj(),this.getParentTable(),t);n&&a&&this._recalculateRowVisibilitiesAfterCellValueChangeFromUserIfSupported(e),this.isGrouped()&&this.getGroupLevelsCollection().hasGroupLevelWithAnyColumnId(t)&&this._recalculateGroupPathForRowIds(e);let l=this.getColorConfigIfExists();l&&l.isDependentOnAnyColumn(t)&&this._recalculateColorByRowIdIfDataLoaded({rowIds:e})}_isCellDataLoadedForCalculatingFiltersOnRowIds(e){let t=Array.from(D.getDependentColumnIds(this._filters.getFiltersObj()));return t.length===0||this.getParentTable().isSliceLoaded({rowIds:e,columnIds:t})}_recalculateRowVisibilitiesAfterCellValueChangeFromUserIfSupported(e){if(!bs(this._filters.getFiltersObj(),this.getParentTable())&&!this._doesQueryContainForeignKeyFilters()&&this._isCellDataLoadedForCalculatingFiltersOnRowIds(e)){let n=this._calculateRowVisibilityUpdates(e);(n.rowIdsToHide.length>0||n.rowIdsToShow.length>0)&&this._updateRowVisibilitiesFromUserIfSupported(n)}}_calculateRowVisibilityUpdates(e,t){let n=t!==void 0?t:this._getRawFilters(),a=this.getParentTable().getColumnsByIdForFiltererOrSorter(),l=this.getParentApplication().getUserScopedAppInterface(),s=G().utcOffset(0).toDate(),m=new et({cellDataProvider:this.getParentTable(),columnTypeAndTypeOptionsById:a,filters:n,context:{getVirtualClockTime:()=>s},appInterface:l,shouldExcludeInactiveFilters:!0}).getFilteredRowIdsSet(e),p=[],y=[];for(let I of e){let b=this.isRowIdVisible(I);!b&&m.has(I)?p.push(I):b&&!m.has(I)&&y.push(I)}return{rowIdsToShow:p,rowIdsToHide:y}}_updateRowVisibilitiesFromUserIfSupported({rowIdsToShow:e,rowIdsToHide:t}){let n=!1,a=!1;(e.length>0||t.length>0)&&(e.length>0&&this._doesRowVisListTrackHiddenRowIds()&&(this._getRowVisList().showIds(e),n=!0),t.length>0&&(this._doesRowVisListTrackHiddenRowIds()?this._getRowVisList().hideIds(t):this._getRowVisList().removeMultipleIds(t),a=!0),n&&this._triggerRowsShown(e),a&&this._triggerRowsHidden(t),(n||a)&&this._triggerRowOrderUpdated()),n&&this.isGrouped()&&this._recalculateGroupPathForRowIds(e),n&&this._recalculateColorByRowIdIfDataLoaded({rowIds:e})}canApplyFiltersOptimistically(e){let t=this.getAllRowIdsIfExists();if(t===null||e&&!this._isCellDataLoadedForCalculatingFilters(e))return!1;let n=this._calculateRowVisibilityUpdates(t,e);return!!this.getParentTable().isSliceLoaded({rowIds:n.rowIdsToShow,columnIds:this._columnIdsNeededToShowRowsOptimistically()})}isGrouped(){return this._groupLevelsCollection!==null&&this.getGroupLevelsCollection().getLength()>0}getGroupLevelCount(){return this.getGroupLevelsCollection().getLength()}getGroupLevelsCollection(){return c.assert(this._groupLevelsCollection,"expected query model's _groupLevelsCollection to be defined"),this._groupLevelsCollection}eachGroupLevel(e){this.getGroupLevelsCollection().each(e)}hasGroupLevelWithColumnId(e){return this.getGroupLevelsCollection().hasGroupLevelWithColumnId(e)}getGroupLevelByColumnIdIfExists(e){return this.getGroupLevelsCollection().getGroupLevelByColumnIdIfExists(e)}getGroupKeysForPartialGroupPath(e){return this._getRowVisList().getGroupKeysForPartialGroupPath(e)}getSubGroupPathsForPartialGroupPath(e){return this.getGroupKeysForPartialGroupPath(e).map(n=>[...e,n])}getGroupedColumnIds(){return this.getGroupLevelsCollection().map(e=>e.getColumnId())}_setGroupLevelsCollectionFromRaw(e){let t=[];if(e)for(let n of e)this._validateRawGroupLevel(n),t.push(new sr(n,this));this._groupLevelsCollection=new $t(t)}_validateRawGroupLevel(e){let t=wa.isObjValid(e);c.assert(t)}_getAvailableGroupLevelColumns(){let e=this._getColumnsNotInViewConfigCollection(this.getGroupLevelsCollection());return e=e.filter(t=>t.canBeGrouped()),e}getAllUngroupedColumns(){return this._getColumnsNotInViewConfigCollection(this.getGroupLevelsCollection())}getFirstAvailableGroupLevelColumn(){return this._getAvailableGroupLevelColumns()[0]}addNewGroupLevelsFromUser(e){c.assert(this.getGroupLevelsCollection().getLength()<xi);let t=[];for(let n of e){if(this.hasGroupLevelWithColumnId(n.columnId))continue;let a=new sr({id:c.id.generateGroupLevelId(),columnId:n.columnId,order:n.orderType,emptyGroupState:n.emptyGroupState,shouldHideGroupCounts:n.shouldHideGroupCounts},this);this.getGroupLevelsCollection().add(a),t.push(a)}if(t.length>0&&this._afterChangeGroupLevelsFromUser(null))for(let n of t)this._triggerGroupLevelAddedFromUser(n)}changeGroupLevelColumnIdFromUser(e,t){e.setColumnId(t),this._afterChangeGroupLevelsFromUser({type:"changeGroupLevelColumnIdFromUser",groupLevel:e})}changeGroupLevelOrderTypeFromUser(e,t){e.setOrderType(t),this._afterChangeGroupLevelsFromUser(null)}changeGroupLevelShowEmptyGroupsFromUser(e,t){e.setShouldShowEmptyGroups(t),this._afterChangeGroupLevelsFromUser(null)}reorderGroupLevelsFromUser(e){this._groupLevelsCollection=new $t(e),this._afterChangeGroupLevelsFromUser({type:"reorderGroupLevelsFromUser"})}removeGroupLevelsFromUser(e){for(let t of e)t.destroy();this._afterChangeGroupLevelsFromUser({type:"removeGroupLevelsFromUser",groupLevels:e})}updateGroupLevelsFromServer(e){let t=H.default(e,this.getGroupLevelsCollection().serializeForSync());this._setGroupLevelsCollectionFromRaw(e),this.isDataLoaded()&&this._replaceRowVisList(),this._triggerGroupLevelsChanged({type:"updateFromServer",isEqualToOldGroupLevels:t}),this._triggerRowOrderUpdated()}updateGroupLevelsFromAndroid(e){this._setGroupLevelsCollectionFromRaw(e),this._afterChangeGroupLevelsFromUser(null)}updateGroupLevelsFromUserViaBlock(e){this._setGroupLevelsCollectionFromRaw(e),this._afterChangeGroupLevelsFromUser(null)}_isCellDataLoadedForCalculatingGroupLevels(e){return this.getParentTable().isSliceLoaded({rowIds:this.getVisibleRowIds(),columnIds:Le(e.filter(({columnId:t})=>t!==void 0).map(({columnId:t})=>t))})}_afterChangeGroupLevelsFromUser(e){let t=this.getGroupLevelsCollection().serializeForSync(),n=!this.canCurrentUserUpdateConfigPersistently()||this._isCellDataLoadedForCalculatingGroupLevels(t);return this.canCurrentUserUpdateConfigPersistently()&&this._syncUpdateGroupLevels({groupLevels:t},{didExecuteOptimistically:n}),n&&(this._replaceRowVisList(),this._triggerGroupLevelsChanged(e),this._triggerRowOrderUpdated()),n}updateColorConfigFromServer(e){this._setColorConfigFromRaw(e),this._triggerColorConfigUpdated()}_setColorConfigFromRaw(e){e?(this._validateRawColorConfig(e),this._colorConfig=new lr(e,this),this.isDataLoaded()&&this._recalculateColorByRowIdIfDataLoaded()):(this._colorConfig=null,this._recalculateColorByRowIdIfDataLoaded())}_setColorByRowIdFromRaw(e){e&&(this._colorByRowId=e)}_validateRawColorConfig(e){let t=Qi.isObjValid(e);c.assert(t)}getOrCreateColorConfig(){return this._colorConfig||(this._colorConfig=new lr(null,this)),this._colorConfig}getColorByRowIdIfExists(){return this._colorByRowId}getColorConfigIfExists(){return this._colorConfig}getColorConfigObjIfExists(){var e,t;return(t=(e=this._colorConfig)==null?void 0:e.serialize())!=null?t:null}getColorConfig(){return c.assert(this._colorConfig,"getColorConfig called when this._colorConfig is null"),this._colorConfig}doesBillingPlanIncludeRecordColoring(){let e=this.getParentApplication().getBillingPlan();return nt(e,"recordColoring")}recalculateColorByRowIdAndOverrideBillingPlanCheck(){this._recalculateColorByRowIdIfDataLoaded({shouldOverrideBillingPlanCheck:!0})}getColorClassForRowId(e){let t=this.getColorForRowId(e);if(t){let{colorClass:n}=Wi(t);return n}else return null}setColorConfigSelectColumnIdToDefault(){let e=this.getEligibleColorConfigSelectColumns();if(e.length===0)return;let t=fr(e,n=>this._isColumnEligibleForDefaultColorConfigSelect(n));t||(t=e[0]),this.changeColorConfigSelectColumnIdFromUser(t.id)}_isColumnEligibleForDefaultColorConfigSelect(e){return!0}getColorForRowId(e){var t,n;return(n=(t=this._colorByRowId)==null?void 0:t[e])!=null?n:null}changeColorConfigSelectColumnIdFromUser(e){let t=this.getOrCreateColorConfig();t.getType()!=="selectColumn"&&(t.setType("selectColumn"),t.clearColorDefinitions(),t.clearDefaultColor()),t.setSelectColumnId(e),this.afterColorConfigChangeFromUser()}changeColorConfigToByDateColumnRange(){let e=this.getOrCreateColorConfig();e.getType()!=="byDateColumnRange"&&(e.setType("byDateColumnRange"),e.clearColorDefinitions(),e.clearDefaultColor(),e.clearSelectColumnId()),this.afterColorConfigChangeFromUser()}removeColorConfigFromUser(){this._colorConfig=null,this.afterColorConfigChangeFromUser()}changeDefaultColorFromUser(e){let t=this.getOrCreateColorConfig();c.assert(t.getType()==="colorDefinitions","type must be COLOR_DEFINITIONS to specify a default"),t.setDefaultColor(e),this.afterColorConfigChangeFromUser()}addNewColorConfigColorDefinitionFromUser(e){let t=this.getOrCreateColorConfig();t.getType()!=="colorDefinitions"&&t.setType("colorDefinitions"),t.addColorDefinition(e),this.afterColorConfigChangeFromUser()}removeColorDefinitionFromUser(e,{viaFilterDestroy:t}){e.destroy(),this.getColorConfig().getColorDefinitionsCollection().getLength()===0&&(this._colorConfig=null),t&&this._triggerColorDefinitionRemovedViaFilterDestroy(),this.afterColorConfigChangeFromUser()}changeColorDefinitionColorFromUser(e,t){e.setColor(t),this.afterColorConfigChangeFromUser()}moveColorDefinitionToIndexFromUser(e,t){this.getColorConfig().getColorDefinitionsCollection().moveFromIndexToIndex(e,t),this.afterColorConfigChangeFromUser()}_isCellDataLoadedForCalculatingColorConfigForRows(e){let t=this.getColorConfigObjIfExists();return t?this.getParentTable().isSliceLoaded({rowIds:e,columnIds:Array.from(ye.getDependentColumnIds(t))}):!0}afterColorConfigChangeFromUser(){let e=this.getColorConfigIfExists(),t;e?t=e.serialize():t=null;let n=!this.canCurrentUserUpdateConfigPersistently()||t===null||this._isCellDataLoadedForCalculatingColorConfigForRows(this.getVisibleRowIds());this.canCurrentUserUpdateConfigPersistently()&&this._syncUpdateColorConfig({colorConfig:t},{didExecuteOptimistically:n}),n&&this._recalculateColorByRowIdIfDataLoaded(),this._triggerColorConfigUpdated()}_recalculateColorByRowIdIfDataLoaded({rowIds:e,shouldOverrideBillingPlanCheck:t=!1}={}){if(this.getHyperbaseModel().isCurrentSessionPublicSharedView())return;let n=!e,a=e!=null?e:this.getVisibleRowIds(),l=this.getColorConfigIfExists();if(!(!!l&&(t||this.doesBillingPlanIncludeRecordColoring()))){if(this._colorByRowId){let W=new Set(F(this._colorByRowId));this._colorByRowId=null,this._triggerRowColorsUpdated(W)}return}if(!this._isCellDataLoadedForCalculatingColorConfigForRows(a))return;let u=n?this._colorByRowId:P(this._colorByRowId,a),m=this.getParentTable().getColumnsByIdForFiltererOrSorter(),p=this.getParentApplication().getUserScopedAppInterface();c.assert(l);let y=this.getParentTable(),I=lu(l.serialize()),b=I.canColorByRowId()?I.getColorByRowId(this.getParentTableId(),a,y,m,p):{},C=ce(u),E=ce(b),v=new Set(E),w=C.filter(W=>(c.assert(u),v.has(W)&&b[W]!==u[W])),U=Ce.default(E,C),Q=Ce.default(C,E);if(n)this._colorByRowId=b;else{this._colorByRowId=this._colorByRowId||{};for(let W of[...U,...w])this._colorByRowId[W]=b[W];for(let W of Q)delete this._colorByRowId[W]}let X=new Set([...w,...Q,...U]);this._triggerRowColorsUpdated(X)}_updateColorByRowId(e){this._colorByRowId=this._colorByRowId||{};let t=new Set;for(let[n,a]of B(e))t.add(n),a===null?delete this._colorByRowId[n]:this._colorByRowId[n]=a;this._triggerRowColorsUpdated(t)}_setSortsCollectionFromRaw(e){let t=[],n;if(e){for(let a of e.sortSet)this._validateRawSort(a),t.push(new at(a,this));n=!!e.shouldAutoSort}else n=!0;this._sortsCollection=new er(t,n)}_validateRawSort(e){let t=Zi.isObjValid(e);c.assert(t)}eachSort(e){this.getSortsCollection().each(e)}getSortsCollection(){return c.assert(this._sortsCollection),this._sortsCollection}isAutoSortActive(){return this.getSortsCollection().isAutoSortActive()}getAvailableSortColumns(){return this._getColumnsNotInViewConfigCollection(this.getSortsCollection())}getFirstAvailableSortColumn(){return this.getAvailableSortColumns()[0]}_isCellDataLoadedForCalculatingSorts(e){return this.getParentTable().isAllRowAndCellDataLoaded()?!0:ys(this._filters.getFiltersObj(),this.getParentTable())?!1:this.getParentTable().isSliceLoaded({rowIds:this.getVisibleRowIds(),columnIds:Le(e.map(({columnId:t})=>t))})}applySortsFromUser(e){let t=this.getSortsCollection().serialize(),n=t.sortSet;c.assert(this.canCurrentUserUpdateConfigPersistently()||this.canCurrentUserUpdateConfigLocally());let a=!this.canCurrentUserUpdateConfigPersistently()||this._isCellDataLoadedForCalculatingSorts(n);if(n.length>0&&a){let l=this.getParentApplication().getUserScopedAppInterface(),s=this.getParentTable(),u=this.getParentTable().getColumnsByIdForFiltererOrSorter(),m=Array.from(this.getParentTable().deprecated_iterateLoadedRowIds()),y=new au({appInterface:l,sorts:n,rowAndCellDataProvider:s,columnsById:u}).sortRows(m);this._getRowVisList().reorderIds(y),this._triggerRowsMovedFromUser(y),this._triggerRowOrderUpdated()}this.canCurrentUserUpdateConfigPersistently()?this._syncApplySorts({sortObjs:n,shouldAutoSort:t.shouldAutoSort},{didExecuteOptimistically:a,onSuccessfulResponseAndPushPayload:e}):e&&e()}setAndApplySortsCollectionFromRaw(e){this._setSortsCollectionFromRaw(e),this.applySortsFromUser()}addNewSortFromUser(e){let t={id:c.id.generateSortId(),columnId:e,ascending:!0},n=new at(t,this);return this.getSortsCollection().add(n),this._onSortsUpdatedByUser(),n}addNewPrimarySortFromUser(e,t){c.assert(typeof t=="boolean"||t===void 0),t=!!t;let n={id:c.id.generateSortId(),columnId:e,ascending:t},a=new at(n,this);return this.getSortsCollection().addPrimarySort(a),this._onSortsUpdatedByUser(),a}changeSortColumnIdFromUser(e,t){e.setColumnId(t),this._onSortsUpdatedByUser()}changeSortIsAscendingFromUser(e,t){e.setIsAscending(t),this._onSortsUpdatedByUser()}_getSortsCollection(){return c.assert(this._sortsCollection),this._sortsCollection}reorderSortsFromUser(e){this._sortsCollection=new er(e,this._getSortsCollection().shouldAutoSort()),this._onSortsUpdatedByUser()}removeSortFromUser(e){e.destroy(),this._onSortsUpdatedByUser()}updateShouldAutoSortFromUser(e){this._getSortsCollection().setShouldAutoSort(e),this._onSortsUpdatedByUser({shouldForceSync:!0})}_onSortsUpdatedByUser({shouldForceSync:e=!1}={}){this._triggerLastSortsAppliedUpdatedFromUser(),(this._getSortsCollection().shouldAutoSort()||e)&&this.applySortsFromUser(ne.default)}updateLastSortsAppliedFromServer(e){this._setSortsCollectionFromRaw(e),this._triggerLastSortsAppliedUpdatedFromServer()}onParentApplicationAppBlanketChange(){let e=[];this.getParentTable().eachColumn(t=>{an(t.getTypeAndTypeOptions())&&e.push(t.id)}),this.getGroupLevelsCollection().hasGroupLevelWithAnyColumnId(e)&&(this._replaceRowVisList(),this._triggerGroupLevelsChanged(null),this._triggerRowOrderUpdated())}onParentWorkspaceBillingPlanChange(){this._recalculateColorByRowIdIfDataLoaded()}onParentTableColumnTypeOrTypeOptionsChange(e){var t;this.getGroupLevelsCollection().hasGroupLevelWithColumnId(e)&&(this._replaceRowVisList(),this._triggerGroupLevelsChanged(null),this._triggerRowOrderUpdated()),(t=this.getColorConfigIfExists())!=null&&t.isDependentOnColumn(e)&&this._recalculateColorByRowIdIfDataLoaded()}onParentTableDestroyedColumn(e){if(this.isDataLoaded()){let t=null,n=this._getRawFilters();n&&(t=D.transformFiltersObj(n,u=>u.columnId!==e?u:null,{shouldConsolidateEmptyFilterSets:!0})),this._setFiltersFromRaw(t);let a=this.getGroupLevelsCollection().getGroupLevelByColumnIdIfExists(e);a&&(a.destroy(),this.isDataLoaded()&&this._replaceRowVisList());let l=this.getSortsCollection().getSortByColumnIdIfExists(e);l&&l.destroy();let s=this.getColorConfigObjIfExists();s&&this._setColorConfigFromRaw(ye.getColorConfigWithoutColumnDependency(s,e))}super.onParentTableDestroyedColumn(e)}_getColumnsNotInViewConfigCollection(e){let t=new Set;e.each(a=>{t.add(a.getColumnId())});let n=[];return this.eachColumn(a=>{t.has(a.id)||n.push(a)}),n}async getDefaultCellValuesByColumnIdGivenViewConfigAndColumnDefaultsAsync({targetOverallRowIndex:e=null,groupPathForNewRow:t=!1,filtersForDefaultCellValues:n=this._filters.getFiltersObj(),shouldIgnoreHiddenColumnDefaultCellValues:a}={}){let l={};if(n){let p=new Map,y={},I={};for(let C of D.getAllFilterObjsReachableFromRootFiltersObj(n)){c.assert(this.getOverallColumnIndexById(C.columnId)!==null);let E=p.get(C.columnId);E||(E=this.getParentTable().getColumnById(C.columnId),p.set(C.columnId,E),y[C.columnId]=E.serialize());let v=E.getParentTable().getParentApplication(),{type:w,typeOptions:U}=E.getTypeAndTypeOptions();if(w==="foreignKey"&&U&&Ji.includes(C.operator)&&C.value&&C.value.length>0){let Q=U.foreignTableId,X=E.getParentTable().getParentApplication().getTableById(Q),W=X.getPrimaryColumnId(),dt=v.getQueryManager(),Ir={source:{type:"table",tableId:X.id},columnIds:[W],filters:{conjunction:"or",filterSet:[{type:"rowIds",rowIds:C.value}]},sorts:null},Ke=dt.loadQuery(Ir);await Ke.waitForDataLoadedAsync();for(let We of C.value)X.hasRowId(We)&&(I[We]=X.getRowDisplayName(We,{isForForeignRowDisplay:!0}));Ke.isDataLoaded()&&Ke.unloadData()}}let b=D.getDefaultCellValuesByColumnIdForNewRow(y,n,C=>{var E;return(E=I[C])!=null?E:null});l=Ee(b,(C,E)=>{let v=p.get(E);return c.assert(v),v.canCurrentUserUpdateCells()})}let s=this.getParentTable().getDefaultCellValuesByColumnIdGivenColumnDefaults(),u=a?P(s,this.getVisibleColumnIds()):s,m=T(T({},u),l);if(this.isGrouped()){let p;if(t)p=t;else if(e!==null){let y=this._getRowVisList().getIdAtOverallIndex(e);p=this.getGroupPathForRowId(y)}if(p){let y=this.getGroupLevelsCollection().getDefaultCellValuesByColumnIdForGroupPath(p);m=T(T({},m),y)}}return m}};yr._eventBindings=oi(yr,yr,"_eventBindings").concat(["rowsMovedFromUser","rowsMovedFromServer","rowsShown","rowsHidden","rowOrderInitialized","rowOrderUpdated","rowVisListReplaced","queryUpdateFromServer","filterAddedFromUserViaColumnConfigMenu","filtersUpdatedFromServer","filtersUpdatedFromUser","filtersAppliedFromServer","allFiltersAppliedFromServer","groupLevelsChanged","groupLevelAddedFromUser","rowsChangedGroupPaths","colorConfigUpdated","colorDefinitionRemovedViaFilterDestroy","rowColorsUpdated","lastSortsAppliedUpdatedFromUser","lastSortsAppliedUpdatedFromServer"]);var yn=yr;En();R();var su=class extends yn{constructor(e){super(e.getParentTable());c.assert(!e.isForm()),this._viewModel=e}getView(){return this._viewModel}_doesRowVisListTrackHiddenRowIds(){return!0}_doesQueryContainForeignKeyFilters(){return!1}canCurrentUserUpdateLayoutPersistently(){return this._viewModel.canCurrentUserEditViewLayoutPersistently()}canCurrentUserUpdateConfigPersistently(){return this._viewModel.canCurrentUserEditViewConfigPersistently()}bindToCanCurrentUserUpdateConfigPersistentlyChange(e){this._viewModel.bindToCanCurrentUserEditViewConfigPersistentlyChange(e)}unbindFromCanCurrentUserUpdateConfigPersistentlyChange(e){this._viewModel.unbindFromCanCurrentUserEditViewConfigPersistentlyChange(e)}couldCurrentUserUpdateConfigPersistentlyWithPermissionLevel(){return this._viewModel.couldCurrentUserEditViewConfigPersistentlyWithPermissionLevel()}getRowCommentCount(e){return this._viewModel.getParentTable().getRowCommentCount(e)}getRowLevelCommentCount(e){return this._viewModel.getParentTable().getRowLevelCommentCount(e)}canCurrentUserUpdateLayoutLocally(){let e=this._viewModel.getHyperbaseModel().getInitData();return Ln(e)?!vn(e):this.canCurrentUserUpdateLayoutPersistently()}canCurrentUserUpdateConfigLocally(){let e=this._viewModel.getHyperbaseModel().getInitData();return Ln(e)?!vn(e):this.canCurrentUserUpdateConfigPersistently()}syncCrudActionAndTrackSuccessfulResponse(e,t,n,a,l){let s=performance.now(),u=this._getRowVisList().getVisibleCount(),m={onSuccessfulResponseAndPushPayload:()=>{var y,I;a&&a();let p=(I=(y=this._getRowVisListIfExists())==null?void 0:y.getVisibleCount())!=null?I:null;Na.track("internal.timing.viewConfig.pushPayload.complete",T({viewId:this._viewModel.id,viewType:this._viewModel.getType(),durationMs:performance.now()-s,crudAction:e,numVisibleRowsBefore:u,numVisibleRowsAfter:p},n))}};l!==void 0?this._viewModel.syncCrudActionThrottled(e,t,l,m):this._viewModel.syncCrudAction(e,t,m)}canHidePrimaryColumn(){return os.canHidePrimaryColumn(this._viewModel.getType())}_syncShowOrHideColumns(e,t){this.syncCrudActionAndTrackSuccessfulResponse("showOrHideColumns",e,{didExecuteOptimistically:t.didExecuteOptimistically,didShowColumns:e.visibility})}_syncShowOrHideAllColumns(e,t){this.syncCrudActionAndTrackSuccessfulResponse("showOrHideAllColumns",e,{didExecuteOptimistically:t.didExecuteOptimistically,didShowColumns:e.visibility})}_syncMoveVisibleColumns(e){this._viewModel.syncCrudAction("moveVisibleColumns",e)}_syncMoveOverallColumns(e){this._viewModel.syncCrudAction("moveOverallColumns",e)}_syncMoveVisibleRows({rowIds:e,targetVisibleIndex:t,newCellValuesByColumnId:n}){this._viewModel.syncCrudAction("moveVisibleRows",{rowIds:e,targetVisibleIndex:t,newCellValuesByColumnId:n})}_syncUpdateFilters(e,{didExecuteOptimistically:t,onSuccessfulResponseAndPushPayload:n}){let a="updateFilters";this.syncCrudActionAndTrackSuccessfulResponse(a,e,{didExecuteOptimistically:t},()=>{this._triggerFiltersAppliedFromServer(),De.isExpectingAnyPushPayloadsForRequest({modelClassName:"view",modelId:this.getView().id,action:a})||this._triggerAllFiltersAppliedFromServer(),n==null||n()})}_syncUpdateGroupLevels(e,t){this.syncCrudActionAndTrackSuccessfulResponse("updateGroupLevels",e,t)}_syncUpdateColorConfig(e,t){this.syncCrudActionAndTrackSuccessfulResponse("updateColorConfig",e,t)}_syncApplySorts(e,t){this.syncCrudActionAndTrackSuccessfulResponse("applySorts",e,{didExecuteOptimistically:t.didExecuteOptimistically},t.onSuccessfulResponseAndPushPayload)}_getColumnIdsLoadedByViewTypeEvenWhenColumnIsHidden(){return this._viewModel.getColumnIdsLoadedByViewTypeEvenWhenColumnIsHidden()}async readRowOrderForForeignKeyCustomizationWhenDataIsUnavailableAsync(){let e=await De.sequentialGetAsync("view",this._viewModel.id,"readRowOrder",{},{applicationId:this.getParentApplicationId()});return c.assert.strictEqual(e.msg,"SUCCESS"),e.data}shouldSkipRowIdWhenSwitchingRows(e){if(this._viewModel.isGrid()){let t=this._viewModel.getHyperbaseModel().getActiveGridViewStateIfExists();return(t==null?void 0:t.getQueryModel())===this&&t.getVerticalOffsetForRowId(e)===null}else return super.shouldSkipRowIdWhenSwitchingRows(e)}getVisibleRowIdsForSwitchingRows(){return this._viewModel.isCalendar()?this._viewModel.getVisibleRowIdsInStartDateOrderUsingFirstRange().filter(t=>!this.shouldSkipRowIdWhenSwitchingRows(t)):super.getVisibleRowIdsForSwitchingRows()}onParentTableColumnTypeOrTypeOptionsChange(e){this._viewModel.isCalendar()&&this._viewModel.onParentTableColumnTypeOrTypeOptionsChange(e),super.onParentTableColumnTypeOrTypeOptionsChange(e)}};d();h();d();var uu="sharingReadinessBaseDescription",kL="sharingReadinessFieldDescription",KL="sharingReadinessRenameView",WL="sharingReadinessTableDescription",HL="sharingReadinessTakeSnapshot";R();He();var sc=i=>{let r=new Date,e=i.getDateCreatedTime();return(r.getTime()-e.getTime())/(1e3*60*60*24)},uc=i=>sc(i)<=30,du=(i,r)=>{let e=r.getCurrentSessionUser();return!e.getBaseShareReadinessStateForApplicationId(i)||!r.getApplicationById(i).canCurrentUserEditSchema()?!1:uc(e)},pu=(i,r)=>{var e;return i===null?null:(e=i[r])!=null?e:null},QL=(i,r,e)=>{let t={};return e.forEach(n=>{t[n]=!1}),f(T({},i),{[r]:{hasSeenInterstitialShareModal:!1,hasSeenViewRenamePrompt:!1,checklistItemCompletedTutorialById:t}})},cu=(i,r,e)=>{let t=r;c.assert(pu(t,i));let n=t[i];return f(T({},t),{[i]:T(T({},n),e)})},ZL=(i,r,e)=>{let t=r;c.assert(pu(t,i));let n=t[i];c.assert.isNotUndefined(n),c.assert.has(n.checklistItemCompletedTutorialById,e);let a=f(T({},n.checklistItemCompletedTutorialById),{[e]:!0});return cu(i,r,{checklistItemCompletedTutorialById:a})},dc=i=>i?i.hasSeenViewRenamePrompt:!1,$L=(i,r)=>{let e=r.getCurrentSessionUser(),t=e.getBaseShareReadinessStateForApplicationId(i);return!dc(t)&&cc(i,e)&&du(i,r)},pc=i=>i?i.checklistItemCompletedTutorialById:null;function cc(i,r){let e=r.getBaseShareReadinessStateForApplicationId(i),t=pc(e);return t?Object.values(t).some(n=>!n):!1}var ev=(i,r)=>cu(i,r,{hasSeenViewRenamePrompt:!0}),tv=i=>F(i.checklistItemCompletedTutorialById),rv=(i,r)=>{du(r,i)&&i.getCurrentSessionUser().setTutorialCompletedForApplication(r,uu)};d();d();h();function mc(i,r,e,t={}){let n=new Set(r.map(a=>a.toLowerCase()));return In(i,n,e,{},t)}function yc(i,r,e,t){let n=new Set(e.map(a=>a.toLowerCase()));return In(i.formatMessage({defaultMessage:[{type:1,value:"sourceName"},{type:0,value:" copy"}],id:"apk3o0"},{sourceName:r}),n,t)}function Ic(i,r,e,t){return In(i.formatMessage({defaultMessage:[{type:1,value:"sourceName"},{type:0,value:" (Old)"}],id:"RyL43B"},{sourceName:r}),e,t)}function In(i,r,e,t={},{preserveBaseName:n=!1}={}){var y;let a;t.maxNumbersByLowercaseName?a=t.maxNumbersByLowercaseName:(a=Tc(r),t.maxNumbersByLowercaseName=a);let{name:l,number:s}=n?{name:i,number:null}:$o(i),u=l.toLowerCase(),m,p=0;do{if(++p>2e3){m=i;break}if(L(a,u)){let I=Math.max(((y=a[u])!=null?y:1)+1,s!=null?s:1),b=" "+I;m=Rn(l,e-b.length)+b,a[u]=I}else m=Rn(i,e),a[u]=s||1}while(r.has(m.toLowerCase()));return m}function Tc(i){let r={};for(let e of i){let t=$o(e),n=t.number===null?1:t.number;(!L(r,t.name)||n>r[t.name])&&(r[t.name]=n)}return r}var bc=/^\d{1,9}$/;function $o(i){let r=i,e=null,t=i.split(" ");if(t.length>0){let n=t[t.length-1];bc.test(n)&&(r=t.slice(0,t.length-1).join(" "),e=parseInt(n,10))}return{name:r,number:e}}var gc={generateUniqueModelName:mc,generateUniqueModelNameForCopy:yc,generateUniqueModelNameWithOldSuffix:Ic,generateUniqueModelNamePerfOptimized:In,parseNameAndNumberFromModelName:$o},sv=gc;d();h();d();function mu({getParentFeatureFlagNamesIfExists:i,isFeatureFlagEnabled:r}){function e(n){return t(n)&&r(n)}function t(n){let a=i(n);return a?a.every(e):!0}return{isEnabled:e}}me();var Tv=mu({getParentFeatureFlagNamesIfExists(i){switch(i){case"peopleTableMain":return null;case"canCreateRelationFieldsSourcedByCollaboratorField":return null;case"dangerouslyAllowPeopleTableManagement":return["peopleTableMain"];default:throw new A(i)}},isFeatureFlagEnabled(i){switch(i){case"peopleTableMain":return q(i);case"canCreateRelationFieldsSourcedByCollaboratorField":return le(i);case"dangerouslyAllowPeopleTableManagement":return q(i);default:throw new A(i)}}});d();d();R();var Tn=class{constructor(r){this._referenceCount=0,this._resourceType=r.resourceType,this._onFullyReleased=r.onFullyReleased}retain(){this._referenceCount++}release(){this._referenceCount--,this._referenceCount<0&&(c.logger.warn("{modelClassName} resource over-released",{modelClassName:this._resourceType}),this._referenceCount=0),this.isRetained()||this._onFullyReleased()}isRetained(){return this._referenceCount>0}};R();var yu=class{constructor(r){this._resource=null,this._referenceCounter=new Tn({resourceType:r.resourceType,onFullyReleased:this._unloadResource.bind(this)}),this._pendingResourceLoadPromise=null,this._loadResourceAsync=r.loadResourceAsync,this._onLoaded=r.onLoaded,this._onUnloaded=r.onUnloaded||null}isResourceLoaded(){return this._resource!==null}async loadIfNeededAndRetainAsync(){this._referenceCounter.retain(),await this._loadIfNeededAsync()}async forceReloadAndRetainAsync(){c.assert(this.isResourceLoaded()),this._referenceCounter.retain(),await this._loadResourceInternalAsync()}release(){this._referenceCounter.release()}isRetained(){return this._referenceCounter.isRetained()}getResource(){return c.assert(this._resource!==null,"Resource not loaded"),this._resource}_unloadResource(){this._resource=null,this._onUnloaded&&this._onUnloaded()}async _loadIfNeededAsync(){this.isResourceLoaded()||await this._loadResourceInternalAsync()}async _loadResourceInternalAsync(){this._pendingResourceLoadPromise||(this._pendingResourceLoadPromise=this._loadResourceAsync(),this._pendingResourceLoadPromise.then(r=>{this._pendingResourceLoadPromise=null,this.isRetained()&&(this._resource=r,this._onLoaded())})),await this._pendingResourceLoadPromise}};d();var Cc=()=>{var i;return(i=window.navigator.language)!=null?i:null},Rv=Cc;d();R();var Tu=!1,bu=!1;function fc(){return Tu}function xv(){Tu=!0}function hc(){return bu}function Dv(){bu=!0}var Iu=class{constructor(){this._hasFetched=new se(!1);this._fetchError=new se(null)}initializeWithSessionUserId(r){if(this._sessionUserId){this._assertUserIdMatchesSessionUserId(r);return}this._sessionUserId=r}_assertUserIdMatchesSessionUserId(r){c.assert.strictEqual(this._sessionUserId,r,"Previously initialized with a different UserId")}async refetchAsync(r){if(fc()||hc()){c.stats.incrementBy("homescreen.model.refetch_while_logged_out_called",1);return}(r!=null&&r.forceRefetching||this._allowMoreRefetchesAfterFirst||!this.hasFetched())&&await this._refetchImplAsync()}hasFetched(){return this._hasFetched.getWithoutListening()}hasFetchedLive(){return this._hasFetched.live()}_setHasFetched(){this._hasFetched.set(!0)}getFetchErrorIfExistsLive(){return this._fetchError.live()}setFetchError(r){this._fetchError.set(r)}};d();h();R();function Mv(i){let{runAction:r,debounceDurationMs:e,isActionAllowed:t,isActionAllowedCheckDurationMs:n=20}=i;c.assert(e>0),c.assert(n>0);let a=Date.now()-(e+1),l=null,s=null,u=()=>{c.assert(l!==null,"lastActionArg should be set");let p=Date.now(),y=p-a,I=y<e,b;if(I)b=!1;else if(b=!t(),!b){a=p,r(l.value),l=null,s&&(clearTimeout(s),s=null);return}if(!s){let C=b?n:Math.max(1,e-y);s=setTimeout(u,C)}};return p=>{l={value:p},u()}}var Ec=0,Sc=2*1e3,ei=class{constructor(r){this._durationMs=r;this.isFinished=!1}start(){c.assert(!this._promise,"Timer cannot be started more than once."),this._promise=new Promise(r=>{this._promiseResolver=r,this._setTimeout()})}resetIfStarted(){c.assert(!this.isFinished,"Timer cannot be reset once it is finished."),this._timeout&&(clearTimeout(this._timeout),this._setTimeout())}async finishAsync(){if(!this._promise)throw new Error("Timer has not started.");await this._promise,this.isFinished=!0}_setTimeout(){c.assert(this._promiseResolver,"This should NEVER be undefined here, by design."),this._timeout=setTimeout(()=>this._promiseResolver(),this._durationMs)}};function Bv(i,{batchWindowMs:r=Ec,delayAfterPreviousBatchFinishesMs:e=Sc}={}){let t=[],n;return async()=>{let a=t.length>0?t[t.length-1]:null;if(a&&!a.timer.isFinished)return a.timer.resetIfStarted(),a.metadata.numBatchedInvocations+=1,a.promise;let l=new ei(r),s={numBatchedInvocations:1},u=(async()=>{try{await(a==null?void 0:a.promise)}catch{}if(n){let m=Date.now()-n;await Ii(Math.max(0,e-m))}l.start(),await l.finishAsync();try{return await i(s)}finally{n=Date.now(),t=t.slice(1)}})();return t.push({timer:l,promise:u,metadata:s}),u}}d();h();R();O();d();O();var gu=o.string().refine(i=>!0);var ti={dataSourceType:o.enum(de),externalAccountId:o.externalAccountId(),selectedExternalFieldIds:Mr,syncFrequency:o.enum(Ve),shouldSyncRowDeletions:o.boolean(),shouldSkipRowInsertions:o.boolean().optional(),editSourceRecordPermissionLevel:o.enum(Ue).optional(),schema:Xt,syncLinkedRecordsTargetConfig:so.optional(),syncedLinkedTablesInfo:ao.optional()},$v=o.object({externalTableSyncConfigs:o.array(o.object(T({},ti)))}),ex=o.object(T({targetColumnIdByExternalFieldId:o.dict(o.string(),o.columnId())},ti)),tx=o.object(T({targetColumnConfigByExternalFieldId:o.dict(o.string(),o.object(P(k.shape,["name","type","typeOptions"]))).optional(),targetTableId:o.tableId().nullable().optional()},ti)),fu=(n=>(n.MAPPED_TO="mappedTo",n.UNMAPPED="unmapped",n.CREATED="created",n.UNCHANGED="unchanged",n))(fu||{}),hu=o.union([o.enum(["allFields"]),o.dict(o.string(),o.object({targetState:o.enum(fu),columnId:o.columnId().optional()}))]),rx=o.object({externalTableSyncId:o.externalTableSyncId(),pendingFieldMappingByFieldId:hu,externalAccountId:o.externalAccountId(),schema:Xt}),Ac=o.object({targetApplicationId:o.applicationId(),targetApplicationTransactionNumber:o.number(),targetTableId:o.tableId(),targetExternalTableSyncId:o.externalTableSyncId()}),Cu=o.object({applicationChangeHookId:o.applicationChangeHookId().optional(),targetActionType:o.enum(io),allowMsgPackOfResult:o.boolean().optional()}),nx=o.union([Cu.extend({shouldReadSchemaOnly:o.enum([!0])}),Cu.extend({shouldReadSchemaOnly:o.enum([!1]).optional(),shareId:o.shareId().optional(),syncTargetInfo:Ac.omit(["targetApplicationTransactionNumber"]).optional()})]);var ut=o.object({shareId:o.shareId().optional(),targetApplicationId:o.applicationId()}),ox=o.union([ut.extend({type:o.enum(["workspaceDeleted","workspaceRestored"])}),ut.extend({type:o.enum(["applicationDeleted","applicationRestored"]),targetApplicationTransactionNumber:o.number()}),ut.extend({type:o.enum(["tableDeleted","tableRestored"]),targetApplicationTransactionNumber:o.number(),targetTableId:o.tableId()}),ut.extend({type:o.enum(["externalTableSyncDeleted"]),targetApplicationTransactionNumber:o.number(),targetTableId:o.tableId(),targetExternalTableSyncId:o.externalTableSyncId()}),ut.extend({type:o.enum(["externalTableSyncCreated"]),targetApplicationTransactionNumber:o.number(),targetTableId:o.tableId(),targetExternalTableSyncId:o.externalTableSyncId()}),ut.extend({type:o.enum(["externalTableSyncSyncAttemptedFromUntrackedTarget"]),targetTableId:o.tableId(),targetExternalTableSyncId:o.externalTableSyncId()})]).refine(i=>!0);c.assert.isTrueType();var ix=o.object({dataSourceType:o.enum(de),externalAccountId:o.externalAccountId(),pendingFieldMappingByFieldId:hu,schema:Xt,targetColumnConfigByExternalFieldId:o.dict(o.string(),o.object(P(k.shape,["name","type","typeOptions"]))).optional()}),Rc=o.union([o.object({syncState:o.enum(["synced"])}),o.object(T({syncState:o.enum(["error"])},Sr(Ur.shape,"consecutiveFailureNumber")))]),Oc=o.object({externalTableSyncRunId:gu,externalTableSyncIds:o.array(o.externalTableSyncId())}),ax=o.object({enqueueOrigin:o.enum(Yt),shouldOnlyUpdateIfSyncStateIsPending:o.boolean(),sourceSyncStatusById:o.dict(o.externalTableSyncId(),Rc),externalTableSyncRunContext:Oc.optional()});var lx=o.object({newAuthoritativeColumnIdsByExternalTableSyncId:o.dict(o.externalTableSyncIdOrTableId(),o.array(o.columnId())).optional(),newAuthoritativeColumnIdsBySourceId:o.dict(o.externalTableSyncIdOrTableId(),o.array(o.columnId())).optional()}),sx=o.object({formerNonEmptyCellValuesByRowIdThenColumnId:o.dict(o.rowId(),o.dict(o.columnId(),Be)),formerRowIdByExternalTableSyncIdThenExternalResourceId:o.dict(o.externalTableSyncId(),o.dict(o.string(),o.rowId()))}).passthrough();d();h();d();var bx={none:0,restrictedToEnterpriseGridByDefault:1,restrictedToEnterpriseByDefault:2,fullyRestricted:3};function gx(i){return i==="restrictedToEnterpriseByDefault"||i==="restrictedToEnterpriseGridByDefault"}function Cx(i){switch(i){case"none":return!1;case"restrictedToEnterpriseGridByDefault":case"restrictedToEnterpriseByDefault":case"fullyRestricted":return!0;default:throw new A(i)}}export{Jr as a,vo as b,tr as c,M as d,sE as e,uE as f,Rs as g,qE as h,Qr as i,wp as j,$E as k,eS as l,Os as m,Np as n,tS as o,nr as p,Do as q,cS as r,Zr as s,Fs as t,wc as u,Nc as v,Pc as w,Mu as x,Zc as y,Bu as z,om as A,im as B,ku as C,Ku as D,Ft as E,Km as F,Wm as G,Hu as H,Dr as I,$m as J,xt as K,ay as L,dl as M,wr as N,eo as O,Xu as P,zu as Q,pl as R,Ly as S,jy as T,ky as U,Ky as V,Wy as W,Qu as X,Zu as Y,$u as Z,ed as _,nd as $,HI as aa,od as ba,id as ca,ad as da,ld as ea,io as fa,Pr as ga,pd as ha,XT as ia,JT as ja,ZT as ka,or as la,Kl as ma,Ng as na,bo as oa,Wl as pa,wd as qa,Pd as ra,rC as sa,Bd as ta,yC as ua,Yl as va,IC as wa,TC as xa,bC as ya,Wr as za,Hr as Aa,Gr as Ba,Db as Ca,bd as Da,wb as Ea,Nb as Fa,gd as Ga,Pb as Ha,Mb as Ia,Bb as Ja,Vb as Ka,Ub as La,Gb as Ma,jb as Na,kb as Oa,Cd as Pa,Kb as Qa,fd as Ra,Wb as Sa,Ml as Ta,Hb as Ua,Yb as Va,Xb as Wa,zb as Xa,qb as Ya,Jb as Za,Ql as _a,Co as $a,Jt as ab,Wd as bb,Eo as cb,Qt as db,Zl as eb,Hd as fb,af as gb,Yd as hb,lf as ib,sf as jb,uf as kb,df as lb,pf as mb,XS as nb,zS as ob,qS as pb,No as qb,Ns as rb,Ps as sb,d_ as tb,jp as ub,Ms as vb,p_ as wb,Jp as xb,Zp as yb,Vs as zb,U_ as Ab,G_ as Bb,ir as Cb,Po as Db,_A as Eb,gx as Fb,Cx as Gb,os as Hb,_e as Ib,$t as Jb,ms as Kb,er as Lb,ep as Mb,as as Nb,Ih as Ob,ds as Pb,nt as Qb,Ip as Rb,Tp as Sb,Dh as Tb,wh as Ub,ot as Vb,Xr as Wb,ys as Xb,nE as Yb,hs as Zb,qr as _b,_p as $b,rr as ac,DE as bc,wE as cc,As as dc,NA as ec,tc as fc,PA as gc,Uo as hc,rc as ic,MA as jc,it as kc,lr as lc,sr as mc,on as nc,ur as oc,at as pc,oO as qc,an as rc,au as sc,zo as tc,un as uc,ke as vc,cn as wc,mn as xc,yn as yc,su as zc,uu as Ac,kL as Bc,KL as Cc,WL as Dc,HL as Ec,uc as Fc,du as Gc,pu as Hc,QL as Ic,ZL as Jc,$L as Kc,ev as Lc,tv as Mc,rv as Nc,sv as Oc,mu as Pc,Tv as Qc,Tn as Rc,yu as Sc,Rv as Tc,_c as Uc,fc as Vc,xv as Wc,Dv as Xc,Iu as Yc,Mv as Zc,Bv as _c};
//# sourceMappingURL=https://airtable.com/jsSourceMap/esbuild/production/chunks/chunk-2IRZ7GAJ.js.map