@dataform/core 2.8.0 → 2.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bundle.js +1 -1
  2. package/package.json +1 -1
package/bundle.js CHANGED
@@ -1 +1 @@
1
- module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=61)}([function(e,t,r){var n,i,o;i=[r(92)],void 0===(o="function"==typeof(n=function(e){"use strict";var t,r,n,i,o=e.Reader,a=e.Writer,s=e.util,l=e.roots.default||(e.roots.default={});return l.dataform=((i={}).ProjectConfig=function(){function t(e){if(this.vars={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.warehouse="",t.prototype.defaultDatabase="",t.prototype.defaultSchema="",t.prototype.defaultLocation="",t.prototype.assertionSchema="",t.prototype.vars=s.emptyObject,t.prototype.concurrentQueryLimit=0,t.prototype.idempotentActionRetries=0,t.prototype.databaseSuffix="",t.prototype.schemaSuffix="",t.prototype.tablePrefix="",t.prototype.gcloudProjectId="",t.prototype.useRunCache=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(10).string(e.warehouse),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(18).string(e.defaultSchema),null!=e.assertionSchema&&Object.hasOwnProperty.call(e,"assertionSchema")&&t.uint32(42).string(e.assertionSchema),null!=e.gcloudProjectId&&Object.hasOwnProperty.call(e,"gcloudProjectId")&&t.uint32(50).string(e.gcloudProjectId),null!=e.schemaSuffix&&Object.hasOwnProperty.call(e,"schemaSuffix")&&t.uint32(58).string(e.schemaSuffix),null!=e.idempotentActionRetries&&Object.hasOwnProperty.call(e,"idempotentActionRetries")&&t.uint32(64).int32(e.idempotentActionRetries),null!=e.defaultDatabase&&Object.hasOwnProperty.call(e,"defaultDatabase")&&t.uint32(74).string(e.defaultDatabase),null!=e.useRunCache&&Object.hasOwnProperty.call(e,"useRunCache")&&t.uint32(80).bool(e.useRunCache),null!=e.tablePrefix&&Object.hasOwnProperty.call(e,"tablePrefix")&&t.uint32(90).string(e.tablePrefix),null!=e.concurrentQueryLimit&&Object.hasOwnProperty.call(e,"concurrentQueryLimit")&&t.uint32(104).int32(e.concurrentQueryLimit),null!=e.vars&&Object.hasOwnProperty.call(e,"vars"))for(var r=Object.keys(e.vars),n=0;n<r.length;++n)t.uint32(114).fork().uint32(10).string(r[n]).uint32(18).string(e.vars[r[n]]).ldelim();return null!=e.databaseSuffix&&Object.hasOwnProperty.call(e,"databaseSuffix")&&t.uint32(122).string(e.databaseSuffix),null!=e.defaultLocation&&Object.hasOwnProperty.call(e,"defaultLocation")&&t.uint32(130).string(e.defaultLocation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.ProjectConfig;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.warehouse=e.string();break;case 9:a.defaultDatabase=e.string();break;case 2:a.defaultSchema=e.string();break;case 16:a.defaultLocation=e.string();break;case 5:a.assertionSchema=e.string();break;case 14:a.vars===s.emptyObject&&(a.vars={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.vars[r]=n;break;case 13:a.concurrentQueryLimit=e.int32();break;case 8:a.idempotentActionRetries=e.int32();break;case 15:a.databaseSuffix=e.string();break;case 7:a.schemaSuffix=e.string();break;case 11:a.tablePrefix=e.string();break;case 6:a.gcloudProjectId=e.string();break;case 10:a.useRunCache=e.bool();break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!s.isString(e.warehouse))return"warehouse: string expected";if(null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&!s.isString(e.defaultDatabase))return"defaultDatabase: string expected";if(null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!s.isString(e.defaultSchema))return"defaultSchema: string expected";if(null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&!s.isString(e.defaultLocation))return"defaultLocation: string expected";if(null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&!s.isString(e.assertionSchema))return"assertionSchema: string expected";if(null!=e.vars&&e.hasOwnProperty("vars")){if(!s.isObject(e.vars))return"vars: object expected";for(var t=Object.keys(e.vars),r=0;r<t.length;++r)if(!s.isString(e.vars[t[r]]))return"vars: string{k:string} expected"}return null!=e.concurrentQueryLimit&&e.hasOwnProperty("concurrentQueryLimit")&&!s.isInteger(e.concurrentQueryLimit)?"concurrentQueryLimit: integer expected":null!=e.idempotentActionRetries&&e.hasOwnProperty("idempotentActionRetries")&&!s.isInteger(e.idempotentActionRetries)?"idempotentActionRetries: integer expected":null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&!s.isString(e.databaseSuffix)?"databaseSuffix: string expected":null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&!s.isString(e.schemaSuffix)?"schemaSuffix: string expected":null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&!s.isString(e.tablePrefix)?"tablePrefix: string expected":null!=e.gcloudProjectId&&e.hasOwnProperty("gcloudProjectId")&&!s.isString(e.gcloudProjectId)?"gcloudProjectId: string expected":null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&"boolean"!=typeof e.useRunCache?"useRunCache: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.ProjectConfig)return e;var t=new l.dataform.ProjectConfig;if(null!=e.warehouse&&(t.warehouse=String(e.warehouse)),null!=e.defaultDatabase&&(t.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),null!=e.defaultLocation&&(t.defaultLocation=String(e.defaultLocation)),null!=e.assertionSchema&&(t.assertionSchema=String(e.assertionSchema)),e.vars){if("object"!=typeof e.vars)throw TypeError(".dataform.ProjectConfig.vars: object expected");t.vars={};for(var r=Object.keys(e.vars),n=0;n<r.length;++n)t.vars[r[n]]=String(e.vars[r[n]])}return null!=e.concurrentQueryLimit&&(t.concurrentQueryLimit=0|e.concurrentQueryLimit),null!=e.idempotentActionRetries&&(t.idempotentActionRetries=0|e.idempotentActionRetries),null!=e.databaseSuffix&&(t.databaseSuffix=String(e.databaseSuffix)),null!=e.schemaSuffix&&(t.schemaSuffix=String(e.schemaSuffix)),null!=e.tablePrefix&&(t.tablePrefix=String(e.tablePrefix)),null!=e.gcloudProjectId&&(t.gcloudProjectId=String(e.gcloudProjectId)),null!=e.useRunCache&&(t.useRunCache=Boolean(e.useRunCache)),t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.objects||t.defaults)&&(n.vars={}),t.defaults&&(n.warehouse="",n.defaultSchema="",n.assertionSchema="",n.gcloudProjectId="",n.schemaSuffix="",n.idempotentActionRetries=0,n.defaultDatabase="",n.useRunCache=!1,n.tablePrefix="",n.concurrentQueryLimit=0,n.databaseSuffix="",n.defaultLocation=""),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(n.warehouse=e.warehouse),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&(n.assertionSchema=e.assertionSchema),null!=e.gcloudProjectId&&e.hasOwnProperty("gcloudProjectId")&&(n.gcloudProjectId=e.gcloudProjectId),null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&(n.schemaSuffix=e.schemaSuffix),null!=e.idempotentActionRetries&&e.hasOwnProperty("idempotentActionRetries")&&(n.idempotentActionRetries=e.idempotentActionRetries),null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&(n.defaultDatabase=e.defaultDatabase),null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&(n.useRunCache=e.useRunCache),null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&(n.tablePrefix=e.tablePrefix),null!=e.concurrentQueryLimit&&e.hasOwnProperty("concurrentQueryLimit")&&(n.concurrentQueryLimit=e.concurrentQueryLimit),e.vars&&(r=Object.keys(e.vars)).length){n.vars={};for(var i=0;i<r.length;++i)n.vars[r[i]]=e.vars[r[i]]}return null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&(n.databaseSuffix=e.databaseSuffix),null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&(n.defaultLocation=e.defaultLocation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ProjectConfig"},t}(),i.GenerateIndexConfig=function(){function t(e){if(this.includePaths=[],this.definitionPaths=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compileConfig=null,t.prototype.includePaths=s.emptyArray,t.prototype.definitionPaths=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.compileConfig&&Object.hasOwnProperty.call(e,"compileConfig")&&l.dataform.CompileConfig.encode(e.compileConfig,t.uint32(10).fork()).ldelim(),null!=e.includePaths&&e.includePaths.length)for(var r=0;r<e.includePaths.length;++r)t.uint32(18).string(e.includePaths[r]);if(null!=e.definitionPaths&&e.definitionPaths.length)for(r=0;r<e.definitionPaths.length;++r)t.uint32(26).string(e.definitionPaths[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.GenerateIndexConfig;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compileConfig=l.dataform.CompileConfig.decode(e,e.uint32());break;case 2:n.includePaths&&n.includePaths.length||(n.includePaths=[]),n.includePaths.push(e.string());break;case 3:n.definitionPaths&&n.definitionPaths.length||(n.definitionPaths=[]),n.definitionPaths.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var t=l.dataform.CompileConfig.verify(e.compileConfig);if(t)return"compileConfig."+t}if(null!=e.includePaths&&e.hasOwnProperty("includePaths")){if(!Array.isArray(e.includePaths))return"includePaths: array expected";for(var r=0;r<e.includePaths.length;++r)if(!s.isString(e.includePaths[r]))return"includePaths: string[] expected"}if(null!=e.definitionPaths&&e.hasOwnProperty("definitionPaths")){if(!Array.isArray(e.definitionPaths))return"definitionPaths: array expected";for(r=0;r<e.definitionPaths.length;++r)if(!s.isString(e.definitionPaths[r]))return"definitionPaths: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.GenerateIndexConfig)return e;var t=new l.dataform.GenerateIndexConfig;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".dataform.GenerateIndexConfig.compileConfig: object expected");t.compileConfig=l.dataform.CompileConfig.fromObject(e.compileConfig)}if(e.includePaths){if(!Array.isArray(e.includePaths))throw TypeError(".dataform.GenerateIndexConfig.includePaths: array expected");t.includePaths=[];for(var r=0;r<e.includePaths.length;++r)t.includePaths[r]=String(e.includePaths[r])}if(e.definitionPaths){if(!Array.isArray(e.definitionPaths))throw TypeError(".dataform.GenerateIndexConfig.definitionPaths: array expected");for(t.definitionPaths=[],r=0;r<e.definitionPaths.length;++r)t.definitionPaths[r]=String(e.definitionPaths[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.includePaths=[],r.definitionPaths=[]),t.defaults&&(r.compileConfig=null),null!=e.compileConfig&&e.hasOwnProperty("compileConfig")&&(r.compileConfig=l.dataform.CompileConfig.toObject(e.compileConfig,t)),e.includePaths&&e.includePaths.length){r.includePaths=[];for(var n=0;n<e.includePaths.length;++n)r.includePaths[n]=e.includePaths[n]}if(e.definitionPaths&&e.definitionPaths.length)for(r.definitionPaths=[],n=0;n<e.definitionPaths.length;++n)r.definitionPaths[n]=e.definitionPaths[n];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.GenerateIndexConfig"},t}(),i.CompileConfig=function(){function t(e){if(this.filePaths=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectDir="",t.prototype.filePaths=s.emptyArray,t.prototype.projectConfigOverride=null,t.prototype.timeoutMillis=0,t.prototype.useMain=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.projectDir&&Object.hasOwnProperty.call(e,"projectDir")&&t.uint32(10).string(e.projectDir),null!=e.projectConfigOverride&&Object.hasOwnProperty.call(e,"projectConfigOverride")&&l.dataform.ProjectConfig.encode(e.projectConfigOverride,t.uint32(26).fork()).ldelim(),null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(48).int32(e.timeoutMillis),null!=e.filePaths&&e.filePaths.length)for(var r=0;r<e.filePaths.length;++r)t.uint32(66).string(e.filePaths[r]);return null!=e.useMain&&Object.hasOwnProperty.call(e,"useMain")&&t.uint32(72).bool(e.useMain),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompileConfig;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectDir=e.string();break;case 8:n.filePaths&&n.filePaths.length||(n.filePaths=[]),n.filePaths.push(e.string());break;case 3:n.projectConfigOverride=l.dataform.ProjectConfig.decode(e,e.uint32());break;case 6:n.timeoutMillis=e.int32();break;case 9:n.useMain=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectDir&&e.hasOwnProperty("projectDir")&&!s.isString(e.projectDir))return"projectDir: string expected";if(null!=e.filePaths&&e.hasOwnProperty("filePaths")){if(!Array.isArray(e.filePaths))return"filePaths: array expected";for(var t=0;t<e.filePaths.length;++t)if(!s.isString(e.filePaths[t]))return"filePaths: string[] expected"}if(null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")){var r=l.dataform.ProjectConfig.verify(e.projectConfigOverride);if(r)return"projectConfigOverride."+r}return null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!s.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.useMain&&e.hasOwnProperty("useMain")&&"boolean"!=typeof e.useMain?"useMain: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.CompileConfig)return e;var t=new l.dataform.CompileConfig;if(null!=e.projectDir&&(t.projectDir=String(e.projectDir)),e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".dataform.CompileConfig.filePaths: array expected");t.filePaths=[];for(var r=0;r<e.filePaths.length;++r)t.filePaths[r]=String(e.filePaths[r])}if(null!=e.projectConfigOverride){if("object"!=typeof e.projectConfigOverride)throw TypeError(".dataform.CompileConfig.projectConfigOverride: object expected");t.projectConfigOverride=l.dataform.ProjectConfig.fromObject(e.projectConfigOverride)}return null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.useMain&&(t.useMain=Boolean(e.useMain)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.filePaths=[]),t.defaults&&(r.projectDir="",r.projectConfigOverride=null,r.timeoutMillis=0,r.useMain=!1),null!=e.projectDir&&e.hasOwnProperty("projectDir")&&(r.projectDir=e.projectDir),null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(r.projectConfigOverride=l.dataform.ProjectConfig.toObject(e.projectConfigOverride,t)),null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(r.timeoutMillis=e.timeoutMillis),e.filePaths&&e.filePaths.length){r.filePaths=[];for(var n=0;n<e.filePaths.length;++n)r.filePaths[n]=e.filePaths[n]}return null!=e.useMain&&e.hasOwnProperty("useMain")&&(r.useMain=e.useMain),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompileConfig"},t}(),i.Target=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.database="",t.prototype.schema="",t.prototype.name="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(10).string(e.schema),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Target;e.pos<r;){var i=e.uint32();switch(i>>>3){case 3:n.database=e.string();break;case 1:n.schema=e.string();break;case 2:n.name=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.database&&e.hasOwnProperty("database")&&!s.isString(e.database)?"database: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!s.isString(e.schema)?"schema: string expected":null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name)?"name: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Target)return e;var t=new l.dataform.Target;return null!=e.database&&(t.database=String(e.database)),null!=e.schema&&(t.schema=String(e.schema)),null!=e.name&&(t.name=String(e.name)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.schema="",r.name="",r.database=""),null!=e.schema&&e.hasOwnProperty("schema")&&(r.schema=e.schema),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.database&&e.hasOwnProperty("database")&&(r.database=e.database),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Target"},t}(),i.BigQueryOptions=function(){function t(e){if(this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.partitionBy="",t.prototype.clusterBy=s.emptyArray,t.prototype.updatePartitionFilter="",t.prototype.labels=s.emptyObject,t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.additionalOptions=s.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(10).string(e.partitionBy),null!=e.clusterBy&&e.clusterBy.length)for(var r=0;r<e.clusterBy.length;++r)t.uint32(18).string(e.clusterBy[r]);if(null!=e.updatePartitionFilter&&Object.hasOwnProperty.call(e,"updatePartitionFilter")&&t.uint32(26).string(e.updatePartitionFilter),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(18).string(e.labels[n[r]]).ldelim()}if(null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(40).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(48).bool(e.requirePartitionFilter),null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(n=Object.keys(e.additionalOptions),r=0;r<n.length;++r)t.uint32(58).fork().uint32(10).string(n[r]).uint32(18).string(e.additionalOptions[n[r]]).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.BigQueryOptions;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.partitionBy=e.string();break;case 2:a.clusterBy&&a.clusterBy.length||(a.clusterBy=[]),a.clusterBy.push(e.string());break;case 3:a.updatePartitionFilter=e.string();break;case 4:a.labels===s.emptyObject&&(a.labels={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;)switch((p=e.uint32())>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}a.labels[r]=n;break;case 5:a.partitionExpirationDays=e.int32();break;case 6:a.requirePartitionFilter=e.bool();break;case 7:for(a.additionalOptions===s.emptyObject&&(a.additionalOptions={}),u=e.uint32()+e.pos,r="",n="";e.pos<u;){var p;switch((p=e.uint32())>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.additionalOptions[r]=n;break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!s.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(var t=0;t<e.clusterBy.length;++t)if(!s.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&!s.isString(e.updatePartitionFilter))return"updatePartitionFilter: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!s.isObject(e.labels))return"labels: object expected";var r=Object.keys(e.labels);for(t=0;t<r.length;++t)if(!s.isString(e.labels[r[t]]))return"labels: string{k:string} expected"}if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!s.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!s.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),t=0;t<r.length;++t)if(!s.isString(e.additionalOptions[r[t]]))return"additionalOptions: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.BigQueryOptions)return e;var t=new l.dataform.BigQueryOptions;if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".dataform.BigQueryOptions.clusterBy: array expected");t.clusterBy=[];for(var r=0;r<e.clusterBy.length;++r)t.clusterBy[r]=String(e.clusterBy[r])}if(null!=e.updatePartitionFilter&&(t.updatePartitionFilter=String(e.updatePartitionFilter)),e.labels){if("object"!=typeof e.labels)throw TypeError(".dataform.BigQueryOptions.labels: object expected");t.labels={};var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.labels[n[r]]=String(e.labels[n[r]])}if(null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".dataform.BigQueryOptions.additionalOptions: object expected");for(t.additionalOptions={},n=Object.keys(e.additionalOptions),r=0;r<n.length;++r)t.additionalOptions[n[r]]=String(e.additionalOptions[n[r]])}return t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.arrays||t.defaults)&&(n.clusterBy=[]),(t.objects||t.defaults)&&(n.labels={},n.additionalOptions={}),t.defaults&&(n.partitionBy="",n.updatePartitionFilter="",n.partitionExpirationDays=0,n.requirePartitionFilter=!1),null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(n.partitionBy=e.partitionBy),e.clusterBy&&e.clusterBy.length){n.clusterBy=[];for(var i=0;i<e.clusterBy.length;++i)n.clusterBy[i]=e.clusterBy[i]}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&(n.updatePartitionFilter=e.updatePartitionFilter),e.labels&&(r=Object.keys(e.labels)).length)for(n.labels={},i=0;i<r.length;++i)n.labels[r[i]]=e.labels[r[i]];if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(n.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(n.requirePartitionFilter=e.requirePartitionFilter),e.additionalOptions&&(r=Object.keys(e.additionalOptions)).length)for(n.additionalOptions={},i=0;i<r.length;++i)n.additionalOptions[r[i]]=e.additionalOptions[r[i]];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.BigQueryOptions"},t}(),i.RedshiftOptions=function(){function t(e){if(this.sortKeys=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.distKey="",t.prototype.distStyle="",t.prototype.sortKeys=s.emptyArray,t.prototype.sortStyle="",t.prototype.bind=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.distKey&&Object.hasOwnProperty.call(e,"distKey")&&t.uint32(10).string(e.distKey),null!=e.distStyle&&Object.hasOwnProperty.call(e,"distStyle")&&t.uint32(18).string(e.distStyle),null!=e.sortKeys&&e.sortKeys.length)for(var r=0;r<e.sortKeys.length;++r)t.uint32(26).string(e.sortKeys[r]);return null!=e.sortStyle&&Object.hasOwnProperty.call(e,"sortStyle")&&t.uint32(34).string(e.sortStyle),null!=e.bind&&Object.hasOwnProperty.call(e,"bind")&&t.uint32(40).bool(e.bind),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.RedshiftOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.distKey=e.string();break;case 2:n.distStyle=e.string();break;case 3:n.sortKeys&&n.sortKeys.length||(n.sortKeys=[]),n.sortKeys.push(e.string());break;case 4:n.sortStyle=e.string();break;case 5:n.bind=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.distKey&&e.hasOwnProperty("distKey")&&!s.isString(e.distKey))return"distKey: string expected";if(null!=e.distStyle&&e.hasOwnProperty("distStyle")&&!s.isString(e.distStyle))return"distStyle: string expected";if(null!=e.sortKeys&&e.hasOwnProperty("sortKeys")){if(!Array.isArray(e.sortKeys))return"sortKeys: array expected";for(var t=0;t<e.sortKeys.length;++t)if(!s.isString(e.sortKeys[t]))return"sortKeys: string[] expected"}return null!=e.sortStyle&&e.hasOwnProperty("sortStyle")&&!s.isString(e.sortStyle)?"sortStyle: string expected":null!=e.bind&&e.hasOwnProperty("bind")&&"boolean"!=typeof e.bind?"bind: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.RedshiftOptions)return e;var t=new l.dataform.RedshiftOptions;if(null!=e.distKey&&(t.distKey=String(e.distKey)),null!=e.distStyle&&(t.distStyle=String(e.distStyle)),e.sortKeys){if(!Array.isArray(e.sortKeys))throw TypeError(".dataform.RedshiftOptions.sortKeys: array expected");t.sortKeys=[];for(var r=0;r<e.sortKeys.length;++r)t.sortKeys[r]=String(e.sortKeys[r])}return null!=e.sortStyle&&(t.sortStyle=String(e.sortStyle)),null!=e.bind&&(t.bind=Boolean(e.bind)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.sortKeys=[]),t.defaults&&(r.distKey="",r.distStyle="",r.sortStyle="",r.bind=!1),null!=e.distKey&&e.hasOwnProperty("distKey")&&(r.distKey=e.distKey),null!=e.distStyle&&e.hasOwnProperty("distStyle")&&(r.distStyle=e.distStyle),e.sortKeys&&e.sortKeys.length){r.sortKeys=[];for(var n=0;n<e.sortKeys.length;++n)r.sortKeys[n]=e.sortKeys[n]}return null!=e.sortStyle&&e.hasOwnProperty("sortStyle")&&(r.sortStyle=e.sortStyle),null!=e.bind&&e.hasOwnProperty("bind")&&(r.bind=e.bind),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.RedshiftOptions"},t}(),i.SnowflakeOptions=function(){function t(e){if(this.clusterBy=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.secure=!1,t.prototype.transient=!1,t.prototype.clusterBy=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.secure&&Object.hasOwnProperty.call(e,"secure")&&t.uint32(8).bool(e.secure),null!=e.transient&&Object.hasOwnProperty.call(e,"transient")&&t.uint32(16).bool(e.transient),null!=e.clusterBy&&e.clusterBy.length)for(var r=0;r<e.clusterBy.length;++r)t.uint32(26).string(e.clusterBy[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.SnowflakeOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.secure=e.bool();break;case 2:n.transient=e.bool();break;case 3:n.clusterBy&&n.clusterBy.length||(n.clusterBy=[]),n.clusterBy.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.secure&&e.hasOwnProperty("secure")&&"boolean"!=typeof e.secure)return"secure: boolean expected";if(null!=e.transient&&e.hasOwnProperty("transient")&&"boolean"!=typeof e.transient)return"transient: boolean expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(var t=0;t<e.clusterBy.length;++t)if(!s.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.SnowflakeOptions)return e;var t=new l.dataform.SnowflakeOptions;if(null!=e.secure&&(t.secure=Boolean(e.secure)),null!=e.transient&&(t.transient=Boolean(e.transient)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".dataform.SnowflakeOptions.clusterBy: array expected");t.clusterBy=[];for(var r=0;r<e.clusterBy.length;++r)t.clusterBy[r]=String(e.clusterBy[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.clusterBy=[]),t.defaults&&(r.secure=!1,r.transient=!1),null!=e.secure&&e.hasOwnProperty("secure")&&(r.secure=e.secure),null!=e.transient&&e.hasOwnProperty("transient")&&(r.transient=e.transient),e.clusterBy&&e.clusterBy.length){r.clusterBy=[];for(var n=0;n<e.clusterBy.length;++n)r.clusterBy[n]=e.clusterBy[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.SnowflakeOptions"},t}(),i.SQLDataWarehouseOptions=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.distribution="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.distribution&&Object.hasOwnProperty.call(e,"distribution")&&t.uint32(10).string(e.distribution),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.SQLDataWarehouseOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.distribution=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.distribution&&e.hasOwnProperty("distribution")&&!s.isString(e.distribution)?"distribution: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.SQLDataWarehouseOptions)return e;var t=new l.dataform.SQLDataWarehouseOptions;return null!=e.distribution&&(t.distribution=String(e.distribution)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.distribution=""),null!=e.distribution&&e.hasOwnProperty("distribution")&&(r.distribution=e.distribution),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.SQLDataWarehouseOptions"},t}(),i.PrestoOptions=function(){function t(e){if(this.partitionBy=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.partitionBy=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.partitionBy&&e.partitionBy.length)for(var r=0;r<e.partitionBy.length;++r)t.uint32(26).string(e.partitionBy[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.PrestoOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 3:n.partitionBy&&n.partitionBy.length||(n.partitionBy=[]),n.partitionBy.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")){if(!Array.isArray(e.partitionBy))return"partitionBy: array expected";for(var t=0;t<e.partitionBy.length;++t)if(!s.isString(e.partitionBy[t]))return"partitionBy: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.PrestoOptions)return e;var t=new l.dataform.PrestoOptions;if(e.partitionBy){if(!Array.isArray(e.partitionBy))throw TypeError(".dataform.PrestoOptions.partitionBy: array expected");t.partitionBy=[];for(var r=0;r<e.partitionBy.length;++r)t.partitionBy[r]=String(e.partitionBy[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.partitionBy=[]),e.partitionBy&&e.partitionBy.length){r.partitionBy=[];for(var n=0;n<e.partitionBy.length;++n)r.partitionBy[n]=e.partitionBy[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.PrestoOptions"},t}(),i.GraphErrors=function(){function t(e){if(this.compilationErrors=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compilationErrors=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.compilationErrors&&e.compilationErrors.length)for(var r=0;r<e.compilationErrors.length;++r)l.dataform.CompilationError.encode(e.compilationErrors[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.GraphErrors;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compilationErrors&&n.compilationErrors.length||(n.compilationErrors=[]),n.compilationErrors.push(l.dataform.CompilationError.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compilationErrors&&e.hasOwnProperty("compilationErrors")){if(!Array.isArray(e.compilationErrors))return"compilationErrors: array expected";for(var t=0;t<e.compilationErrors.length;++t){var r=l.dataform.CompilationError.verify(e.compilationErrors[t]);if(r)return"compilationErrors."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.GraphErrors)return e;var t=new l.dataform.GraphErrors;if(e.compilationErrors){if(!Array.isArray(e.compilationErrors))throw TypeError(".dataform.GraphErrors.compilationErrors: array expected");t.compilationErrors=[];for(var r=0;r<e.compilationErrors.length;++r){if("object"!=typeof e.compilationErrors[r])throw TypeError(".dataform.GraphErrors.compilationErrors: object expected");t.compilationErrors[r]=l.dataform.CompilationError.fromObject(e.compilationErrors[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.compilationErrors=[]),e.compilationErrors&&e.compilationErrors.length){r.compilationErrors=[];for(var n=0;n<e.compilationErrors.length;++n)r.compilationErrors[n]=l.dataform.CompilationError.toObject(e.compilationErrors[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.GraphErrors"},t}(),i.CompilationError=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.fileName="",t.prototype.actionName="",t.prototype.actionTarget=null,t.prototype.message="",t.prototype.stack="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(10).string(e.fileName),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).string(e.message),null!=e.stack&&Object.hasOwnProperty.call(e,"stack")&&t.uint32(26).string(e.stack),null!=e.actionName&&Object.hasOwnProperty.call(e,"actionName")&&t.uint32(34).string(e.actionName),null!=e.actionTarget&&Object.hasOwnProperty.call(e,"actionTarget")&&l.dataform.Target.encode(e.actionTarget,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompilationError;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.fileName=e.string();break;case 4:n.actionName=e.string();break;case 5:n.actionTarget=l.dataform.Target.decode(e,e.uint32());break;case 2:n.message=e.string();break;case 3:n.stack=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName))return"fileName: string expected";if(null!=e.actionName&&e.hasOwnProperty("actionName")&&!s.isString(e.actionName))return"actionName: string expected";if(null!=e.actionTarget&&e.hasOwnProperty("actionTarget")){var t=l.dataform.Target.verify(e.actionTarget);if(t)return"actionTarget."+t}return null!=e.message&&e.hasOwnProperty("message")&&!s.isString(e.message)?"message: string expected":null!=e.stack&&e.hasOwnProperty("stack")&&!s.isString(e.stack)?"stack: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.CompilationError)return e;var t=new l.dataform.CompilationError;if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.actionName&&(t.actionName=String(e.actionName)),null!=e.actionTarget){if("object"!=typeof e.actionTarget)throw TypeError(".dataform.CompilationError.actionTarget: object expected");t.actionTarget=l.dataform.Target.fromObject(e.actionTarget)}return null!=e.message&&(t.message=String(e.message)),null!=e.stack&&(t.stack=String(e.stack)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.fileName="",r.message="",r.stack="",r.actionName="",r.actionTarget=null),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.message&&e.hasOwnProperty("message")&&(r.message=e.message),null!=e.stack&&e.hasOwnProperty("stack")&&(r.stack=e.stack),null!=e.actionName&&e.hasOwnProperty("actionName")&&(r.actionName=e.actionName),null!=e.actionTarget&&e.hasOwnProperty("actionTarget")&&(r.actionTarget=l.dataform.Target.toObject(e.actionTarget,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompilationError"},t}(),i.ActionDescriptor=function(){function t(e){if(this.columns=[],this.bigqueryLabels={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.description="",t.prototype.columns=s.emptyArray,t.prototype.bigqueryLabels=s.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.columns&&e.columns.length)for(var r=0;r<e.columns.length;++r)l.dataform.ColumnDescriptor.encode(e.columns[r],t.uint32(18).fork()).ldelim();if(null!=e.bigqueryLabels&&Object.hasOwnProperty.call(e,"bigqueryLabels")){var n=Object.keys(e.bigqueryLabels);for(r=0;r<n.length;++r)t.uint32(26).fork().uint32(10).string(n[r]).uint32(18).string(e.bigqueryLabels[n[r]]).ldelim()}return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.ActionDescriptor;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.description=e.string();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(l.dataform.ColumnDescriptor.decode(e,e.uint32()));break;case 3:a.bigqueryLabels===s.emptyObject&&(a.bigqueryLabels={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.bigqueryLabels[r]=n;break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t){var r=l.dataform.ColumnDescriptor.verify(e.columns[t]);if(r)return"columns."+r}}if(null!=e.bigqueryLabels&&e.hasOwnProperty("bigqueryLabels")){if(!s.isObject(e.bigqueryLabels))return"bigqueryLabels: object expected";var n=Object.keys(e.bigqueryLabels);for(t=0;t<n.length;++t)if(!s.isString(e.bigqueryLabels[n[t]]))return"bigqueryLabels: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.ActionDescriptor)return e;var t=new l.dataform.ActionDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".dataform.ActionDescriptor.columns: array expected");t.columns=[];for(var r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".dataform.ActionDescriptor.columns: object expected");t.columns[r]=l.dataform.ColumnDescriptor.fromObject(e.columns[r])}}if(e.bigqueryLabels){if("object"!=typeof e.bigqueryLabels)throw TypeError(".dataform.ActionDescriptor.bigqueryLabels: object expected");t.bigqueryLabels={};var n=Object.keys(e.bigqueryLabels);for(r=0;r<n.length;++r)t.bigqueryLabels[n[r]]=String(e.bigqueryLabels[n[r]])}return t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.arrays||t.defaults)&&(n.columns=[]),(t.objects||t.defaults)&&(n.bigqueryLabels={}),t.defaults&&(n.description=""),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.columns&&e.columns.length){n.columns=[];for(var i=0;i<e.columns.length;++i)n.columns[i]=l.dataform.ColumnDescriptor.toObject(e.columns[i],t)}if(e.bigqueryLabels&&(r=Object.keys(e.bigqueryLabels)).length)for(n.bigqueryLabels={},i=0;i<r.length;++i)n.bigqueryLabels[r[i]]=e.bigqueryLabels[r[i]];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ActionDescriptor"},t}(),i.ColumnDescriptor=function(){function t(e){if(this.path=[],this.tags=[],this.bigqueryPolicyTags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r,n;return t.prototype.description="",t.prototype.path=s.emptyArray,t.prototype.displayName="",t.prototype.dimensionType=0,t.prototype.aggregation=0,t.prototype.expression="",t.prototype.tags=s.emptyArray,t.prototype.bigqueryPolicyTags=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.path&&e.path.length)for(var r=0;r<e.path.length;++r)t.uint32(18).string(e.path[r]);if(null!=e.displayName&&Object.hasOwnProperty.call(e,"displayName")&&t.uint32(26).string(e.displayName),null!=e.dimensionType&&Object.hasOwnProperty.call(e,"dimensionType")&&t.uint32(32).int32(e.dimensionType),null!=e.aggregation&&Object.hasOwnProperty.call(e,"aggregation")&&t.uint32(40).int32(e.aggregation),null!=e.expression&&Object.hasOwnProperty.call(e,"expression")&&t.uint32(50).string(e.expression),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(58).string(e.tags[r]);if(null!=e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(r=0;r<e.bigqueryPolicyTags.length;++r)t.uint32(66).string(e.bigqueryPolicyTags[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ColumnDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.description=e.string();break;case 2:n.path&&n.path.length||(n.path=[]),n.path.push(e.string());break;case 3:n.displayName=e.string();break;case 4:n.dimensionType=e.int32();break;case 5:n.aggregation=e.int32();break;case 6:n.expression=e.string();break;case 7:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 8:n.bigqueryPolicyTags&&n.bigqueryPolicyTags.length||(n.bigqueryPolicyTags=[]),n.bigqueryPolicyTags.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description))return"description: string expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t<e.path.length;++t)if(!s.isString(e.path[t]))return"path: string[] expected"}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&!s.isString(e.displayName))return"displayName: string expected";if(null!=e.dimensionType&&e.hasOwnProperty("dimensionType"))switch(e.dimensionType){default:return"dimensionType: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.aggregation&&e.hasOwnProperty("aggregation"))switch(e.aggregation){default:return"aggregation: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.expression&&e.hasOwnProperty("expression")&&!s.isString(e.expression))return"expression: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(t=0;t<e.bigqueryPolicyTags.length;++t)if(!s.isString(e.bigqueryPolicyTags[t]))return"bigqueryPolicyTags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.ColumnDescriptor)return e;var t=new l.dataform.ColumnDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.path){if(!Array.isArray(e.path))throw TypeError(".dataform.ColumnDescriptor.path: array expected");t.path=[];for(var r=0;r<e.path.length;++r)t.path[r]=String(e.path[r])}switch(null!=e.displayName&&(t.displayName=String(e.displayName)),e.dimensionType){default:if("number"==typeof e.dimensionType){t.dimensionType=e.dimensionType;break}break;case"UNKNOWN_DIMENSION":case 0:t.dimensionType=0;break;case"CATEGORY":case 1:t.dimensionType=1;break;case"TIMESTAMP":case 2:t.dimensionType=2;break;case"NUMBER":case 3:t.dimensionType=3}switch(e.aggregation){default:if("number"==typeof e.aggregation){t.aggregation=e.aggregation;break}break;case"UNKNOWN_AGGREGATION":case 0:t.aggregation=0;break;case"SUM":case 1:t.aggregation=1;break;case"DISTINCT":case 2:t.aggregation=2;break;case"DERIVED":case 3:t.aggregation=3}if(null!=e.expression&&(t.expression=String(e.expression)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.ColumnDescriptor.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".dataform.ColumnDescriptor.bigqueryPolicyTags: array expected");for(t.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)t.bigqueryPolicyTags[r]=String(e.bigqueryPolicyTags[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.path=[],r.tags=[],r.bigqueryPolicyTags=[]),t.defaults&&(r.description="",r.displayName="",r.dimensionType=t.enums===String?"UNKNOWN_DIMENSION":0,r.aggregation=t.enums===String?"UNKNOWN_AGGREGATION":0,r.expression=""),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.path&&e.path.length){r.path=[];for(var n=0;n<e.path.length;++n)r.path[n]=e.path[n]}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&(r.displayName=e.displayName),null!=e.dimensionType&&e.hasOwnProperty("dimensionType")&&(r.dimensionType=t.enums===String?void 0===l.dataform.ColumnDescriptor.DimensionType[e.dimensionType]?e.dimensionType:l.dataform.ColumnDescriptor.DimensionType[e.dimensionType]:e.dimensionType),null!=e.aggregation&&e.hasOwnProperty("aggregation")&&(r.aggregation=t.enums===String?void 0===l.dataform.ColumnDescriptor.Aggregation[e.aggregation]?e.aggregation:l.dataform.ColumnDescriptor.Aggregation[e.aggregation]:e.aggregation),null!=e.expression&&e.hasOwnProperty("expression")&&(r.expression=e.expression),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];if(e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(r.bigqueryPolicyTags=[],n=0;n<e.bigqueryPolicyTags.length;++n)r.bigqueryPolicyTags[n]=e.bigqueryPolicyTags[n];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ColumnDescriptor"},t.DimensionType=(r={},(n=Object.create(r))[r[0]="UNKNOWN_DIMENSION"]=0,n[r[1]="CATEGORY"]=1,n[r[2]="TIMESTAMP"]=2,n[r[3]="NUMBER"]=3,n),t.Aggregation=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_AGGREGATION"]=0,t[e[1]="SUM"]=1,t[e[2]="DISTINCT"]=2,t[e[3]="DERIVED"]=3,t}(),t}(),i.TableType=(t={},(r=Object.create(t))[t[0]="UNKNOWN_TYPE"]=0,r[t[1]="TABLE"]=1,r[t[2]="INCREMENTAL"]=2,r[t[3]="VIEW"]=3,r[t[4]="INLINE"]=4,r),i.Table=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.uniqueKey=[],this.preOps=[],this.postOps=[],this.incrementalPreOps=[],this.incrementalPostOps=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.type="",t.prototype.query="",t.prototype.protected=!1,t.prototype.materialized=!1,t.prototype.enumType=0,t.prototype.actionDescriptor=null,t.prototype.tags=s.emptyArray,t.prototype.where="",t.prototype.incrementalQuery="",t.prototype.uniqueKey=s.emptyArray,t.prototype.preOps=s.emptyArray,t.prototype.postOps=s.emptyArray,t.prototype.incrementalPreOps=s.emptyArray,t.prototype.incrementalPostOps=s.emptyArray,t.prototype.redshift=null,t.prototype.bigquery=null,t.prototype.snowflake=null,t.prototype.sqlDataWarehouse=null,t.prototype.presto=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(34).fork()).ldelim(),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(42).string(e.query),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.where&&Object.hasOwnProperty.call(e,"where")&&t.uint32(66).string(e.where),null!=e.protected&&Object.hasOwnProperty.call(e,"protected")&&t.uint32(72).bool(e.protected),null!=e.preOps&&e.preOps.length)for(var r=0;r<e.preOps.length;++r)t.uint32(106).string(e.preOps[r]);if(null!=e.postOps&&e.postOps.length)for(r=0;r<e.postOps.length;++r)t.uint32(114).string(e.postOps[r]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(146).string(e.fileName),null!=e.redshift&&Object.hasOwnProperty.call(e,"redshift")&&l.dataform.RedshiftOptions.encode(e.redshift,t.uint32(170).fork()).ldelim(),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&l.dataform.BigQueryOptions.encode(e.bigquery,t.uint32(178).fork()).ldelim(),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(186).string(e.tags[r]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(194).fork()).ldelim(),null!=e.sqlDataWarehouse&&Object.hasOwnProperty.call(e,"sqlDataWarehouse")&&l.dataform.SQLDataWarehouseOptions.encode(e.sqlDataWarehouse,t.uint32(202).fork()).ldelim(),null!=e.incrementalQuery&&Object.hasOwnProperty.call(e,"incrementalQuery")&&t.uint32(210).string(e.incrementalQuery),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(218).fork()).ldelim();if(null!=e.incrementalPreOps&&e.incrementalPreOps.length)for(r=0;r<e.incrementalPreOps.length;++r)t.uint32(226).string(e.incrementalPreOps[r]);if(null!=e.incrementalPostOps&&e.incrementalPostOps.length)for(r=0;r<e.incrementalPostOps.length;++r)t.uint32(234).string(e.incrementalPostOps[r]);if(null!=e.uniqueKey&&e.uniqueKey.length)for(r=0;r<e.uniqueKey.length;++r)t.uint32(242).string(e.uniqueKey[r]);return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(248).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(258).fork()).ldelim(),null!=e.snowflake&&Object.hasOwnProperty.call(e,"snowflake")&&l.dataform.SnowflakeOptions.encode(e.snowflake,t.uint32(266).fork()).ldelim(),null!=e.presto&&Object.hasOwnProperty.call(e,"presto")&&l.dataform.PrestoOptions.encode(e.presto,t.uint32(274).fork()).ldelim(),null!=e.materialized&&Object.hasOwnProperty.call(e,"materialized")&&t.uint32(280).bool(e.materialized),null!=e.enumType&&Object.hasOwnProperty.call(e,"enumType")&&t.uint32(288).int32(e.enumType),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Table;e.pos<r;){var i=e.uint32();switch(i>>>3){case 4:n.target=l.dataform.Target.decode(e,e.uint32());break;case 32:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 27:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 31:n.hermeticity=e.int32();break;case 6:n.disabled=e.bool();break;case 3:n.type=e.string();break;case 5:n.query=e.string();break;case 9:n.protected=e.bool();break;case 35:n.materialized=e.bool();break;case 36:n.enumType=e.int32();break;case 24:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 23:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 8:n.where=e.string();break;case 26:n.incrementalQuery=e.string();break;case 30:n.uniqueKey&&n.uniqueKey.length||(n.uniqueKey=[]),n.uniqueKey.push(e.string());break;case 13:n.preOps&&n.preOps.length||(n.preOps=[]),n.preOps.push(e.string());break;case 14:n.postOps&&n.postOps.length||(n.postOps=[]),n.postOps.push(e.string());break;case 28:n.incrementalPreOps&&n.incrementalPreOps.length||(n.incrementalPreOps=[]),n.incrementalPreOps.push(e.string());break;case 29:n.incrementalPostOps&&n.incrementalPostOps.length||(n.incrementalPostOps=[]),n.incrementalPostOps.push(e.string());break;case 21:n.redshift=l.dataform.RedshiftOptions.decode(e,e.uint32());break;case 22:n.bigquery=l.dataform.BigQueryOptions.decode(e,e.uint32());break;case 33:n.snowflake=l.dataform.SnowflakeOptions.decode(e,e.uint32());break;case 25:n.sqlDataWarehouse=l.dataform.SQLDataWarehouseOptions.decode(e,e.uint32());break;case 34:n.presto=l.dataform.PrestoOptions.decode(e,e.uint32());break;case 18:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=l.dataform.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var r;if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.type&&e.hasOwnProperty("type")&&!s.isString(e.type))return"type: string expected";if(null!=e.query&&e.hasOwnProperty("query")&&!s.isString(e.query))return"query: string expected";if(null!=e.protected&&e.hasOwnProperty("protected")&&"boolean"!=typeof e.protected)return"protected: boolean expected";if(null!=e.materialized&&e.hasOwnProperty("materialized")&&"boolean"!=typeof e.materialized)return"materialized: boolean expected";if(null!=e.enumType&&e.hasOwnProperty("enumType"))switch(e.enumType){default:return"enumType: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor)))return"actionDescriptor."+r;if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.where&&e.hasOwnProperty("where")&&!s.isString(e.where))return"where: string expected";if(null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&!s.isString(e.incrementalQuery))return"incrementalQuery: string expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(t=0;t<e.uniqueKey.length;++t)if(!s.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.preOps&&e.hasOwnProperty("preOps")){if(!Array.isArray(e.preOps))return"preOps: array expected";for(t=0;t<e.preOps.length;++t)if(!s.isString(e.preOps[t]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(t=0;t<e.postOps.length;++t)if(!s.isString(e.postOps[t]))return"postOps: string[] expected"}if(null!=e.incrementalPreOps&&e.hasOwnProperty("incrementalPreOps")){if(!Array.isArray(e.incrementalPreOps))return"incrementalPreOps: array expected";for(t=0;t<e.incrementalPreOps.length;++t)if(!s.isString(e.incrementalPreOps[t]))return"incrementalPreOps: string[] expected"}if(null!=e.incrementalPostOps&&e.hasOwnProperty("incrementalPostOps")){if(!Array.isArray(e.incrementalPostOps))return"incrementalPostOps: array expected";for(t=0;t<e.incrementalPostOps.length;++t)if(!s.isString(e.incrementalPostOps[t]))return"incrementalPostOps: string[] expected"}return null!=e.redshift&&e.hasOwnProperty("redshift")&&(r=l.dataform.RedshiftOptions.verify(e.redshift))?"redshift."+r:null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r=l.dataform.BigQueryOptions.verify(e.bigquery))?"bigquery."+r:null!=e.snowflake&&e.hasOwnProperty("snowflake")&&(r=l.dataform.SnowflakeOptions.verify(e.snowflake))?"snowflake."+r:null!=e.sqlDataWarehouse&&e.hasOwnProperty("sqlDataWarehouse")&&(r=l.dataform.SQLDataWarehouseOptions.verify(e.sqlDataWarehouse))?"sqlDataWarehouse."+r:null!=e.presto&&e.hasOwnProperty("presto")&&(r=l.dataform.PrestoOptions.verify(e.presto))?"presto."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Table)return e;var t=new l.dataform.Table;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Table.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Table.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.Table.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.Table.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}switch(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.type&&(t.type=String(e.type)),null!=e.query&&(t.query=String(e.query)),null!=e.protected&&(t.protected=Boolean(e.protected)),null!=e.materialized&&(t.materialized=Boolean(e.materialized)),e.enumType){default:if("number"==typeof e.enumType){t.enumType=e.enumType;break}break;case"UNKNOWN_TYPE":case 0:t.enumType=0;break;case"TABLE":case 1:t.enumType=1;break;case"INCREMENTAL":case 2:t.enumType=2;break;case"VIEW":case 3:t.enumType=3;break;case"INLINE":case 4:t.enumType=4}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Table.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.Table.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(null!=e.where&&(t.where=String(e.where)),null!=e.incrementalQuery&&(t.incrementalQuery=String(e.incrementalQuery)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".dataform.Table.uniqueKey: array expected");for(t.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)t.uniqueKey[r]=String(e.uniqueKey[r])}if(e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".dataform.Table.preOps: array expected");for(t.preOps=[],r=0;r<e.preOps.length;++r)t.preOps[r]=String(e.preOps[r])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".dataform.Table.postOps: array expected");for(t.postOps=[],r=0;r<e.postOps.length;++r)t.postOps[r]=String(e.postOps[r])}if(e.incrementalPreOps){if(!Array.isArray(e.incrementalPreOps))throw TypeError(".dataform.Table.incrementalPreOps: array expected");for(t.incrementalPreOps=[],r=0;r<e.incrementalPreOps.length;++r)t.incrementalPreOps[r]=String(e.incrementalPreOps[r])}if(e.incrementalPostOps){if(!Array.isArray(e.incrementalPostOps))throw TypeError(".dataform.Table.incrementalPostOps: array expected");for(t.incrementalPostOps=[],r=0;r<e.incrementalPostOps.length;++r)t.incrementalPostOps[r]=String(e.incrementalPostOps[r])}if(null!=e.redshift){if("object"!=typeof e.redshift)throw TypeError(".dataform.Table.redshift: object expected");t.redshift=l.dataform.RedshiftOptions.fromObject(e.redshift)}if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".dataform.Table.bigquery: object expected");t.bigquery=l.dataform.BigQueryOptions.fromObject(e.bigquery)}if(null!=e.snowflake){if("object"!=typeof e.snowflake)throw TypeError(".dataform.Table.snowflake: object expected");t.snowflake=l.dataform.SnowflakeOptions.fromObject(e.snowflake)}if(null!=e.sqlDataWarehouse){if("object"!=typeof e.sqlDataWarehouse)throw TypeError(".dataform.Table.sqlDataWarehouse: object expected");t.sqlDataWarehouse=l.dataform.SQLDataWarehouseOptions.fromObject(e.sqlDataWarehouse)}if(null!=e.presto){if("object"!=typeof e.presto)throw TypeError(".dataform.Table.presto: object expected");t.presto=l.dataform.PrestoOptions.fromObject(e.presto)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.preOps=[],r.postOps=[],r.tags=[],r.dependencyTargets=[],r.incrementalPreOps=[],r.incrementalPostOps=[],r.uniqueKey=[]),t.defaults&&(r.type="",r.target=null,r.query="",r.disabled=!1,r.where="",r.protected=!1,r.fileName="",r.redshift=null,r.bigquery=null,r.actionDescriptor=null,r.sqlDataWarehouse=null,r.incrementalQuery="",r.hermeticity=t.enums===String?"UNKNOWN":0,r.canonicalTarget=null,r.snowflake=null,r.presto=null,r.materialized=!1,r.enumType=t.enums===String?"UNKNOWN_TYPE":0),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),null!=e.where&&e.hasOwnProperty("where")&&(r.where=e.where),null!=e.protected&&e.hasOwnProperty("protected")&&(r.protected=e.protected),e.preOps&&e.preOps.length){r.preOps=[];for(var n=0;n<e.preOps.length;++n)r.preOps[n]=e.preOps[n]}if(e.postOps&&e.postOps.length)for(r.postOps=[],n=0;n<e.postOps.length;++n)r.postOps[n]=e.postOps[n];if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.redshift&&e.hasOwnProperty("redshift")&&(r.redshift=l.dataform.RedshiftOptions.toObject(e.redshift,t)),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r.bigquery=l.dataform.BigQueryOptions.toObject(e.bigquery,t)),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.sqlDataWarehouse&&e.hasOwnProperty("sqlDataWarehouse")&&(r.sqlDataWarehouse=l.dataform.SQLDataWarehouseOptions.toObject(e.sqlDataWarehouse,t)),null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&(r.incrementalQuery=e.incrementalQuery),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);if(e.incrementalPreOps&&e.incrementalPreOps.length)for(r.incrementalPreOps=[],n=0;n<e.incrementalPreOps.length;++n)r.incrementalPreOps[n]=e.incrementalPreOps[n];if(e.incrementalPostOps&&e.incrementalPostOps.length)for(r.incrementalPostOps=[],n=0;n<e.incrementalPostOps.length;++n)r.incrementalPostOps[n]=e.incrementalPostOps[n];if(e.uniqueKey&&e.uniqueKey.length)for(r.uniqueKey=[],n=0;n<e.uniqueKey.length;++n)r.uniqueKey[n]=e.uniqueKey[n];return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),null!=e.snowflake&&e.hasOwnProperty("snowflake")&&(r.snowflake=l.dataform.SnowflakeOptions.toObject(e.snowflake,t)),null!=e.presto&&e.hasOwnProperty("presto")&&(r.presto=l.dataform.PrestoOptions.toObject(e.presto,t)),null!=e.materialized&&e.hasOwnProperty("materialized")&&(r.materialized=e.materialized),null!=e.enumType&&e.hasOwnProperty("enumType")&&(r.enumType=t.enums===String?void 0===l.dataform.TableType[e.enumType]?e.enumType:l.dataform.TableType[e.enumType]:e.enumType),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Table"},t}(),i.Operation=function(){function t(e){if(this.dependencyTargets=[],this.queries=[],this.tags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.queries=s.emptyArray,t.prototype.hasOutput=!1,t.prototype.tags=s.emptyArray,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(26).fork()).ldelim(),null!=e.queries&&e.queries.length)for(var r=0;r<e.queries.length;++r)t.uint32(50).string(e.queries[r]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.hasOutput&&Object.hasOwnProperty.call(e,"hasOutput")&&t.uint32(64).bool(e.hasOutput),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(74).string(e.tags[r]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Operation;e.pos<r;){var i=e.uint32();switch(i>>>3){case 3:n.target=l.dataform.Target.decode(e,e.uint32());break;case 13:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 11:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 12:n.hermeticity=e.int32();break;case 14:n.disabled=e.bool();break;case 6:n.queries&&n.queries.length||(n.queries=[]),n.queries.push(e.string());break;case 8:n.hasOutput=e.bool();break;case 9:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 10:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 7:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=l.dataform.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var r;if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(t=0;t<e.queries.length;++t)if(!s.isString(e.queries[t]))return"queries: string[] expected"}if(null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&"boolean"!=typeof e.hasOutput)return"hasOutput: boolean expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Operation)return e;var t=new l.dataform.Operation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Operation.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Operation.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.Operation.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.Operation.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.queries){if(!Array.isArray(e.queries))throw TypeError(".dataform.Operation.queries: array expected");for(t.queries=[],r=0;r<e.queries.length;++r)t.queries[r]=String(e.queries[r])}if(null!=e.hasOutput&&(t.hasOutput=Boolean(e.hasOutput)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.Operation.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Operation.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.queries=[],r.tags=[],r.dependencyTargets=[]),t.defaults&&(r.target=null,r.fileName="",r.hasOutput=!1,r.actionDescriptor=null,r.hermeticity=t.enums===String?"UNKNOWN":0,r.canonicalTarget=null,r.disabled=!1),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),e.queries&&e.queries.length){r.queries=[];for(var n=0;n<e.queries.length;++n)r.queries[n]=e.queries[n]}if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&(r.hasOutput=e.hasOutput),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Operation"},t}(),i.Assertion=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.query="",t.prototype.tags=s.emptyArray,t.prototype.actionDescriptor=null,t.prototype.parentAction=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(26).string(e.query),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(66).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var r=0;r<e.tags.length;++r)t.uint32(74).string(e.tags[r]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),null!=e.parentAction&&Object.hasOwnProperty.call(e,"parentAction")&&l.dataform.Target.encode(e.parentAction,t.uint32(122).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Assertion;e.pos<r;){var i=e.uint32();switch(i>>>3){case 8:n.target=l.dataform.Target.decode(e,e.uint32());break;case 13:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 11:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 12:n.hermeticity=e.int32();break;case 14:n.disabled=e.bool();break;case 3:n.query=e.string();break;case 9:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 10:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 15:n.parentAction=l.dataform.Target.decode(e,e.uint32());break;case 7:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=l.dataform.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var r;if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.query&&e.hasOwnProperty("query")&&!s.isString(e.query))return"query: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+r:null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(r=l.dataform.Target.verify(e.parentAction))?"parentAction."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Assertion)return e;var t=new l.dataform.Assertion;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Assertion.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Assertion.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.Assertion.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.Assertion.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.query&&(t.query=String(e.query)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.Assertion.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Assertion.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}if(null!=e.parentAction){if("object"!=typeof e.parentAction)throw TypeError(".dataform.Assertion.parentAction: object expected");t.parentAction=l.dataform.Target.fromObject(e.parentAction)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tags=[],r.dependencyTargets=[]),t.defaults&&(r.query="",r.fileName="",r.target=null,r.actionDescriptor=null,r.hermeticity=t.enums===String?"UNKNOWN":0,r.canonicalTarget=null,r.disabled=!1,r.parentAction=null),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),e.tags&&e.tags.length){r.tags=[];for(var n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n]}if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(r.parentAction=l.dataform.Target.toObject(e.parentAction,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Assertion"},t}(),i.ActionHermeticity=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="HERMETIC"]=1,t[e[2]="NON_HERMETIC"]=2,t}(),i.Declaration=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(18).fork()).ldelim(),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(26).fork()).ldelim(),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Declaration;e.pos<r;){var i=e.uint32();switch(i>>>3){case 2:n.target=l.dataform.Target.decode(e,e.uint32());break;case 5:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 3:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 4:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.target&&e.hasOwnProperty("target")&&(t=l.dataform.Target.verify(e.target))?"target."+t:null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(t=l.dataform.Target.verify(e.canonicalTarget))?"canonicalTarget."+t:null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(t=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+t:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null;var t},t.fromObject=function(e){if(e instanceof l.dataform.Declaration)return e;var t=new l.dataform.Declaration;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Declaration.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Declaration.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Declaration.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.target=null,r.actionDescriptor=null,r.fileName="",r.canonicalTarget=null),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Declaration"},t}(),i.Test=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.name="",t.prototype.testQuery="",t.prototype.expectedOutputQuery="",t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.testQuery&&Object.hasOwnProperty.call(e,"testQuery")&&t.uint32(18).string(e.testQuery),null!=e.expectedOutputQuery&&Object.hasOwnProperty.call(e,"expectedOutputQuery")&&t.uint32(26).string(e.expectedOutputQuery),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Test;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.name=e.string();break;case 2:n.testQuery=e.string();break;case 3:n.expectedOutputQuery=e.string();break;case 4:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name)?"name: string expected":null!=e.testQuery&&e.hasOwnProperty("testQuery")&&!s.isString(e.testQuery)?"testQuery: string expected":null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&!s.isString(e.expectedOutputQuery)?"expectedOutputQuery: string expected":null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Test)return e;var t=new l.dataform.Test;return null!=e.name&&(t.name=String(e.name)),null!=e.testQuery&&(t.testQuery=String(e.testQuery)),null!=e.expectedOutputQuery&&(t.expectedOutputQuery=String(e.expectedOutputQuery)),null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name="",r.testQuery="",r.expectedOutputQuery="",r.fileName=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.testQuery&&e.hasOwnProperty("testQuery")&&(r.testQuery=e.testQuery),null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&(r.expectedOutputQuery=e.expectedOutputQuery),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Test"},t}(),i.CompiledGraph=function(){function t(e){if(this.tables=[],this.operations=[],this.assertions=[],this.declarations=[],this.tests=[],this.targets=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectConfig=null,t.prototype.tables=s.emptyArray,t.prototype.operations=s.emptyArray,t.prototype.assertions=s.emptyArray,t.prototype.declarations=s.emptyArray,t.prototype.tests=s.emptyArray,t.prototype.graphErrors=null,t.prototype.dataformCoreVersion="",t.prototype.targets=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.tables&&e.tables.length)for(var r=0;r<e.tables.length;++r)l.dataform.Table.encode(e.tables[r],t.uint32(10).fork()).ldelim();if(null!=e.operations&&e.operations.length)for(r=0;r<e.operations.length;++r)l.dataform.Operation.encode(e.operations[r],t.uint32(18).fork()).ldelim();if(null!=e.assertions&&e.assertions.length)for(r=0;r<e.assertions.length;++r)l.dataform.Assertion.encode(e.assertions[r],t.uint32(26).fork()).ldelim();if(null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&l.dataform.ProjectConfig.encode(e.projectConfig,t.uint32(34).fork()).ldelim(),null!=e.graphErrors&&Object.hasOwnProperty.call(e,"graphErrors")&&l.dataform.GraphErrors.encode(e.graphErrors,t.uint32(58).fork()).ldelim(),null!=e.tests&&e.tests.length)for(r=0;r<e.tests.length;++r)l.dataform.Test.encode(e.tests[r],t.uint32(66).fork()).ldelim();if(null!=e.declarations&&e.declarations.length)for(r=0;r<e.declarations.length;++r)l.dataform.Declaration.encode(e.declarations[r],t.uint32(74).fork()).ldelim();if(null!=e.dataformCoreVersion&&Object.hasOwnProperty.call(e,"dataformCoreVersion")&&t.uint32(82).string(e.dataformCoreVersion),null!=e.targets&&e.targets.length)for(r=0;r<e.targets.length;++r)l.dataform.Target.encode(e.targets[r],t.uint32(90).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompiledGraph;e.pos<r;){var i=e.uint32();switch(i>>>3){case 4:n.projectConfig=l.dataform.ProjectConfig.decode(e,e.uint32());break;case 1:n.tables&&n.tables.length||(n.tables=[]),n.tables.push(l.dataform.Table.decode(e,e.uint32()));break;case 2:n.operations&&n.operations.length||(n.operations=[]),n.operations.push(l.dataform.Operation.decode(e,e.uint32()));break;case 3:n.assertions&&n.assertions.length||(n.assertions=[]),n.assertions.push(l.dataform.Assertion.decode(e,e.uint32()));break;case 9:n.declarations&&n.declarations.length||(n.declarations=[]),n.declarations.push(l.dataform.Declaration.decode(e,e.uint32()));break;case 8:n.tests&&n.tests.length||(n.tests=[]),n.tests.push(l.dataform.Test.decode(e,e.uint32()));break;case 7:n.graphErrors=l.dataform.GraphErrors.decode(e,e.uint32());break;case 10:n.dataformCoreVersion=e.string();break;case 11:n.targets&&n.targets.length||(n.targets=[]),n.targets.push(l.dataform.Target.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=l.dataform.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+r;if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t)if(r=l.dataform.Table.verify(e.tables[t]))return"tables."+r}if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(t=0;t<e.operations.length;++t)if(r=l.dataform.Operation.verify(e.operations[t]))return"operations."+r}if(null!=e.assertions&&e.hasOwnProperty("assertions")){if(!Array.isArray(e.assertions))return"assertions: array expected";for(t=0;t<e.assertions.length;++t)if(r=l.dataform.Assertion.verify(e.assertions[t]))return"assertions."+r}if(null!=e.declarations&&e.hasOwnProperty("declarations")){if(!Array.isArray(e.declarations))return"declarations: array expected";for(t=0;t<e.declarations.length;++t)if(r=l.dataform.Declaration.verify(e.declarations[t]))return"declarations."+r}if(null!=e.tests&&e.hasOwnProperty("tests")){if(!Array.isArray(e.tests))return"tests: array expected";for(t=0;t<e.tests.length;++t)if(r=l.dataform.Test.verify(e.tests[t]))return"tests."+r}if(null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(r=l.dataform.GraphErrors.verify(e.graphErrors)))return"graphErrors."+r;if(null!=e.dataformCoreVersion&&e.hasOwnProperty("dataformCoreVersion")&&!s.isString(e.dataformCoreVersion))return"dataformCoreVersion: string expected";if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(t=0;t<e.targets.length;++t){var r;if(r=l.dataform.Target.verify(e.targets[t]))return"targets."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.CompiledGraph)return e;var t=new l.dataform.CompiledGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".dataform.CompiledGraph.projectConfig: object expected");t.projectConfig=l.dataform.ProjectConfig.fromObject(e.projectConfig)}if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".dataform.CompiledGraph.tables: array expected");t.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".dataform.CompiledGraph.tables: object expected");t.tables[r]=l.dataform.Table.fromObject(e.tables[r])}}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".dataform.CompiledGraph.operations: array expected");for(t.operations=[],r=0;r<e.operations.length;++r){if("object"!=typeof e.operations[r])throw TypeError(".dataform.CompiledGraph.operations: object expected");t.operations[r]=l.dataform.Operation.fromObject(e.operations[r])}}if(e.assertions){if(!Array.isArray(e.assertions))throw TypeError(".dataform.CompiledGraph.assertions: array expected");for(t.assertions=[],r=0;r<e.assertions.length;++r){if("object"!=typeof e.assertions[r])throw TypeError(".dataform.CompiledGraph.assertions: object expected");t.assertions[r]=l.dataform.Assertion.fromObject(e.assertions[r])}}if(e.declarations){if(!Array.isArray(e.declarations))throw TypeError(".dataform.CompiledGraph.declarations: array expected");for(t.declarations=[],r=0;r<e.declarations.length;++r){if("object"!=typeof e.declarations[r])throw TypeError(".dataform.CompiledGraph.declarations: object expected");t.declarations[r]=l.dataform.Declaration.fromObject(e.declarations[r])}}if(e.tests){if(!Array.isArray(e.tests))throw TypeError(".dataform.CompiledGraph.tests: array expected");for(t.tests=[],r=0;r<e.tests.length;++r){if("object"!=typeof e.tests[r])throw TypeError(".dataform.CompiledGraph.tests: object expected");t.tests[r]=l.dataform.Test.fromObject(e.tests[r])}}if(null!=e.graphErrors){if("object"!=typeof e.graphErrors)throw TypeError(".dataform.CompiledGraph.graphErrors: object expected");t.graphErrors=l.dataform.GraphErrors.fromObject(e.graphErrors)}if(null!=e.dataformCoreVersion&&(t.dataformCoreVersion=String(e.dataformCoreVersion)),e.targets){if(!Array.isArray(e.targets))throw TypeError(".dataform.CompiledGraph.targets: array expected");for(t.targets=[],r=0;r<e.targets.length;++r){if("object"!=typeof e.targets[r])throw TypeError(".dataform.CompiledGraph.targets: object expected");t.targets[r]=l.dataform.Target.fromObject(e.targets[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tables=[],r.operations=[],r.assertions=[],r.tests=[],r.declarations=[],r.targets=[]),t.defaults&&(r.projectConfig=null,r.graphErrors=null,r.dataformCoreVersion=""),e.tables&&e.tables.length){r.tables=[];for(var n=0;n<e.tables.length;++n)r.tables[n]=l.dataform.Table.toObject(e.tables[n],t)}if(e.operations&&e.operations.length)for(r.operations=[],n=0;n<e.operations.length;++n)r.operations[n]=l.dataform.Operation.toObject(e.operations[n],t);if(e.assertions&&e.assertions.length)for(r.assertions=[],n=0;n<e.assertions.length;++n)r.assertions[n]=l.dataform.Assertion.toObject(e.assertions[n],t);if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r.projectConfig=l.dataform.ProjectConfig.toObject(e.projectConfig,t)),null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(r.graphErrors=l.dataform.GraphErrors.toObject(e.graphErrors,t)),e.tests&&e.tests.length)for(r.tests=[],n=0;n<e.tests.length;++n)r.tests[n]=l.dataform.Test.toObject(e.tests[n],t);if(e.declarations&&e.declarations.length)for(r.declarations=[],n=0;n<e.declarations.length;++n)r.declarations[n]=l.dataform.Declaration.toObject(e.declarations[n],t);if(null!=e.dataformCoreVersion&&e.hasOwnProperty("dataformCoreVersion")&&(r.dataformCoreVersion=e.dataformCoreVersion),e.targets&&e.targets.length)for(r.targets=[],n=0;n<e.targets.length;++n)r.targets[n]=l.dataform.Target.toObject(e.targets[n],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompiledGraph"},t}(),i.CoreExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.compile=null,Object.defineProperty(t.prototype,"request",{get:s.oneOfGetter(r=["compile"]),set:s.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&l.dataform.CompileExecutionRequest.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CoreExecutionRequest;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compile=l.dataform.CompileExecutionRequest.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=l.dataform.CompileExecutionRequest.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CoreExecutionRequest)return e;var t=new l.dataform.CoreExecutionRequest;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".dataform.CoreExecutionRequest.compile: object expected");t.compile=l.dataform.CompileExecutionRequest.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.compile&&e.hasOwnProperty("compile")&&(r.compile=l.dataform.CompileExecutionRequest.toObject(e.compile,t),t.oneofs&&(r.request="compile")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CoreExecutionRequest"},t}(),i.CoreExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.compile=null,Object.defineProperty(t.prototype,"response",{get:s.oneOfGetter(r=["compile"]),set:s.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&l.dataform.CompileExecutionResponse.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CoreExecutionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compile=l.dataform.CompileExecutionResponse.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=l.dataform.CompileExecutionResponse.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CoreExecutionResponse)return e;var t=new l.dataform.CoreExecutionResponse;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".dataform.CoreExecutionResponse.compile: object expected");t.compile=l.dataform.CompileExecutionResponse.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.compile&&e.hasOwnProperty("compile")&&(r.compile=l.dataform.CompileExecutionResponse.toObject(e.compile,t),t.oneofs&&(r.response="compile")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CoreExecutionResponse"},t}(),i.CompileExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compileConfig=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compileConfig&&Object.hasOwnProperty.call(e,"compileConfig")&&l.dataform.CompileConfig.encode(e.compileConfig,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompileExecutionRequest;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compileConfig=l.dataform.CompileConfig.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var t=l.dataform.CompileConfig.verify(e.compileConfig);if(t)return"compileConfig."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CompileExecutionRequest)return e;var t=new l.dataform.CompileExecutionRequest;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".dataform.CompileExecutionRequest.compileConfig: object expected");t.compileConfig=l.dataform.CompileConfig.fromObject(e.compileConfig)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.compileConfig=null),null!=e.compileConfig&&e.hasOwnProperty("compileConfig")&&(r.compileConfig=l.dataform.CompileConfig.toObject(e.compileConfig,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompileExecutionRequest"},t}(),i.CompileExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compiledGraph=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compiledGraph&&Object.hasOwnProperty.call(e,"compiledGraph")&&l.dataform.CompiledGraph.encode(e.compiledGraph,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompileExecutionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compiledGraph=l.dataform.CompiledGraph.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")){var t=l.dataform.CompiledGraph.verify(e.compiledGraph);if(t)return"compiledGraph."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CompileExecutionResponse)return e;var t=new l.dataform.CompileExecutionResponse;if(null!=e.compiledGraph){if("object"!=typeof e.compiledGraph)throw TypeError(".dataform.CompileExecutionResponse.compiledGraph: object expected");t.compiledGraph=l.dataform.CompiledGraph.fromObject(e.compiledGraph)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.compiledGraph=null),null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")&&(r.compiledGraph=l.dataform.CompiledGraph.toObject(e.compiledGraph,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompileExecutionResponse"},t}(),i.SupportedFeatures=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FEATURE"]=0,t[e[1]="ARRAY_BUFFER_IPC"]=1,t}(),i.QueryEvaluationError=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.message="",t.prototype.errorLocation=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(10).string(e.message),null!=e.errorLocation&&Object.hasOwnProperty.call(e,"errorLocation")&&l.dataform.QueryEvaluationError.ErrorLocation.encode(e.errorLocation,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.QueryEvaluationError;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.message=e.string();break;case 2:n.errorLocation=l.dataform.QueryEvaluationError.ErrorLocation.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.message&&e.hasOwnProperty("message")&&!s.isString(e.message))return"message: string expected";if(null!=e.errorLocation&&e.hasOwnProperty("errorLocation")){var t=l.dataform.QueryEvaluationError.ErrorLocation.verify(e.errorLocation);if(t)return"errorLocation."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.QueryEvaluationError)return e;var t=new l.dataform.QueryEvaluationError;if(null!=e.message&&(t.message=String(e.message)),null!=e.errorLocation){if("object"!=typeof e.errorLocation)throw TypeError(".dataform.QueryEvaluationError.errorLocation: object expected");t.errorLocation=l.dataform.QueryEvaluationError.ErrorLocation.fromObject(e.errorLocation)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.message="",r.errorLocation=null),null!=e.message&&e.hasOwnProperty("message")&&(r.message=e.message),null!=e.errorLocation&&e.hasOwnProperty("errorLocation")&&(r.errorLocation=l.dataform.QueryEvaluationError.ErrorLocation.toObject(e.errorLocation,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.QueryEvaluationError"},t.ErrorLocation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.line=0,t.prototype.column=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.line&&Object.hasOwnProperty.call(e,"line")&&t.uint32(8).int32(e.line),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(16).int32(e.column),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.QueryEvaluationError.ErrorLocation;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.line=e.int32();break;case 2:n.column=e.int32();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.line&&e.hasOwnProperty("line")&&!s.isInteger(e.line)?"line: integer expected":null!=e.column&&e.hasOwnProperty("column")&&!s.isInteger(e.column)?"column: integer expected":null},t.fromObject=function(e){if(e instanceof l.dataform.QueryEvaluationError.ErrorLocation)return e;var t=new l.dataform.QueryEvaluationError.ErrorLocation;return null!=e.line&&(t.line=0|e.line),null!=e.column&&(t.column=0|e.column),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.line=0,r.column=0),null!=e.line&&e.hasOwnProperty("line")&&(r.line=e.line),null!=e.column&&e.hasOwnProperty("column")&&(r.column=e.column),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.QueryEvaluationError.ErrorLocation"},t}(),t}(),i.QueryEvaluation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.status=0,t.prototype.error=null,t.prototype.incremental=!1,t.prototype.query="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.error&&Object.hasOwnProperty.call(e,"error")&&l.dataform.QueryEvaluationError.encode(e.error,t.uint32(18).fork()).ldelim(),null!=e.incremental&&Object.hasOwnProperty.call(e,"incremental")&&t.uint32(24).bool(e.incremental),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(34).string(e.query),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.QueryEvaluation;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.status=e.int32();break;case 2:n.error=l.dataform.QueryEvaluationError.decode(e,e.uint32());break;case 3:n.incremental=e.bool();break;case 4:n.query=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:}if(null!=e.error&&e.hasOwnProperty("error")){var t=l.dataform.QueryEvaluationError.verify(e.error);if(t)return"error."+t}return null!=e.incremental&&e.hasOwnProperty("incremental")&&"boolean"!=typeof e.incremental?"incremental: boolean expected":null!=e.query&&e.hasOwnProperty("query")&&!s.isString(e.query)?"query: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.QueryEvaluation)return e;var t=new l.dataform.QueryEvaluation;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"SUCCESS":case 0:t.status=0;break;case"FAILURE":case 1:t.status=1}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".dataform.QueryEvaluation.error: object expected");t.error=l.dataform.QueryEvaluationError.fromObject(e.error)}return null!=e.incremental&&(t.incremental=Boolean(e.incremental)),null!=e.query&&(t.query=String(e.query)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.status=t.enums===String?"SUCCESS":0,r.error=null,r.incremental=!1,r.query=""),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.QueryEvaluation.QueryEvaluationStatus[e.status]?e.status:l.dataform.QueryEvaluation.QueryEvaluationStatus[e.status]:e.status),null!=e.error&&e.hasOwnProperty("error")&&(r.error=l.dataform.QueryEvaluationError.toObject(e.error,t)),null!=e.incremental&&e.hasOwnProperty("incremental")&&(r.incremental=e.incremental),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.QueryEvaluation"},t.QueryEvaluationStatus=function(){var e={},t=Object.create(e);return t[e[0]="SUCCESS"]=0,t[e[1]="FAILURE"]=1,t}(),t}(),i.RunConfig=function(){function t(e){if(this.actions=[],this.tags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.actions=s.emptyArray,t.prototype.tags=s.emptyArray,t.prototype.includeDependencies=!1,t.prototype.includeDependents=!1,t.prototype.fullRefresh=!1,t.prototype.timeoutMillis=0,t.prototype.disableSetMetadata=!1,t.prototype.useRunCache=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.actions&&e.actions.length)for(var r=0;r<e.actions.length;++r)t.uint32(10).string(e.actions[r]);if(null!=e.fullRefresh&&Object.hasOwnProperty.call(e,"fullRefresh")&&t.uint32(16).bool(e.fullRefresh),null!=e.includeDependencies&&Object.hasOwnProperty.call(e,"includeDependencies")&&t.uint32(24).bool(e.includeDependencies),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(42).string(e.tags[r]);return null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(56).int32(e.timeoutMillis),null!=e.useRunCache&&Object.hasOwnProperty.call(e,"useRunCache")&&t.uint32(64).bool(e.useRunCache),null!=e.disableSetMetadata&&Object.hasOwnProperty.call(e,"disableSetMetadata")&&t.uint32(72).bool(e.disableSetMetadata),null!=e.includeDependents&&Object.hasOwnProperty.call(e,"includeDependents")&&t.uint32(88).bool(e.includeDependents),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.RunConfig;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.actions&&n.actions.length||(n.actions=[]),n.actions.push(e.string());break;case 5:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 3:n.includeDependencies=e.bool();break;case 11:n.includeDependents=e.bool();break;case 2:n.fullRefresh=e.bool();break;case 7:n.timeoutMillis=e.int32();break;case 9:n.disableSetMetadata=e.bool();break;case 8:n.useRunCache=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(!s.isString(e.actions[t]))return"actions: string[] expected"}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&"boolean"!=typeof e.includeDependencies?"includeDependencies: boolean expected":null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&"boolean"!=typeof e.includeDependents?"includeDependents: boolean expected":null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&"boolean"!=typeof e.fullRefresh?"fullRefresh: boolean expected":null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!s.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&"boolean"!=typeof e.disableSetMetadata?"disableSetMetadata: boolean expected":null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&"boolean"!=typeof e.useRunCache?"useRunCache: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.RunConfig)return e;var t=new l.dataform.RunConfig;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".dataform.RunConfig.actions: array expected");t.actions=[];for(var r=0;r<e.actions.length;++r)t.actions[r]=String(e.actions[r])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.RunConfig.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}return null!=e.includeDependencies&&(t.includeDependencies=Boolean(e.includeDependencies)),null!=e.includeDependents&&(t.includeDependents=Boolean(e.includeDependents)),null!=e.fullRefresh&&(t.fullRefresh=Boolean(e.fullRefresh)),null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.disableSetMetadata&&(t.disableSetMetadata=Boolean(e.disableSetMetadata)),null!=e.useRunCache&&(t.useRunCache=Boolean(e.useRunCache)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.actions=[],r.tags=[]),t.defaults&&(r.fullRefresh=!1,r.includeDependencies=!1,r.timeoutMillis=0,r.useRunCache=!1,r.disableSetMetadata=!1,r.includeDependents=!1),e.actions&&e.actions.length){r.actions=[];for(var n=0;n<e.actions.length;++n)r.actions[n]=e.actions[n]}if(null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&(r.fullRefresh=e.fullRefresh),null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&(r.includeDependencies=e.includeDependencies),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];return null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(r.timeoutMillis=e.timeoutMillis),null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&(r.useRunCache=e.useRunCache),null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&(r.disableSetMetadata=e.disableSetMetadata),null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&(r.includeDependents=e.includeDependents),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.RunConfig"},t}(),i.ExecutionTask=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.type="",t.prototype.statement="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(10).string(e.type),null!=e.statement&&Object.hasOwnProperty.call(e,"statement")&&t.uint32(18).string(e.statement),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionTask;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.type=e.string();break;case 2:n.statement=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!s.isString(e.type)?"type: string expected":null!=e.statement&&e.hasOwnProperty("statement")&&!s.isString(e.statement)?"statement: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionTask)return e;var t=new l.dataform.ExecutionTask;return null!=e.type&&(t.type=String(e.type)),null!=e.statement&&(t.statement=String(e.statement)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type="",r.statement=""),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.statement&&e.hasOwnProperty("statement")&&(r.statement=e.statement),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionTask"},t}(),i.ExecutionAction=function(){function t(e){if(this.dependencyTargets=[],this.tasks=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.fileName="",t.prototype.type="",t.prototype.tableType="",t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.tasks=s.emptyArray,t.prototype.actionDescriptor=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.tasks&&e.tasks.length)for(var r=0;r<e.tasks.length;++r)l.dataform.ExecutionTask.encode(e.tasks[r],t.uint32(18).fork()).ldelim();if(null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(34).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(42).fork()).ldelim(),null!=e.tableType&&Object.hasOwnProperty.call(e,"tableType")&&t.uint32(50).string(e.tableType),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(66).string(e.fileName),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(74).fork()).ldelim(),null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(80).int32(e.hermeticity),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(90).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionAction;e.pos<r;){var i=e.uint32();switch(i>>>3){case 5:n.target=l.dataform.Target.decode(e,e.uint32());break;case 8:n.fileName=e.string();break;case 4:n.type=e.string();break;case 6:n.tableType=e.string();break;case 11:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 10:n.hermeticity=e.int32();break;case 2:n.tasks&&n.tasks.length||(n.tasks=[]),n.tasks.push(l.dataform.ExecutionTask.decode(e,e.uint32()));break;case 9:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName))return"fileName: string expected";if(null!=e.type&&e.hasOwnProperty("type")&&!s.isString(e.type))return"type: string expected";if(null!=e.tableType&&e.hasOwnProperty("tableType")&&!s.isString(e.tableType))return"tableType: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(t=0;t<e.tasks.length;++t){var r;if(r=l.dataform.ExecutionTask.verify(e.tasks[t]))return"tasks."+r}}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionAction)return e;var t=new l.dataform.ExecutionAction;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.ExecutionAction.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.type&&(t.type=String(e.type)),null!=e.tableType&&(t.tableType=String(e.tableType)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.ExecutionAction.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.ExecutionAction.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".dataform.ExecutionAction.tasks: array expected");for(t.tasks=[],r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".dataform.ExecutionAction.tasks: object expected");t.tasks[r]=l.dataform.ExecutionTask.fromObject(e.tasks[r])}}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.ExecutionAction.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tasks=[],r.dependencyTargets=[]),t.defaults&&(r.type="",r.target=null,r.tableType="",r.fileName="",r.actionDescriptor=null,r.hermeticity=t.enums===String?"UNKNOWN":0),e.tasks&&e.tasks.length){r.tasks=[];for(var n=0;n<e.tasks.length;++n)r.tasks[n]=l.dataform.ExecutionTask.toObject(e.tasks[n],t)}if(null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),null!=e.tableType&&e.hasOwnProperty("tableType")&&(r.tableType=e.tableType),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionAction"},t}(),i.WarehouseState=function(){function t(e){if(this.tables=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.tables=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.tables&&e.tables.length)for(var r=0;r<e.tables.length;++r)l.dataform.TableMetadata.encode(e.tables[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.WarehouseState;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.tables&&n.tables.length||(n.tables=[]),n.tables.push(l.dataform.TableMetadata.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t){var r=l.dataform.TableMetadata.verify(e.tables[t]);if(r)return"tables."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.WarehouseState)return e;var t=new l.dataform.WarehouseState;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".dataform.WarehouseState.tables: array expected");t.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".dataform.WarehouseState.tables: object expected");t.tables[r]=l.dataform.TableMetadata.fromObject(e.tables[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tables=[]),e.tables&&e.tables.length){r.tables=[];for(var n=0;n<e.tables.length;++n)r.tables[n]=l.dataform.TableMetadata.toObject(e.tables[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.WarehouseState"},t}(),i.ExecutionGraph=function(){function t(e){if(this.declarationTargets=[],this.actions=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectConfig=null,t.prototype.runConfig=null,t.prototype.warehouseState=null,t.prototype.declarationTargets=s.emptyArray,t.prototype.actions=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&l.dataform.ProjectConfig.encode(e.projectConfig,t.uint32(10).fork()).ldelim(),null!=e.runConfig&&Object.hasOwnProperty.call(e,"runConfig")&&l.dataform.RunConfig.encode(e.runConfig,t.uint32(18).fork()).ldelim(),null!=e.actions&&e.actions.length)for(var r=0;r<e.actions.length;++r)l.dataform.ExecutionAction.encode(e.actions[r],t.uint32(26).fork()).ldelim();if(null!=e.warehouseState&&Object.hasOwnProperty.call(e,"warehouseState")&&l.dataform.WarehouseState.encode(e.warehouseState,t.uint32(34).fork()).ldelim(),null!=e.declarationTargets&&e.declarationTargets.length)for(r=0;r<e.declarationTargets.length;++r)l.dataform.Target.encode(e.declarationTargets[r],t.uint32(42).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionGraph;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectConfig=l.dataform.ProjectConfig.decode(e,e.uint32());break;case 2:n.runConfig=l.dataform.RunConfig.decode(e,e.uint32());break;case 4:n.warehouseState=l.dataform.WarehouseState.decode(e,e.uint32());break;case 5:n.declarationTargets&&n.declarationTargets.length||(n.declarationTargets=[]),n.declarationTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 3:n.actions&&n.actions.length||(n.actions=[]),n.actions.push(l.dataform.ExecutionAction.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=l.dataform.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+r;if(null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(r=l.dataform.RunConfig.verify(e.runConfig)))return"runConfig."+r;if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(r=l.dataform.WarehouseState.verify(e.warehouseState)))return"warehouseState."+r;if(null!=e.declarationTargets&&e.hasOwnProperty("declarationTargets")){if(!Array.isArray(e.declarationTargets))return"declarationTargets: array expected";for(var t=0;t<e.declarationTargets.length;++t)if(r=l.dataform.Target.verify(e.declarationTargets[t]))return"declarationTargets."+r}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(t=0;t<e.actions.length;++t){var r;if(r=l.dataform.ExecutionAction.verify(e.actions[t]))return"actions."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionGraph)return e;var t=new l.dataform.ExecutionGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".dataform.ExecutionGraph.projectConfig: object expected");t.projectConfig=l.dataform.ProjectConfig.fromObject(e.projectConfig)}if(null!=e.runConfig){if("object"!=typeof e.runConfig)throw TypeError(".dataform.ExecutionGraph.runConfig: object expected");t.runConfig=l.dataform.RunConfig.fromObject(e.runConfig)}if(null!=e.warehouseState){if("object"!=typeof e.warehouseState)throw TypeError(".dataform.ExecutionGraph.warehouseState: object expected");t.warehouseState=l.dataform.WarehouseState.fromObject(e.warehouseState)}if(e.declarationTargets){if(!Array.isArray(e.declarationTargets))throw TypeError(".dataform.ExecutionGraph.declarationTargets: array expected");t.declarationTargets=[];for(var r=0;r<e.declarationTargets.length;++r){if("object"!=typeof e.declarationTargets[r])throw TypeError(".dataform.ExecutionGraph.declarationTargets: object expected");t.declarationTargets[r]=l.dataform.Target.fromObject(e.declarationTargets[r])}}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".dataform.ExecutionGraph.actions: array expected");for(t.actions=[],r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".dataform.ExecutionGraph.actions: object expected");t.actions[r]=l.dataform.ExecutionAction.fromObject(e.actions[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.actions=[],r.declarationTargets=[]),t.defaults&&(r.projectConfig=null,r.runConfig=null,r.warehouseState=null),null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r.projectConfig=l.dataform.ProjectConfig.toObject(e.projectConfig,t)),null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(r.runConfig=l.dataform.RunConfig.toObject(e.runConfig,t)),e.actions&&e.actions.length){r.actions=[];for(var n=0;n<e.actions.length;++n)r.actions[n]=l.dataform.ExecutionAction.toObject(e.actions[n],t)}if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(r.warehouseState=l.dataform.WarehouseState.toObject(e.warehouseState,t)),e.declarationTargets&&e.declarationTargets.length)for(r.declarationTargets=[],n=0;n<e.declarationTargets.length;++n)r.declarationTargets[n]=l.dataform.Target.toObject(e.declarationTargets[n],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionGraph"},t}(),i.Timing=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.startTimeMillis=0,t.prototype.endTimeMillis=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.startTimeMillis&&Object.hasOwnProperty.call(e,"startTimeMillis")&&t.uint32(8).int64(e.startTimeMillis),null!=e.endTimeMillis&&Object.hasOwnProperty.call(e,"endTimeMillis")&&t.uint32(16).int64(e.endTimeMillis),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Timing;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.startTimeMillis=e.int64();break;case 2:n.endTimeMillis=e.int64();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&!(s.isInteger(e.startTimeMillis)||e.startTimeMillis&&s.isInteger(e.startTimeMillis.low)&&s.isInteger(e.startTimeMillis.high))?"startTimeMillis: integer|Long expected":null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&!(s.isInteger(e.endTimeMillis)||e.endTimeMillis&&s.isInteger(e.endTimeMillis.low)&&s.isInteger(e.endTimeMillis.high))?"endTimeMillis: integer|Long expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Timing)return e;var t=new l.dataform.Timing;return null!=e.startTimeMillis&&(s.Long?(t.startTimeMillis=s.Long.fromValue(e.startTimeMillis)).unsigned=!1:"string"==typeof e.startTimeMillis?t.startTimeMillis=parseInt(e.startTimeMillis,10):"number"==typeof e.startTimeMillis?t.startTimeMillis=e.startTimeMillis:"object"==typeof e.startTimeMillis&&(t.startTimeMillis=new s.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber())),null!=e.endTimeMillis&&(s.Long?(t.endTimeMillis=s.Long.fromValue(e.endTimeMillis)).unsigned=!1:"string"==typeof e.endTimeMillis?t.endTimeMillis=parseInt(e.endTimeMillis,10):"number"==typeof e.endTimeMillis?t.endTimeMillis=e.endTimeMillis:"object"==typeof e.endTimeMillis&&(t.endTimeMillis=new s.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.startTimeMillis=0,r.endTimeMillis=0),null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&("number"==typeof e.startTimeMillis?r.startTimeMillis=t.longs===String?String(e.startTimeMillis):e.startTimeMillis:r.startTimeMillis=t.longs===String?s.Long.prototype.toString.call(e.startTimeMillis):t.longs===Number?new s.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber():e.startTimeMillis),null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&("number"==typeof e.endTimeMillis?r.endTimeMillis=t.longs===String?String(e.endTimeMillis):e.endTimeMillis:r.endTimeMillis=t.longs===String?s.Long.prototype.toString.call(e.endTimeMillis):t.longs===Number?new s.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber():e.endTimeMillis),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Timing"},t}(),i.RunResult=function(){function t(e){if(this.actions=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.status=0,t.prototype.actions=s.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.actions&&e.actions.length)for(var r=0;r<e.actions.length;++r)l.dataform.ActionResult.encode(e.actions[r],t.uint32(18).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&l.dataform.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.RunResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.status=e.int32();break;case 2:n.actions&&n.actions.length||(n.actions=[]),n.actions.push(l.dataform.ActionResult.decode(e,e.uint32()));break;case 3:n.timing=l.dataform.Timing.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(r=l.dataform.ActionResult.verify(e.actions[t]))return"actions."+r}var r;return null!=e.timing&&e.hasOwnProperty("timing")&&(r=l.dataform.Timing.verify(e.timing))?"timing."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.RunResult)return e;var t=new l.dataform.RunResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"CANCELLED":case 4:t.status=4;break;case"TIMED_OUT":case 5:t.status=5}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".dataform.RunResult.actions: array expected");t.actions=[];for(var r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".dataform.RunResult.actions: object expected");t.actions[r]=l.dataform.ActionResult.fromObject(e.actions[r])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".dataform.RunResult.timing: object expected");t.timing=l.dataform.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.actions=[]),t.defaults&&(r.status=t.enums===String?"UNKNOWN":0,r.timing=null),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.RunResult.ExecutionStatus[e.status]?e.status:l.dataform.RunResult.ExecutionStatus[e.status]:e.status),e.actions&&e.actions.length){r.actions=[];for(var n=0;n<e.actions.length;++n)r.actions[n]=l.dataform.ActionResult.toObject(e.actions[n],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(r.timing=l.dataform.Timing.toObject(e.timing,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.RunResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="CANCELLED"]=4,t[e[5]="TIMED_OUT"]=5,t}(),t}(),i.ActionResult=function(){function t(e){if(this.tasks=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.status=0,t.prototype.tasks=s.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(16).int32(e.status),null!=e.tasks&&e.tasks.length)for(var r=0;r<e.tasks.length;++r)l.dataform.TaskResult.encode(e.tasks[r],t.uint32(26).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&l.dataform.Timing.encode(e.timing,t.uint32(34).fork()).ldelim(),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ActionResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 5:n.target=l.dataform.Target.decode(e,e.uint32());break;case 2:n.status=e.int32();break;case 3:n.tasks&&n.tasks.length||(n.tasks=[]),n.tasks.push(l.dataform.TaskResult.decode(e,e.uint32()));break;case 4:n.timing=l.dataform.Timing.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(var t=0;t<e.tasks.length;++t){var r;if(r=l.dataform.TaskResult.verify(e.tasks[t]))return"tasks."+r}}return null!=e.timing&&e.hasOwnProperty("timing")&&(r=l.dataform.Timing.verify(e.timing))?"timing."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.ActionResult)return e;var t=new l.dataform.ActionResult;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.ActionResult.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"DISABLED":case 5:t.status=5;break;case"CANCELLED":case 6:t.status=6}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".dataform.ActionResult.tasks: array expected");t.tasks=[];for(var r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".dataform.ActionResult.tasks: object expected");t.tasks[r]=l.dataform.TaskResult.fromObject(e.tasks[r])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".dataform.ActionResult.timing: object expected");t.timing=l.dataform.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tasks=[]),t.defaults&&(r.status=t.enums===String?"UNKNOWN":0,r.timing=null,r.target=null),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.ActionResult.ExecutionStatus[e.status]?e.status:l.dataform.ActionResult.ExecutionStatus[e.status]:e.status),e.tasks&&e.tasks.length){r.tasks=[];for(var n=0;n<e.tasks.length;++n)r.tasks[n]=l.dataform.TaskResult.toObject(e.tasks[n],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(r.timing=l.dataform.Timing.toObject(e.timing,t)),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ActionResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="DISABLED"]=5,t[e[6]="CANCELLED"]=6,t}(),t}(),i.ExecutionMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&l.dataform.ExecutionMetadata.BigqueryMetadata.encode(e.bigquery,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionMetadata;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.bigquery=l.dataform.ExecutionMetadata.BigqueryMetadata.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.bigquery&&e.hasOwnProperty("bigquery")){var t=l.dataform.ExecutionMetadata.BigqueryMetadata.verify(e.bigquery);if(t)return"bigquery."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionMetadata)return e;var t=new l.dataform.ExecutionMetadata;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".dataform.ExecutionMetadata.bigquery: object expected");t.bigquery=l.dataform.ExecutionMetadata.BigqueryMetadata.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.bigquery=null),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r.bigquery=l.dataform.ExecutionMetadata.BigqueryMetadata.toObject(e.bigquery,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionMetadata"},t.BigqueryMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.jobId="",t.prototype.totalBytesProcessed=0,t.prototype.totalBytesBilled=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.jobId&&Object.hasOwnProperty.call(e,"jobId")&&t.uint32(10).string(e.jobId),null!=e.totalBytesProcessed&&Object.hasOwnProperty.call(e,"totalBytesProcessed")&&t.uint32(16).int64(e.totalBytesProcessed),null!=e.totalBytesBilled&&Object.hasOwnProperty.call(e,"totalBytesBilled")&&t.uint32(24).int64(e.totalBytesBilled),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionMetadata.BigqueryMetadata;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.jobId=e.string();break;case 2:n.totalBytesProcessed=e.int64();break;case 3:n.totalBytesBilled=e.int64();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.jobId&&e.hasOwnProperty("jobId")&&!s.isString(e.jobId)?"jobId: string expected":null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&!(s.isInteger(e.totalBytesProcessed)||e.totalBytesProcessed&&s.isInteger(e.totalBytesProcessed.low)&&s.isInteger(e.totalBytesProcessed.high))?"totalBytesProcessed: integer|Long expected":null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&!(s.isInteger(e.totalBytesBilled)||e.totalBytesBilled&&s.isInteger(e.totalBytesBilled.low)&&s.isInteger(e.totalBytesBilled.high))?"totalBytesBilled: integer|Long expected":null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionMetadata.BigqueryMetadata)return e;var t=new l.dataform.ExecutionMetadata.BigqueryMetadata;return null!=e.jobId&&(t.jobId=String(e.jobId)),null!=e.totalBytesProcessed&&(s.Long?(t.totalBytesProcessed=s.Long.fromValue(e.totalBytesProcessed)).unsigned=!1:"string"==typeof e.totalBytesProcessed?t.totalBytesProcessed=parseInt(e.totalBytesProcessed,10):"number"==typeof e.totalBytesProcessed?t.totalBytesProcessed=e.totalBytesProcessed:"object"==typeof e.totalBytesProcessed&&(t.totalBytesProcessed=new s.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber())),null!=e.totalBytesBilled&&(s.Long?(t.totalBytesBilled=s.Long.fromValue(e.totalBytesBilled)).unsigned=!1:"string"==typeof e.totalBytesBilled?t.totalBytesBilled=parseInt(e.totalBytesBilled,10):"number"==typeof e.totalBytesBilled?t.totalBytesBilled=e.totalBytesBilled:"object"==typeof e.totalBytesBilled&&(t.totalBytesBilled=new s.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.jobId="",r.totalBytesProcessed=0,r.totalBytesBilled=0),null!=e.jobId&&e.hasOwnProperty("jobId")&&(r.jobId=e.jobId),null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&("number"==typeof e.totalBytesProcessed?r.totalBytesProcessed=t.longs===String?String(e.totalBytesProcessed):e.totalBytesProcessed:r.totalBytesProcessed=t.longs===String?s.Long.prototype.toString.call(e.totalBytesProcessed):t.longs===Number?new s.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber():e.totalBytesProcessed),null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&("number"==typeof e.totalBytesBilled?r.totalBytesBilled=t.longs===String?String(e.totalBytesBilled):e.totalBytesBilled:r.totalBytesBilled=t.longs===String?s.Long.prototype.toString.call(e.totalBytesBilled):t.longs===Number?new s.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber():e.totalBytesBilled),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionMetadata.BigqueryMetadata"},t}(),t}(),i.TaskResult=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.status=0,t.prototype.errorMessage="",t.prototype.timing=null,t.prototype.metadata=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.errorMessage&&Object.hasOwnProperty.call(e,"errorMessage")&&t.uint32(18).string(e.errorMessage),null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&l.dataform.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&l.dataform.ExecutionMetadata.encode(e.metadata,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.TaskResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.status=e.int32();break;case 2:n.errorMessage=e.string();break;case 3:n.timing=l.dataform.Timing.decode(e,e.uint32());break;case 4:n.metadata=l.dataform.ExecutionMetadata.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}return null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&!s.isString(e.errorMessage)?"errorMessage: string expected":null!=e.timing&&e.hasOwnProperty("timing")&&(t=l.dataform.Timing.verify(e.timing))?"timing."+t:null!=e.metadata&&e.hasOwnProperty("metadata")&&(t=l.dataform.ExecutionMetadata.verify(e.metadata))?"metadata."+t:null;var t},t.fromObject=function(e){if(e instanceof l.dataform.TaskResult)return e;var t=new l.dataform.TaskResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"CANCELLED":case 5:t.status=5}if(null!=e.errorMessage&&(t.errorMessage=String(e.errorMessage)),null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".dataform.TaskResult.timing: object expected");t.timing=l.dataform.Timing.fromObject(e.timing)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".dataform.TaskResult.metadata: object expected");t.metadata=l.dataform.ExecutionMetadata.fromObject(e.metadata)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.status=t.enums===String?"UNKNOWN":0,r.errorMessage="",r.timing=null,r.metadata=null),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.TaskResult.ExecutionStatus[e.status]?e.status:l.dataform.TaskResult.ExecutionStatus[e.status]:e.status),null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&(r.errorMessage=e.errorMessage),null!=e.timing&&e.hasOwnProperty("timing")&&(r.timing=l.dataform.Timing.toObject(e.timing,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=l.dataform.ExecutionMetadata.toObject(e.metadata,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TaskResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="CANCELLED"]=5,t}(),t}(),i.TestResult=function(){function t(e){if(this.messages=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.name="",t.prototype.successful=!1,t.prototype.messages=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.successful&&Object.hasOwnProperty.call(e,"successful")&&t.uint32(16).bool(e.successful),null!=e.messages&&e.messages.length)for(var r=0;r<e.messages.length;++r)t.uint32(26).string(e.messages[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.TestResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.name=e.string();break;case 2:n.successful=e.bool();break;case 3:n.messages&&n.messages.length||(n.messages=[]),n.messages.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name))return"name: string expected";if(null!=e.successful&&e.hasOwnProperty("successful")&&"boolean"!=typeof e.successful)return"successful: boolean expected";if(null!=e.messages&&e.hasOwnProperty("messages")){if(!Array.isArray(e.messages))return"messages: array expected";for(var t=0;t<e.messages.length;++t)if(!s.isString(e.messages[t]))return"messages: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.TestResult)return e;var t=new l.dataform.TestResult;if(null!=e.name&&(t.name=String(e.name)),null!=e.successful&&(t.successful=Boolean(e.successful)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".dataform.TestResult.messages: array expected");t.messages=[];for(var r=0;r<e.messages.length;++r)t.messages[r]=String(e.messages[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.messages=[]),t.defaults&&(r.name="",r.successful=!1),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.successful&&e.hasOwnProperty("successful")&&(r.successful=e.successful),e.messages&&e.messages.length){r.messages=[];for(var n=0;n<e.messages.length;++n)r.messages[n]=e.messages[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TestResult"},t}(),i.Field=function(){function t(e){if(this.flags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.name="",t.prototype.flags=s.emptyArray,t.prototype.primitive=null,t.prototype.struct=null,t.prototype.description="",Object.defineProperty(t.prototype,"type",{get:s.oneOfGetter(r=["primitive","struct"]),set:s.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.struct&&Object.hasOwnProperty.call(e,"struct")&&l.dataform.Fields.encode(e.struct,t.uint32(26).fork()).ldelim(),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.flags&&e.flags.length){t.uint32(50).fork();for(var r=0;r<e.flags.length;++r)t.int32(e.flags[r]);t.ldelim()}return null!=e.primitive&&Object.hasOwnProperty.call(e,"primitive")&&t.uint32(56).int32(e.primitive),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Field;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.name=e.string();break;case 6:if(n.flags&&n.flags.length||(n.flags=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)n.flags.push(e.int32());else n.flags.push(e.int32());break;case 7:n.primitive=e.int32();break;case 3:n.struct=l.dataform.Fields.decode(e,e.uint32());break;case 5:n.description=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name))return"name: string expected";if(null!=e.flags&&e.hasOwnProperty("flags")){if(!Array.isArray(e.flags))return"flags: array expected";for(var r=0;r<e.flags.length;++r)switch(e.flags[r]){default:return"flags: enum value[] expected";case 0:case 1:}}if(null!=e.primitive&&e.hasOwnProperty("primitive"))switch(t.type=1,e.primitive){default:return"primitive: enum value expected";case 0:case 1:case 2:case 5:case 3:case 4:case 6:case 7:case 8:case 9:case 10:case 11:case 12:}if(null!=e.struct&&e.hasOwnProperty("struct")){if(1===t.type)return"type: multiple values";t.type=1;var n=l.dataform.Fields.verify(e.struct);if(n)return"struct."+n}return null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description)?"description: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Field)return e;var t=new l.dataform.Field;if(null!=e.name&&(t.name=String(e.name)),e.flags){if(!Array.isArray(e.flags))throw TypeError(".dataform.Field.flags: array expected");t.flags=[];for(var r=0;r<e.flags.length;++r)switch(e.flags[r]){default:if("number"==typeof e.flags[r]){t.flags[r]=e.flags[r];break}case"UNKNOWN_FLAG":case 0:t.flags[r]=0;break;case"REPEATED":case 1:t.flags[r]=1}}switch(e.primitive){default:if("number"==typeof e.primitive){t.primitive=e.primitive;break}break;case"UNKNOWN":case 0:t.primitive=0;break;case"INTEGER":case 1:t.primitive=1;break;case"FLOAT":case 2:t.primitive=2;break;case"NUMERIC":case 5:t.primitive=5;break;case"BOOLEAN":case 3:t.primitive=3;break;case"STRING":case 4:t.primitive=4;break;case"DATE":case 6:t.primitive=6;break;case"DATETIME":case 7:t.primitive=7;break;case"TIMESTAMP":case 8:t.primitive=8;break;case"TIME":case 9:t.primitive=9;break;case"BYTES":case 10:t.primitive=10;break;case"ANY":case 11:t.primitive=11;break;case"GEOGRAPHY":case 12:t.primitive=12}if(null!=e.struct){if("object"!=typeof e.struct)throw TypeError(".dataform.Field.struct: object expected");t.struct=l.dataform.Fields.fromObject(e.struct)}return null!=e.description&&(t.description=String(e.description)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.flags=[]),t.defaults&&(r.name="",r.description=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.struct&&e.hasOwnProperty("struct")&&(r.struct=l.dataform.Fields.toObject(e.struct,t),t.oneofs&&(r.type="struct")),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.flags&&e.flags.length){r.flags=[];for(var n=0;n<e.flags.length;++n)r.flags[n]=t.enums===String?void 0===l.dataform.Field.Flag[e.flags[n]]?e.flags[n]:l.dataform.Field.Flag[e.flags[n]]:e.flags[n]}return null!=e.primitive&&e.hasOwnProperty("primitive")&&(r.primitive=t.enums===String?void 0===l.dataform.Field.Primitive[e.primitive]?e.primitive:l.dataform.Field.Primitive[e.primitive]:e.primitive,t.oneofs&&(r.type="primitive")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Field"},t.Primitive=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="INTEGER"]=1,t[e[2]="FLOAT"]=2,t[e[5]="NUMERIC"]=5,t[e[3]="BOOLEAN"]=3,t[e[4]="STRING"]=4,t[e[6]="DATE"]=6,t[e[7]="DATETIME"]=7,t[e[8]="TIMESTAMP"]=8,t[e[9]="TIME"]=9,t[e[10]="BYTES"]=10,t[e[11]="ANY"]=11,t[e[12]="GEOGRAPHY"]=12,t}(),t.Flag=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FLAG"]=0,t[e[1]="REPEATED"]=1,t}(),t}(),i.Fields=function(){function t(e){if(this.fields=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.fields=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.fields&&e.fields.length)for(var r=0;r<e.fields.length;++r)l.dataform.Field.encode(e.fields[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Fields;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.fields&&n.fields.length||(n.fields=[]),n.fields.push(l.dataform.Field.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var r=l.dataform.Field.verify(e.fields[t]);if(r)return"fields."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.Fields)return e;var t=new l.dataform.Fields;if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".dataform.Fields.fields: array expected");t.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".dataform.Fields.fields: object expected");t.fields[r]=l.dataform.Field.fromObject(e.fields[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.fields=[]),e.fields&&e.fields.length){r.fields=[];for(var n=0;n<e.fields.length;++n)r.fields[n]=l.dataform.Field.toObject(e.fields[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Fields"},t}(),i.TableMetadata=function(){function t(e){if(this.fields=[],this.labels={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.type=0,t.prototype.fields=s.emptyArray,t.prototype.description="",t.prototype.labels=s.emptyObject,t.prototype.lastUpdatedMillis=0,t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.fields&&e.fields.length)for(var r=0;r<e.fields.length;++r)l.dataform.Field.encode(e.fields[r],t.uint32(26).fork()).ldelim();if(null!=e.lastUpdatedMillis&&Object.hasOwnProperty.call(e,"lastUpdatedMillis")&&t.uint32(32).int64(e.lastUpdatedMillis),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(48).int32(e.type),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.uint32(58).fork().uint32(10).string(n[r]).uint32(18).string(e.labels[n[r]]).ldelim()}return null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&l.dataform.TableMetadata.BigQuery.encode(e.bigquery,t.uint32(66).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.TableMetadata;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.target=l.dataform.Target.decode(e,e.uint32());break;case 6:a.type=e.int32();break;case 3:a.fields&&a.fields.length||(a.fields=[]),a.fields.push(l.dataform.Field.decode(e,e.uint32()));break;case 5:a.description=e.string();break;case 7:a.labels===s.emptyObject&&(a.labels={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.labels[r]=n;break;case 4:a.lastUpdatedMillis=e.int64();break;case 8:a.bigquery=l.dataform.TableMetadata.BigQuery.decode(e,e.uint32());break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:}if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var r;if(r=l.dataform.Field.verify(e.fields[t]))return"fields."+r}}if(null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description))return"description: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!s.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!s.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}return null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&!(s.isInteger(e.lastUpdatedMillis)||e.lastUpdatedMillis&&s.isInteger(e.lastUpdatedMillis.low)&&s.isInteger(e.lastUpdatedMillis.high))?"lastUpdatedMillis: integer|Long expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r=l.dataform.TableMetadata.BigQuery.verify(e.bigquery))?"bigquery."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.TableMetadata)return e;var t=new l.dataform.TableMetadata;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.TableMetadata.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}switch(e.type){default:if("number"==typeof e.type){t.type=e.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"TABLE":case 1:t.type=1;break;case"VIEW":case 2:t.type=2}if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".dataform.TableMetadata.fields: array expected");t.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".dataform.TableMetadata.fields: object expected");t.fields[r]=l.dataform.Field.fromObject(e.fields[r])}}if(null!=e.description&&(t.description=String(e.description)),e.labels){if("object"!=typeof e.labels)throw TypeError(".dataform.TableMetadata.labels: object expected");t.labels={};var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.labels[n[r]]=String(e.labels[n[r]])}if(null!=e.lastUpdatedMillis&&(s.Long?(t.lastUpdatedMillis=s.Long.fromValue(e.lastUpdatedMillis)).unsigned=!1:"string"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=parseInt(e.lastUpdatedMillis,10):"number"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=e.lastUpdatedMillis:"object"==typeof e.lastUpdatedMillis&&(t.lastUpdatedMillis=new s.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber())),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".dataform.TableMetadata.bigquery: object expected");t.bigquery=l.dataform.TableMetadata.BigQuery.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.arrays||t.defaults)&&(n.fields=[]),(t.objects||t.defaults)&&(n.labels={}),t.defaults&&(n.target=null,n.lastUpdatedMillis=0,n.description="",n.type=t.enums===String?"UNKNOWN":0,n.bigquery=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=l.dataform.Target.toObject(e.target,t)),e.fields&&e.fields.length){n.fields=[];for(var i=0;i<e.fields.length;++i)n.fields[i]=l.dataform.Field.toObject(e.fields[i],t)}if(null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&("number"==typeof e.lastUpdatedMillis?n.lastUpdatedMillis=t.longs===String?String(e.lastUpdatedMillis):e.lastUpdatedMillis:n.lastUpdatedMillis=t.longs===String?s.Long.prototype.toString.call(e.lastUpdatedMillis):t.longs===Number?new s.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber():e.lastUpdatedMillis),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.type&&e.hasOwnProperty("type")&&(n.type=t.enums===String?void 0===l.dataform.TableMetadata.Type[e.type]?e.type:l.dataform.TableMetadata.Type[e.type]:e.type),e.labels&&(r=Object.keys(e.labels)).length)for(n.labels={},i=0;i<r.length;++i)n.labels[r[i]]=e.labels[r[i]];return null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=l.dataform.TableMetadata.BigQuery.toObject(e.bigquery,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TableMetadata"},t.Type=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="TABLE"]=1,t[e[2]="VIEW"]=2,t}(),t.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.hasStreamingBuffer=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.hasStreamingBuffer&&Object.hasOwnProperty.call(e,"hasStreamingBuffer")&&t.uint32(8).bool(e.hasStreamingBuffer),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.TableMetadata.BigQuery;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.hasStreamingBuffer=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&"boolean"!=typeof e.hasStreamingBuffer?"hasStreamingBuffer: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.TableMetadata.BigQuery)return e;var t=new l.dataform.TableMetadata.BigQuery;return null!=e.hasStreamingBuffer&&(t.hasStreamingBuffer=Boolean(e.hasStreamingBuffer)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.hasStreamingBuffer=!1),null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&(r.hasStreamingBuffer=e.hasStreamingBuffer),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TableMetadata.BigQuery"},t}(),t}(),i.JDBC=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.host="",t.prototype.port=0,t.prototype.username="",t.prototype.password="",t.prototype.databaseName="",t.prototype.ssl=null,t.prototype.sshTunnel=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(18).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(24).int32(e.port),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(34).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(42).string(e.password),null!=e.databaseName&&Object.hasOwnProperty.call(e,"databaseName")&&t.uint32(50).string(e.databaseName),null!=e.sshTunnel&&Object.hasOwnProperty.call(e,"sshTunnel")&&l.dataform.JDBC.SshTunnel.encode(e.sshTunnel,t.uint32(58).fork()).ldelim(),null!=e.ssl&&Object.hasOwnProperty.call(e,"ssl")&&l.dataform.JDBC.SslConfiguration.encode(e.ssl,t.uint32(66).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.JDBC;e.pos<r;){var i=e.uint32();switch(i>>>3){case 2:n.host=e.string();break;case 3:n.port=e.int32();break;case 4:n.username=e.string();break;case 5:n.password=e.string();break;case 6:n.databaseName=e.string();break;case 8:n.ssl=l.dataform.JDBC.SslConfiguration.decode(e,e.uint32());break;case 7:n.sshTunnel=l.dataform.JDBC.SshTunnel.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!s.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.databaseName&&e.hasOwnProperty("databaseName")&&!s.isString(e.databaseName)?"databaseName: string expected":null!=e.ssl&&e.hasOwnProperty("ssl")&&(t=l.dataform.JDBC.SslConfiguration.verify(e.ssl))?"ssl."+t:null!=e.sshTunnel&&e.hasOwnProperty("sshTunnel")&&(t=l.dataform.JDBC.SshTunnel.verify(e.sshTunnel))?"sshTunnel."+t:null;var t},t.fromObject=function(e){if(e instanceof l.dataform.JDBC)return e;var t=new l.dataform.JDBC;if(null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=0|e.port),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.databaseName&&(t.databaseName=String(e.databaseName)),null!=e.ssl){if("object"!=typeof e.ssl)throw TypeError(".dataform.JDBC.ssl: object expected");t.ssl=l.dataform.JDBC.SslConfiguration.fromObject(e.ssl)}if(null!=e.sshTunnel){if("object"!=typeof e.sshTunnel)throw TypeError(".dataform.JDBC.sshTunnel: object expected");t.sshTunnel=l.dataform.JDBC.SshTunnel.fromObject(e.sshTunnel)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.host="",r.port=0,r.username="",r.password="",r.databaseName="",r.sshTunnel=null,r.ssl=null),null!=e.host&&e.hasOwnProperty("host")&&(r.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=e.databaseName),null!=e.sshTunnel&&e.hasOwnProperty("sshTunnel")&&(r.sshTunnel=l.dataform.JDBC.SshTunnel.toObject(e.sshTunnel,t)),null!=e.ssl&&e.hasOwnProperty("ssl")&&(r.ssl=l.dataform.JDBC.SslConfiguration.toObject(e.ssl,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.JDBC"},t.SslConfiguration=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.serverCertificate="",t.prototype.clientCertificate="",t.prototype.clientPrivateKey="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.serverCertificate&&Object.hasOwnProperty.call(e,"serverCertificate")&&t.uint32(10).string(e.serverCertificate),null!=e.clientCertificate&&Object.hasOwnProperty.call(e,"clientCertificate")&&t.uint32(18).string(e.clientCertificate),null!=e.clientPrivateKey&&Object.hasOwnProperty.call(e,"clientPrivateKey")&&t.uint32(26).string(e.clientPrivateKey),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.JDBC.SslConfiguration;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.serverCertificate=e.string();break;case 2:n.clientCertificate=e.string();break;case 3:n.clientPrivateKey=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.serverCertificate&&e.hasOwnProperty("serverCertificate")&&!s.isString(e.serverCertificate)?"serverCertificate: string expected":null!=e.clientCertificate&&e.hasOwnProperty("clientCertificate")&&!s.isString(e.clientCertificate)?"clientCertificate: string expected":null!=e.clientPrivateKey&&e.hasOwnProperty("clientPrivateKey")&&!s.isString(e.clientPrivateKey)?"clientPrivateKey: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.JDBC.SslConfiguration)return e;var t=new l.dataform.JDBC.SslConfiguration;return null!=e.serverCertificate&&(t.serverCertificate=String(e.serverCertificate)),null!=e.clientCertificate&&(t.clientCertificate=String(e.clientCertificate)),null!=e.clientPrivateKey&&(t.clientPrivateKey=String(e.clientPrivateKey)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serverCertificate="",r.clientCertificate="",r.clientPrivateKey=""),null!=e.serverCertificate&&e.hasOwnProperty("serverCertificate")&&(r.serverCertificate=e.serverCertificate),null!=e.clientCertificate&&e.hasOwnProperty("clientCertificate")&&(r.clientCertificate=e.clientCertificate),null!=e.clientPrivateKey&&e.hasOwnProperty("clientPrivateKey")&&(r.clientPrivateKey=e.clientPrivateKey),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.JDBC.SslConfiguration"},t}(),t.SshTunnel=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.privateKey="",t.prototype.username="",t.prototype.password="",t.prototype.host="",t.prototype.port=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.privateKey&&Object.hasOwnProperty.call(e,"privateKey")&&t.uint32(10).string(e.privateKey),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(18).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(26).string(e.password),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(34).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(40).int32(e.port),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.JDBC.SshTunnel;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.privateKey=e.string();break;case 2:n.username=e.string();break;case 3:n.password=e.string();break;case 4:n.host=e.string();break;case 5:n.port=e.int32();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.privateKey&&e.hasOwnProperty("privateKey")&&!s.isString(e.privateKey)?"privateKey: string expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.host&&e.hasOwnProperty("host")&&!s.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null},t.fromObject=function(e){if(e instanceof l.dataform.JDBC.SshTunnel)return e;var t=new l.dataform.JDBC.SshTunnel;return null!=e.privateKey&&(t.privateKey=String(e.privateKey)),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=0|e.port),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.privateKey="",r.username="",r.password="",r.host="",r.port=0),null!=e.privateKey&&e.hasOwnProperty("privateKey")&&(r.privateKey=e.privateKey),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.host&&e.hasOwnProperty("host")&&(r.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.JDBC.SshTunnel"},t}(),t}(),i.Snowflake=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.accountId="",t.prototype.username="",t.prototype.password="",t.prototype.role="",t.prototype.databaseName="",t.prototype.warehouse="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&t.uint32(18).string(e.accountId),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(26).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(34).string(e.password),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(42).string(e.role),null!=e.databaseName&&Object.hasOwnProperty.call(e,"databaseName")&&t.uint32(50).string(e.databaseName),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(58).string(e.warehouse),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Snowflake;e.pos<r;){var i=e.uint32();switch(i>>>3){case 2:n.accountId=e.string();break;case 3:n.username=e.string();break;case 4:n.password=e.string();break;case 5:n.role=e.string();break;case 6:n.databaseName=e.string();break;case 7:n.warehouse=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.accountId&&e.hasOwnProperty("accountId")&&!s.isString(e.accountId)?"accountId: string expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.role&&e.hasOwnProperty("role")&&!s.isString(e.role)?"role: string expected":null!=e.databaseName&&e.hasOwnProperty("databaseName")&&!s.isString(e.databaseName)?"databaseName: string expected":null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!s.isString(e.warehouse)?"warehouse: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Snowflake)return e;var t=new l.dataform.Snowflake;return null!=e.accountId&&(t.accountId=String(e.accountId)),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.role&&(t.role=String(e.role)),null!=e.databaseName&&(t.databaseName=String(e.databaseName)),null!=e.warehouse&&(t.warehouse=String(e.warehouse)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.accountId="",r.username="",r.password="",r.role="",r.databaseName="",r.warehouse=""),null!=e.accountId&&e.hasOwnProperty("accountId")&&(r.accountId=e.accountId),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.role&&e.hasOwnProperty("role")&&(r.role=e.role),null!=e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=e.databaseName),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(r.warehouse=e.warehouse),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Snowflake"},t}(),i.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectId="",t.prototype.credentials="",t.prototype.location="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.projectId&&Object.hasOwnProperty.call(e,"projectId")&&t.uint32(10).string(e.projectId),null!=e.credentials&&Object.hasOwnProperty.call(e,"credentials")&&t.uint32(26).string(e.credentials),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(34).string(e.location),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.BigQuery;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectId=e.string();break;case 3:n.credentials=e.string();break;case 4:n.location=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectId&&e.hasOwnProperty("projectId")&&!s.isString(e.projectId)?"projectId: string expected":null!=e.credentials&&e.hasOwnProperty("credentials")&&!s.isString(e.credentials)?"credentials: string expected":null!=e.location&&e.hasOwnProperty("location")&&!s.isString(e.location)?"location: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.BigQuery)return e;var t=new l.dataform.BigQuery;return null!=e.projectId&&(t.projectId=String(e.projectId)),null!=e.credentials&&(t.credentials=String(e.credentials)),null!=e.location&&(t.location=String(e.location)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.projectId="",r.credentials="",r.location=""),null!=e.projectId&&e.hasOwnProperty("projectId")&&(r.projectId=e.projectId),null!=e.credentials&&e.hasOwnProperty("credentials")&&(r.credentials=e.credentials),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.BigQuery"},t}(),i.SQLDataWarehouse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.server="",t.prototype.port=0,t.prototype.username="",t.prototype.password="",t.prototype.database="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.server&&Object.hasOwnProperty.call(e,"server")&&t.uint32(10).string(e.server),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).int32(e.port),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(26).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(34).string(e.password),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(42).string(e.database),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.SQLDataWarehouse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.server=e.string();break;case 2:n.port=e.int32();break;case 3:n.username=e.string();break;case 4:n.password=e.string();break;case 5:n.database=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.server&&e.hasOwnProperty("server")&&!s.isString(e.server)?"server: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.database&&e.hasOwnProperty("database")&&!s.isString(e.database)?"database: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.SQLDataWarehouse)return e;var t=new l.dataform.SQLDataWarehouse;return null!=e.server&&(t.server=String(e.server)),null!=e.port&&(t.port=0|e.port),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.database&&(t.database=String(e.database)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.server="",r.port=0,r.username="",r.password="",r.database=""),null!=e.server&&e.hasOwnProperty("server")&&(r.server=e.server),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.database&&e.hasOwnProperty("database")&&(r.database=e.database),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.SQLDataWarehouse"},t}(),i.Presto=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.host="",t.prototype.port=0,t.prototype.user="",t.prototype.catalog="",t.prototype.schema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(10).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).int32(e.port),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(26).string(e.user),null!=e.catalog&&Object.hasOwnProperty.call(e,"catalog")&&t.uint32(34).string(e.catalog),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(42).string(e.schema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Presto;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.host=e.string();break;case 2:n.port=e.int32();break;case 3:n.user=e.string();break;case 4:n.catalog=e.string();break;case 5:n.schema=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!s.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null!=e.user&&e.hasOwnProperty("user")&&!s.isString(e.user)?"user: string expected":null!=e.catalog&&e.hasOwnProperty("catalog")&&!s.isString(e.catalog)?"catalog: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!s.isString(e.schema)?"schema: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Presto)return e;var t=new l.dataform.Presto;return null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=0|e.port),null!=e.user&&(t.user=String(e.user)),null!=e.catalog&&(t.catalog=String(e.catalog)),null!=e.schema&&(t.schema=String(e.schema)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.host="",r.port=0,r.user="",r.catalog="",r.schema=""),null!=e.host&&e.hasOwnProperty("host")&&(r.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),null!=e.user&&e.hasOwnProperty("user")&&(r.user=e.user),null!=e.catalog&&e.hasOwnProperty("catalog")&&(r.catalog=e.catalog),null!=e.schema&&e.hasOwnProperty("schema")&&(r.schema=e.schema),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Presto"},t}(),i.server=((n={}).Empty=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.server.Empty;e.pos<r;){var i=e.uint32();e.skipType(7&i)}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},t.fromObject=function(e){return e instanceof l.dataform.server.Empty?e:new l.dataform.server.Empty},t.toObject=function(){return{}},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.server.Empty"},t}(),n.MetadataResponse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectDir="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.projectDir&&Object.hasOwnProperty.call(e,"projectDir")&&t.uint32(10).string(e.projectDir),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.server.MetadataResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectDir=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectDir&&e.hasOwnProperty("projectDir")&&!s.isString(e.projectDir)?"projectDir: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.server.MetadataResponse)return e;var t=new l.dataform.server.MetadataResponse;return null!=e.projectDir&&(t.projectDir=String(e.projectDir)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.projectDir=""),null!=e.projectDir&&e.hasOwnProperty("projectDir")&&(r.projectDir=e.projectDir),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.server.MetadataResponse"},t}(),n.Service=function(){function t(t,r,n){e.rpc.Service.call(this,t,r,n)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,r){return new this(e,t,r)},Object.defineProperty(t.prototype.metadata=function e(t,r){return this.rpcCall(e,l.dataform.server.Empty,l.dataform.server.MetadataResponse,t,r)},"name",{value:"Metadata"}),t}(),n),i),l})?n.apply(t,i):n)||(e.exports=o)},function(e,t,r){"use strict";var n,i,o=e.exports=r(7),a=r(50);o.codegen=r(114),o.fetch=r(115),o.path=r(116),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var s=/\\/g,l=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(s,"\\\\").replace(l,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var c=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(c,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;n||(n=r(33));var i=new n(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var u=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=r(6));var t=new i("Enum"+u++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var i=r.shift();if("__proto__"===i||"prototype"===i)return t;if(r.length>0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(38)))}})},function(e,t,r){const n=r(18),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(17),{safeRe:a,t:s}=r(14),l=r(22),{compareIdentifiers:c}=r(42);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return c(r,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return c(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error("invalid increment argument: "+e)}return this.raw=this.format(),this.build.length&&(this.raw+="+"+this.build.join(".")),this}}e.exports=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);function i(e){return e.split(t.pathSeperator).slice(-1)[0].split(".")[0]}t.pathSeperator="undefined"!=typeof process&&"win32"===process.platform?"\\":"/",t.baseFilename=i,t.getEscapedFileName=function(e){return i(e).replace(/\\/g,"\\\\")},t.matchPatterns=function(e,t){const r=[];return e.forEach(e=>{if(e.includes("."))t.includes(e)&&r.push(e);else{const n=t.filter(t=>e===t.split(".").slice(-1)[0]);if(0===n.length)return;if(n.length>1)throw new Error(s(e,n));r.push(n[0])}}),r},t.getCallerFile=function(e){let r;const n=function(){const e=Error.stackTraceLimit,t=Error.prepareStackTrace;try{return Error.stackTraceLimit=Number.POSITIVE_INFINITY,Error.prepareStackTrace=(e,t)=>t,(new Error).stack}finally{Error.stackTraceLimit=e,Error.prepareStackTrace=t}}();for(;n.length;){const i=n.shift().getFileName();if(i&&(i.includes(e)&&!i.includes("node_modules")&&(r=i,i.includes("definitions"+t.pathSeperator)||i.includes("models"+t.pathSeperator))))break}if(!r)throw new Error("Unable to find valid caller file; please report this issue.");return function(e,r){if(0===r.length)return e;const n=e.substr(r.length);return n.startsWith(t.pathSeperator)?n.substr(1):n}(r,e)},t.graphHasErrors=function(e){var t;return(null===(t=e.graphErrors)||void 0===t?void 0:t.compilationErrors.length)>0};const o="Invalid input. Accepted inputs include: a single object containing an (optional) 'database', (optional) 'schema', and 'name', or 1-3 inputs consisting of an (optional) database, (optional) schema, and 'name'.";function a(e){return"string"==typeof e?e:JSON.stringify(e)}function s(e,t){const r="string"==typeof t[0]?t:t.map(e=>`${e.proto.target.schema}.${e.proto.target.name}`);return`Ambiguous Action name: ${a(e)}. Did you mean one of: ${r.join(", ")}.`}function l(e,t,r,i,o){return i=i||t.defaultSchema,o=o||t.defaultDatabase,n.dataform.Target.create({name:e.normalizeIdentifier(r),schema:i?e.normalizeIdentifier(i||t.defaultSchema):void 0,database:o?e.normalizeIdentifier(o):void 0})}function c(e,t){switch(e){case"table":return n.dataform.TableType.TABLE;case"incremental":return n.dataform.TableType.INCREMENTAL;case"view":return n.dataform.TableType.VIEW;case"inline":return n.dataform.TableType.INLINE;default:if(t)throw new Error("Unexpected table type: "+e);return n.dataform.TableType.UNKNOWN_TYPE}}function u(e){return n.dataform.TableType[e].toLowerCase()}t.toResolvable=function(e,t=[]){if(Array.isArray(e)&&t.length>0)throw new Error(o);if(0===t.length&&!Array.isArray(e))return e;const r=Array.isArray(e)?e.reverse():[e,...t].reverse();if(!function(e){if(e.some(e=>"string"!=typeof e))return!1;return e.length>0&&e.length<=3}(r))throw new Error(o);const[n,i,a]=r;return{database:a,schema:i,name:n}},t.resolvableAsTarget=function(e){return"string"==typeof e?{name:e}:e},t.stringifyResolvable=a,t.ambiguousActionNameMsg=s,t.target=l,t.setNameAndTarget=function(e,t,r,n,i){t.target=l(e.adapter(),e.config,r,n,i),t.canonicalTarget=l(e.adapter(),e.canonicalConfig,r,n,i)},t.strictKeysOf=function(){return e=>e},t.checkExcessProperties=function(e,t,r,n){const i=Object.keys(t).filter(e=>!r.includes(e));i.length>0&&e(new Error(`Unexpected property "${i[0]}"${n?" in "+n:""}. Supported properties are: ${JSON.stringify(r)}`))},t.validateQueryString=function(e,t,r){";"===(null==t?void 0:t.trim().slice(-1))&&e.compileError(new Error("Semi-colons are not allowed at the end of SQL statements."),r)},t.throwIfInvalid=function(e,t){const r=t(e);if(r)throw new Error(r)},t.tableTypeStringToEnum=c,t.tableTypeEnumToString=u,t.setOrValidateTableEnumType=function(e){let t=null;if(""!==e.type&&void 0!==e.type&&(t=c(e.type,!0)),e.enumType===n.dataform.TableType.UNKNOWN_TYPE||void 0===e.enumType)e.enumType=t;else if(null!==t&&e.enumType!==t)throw new Error(`Table str type "${e.type}" and enumType "${u(e.enumType)}" are not equivalent.`)}},function(e,t,r){const n=r(2);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},function(e,t,r){class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(e=>this.parseRange(e)).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!m(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&y))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,x(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],p),s("comparator trim",e);let l=(e=(e=e.replace(c[u.TILDETRIM],f)).replace(c[u.CARETTRIM],d)).split(" ").map(e=>O(e,this.options)).join(" ").split(/\s+/).map(e=>k(e,this.options));n&&(l=l.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),s("range list",l);const g=new Map,b=l.map(e=>new a(e,this.options));for(const e of b){if(m(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const v=[...g.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some(r=>b(r,t)&&e.set.some(e=>b(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(N(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const i=new(r(79))({max:1e3}),o=r(22),a=r(20),s=r(18),l=r(2),{safeRe:c,t:u,comparatorTrimReplace:p,tildeTrimReplace:f,caretTrimReplace:d}=r(14),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:y}=r(17),m=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,b=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},O=(e,t)=>(s("comp",e,t),e=E(e,t),s("caret",e),e=T(e,t),s("tildes",e),e=j(e,t),s("xrange",e),e=A(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,T=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,(t,r,n,i,o)=>{let a;return s("tilde",e,t,r,n,i,o),v(r)?a="":v(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:v(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(s("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,s("tilde return",a),a})},E=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{s("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,a)=>{let l;return s("caret",e,t,r,i,o,a),v(r)?l="":v(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(o)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),s("caret return",l),l})},j=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>P(e,t)).join(" ")),P=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,(r,n,i,o,a,l)=>{s("xRange",e,r,n,i,o,a,l);const c=v(i),u=c||v(o),p=u||v(a),f=p;return"="===n&&f&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(o=0),a=0,">"===n?(n=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),"<"===n&&(l="-0"),r=`${n+i}.${o}.${a}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:p&&(r=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),s("xRange return",r),r})},A=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),k=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),x=e=>(t,r,n,i,o,a,s,l,c,u,p,f,d)=>`${r=v(n)?"":v(i)?`>=${n}.0.0${e?"-0":""}`:v(o)?`>=${n}.${i}.0${e?"-0":""}`:a?">="+r:`>=${r}${e?"-0":""}`} ${l=v(c)?"":v(u)?`<${+c+1}.0.0-0`:v(p)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${p}-${f}`:e?`<${c}.${u}.${+p+1}-0`:"<="+l}`.trim(),N=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},function(e,t,r){"use strict";e.exports=a;var n=r(11);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var i=r(15),o=r(1);function a(e,t,r,i,o,a){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.valuesOptions=a,this.reserved=void 0,t)for(var s=Object.keys(t),l=0;l<s.length;++l)"number"==typeof t[s[l]]&&(this.valuesById[this.values[s[l]]=t[s[l]]]=s[l])}a.fromJSON=function(e,t){var r=new a(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},a.prototype.add=function(e,t,r,n){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return n&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=r||null,this},a.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=r(47),n.base64=r(93),n.EventEmitter=r(94),n.float=r(95),n.inquire=r(48),n.utf8=r(96),n.pool=r(97),n.LongBits=r(98),n.isNode=Boolean("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),n.global=n.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);function i(e,t){return e.filter(e=>!!e).map(e=>e.trim()).map(e=>e.length>0&&";"===e.charAt(e.length-1)?e.substring(0,e.length-1):e).map(e=>t?t(e):e).join("\n;\n")}t.concatenateQueries=i;class o{constructor(){this.tasks=[]}static create(){return new o}add(e){return this.tasks.push(e),this}addAll(e){return this.tasks=this.tasks.concat(e.tasks),this}build(){return this.tasks.map(e=>e.build())}concatenate(){return o.create().add(a.statement(i(this.tasks.map(e=>e.getStatement()))))}}t.Tasks=o;class a{constructor(){this.proto=n.dataform.ExecutionTask.create()}static create(){return new a}static statement(e){return a.create().type("statement").statement(e)}static assertion(e){return a.create().type("assertion").statement(e)}type(e){return this.proto.type=e,this}statement(e){return this.proto.statement=e,this}getStatement(){return this.proto.statement}build(){return n.dataform.ExecutionTask.create(this.proto)}}t.Task=a},function(e,t,r){"use strict";e.exports=c;var n=r(11);((c.prototype=Object.create(n.prototype)).constructor=c).className="Field";var i,o=r(6),a=r(12),s=r(1),l=/^required|optional|repeated$/;function c(e,t,r,i,o,c,u){if(s.isObject(i)?(u=o,c=i,i=o=void 0):s.isObject(o)&&(u=c,c=o,o=void 0),n.call(this,e,c),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!l.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!s.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=u}c.fromJSON=function(e,t){return new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(c.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),c.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},c.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(i,o){s.decorateType(i.constructor).add(new c(o,e,t,r,{default:n}))}},c._configure=function(e){i=e}},function(e,t,r){const n=r(2);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},function(e,t,r){"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(1);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var a=o[e];i.setProperty(a,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var s={};s[e]=t,n.push(s)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},o.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},o._configure=function(e){n=e}},function(e,t,r){"use strict";var n=t,i=r(1),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}n.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),n.long=a([0,0,0,1,1],7),n.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(41)),o=r(8),a=r(3),s=r(0);t.Adapter=class{constructor(e){this.dataformCoreVersion=e}normalizeIdentifier(e){return e}sqlString(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}dropIfExists(e,t){return`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)} ${t===s.dataform.TableMetadata.Type.TABLE?"cascade":""}`}baseTableType(e){switch(e){case s.dataform.TableType.TABLE:case s.dataform.TableType.INCREMENTAL:return s.dataform.TableMetadata.Type.TABLE;case s.dataform.TableType.VIEW:return s.dataform.TableMetadata.Type.VIEW;default:throw new Error("Unexpected table type: "+a.tableTypeEnumToString(e))}}tableTypeAsSql(e){switch(e){case s.dataform.TableMetadata.Type.TABLE:return"table";case s.dataform.TableMetadata.Type.VIEW:return"view";default:throw new Error("Unexpected table type: "+e)}}indexAssertion(e,t){const r=t.join(", ");return`\nSELECT\n *\nFROM (\n SELECT\n ${r},\n COUNT(1) AS index_row_count\n FROM ${e}\n GROUP BY ${r}\n ) AS data\nWHERE index_row_count > 1\n`}rowConditionsAssertion(e,t){return t.map(t=>`\nSELECT\n ${this.sqlString(t)} AS failing_row_condition,\n *\nFROM ${e}\nWHERE NOT (${t})\n`).join("UNION ALL")}insertInto(e,t,r){return`\t\ninsert into ${this.resolveTarget(e)}\t\n(${t.join(",")})\t\nselect ${t.join(",")}\t\nfrom (${r}) as insertions`}oppositeTableType(e){switch(e){case s.dataform.TableMetadata.Type.TABLE:return s.dataform.TableMetadata.Type.VIEW;case s.dataform.TableMetadata.Type.VIEW:return s.dataform.TableMetadata.Type.TABLE;default:throw new Error("Unexpected table type: "+e)}}where(e,t){return t?`\n select * from (${e}) as subquery\n where ${t}`:e}shouldWriteIncrementally(e,t){return!e.fullRefresh&&t&&t.type!==s.dataform.TableMetadata.Type.VIEW}preOps(e,t,r){let n=e.preOps;return i.gt(this.dataformCoreVersion,"1.4.8")&&e.enumType===s.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)&&(n=e.incrementalPreOps),(n||[]).map(e=>o.Task.statement(e))}postOps(e,t,r){let n=e.postOps;return i.gt(this.dataformCoreVersion,"1.4.8")&&e.enumType===s.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)&&(n=e.incrementalPostOps),(n||[]).map(e=>o.Task.statement(e))}}},function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n}=r(17),i=r(18),o=(t=e.exports={}).re=[],a=t.safeRe=[],s=t.src=[],l=t.t={};let c=0;const u=(e,t,r)=>{const n=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),u=c++;i(e,u,t),l[e]=u,s[u]=t,o[u]=new RegExp(t,r?"g":void 0),a[u]=new RegExp(n,r?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[l.NUMERICIDENTIFIER]})\\.(${s[l.NUMERICIDENTIFIER]})\\.(${s[l.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[l.NUMERICIDENTIFIERLOOSE]})\\.(${s[l.NUMERICIDENTIFIERLOOSE]})\\.(${s[l.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[l.NUMERICIDENTIFIER]}|${s[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[l.NUMERICIDENTIFIERLOOSE]}|${s[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[l.PRERELEASEIDENTIFIER]}(?:\\.${s[l.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[l.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[l.BUILDIDENTIFIER]}(?:\\.${s[l.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[l.MAINVERSION]}${s[l.PRERELEASE]}?${s[l.BUILD]}?`),u("FULL",`^${s[l.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[l.MAINVERSIONLOOSE]}${s[l.PRERELEASELOOSE]}?${s[l.BUILD]}?`),u("LOOSE",`^${s[l.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",s[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),u("XRANGEIDENTIFIER",s[l.NUMERICIDENTIFIER]+"|x|X|\\*"),u("XRANGEPLAIN",`[v=\\s]*(${s[l.XRANGEIDENTIFIER]})(?:\\.(${s[l.XRANGEIDENTIFIER]})(?:\\.(${s[l.XRANGEIDENTIFIER]})(?:${s[l.PRERELEASE]})?${s[l.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[l.XRANGEIDENTIFIERLOOSE]})(?:${s[l.PRERELEASELOOSE]})?${s[l.BUILD]}?)?)?`),u("XRANGE",`^${s[l.GTLT]}\\s*${s[l.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[l.GTLT]}\\s*${s[l.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),u("COERCERTL",s[l.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${s[l.LONETILDE]}${s[l.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[l.LONETILDE]}${s[l.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${s[l.LONECARET]}${s[l.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[l.LONECARET]}${s[l.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[l.GTLT]}\\s*(${s[l.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[l.GTLT]}\\s*(${s[l.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[l.GTLT]}\\s*(${s[l.LOOSEPLAIN]}|${s[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[l.XRANGEPLAIN]})\\s+-\\s+(${s[l.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[l.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},function(e,t,r){"use strict";e.exports=p;var n=r(11);((p.prototype=Object.create(n.prototype)).constructor=p).className="Namespace";var i,o,a,s=r(9),l=r(1),c=r(16);function u(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function p(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function f(e){return e._nestedArray=null,e}p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=u,p.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},p.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=l.toArray(this.nested))}}),p.prototype.toJSON=function(e){return l.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},p.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?s.fromJSON:p.fromJSON)(r[n],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof i||e instanceof c||e instanceof a||e instanceof o||e instanceof p))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof p&&e instanceof p)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),f(this)},p.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),f(this)},p.prototype.define=function(e,t){if(l.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof p))throw Error("path conflicts with non-namespace objects")}else r.add(r=new p(n))}return t&&r.addJSON(t),r},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this.resolve()},p.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),l.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof p&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof p&&(n=this._nestedArray[i].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},p.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},p.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._configure=function(e,t,r){i=e,o=t,a=r}},function(e,t,r){"use strict";e.exports=a;var n=r(11);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var i=r(9),o=r(1);function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},function(e,t){const r=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},function(e,t){const r="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)>0},function(e,t,r){const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):(!(t=o(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=i;const o=r(22),{safeRe:a,t:s}=r(14),l=r(45),c=r(18),u=r(2),p=r(5)},function(e,t,r){const n=r(5);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},function(e,t){const r=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?r:e:n},function(e,t,r){const n=r(2);e.exports=(e,t,r)=>{const i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)<0},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)>=0},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)<=0},function(e,t,r){const n=r(2),i=r(20),{ANY:o}=i,a=r(5),s=r(21),l=r(19),c=r(24),u=r(26),p=r(25);e.exports=(e,t,r,f)=>{let d,h,y,m,g;switch(e=new n(e,f),t=new a(t,f),r){case">":d=l,h=u,y=c,m=">",g=">=";break;case"<":d=c,h=p,y=l,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,f))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let a=null,s=null;if(n.forEach(e=>{e.semver===o&&(e=new i(">=0.0.0")),a=a||e,s=s||e,d(e.semver,a.semver,f)?a=e:y(e.semver,s.semver,f)&&(s=e)}),a.operator===m||a.operator===g)return!1;if((!s.operator||s.operator===m)&&h(e,s.semver))return!1;if(s.operator===g&&y(e,s.semver))return!1}return!0}},function(e,t,r){"use strict";e.exports=p;var n,i=r(7),o=i.LongBits,a=i.base64,s=i.utf8;function l(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p.create=function(){return new n})()}:function(){return new p}};function d(e,t,r){t[r]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function m(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}p.create=f(),p.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(p.alloc=i.pool(p.alloc,i.Array.prototype.subarray)),p.prototype._push=function(e,t,r){return this.tail=this.tail.next=new l(e,t,r),this.len+=t,this},h.prototype=Object.create(l.prototype),h.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(y,10,o.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=o.from(e);return this._push(y,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(y,t.length(),t)},p.prototype.bool=function(e){return this._push(d,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=o.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var g=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=p.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},p._configure=function(e){n=e,p.create=f(),n._configure()}},function(e,t,r){"use strict";e.exports=l;var n,i=r(7),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},p=function(){return i.Buffer?function(e){return(l.create=function(e){return i.Buffer.isBuffer(e)?new n(e):u(e)})(e)}:u};function f(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}l.create=p(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},l.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){n=e,l.create=p(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(107),o=n(r(3)),a=r(0);class s{static mapToColumnProtoArray(e,t){return Object.keys(e).map(r=>s.mapColumnDescriptionToProto([r],e[r],t)).flat()}static mapColumnDescriptionToProto(e,t,r){if("string"==typeof t)return[a.dataform.ColumnDescriptor.create({description:t,path:e})];o.checkExcessProperties(r,t,i.IRecordDescriptorProperties(),e.join(".")+" column descriptor");const n=t?[a.dataform.ColumnDescriptor.create({path:e,description:t.description,displayName:t.displayName,dimensionType:s.mapDimensionType(t.dimension),aggregation:s.mapAggregation(t.aggregator),expression:t.expression,tags:"string"==typeof t.tags?[t.tags]:t.tags,bigqueryPolicyTags:"string"==typeof t.bigqueryPolicyTags?[t.bigqueryPolicyTags]:t.bigqueryPolicyTags})]:[],l=t.columns?Object.keys(t.columns):[];return n.concat(l.map(n=>s.mapColumnDescriptionToProto(e.concat([n]),t.columns[n],r)).flat())}static mapAggregation(e){switch(e){case"sum":return a.dataform.ColumnDescriptor.Aggregation.SUM;case"distinct":return a.dataform.ColumnDescriptor.Aggregation.DISTINCT;case"derived":return a.dataform.ColumnDescriptor.Aggregation.DERIVED;case void 0:return;default:throw new Error(`'${e}' is not a valid aggregation option.`)}}static mapFromAggregation(e){switch(e){case a.dataform.ColumnDescriptor.Aggregation.SUM:return"sum";case a.dataform.ColumnDescriptor.Aggregation.DISTINCT:return"distinct";case a.dataform.ColumnDescriptor.Aggregation.DERIVED:return"derived";case a.dataform.ColumnDescriptor.Aggregation.UNKNOWN_AGGREGATION:case void 0:return;default:throw new Error("Aggregation type not recognized: "+e)}}static mapDimensionType(e){switch(e){case"category":return a.dataform.ColumnDescriptor.DimensionType.CATEGORY;case"timestamp":return a.dataform.ColumnDescriptor.DimensionType.TIMESTAMP;case"number":return a.dataform.ColumnDescriptor.DimensionType.NUMBER;case void 0:return;default:throw new Error(`'${e}' is not a valid dimension type.`)}}static mapFromDimensionType(e){switch(e){case a.dataform.ColumnDescriptor.DimensionType.CATEGORY:return"category";case a.dataform.ColumnDescriptor.DimensionType.TIMESTAMP:return"timestamp";case a.dataform.ColumnDescriptor.DimensionType.NUMBER:return"number";case a.dataform.ColumnDescriptor.DimensionType.UNKNOWN_DIMENSION:case void 0:return;default:throw new Error("Dimension type not recognized: "+e)}}}t.ColumnDescriptors=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(30),i=r(3),o=r(0);t.TableType=["table","view","incremental","inline"],t.DistStyleType=["even","key","all"],t.SortStyleType=["compound","interleaved"];t.ITableConfigProperties=()=>i.strictKeysOf()(["type","disabled","protected","name","redshift","bigquery","snowflake","sqldatawarehouse","presto","tags","uniqueKey","dependencies","hermetic","schema","assertions","database","columns","description","materialized"]);class a{constructor(){this.proto=o.dataform.Table.create({type:"view",enumType:o.dataform.TableType.VIEW,disabled:!1,tags:[]}),this.contextablePreOps=[],this.contextablePostOps=[],this.uniqueKeyAssertions=[]}config(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,t.ITableConfigProperties(),"table config"),e.type&&this.type(e.type),e.dependencies&&this.dependencies(e.dependencies),void 0!==e.hermetic&&this.hermetic(e.hermetic),e.disabled&&this.disabled(),e.protected&&this.protected(),e.redshift&&this.redshift(e.redshift),e.bigquery&&this.bigquery(e.bigquery),e.snowflake&&this.snowflake(e.snowflake),e.sqldatawarehouse&&this.sqldatawarehouse(e.sqldatawarehouse),e.presto&&this.presto(e.presto),e.tags&&this.tags(e.tags),e.description&&this.description(e.description),e.columns&&this.columns(e.columns),e.database&&this.database(e.database),e.schema&&this.schema(e.schema),e.assertions&&this.assertions(e.assertions),e.uniqueKey&&this.uniqueKey(e.uniqueKey),e.materialized&&this.materialized(e.materialized),this}type(e){return this.proto.type=e,this.proto.enumType=i.tableTypeStringToEnum(e,!1),this}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(){var e;return this.proto.disabled=!0,this.uniqueKeyAssertions.forEach(e=>e.disabled()),null===(e=this.rowConditionsAssertion)||void 0===e||e.disabled(),this}protected(){return this.proto.protected=!0,this}uniqueKey(e){this.proto.uniqueKey=e}materialized(e){this.proto.materialized=e}snowflake(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["secure","transient","clusterBy"]),"snowflake config"),this.proto.snowflake=o.dataform.SnowflakeOptions.create(e),this}sqldatawarehouse(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["distribution"]),"sqldatawarehouse config"),this.proto.sqlDataWarehouse=o.dataform.SQLDataWarehouseOptions.create(e),this}redshift(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["distKey","distStyle","sortKeys","sortStyle"]),"redshift config"),this.proto.redshift=o.dataform.RedshiftOptions.create(e),this}bigquery(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["partitionBy","clusterBy","updatePartitionFilter","labels","partitionExpirationDays","requirePartitionFilter","additionalOptions"]),"bigquery config"),this.proto.bigquery=o.dataform.BigQueryOptions.create(e),e.labels&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels),this}presto(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["partitionBy"]),"presto config"),this.proto.presto=o.dataform.PrestoOptions.create(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach(e=>{this.proto.dependencyTargets.push(i.resolvableAsTarget(e))}),this}hermetic(e){this.proto.hermeticity=e?o.dataform.ActionHermeticity.HERMETIC:o.dataform.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach(e=>{this.proto.tags.push(e)}),this.uniqueKeyAssertions.forEach(t=>t.tags(e)),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=n.ColumnDescriptors.mapToColumnProtoArray(e,e=>this.session.compileError(e)),this}database(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,this.proto.target.schema,e),this}schema(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,e,this.proto.target.database),this}assertions(e){i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["uniqueKey","uniqueKeys","nonNull","rowConditions"]),"assertions config"),e.uniqueKey&&e.uniqueKeys&&this.session.compileError(new Error("Specify at most one of 'assertions.uniqueKey' and 'assertions.uniqueKeys'."));let t=e.uniqueKeys;e.uniqueKey&&(t="string"==typeof e.uniqueKey?[[e.uniqueKey]]:[e.uniqueKey]),t&&t.forEach((e,t)=>{const r=this.session.assert(`${this.proto.target.schema}_${this.proto.target.name}_assertions_uniqueKey_${t}`,t=>this.session.adapter().indexAssertion(t.ref(this.proto.target),e));this.proto.tags&&r.tags(this.proto.tags),r.proto.parentAction=this.proto.target,this.proto.disabled&&r.disabled(),this.uniqueKeyAssertions.push(r)});const r=e.rowConditions||[];if(e.nonNull){("string"==typeof e.nonNull?[e.nonNull]:e.nonNull).forEach(e=>r.push(e+" IS NOT NULL"))}return r&&r.length>0&&(this.rowConditionsAssertion=this.session.assert(`${this.proto.target.schema}_${this.proto.target.name}_assertions_rowConditions`,e=>this.session.adapter().rowConditionsAssertion(e.ref(this.proto.target),r)),this.rowConditionsAssertion.proto.parentAction=this.proto.target,this.proto.disabled&&this.rowConditionsAssertion.disabled(),this.proto.tags&&this.rowConditionsAssertion.tags(this.proto.tags)),this}compile(){const e=new s(this),t=new s(this,!0);return this.proto.query=e.apply(this.contextableQuery),this.proto.enumType===o.dataform.TableType.INCREMENTAL&&(this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t)),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter(e=>!!e.trim()),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter(e=>!!e.trim()),i.validateQueryString(this.session,this.proto.query,this.proto.fileName),i.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName),this.proto}contextifyOps(e,t){let r=[];return e.forEach(e=>{const n=t.apply(e);r=r.concat("string"==typeof n?[n]:n)}),r}}t.Table=a,a.INLINE_IGNORED_PROPS=["bigquery","redshift","snowflake","sqlDataWarehouse","presto","preOps","postOps","actionDescriptor","disabled","where"];class s{constructor(e,t=!1){this.table=e,this.isIncremental=t}config(e){return this.table.config(e),""}self(){return this.resolve(this.table.proto.target)}name(){return this.table.session.finalizeName(this.table.proto.target.name)}ref(e,...t){return e=i.toResolvable(e,t),i.resolvableAsTarget(e)?(this.table.dependencies(e),this.resolve(e)):(this.table.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.table.session.resolve(e,...t)}schema(){return this.table.session.finalizeSchema(this.table.proto.target.schema)}database(){return this.table.proto.target.database?this.table.session.finalizeDatabase(this.table.proto.target.database):(this.table.session.compileError(new Error("Warehouse does not support multiple databases")),"")}type(e){return this.table.type(e),""}where(e){return this.table.where(e),""}when(e,t,r=""){return e?t:r}incremental(){return!!this.isIncremental}preOps(e){return this.table.preOps(e),""}postOps(e){return this.table.postOps(e),""}disabled(){return this.table.disabled(),""}redshift(e){return this.table.redshift(e),""}bigquery(e){return this.table.bigquery(e),""}presto(e){return this.table.presto(e),""}dependencies(e){return this.table.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.table.tags(e),""}}t.TableContext=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(111);function i(e,t={}){return function(e){return n.util.base64.encode(e,0,e.length)}(e.encode(e.create(t)).finish())}function o(e,t){return t?e.decode(function(e){const t=new Uint8Array(n.util.base64.length(e));return n.util.base64.decode(e,t,0),t}(t)):e.create()}t.encode64=i,t.decode64=o,t.equals=function(e,t,r){return i(e,t)===i(e,r)},t.deepClone=function(e,t){return e.fromObject(e.toObject(e.create(t)))};class a{constructor(e){this.protoType=e}static create(e){return new a(e)}stringify(e){return i(this.protoType,e)}parse(e){return o(this.protoType,e)}}t.ProtoStringifier=a},function(e,t,r){"use strict";e.exports=b;var n=r(15);((b.prototype=Object.create(n.prototype)).constructor=b).className="Type";var i=r(6),o=r(16),a=r(9),s=r(34),l=r(35),c=r(37),u=r(29),p=r(28),f=r(1),d=r(53),h=r(54),y=r(55),m=r(56),g=r(57);function b(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function O(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=f.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=f.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,f.merge(e.prototype,t)),e.$type=e.prototype.$type=this,f.merge(e,c,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:f.oneOfGetter(this._oneofsArray[r].oneof),set:f.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),b.generateConstructor=function(e){for(var t,r=f.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",f.safeProp(t.name)):t.repeated&&r("this%s=[]",f.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){var r=new b(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var c=Object.keys(t.fields),u=0;u<c.length;++u)r.add((void 0!==t.fields[c[u]].keyType?s.fromJSON:a.fromJSON)(c[u],t.fields[c[u]]));if(t.oneofs)for(c=Object.keys(t.oneofs),u=0;u<c.length;++u)r.add(o.fromJSON(c[u],t.oneofs[c[u]]));if(t.nested)for(c=Object.keys(t.nested),u=0;u<c.length;++u){var p=t.nested[c[u]];r.add((void 0!==p.id?a.fromJSON:void 0!==p.fields?b.fromJSON:void 0!==p.values?i.fromJSON:void 0!==p.methods?l.fromJSON:n.fromJSON)(c[u],p))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},b.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return f.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},b.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),O(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),O(this)):n.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof a&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),O(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),O(this)}return n.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:p,types:t,util:f}),this.decode=h(this)({Reader:u,types:t,util:f}),this.verify=y(this)({types:t,util:f}),this.fromObject=m.fromObject(this)({types:t,util:f}),this.toObject=m.toObject(this)({types:t,util:f});var n=g[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){f.decorateType(t,e)}}},function(e,t,r){"use strict";e.exports=a;var n=r(9);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var i=r(12),o=r(1);function a(e,t,r,i,a,s){if(n.call(this,e,t,i,void 0,void 0,a,s),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=o.decorateType(r).name:r&&"object"==typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new a(i,e,t,r))}}},function(e,t,r){"use strict";e.exports=s;var n=r(15);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var i=r(36),o=r(1),a=r(49);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function l(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return o.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,l(this)):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,l(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,i=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var l=o.lcFirst((n=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[l]=o.codegen(["r","c"],o.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},function(e,t,r){"use strict";e.exports=o;var n=r(11);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(1);function o(e,t,r,o,a,s,l,c,u){if(i.isObject(a)?(l=a,a=s=void 0):i.isObject(s)&&(l=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,l),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=o,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c,this.parsedOptions=u}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},function(e,t,r){"use strict";e.exports=i;var n=r(7);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},function(e,t,r){"use strict";e.exports=p;var n=r(15);((p.prototype=Object.create(n.prototype)).constructor=p).className="Root";var i,o,a,s=r(9),l=r(6),c=r(16),u=r(1);function p(e){n.call(this,"",e),this.deferred=[],this.files=[]}function f(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=u.path.resolve,p.prototype.fetch=u.fetch,p.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return u.asPromise(e,i,t,r);var s=n===f;function l(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function c(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function p(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){o.filename=e;var n,a=o(t,i,r),p=0;if(a.imports)for(;p<a.imports.length;++p)(n=c(a.imports[p])||i.resolvePath(e,a.imports[p]))&&d(n);if(a.weakImports)for(p=0;p<a.weakImports.length;++p)(n=c(a.weakImports[p])||i.resolvePath(e,a.weakImports[p]))&&d(n,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}s||h||l(null,i)}function d(e,t){if(e=c(e)||e,!(i.files.indexOf(e)>-1))if(i.files.push(e),e in a)s?p(e,a[e]):(++h,setTimeout((function(){--h,p(e,a[e])})));else if(s){var r;try{r=u.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||l(e))}p(e,r)}else++h,i.fetch(e,(function(r,o){--h,n&&(r?t?h||l(null,i):l(r):p(e,o))}))}var h=0;u.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=i.resolvePath("",t[m]))&&d(y);if(s)return i;h||l(null,i)},p.prototype.loadSync=function(e,t){if(!u.isNode)throw Error("not supported");return this.load(e,t,f)},p.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function h(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.get(n.name)||(n.declaringField=t,t.extensionField=n,r.add(n)),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||h(0,e)||this.deferred.push(e);else if(e instanceof l)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof c)){if(e instanceof i)for(var t=0;t<this.deferred.length;)h(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},p.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof l)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},p._configure=function(e,t,r){i=e,o=t,a=r}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(122));class o{static create(){return new o}stringify(e){return JSON.stringify(e)}parse(e){return JSON.parse(e)}}t.JSONStringifier=o;class a{static create(){return new a}stringify(e){return JSON.stringify(Object.keys(e).sort().reduce((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]}),{}))}parse(e){return JSON.parse(e)}}t.JSONObjectStringifier=a;class s{static create(){return new s}stringify(e){return e.toString()}parse(e){return i.default.fromString(e)}}t.LongStringifier=s;class l{constructor(e){this.stringifier=e}static create(e){return new l(e)}stringify(e){return JSON.stringify(e.map(e=>this.stringifier.stringify(e)))}parse(e){return JSON.parse(e).map(e=>this.stringifier.parse(e))}}t.ArrayStringifier=l;class c{static create(){return new c}stringify(e){return e}parse(e){return e}}t.StringStringifier=c;class u{constructor(e,t){this.stringifier=e,this.map=t?new Map(t.map(([t,r])=>[e.stringify(t),r])):new Map}get[Symbol.toStringTag](){return u.name}get size(){return this.map.size}clear(){return this.map.clear()}delete(e){return this.map.delete(this.stringifier.stringify(e))}forEach(e,t){return this.map.forEach((t,r,n)=>e(t,this.stringifier.parse(r),null),t)}get(e){return this.map.get(this.stringifier.stringify(e))}has(e){return this.map.has(this.stringifier.stringify(e))}set(e,t){return this.map.set(this.stringifier.stringify(e),t),this}[Symbol.iterator](){return this.entries()}entries(){const e=this.stringifier,t=this.map[Symbol.iterator]();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:[e.parse(r.value[0]),r.value[1]],done:r.done}}}}keys(){const e=this.stringifier,t=this.map.keys();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:e.parse(r.value),done:r.done}}}}values(){return this.map.values()}}t.StringifiedMap=u;class p{constructor(e,t){this.stringifier=e,this.set=t?new Set(t.map(t=>e.stringify(t))):new Set}get size(){return this.set.size}get[Symbol.toStringTag](){return p.name}add(e){return this.set.add(this.stringifier.stringify(e)),this}clear(){return this.set.clear()}delete(e){return this.set.delete(this.stringifier.stringify(e))}forEach(e,t){return this.set.forEach((t,r,n)=>e(this.stringifier.parse(t),this.stringifier.parse(r),null),t)}has(e){return this.set.has(this.stringifier.stringify(e))}[Symbol.iterator](){return this.keys()}entries(){const e=this.stringifier,t=this.set[Symbol.iterator]();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:[e.parse(r.value[0]),r.value[1]],done:r.done}}}}keys(){const e=this.stringifier,t=this.set.keys();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:e.parse(r.value),done:r.done}}}}values(){const e=this.stringifier,t=this.set.values();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:e.parse(r.value),done:r.done}}}}}t.StringifiedSet=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(64),i=r(65),o=r(102),a=r(103),s=r(104),l=r(105),c=r(8),u=r(0);var p;!function(e){e.BIGQUERY="bigquery",e.PRESTO="presto",e.POSTGRES="postgres",e.REDSHIFT="redshift",e.SNOWFLAKE="snowflake",e.SQLDATAWAREHOUSE="sqldatawarehouse"}(p=t.WarehouseType||(t.WarehouseType={})),t.isWarehouseType=function(e){return Object.values(p).includes(e)};const f=[p.BIGQUERY,p.SQLDATAWAREHOUSE];t.supportsCancel=function(e){return f.some(t=>t===e)};const d=["host","port","username","password","databaseName"];t.requiredWarehouseProps={[p.BIGQUERY]:["projectId"],[p.POSTGRES]:d,[p.REDSHIFT]:d,[p.SNOWFLAKE]:["accountId","username","password","role","databaseName","warehouse"],[p.SQLDATAWAREHOUSE]:["server","port","username","password","database"],[p.PRESTO]:["host","port","user"]};const h={};function y(e,t){h[e]=t}t.register=y,t.create=function(e,t){if(!h[e.warehouse])throw new Error("Unsupported warehouse: "+e.warehouse);return new h[e.warehouse](e,t)},y("bigquery",i.BigQueryAdapter),y("presto",o.PrestoAdapter),y("postgres",a.RedshiftAdapter),y("redshift",a.RedshiftAdapter),y("snowflake",s.SnowflakeAdapter),y("sqldatawarehouse",l.SQLDataWarehouseAdapter),t.collectEvaluationQueries=function(e,t,r=(e=>e)){const i=new Array;if("string"==typeof e)i.push({query:r(e)});else try{if(e instanceof u.dataform.Table){if(e.enumType===u.dataform.TableType.INCREMENTAL){const n=e.incrementalPreOps.concat(e.incrementalQuery,e.incrementalPostOps);t?i.push({query:c.concatenateQueries(n,r),incremental:!0}):n.forEach(e=>i.push({query:r(e),incremental:!0}))}const n=e.preOps.concat(e.query,e.postOps);t?i.push({query:c.concatenateQueries(n,r)}):n.forEach(e=>i.push({query:r(e)}))}else if(e instanceof u.dataform.Operation)t?i.push({query:c.concatenateQueries(e.queries,r)}):e.queries.forEach(e=>i.push({query:r(e)}));else{if(!(e instanceof u.dataform.Assertion))throw new Error("Unrecognized evaluate type.");i.push({query:r(e.query)})}}catch(e){throw new n.ErrorWithCause("Error building tasks for evaluation. "+e.message,e)}return i.map(e=>Object.assign({query:e.query.trim()},e)).filter(e=>!!e.query)}},function(e,t,r){const n=r(14),i=r(17),o=r(2),a=r(42),s=r(10),l=r(66),c=r(67),u=r(68),p=r(69),f=r(70),d=r(71),h=r(72),y=r(73),m=r(4),g=r(74),b=r(75),O=r(23),v=r(76),T=r(77),w=r(19),E=r(24),S=r(43),j=r(44),P=r(25),A=r(26),k=r(45),x=r(78),N=r(20),C=r(5),R=r(21),_=r(82),I=r(83),D=r(84),L=r(85),q=r(86),B=r(27),M=r(87),$=r(88),U=r(89),Q=r(90),G=r(91);e.exports={parse:s,valid:l,clean:c,inc:u,diff:p,major:f,minor:d,patch:h,prerelease:y,compare:m,rcompare:g,compareLoose:b,compareBuild:O,sort:v,rsort:T,gt:w,lt:E,eq:S,neq:j,gte:P,lte:A,cmp:k,coerce:x,Comparator:N,Range:C,satisfies:R,toComparators:_,maxSatisfying:I,minSatisfying:D,minVersion:L,validRange:q,outside:B,gtr:M,ltr:$,intersects:U,simplifyRange:Q,subset:G,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},function(e,t){const r=/^[0-9]+$/,n=(e,t)=>{const n=r.test(e),i=r.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>0===n(e,t,r)},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>0!==n(e,t,r)},function(e,t,r){const n=r(43),i=r(44),o=r(19),a=r(25),s=r(24),l=r(26);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return i(e,r,c);case">":return o(e,r,c);case">=":return a(e,r,c);case"<":return s(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError("Invalid operator: "+t)}}},function(e,t,r){"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(28),n.BufferWriter=r(99),n.Reader=r(29),n.BufferReader=r(100),n.util=r(7),n.rpc=r(49),n.roots=r(50),n.configure=i,i()},function(e,t,r){"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,o=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,a){r[n]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,a(e))}}))}},function(module,exports,__webpack_require__){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},function(e,t,r){"use strict";t.Service=r(101)},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3),i=r(0);t.IAssertionConfigProperties=n.strictKeysOf()(["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]);t.Assertion=class{constructor(){this.proto=i.dataform.Assertion.create()}config(e){return n.checkExcessProperties(e=>this.session.compileError(e),e,t.IAssertionConfigProperties,"assertion config"),e.dependencies&&this.dependencies(e.dependencies),void 0!==e.hermetic&&this.hermetic(e.hermetic),e.disabled&&this.disabled(),e.tags&&this.tags(e.tags),e.description&&this.description(e.description),e.database&&this.database(e.database),e.schema&&this.schema(e.schema),this}query(e){return this.contextableQuery=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach(e=>{this.proto.dependencyTargets.push(n.resolvableAsTarget(e))}),this}hermetic(e){this.proto.hermeticity=e?i.dataform.ActionHermeticity.HERMETIC:i.dataform.ActionHermeticity.NON_HERMETIC}disabled(){return this.proto.disabled=!0,this}tags(e){return("string"==typeof e?[e]:e).forEach(e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)}),this}description(e){return this.proto.actionDescriptor={description:e},this}database(e){return n.setNameAndTarget(this.session,this.proto,this.proto.target.name,this.proto.target.schema,e),this}schema(e){return n.setNameAndTarget(this.session,this.proto,this.proto.target.name,e,this.proto.target.database),this}compile(){const e=new o(this);return this.proto.query=e.apply(this.contextableQuery),n.validateQueryString(this.session,this.proto.query,this.proto.fileName),this.proto}};class o{constructor(e){this.assertion=e}self(){return this.resolve(this.assertion.proto.target)}name(){return this.assertion.session.finalizeName(this.assertion.proto.target.name)}ref(e,...t){return e=n.toResolvable(e,t),n.resolvableAsTarget(e)?(this.assertion.dependencies(e),this.resolve(e)):(this.assertion.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.assertion.session.resolve(e,...t)}schema(){return this.assertion.session.finalizeSchema(this.assertion.proto.target.schema)}database(){return this.assertion.proto.target.database?this.assertion.session.finalizeDatabase(this.assertion.proto.target.database):(this.assertion.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.assertion.dependencies(e),""}tags(e){return this.assertion.tags(e),""}when(e,t,r=""){return e?t:r}apply(e){return"function"==typeof e?e(this):e}}t.AssertionContext=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(30),i=r(3),o=r(0);t.IIOperationConfigProperties=i.strictKeysOf()(["columns","database","dependencies","description","disabled","hasOutput","hermetic","name","schema","tags","type"]);t.Operation=class{constructor(){this.proto=o.dataform.Operation.create()}config(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,t.IIOperationConfigProperties,"operation config"),e.dependencies&&this.dependencies(e.dependencies),void 0!==e.hermetic&&this.hermetic(e.hermetic),e.disabled&&this.disabled(),e.tags&&this.tags(e.tags),e.hasOutput&&this.hasOutput(e.hasOutput),e.description&&this.description(e.description),e.columns&&this.columns(e.columns),e.database&&this.database(e.database),e.schema&&this.schema(e.schema),this}queries(e){return this.contextableQueries=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach(e=>{this.proto.dependencyTargets.push(i.resolvableAsTarget(e))}),this}hermetic(e){this.proto.hermeticity=e?o.dataform.ActionHermeticity.HERMETIC:o.dataform.ActionHermeticity.NON_HERMETIC}disabled(){return this.proto.disabled=!0,this}tags(e){return("string"==typeof e?[e]:e).forEach(e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)}),this}hasOutput(e){return this.proto.hasOutput=e,this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=n.ColumnDescriptors.mapToColumnProtoArray(e,e=>this.session.compileError(e)),this}database(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,this.proto.target.schema,e),this}schema(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,e,this.proto.target.database),this}compile(){var e,t;(null===(t=null===(e=this.proto.actionDescriptor)||void 0===e?void 0:e.columns)||void 0===t?void 0:t.length)>0&&!this.proto.hasOutput&&this.session.compileError(new Error("Actions of type 'operations' may only describe columns if they specify 'hasOutput: true'."),this.proto.fileName);const r=new a(this).apply(this.contextableQueries);return this.proto.queries="string"==typeof r?[r]:r,this.proto}};class a{constructor(e){this.operation=e}self(){return this.resolve(this.operation.proto.target)}name(){return this.operation.session.finalizeName(this.operation.proto.target.name)}ref(e,...t){return e=i.toResolvable(e,t),i.resolvableAsTarget(e)?(this.operation.dependencies(e),this.resolve(e)):(this.operation.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.operation.session.resolve(e,...t)}schema(){return this.operation.session.finalizeSchema(this.operation.proto.target.schema)}database(){return this.operation.proto.target.database?this.operation.session.finalizeDatabase(this.operation.proto.target.database):(this.operation.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.operation.dependencies(e),""}tags(e){return this.operation.tags(e),""}hasOutput(e){return this.operation.hasOutput(e),""}when(e,t,r=""){return e?t:r}apply(e){return"function"==typeof e?e(this):e}}t.OperationContext=a},function(e,t,r){"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(o.compareFieldsById),l=0;l<s.length;++l){var c=s[l].resolve(),u=e._fieldsArray.indexOf(c),p=c.resolvedType instanceof n?"int32":c.type,f=i.basic[p];t="m"+o.safeProp(c.name),c.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,c.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(c.id<<3|2)>>>0,8|i.mapKey[c.keyType],c.keyType),void 0===f?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,p,t),r("}")("}")):c.repeated?(r("if(%s!=null&&%s.length){",t,t),c.packed&&void 0!==i.packed[p]?r("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===f?a(r,c,u,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(c.id<<3|f)>>>0,p,t)),r("}")):(c.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===f?a(r,c,u,t):r("w.uint32(%i).%s(%s)",(c.id<<3|f)>>>0,p,t))}return r("return w")};var n=r(6),i=r(12),o=r(1);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var s=e._fieldsArray[r].resolve(),l=s.resolvedType instanceof n?"int32":s.type,c="m"+o.safeProp(s.name);t("case %i: {",s.id),s.map?(t("if(%s===util.emptyObject)",c)("%s={}",c)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[s.keyType]?t("k=%j",i.defaults[s.keyType]):t("k=null"),void 0!==i.defaults[l]?t("value=%j",i.defaults[l]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[l]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):t("%s[k]=value",c)):s.repeated?(t("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==i.packed[l]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",c,l)("}else"),void 0===i.basic[l]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",c,r):t("%s.push(r.%s())",c,l)):void 0===i.basic[l]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",c,r):t("%s=r.%s()",c,l),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var u=e._fieldsArray[r];u.required&&t("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",a(u))}return t("return m")};var n=r(6),i=r(12),o=r(1);function a(e){return"missing required '"+e.name+"'"}},function(e,t,r){"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,n={};r.length&&t("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var c=e._fieldsArray[l].resolve(),u="m"+i.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",o(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),s(t,c,"k[i]"),a(t,c,l,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",o(c,"array"))("for(var i=0;i<%s.length;++i){",u),a(t,c,l,u+"[i]")("}");else{if(c.partOf){var p=i.safeProp(c.partOf.name);1===n[c.partOf.name]&&t("if(p%s===1)",p)("return%j",c.partOf.name+": multiple values"),n[c.partOf.name]=1,t("p%s=1",p)}a(t,c,l,u)}c.optional&&t("}")}return t("return null")};var n=r(6),i=r(1);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function s(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}return e}},function(e,t,r){"use strict";var n=t,i=r(6),o=r(1);function a(e,t,r,n){var o=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||o||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),t.repeated||e("break"),o=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",n,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),l=o.safeProp(s.name);s.map?(r("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),a(r,s,n,l+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),a(r,s,n,l+"[i]")("}")("}")):(s.resolvedType instanceof i||r("if(d%s!=null){",l),a(r,s,n,l),s.resolvedType instanceof i||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],a=[],l=[],c=0;c<t.length;++c)t[c].partOf||(t[c].resolve().repeated?n:t[c].map?a:l).push(t[c]);if(n.length){for(r("if(o.arrays||o.defaults){"),c=0;c<n.length;++c)r("d%s=[]",o.safeProp(n[c].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),c=0;c<a.length;++c)r("d%s={}",o.safeProp(a[c].name));r("}")}if(l.length){for(r("if(o.defaults){"),c=0;c<l.length;++c){var u=l[c],p=o.safeProp(u.name);if(u.resolvedType instanceof i)r("d%s=o.enums===String?%j:%j",p,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var f="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",p,f)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else r("d%s=%j",p,u.typeDefault)}r("}")}var d=!1;for(c=0;c<t.length;++c){u=t[c];var h=e._fieldsArray.indexOf(u);p=o.safeProp(u.name);u.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),s(r,u,h,p+"[ks2[j]]")("}")):u.repeated?(r("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),s(r,u,h,p+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",p,u.name),s(r,u,h,p),u.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(u.partOf.name),u.name)),r("}")}return r("return d")}},function(e,t,r){"use strict";var n=t,i=r(37);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},function(e,t,r){"use strict";e.exports=d;var n=/[\s{}=;:[\],'"()<>]/g,i=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a=/^ *[*/]+ */,s=/^\s*\*?\/*/,l=/\n/g,c=/\s/,u=/\\(.?)/g,p={0:"\0",r:"\r",n:"\n",t:"\t"};function f(e){return e.replace(u,(function(e,t){switch(t){case"\\":case"":return t;default:return p[t]||""}}))}function d(e,t){e=e.toString();var r=0,u=e.length,p=1,d=0,h={},y=[],m=null;function g(e){return Error("illegal "+e+" (line "+p+")")}function b(t){return e.charAt(t)}function O(r,n,i){var o,c={type:e.charAt(r++),lineEmpty:!1,leading:i},u=r-(t?2:3);do{if(--u<0||"\n"===(o=e.charAt(u))){c.lineEmpty=!0;break}}while(" "===o||"\t"===o);for(var f=e.substring(r,n).split(l),y=0;y<f.length;++y)f[y]=f[y].replace(t?s:a,"").trim();c.text=f.join("\n").trim(),h[p]=c,d=p}function v(t){var r=T(t),n=e.substring(t,r);return/^\s*\/{1,2}/.test(n)}function T(e){for(var t=e;t<u&&"\n"!==b(t);)t++;return t}function w(){if(y.length>0)return y.shift();if(m)return function(){var t="'"===m?o:i;t.lastIndex=r-1;var n=t.exec(e);if(!n)throw g("string");return r=t.lastIndex,E(m),m=null,f(n[1])}();var a,s,l,d,h,w=0===r;do{if(r===u)return null;for(a=!1;c.test(l=b(r));)if("\n"===l&&(w=!0,++p),++r===u)return null;if("/"===b(r)){if(++r===u)throw g("comment");if("/"===b(r))if(t){if(d=r,h=!1,v(r)){h=!0;do{if((r=T(r))===u)break;if(r++,!w)break}while(v(r))}else r=Math.min(u,T(r)+1);h&&(O(d,r,w),w=!0),p++,a=!0}else{for(h="/"===b(d=r+1);"\n"!==b(++r);)if(r===u)return null;++r,h&&(O(d,r-1,w),w=!0),++p,a=!0}else{if("*"!==(l=b(r)))return"/";d=r+1,h=t||"*"===b(d);do{if("\n"===l&&++p,++r===u)throw g("comment");s=l,l=b(r)}while("*"!==s||"/"!==l);++r,h&&(O(d,r-2,w),w=!0),a=!0}}}while(a);var S=r;if(n.lastIndex=0,!n.test(b(S++)))for(;S<u&&!n.test(b(S));)++S;var j=e.substring(r,r=S);return'"'!==j&&"'"!==j||(m=j),j}function E(e){y.push(e)}function S(){if(!y.length){var e=w();if(null===e)return null;E(e)}return y[0]}return Object.defineProperty({next:w,peek:S,push:E,skip:function(e,t){var r=S();if(r===e)return w(),!0;if(!t)throw g("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var r,n=null;return void 0===e?(r=h[p-1],delete h[p-1],r&&(t||"*"===r.type||r.lineEmpty)&&(n=r.leading?r.text:null)):(d<e&&S(),r=h[e],delete h[e],!r||r.lineEmpty||!t&&"/"!==r.type||(n=r.leading?null:r.text)),n}},"line",{get:function(){return p}})}d.unescape=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(39);t.targetStringifier=n.JSONObjectStringifier.create(),t.targetsAreEqual=function(e,t){return e.database===t.database&&e.schema===t.schema&&e.name===t.name},t.targetAsReadableString=function(e){const t=[e.name,e.schema];return e.database&&t.push(e.database),t.reverse().join(".")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="2.8.0"},function(e,t,r){e.exports=r(62)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(63);t.adapters=n.adapters,t.compiler=n.compiler,t.compileStandaloneSqlxQuery=n.compileStandaloneSqlxQuery,t.indexFileGenerator=n.indexFileGenerator,t.main=n.main,t.session=n.session,t.supportedFeatures=n.supportedFeatures,t.version=n.version},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(40));t.adapters=i;const o=r(106);t.compiler=o.compile,t.compileStandaloneSqlxQuery=o.compileStandaloneSqlxQuery;const a=r(110);t.indexFileGenerator=a.genIndex;const s=r(119);t.main=s.main;const l=r(120),c=r(60);t.version=c.version;const u=r(0);const p=(global._DF_SESSION||(global._DF_SESSION=new l.Session),global._DF_SESSION);t.session=p;const f=[u.dataform.SupportedFeatures.ARRAY_BUFFER_IPC];t.supportedFeatures=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t){super("string"==typeof e?e:void 0),this.cause=t,"string"!=typeof e&&(this.cause=e),this.cause&&(this.stack+="\nCaused by: "+this.cause.stack)}}t.ErrorWithCause=n,t.coerceAsError=function(e){if(e instanceof Error)return e;const t=e,r=t.message?String(t.message):String(e),n=new Error(r);return t.stack&&(n.stack=t.stack),t.name&&(n.name=t.name),n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`\`${e.database||this.project.defaultDatabase}.${e.schema||this.project.defaultSchema}.${e.name}\``}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);return r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.add(i.Task.statement(e.uniqueKey&&e.uniqueKey.length>0?this.mergeInto(e.target,null==r?void 0:r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where),e.uniqueKey,e.bigquery&&e.bigquery.updatePartitionFilter):this.insertInto(e.target,null==r?void 0:r.fields.map(e=>e.name).map(e=>`\`${e}\``),this.where(e.incrementalQuery||e.query,e.where)))):n.add(i.Task.statement(this.createOrReplace(e))),this.postOps(e,t,r).forEach(e=>n.add(e)),n.concatenate()}assertTasks(e,t){const r=i.Tasks.create(),n=e.target;return r.add(i.Task.statement(this.createOrReplaceView(n,e.query))),r.add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(n))),r}dropIfExists(e,t){return`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)}`}createOrReplace(e){const t=[];if(e.bigquery&&e.bigquery.partitionBy&&e.bigquery.partitionExpirationDays&&t.push("partition_expiration_days="+e.bigquery.partitionExpirationDays),e.bigquery&&e.bigquery.partitionBy&&e.bigquery.requirePartitionFilter&&t.push("require_partition_filter="+e.bigquery.requirePartitionFilter),e.bigquery&&e.bigquery.additionalOptions)for(const[r,n]of Object.entries(e.bigquery.additionalOptions))t.push(`${r}=${n}`);return`create or replace ${e.materialized?"materialized ":""}${this.tableTypeAsSql(this.baseTableType(e.enumType))} ${this.resolveTarget(e.target)} ${e.bigquery&&e.bigquery.partitionBy?`partition by ${e.bigquery.partitionBy} `:""}${e.bigquery&&e.bigquery.clusterBy&&e.bigquery.clusterBy.length>0?`cluster by ${e.bigquery.clusterBy.join(", ")} `:""}${t.length>0?`OPTIONS(${t.join(",")})`:""}as ${e.query}`}createOrReplaceView(e,t){return`\n create or replace view ${this.resolveTarget(e)} as ${t}`}mergeInto(e,t,r,n,i){const o=t.map(e=>`\`${e}\``);return`\nmerge ${this.resolveTarget(e)} T\nusing (${r}\n) S\non ${n.map(e=>`T.${e} = S.${e}`).join(" and ")}\n ${i?"and T."+i:""}\nwhen matched then\n update set ${t.map(e=>`\`${e}\` = S.${e}`).join(",")}\nwhen not matched then\n insert (${o.join(",")}) values (${o.join(",")})`}}t.BigQueryAdapter=a},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},function(e,t,r){const n=r(2);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,l=a?i:r,c=!!s.prerelease.length;if(!!l.prerelease.length&&!c)return l.patch||l.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}},function(e,t,r){const n=r(2);e.exports=(e,t)=>new n(e,t).major},function(e,t,r){const n=r(2);e.exports=(e,t)=>new n(e,t).minor},function(e,t,r){const n=r(2);e.exports=(e,t)=>new n(e,t).patch},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(t,e,r)},function(e,t,r){const n=r(4);e.exports=(e,t)=>n(e,t,!0)},function(e,t,r){const n=r(23);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},function(e,t,r){const n=r(23);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},function(e,t,r){const n=r(2),i=r(10),{safeRe:o,t:a}=r(14);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[a.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[a.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[a.COERCERTL].lastIndex=-1}else r=e.match(o[a.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},function(e,t,r){"use strict";const n=r(80),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),p=Symbol("lruList"),f=Symbol("cache"),d=Symbol("updateAgeOnGet"),h=()=>1;const y=(e,t,r)=>{const n=e[f].get(t);if(n){const t=n.value;if(m(e,t)){if(b(e,n),!e[s])return}else r&&(e[d]&&(n.value.now=Date.now()),e[p].unshiftNode(n));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},g=e=>{if(e[o]>e[i])for(let t=e[p].tail;e[o]>e[i]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[f].delete(r.key),e[p].removeNode(t)}};class O{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const v=(e,t,r,n)=>{let i=r.value;m(e,i)&&(b(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||h;if(this[a]="function"!=typeof t?h:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[d]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,g(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,g(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[a]&&(this[a]=e,this[o]=0,this[p].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),g(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let r=this[p].tail;null!==r;){const n=r.prev;v(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[p].head;null!==r;){const n=r.next;v(this,e,r,t),r=n}}keys(){return this[p].toArray().map(e=>e.key)}values(){return this[p].toArray().map(e=>e.value)}reset(){this[c]&&this[p]&&this[p].length&&this[p].forEach(e=>this[c](e.key,e.value)),this[f]=new Map,this[p]=new n,this[o]=0}dump(){return this[p].map(e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[p]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[i])return b(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[c]&&(this[u]||this[c](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),g(this),!0}const d=new O(e,t,s,n,r);return d.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=d.length,this[p].unshift(d),this[f].set(e,this[p].head),g(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!m(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[p].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[f].forEach((e,t)=>y(this,t,!1))}}},function(e,t,r){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=s,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var a=[];for(n=0;o&&n<t;n++)a.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(n=0;n<r.length;n++)o=i(this,o,r[n]);return a},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(81)(n)}catch(e){}},function(e,t,r){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},function(e,t,r){const n=r(5);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},function(e,t,r){const n=r(2),i=r(5);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(o&&-1!==a.compare(e)||(o=e,a=new n(o,r)))}),o}},function(e,t,r){const n=r(2),i=r(5);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(o&&1!==a.compare(e)||(o=e,a=new n(o,r)))}),o}},function(e,t,r){const n=r(2),i=r(5),o=r(19);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let a=null;i.forEach(e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":a&&!o(t,a)||(a=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}),!a||r&&!o(r,a)||(r=a)}return r&&e.test(r)?r:null}},function(e,t,r){const n=r(5);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},function(e,t,r){const n=r(27);e.exports=(e,t,r)=>n(e,t,">",r)},function(e,t,r){const n=r(27);e.exports=(e,t,r)=>n(e,t,"<",r)},function(e,t,r){const n=r(5);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},function(e,t,r){const n=r(21),i=r(4);e.exports=(e,t,r)=>{const o=[];let a=null,s=null;const l=e.sort((e,t)=>i(e,t,r));for(const e of l){n(e,t,r)?(s=e,a||(a=e)):(s&&o.push([a,s]),s=null,a=null)}a&&o.push([a,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push("<="+t):c.push(`${e} - ${t}`):c.push(">="+e):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},function(e,t,r){const n=r(5),i=r(20),{ANY:o}=i,a=r(21),s=r(4),l=[new i(">=0.0.0-0")],c=[new i(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?l:c}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=c}const n=new Set;let i,u,d,h,y,m,g;for(const t of e)">"===t.operator||">="===t.operator?i=p(i,t,r):"<"===t.operator||"<="===t.operator?u=f(u,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&u){if(d=s(i.semver,u.semver,r),d>0)return null;if(0===d&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of n){if(i&&!a(e,String(i),r))return null;if(u&&!a(e,String(u),r))return null;for(const n of t)if(!a(e,String(n),r))return!1;return!0}let b=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,O=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;b&&1===b.prerelease.length&&"<"===u.operator&&0===b.prerelease[0]&&(b=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(O&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===O.major&&e.semver.minor===O.minor&&e.semver.patch===O.patch&&(O=!1),">"===e.operator||">="===e.operator){if(h=p(i,e,r),h===e&&h!==i)return!1}else if(">="===i.operator&&!a(i.semver,String(e),r))return!1;if(u)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if(y=f(u,e,r),y===e&&y!==u)return!1}else if("<="===u.operator&&!a(u.semver,String(e),r))return!1;if(!e.operator&&(u||i)&&0!==d)return!1}return!(i&&m&&!u&&0!==d)&&(!(u&&g&&!i&&0!==d)&&(!O&&!b))},p=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},f=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},function(e,t,r){"use strict";e.exports=r(46)},function(e,t,r){"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),o=new Array(123),a=0;a<64;)o[i[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;n.encode=function(e,t,r){for(var n,o=null,a=[],s=0,l=0;t<r;){var c=e[t++];switch(l){case 0:a[s++]=i[c>>2],n=(3&c)<<4,l=1;break;case 1:a[s++]=i[n|c>>4],n=(15&c)<<2,l=2;break;case 2:a[s++]=i[n|c>>6],a[s++]=i[63&c],l=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=i[n],a[s++]=61,1===l&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};n.decode=function(e,t,r){for(var n,i=r,a=0,s=0;s<e.length;){var l=e.charCodeAt(s++);if(61===l&&a>1)break;if(void 0===(l=o[l]))throw Error("invalid encoding");switch(a){case 0:n=l,a=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,a=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,a=3;break;case 3:t[r++]=(3&n)<<6|l,a=0}}if(1===a)throw Error("invalid encoding");return r-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,r){"use strict";function n(){this._listeners={}}e.exports=n,n.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},n.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},function(e,t,r){"use strict";function n(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function r(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,a=8388607&n;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,o),e.readFloatLE=r.bind(null,a),e.readFloatBE=r.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,i,o){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=n*Math.pow(2,-l))>>>0,i,o+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,i,o+r)}}}function r(e,t,r,n,i){var o=e(n,i+t),a=e(n,i+r),s=2*(a>>31)+1,l=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===l?c?NaN:s*(1/0):0===l?5e-324*s*c:s*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=r.bind(null,a,0,4),e.readDoubleBE=r.bind(null,s,4,0)}(),e}function i(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=n(n)},function(e,t,r){"use strict";var n=t;n.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},n.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],a=0;t<r;)(n=e[t++])<128?o[a++]=n:n>191&&n<224?o[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(e,t,r){for(var n,i,o=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(o=e(n),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},function(e,t,r){"use strict";e.exports=i;var n=r(7);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},function(e,t,r){"use strict";e.exports=o;var n=r(28);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(7);function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},function(e,t,r){"use strict";e.exports=o;var n=r(29);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(7);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},function(e,t,r){"use strict";e.exports=i;var n=r(7);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`"${e.database||this.project.defaultDatabase}"."${e.schema||this.project.defaultSchema}"."${e.name}"`}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);if(r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL)throw new Error("Incremental table types are not currently supported for Presto.");return n.add(i.Task.statement(this.createOrReplace(e))),this.postOps(e,t,r).forEach(e=>n.add(e)),n.concatenate()}assertTasks(e,t){const r=i.Tasks.create(),n=e.target;return r.add(i.Task.statement(this.createOrReplaceView(n,e.query))),r.add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(n))),r}createOrReplaceView(e,t){return`create or replace view ${this.resolveTarget(e)} as ${t}`}createTable(e){var t,r;return`create table if not exists ${this.resolveTarget(e.target)} as ${e.query} ${(null===(t=e.presto)||void 0===t?void 0:t.partitionBy)?`with (partitioned_by = array[${null===(r=e.presto)||void 0===r?void 0:r.partitionBy.join(", ")}]`:""}`}dropTableIfExists(e,t){return`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)}`}createOrReplace(e){return this.createTable(e)}mergeInto(){throw new Error("mergeInto unimplemented for Presto.")}}t.PrestoAdapter=a},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(41)),o=r(13),a=r(8),s=r(0);class l extends o.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`"${e.schema}"."${e.name}"`}publishTasks(e,t,r){const n=a.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const i=this.baseTableType(e.enumType);return r&&r.type!==i&&n.add(a.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(i)))),e.enumType===s.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.addAll(e.uniqueKey&&e.uniqueKey.length>0?this.mergeInto(e.target,this.where(e.incrementalQuery||e.query,e.where),e.uniqueKey):a.Tasks.create().add(a.Task.statement(this.insertInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where))))):n.addAll(this.createOrReplace(e)),this.postOps(e,t,r).forEach(e=>n.add(e)),n}assertTasks(e,t){const r=e.target;return a.Tasks.create().add(a.Task.statement(this.dropIfExists(r,s.dataform.TableMetadata.Type.VIEW))).add(a.Task.statement(this.createOrReplaceView(r,e.query,!1))).add(a.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(r)))}dropIfExists(e,t){const r=`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)}`;return"postgres"===this.project.warehouse||this.isBindSupported()?r+" cascade":r}createOrReplaceView(e,t,r){const n=`create or replace view ${this.resolveTarget(e)} as ${t}`;return r||"postgres"===this.project.warehouse?n:n+" with no schema binding"}createOrReplace(e){if(e.enumType===s.dataform.TableType.VIEW){const t=e.redshift&&e.redshift.hasOwnProperty("bind"),r=!i.gte(this.dataformCoreVersion,"1.4.1"),n=(t?e.redshift.bind:r)&&this.isBindSupported();return a.Tasks.create().add(a.Task.statement(this.dropIfExists(e.target,this.baseTableType(e.enumType)))).add(a.Task.statement(this.createOrReplaceView(e.target,e.query,n)))}const t=s.dataform.Target.create({schema:e.target.schema,name:e.target.name+"_temp"});return a.Tasks.create().add(a.Task.statement(this.dropIfExists(t,this.baseTableType(e.enumType)))).add(a.Task.statement(this.createTable(e,t))).add(a.Task.statement(this.dropIfExists(e.target,s.dataform.TableMetadata.Type.TABLE))).add(a.Task.statement(`alter table ${this.resolveTarget(t)} rename to "${e.target.name}"`))}createTable(e,t){if(e.redshift){let r="create table "+this.resolveTarget(t);return e.redshift.distStyle&&e.redshift.distKey&&(r=`${r} diststyle ${e.redshift.distStyle} distkey (${e.redshift.distKey})`),e.redshift.sortStyle&&e.redshift.sortKeys&&(r=`${r} ${e.redshift.sortStyle} sortkey (${e.redshift.sortKeys.join(", ")})`),`${r} as ${e.query}`}return`create table ${this.resolveTarget(t)} as ${e.query}`}mergeInto(e,t,r){const n=this.resolveTarget(e),i=`"${e.schema}__${e.name}_incremental_temp"`;return a.Tasks.create().add(a.Task.statement(`drop table if exists ${i};`)).add(a.Task.statement(`create temp table ${i} as select * from (${t}\n) as data;`)).add(a.Task.statement("begin transaction;")).add(a.Task.statement(`delete from ${n} using ${i} where ${r.map(e=>`${n}."${e}" = ${i}."${e}"`).join(" and ")};`)).add(a.Task.statement(`insert into ${n} select * from ${i};`)).add(a.Task.statement("end transaction;")).add(a.Task.statement(`drop table ${i};`))}isBindSupported(){return i.lte(this.dataformCoreVersion,"1.10.0")}}t.RedshiftAdapter=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`${e.database?`"${e.database}".`:""}"${e.schema}"."${e.name}"`}normalizeIdentifier(e){return e.toUpperCase()}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);return r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.add(i.Task.statement(e.uniqueKey&&e.uniqueKey.length>0?this.mergeInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where),e.uniqueKey):this.insertInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where)))):n.add(i.Task.statement(this.createOrReplace(e))),this.postOps(e,t,r).forEach(e=>n.add(e)),n}assertTasks(e,t){const r=i.Tasks.create(),n=e.target;return r.add(i.Task.statement(this.createOrReplaceView(n,e.query,!1,!1))),r.add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(n))),r}createOrReplaceView(e,t,r,n){return`create or replace ${r?"secure ":""}${n?"materialized ":""}view ${this.resolveTarget(e)} as ${t}`}createOrReplace(e){var t,r,n,i,a;return e.enumType===o.dataform.TableType.VIEW?this.createOrReplaceView(e.target,e.query,null===(t=e.snowflake)||void 0===t?void 0:t.secure,e.materialized):`create or replace ${(null===(r=e.snowflake)||void 0===r?void 0:r.transient)?"transient ":""}table ${this.resolveTarget(e.target)} ${(null===(i=null===(n=e.snowflake)||void 0===n?void 0:n.clusterBy)||void 0===i?void 0:i.length)>0?`cluster by (${null===(a=e.snowflake)||void 0===a?void 0:a.clusterBy.join(", ")}) `:""}as ${e.query}`}mergeInto(e,t,r,n){return`\nmerge into ${this.resolveTarget(e)} T\nusing (${r}\n) S\non ${n.map(e=>`T.${e} = S.${e}`).join(" and ")}\nwhen matched then\n update set ${t.map(e=>`${e} = S.${e}`).join(",")}\nwhen not matched then\n insert (${t.join(",")}) values (${t.join(",")})`}}t.SnowflakeAdapter=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}sqlString(e){return`'${e.replace(/'/g,"''")}'`}resolveTarget(e){return`"${e.schema}"."${e.name}"`}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);return r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.add(i.Task.statement(this.insertInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where)))):n.addAll(this.createOrReplace(e,!!r)),this.postOps(e,t,r).forEach(e=>n.add(e)),n.concatenate()}assertTasks(e,t){const r=e.target;return i.Tasks.create().add(i.Task.statement(this.dropIfExists(r,o.dataform.TableMetadata.Type.VIEW))).add(i.Task.statement(`\n create view ${this.resolveTarget(r)}\n as ${e.query}`)).add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(r)))}dropIfExists(e,t){return t===o.dataform.TableMetadata.Type.VIEW?`drop view if exists ${this.resolveTarget(e)} `:`if object_id ('${this.resolveTarget(e)}','U') is not null drop table ${this.resolveTarget(e)}`}insertInto(e,t,r){return`\ninsert into ${this.resolveTarget(e)}\n(${t.join(",")})\nselect ${t.join(",")}\nfrom (${r}\n) as insertions`}createOrReplace(e,t){if(e.enumType===o.dataform.TableType.VIEW)return i.Tasks.create().add(i.Task.statement(`${t?"alter":"create"} view ${this.resolveTarget(e.target)} as ${e.query}`));const r=o.dataform.Target.create({schema:e.target.schema,name:e.target.name+"_temp"});return i.Tasks.create().add(i.Task.statement(this.dropIfExists(r,this.baseTableType(e.enumType)))).add(i.Task.statement(this.createTable(e,r))).add(i.Task.statement(this.dropIfExists(e.target,o.dataform.TableMetadata.Type.TABLE))).add(i.Task.statement(`rename object ${this.resolveTarget(r)} to ${e.target.name} `))}createTable(e,t){const r=e.sqlDataWarehouse&&e.sqlDataWarehouse.distribution?e.sqlDataWarehouse.distribution:"ROUND_ROBIN";return`create table ${this.resolveTarget(t)}\n with(\n distribution = ${r}\n ) \n as ${e.query}`}}t.SQLDataWarehouseAdapter=a},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(51),o=r(52),a=r(31),s=n(r(3)),l=r(108);function c(e){return`ctx.${e} ? ctx.${e}.bind(ctx) : undefined`}function u(e){const t=[];return{sql:e.replace(/^\s*\/\*[jJ][sS]\s*[\r\n]+((?:[^*]|[\r\n]|(?:\*+(?:[^*/]|[\r\n])))*)\*+\/|^\s*\-\-[jJ][sS]\s(.*)/gm,(e,r,n)=>(r&&t.push(r),n&&t.push(n),"")).replace(/([^\\])`/g,(e,t)=>t+"\\`").trim(),js:t.map(e=>e.trim()).join("\n")}}function p(e){let t="",r="";e.children().filter(l.SyntaxTreeNode.isSyntaxTreeNode).filter(e=>e.type===l.SyntaxTreeNodeType.JAVASCRIPT).forEach(e=>{const n=e.concatenate();n.startsWith("config")?t=n.slice("config ".length):r+=n.slice("js {".length,-1*"}".length)});const n=d(e.children().filter(e=>"string"==typeof e||[l.SyntaxTreeNodeType.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER,l.SyntaxTreeNodeType.SQL_COMMENT,l.SyntaxTreeNodeType.SQL_LITERAL_STRING,l.SyntaxTreeNodeType.SQL_LITERAL_MULTILINE_STRING,l.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR].includes(e.type)));let i="",o=[],a=[];const s=[];return e.children().filter(l.SyntaxTreeNode.isSyntaxTreeNode).filter(e=>e.type===l.SyntaxTreeNodeType.SQL).forEach(e=>{const t=e.children()[0],r=e.children().slice(-1)[0],n=d((1===e.children().length?new l.SyntaxTreeNode(l.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1,t.lastIndexOf("}"))]):new l.SyntaxTreeNode(l.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1),...e.children().slice(1,-1),r.slice(0,r.lastIndexOf("}"))])).children());if(t.startsWith("incremental_where")){if(n.length>1)throw new Error("'incremental_where' code blocks may only contain a single SQL statement.");i=n[0]}else if(t.startsWith("pre_operations"))o=n;else if(t.startsWith("post_operations"))a=n;else if(t.startsWith("input")){if(n.length>1)throw new Error("'input' code blocks may only contain a single SQL statement.");const e=t.slice(t.indexOf('"'),t.lastIndexOf('"')+1).split(",").map(e=>e.trim().slice(1,-1));s.push({labelParts:e,value:n[0]})}}),{config:t,js:r,sql:n,incremental:i,preOperations:o,postOperations:a,inputs:s}}function f(e){return[...new Set(Object.getOwnPropertyNames(e).filter(t=>"function"==typeof e[t]&&"constructor"!==t))]}function d(e){const t=[""];return e.forEach(e=>{"string"==typeof e||e.type!==l.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR?t[t.length-1]+=function(e){if("string"==typeof e)return h.get(l.SyntaxTreeNodeType.SQL_LITERAL_STRING)(e);return e.concatenate(h)}(e):t.push("")}),t}t.compile=function(e,t){return t.endsWith(".sqlx")?function(e,t){const{config:r,js:n,sql:i,incremental:o,preOperations:a,postOperations:l,inputs:c}=p(e),u=["self","ref","resolve","name","when","incremental","schema","database"].map(e=>`const ${e} = ctx.${e} ? ctx.${e}.bind(ctx) : undefined;`).join("\n");return`dataform.sqlxAction({\n sqlxConfig: {\n name: "${s.getEscapedFileName(t)}",\n type: "operations",\n ...${r||"{}"}\n },\n sqlStatementCount: ${i.length},\n sqlContextable: (ctx) => {\n ${u}\n ${n}\n return [${i.map(e=>`\`${e}\``)}];\n },\n incrementalWhereContextable: ${o?`(ctx) => {\n ${u}\n ${n}\n return \`${o}\`\n }`:"undefined"},\n preOperationsContextable: ${a.length>0?`(ctx) => {\n ${u}\n ${n}\n return [${a.map(e=>`\`${e}\``)}];\n }`:"undefined"},\n postOperationsContextable: ${l.length>0?`(ctx) => {\n ${u}\n ${n}\n return [${l.map(e=>`\`${e}\``)}];\n }`:"undefined"},\n inputContextables: [\n ${c.map(({labelParts:e,value:t})=>`{\n refName: [${e.map(e=>`"${e}"`).join(", ")}],\n contextable: (ctx) => {\n ${n}\n return \`${t}\`;\n }\n }`).join(",")}\n ]\n});\n`}(l.SyntaxTreeNode.create(e),t):t.endsWith(".assert.sql")?function(e,t){const{sql:r,js:n}=u(e),o=f(i.AssertionContext.prototype).map(e=>`const ${e} = ${c(e)};`);return`\n assert("${s.getEscapedFileName(t)}").query(ctx => {\n ${o.join("\n")}\n ${n}\n return \`${r}\`;\n })`}(e,t):t.endsWith(".ops.sql")?function(e,t){const{sql:r,js:n}=u(e),i=f(o.OperationContext.prototype).map(e=>`const ${e} = ${c(e)};`);return`\n operate("${s.getEscapedFileName(t)}").queries(ctx => {\n ${i.join("\n")}\n ${n}\n return \`${r}\`.split("\\n---\\n");\n })`}(e,t):t.endsWith(".sql")?function(e,t){const{sql:r,js:n}=u(e),i=f(a.TableContext.prototype).map(e=>`const ${e} = ${c(e)};`);return`\n publish("${s.getEscapedFileName(t)}").query(ctx => {\n ${i.join("\n")}\n ${n}\n return \`${r}\`;\n })`}(e,t):e},t.extractJsBlocks=u,t.compileStandaloneSqlxQuery=function(e){const{config:t,js:r,sql:n,incremental:i,preOperations:o,postOperations:a,inputs:s}=p(l.SyntaxTreeNode.create(e));if(t)throw new Error("Standalone SQLX queries may not define 'config' code blocks.");if(i)throw new Error("Standalone SQLX queries may not define 'incremental_where' code blocks.");if(o.length>0)throw new Error("Standalone SQLX queries may not define 'pre_operations' code blocks.");if(a.length>0)throw new Error("Standalone SQLX queries may not define 'post_operations' code blocks.");if(s.length>0)throw new Error("Standalone SQLX queries may not define 'input' code blocks.");return`\n const ref = dataform.resolve.bind(dataform);\n const resolve = dataform.resolve.bind(dataform);\n ${r}\n return \`${n}\`;\n `};const h=new Map([[l.SyntaxTreeNodeType.SQL_COMMENT,e=>e.replace(/`/g,"\\`").replace(/\${/g,"\\${")],[l.SyntaxTreeNodeType.SQL_LITERAL_STRING,e=>e.replace(/\\/g,"\\\\").replace(/\`/g,"\\`")]])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3);t.IRecordDescriptorProperties=()=>n.strictKeysOf()(["description","columns","displayName","dimension","aggregator","expression","tags","bigqueryPolicyTags"])},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(109)),o="sql",a="jsBlock",s="jsTemplateString",l="innerSqlBlock",c="innerSingleQuote",u="innerDoubleQuote",p="innerTripleSingleQuote",f="innerTripleDoubleQuote",d={START_CONFIG:o+"_startConfig",START_JS:o+"_startJs",START_INCREMENTAL:o+"_startIncremental",START_PRE_OPERATIONS:o+"_startPreOperations",START_POST_OPERATIONS:o+"_startPostOperations",START_INPUT:o+"_startInput",STATEMENT_SEPERATOR:o+"_statementSeparator",SINGLE_LINE_COMMENT:o+"_singleLineComment",MULTI_LINE_COMMENT:o+"_multiLineComment",START_JS_PLACEHOLDER:o+"_startJsPlaceholder",BACKTICK:o+"_backtick",START_QUOTE_SINGLE:o+"_startQuoteSingle",START_QUOTE_DOUBLE:o+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:o+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:o+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:o+"_captureEverythingElse"},h={SINGLE_LINE_COMMENT:a+"_singleLineComment",MULTI_LINE_COMMENT:a+"_multiLineComment",SINGLE_QUOTE_STRING:a+"_singleQuoteString",DOUBLE_QUOTE_STRING:a+"_doubleQuoteString",START_JS_TEMPLATE_STRING:a+"_startJsTemplateString",START_JS_BLOCK:a+"_startJsBlock",CLOSE_BLOCK:a+"_closeBlock",CAPTURE_EVERYTHING_ELSE:a+"_captureEverythingElse"},y={ESCAPED_BACKSLASH:s+"_escapedBackslash",ESCAPED_DOLLAR_BRACE:s+"_escapedDollarBrace",START_JS_BLOCK:s+"_startJsBlock",CLOSE_STRING:s+"_closeString",CAPTURE_EVERYTHING_ELSE:s+"_captureEverythingElse"},m={STATEMENT_SEPERATOR:l+"_statementSeparator",SINGLE_LINE_COMMENT:l+"_singleLineComment",MULTI_LINE_COMMENT:l+"_multiLineComment",START_JS_PLACEHOLDER:l+"_startJsPlaceholder",CLOSE_BLOCK:l+"_closeBlock",BACKTICK:l+"_backtick",START_QUOTE_SINGLE:l+"_startQuoteSingle",START_QUOTE_DOUBLE:l+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:l+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:l+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:l+"_captureEverythingElse"},g={ESCAPED_BACKSLASH:c+"_escapedBackslash",ESCAPED_QUOTE:c+"_escapedQuoteSingle",START_JS_PLACEHOLDER:c+"_startJsPlaceholder",CLOSE_QUOTE:c+"_closeQuoteSingle",CAPTURE_EVERYTHING_ELSE:c+"_captureEverythingElse"},b={ESCAPED_BACKSLASH:u+"_escapedBackslash",ESCAPED_QUOTE:u+"_escapedQuoteDouble",START_JS_PLACEHOLDER:u+"_startJsPlaceholder",CLOSE_QUOTE:u+"_closeQuoteDouble",CAPTURE_EVERYTHING_ELSE:u+"_captureEverythingElse"},O={ESCAPED_BACKSLASH:p+"_escapedBackslash",START_JS_PLACEHOLDER:p+"_startJsPlaceholder",CLOSE_QUOTE:p+"_closeTripleQuoteSingle",CAPTURE_EVERYTHING_ELSE:p+"_captureEverythingElse"},v={ESCAPED_BACKSLASH:f+"_escapedBackslash",START_JS_PLACEHOLDER:f+"_startJsPlaceholder",CLOSE_QUOTE:f+"_closeTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:f+"_captureEverythingElse"},T=i.states(function(){const e={};e[d.START_CONFIG]={match:"config {",push:a},e[d.START_JS]={match:"js {",push:a},e[d.START_INCREMENTAL]={match:"incremental_where {",push:l},e[d.START_PRE_OPERATIONS]={match:"pre_operations {",push:l},e[d.START_POST_OPERATIONS]={match:"post_operations {",push:l},e[d.START_INPUT]={match:/input "[a-zA-Z0-9_-]+"(?:,\s*"[a-zA-Z0-9_-]+")* {/,push:l},e[d.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,e[d.SINGLE_LINE_COMMENT]=/--.*?$/,e[d.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,e[d.START_JS_PLACEHOLDER]={match:"${",push:a},e[d.BACKTICK]="`",e[d.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},e[d.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},e[d.START_QUOTE_SINGLE]={match:"'",push:c},e[d.START_QUOTE_DOUBLE]={match:'"',push:u},e[d.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const t={};t[h.SINGLE_LINE_COMMENT]=/\/\/.*?$/,t[h.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,t[h.SINGLE_QUOTE_STRING]=/'(?:\\['\\]|[^\n'\\])*'/,t[h.DOUBLE_QUOTE_STRING]=/"(?:\\["\\]|[^\n"\\])*"/,t[h.START_JS_TEMPLATE_STRING]={match:"`",push:s},t[h.START_JS_BLOCK]={match:"{",push:a},t[h.CLOSE_BLOCK]={match:"}",pop:1},t[h.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const r={};r[y.ESCAPED_BACKSLASH]=/\\\\/,r[y.ESCAPED_DOLLAR_BRACE]=/\\\${`/,r[y.START_JS_BLOCK]={match:"${",push:a},r[y.CLOSE_STRING]={match:"`",pop:1},r[y.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const n={};n[m.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,n[m.SINGLE_LINE_COMMENT]=/--.*?$/,n[m.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,n[m.START_JS_PLACEHOLDER]={match:"${",push:a},n[m.CLOSE_BLOCK]={match:"}",pop:1},n[m.BACKTICK]="`",n[m.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},n[m.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},n[m.START_QUOTE_SINGLE]={match:"'",push:c},n[m.START_QUOTE_DOUBLE]={match:'"',push:u},n[m.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const i={};i[g.ESCAPED_BACKSLASH]="\\\\",i[g.ESCAPED_QUOTE]="\\'",i[g.START_JS_PLACEHOLDER]={match:"${",push:a},i[g.CLOSE_QUOTE]={match:"'",pop:1},i[g.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const T={};T[b.ESCAPED_BACKSLASH]="\\\\",T[b.ESCAPED_QUOTE]={match:'\\"'},i[b.START_JS_PLACEHOLDER]={match:"${",push:a},T[b.CLOSE_QUOTE]={match:'"',pop:1},T[b.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const w={};w[O.ESCAPED_BACKSLASH]="\\\\",w[O.START_JS_PLACEHOLDER]={match:"${",push:a},w[O.CLOSE_QUOTE]={match:"'''",pop:1},w[O.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const E={};E[v.ESCAPED_BACKSLASH]="\\\\",E[v.START_JS_PLACEHOLDER]={match:"${",push:a},E[v.CLOSE_QUOTE]={match:'"""',pop:1},E[v.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const S={};return S[o]=e,S[a]=t,S[s]=r,S[l]=n,S[c]=i,S[u]=T,S[p]=w,S[f]=E,S}());var w;!function(e){e[e.JAVASCRIPT=0]="JAVASCRIPT",e[e.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER=1]="JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER",e[e.SQL=2]="SQL",e[e.SQL_COMMENT=3]="SQL_COMMENT",e[e.SQL_LITERAL_STRING=4]="SQL_LITERAL_STRING",e[e.SQL_LITERAL_MULTILINE_STRING=5]="SQL_LITERAL_MULTILINE_STRING",e[e.SQL_STATEMENT_SEPARATOR=6]="SQL_STATEMENT_SEPARATOR"}(w=t.SyntaxTreeNodeType||(t.SyntaxTreeNodeType={}));const E=new Map([[d.START_CONFIG,w.JAVASCRIPT],[d.START_INCREMENTAL,w.SQL],[d.START_INPUT,w.SQL],[d.START_JS,w.JAVASCRIPT],[d.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[d.START_POST_OPERATIONS,w.SQL],[d.START_PRE_OPERATIONS,w.SQL],[d.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[d.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[d.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[d.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[h.START_JS_BLOCK,w.JAVASCRIPT],[y.START_JS_BLOCK,w.JAVASCRIPT],[m.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[m.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[m.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[m.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[m.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[g.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[b.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[O.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[v.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER]]),S=new Set([h.CLOSE_BLOCK,m.CLOSE_BLOCK,g.CLOSE_QUOTE,b.CLOSE_QUOTE,O.CLOSE_QUOTE,v.CLOSE_QUOTE]),j=new Map([[d.MULTI_LINE_COMMENT,w.SQL_COMMENT],[d.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[d.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR],[m.MULTI_LINE_COMMENT,w.SQL_COMMENT],[m.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[m.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR]]);class P{constructor(e,t=[]){this.type=e,this.allChildren=t}static create(e){const t=new P(w.SQL);let r=t;const n=[r];T.reset(e);for(const e of T){if(!e.type)throw new Error("Undefined token type encountered.");if(E.has(e.type)){const t=E.get(e.type);if(t===w.SQL&&r.type!==w.SQL)throw new Error("SQL syntax tree nodes may only be children of other SQL nodes.");const i=new P(t,[e.value]);n.push(i),r.push(i),r=i}else S.has(e.type)?(r.push(e.value),n.pop(),r=n[n.length-1]):j.has(e.type)?r.push(new P(j.get(e.type)).push(e.value)):r.push(e.value)}return t}static isSyntaxTreeNode(e){return"string"!=typeof e}children(){return this.allChildren.slice()}concatenate(e){const t=(null==e?void 0:e.has(this.type))?e.get(this.type):e=>e;return this.allChildren.map(e=>"string"==typeof e?t(e):e.concatenate()).join("")}push(e){return this.allChildren.length>0&&"string"==typeof e&&"string"==typeof this.allChildren[this.allChildren.length-1]?(this.allChildren[this.allChildren.length-1]=this.allChildren[this.allChildren.length-1]+e,this):(this.allChildren.push(e),this)}equals(e){if(this.type!==e.type)return!1;if(this.allChildren.length!==e.children().length)return!1;return!this.allChildren.some((t,r)=>{return n=t,i=e.children()[r],!(typeof n==typeof i&&("string"==typeof n||"string"==typeof i?n===i:n.equals(i)));var n,i})}}t.SyntaxTreeNode=P},function(e,t,r){var n,i,o;i=[],void 0===(o="function"==typeof(n=function(){"use strict";var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r="boolean"==typeof(new RegExp).sticky;function n(e){return e&&"[object RegExp]"===t.call(e)}function i(e){return e&&"object"==typeof e&&!n(e)&&!Array.isArray(e)}function o(e){return"("+e+")"}function a(e){return e.length?"(?:"+e.map((function(e){return"(?:"+e+")"})).join("|")+")":"(?!)"}function s(e){if("string"==typeof e)return"(?:"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(n(e)){if(e.ignoreCase)throw new Error("RegExp /i flag not allowed");if(e.global)throw new Error("RegExp /g flag is implied");if(e.sticky)throw new Error("RegExp /y flag is implied");if(e.multiline)throw new Error("RegExp /m flag is implied");return e.source}throw new Error("Not a pattern: "+e)}function l(t,r){if(i(r)||(r={match:r}),r.include)throw new Error("Matching rules cannot also include states");var o={defaultType:t,lineBreaks:!!r.error||!!r.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var a in r)e.call(r,a)&&(o[a]=r[a]);if("string"==typeof o.type&&t!==o.type)throw new Error("Type transform cannot be a string (type '"+o.type+"' for token '"+t+"')");var s=o.match;return o.match=Array.isArray(s)?s:s?[s]:[],o.match.sort((function(e,t){return n(e)&&n(t)?0:n(t)?-1:n(e)?1:t.length-e.length})),o}function c(e){return Array.isArray(e)?function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n.include)for(var i=[].concat(n.include),o=0;o<i.length;o++)t.push({include:i[o]});else{if(!n.type)throw new Error("Rule has no type: "+JSON.stringify(n));t.push(l(n.type,n))}}return t}(e):function(e){for(var t=Object.getOwnPropertyNames(e),r=[],n=0;n<t.length;n++){var o=t[n],a=e[o],s=[].concat(a);if("include"!==o){var c=[];s.forEach((function(e){i(e)?(c.length&&r.push(l(o,c)),r.push(l(o,e)),c=[]):c.push(e)})),c.length&&r.push(l(o,c))}else for(var u=0;u<s.length;u++)r.push({include:s[u]})}return r}(e)}var u=l("error",{lineBreaks:!0,shouldThrow:!0});function p(e,t){for(var i=null,l=Object.create(null),c=!0,p=null,f=[],d=[],h=0;h<e.length;h++)e[h].fallback&&(c=!1);for(h=0;h<e.length;h++){var y=e[h];if(y.include)throw new Error("Inheritance is not allowed in stateless lexers");if(y.error||y.fallback){if(i)throw!y.fallback==!i.fallback?new Error("Multiple "+(y.fallback?"fallback":"error")+" rules not allowed (for token '"+y.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+y.defaultType+"')");i=y}var m=y.match.slice();if(c)for(;m.length&&"string"==typeof m[0]&&1===m[0].length;)l[m.shift().charCodeAt(0)]=y;if(y.pop||y.push||y.next){if(!t)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+y.defaultType+"')");if(y.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+y.defaultType+"')")}if(0!==m.length){c=!1,f.push(y);for(var g=0;g<m.length;g++){var b=m[g];if(n(b))if(null===p)p=b.unicode;else if(p!==b.unicode&&!1===y.fallback)throw new Error("If one rule is /u then all must be")}var O=a(m.map(s)),v=new RegExp(O);if(v.test(""))throw new Error("RegExp matches empty string: "+v);if(new RegExp("|"+O).exec("").length-1>0)throw new Error("RegExp has capture groups: "+v+"\nUse (?: … ) instead");if(!y.lineBreaks&&v.test("\n"))throw new Error("Rule should declare lineBreaks: "+v);d.push(o(O))}}var T=i&&i.fallback,w=r&&!T?"ym":"gm",E=r||T?"":"|";return!0===p&&(w+="u"),{regexp:new RegExp(a(d)+E,w),groups:f,fast:l,error:i||u}}function f(e,t,r){var n=e&&(e.push||e.next);if(n&&!r[n])throw new Error("Missing state '"+n+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw new Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var d=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};d.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},d.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},d.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},d.prototype.popState=function(){this.setState(this.stack.pop())},d.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var h=r?function(e,t){return e.exec(t)}:function(e,t){var r=e.exec(t);return 0===r[0].length?null:r};function y(){return this.value}if(d.prototype._getGroup=function(e){for(var t=this.groups.length,r=0;r<t;r++)if(void 0!==e[r+1])return this.groups[r];throw new Error("Cannot find token type for matched text")},d.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText="",t}var r=this.buffer;if(e!==r.length){if(a=this.fast[r.charCodeAt(e)])return this._token(a,r.charAt(e),e);var n=this.re;n.lastIndex=e;var i=h(n,r),o=this.error;if(null==i)return this._token(o,r.slice(e,r.length),e);var a=this._getGroup(i),s=i[0];return o.fallback&&i.index!==e?(this.queuedGroup=a,this.queuedText=s,this._token(o,r.slice(e,i.index),e)):this._token(a,s,e)}},d.prototype._token=function(e,t,r){var n=0;if(e.lineBreaks){var i=/\n/g,o=1;if("\n"===t)n=1;else for(;i.exec(t);)n++,o=i.lastIndex}var a={type:"function"==typeof e.type&&e.type(t)||e.defaultType,value:"function"==typeof e.value?e.value(t):t,text:t,toString:y,offset:r,lineBreaks:n,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=n,0!==n?this.col=s-o+1:this.col+=s,e.shouldThrow)throw new Error(this.formatError(a,"invalid syntax"));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),a},"undefined"!=typeof Symbol&&Symbol.iterator){var m=function(e){this.lexer=e};m.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},m.prototype[Symbol.iterator]=function(){return this},d.prototype[Symbol.iterator]=function(){return new m(this)}}return d.prototype.formatError=function(e,t){if(null==e){var r=this.buffer.slice(this.index);e={text:r,offset:this.index,lineBreaks:-1===r.indexOf("\n")?0:1,line:this.line,col:this.col}}var n=Math.max(0,e.offset-e.col+1),i=e.lineBreaks?e.text.indexOf("\n"):e.text.length,o=this.buffer.substring(n,e.offset+i);return t+=" at line "+e.line+" col "+e.col+":\n\n",t+=" "+o+"\n",t+=" "+Array(e.col).join(" ")+"^"},d.prototype.clone=function(){return new d(this.states,this.state)},d.prototype.has=function(e){return!0},{compile:function(e){var t=p(c(e));return new d({start:t},"start")},states:function(e,t){var r=e.$all?c(e.$all):[];delete e.$all;var n=Object.getOwnPropertyNames(e);t||(t=n[0]);for(var i=Object.create(null),o=0;o<n.length;o++){var a=n[o];i[a]=c(e[a]).concat(r)}for(o=0;o<n.length;o++){a=n[o];for(var s=i[a],l=Object.create(null),u=0;u<s.length;u++){var h=s[u];if(h.include){var y=[u,1];if(h.include!==a&&!l[h.include]){l[h.include]=!0;var m=i[h.include];if(!m)throw new Error("Cannot include nonexistent state '"+h.include+"' (in state '"+a+"')");for(var g=0;g<m.length;g++){var b=m[g];-1===s.indexOf(b)&&y.push(b)}}s.splice.apply(s,y),u--}}}var O=Object.create(null);for(o=0;o<n.length;o++)a=n[o],O[a]=p(i[a],!0);for(o=0;o<n.length;o++){var v=n[o],T=O[v],w=T.groups;for(u=0;u<w.length;u++)f(w[u],v,O);var E=Object.getOwnPropertyNames(T.fast);for(u=0;u<E.length;u++)f(T.fast[E[u]],v,O)}return new d(O,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t=Object.create(null),r=Object.create(null),n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var o=n[i],a=e[o];(Array.isArray(a)?a:[a]).forEach((function(e){if((r[e.length]=r[e.length]||[]).push(e),"string"!=typeof e)throw new Error("keyword must be string (in keyword '"+o+"')");t[e]=o}))}function s(e){return JSON.stringify(e)}var l="";for(var c in l+="switch (value.length) {\n",r){var u=r[c];l+="case "+c+":\n",l+="switch (value) {\n",u.forEach((function(e){var r=t[e];l+="case "+s(e)+": return "+s(r)+"\n"})),l+="}\n"}return l+="}\n",Function("value",l)}}})?n.apply(t,i):n)||(e.exports=o)},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(32),o=n(r(3)),a=r(0);t.genIndex=function(e){const t=i.decode64(a.dataform.GenerateIndexConfig,e),r=t.includePaths.map(e=>`\n try { global.${o.baseFilename(e)} = require("./${e}"); } catch (e) {\n session.compileError(e, "${e}");\n }`).join("\n"),n=t.definitionPaths.map(e=>`\n try { require("./${e}"); } catch (e) {\n session.compileError(e, "${e}");\n }`).join("\n"),s=JSON.stringify(a.dataform.ProjectConfig.create(t.compileConfig.projectConfigOverride).toJSON());return`\n// Read the project config.\nconst originalProjectConfig = require("./dataform.json");\n\n// Stop using the deprecated 'gcloudProjectId' field.\nif (!originalProjectConfig.defaultDatabase) {\n originalProjectConfig.defaultDatabase = originalProjectConfig.gcloudProjectId;\n}\ndelete originalProjectConfig.gcloudProjectId;\n\nlet projectConfig = { ...originalProjectConfig };\n\n// Merge in general project config overrides.\nprojectConfig = { ...projectConfig, ...${s}, vars: { ...projectConfig.vars, ...${s}.vars } };\n\n// Initialize the compilation session.\nconst session = require("@dataform/core").session;\nsession.init("${t.compileConfig.projectDir.replace(/\\/g,"\\\\")}", projectConfig, originalProjectConfig);\n\n// Allow "includes" files to use the current session object.\nglobal.dataform = session;\n\n// Require "includes" *.js files.\n${r}\n\n// Bind various @dataform/core APIs to the 'global' object.\nglobal.publish = session.publish.bind(session);\nglobal.operate = session.operate.bind(session);\nglobal.assert = session.assert.bind(session);\nglobal.declare = session.declare.bind(session);\nglobal.test = session.test.bind(session);\n\n// Require all "definitions" files (attaching them to the session).\n${n}\n\n// Return a base64 encoded proto via NodeVM. Returning a Uint8Array directly causes issues.\nreturn session.compileToBase64();`}},function(e,t,r){"use strict";e.exports=r(112)},function(e,t,r){"use strict";var n=e.exports=r(113);n.build="full",n.tokenize=r(58),n.parse=r(117),n.common=r(118),n.Root._configure(n.Type,n.parse,n.common)},function(e,t,r){"use strict";var n=e.exports=r(46);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(53),n.decoder=r(54),n.verifier=r(55),n.converter=r(56),n.ReflectionObject=r(11),n.Namespace=r(15),n.Root=r(38),n.Enum=r(6),n.Type=r(33),n.Field=r(9),n.OneOf=r(16),n.MapField=r(34),n.Service=r(35),n.Method=r(36),n.Message=r(37),n.wrappers=r(57),n.types=r(12),n.util=r(1),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},function(e,t,r){"use strict";function n(e,t){"string"==typeof e&&(t=e,e=void 0);var r=[];function i(e){if("string"!=typeof e){var t=o();if(n.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var a=Object.keys(e),s=new Array(a.length+1),l=new Array(a.length),c=0;c<a.length;)s[c]=a[c],l[c]=e[a[c++]];return s[c]=t,Function.apply(null,s).apply(null,l)}return Function(t)()}for(var u=new Array(arguments.length-1),p=0;p<u.length;)u[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=u[p++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),p!==u.length)throw Error("parameter count mismatch");return r.push(e),i}function o(n){return"function "+(n||t||"")+"("+(e&&e.join(",")||"")+"){\n "+r.join("\n ")+"\n}"}return i.toString=o,i}e.exports=n,n.verbose=!1},function(e,t,r){"use strict";e.exports=o;var n=r(47),i=r(48)("fs");function o(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},function(e,t,r){"use strict";var n=t,i=n.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=n.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=i(e),n="";r&&(n=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return n+t.join("/")};n.resolve=function(e,t,r){return r||(t=o(t)),i(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},function(e,t,r){"use strict";e.exports=S,S.filename=null,S.defaults={keepCase:!1};var n=r(58),i=r(38),o=r(33),a=r(9),s=r(34),l=r(16),c=r(6),u=r(35),p=r(36),f=r(12),d=r(1),h=/^[1-9][0-9]*$/,y=/^-?[1-9][0-9]*$/,m=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,b=/^0[0-7]+$/,O=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,w=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,E=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function S(e,t,r){t instanceof i||(r=t,t=new i),r||(r=S.defaults);var j,P,A,k,x,N=r.preferTrailingComment||!1,C=n(e,r.alternateCommentMode||!1),R=C.next,_=C.push,I=C.peek,D=C.skip,L=C.cmnt,q=!0,B=!1,M=t,$=r.keepCase?function(e){return e}:d.camelCase;function U(e,t,r){var n=S.filename;return r||(S.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+C.line+")")}function Q(){var e,t=[];do{if('"'!==(e=R())&&"'"!==e)throw U(e);t.push(R()),D(e),e=I()}while('"'===e||"'"===e);return t.join("")}function G(e){var t=R();switch(t){case"'":case'"':return _(t),Q();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(h.test(e))return r*parseInt(e,10);if(m.test(e))return r*parseInt(e,16);if(b.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw U(e,"number",t)}(t,!0)}catch(r){if(e&&w.test(t))return t;throw U(t,"value")}}function J(e,t){var r,n;do{!t||'"'!==(r=I())&&"'"!==r?e.push([n=K(R()),D("to",!0)?K(R()):n]):e.push(Q())}while(D(",",!0));D(";")}function K(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw U(e,"id");if(y.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(O.test(e))return parseInt(e,8);throw U(e,"id")}function F(){if(void 0!==j)throw U("package");if(j=R(),!w.test(j))throw U(j,"name");M=M.define(j),D(";")}function W(){var e,t=I();switch(t){case"weak":e=A||(A=[]),R();break;case"public":R();default:e=P||(P=[])}t=Q(),D(";"),e.push(t)}function V(){if(D("="),k=Q(),!(B="proto3"===k)&&"proto2"!==k)throw U(k,"syntax");D(";")}function z(e,t){switch(t){case"option":return ee(e,t),D(";"),!0;case"message":return Y(e,t),!0;case"enum":return Z(e,t),!0;case"service":return function(e,t){if(!T.test(t=R()))throw U(t,"service name");var r=new u(t);H(r,(function(e){if(!z(r,e)){if("rpc"!==e)throw U(e);!function(e,t){var r=L(),n=t;if(!T.test(t=R()))throw U(t,"name");var i,o,a,s,l=t;D("("),D("stream",!0)&&(o=!0);if(!w.test(t=R()))throw U(t);i=t,D(")"),D("returns"),D("("),D("stream",!0)&&(s=!0);if(!w.test(t=R()))throw U(t);a=t,D(")");var c=new p(l,n,i,a,o,s);c.comment=r,H(c,(function(e){if("option"!==e)throw U(e);ee(c,e),D(";")})),e.add(c)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!w.test(t=R()))throw U(t,"reference");var r=t;H(null,(function(t){switch(t){case"required":case"repeated":X(e,t,r);break;case"optional":X(e,B?"proto3_optional":"optional",r);break;default:if(!B||!w.test(t))throw U(t);_(t),X(e,"optional",r)}}))}(e,t),!0}return!1}function H(e,t,r){var n=C.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=S.filename),D("{",!0)){for(var i;"}"!==(i=R());)t(i);D(";",!0)}else r&&r(),D(";"),e&&("string"!=typeof e.comment||N)&&(e.comment=L(n)||e.comment)}function Y(e,t){if(!T.test(t=R()))throw U(t,"type name");var r=new o(t);H(r,(function(e){if(!z(r,e))switch(e){case"map":!function(e){D("<");var t=R();if(void 0===f.mapKey[t])throw U(t,"type");D(",");var r=R();if(!w.test(r))throw U(r,"type");D(">");var n=R();if(!T.test(n))throw U(n,"name");D("=");var i=new s($(n),K(R()),t,r);H(i,(function(e){if("option"!==e)throw U(e);ee(i,e),D(";")}),(function(){ne(i)})),e.add(i)}(r);break;case"required":case"repeated":X(r,e);break;case"optional":X(r,B?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=R()))throw U(t,"name");var r=new l($(t));H(r,(function(e){"option"===e?(ee(r,e),D(";")):(_(e),X(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":J(r.extensions||(r.extensions=[]));break;case"reserved":J(r.reserved||(r.reserved=[]),!0);break;default:if(!B||!w.test(e))throw U(e);_(e),X(r,"optional")}})),e.add(r)}function X(e,t,r){var n=R();if("group"!==n){for(;n.endsWith(".")||I().startsWith(".");)n+=R();if(!w.test(n))throw U(n,"type");var i=R();if(!T.test(i))throw U(i,"name");i=$(i),D("=");var s=new a(i,K(R()),n,t,r);if(H(s,(function(e){if("option"!==e)throw U(e);ee(s,e),D(";")}),(function(){ne(s)})),"proto3_optional"===t){var c=new l("_"+i);s.setOption("proto3_optional",!0),c.add(s),e.add(c)}else e.add(s);B||!s.repeated||void 0===f.packed[n]&&void 0!==f.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=R();if(!T.test(r))throw U(r,"name");var n=d.lcFirst(r);r===n&&(r=d.ucFirst(r));D("=");var i=K(R()),s=new o(r);s.group=!0;var l=new a(n,i,r,t);l.filename=S.filename,H(s,(function(e){switch(e){case"option":ee(s,e),D(";");break;case"required":case"repeated":X(s,e);break;case"optional":X(s,B?"proto3_optional":"optional");break;case"message":Y(s,e);break;case"enum":Z(s,e);break;default:throw U(e)}})),e.add(s).add(l)}(e,t)}function Z(e,t){if(!T.test(t=R()))throw U(t,"name");var r=new c(t);H(r,(function(e){switch(e){case"option":ee(r,e),D(";");break;case"reserved":J(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw U(t,"name");D("=");var r=K(R(),!0),n={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};H(n,(function(e){if("option"!==e)throw U(e);ee(n,e),D(";")}),(function(){ne(n)})),e.add(t,r,n.comment,n.options)}(r,e)}})),e.add(r)}function ee(e,t){var r=D("(",!0);if(!w.test(t=R()))throw U(t,"name");var n,i=t,o=i;r&&(D(")"),o=i="("+i+")",t=I(),E.test(t)&&(n=t.slice(1),i+=t,R())),D("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,o,te(e,i),n)}function te(e,t){if(D("{",!0)){for(var r={};!D("}",!0);){if(!T.test(x=R()))throw U(x,"name");var n,i=x;if(D(":",!0),"{"===I())n=te(e,t+"."+x);else if("["===I()){var o;if(n=[],D("[",!0)){do{o=G(!0),n.push(o)}while(D(",",!0));D("]"),void 0!==o&&re(e,t+"."+x,o)}}else n=G(!0),re(e,t+"."+x,n);var a=r[i];a&&(n=[].concat(a).concat(n)),r[i]=n,D(",",!0),D(";",!0)}return r}var s=G(!0);return re(e,t,s),s}function re(e,t,r){e.setOption&&e.setOption(t,r)}function ne(e){if(D("[",!0)){do{ee(e,"option")}while(D(",",!0));D("]")}return e}for(;null!==(x=R());)switch(x){case"package":if(!q)throw U(x);F();break;case"import":if(!q)throw U(x);W();break;case"syntax":if(!q)throw U(x);V();break;case"option":ee(M,x),D(";");break;default:if(z(M,x)){q=!1;continue}throw U(x)}return S.filename=null,{package:j,imports:P,weakImports:A,syntax:k,root:t}}},function(e,t,r){"use strict";e.exports=o;var n,i=/\/|\./;function o(e,t){i.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:n={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:n}),o("empty",{Empty:{fields:{}}}),o("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),o("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(32),o=n(r(3)),a=r(0),s=require;t.main=function(e){var t;const r=global;let n;n="string"==typeof e?i.decode64(a.dataform.CoreExecutionRequest,e):a.dataform.CoreExecutionRequest.decode(e);const l=n.compile,c=s("dataform.json"),u=null!==(t=l.compileConfig.projectConfigOverride)&&void 0!==t?t:{};c.defaultDatabase||(c.defaultDatabase=c.gcloudProjectId),delete c.gcloudProjectId;let p=Object.assign({},c);p=Object.assign(Object.assign(Object.assign({},p),u),{vars:Object.assign(Object.assign({},p.vars),u.vars)});const f=s("@dataform/core").session;f.init(l.compileConfig.projectDir,p,c),r.dataform=f;const d={};l.compileConfig.filePaths.filter(e=>e.startsWith("includes"+o.pathSeperator)).filter(e=>2===e.split(o.pathSeperator).length).filter(e=>e.endsWith(".js")).forEach(e=>{try{d[o.baseFilename(e)]=s(e)}catch(t){f.compileError(t,e)}}),Object.assign(r,d),r.publish=f.publish.bind(f),r.operate=f.operate.bind(f),r.assert=f.assert.bind(f),r.declare=f.declare.bind(f),r.test=f.test.bind(f),l.compileConfig.filePaths.filter(e=>e.startsWith("definitions"+o.pathSeperator)).filter(e=>e.endsWith(".js")||e.endsWith(".sqlx")).forEach(e=>{try{s(e)}catch(t){f.compileError(t,e)}});const h=a.dataform.CoreExecutionResponse.create({compile:{compiledGraph:f.compile()}});return"string"==typeof e?i.encode64(a.dataform.CoreExecutionResponse,h):a.dataform.CoreExecutionResponse.encode(h).finish()}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(121)),a=r(32),s=r(39),l=i(r(40)),c=r(51),u=r(123),p=r(52),f=r(31),d=r(59),h=i(r(124)),y=i(r(3)),m=r(3),g=r(60),b=r(0),O=new RegExp("HASH\\s*\\(\\s*\\w*\\s*\\)\\s*"),v={defaultSchema:"dataform",assertionSchema:"dataform_assertions"};function T(e){return"view"===e||"table"===e||"inline"===e||"incremental"===e}function w(e){return e.map(e=>`"${e}"`).join(" | ")}t.Session=class{constructor(e,t,r){this.init(e,t,r)}init(e,t,r){this.rootDir=e,this.config=t||v,this.canonicalConfig=function(e){return{warehouse:e.warehouse,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,assertionSchema:e.assertionSchema}}(r||t||v),this.actions=[],this.tests={},this.graphErrors={compilationErrors:[]}}get projectConfig(){return Object.freeze({warehouse:this.config.warehouse,defaultDatabase:this.config.defaultDatabase,defaultSchema:this.config.defaultSchema,assertionSchema:this.config.assertionSchema,databaseSuffix:this.config.databaseSuffix,schemaSuffix:this.config.schemaSuffix,tablePrefix:this.config.tablePrefix,vars:Object.freeze(Object.assign({},this.config.vars))})}adapter(){return l.create(this.config,g.version)}sqlxAction(e){const{sqlxConfig:t}=e;switch(e.sqlStatementCount>1&&"operations"!==t.type&&this.compileError("Actions may only contain more than one SQL statement if they are of type 'operations'."),t.hasOwnProperty("protected")&&"incremental"!==t.type&&this.compileError("Actions may only specify 'protected: true' if they are of type 'incremental'."),e.incrementalWhereContextable&&"incremental"!==t.type&&this.compileError("Actions may only include incremental_where if they are of type 'incremental'."),t.hasOwnProperty("schema")||"declaration"!==t.type||this.compileError("Actions of type 'declaration' must specify a value for 'schema'."),e.inputContextables.length>0&&"test"!==t.type&&this.compileError("Actions may only include input blocks if they are of type 'test'."),e.preOperationsContextable&&!T(t.type)&&this.compileError("Actions may only include pre_operations if they create a dataset."),e.postOperationsContextable&&!T(t.type)&&this.compileError("Actions may only include post_operations if they create a dataset."),t.hasOwnProperty("sqldatawarehouse")&&!["bigquery","snowflake"].includes(this.config.warehouse)&&this.compileError("Actions may only specify 'database' in projects whose warehouse is 'BigQuery' or 'Snowflake'."),t.type){case"view":case"table":case"inline":case"incremental":const r=this.publish(t.name).config(t).query(t=>e.sqlContextable(t)[0]);e.incrementalWhereContextable&&r.where(e.incrementalWhereContextable),e.preOperationsContextable&&r.preOps(e.preOperationsContextable),e.postOperationsContextable&&r.postOps(e.postOperationsContextable);break;case"assertion":this.assert(t.name).config(t).query(t=>e.sqlContextable(t)[0]);break;case"operations":this.operate(t.name).config(t).queries(e.sqlContextable);break;case"declaration":this.declare({database:t.database,schema:t.schema,name:t.name}).config(t);break;case"test":const n=this.test(t.name).config(t).expect(t=>e.sqlContextable(t)[0]);e.inputContextables.forEach(({refName:e,contextable:t})=>{n.input(e,t)});break;default:throw new Error("Unrecognized action type: "+t.type)}}resolve(e,...t){e=m.toResolvable(e,t);const r=this.indexedActions.find(y.resolvableAsTarget(e));r.length>1&&this.compileError(new Error(y.ambiguousActionNameMsg(e,r)));const n=r.length>0?r[0]:void 0;return n&&n instanceof f.Table&&n.proto.enumType===b.dataform.TableType.INLINE?`(${n.proto.query})`:(n&&n instanceof p.Operation&&!n.proto.hasOutput&&this.compileError(new Error("Actions cannot resolve operations which do not produce output.")),n?n instanceof u.Declaration?this.adapter().resolveTarget(n.proto.target):this.adapter().resolveTarget(Object.assign(Object.assign({},n.proto.target),{database:n.proto.target.database&&this.finalizeDatabase(n.proto.target.database),schema:this.finalizeSchema(n.proto.target.schema),name:this.finalizeName(n.proto.target.name)})):"string"==typeof e?this.adapter().resolveTarget(y.target(this.adapter(),this.config,this.finalizeName(e),this.finalizeSchema(this.config.defaultSchema),this.config.defaultDatabase&&this.finalizeDatabase(this.config.defaultDatabase))):this.adapter().resolveTarget(y.target(this.adapter(),this.config,this.finalizeName(e.name),this.finalizeSchema(e.schema),e.database&&this.finalizeName(e.database))))}operate(e,t){const r=new p.Operation;return r.session=this,y.setNameAndTarget(this,r.proto,e),t&&r.queries(t),r.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(r),r}publish(e,t){const r=new f.Table;return r.session=this,y.setNameAndTarget(this,r.proto,e),t&&("object"==typeof t?r.config(t):r.query(t)),r.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(r),r}assert(e,t){const r=new c.Assertion;return r.session=this,y.setNameAndTarget(this,r.proto,e,this.config.assertionSchema),t&&r.query(t),r.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(r),r}declare(e){const t=new u.Declaration;return t.session=this,y.setNameAndTarget(this,t.proto,e.name,e.schema,e.database),t.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(t),t}test(e){const t=new h.Test;return t.session=this,t.proto.name=e,t.proto.fileName=y.getCallerFile(this.rootDir),this.tests[e]=t,t}compileError(t,r,n){const i=r||y.getCallerFile(this.rootDir)||e,o=b.dataform.CompilationError.create({fileName:i,actionName:n?d.targetAsReadableString(n):void 0,actionTarget:n});"string"==typeof t?o.message=t:(o.message=t.message,o.stack=t.stack),this.graphErrors.compilationErrors.push(o)}compile(){if(this.indexedActions=new E(this.adapter(),this.actions),"bigquery"!==this.config.warehouse||this.config.defaultLocation||this.compileError("A defaultLocation is required for BigQuery. This can be configured in dataform.json.","dataform.json"),this.config.vars&&!Object.values(this.config.vars).every(e=>"string"==typeof e))throw new Error("Custom variables defined in dataform.json can only be strings.");const e=b.dataform.CompiledGraph.create({projectConfig:this.config,tables:this.compileGraphChunk(this.actions.filter(e=>e instanceof f.Table),b.dataform.Table.verify),operations:this.compileGraphChunk(this.actions.filter(e=>e instanceof p.Operation),b.dataform.Operation.verify),assertions:this.compileGraphChunk(this.actions.filter(e=>e instanceof c.Assertion),b.dataform.Assertion.verify),declarations:this.compileGraphChunk(this.actions.filter(e=>e instanceof u.Declaration),b.dataform.Declaration.verify),tests:this.compileGraphChunk(Object.values(this.tests),b.dataform.Test.verify),graphErrors:this.graphErrors,dataformCoreVersion:g.version,targets:this.actions.map(e=>e.proto.target)});return this.fullyQualifyDependencies([].concat(e.tables,e.assertions,e.operations)),this.alterActionName([].concat(e.tables,e.assertions,e.operations),[].concat(e.declarations.map(e=>e.target))),this.removeNonUniqueActionsFromCompiledGraph(e),this.checkTestNameUniqueness(e.tests),this.checkTableConfigValidity(e.tables),this.checkCircularity([].concat(e.tables,e.assertions,e.operations)),this.config.useRunCache&&this.checkRunCachingCorrectness([].concat(e.tables,e.assertions,e.operations.filter(e=>e.hasOutput))),y.throwIfInvalid(e,b.dataform.CompiledGraph.verify),e}compileToBase64(){return a.encode64(b.dataform.CompiledGraph,this.compile())}finalizeDatabase(e){return this.adapter().normalizeIdentifier(`${e}${this.getDatabaseSuffixWithUnderscore()}`)}finalizeSchema(e){return this.adapter().normalizeIdentifier(`${e}${this.getSchemaSuffixWithUnderscore()}`)}finalizeName(e){return this.adapter().normalizeIdentifier(`${this.getTablePrefixWithUnderscore()}${e}`)}getDatabaseSuffixWithUnderscore(){return this.config.databaseSuffix?"_"+this.config.databaseSuffix:""}getSchemaSuffixWithUnderscore(){return this.config.schemaSuffix?"_"+this.config.schemaSuffix:""}getTablePrefixWithUnderscore(){return this.config.tablePrefix?this.config.tablePrefix+"_":""}compileGraphChunk(e,t){const r=[];return e.forEach(e=>{try{const n=e.compile();y.throwIfInvalid(n,t),r.push(n)}catch(t){this.compileError(t,e.proto.fileName,e.proto.target)}}),r}fullyQualifyDependencies(e){e.forEach(e=>{const t={};for(const r of e.dependencyTargets){const n=this.indexedActions.find(r);if(0===n.length)this.compileError(new Error(`Missing dependency detected: Action "${d.targetAsReadableString(e.target)}" depends on "${y.stringifyResolvable(r)}" which does not exist`),e.fileName,e.target);else if(1===n.length){const r=n[0].proto;r instanceof b.dataform.Table&&r.enumType===b.dataform.TableType.INLINE?r.dependencyTargets.forEach(t=>e.dependencyTargets.push(t)):t[d.targetAsReadableString(r.target)]=r.target}else this.compileError(new Error(y.ambiguousActionNameMsg(r,n)),e.fileName,e.target)}e.dependencyTargets=Object.values(t)})}alterActionName(e,t){const{tablePrefix:r,schemaSuffix:n,databaseSuffix:i}=this.config;if(!r&&!n&&!i)return;const o=new s.StringifiedMap(d.targetStringifier);t.forEach(e=>o.set(e,e)),e.forEach(e=>{o.set(e.target,Object.assign(Object.assign({},e.target),{database:e.target.database&&this.adapter().normalizeIdentifier(`${e.target.database}${this.getDatabaseSuffixWithUnderscore()}`),schema:this.adapter().normalizeIdentifier(`${e.target.schema}${this.getSchemaSuffixWithUnderscore()}`),name:this.adapter().normalizeIdentifier(`${this.getTablePrefixWithUnderscore()}${e.target.name}`)})),e.target=o.get(e.target)});const a=e=>o.has(e)?o.get(e):e;e.forEach(e=>{e.dependencyTargets=(e.dependencyTargets||[]).map(a),e.parentAction&&(e.parentAction=a(e.parentAction))})}checkTableConfigValidity(e){e.forEach(e=>{var t,r;if(e.enumType===b.dataform.TableType.UNKNOWN_TYPE&&this.compileError("Wrong type of table detected. Should only use predefined types: "+w(f.TableType),e.fileName,e.target),e.materialized&&(e.enumType!==b.dataform.TableType.VIEW||"snowflake"!==this.config.warehouse&&"bigquery"!==this.config.warehouse)&&this.compileError(new Error("The 'materialized' option is only valid for Snowflake and BigQuery views"),e.fileName,e.target),e.snowflake&&(e.snowflake.secure&&e.enumType!==b.dataform.TableType.VIEW&&this.compileError(new Error("The 'secure' option is only valid for Snowflake views"),e.fileName,e.target),e.snowflake.transient&&e.enumType!==b.dataform.TableType.TABLE&&this.compileError(new Error("The 'transient' option is only valid for Snowflake tables"),e.fileName,e.target),(null===(t=e.snowflake.clusterBy)||void 0===t?void 0:t.length)>0&&e.enumType!==b.dataform.TableType.TABLE&&e.enumType!==b.dataform.TableType.INCREMENTAL&&this.compileError(new Error("The 'clusterBy' option is only valid for Snowflake tables"),e.fileName,e.target)),e.sqlDataWarehouse&&(e.uniqueKey&&e.uniqueKey.length>0&&this.compileError(new Error("Merging using unique keys for SQLDataWarehouse has not yet been implemented"),e.fileName,e.target),e.sqlDataWarehouse.distribution)){const t=e.sqlDataWarehouse.distribution.toUpperCase();"REPLICATE"===t||"ROUND_ROBIN"===t||O.test(t)||this.compileError(new Error("Invalid value for sqldatawarehouse distribution: "+t),e.fileName,e.target)}if(e.redshift){const t=(t,r)=>{const n=t[r];t.hasOwnProperty(r)?n instanceof Array&&0===n.length&&this.compileError(`Property "${r}" is not defined`,e.fileName,e.target):this.compileError(`Property "${r}" is not defined`,e.fileName,e.target)},r=(e,r)=>r.forEach(r=>t(e,r)),n=(t,r,n)=>{t[r]&&!n.includes(t[r])&&this.compileError(`Wrong value of "${r}" property. Should only use predefined values: ${w(n)}`,e.fileName,e.target)};(e.redshift.distStyle||e.redshift.distKey)&&(r(e.redshift,["distStyle","distKey"]),n(e.redshift,"distStyle",f.DistStyleType)),(e.redshift.sortStyle||e.redshift.sortKeys&&e.redshift.sortKeys.length)&&(r(e.redshift,["sortStyle","sortKeys"]),n(e.redshift,"sortStyle",f.SortStyleType))}e.bigquery&&((e.bigquery.partitionBy||(null===(r=e.bigquery.clusterBy)||void 0===r?void 0:r.length)||e.bigquery.partitionExpirationDays||e.bigquery.requirePartitionFilter)&&e.enumType===b.dataform.TableType.VIEW?this.compileError("partitionBy/clusterBy/requirePartitionFilter/partitionExpirationDays are not valid for BigQuery views; they are only valid for tables",e.fileName,e.target):e.bigquery.partitionBy||!e.bigquery.partitionExpirationDays&&!e.bigquery.requirePartitionFilter||e.enumType!==b.dataform.TableType.TABLE?e.bigquery.additionalOptions&&(e.bigquery.partitionExpirationDays&&e.bigquery.additionalOptions.partition_expiration_days&&this.compileError("partitionExpirationDays has been declared twice",e.fileName,e.target),e.bigquery.requirePartitionFilter&&e.bigquery.additionalOptions.require_partition_filter&&this.compileError("requirePartitionFilter has been declared twice",e.fileName,e.target)):this.compileError("requirePartitionFilter/partitionExpirationDays are not valid for non partitioned BigQuery tables",e.fileName,e.target)),e.enumType===b.dataform.TableType.INLINE&&f.Table.INLINE_IGNORED_PROPS.forEach(t=>{(function(e){if(!e)return!1;return Array.isArray(e)&&!!e.length||!Array.isArray(e)&&"object"==typeof e&&!!Object.keys(e).length||"object"!=typeof e})(e[t])&&this.compileError(`Unused property was detected: "${t}". This property is not used for tables with type "inline" and will be ignored`,e.fileName,e.target)})})}checkTestNameUniqueness(e){const t=[];e.forEach(e=>{t.includes(e.name)&&this.compileError(new Error(`Duplicate test name detected: "${e.name}"`),e.fileName),t.push(e.name)})}checkCircularity(e){const t=new Map(e.map(e=>[d.targetStringifier.stringify(e.target),e])),r=new o.default;e.forEach(e=>{const n=(e.dependencyTargets||[]).filter(e=>!!t.get(d.targetStringifier.stringify(e)));r.add(d.targetStringifier.stringify(e.target),n.map(e=>d.targetStringifier.stringify(e)))});r.getCycles().forEach(e=>{const r=t.get(e[0].name),n=`Circular dependency detected in chain: [${e.map(e=>e.name).join(" > ")} > ${d.targetAsReadableString(r.target)}]`;this.compileError(new Error(n),r.fileName,r.target)})}checkRunCachingCorrectness(e){e.forEach(e=>{var t;(null===(t=e.dependencyTargets)||void 0===t?void 0:t.length)>0||[b.dataform.ActionHermeticity.HERMETIC,b.dataform.ActionHermeticity.NON_HERMETIC].includes(e.hermeticity)||this.compileError(new Error("Zero-dependency actions which create datasets are required to explicitly declare 'hermetic: (true|false)' when run caching is turned on."),e.fileName,e.target)})}removeNonUniqueActionsFromCompiledGraph(e){function t(e){const t=new s.StringifiedSet(d.targetStringifier),r=new s.StringifiedSet(d.targetStringifier);return e.forEach(e=>{t.has(e)&&r.add(e),t.add(e)}),r}const r=[].concat(e.tables,e.assertions,e.operations,e.declarations),n=t(r.map(e=>e.target)),i=t(r.map(e=>e.canonicalTarget)),o=e=>{const t=n.has(e.target),r=i.has(e.canonicalTarget);return t&&this.compileError(new Error("Duplicate action name detected. Names within a schema must be unique across tables, declarations, assertions, and operations"),e.fileName,e.target),r&&this.compileError(new Error(`Duplicate canonical target detected. Canonical targets must be unique across tables, declarations, assertions, and operations:\n"${JSON.stringify(e.canonicalTarget)}"`),e.fileName,e.target),!t&&!r};e.tables=e.tables.filter(o),e.operations=e.operations.filter(o),e.declarations=e.declarations.filter(o),e.assertions=e.assertions.filter(o)}};class E{constructor(e,t){this.adapter=e,this.byName=new Map,this.bySchemaAndName=new Map,this.byDatabaseAndName=new Map,this.byDatabaseSchemaAndName=new Map;for(const e of t){this.byName.has(e.proto.target.name)||this.byName.set(e.proto.target.name,[]),this.byName.get(e.proto.target.name).push(e),this.bySchemaAndName.has(e.proto.target.schema)||this.bySchemaAndName.set(e.proto.target.schema,new Map);const t=this.bySchemaAndName.get(e.proto.target.schema);if(t.has(e.proto.target.name)||t.set(e.proto.target.name,[]),t.get(e.proto.target.name).push(e),e.proto.target.database){this.byDatabaseAndName.has(e.proto.target.database)||this.byDatabaseAndName.set(e.proto.target.database,new Map);const t=this.byDatabaseAndName.get(e.proto.target.database);t.has(e.proto.target.name)||t.set(e.proto.target.name,[]),t.get(e.proto.target.name).push(e),this.byDatabaseSchemaAndName.has(e.proto.target.database)||this.byDatabaseSchemaAndName.set(e.proto.target.database,new Map);const r=this.byDatabaseSchemaAndName.get(e.proto.target.database);r.has(e.proto.target.schema)||r.set(e.proto.target.schema,new Map);const n=r.get(e.proto.target.schema);n.has(e.proto.target.name)||n.set(e.proto.target.name,[]),n.get(e.proto.target.name).push(e)}}}find(e){return e.database?e.schema?this.byDatabaseSchemaAndName.get(this.adapter.normalizeIdentifier(e.database)).get(this.adapter.normalizeIdentifier(e.schema)).get(this.adapter.normalizeIdentifier(e.name))||[]:this.byDatabaseAndName.get(this.adapter.normalizeIdentifier(e.database)).get(this.adapter.normalizeIdentifier(e.name))||[]:e.schema?this.bySchemaAndName.get(this.adapter.normalizeIdentifier(e.schema)).get(this.adapter.normalizeIdentifier(e.name))||[]:this.byName.get(this.adapter.normalizeIdentifier(e.name))||[]}}}).call(this,"/index.js")},function(e,t){class r{constructor(e,t){this.name=e,this.successors=t,this.reset()}reset(){this.index=-1,this.lowLink=-1,this.onStack=!1,this.visited=!1}}class n{constructor(){this.vertices={}}add(e,t){const n=(t=Array.isArray(t)?t:[t]).map(e=>(this.vertices[e]||(this.vertices[e]=new r(e,[])),this.vertices[e]));return this.vertices[e]||(this.vertices[e]=new r(e)),this.vertices[e].successors=n.concat([]).reverse(),this}reset(){Object.keys(this.vertices).forEach(e=>{this.vertices[e].reset()})}addAndVerify(e,t){this.add(e,t);const r=this.getCycles();if(r.length){let e=`Detected ${r.length} cycle${1===r.length?"":"s"}:`;e+="\n"+r.map(e=>{const t=e.map(e=>e.name);return` ${t.join(" -> ")} -> ${t[0]}`}).join("\n");const t=new Error(e);throw t.cycles=r,t}return this}dfs(e,t){this.reset();const r=[this.vertices[e]];let n;for(;n=r.pop();)n.visited||(t(n),n.visited=!0,n.successors.forEach(e=>r.push(e)))}getDescendants(e){const t=[];let r=!0;return this.dfs(e,e=>{r?r=!1:t.push(e.name)}),t}hasCycle(){return this.getCycles().length>0}getStronglyConnectedComponents(){const e=Object.keys(this.vertices).map(e=>(this.vertices[e].reset(),this.vertices[e]));let t=0;const r=[],n=[],i=e=>{if(e.index=t,e.lowLink=t,t++,r.push(e),e.onStack=!0,e.successors.forEach(t=>{t.index<0?(i(t),e.lowLink=Math.min(e.lowLink,t.lowLink)):t.onStack&&(e.lowLink=Math.min(e.lowLink,t.index))}),e.lowLink===e.index){const t=[];let i;do{i=r.pop(),i.onStack=!1,t.push(i)}while(i!==e);n.push(t)}};return e.forEach((function(e){e.index<0&&i(e)})),n}getCycles(){return this.getStronglyConnectedComponents().filter(e=>{if(e.length>1)return!0;const t=e[0];return t&&t.successors.some(e=>e===t)})}clone(){const e=new n;return Object.keys(this.vertices).forEach(t=>{const r=this.vertices[t];e.add(r.name,r.successors.map(e=>e.name))}),e}toDot(){const e=this.vertices,t=["digraph {"];return this.getCycles().forEach((e,r)=>{t.push(" subgraph cluster"+r+" {"),t.push(" color=red;"),t.push(" "+e.map(e=>e.name).join("; ")+";"),t.push(" }")}),Object.keys(e).forEach(r=>{const n=e[r];n.successors.length&&n.successors.forEach(e=>{t.push(` ${n.name} -> ${e.name}`)})}),t.push("}"),t.join("\n")+"\n"}}e.exports=n},function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=c(e,(0|e)<0?-1:0,!0),i&&(a[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function l(e,t){if(isNaN(e))return t?b:g;if(t){if(e<0)return b;if(e>=h)return E}else{if(e<=-y)return S;if(e+1>=y)return w}return e<0?l(-e,t).neg():c(e%d|0,e/d|0,t)}function c(e,t,r){return new n(e,t,r)}n.fromInt=s,n.fromNumber=l,n.fromBits=c;var u=Math.pow;function p(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return p(e.substring(1),t,r).neg();for(var i=l(u(r,8)),o=g,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+s),r);if(s<8){var f=l(u(r,s));o=o.mul(f).add(l(c))}else o=(o=o.mul(i)).add(l(c))}return o.unsigned=t,o}function f(e,t){return"number"==typeof e?l(e,t):"string"==typeof e?p(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=p,n.fromValue=f;var d=4294967296,h=d*d,y=h/2,m=s(1<<24),g=s(0);n.ZERO=g;var b=s(0,!0);n.UZERO=b;var O=s(1);n.ONE=O;var v=s(1,!0);n.UONE=v;var T=s(-1);n.NEG_ONE=T;var w=c(-1,2147483647,!1);n.MAX_VALUE=w;var E=c(-1,-1,!0);n.MAX_UNSIGNED_VALUE=E;var S=c(0,-2147483648,!1);n.MIN_VALUE=S;var j=n.prototype;j.toInt=function(){return this.unsigned?this.low>>>0:this.low},j.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},j.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=l(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=l(u(e,6),this.unsigned),o=this,a="";;){var s=o.div(i),c=(o.sub(s.mul(i)).toInt()>>>0).toString(e);if((o=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},j.getHighBits=function(){return this.high},j.getHighBitsUnsigned=function(){return this.high>>>0},j.getLowBits=function(){return this.low},j.getLowBitsUnsigned=function(){return this.low>>>0},j.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},j.isZero=function(){return 0===this.high&&0===this.low},j.eqz=j.isZero,j.isNegative=function(){return!this.unsigned&&this.high<0},j.isPositive=function(){return this.unsigned||this.high>=0},j.isOdd=function(){return 1==(1&this.low)},j.isEven=function(){return 0==(1&this.low)},j.equals=function(e){return i(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},j.eq=j.equals,j.notEquals=function(e){return!this.eq(e)},j.neq=j.notEquals,j.ne=j.notEquals,j.lessThan=function(e){return this.comp(e)<0},j.lt=j.lessThan,j.lessThanOrEqual=function(e){return this.comp(e)<=0},j.lte=j.lessThanOrEqual,j.le=j.lessThanOrEqual,j.greaterThan=function(e){return this.comp(e)>0},j.gt=j.greaterThan,j.greaterThanOrEqual=function(e){return this.comp(e)>=0},j.gte=j.greaterThanOrEqual,j.ge=j.greaterThanOrEqual,j.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},j.comp=j.compare,j.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(O)},j.neg=j.negate,j.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,l=e.low>>>16,u=0,p=0,d=0,h=0;return d+=(h+=o+(65535&e.low))>>>16,p+=(d+=n+l)>>>16,u+=(p+=r+s)>>>16,u+=t+a,c((d&=65535)<<16|(h&=65535),(u&=65535)<<16|(p&=65535),this.unsigned)},j.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},j.sub=j.subtract,j.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=f(e)),r)return c(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(S))return e.isOdd()?S:g;if(e.eq(S))return this.isOdd()?S:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return l(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,p=e.low>>>16,d=65535&e.low,h=0,y=0,b=0,O=0;return b+=(O+=a*d)>>>16,y+=(b+=o*d)>>>16,b&=65535,y+=(b+=a*p)>>>16,h+=(y+=n*d)>>>16,y&=65535,h+=(y+=o*p)>>>16,y&=65535,h+=(y+=a*u)>>>16,h+=t*d+n*p+o*u+a*s,c((b&=65535)<<16|(O&=65535),(h&=65535)<<16|(y&=65535),this.unsigned)},j.mul=j.multiply,j.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return v;o=b}else{if(this.eq(S))return e.eq(O)||e.eq(T)?S:e.eq(S)?O:(t=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?O:T:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(S))return this.unsigned?b:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=g}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(t)/Math.LN2),s=a<=48?1:u(2,a-48),p=l(t),d=p.mul(e);d.isNegative()||d.gt(n);)d=(p=l(t-=s,this.unsigned)).mul(e);p.isZero()&&(p=O),o=o.add(p),n=n.sub(d)}return o},j.div=j.divide,j.modulo=function(e){return i(e)||(e=f(e)),r?c((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},j.mod=j.modulo,j.rem=j.modulo,j.not=function(){return c(~this.low,~this.high,this.unsigned)},j.and=function(e){return i(e)||(e=f(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},j.or=function(e){return i(e)||(e=f(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},j.xor=function(e){return i(e)||(e=f(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},j.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},j.shl=j.shiftLeft,j.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},j.shr=j.shiftRight,j.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},j.shru=j.shiftRightUnsigned,j.shr_u=j.shiftRightUnsigned,j.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},j.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},j.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},j.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},j.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(30),i=r(3),o=r(0);t.IDeclarationConfigProperties=i.strictKeysOf()(["columns","database","description","name","schema","type"]);t.Declaration=class{constructor(){this.proto=o.dataform.Declaration.create()}config(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,t.IDeclarationConfigProperties,"declaration config"),e.description&&this.description(e.description),e.columns&&this.columns(e.columns),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=n.ColumnDescriptors.mapToColumnProtoArray(e,e=>this.session.compileError(e)),this}compile(){return this.proto}}},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(39),o=n(r(31)),a=r(59),s=r(3),l=r(0),c=s.strictKeysOf()(["type","dataset","name"]);t.Test=class{constructor(){this.proto=l.dataform.Test.create(),this.contextableInputs=new i.StringifiedMap(a.targetStringifier)}config(e){return s.checkExcessProperties(e=>this.session.compileError(e),e,c,"test config"),e.dataset&&this.dataset(e.dataset),this}dataset(e){return this.datasetToTest=e,this}input(e,t){return this.contextableInputs.set(s.resolvableAsTarget(s.toResolvable(e)),t),this}expect(e){return this.contextableQuery=e,this}compile(){const e=new u(this);if(this.datasetToTest){const t=this.session.indexedActions.find(s.resolvableAsTarget(this.datasetToTest));t.length>1&&this.session.compileError(new Error(s.ambiguousActionNameMsg(this.datasetToTest,t)),this.proto.fileName);const r=t.length>0?t[0]:void 0;if(r&&r instanceof o.Table)if(r.proto.enumType===l.dataform.TableType.INCREMENTAL)this.session.compileError(new Error("Running tests on incremental datasets is not yet supported."),this.proto.fileName);else{const t=new p(e);this.proto.testQuery=t.apply(r.contextableQuery)}else this.session.compileError(new Error(`Dataset ${s.stringifyResolvable(this.datasetToTest)} could not be found.`),this.proto.fileName)}else this.session.compileError(new Error("Tests must operate upon a specified dataset."),this.proto.fileName);return this.proto.expectedOutputQuery=e.apply(this.contextableQuery),this.proto}};class u{constructor(e){this.test=e}apply(e){return"function"==typeof e?e(this):e}}t.TestContext=u;class p{constructor(e){this.testContext=e}ref(e,...t){return this.resolve(e,...t)}resolve(e,...t){const r=s.resolvableAsTarget(s.toResolvable(e,t));return this.testContext.test.contextableInputs.has(r)?`(${this.testContext.apply(this.testContext.test.contextableInputs.get(r))})`:(this.testContext.test.session.compileError(new Error(`Input for dataset "${JSON.stringify(r)}" has not been provided. Provided inputs: ${Array.from(this.testContext.test.contextableInputs.keys()).map(e=>JSON.stringify(e))}`)),"")}apply(e){return"function"==typeof e?e(this):e}config(e){return""}self(){return""}name(){return""}type(e){return""}schema(){return""}database(){return""}where(e){return""}when(e,t,r=""){return e?t:r}incremental(){return!1}preOps(e){return""}postOps(e){return""}disabled(){return""}redshift(e){return""}bigquery(e){return""}dependencies(e){return""}tags(e){return""}}}]);
1
+ module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=61)}([function(e,t,r){var n,i,o;i=[r(92)],void 0===(o="function"==typeof(n=function(e){"use strict";var t,r,n,i,o=e.Reader,a=e.Writer,s=e.util,l=e.roots.default||(e.roots.default={});return l.dataform=((i={}).ProjectConfig=function(){function t(e){if(this.vars={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.warehouse="",t.prototype.defaultDatabase="",t.prototype.defaultSchema="",t.prototype.defaultLocation="",t.prototype.assertionSchema="",t.prototype.vars=s.emptyObject,t.prototype.concurrentQueryLimit=0,t.prototype.idempotentActionRetries=0,t.prototype.databaseSuffix="",t.prototype.schemaSuffix="",t.prototype.tablePrefix="",t.prototype.gcloudProjectId="",t.prototype.useRunCache=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(10).string(e.warehouse),null!=e.defaultSchema&&Object.hasOwnProperty.call(e,"defaultSchema")&&t.uint32(18).string(e.defaultSchema),null!=e.assertionSchema&&Object.hasOwnProperty.call(e,"assertionSchema")&&t.uint32(42).string(e.assertionSchema),null!=e.gcloudProjectId&&Object.hasOwnProperty.call(e,"gcloudProjectId")&&t.uint32(50).string(e.gcloudProjectId),null!=e.schemaSuffix&&Object.hasOwnProperty.call(e,"schemaSuffix")&&t.uint32(58).string(e.schemaSuffix),null!=e.idempotentActionRetries&&Object.hasOwnProperty.call(e,"idempotentActionRetries")&&t.uint32(64).int32(e.idempotentActionRetries),null!=e.defaultDatabase&&Object.hasOwnProperty.call(e,"defaultDatabase")&&t.uint32(74).string(e.defaultDatabase),null!=e.useRunCache&&Object.hasOwnProperty.call(e,"useRunCache")&&t.uint32(80).bool(e.useRunCache),null!=e.tablePrefix&&Object.hasOwnProperty.call(e,"tablePrefix")&&t.uint32(90).string(e.tablePrefix),null!=e.concurrentQueryLimit&&Object.hasOwnProperty.call(e,"concurrentQueryLimit")&&t.uint32(104).int32(e.concurrentQueryLimit),null!=e.vars&&Object.hasOwnProperty.call(e,"vars"))for(var r=Object.keys(e.vars),n=0;n<r.length;++n)t.uint32(114).fork().uint32(10).string(r[n]).uint32(18).string(e.vars[r[n]]).ldelim();return null!=e.databaseSuffix&&Object.hasOwnProperty.call(e,"databaseSuffix")&&t.uint32(122).string(e.databaseSuffix),null!=e.defaultLocation&&Object.hasOwnProperty.call(e,"defaultLocation")&&t.uint32(130).string(e.defaultLocation),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.ProjectConfig;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.warehouse=e.string();break;case 9:a.defaultDatabase=e.string();break;case 2:a.defaultSchema=e.string();break;case 16:a.defaultLocation=e.string();break;case 5:a.assertionSchema=e.string();break;case 14:a.vars===s.emptyObject&&(a.vars={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.vars[r]=n;break;case 13:a.concurrentQueryLimit=e.int32();break;case 8:a.idempotentActionRetries=e.int32();break;case 15:a.databaseSuffix=e.string();break;case 7:a.schemaSuffix=e.string();break;case 11:a.tablePrefix=e.string();break;case 6:a.gcloudProjectId=e.string();break;case 10:a.useRunCache=e.bool();break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!s.isString(e.warehouse))return"warehouse: string expected";if(null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&!s.isString(e.defaultDatabase))return"defaultDatabase: string expected";if(null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&!s.isString(e.defaultSchema))return"defaultSchema: string expected";if(null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&!s.isString(e.defaultLocation))return"defaultLocation: string expected";if(null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&!s.isString(e.assertionSchema))return"assertionSchema: string expected";if(null!=e.vars&&e.hasOwnProperty("vars")){if(!s.isObject(e.vars))return"vars: object expected";for(var t=Object.keys(e.vars),r=0;r<t.length;++r)if(!s.isString(e.vars[t[r]]))return"vars: string{k:string} expected"}return null!=e.concurrentQueryLimit&&e.hasOwnProperty("concurrentQueryLimit")&&!s.isInteger(e.concurrentQueryLimit)?"concurrentQueryLimit: integer expected":null!=e.idempotentActionRetries&&e.hasOwnProperty("idempotentActionRetries")&&!s.isInteger(e.idempotentActionRetries)?"idempotentActionRetries: integer expected":null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&!s.isString(e.databaseSuffix)?"databaseSuffix: string expected":null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&!s.isString(e.schemaSuffix)?"schemaSuffix: string expected":null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&!s.isString(e.tablePrefix)?"tablePrefix: string expected":null!=e.gcloudProjectId&&e.hasOwnProperty("gcloudProjectId")&&!s.isString(e.gcloudProjectId)?"gcloudProjectId: string expected":null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&"boolean"!=typeof e.useRunCache?"useRunCache: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.ProjectConfig)return e;var t=new l.dataform.ProjectConfig;if(null!=e.warehouse&&(t.warehouse=String(e.warehouse)),null!=e.defaultDatabase&&(t.defaultDatabase=String(e.defaultDatabase)),null!=e.defaultSchema&&(t.defaultSchema=String(e.defaultSchema)),null!=e.defaultLocation&&(t.defaultLocation=String(e.defaultLocation)),null!=e.assertionSchema&&(t.assertionSchema=String(e.assertionSchema)),e.vars){if("object"!=typeof e.vars)throw TypeError(".dataform.ProjectConfig.vars: object expected");t.vars={};for(var r=Object.keys(e.vars),n=0;n<r.length;++n)t.vars[r[n]]=String(e.vars[r[n]])}return null!=e.concurrentQueryLimit&&(t.concurrentQueryLimit=0|e.concurrentQueryLimit),null!=e.idempotentActionRetries&&(t.idempotentActionRetries=0|e.idempotentActionRetries),null!=e.databaseSuffix&&(t.databaseSuffix=String(e.databaseSuffix)),null!=e.schemaSuffix&&(t.schemaSuffix=String(e.schemaSuffix)),null!=e.tablePrefix&&(t.tablePrefix=String(e.tablePrefix)),null!=e.gcloudProjectId&&(t.gcloudProjectId=String(e.gcloudProjectId)),null!=e.useRunCache&&(t.useRunCache=Boolean(e.useRunCache)),t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.objects||t.defaults)&&(n.vars={}),t.defaults&&(n.warehouse="",n.defaultSchema="",n.assertionSchema="",n.gcloudProjectId="",n.schemaSuffix="",n.idempotentActionRetries=0,n.defaultDatabase="",n.useRunCache=!1,n.tablePrefix="",n.concurrentQueryLimit=0,n.databaseSuffix="",n.defaultLocation=""),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(n.warehouse=e.warehouse),null!=e.defaultSchema&&e.hasOwnProperty("defaultSchema")&&(n.defaultSchema=e.defaultSchema),null!=e.assertionSchema&&e.hasOwnProperty("assertionSchema")&&(n.assertionSchema=e.assertionSchema),null!=e.gcloudProjectId&&e.hasOwnProperty("gcloudProjectId")&&(n.gcloudProjectId=e.gcloudProjectId),null!=e.schemaSuffix&&e.hasOwnProperty("schemaSuffix")&&(n.schemaSuffix=e.schemaSuffix),null!=e.idempotentActionRetries&&e.hasOwnProperty("idempotentActionRetries")&&(n.idempotentActionRetries=e.idempotentActionRetries),null!=e.defaultDatabase&&e.hasOwnProperty("defaultDatabase")&&(n.defaultDatabase=e.defaultDatabase),null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&(n.useRunCache=e.useRunCache),null!=e.tablePrefix&&e.hasOwnProperty("tablePrefix")&&(n.tablePrefix=e.tablePrefix),null!=e.concurrentQueryLimit&&e.hasOwnProperty("concurrentQueryLimit")&&(n.concurrentQueryLimit=e.concurrentQueryLimit),e.vars&&(r=Object.keys(e.vars)).length){n.vars={};for(var i=0;i<r.length;++i)n.vars[r[i]]=e.vars[r[i]]}return null!=e.databaseSuffix&&e.hasOwnProperty("databaseSuffix")&&(n.databaseSuffix=e.databaseSuffix),null!=e.defaultLocation&&e.hasOwnProperty("defaultLocation")&&(n.defaultLocation=e.defaultLocation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ProjectConfig"},t}(),i.GenerateIndexConfig=function(){function t(e){if(this.includePaths=[],this.definitionPaths=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compileConfig=null,t.prototype.includePaths=s.emptyArray,t.prototype.definitionPaths=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.compileConfig&&Object.hasOwnProperty.call(e,"compileConfig")&&l.dataform.CompileConfig.encode(e.compileConfig,t.uint32(10).fork()).ldelim(),null!=e.includePaths&&e.includePaths.length)for(var r=0;r<e.includePaths.length;++r)t.uint32(18).string(e.includePaths[r]);if(null!=e.definitionPaths&&e.definitionPaths.length)for(r=0;r<e.definitionPaths.length;++r)t.uint32(26).string(e.definitionPaths[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.GenerateIndexConfig;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compileConfig=l.dataform.CompileConfig.decode(e,e.uint32());break;case 2:n.includePaths&&n.includePaths.length||(n.includePaths=[]),n.includePaths.push(e.string());break;case 3:n.definitionPaths&&n.definitionPaths.length||(n.definitionPaths=[]),n.definitionPaths.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var t=l.dataform.CompileConfig.verify(e.compileConfig);if(t)return"compileConfig."+t}if(null!=e.includePaths&&e.hasOwnProperty("includePaths")){if(!Array.isArray(e.includePaths))return"includePaths: array expected";for(var r=0;r<e.includePaths.length;++r)if(!s.isString(e.includePaths[r]))return"includePaths: string[] expected"}if(null!=e.definitionPaths&&e.hasOwnProperty("definitionPaths")){if(!Array.isArray(e.definitionPaths))return"definitionPaths: array expected";for(r=0;r<e.definitionPaths.length;++r)if(!s.isString(e.definitionPaths[r]))return"definitionPaths: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.GenerateIndexConfig)return e;var t=new l.dataform.GenerateIndexConfig;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".dataform.GenerateIndexConfig.compileConfig: object expected");t.compileConfig=l.dataform.CompileConfig.fromObject(e.compileConfig)}if(e.includePaths){if(!Array.isArray(e.includePaths))throw TypeError(".dataform.GenerateIndexConfig.includePaths: array expected");t.includePaths=[];for(var r=0;r<e.includePaths.length;++r)t.includePaths[r]=String(e.includePaths[r])}if(e.definitionPaths){if(!Array.isArray(e.definitionPaths))throw TypeError(".dataform.GenerateIndexConfig.definitionPaths: array expected");for(t.definitionPaths=[],r=0;r<e.definitionPaths.length;++r)t.definitionPaths[r]=String(e.definitionPaths[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.includePaths=[],r.definitionPaths=[]),t.defaults&&(r.compileConfig=null),null!=e.compileConfig&&e.hasOwnProperty("compileConfig")&&(r.compileConfig=l.dataform.CompileConfig.toObject(e.compileConfig,t)),e.includePaths&&e.includePaths.length){r.includePaths=[];for(var n=0;n<e.includePaths.length;++n)r.includePaths[n]=e.includePaths[n]}if(e.definitionPaths&&e.definitionPaths.length)for(r.definitionPaths=[],n=0;n<e.definitionPaths.length;++n)r.definitionPaths[n]=e.definitionPaths[n];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.GenerateIndexConfig"},t}(),i.CompileConfig=function(){function t(e){if(this.filePaths=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectDir="",t.prototype.filePaths=s.emptyArray,t.prototype.projectConfigOverride=null,t.prototype.timeoutMillis=0,t.prototype.useMain=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.projectDir&&Object.hasOwnProperty.call(e,"projectDir")&&t.uint32(10).string(e.projectDir),null!=e.projectConfigOverride&&Object.hasOwnProperty.call(e,"projectConfigOverride")&&l.dataform.ProjectConfig.encode(e.projectConfigOverride,t.uint32(26).fork()).ldelim(),null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(48).int32(e.timeoutMillis),null!=e.filePaths&&e.filePaths.length)for(var r=0;r<e.filePaths.length;++r)t.uint32(66).string(e.filePaths[r]);return null!=e.useMain&&Object.hasOwnProperty.call(e,"useMain")&&t.uint32(72).bool(e.useMain),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompileConfig;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectDir=e.string();break;case 8:n.filePaths&&n.filePaths.length||(n.filePaths=[]),n.filePaths.push(e.string());break;case 3:n.projectConfigOverride=l.dataform.ProjectConfig.decode(e,e.uint32());break;case 6:n.timeoutMillis=e.int32();break;case 9:n.useMain=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectDir&&e.hasOwnProperty("projectDir")&&!s.isString(e.projectDir))return"projectDir: string expected";if(null!=e.filePaths&&e.hasOwnProperty("filePaths")){if(!Array.isArray(e.filePaths))return"filePaths: array expected";for(var t=0;t<e.filePaths.length;++t)if(!s.isString(e.filePaths[t]))return"filePaths: string[] expected"}if(null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")){var r=l.dataform.ProjectConfig.verify(e.projectConfigOverride);if(r)return"projectConfigOverride."+r}return null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!s.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.useMain&&e.hasOwnProperty("useMain")&&"boolean"!=typeof e.useMain?"useMain: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.CompileConfig)return e;var t=new l.dataform.CompileConfig;if(null!=e.projectDir&&(t.projectDir=String(e.projectDir)),e.filePaths){if(!Array.isArray(e.filePaths))throw TypeError(".dataform.CompileConfig.filePaths: array expected");t.filePaths=[];for(var r=0;r<e.filePaths.length;++r)t.filePaths[r]=String(e.filePaths[r])}if(null!=e.projectConfigOverride){if("object"!=typeof e.projectConfigOverride)throw TypeError(".dataform.CompileConfig.projectConfigOverride: object expected");t.projectConfigOverride=l.dataform.ProjectConfig.fromObject(e.projectConfigOverride)}return null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.useMain&&(t.useMain=Boolean(e.useMain)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.filePaths=[]),t.defaults&&(r.projectDir="",r.projectConfigOverride=null,r.timeoutMillis=0,r.useMain=!1),null!=e.projectDir&&e.hasOwnProperty("projectDir")&&(r.projectDir=e.projectDir),null!=e.projectConfigOverride&&e.hasOwnProperty("projectConfigOverride")&&(r.projectConfigOverride=l.dataform.ProjectConfig.toObject(e.projectConfigOverride,t)),null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(r.timeoutMillis=e.timeoutMillis),e.filePaths&&e.filePaths.length){r.filePaths=[];for(var n=0;n<e.filePaths.length;++n)r.filePaths[n]=e.filePaths[n]}return null!=e.useMain&&e.hasOwnProperty("useMain")&&(r.useMain=e.useMain),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompileConfig"},t}(),i.Target=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.database="",t.prototype.schema="",t.prototype.name="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(10).string(e.schema),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(18).string(e.name),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(26).string(e.database),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Target;e.pos<r;){var i=e.uint32();switch(i>>>3){case 3:n.database=e.string();break;case 1:n.schema=e.string();break;case 2:n.name=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.database&&e.hasOwnProperty("database")&&!s.isString(e.database)?"database: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!s.isString(e.schema)?"schema: string expected":null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name)?"name: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Target)return e;var t=new l.dataform.Target;return null!=e.database&&(t.database=String(e.database)),null!=e.schema&&(t.schema=String(e.schema)),null!=e.name&&(t.name=String(e.name)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.schema="",r.name="",r.database=""),null!=e.schema&&e.hasOwnProperty("schema")&&(r.schema=e.schema),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.database&&e.hasOwnProperty("database")&&(r.database=e.database),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Target"},t}(),i.BigQueryOptions=function(){function t(e){if(this.clusterBy=[],this.labels={},this.additionalOptions={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.partitionBy="",t.prototype.clusterBy=s.emptyArray,t.prototype.updatePartitionFilter="",t.prototype.labels=s.emptyObject,t.prototype.partitionExpirationDays=0,t.prototype.requirePartitionFilter=!1,t.prototype.additionalOptions=s.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.partitionBy&&Object.hasOwnProperty.call(e,"partitionBy")&&t.uint32(10).string(e.partitionBy),null!=e.clusterBy&&e.clusterBy.length)for(var r=0;r<e.clusterBy.length;++r)t.uint32(18).string(e.clusterBy[r]);if(null!=e.updatePartitionFilter&&Object.hasOwnProperty.call(e,"updatePartitionFilter")&&t.uint32(26).string(e.updatePartitionFilter),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.uint32(34).fork().uint32(10).string(n[r]).uint32(18).string(e.labels[n[r]]).ldelim()}if(null!=e.partitionExpirationDays&&Object.hasOwnProperty.call(e,"partitionExpirationDays")&&t.uint32(40).int32(e.partitionExpirationDays),null!=e.requirePartitionFilter&&Object.hasOwnProperty.call(e,"requirePartitionFilter")&&t.uint32(48).bool(e.requirePartitionFilter),null!=e.additionalOptions&&Object.hasOwnProperty.call(e,"additionalOptions"))for(n=Object.keys(e.additionalOptions),r=0;r<n.length;++r)t.uint32(58).fork().uint32(10).string(n[r]).uint32(18).string(e.additionalOptions[n[r]]).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.BigQueryOptions;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.partitionBy=e.string();break;case 2:a.clusterBy&&a.clusterBy.length||(a.clusterBy=[]),a.clusterBy.push(e.string());break;case 3:a.updatePartitionFilter=e.string();break;case 4:a.labels===s.emptyObject&&(a.labels={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;)switch((p=e.uint32())>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}a.labels[r]=n;break;case 5:a.partitionExpirationDays=e.int32();break;case 6:a.requirePartitionFilter=e.bool();break;case 7:for(a.additionalOptions===s.emptyObject&&(a.additionalOptions={}),u=e.uint32()+e.pos,r="",n="";e.pos<u;){var p;switch((p=e.uint32())>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.additionalOptions[r]=n;break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&!s.isString(e.partitionBy))return"partitionBy: string expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(var t=0;t<e.clusterBy.length;++t)if(!s.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&!s.isString(e.updatePartitionFilter))return"updatePartitionFilter: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!s.isObject(e.labels))return"labels: object expected";var r=Object.keys(e.labels);for(t=0;t<r.length;++t)if(!s.isString(e.labels[r[t]]))return"labels: string{k:string} expected"}if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&!s.isInteger(e.partitionExpirationDays))return"partitionExpirationDays: integer expected";if(null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&"boolean"!=typeof e.requirePartitionFilter)return"requirePartitionFilter: boolean expected";if(null!=e.additionalOptions&&e.hasOwnProperty("additionalOptions")){if(!s.isObject(e.additionalOptions))return"additionalOptions: object expected";for(r=Object.keys(e.additionalOptions),t=0;t<r.length;++t)if(!s.isString(e.additionalOptions[r[t]]))return"additionalOptions: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.BigQueryOptions)return e;var t=new l.dataform.BigQueryOptions;if(null!=e.partitionBy&&(t.partitionBy=String(e.partitionBy)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".dataform.BigQueryOptions.clusterBy: array expected");t.clusterBy=[];for(var r=0;r<e.clusterBy.length;++r)t.clusterBy[r]=String(e.clusterBy[r])}if(null!=e.updatePartitionFilter&&(t.updatePartitionFilter=String(e.updatePartitionFilter)),e.labels){if("object"!=typeof e.labels)throw TypeError(".dataform.BigQueryOptions.labels: object expected");t.labels={};var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.labels[n[r]]=String(e.labels[n[r]])}if(null!=e.partitionExpirationDays&&(t.partitionExpirationDays=0|e.partitionExpirationDays),null!=e.requirePartitionFilter&&(t.requirePartitionFilter=Boolean(e.requirePartitionFilter)),e.additionalOptions){if("object"!=typeof e.additionalOptions)throw TypeError(".dataform.BigQueryOptions.additionalOptions: object expected");for(t.additionalOptions={},n=Object.keys(e.additionalOptions),r=0;r<n.length;++r)t.additionalOptions[n[r]]=String(e.additionalOptions[n[r]])}return t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.arrays||t.defaults)&&(n.clusterBy=[]),(t.objects||t.defaults)&&(n.labels={},n.additionalOptions={}),t.defaults&&(n.partitionBy="",n.updatePartitionFilter="",n.partitionExpirationDays=0,n.requirePartitionFilter=!1),null!=e.partitionBy&&e.hasOwnProperty("partitionBy")&&(n.partitionBy=e.partitionBy),e.clusterBy&&e.clusterBy.length){n.clusterBy=[];for(var i=0;i<e.clusterBy.length;++i)n.clusterBy[i]=e.clusterBy[i]}if(null!=e.updatePartitionFilter&&e.hasOwnProperty("updatePartitionFilter")&&(n.updatePartitionFilter=e.updatePartitionFilter),e.labels&&(r=Object.keys(e.labels)).length)for(n.labels={},i=0;i<r.length;++i)n.labels[r[i]]=e.labels[r[i]];if(null!=e.partitionExpirationDays&&e.hasOwnProperty("partitionExpirationDays")&&(n.partitionExpirationDays=e.partitionExpirationDays),null!=e.requirePartitionFilter&&e.hasOwnProperty("requirePartitionFilter")&&(n.requirePartitionFilter=e.requirePartitionFilter),e.additionalOptions&&(r=Object.keys(e.additionalOptions)).length)for(n.additionalOptions={},i=0;i<r.length;++i)n.additionalOptions[r[i]]=e.additionalOptions[r[i]];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.BigQueryOptions"},t}(),i.RedshiftOptions=function(){function t(e){if(this.sortKeys=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.distKey="",t.prototype.distStyle="",t.prototype.sortKeys=s.emptyArray,t.prototype.sortStyle="",t.prototype.bind=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.distKey&&Object.hasOwnProperty.call(e,"distKey")&&t.uint32(10).string(e.distKey),null!=e.distStyle&&Object.hasOwnProperty.call(e,"distStyle")&&t.uint32(18).string(e.distStyle),null!=e.sortKeys&&e.sortKeys.length)for(var r=0;r<e.sortKeys.length;++r)t.uint32(26).string(e.sortKeys[r]);return null!=e.sortStyle&&Object.hasOwnProperty.call(e,"sortStyle")&&t.uint32(34).string(e.sortStyle),null!=e.bind&&Object.hasOwnProperty.call(e,"bind")&&t.uint32(40).bool(e.bind),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.RedshiftOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.distKey=e.string();break;case 2:n.distStyle=e.string();break;case 3:n.sortKeys&&n.sortKeys.length||(n.sortKeys=[]),n.sortKeys.push(e.string());break;case 4:n.sortStyle=e.string();break;case 5:n.bind=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.distKey&&e.hasOwnProperty("distKey")&&!s.isString(e.distKey))return"distKey: string expected";if(null!=e.distStyle&&e.hasOwnProperty("distStyle")&&!s.isString(e.distStyle))return"distStyle: string expected";if(null!=e.sortKeys&&e.hasOwnProperty("sortKeys")){if(!Array.isArray(e.sortKeys))return"sortKeys: array expected";for(var t=0;t<e.sortKeys.length;++t)if(!s.isString(e.sortKeys[t]))return"sortKeys: string[] expected"}return null!=e.sortStyle&&e.hasOwnProperty("sortStyle")&&!s.isString(e.sortStyle)?"sortStyle: string expected":null!=e.bind&&e.hasOwnProperty("bind")&&"boolean"!=typeof e.bind?"bind: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.RedshiftOptions)return e;var t=new l.dataform.RedshiftOptions;if(null!=e.distKey&&(t.distKey=String(e.distKey)),null!=e.distStyle&&(t.distStyle=String(e.distStyle)),e.sortKeys){if(!Array.isArray(e.sortKeys))throw TypeError(".dataform.RedshiftOptions.sortKeys: array expected");t.sortKeys=[];for(var r=0;r<e.sortKeys.length;++r)t.sortKeys[r]=String(e.sortKeys[r])}return null!=e.sortStyle&&(t.sortStyle=String(e.sortStyle)),null!=e.bind&&(t.bind=Boolean(e.bind)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.sortKeys=[]),t.defaults&&(r.distKey="",r.distStyle="",r.sortStyle="",r.bind=!1),null!=e.distKey&&e.hasOwnProperty("distKey")&&(r.distKey=e.distKey),null!=e.distStyle&&e.hasOwnProperty("distStyle")&&(r.distStyle=e.distStyle),e.sortKeys&&e.sortKeys.length){r.sortKeys=[];for(var n=0;n<e.sortKeys.length;++n)r.sortKeys[n]=e.sortKeys[n]}return null!=e.sortStyle&&e.hasOwnProperty("sortStyle")&&(r.sortStyle=e.sortStyle),null!=e.bind&&e.hasOwnProperty("bind")&&(r.bind=e.bind),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.RedshiftOptions"},t}(),i.SnowflakeOptions=function(){function t(e){if(this.clusterBy=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.secure=!1,t.prototype.transient=!1,t.prototype.clusterBy=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.secure&&Object.hasOwnProperty.call(e,"secure")&&t.uint32(8).bool(e.secure),null!=e.transient&&Object.hasOwnProperty.call(e,"transient")&&t.uint32(16).bool(e.transient),null!=e.clusterBy&&e.clusterBy.length)for(var r=0;r<e.clusterBy.length;++r)t.uint32(26).string(e.clusterBy[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.SnowflakeOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.secure=e.bool();break;case 2:n.transient=e.bool();break;case 3:n.clusterBy&&n.clusterBy.length||(n.clusterBy=[]),n.clusterBy.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.secure&&e.hasOwnProperty("secure")&&"boolean"!=typeof e.secure)return"secure: boolean expected";if(null!=e.transient&&e.hasOwnProperty("transient")&&"boolean"!=typeof e.transient)return"transient: boolean expected";if(null!=e.clusterBy&&e.hasOwnProperty("clusterBy")){if(!Array.isArray(e.clusterBy))return"clusterBy: array expected";for(var t=0;t<e.clusterBy.length;++t)if(!s.isString(e.clusterBy[t]))return"clusterBy: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.SnowflakeOptions)return e;var t=new l.dataform.SnowflakeOptions;if(null!=e.secure&&(t.secure=Boolean(e.secure)),null!=e.transient&&(t.transient=Boolean(e.transient)),e.clusterBy){if(!Array.isArray(e.clusterBy))throw TypeError(".dataform.SnowflakeOptions.clusterBy: array expected");t.clusterBy=[];for(var r=0;r<e.clusterBy.length;++r)t.clusterBy[r]=String(e.clusterBy[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.clusterBy=[]),t.defaults&&(r.secure=!1,r.transient=!1),null!=e.secure&&e.hasOwnProperty("secure")&&(r.secure=e.secure),null!=e.transient&&e.hasOwnProperty("transient")&&(r.transient=e.transient),e.clusterBy&&e.clusterBy.length){r.clusterBy=[];for(var n=0;n<e.clusterBy.length;++n)r.clusterBy[n]=e.clusterBy[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.SnowflakeOptions"},t}(),i.SQLDataWarehouseOptions=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.distribution="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.distribution&&Object.hasOwnProperty.call(e,"distribution")&&t.uint32(10).string(e.distribution),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.SQLDataWarehouseOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.distribution=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.distribution&&e.hasOwnProperty("distribution")&&!s.isString(e.distribution)?"distribution: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.SQLDataWarehouseOptions)return e;var t=new l.dataform.SQLDataWarehouseOptions;return null!=e.distribution&&(t.distribution=String(e.distribution)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.distribution=""),null!=e.distribution&&e.hasOwnProperty("distribution")&&(r.distribution=e.distribution),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.SQLDataWarehouseOptions"},t}(),i.PrestoOptions=function(){function t(e){if(this.partitionBy=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.partitionBy=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.partitionBy&&e.partitionBy.length)for(var r=0;r<e.partitionBy.length;++r)t.uint32(26).string(e.partitionBy[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.PrestoOptions;e.pos<r;){var i=e.uint32();switch(i>>>3){case 3:n.partitionBy&&n.partitionBy.length||(n.partitionBy=[]),n.partitionBy.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.partitionBy&&e.hasOwnProperty("partitionBy")){if(!Array.isArray(e.partitionBy))return"partitionBy: array expected";for(var t=0;t<e.partitionBy.length;++t)if(!s.isString(e.partitionBy[t]))return"partitionBy: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.PrestoOptions)return e;var t=new l.dataform.PrestoOptions;if(e.partitionBy){if(!Array.isArray(e.partitionBy))throw TypeError(".dataform.PrestoOptions.partitionBy: array expected");t.partitionBy=[];for(var r=0;r<e.partitionBy.length;++r)t.partitionBy[r]=String(e.partitionBy[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.partitionBy=[]),e.partitionBy&&e.partitionBy.length){r.partitionBy=[];for(var n=0;n<e.partitionBy.length;++n)r.partitionBy[n]=e.partitionBy[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.PrestoOptions"},t}(),i.GraphErrors=function(){function t(e){if(this.compilationErrors=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compilationErrors=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.compilationErrors&&e.compilationErrors.length)for(var r=0;r<e.compilationErrors.length;++r)l.dataform.CompilationError.encode(e.compilationErrors[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.GraphErrors;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compilationErrors&&n.compilationErrors.length||(n.compilationErrors=[]),n.compilationErrors.push(l.dataform.CompilationError.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compilationErrors&&e.hasOwnProperty("compilationErrors")){if(!Array.isArray(e.compilationErrors))return"compilationErrors: array expected";for(var t=0;t<e.compilationErrors.length;++t){var r=l.dataform.CompilationError.verify(e.compilationErrors[t]);if(r)return"compilationErrors."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.GraphErrors)return e;var t=new l.dataform.GraphErrors;if(e.compilationErrors){if(!Array.isArray(e.compilationErrors))throw TypeError(".dataform.GraphErrors.compilationErrors: array expected");t.compilationErrors=[];for(var r=0;r<e.compilationErrors.length;++r){if("object"!=typeof e.compilationErrors[r])throw TypeError(".dataform.GraphErrors.compilationErrors: object expected");t.compilationErrors[r]=l.dataform.CompilationError.fromObject(e.compilationErrors[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.compilationErrors=[]),e.compilationErrors&&e.compilationErrors.length){r.compilationErrors=[];for(var n=0;n<e.compilationErrors.length;++n)r.compilationErrors[n]=l.dataform.CompilationError.toObject(e.compilationErrors[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.GraphErrors"},t}(),i.CompilationError=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.fileName="",t.prototype.actionName="",t.prototype.actionTarget=null,t.prototype.message="",t.prototype.stack="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(10).string(e.fileName),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(18).string(e.message),null!=e.stack&&Object.hasOwnProperty.call(e,"stack")&&t.uint32(26).string(e.stack),null!=e.actionName&&Object.hasOwnProperty.call(e,"actionName")&&t.uint32(34).string(e.actionName),null!=e.actionTarget&&Object.hasOwnProperty.call(e,"actionTarget")&&l.dataform.Target.encode(e.actionTarget,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompilationError;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.fileName=e.string();break;case 4:n.actionName=e.string();break;case 5:n.actionTarget=l.dataform.Target.decode(e,e.uint32());break;case 2:n.message=e.string();break;case 3:n.stack=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName))return"fileName: string expected";if(null!=e.actionName&&e.hasOwnProperty("actionName")&&!s.isString(e.actionName))return"actionName: string expected";if(null!=e.actionTarget&&e.hasOwnProperty("actionTarget")){var t=l.dataform.Target.verify(e.actionTarget);if(t)return"actionTarget."+t}return null!=e.message&&e.hasOwnProperty("message")&&!s.isString(e.message)?"message: string expected":null!=e.stack&&e.hasOwnProperty("stack")&&!s.isString(e.stack)?"stack: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.CompilationError)return e;var t=new l.dataform.CompilationError;if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.actionName&&(t.actionName=String(e.actionName)),null!=e.actionTarget){if("object"!=typeof e.actionTarget)throw TypeError(".dataform.CompilationError.actionTarget: object expected");t.actionTarget=l.dataform.Target.fromObject(e.actionTarget)}return null!=e.message&&(t.message=String(e.message)),null!=e.stack&&(t.stack=String(e.stack)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.fileName="",r.message="",r.stack="",r.actionName="",r.actionTarget=null),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.message&&e.hasOwnProperty("message")&&(r.message=e.message),null!=e.stack&&e.hasOwnProperty("stack")&&(r.stack=e.stack),null!=e.actionName&&e.hasOwnProperty("actionName")&&(r.actionName=e.actionName),null!=e.actionTarget&&e.hasOwnProperty("actionTarget")&&(r.actionTarget=l.dataform.Target.toObject(e.actionTarget,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompilationError"},t}(),i.ActionDescriptor=function(){function t(e){if(this.columns=[],this.bigqueryLabels={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.description="",t.prototype.columns=s.emptyArray,t.prototype.bigqueryLabels=s.emptyObject,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.columns&&e.columns.length)for(var r=0;r<e.columns.length;++r)l.dataform.ColumnDescriptor.encode(e.columns[r],t.uint32(18).fork()).ldelim();if(null!=e.bigqueryLabels&&Object.hasOwnProperty.call(e,"bigqueryLabels")){var n=Object.keys(e.bigqueryLabels);for(r=0;r<n.length;++r)t.uint32(26).fork().uint32(10).string(n[r]).uint32(18).string(e.bigqueryLabels[n[r]]).ldelim()}return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.ActionDescriptor;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.description=e.string();break;case 2:a.columns&&a.columns.length||(a.columns=[]),a.columns.push(l.dataform.ColumnDescriptor.decode(e,e.uint32()));break;case 3:a.bigqueryLabels===s.emptyObject&&(a.bigqueryLabels={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.bigqueryLabels[r]=n;break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description))return"description: string expected";if(null!=e.columns&&e.hasOwnProperty("columns")){if(!Array.isArray(e.columns))return"columns: array expected";for(var t=0;t<e.columns.length;++t){var r=l.dataform.ColumnDescriptor.verify(e.columns[t]);if(r)return"columns."+r}}if(null!=e.bigqueryLabels&&e.hasOwnProperty("bigqueryLabels")){if(!s.isObject(e.bigqueryLabels))return"bigqueryLabels: object expected";var n=Object.keys(e.bigqueryLabels);for(t=0;t<n.length;++t)if(!s.isString(e.bigqueryLabels[n[t]]))return"bigqueryLabels: string{k:string} expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.ActionDescriptor)return e;var t=new l.dataform.ActionDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.columns){if(!Array.isArray(e.columns))throw TypeError(".dataform.ActionDescriptor.columns: array expected");t.columns=[];for(var r=0;r<e.columns.length;++r){if("object"!=typeof e.columns[r])throw TypeError(".dataform.ActionDescriptor.columns: object expected");t.columns[r]=l.dataform.ColumnDescriptor.fromObject(e.columns[r])}}if(e.bigqueryLabels){if("object"!=typeof e.bigqueryLabels)throw TypeError(".dataform.ActionDescriptor.bigqueryLabels: object expected");t.bigqueryLabels={};var n=Object.keys(e.bigqueryLabels);for(r=0;r<n.length;++r)t.bigqueryLabels[n[r]]=String(e.bigqueryLabels[n[r]])}return t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.arrays||t.defaults)&&(n.columns=[]),(t.objects||t.defaults)&&(n.bigqueryLabels={}),t.defaults&&(n.description=""),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),e.columns&&e.columns.length){n.columns=[];for(var i=0;i<e.columns.length;++i)n.columns[i]=l.dataform.ColumnDescriptor.toObject(e.columns[i],t)}if(e.bigqueryLabels&&(r=Object.keys(e.bigqueryLabels)).length)for(n.bigqueryLabels={},i=0;i<r.length;++i)n.bigqueryLabels[r[i]]=e.bigqueryLabels[r[i]];return n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ActionDescriptor"},t}(),i.ColumnDescriptor=function(){function t(e){if(this.path=[],this.tags=[],this.bigqueryPolicyTags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r,n;return t.prototype.description="",t.prototype.path=s.emptyArray,t.prototype.displayName="",t.prototype.dimensionType=0,t.prototype.aggregation=0,t.prototype.expression="",t.prototype.tags=s.emptyArray,t.prototype.bigqueryPolicyTags=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(10).string(e.description),null!=e.path&&e.path.length)for(var r=0;r<e.path.length;++r)t.uint32(18).string(e.path[r]);if(null!=e.displayName&&Object.hasOwnProperty.call(e,"displayName")&&t.uint32(26).string(e.displayName),null!=e.dimensionType&&Object.hasOwnProperty.call(e,"dimensionType")&&t.uint32(32).int32(e.dimensionType),null!=e.aggregation&&Object.hasOwnProperty.call(e,"aggregation")&&t.uint32(40).int32(e.aggregation),null!=e.expression&&Object.hasOwnProperty.call(e,"expression")&&t.uint32(50).string(e.expression),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(58).string(e.tags[r]);if(null!=e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(r=0;r<e.bigqueryPolicyTags.length;++r)t.uint32(66).string(e.bigqueryPolicyTags[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ColumnDescriptor;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.description=e.string();break;case 2:n.path&&n.path.length||(n.path=[]),n.path.push(e.string());break;case 3:n.displayName=e.string();break;case 4:n.dimensionType=e.int32();break;case 5:n.aggregation=e.int32();break;case 6:n.expression=e.string();break;case 7:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 8:n.bigqueryPolicyTags&&n.bigqueryPolicyTags.length||(n.bigqueryPolicyTags=[]),n.bigqueryPolicyTags.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description))return"description: string expected";if(null!=e.path&&e.hasOwnProperty("path")){if(!Array.isArray(e.path))return"path: array expected";for(var t=0;t<e.path.length;++t)if(!s.isString(e.path[t]))return"path: string[] expected"}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&!s.isString(e.displayName))return"displayName: string expected";if(null!=e.dimensionType&&e.hasOwnProperty("dimensionType"))switch(e.dimensionType){default:return"dimensionType: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.aggregation&&e.hasOwnProperty("aggregation"))switch(e.aggregation){default:return"aggregation: enum value expected";case 0:case 1:case 2:case 3:}if(null!=e.expression&&e.hasOwnProperty("expression")&&!s.isString(e.expression))return"expression: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.bigqueryPolicyTags&&e.hasOwnProperty("bigqueryPolicyTags")){if(!Array.isArray(e.bigqueryPolicyTags))return"bigqueryPolicyTags: array expected";for(t=0;t<e.bigqueryPolicyTags.length;++t)if(!s.isString(e.bigqueryPolicyTags[t]))return"bigqueryPolicyTags: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.ColumnDescriptor)return e;var t=new l.dataform.ColumnDescriptor;if(null!=e.description&&(t.description=String(e.description)),e.path){if(!Array.isArray(e.path))throw TypeError(".dataform.ColumnDescriptor.path: array expected");t.path=[];for(var r=0;r<e.path.length;++r)t.path[r]=String(e.path[r])}switch(null!=e.displayName&&(t.displayName=String(e.displayName)),e.dimensionType){default:if("number"==typeof e.dimensionType){t.dimensionType=e.dimensionType;break}break;case"UNKNOWN_DIMENSION":case 0:t.dimensionType=0;break;case"CATEGORY":case 1:t.dimensionType=1;break;case"TIMESTAMP":case 2:t.dimensionType=2;break;case"NUMBER":case 3:t.dimensionType=3}switch(e.aggregation){default:if("number"==typeof e.aggregation){t.aggregation=e.aggregation;break}break;case"UNKNOWN_AGGREGATION":case 0:t.aggregation=0;break;case"SUM":case 1:t.aggregation=1;break;case"DISTINCT":case 2:t.aggregation=2;break;case"DERIVED":case 3:t.aggregation=3}if(null!=e.expression&&(t.expression=String(e.expression)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.ColumnDescriptor.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(e.bigqueryPolicyTags){if(!Array.isArray(e.bigqueryPolicyTags))throw TypeError(".dataform.ColumnDescriptor.bigqueryPolicyTags: array expected");for(t.bigqueryPolicyTags=[],r=0;r<e.bigqueryPolicyTags.length;++r)t.bigqueryPolicyTags[r]=String(e.bigqueryPolicyTags[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.path=[],r.tags=[],r.bigqueryPolicyTags=[]),t.defaults&&(r.description="",r.displayName="",r.dimensionType=t.enums===String?"UNKNOWN_DIMENSION":0,r.aggregation=t.enums===String?"UNKNOWN_AGGREGATION":0,r.expression=""),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.path&&e.path.length){r.path=[];for(var n=0;n<e.path.length;++n)r.path[n]=e.path[n]}if(null!=e.displayName&&e.hasOwnProperty("displayName")&&(r.displayName=e.displayName),null!=e.dimensionType&&e.hasOwnProperty("dimensionType")&&(r.dimensionType=t.enums===String?void 0===l.dataform.ColumnDescriptor.DimensionType[e.dimensionType]?e.dimensionType:l.dataform.ColumnDescriptor.DimensionType[e.dimensionType]:e.dimensionType),null!=e.aggregation&&e.hasOwnProperty("aggregation")&&(r.aggregation=t.enums===String?void 0===l.dataform.ColumnDescriptor.Aggregation[e.aggregation]?e.aggregation:l.dataform.ColumnDescriptor.Aggregation[e.aggregation]:e.aggregation),null!=e.expression&&e.hasOwnProperty("expression")&&(r.expression=e.expression),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];if(e.bigqueryPolicyTags&&e.bigqueryPolicyTags.length)for(r.bigqueryPolicyTags=[],n=0;n<e.bigqueryPolicyTags.length;++n)r.bigqueryPolicyTags[n]=e.bigqueryPolicyTags[n];return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ColumnDescriptor"},t.DimensionType=(r={},(n=Object.create(r))[r[0]="UNKNOWN_DIMENSION"]=0,n[r[1]="CATEGORY"]=1,n[r[2]="TIMESTAMP"]=2,n[r[3]="NUMBER"]=3,n),t.Aggregation=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_AGGREGATION"]=0,t[e[1]="SUM"]=1,t[e[2]="DISTINCT"]=2,t[e[3]="DERIVED"]=3,t}(),t}(),i.TableType=(t={},(r=Object.create(t))[t[0]="UNKNOWN_TYPE"]=0,r[t[1]="TABLE"]=1,r[t[2]="INCREMENTAL"]=2,r[t[3]="VIEW"]=3,r[t[4]="INLINE"]=4,r),i.Table=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],this.uniqueKey=[],this.preOps=[],this.postOps=[],this.incrementalPreOps=[],this.incrementalPostOps=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.type="",t.prototype.query="",t.prototype.protected=!1,t.prototype.materialized=!1,t.prototype.enumType=0,t.prototype.actionDescriptor=null,t.prototype.tags=s.emptyArray,t.prototype.where="",t.prototype.incrementalQuery="",t.prototype.uniqueKey=s.emptyArray,t.prototype.preOps=s.emptyArray,t.prototype.postOps=s.emptyArray,t.prototype.incrementalPreOps=s.emptyArray,t.prototype.incrementalPostOps=s.emptyArray,t.prototype.redshift=null,t.prototype.bigquery=null,t.prototype.snowflake=null,t.prototype.sqlDataWarehouse=null,t.prototype.presto=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(26).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(34).fork()).ldelim(),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(42).string(e.query),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(48).bool(e.disabled),null!=e.where&&Object.hasOwnProperty.call(e,"where")&&t.uint32(66).string(e.where),null!=e.protected&&Object.hasOwnProperty.call(e,"protected")&&t.uint32(72).bool(e.protected),null!=e.preOps&&e.preOps.length)for(var r=0;r<e.preOps.length;++r)t.uint32(106).string(e.preOps[r]);if(null!=e.postOps&&e.postOps.length)for(r=0;r<e.postOps.length;++r)t.uint32(114).string(e.postOps[r]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(146).string(e.fileName),null!=e.redshift&&Object.hasOwnProperty.call(e,"redshift")&&l.dataform.RedshiftOptions.encode(e.redshift,t.uint32(170).fork()).ldelim(),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&l.dataform.BigQueryOptions.encode(e.bigquery,t.uint32(178).fork()).ldelim(),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(186).string(e.tags[r]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(194).fork()).ldelim(),null!=e.sqlDataWarehouse&&Object.hasOwnProperty.call(e,"sqlDataWarehouse")&&l.dataform.SQLDataWarehouseOptions.encode(e.sqlDataWarehouse,t.uint32(202).fork()).ldelim(),null!=e.incrementalQuery&&Object.hasOwnProperty.call(e,"incrementalQuery")&&t.uint32(210).string(e.incrementalQuery),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(218).fork()).ldelim();if(null!=e.incrementalPreOps&&e.incrementalPreOps.length)for(r=0;r<e.incrementalPreOps.length;++r)t.uint32(226).string(e.incrementalPreOps[r]);if(null!=e.incrementalPostOps&&e.incrementalPostOps.length)for(r=0;r<e.incrementalPostOps.length;++r)t.uint32(234).string(e.incrementalPostOps[r]);if(null!=e.uniqueKey&&e.uniqueKey.length)for(r=0;r<e.uniqueKey.length;++r)t.uint32(242).string(e.uniqueKey[r]);return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(248).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(258).fork()).ldelim(),null!=e.snowflake&&Object.hasOwnProperty.call(e,"snowflake")&&l.dataform.SnowflakeOptions.encode(e.snowflake,t.uint32(266).fork()).ldelim(),null!=e.presto&&Object.hasOwnProperty.call(e,"presto")&&l.dataform.PrestoOptions.encode(e.presto,t.uint32(274).fork()).ldelim(),null!=e.materialized&&Object.hasOwnProperty.call(e,"materialized")&&t.uint32(280).bool(e.materialized),null!=e.enumType&&Object.hasOwnProperty.call(e,"enumType")&&t.uint32(288).int32(e.enumType),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Table;e.pos<r;){var i=e.uint32();switch(i>>>3){case 4:n.target=l.dataform.Target.decode(e,e.uint32());break;case 32:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 27:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 31:n.hermeticity=e.int32();break;case 6:n.disabled=e.bool();break;case 3:n.type=e.string();break;case 5:n.query=e.string();break;case 9:n.protected=e.bool();break;case 35:n.materialized=e.bool();break;case 36:n.enumType=e.int32();break;case 24:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 23:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 8:n.where=e.string();break;case 26:n.incrementalQuery=e.string();break;case 30:n.uniqueKey&&n.uniqueKey.length||(n.uniqueKey=[]),n.uniqueKey.push(e.string());break;case 13:n.preOps&&n.preOps.length||(n.preOps=[]),n.preOps.push(e.string());break;case 14:n.postOps&&n.postOps.length||(n.postOps=[]),n.postOps.push(e.string());break;case 28:n.incrementalPreOps&&n.incrementalPreOps.length||(n.incrementalPreOps=[]),n.incrementalPreOps.push(e.string());break;case 29:n.incrementalPostOps&&n.incrementalPostOps.length||(n.incrementalPostOps=[]),n.incrementalPostOps.push(e.string());break;case 21:n.redshift=l.dataform.RedshiftOptions.decode(e,e.uint32());break;case 22:n.bigquery=l.dataform.BigQueryOptions.decode(e,e.uint32());break;case 33:n.snowflake=l.dataform.SnowflakeOptions.decode(e,e.uint32());break;case 25:n.sqlDataWarehouse=l.dataform.SQLDataWarehouseOptions.decode(e,e.uint32());break;case 34:n.presto=l.dataform.PrestoOptions.decode(e,e.uint32());break;case 18:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=l.dataform.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var r;if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.type&&e.hasOwnProperty("type")&&!s.isString(e.type))return"type: string expected";if(null!=e.query&&e.hasOwnProperty("query")&&!s.isString(e.query))return"query: string expected";if(null!=e.protected&&e.hasOwnProperty("protected")&&"boolean"!=typeof e.protected)return"protected: boolean expected";if(null!=e.materialized&&e.hasOwnProperty("materialized")&&"boolean"!=typeof e.materialized)return"materialized: boolean expected";if(null!=e.enumType&&e.hasOwnProperty("enumType"))switch(e.enumType){default:return"enumType: enum value expected";case 0:case 1:case 2:case 3:case 4:}if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor)))return"actionDescriptor."+r;if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}if(null!=e.where&&e.hasOwnProperty("where")&&!s.isString(e.where))return"where: string expected";if(null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&!s.isString(e.incrementalQuery))return"incrementalQuery: string expected";if(null!=e.uniqueKey&&e.hasOwnProperty("uniqueKey")){if(!Array.isArray(e.uniqueKey))return"uniqueKey: array expected";for(t=0;t<e.uniqueKey.length;++t)if(!s.isString(e.uniqueKey[t]))return"uniqueKey: string[] expected"}if(null!=e.preOps&&e.hasOwnProperty("preOps")){if(!Array.isArray(e.preOps))return"preOps: array expected";for(t=0;t<e.preOps.length;++t)if(!s.isString(e.preOps[t]))return"preOps: string[] expected"}if(null!=e.postOps&&e.hasOwnProperty("postOps")){if(!Array.isArray(e.postOps))return"postOps: array expected";for(t=0;t<e.postOps.length;++t)if(!s.isString(e.postOps[t]))return"postOps: string[] expected"}if(null!=e.incrementalPreOps&&e.hasOwnProperty("incrementalPreOps")){if(!Array.isArray(e.incrementalPreOps))return"incrementalPreOps: array expected";for(t=0;t<e.incrementalPreOps.length;++t)if(!s.isString(e.incrementalPreOps[t]))return"incrementalPreOps: string[] expected"}if(null!=e.incrementalPostOps&&e.hasOwnProperty("incrementalPostOps")){if(!Array.isArray(e.incrementalPostOps))return"incrementalPostOps: array expected";for(t=0;t<e.incrementalPostOps.length;++t)if(!s.isString(e.incrementalPostOps[t]))return"incrementalPostOps: string[] expected"}return null!=e.redshift&&e.hasOwnProperty("redshift")&&(r=l.dataform.RedshiftOptions.verify(e.redshift))?"redshift."+r:null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r=l.dataform.BigQueryOptions.verify(e.bigquery))?"bigquery."+r:null!=e.snowflake&&e.hasOwnProperty("snowflake")&&(r=l.dataform.SnowflakeOptions.verify(e.snowflake))?"snowflake."+r:null!=e.sqlDataWarehouse&&e.hasOwnProperty("sqlDataWarehouse")&&(r=l.dataform.SQLDataWarehouseOptions.verify(e.sqlDataWarehouse))?"sqlDataWarehouse."+r:null!=e.presto&&e.hasOwnProperty("presto")&&(r=l.dataform.PrestoOptions.verify(e.presto))?"presto."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Table)return e;var t=new l.dataform.Table;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Table.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Table.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.Table.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.Table.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}switch(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.type&&(t.type=String(e.type)),null!=e.query&&(t.query=String(e.query)),null!=e.protected&&(t.protected=Boolean(e.protected)),null!=e.materialized&&(t.materialized=Boolean(e.materialized)),e.enumType){default:if("number"==typeof e.enumType){t.enumType=e.enumType;break}break;case"UNKNOWN_TYPE":case 0:t.enumType=0;break;case"TABLE":case 1:t.enumType=1;break;case"INCREMENTAL":case 2:t.enumType=2;break;case"VIEW":case 3:t.enumType=3;break;case"INLINE":case 4:t.enumType=4}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Table.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.Table.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(null!=e.where&&(t.where=String(e.where)),null!=e.incrementalQuery&&(t.incrementalQuery=String(e.incrementalQuery)),e.uniqueKey){if(!Array.isArray(e.uniqueKey))throw TypeError(".dataform.Table.uniqueKey: array expected");for(t.uniqueKey=[],r=0;r<e.uniqueKey.length;++r)t.uniqueKey[r]=String(e.uniqueKey[r])}if(e.preOps){if(!Array.isArray(e.preOps))throw TypeError(".dataform.Table.preOps: array expected");for(t.preOps=[],r=0;r<e.preOps.length;++r)t.preOps[r]=String(e.preOps[r])}if(e.postOps){if(!Array.isArray(e.postOps))throw TypeError(".dataform.Table.postOps: array expected");for(t.postOps=[],r=0;r<e.postOps.length;++r)t.postOps[r]=String(e.postOps[r])}if(e.incrementalPreOps){if(!Array.isArray(e.incrementalPreOps))throw TypeError(".dataform.Table.incrementalPreOps: array expected");for(t.incrementalPreOps=[],r=0;r<e.incrementalPreOps.length;++r)t.incrementalPreOps[r]=String(e.incrementalPreOps[r])}if(e.incrementalPostOps){if(!Array.isArray(e.incrementalPostOps))throw TypeError(".dataform.Table.incrementalPostOps: array expected");for(t.incrementalPostOps=[],r=0;r<e.incrementalPostOps.length;++r)t.incrementalPostOps[r]=String(e.incrementalPostOps[r])}if(null!=e.redshift){if("object"!=typeof e.redshift)throw TypeError(".dataform.Table.redshift: object expected");t.redshift=l.dataform.RedshiftOptions.fromObject(e.redshift)}if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".dataform.Table.bigquery: object expected");t.bigquery=l.dataform.BigQueryOptions.fromObject(e.bigquery)}if(null!=e.snowflake){if("object"!=typeof e.snowflake)throw TypeError(".dataform.Table.snowflake: object expected");t.snowflake=l.dataform.SnowflakeOptions.fromObject(e.snowflake)}if(null!=e.sqlDataWarehouse){if("object"!=typeof e.sqlDataWarehouse)throw TypeError(".dataform.Table.sqlDataWarehouse: object expected");t.sqlDataWarehouse=l.dataform.SQLDataWarehouseOptions.fromObject(e.sqlDataWarehouse)}if(null!=e.presto){if("object"!=typeof e.presto)throw TypeError(".dataform.Table.presto: object expected");t.presto=l.dataform.PrestoOptions.fromObject(e.presto)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.preOps=[],r.postOps=[],r.tags=[],r.dependencyTargets=[],r.incrementalPreOps=[],r.incrementalPostOps=[],r.uniqueKey=[]),t.defaults&&(r.type="",r.target=null,r.query="",r.disabled=!1,r.where="",r.protected=!1,r.fileName="",r.redshift=null,r.bigquery=null,r.actionDescriptor=null,r.sqlDataWarehouse=null,r.incrementalQuery="",r.hermeticity=t.enums===String?"UNKNOWN":0,r.canonicalTarget=null,r.snowflake=null,r.presto=null,r.materialized=!1,r.enumType=t.enums===String?"UNKNOWN_TYPE":0),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),null!=e.where&&e.hasOwnProperty("where")&&(r.where=e.where),null!=e.protected&&e.hasOwnProperty("protected")&&(r.protected=e.protected),e.preOps&&e.preOps.length){r.preOps=[];for(var n=0;n<e.preOps.length;++n)r.preOps[n]=e.preOps[n]}if(e.postOps&&e.postOps.length)for(r.postOps=[],n=0;n<e.postOps.length;++n)r.postOps[n]=e.postOps[n];if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.redshift&&e.hasOwnProperty("redshift")&&(r.redshift=l.dataform.RedshiftOptions.toObject(e.redshift,t)),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r.bigquery=l.dataform.BigQueryOptions.toObject(e.bigquery,t)),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.sqlDataWarehouse&&e.hasOwnProperty("sqlDataWarehouse")&&(r.sqlDataWarehouse=l.dataform.SQLDataWarehouseOptions.toObject(e.sqlDataWarehouse,t)),null!=e.incrementalQuery&&e.hasOwnProperty("incrementalQuery")&&(r.incrementalQuery=e.incrementalQuery),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);if(e.incrementalPreOps&&e.incrementalPreOps.length)for(r.incrementalPreOps=[],n=0;n<e.incrementalPreOps.length;++n)r.incrementalPreOps[n]=e.incrementalPreOps[n];if(e.incrementalPostOps&&e.incrementalPostOps.length)for(r.incrementalPostOps=[],n=0;n<e.incrementalPostOps.length;++n)r.incrementalPostOps[n]=e.incrementalPostOps[n];if(e.uniqueKey&&e.uniqueKey.length)for(r.uniqueKey=[],n=0;n<e.uniqueKey.length;++n)r.uniqueKey[n]=e.uniqueKey[n];return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),null!=e.snowflake&&e.hasOwnProperty("snowflake")&&(r.snowflake=l.dataform.SnowflakeOptions.toObject(e.snowflake,t)),null!=e.presto&&e.hasOwnProperty("presto")&&(r.presto=l.dataform.PrestoOptions.toObject(e.presto,t)),null!=e.materialized&&e.hasOwnProperty("materialized")&&(r.materialized=e.materialized),null!=e.enumType&&e.hasOwnProperty("enumType")&&(r.enumType=t.enums===String?void 0===l.dataform.TableType[e.enumType]?e.enumType:l.dataform.TableType[e.enumType]:e.enumType),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Table"},t}(),i.Operation=function(){function t(e){if(this.dependencyTargets=[],this.queries=[],this.tags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.queries=s.emptyArray,t.prototype.hasOutput=!1,t.prototype.tags=s.emptyArray,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(26).fork()).ldelim(),null!=e.queries&&e.queries.length)for(var r=0;r<e.queries.length;++r)t.uint32(50).string(e.queries[r]);if(null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.hasOutput&&Object.hasOwnProperty.call(e,"hasOutput")&&t.uint32(64).bool(e.hasOutput),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(74).string(e.tags[r]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Operation;e.pos<r;){var i=e.uint32();switch(i>>>3){case 3:n.target=l.dataform.Target.decode(e,e.uint32());break;case 13:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 11:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 12:n.hermeticity=e.int32();break;case 14:n.disabled=e.bool();break;case 6:n.queries&&n.queries.length||(n.queries=[]),n.queries.push(e.string());break;case 8:n.hasOutput=e.bool();break;case 9:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 10:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 7:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=l.dataform.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var r;if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.queries&&e.hasOwnProperty("queries")){if(!Array.isArray(e.queries))return"queries: array expected";for(t=0;t<e.queries.length;++t)if(!s.isString(e.queries[t]))return"queries: string[] expected"}if(null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&"boolean"!=typeof e.hasOutput)return"hasOutput: boolean expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Operation)return e;var t=new l.dataform.Operation;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Operation.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Operation.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.Operation.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.Operation.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),e.queries){if(!Array.isArray(e.queries))throw TypeError(".dataform.Operation.queries: array expected");for(t.queries=[],r=0;r<e.queries.length;++r)t.queries[r]=String(e.queries[r])}if(null!=e.hasOutput&&(t.hasOutput=Boolean(e.hasOutput)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.Operation.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Operation.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.queries=[],r.tags=[],r.dependencyTargets=[]),t.defaults&&(r.target=null,r.fileName="",r.hasOutput=!1,r.actionDescriptor=null,r.hermeticity=t.enums===String?"UNKNOWN":0,r.canonicalTarget=null,r.disabled=!1),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),e.queries&&e.queries.length){r.queries=[];for(var n=0;n<e.queries.length;++n)r.queries[n]=e.queries[n]}if(null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.hasOutput&&e.hasOwnProperty("hasOutput")&&(r.hasOutput=e.hasOutput),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Operation"},t}(),i.Assertion=function(){function t(e){if(this.dependencyTargets=[],this.tags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.disabled=!1,t.prototype.query="",t.prototype.tags=s.emptyArray,t.prototype.actionDescriptor=null,t.prototype.parentAction=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(26).string(e.query),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(58).string(e.fileName),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(66).fork()).ldelim(),null!=e.tags&&e.tags.length)for(var r=0;r<e.tags.length;++r)t.uint32(74).string(e.tags[r]);if(null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(82).fork()).ldelim(),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(90).fork()).ldelim();return null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(96).int32(e.hermeticity),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(106).fork()).ldelim(),null!=e.disabled&&Object.hasOwnProperty.call(e,"disabled")&&t.uint32(112).bool(e.disabled),null!=e.parentAction&&Object.hasOwnProperty.call(e,"parentAction")&&l.dataform.Target.encode(e.parentAction,t.uint32(122).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Assertion;e.pos<r;){var i=e.uint32();switch(i>>>3){case 8:n.target=l.dataform.Target.decode(e,e.uint32());break;case 13:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 11:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 12:n.hermeticity=e.int32();break;case 14:n.disabled=e.bool();break;case 3:n.query=e.string();break;case 9:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 10:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 15:n.parentAction=l.dataform.Target.decode(e,e.uint32());break;case 7:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r=l.dataform.Target.verify(e.canonicalTarget)))return"canonicalTarget."+r;if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t){var r;if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.disabled&&e.hasOwnProperty("disabled")&&"boolean"!=typeof e.disabled)return"disabled: boolean expected";if(null!=e.query&&e.hasOwnProperty("query")&&!s.isString(e.query))return"query: string expected";if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+r:null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(r=l.dataform.Target.verify(e.parentAction))?"parentAction."+r:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Assertion)return e;var t=new l.dataform.Assertion;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Assertion.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Assertion.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.Assertion.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.Assertion.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(null!=e.disabled&&(t.disabled=Boolean(e.disabled)),null!=e.query&&(t.query=String(e.query)),e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.Assertion.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Assertion.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}if(null!=e.parentAction){if("object"!=typeof e.parentAction)throw TypeError(".dataform.Assertion.parentAction: object expected");t.parentAction=l.dataform.Target.fromObject(e.parentAction)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tags=[],r.dependencyTargets=[]),t.defaults&&(r.query="",r.fileName="",r.target=null,r.actionDescriptor=null,r.hermeticity=t.enums===String?"UNKNOWN":0,r.canonicalTarget=null,r.disabled=!1,r.parentAction=null),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),e.tags&&e.tags.length){r.tags=[];for(var n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n]}if(null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);return null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),null!=e.disabled&&e.hasOwnProperty("disabled")&&(r.disabled=e.disabled),null!=e.parentAction&&e.hasOwnProperty("parentAction")&&(r.parentAction=l.dataform.Target.toObject(e.parentAction,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Assertion"},t}(),i.ActionHermeticity=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="HERMETIC"]=1,t[e[2]="NON_HERMETIC"]=2,t}(),i.Declaration=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.canonicalTarget=null,t.prototype.actionDescriptor=null,t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(18).fork()).ldelim(),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(26).fork()).ldelim(),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),null!=e.canonicalTarget&&Object.hasOwnProperty.call(e,"canonicalTarget")&&l.dataform.Target.encode(e.canonicalTarget,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Declaration;e.pos<r;){var i=e.uint32();switch(i>>>3){case 2:n.target=l.dataform.Target.decode(e,e.uint32());break;case 5:n.canonicalTarget=l.dataform.Target.decode(e,e.uint32());break;case 3:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;case 4:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.target&&e.hasOwnProperty("target")&&(t=l.dataform.Target.verify(e.target))?"target."+t:null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(t=l.dataform.Target.verify(e.canonicalTarget))?"canonicalTarget."+t:null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(t=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+t:null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null;var t},t.fromObject=function(e){if(e instanceof l.dataform.Declaration)return e;var t=new l.dataform.Declaration;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.Declaration.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.canonicalTarget){if("object"!=typeof e.canonicalTarget)throw TypeError(".dataform.Declaration.canonicalTarget: object expected");t.canonicalTarget=l.dataform.Target.fromObject(e.canonicalTarget)}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.Declaration.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}return null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.target=null,r.actionDescriptor=null,r.fileName="",r.canonicalTarget=null),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.canonicalTarget&&e.hasOwnProperty("canonicalTarget")&&(r.canonicalTarget=l.dataform.Target.toObject(e.canonicalTarget,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Declaration"},t}(),i.Test=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.name="",t.prototype.testQuery="",t.prototype.expectedOutputQuery="",t.prototype.fileName="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.testQuery&&Object.hasOwnProperty.call(e,"testQuery")&&t.uint32(18).string(e.testQuery),null!=e.expectedOutputQuery&&Object.hasOwnProperty.call(e,"expectedOutputQuery")&&t.uint32(26).string(e.expectedOutputQuery),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(34).string(e.fileName),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Test;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.name=e.string();break;case 2:n.testQuery=e.string();break;case 3:n.expectedOutputQuery=e.string();break;case 4:n.fileName=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name)?"name: string expected":null!=e.testQuery&&e.hasOwnProperty("testQuery")&&!s.isString(e.testQuery)?"testQuery: string expected":null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&!s.isString(e.expectedOutputQuery)?"expectedOutputQuery: string expected":null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName)?"fileName: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Test)return e;var t=new l.dataform.Test;return null!=e.name&&(t.name=String(e.name)),null!=e.testQuery&&(t.testQuery=String(e.testQuery)),null!=e.expectedOutputQuery&&(t.expectedOutputQuery=String(e.expectedOutputQuery)),null!=e.fileName&&(t.fileName=String(e.fileName)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name="",r.testQuery="",r.expectedOutputQuery="",r.fileName=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.testQuery&&e.hasOwnProperty("testQuery")&&(r.testQuery=e.testQuery),null!=e.expectedOutputQuery&&e.hasOwnProperty("expectedOutputQuery")&&(r.expectedOutputQuery=e.expectedOutputQuery),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Test"},t}(),i.CompiledGraph=function(){function t(e){if(this.tables=[],this.operations=[],this.assertions=[],this.declarations=[],this.tests=[],this.targets=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectConfig=null,t.prototype.tables=s.emptyArray,t.prototype.operations=s.emptyArray,t.prototype.assertions=s.emptyArray,t.prototype.declarations=s.emptyArray,t.prototype.tests=s.emptyArray,t.prototype.graphErrors=null,t.prototype.dataformCoreVersion="",t.prototype.targets=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.tables&&e.tables.length)for(var r=0;r<e.tables.length;++r)l.dataform.Table.encode(e.tables[r],t.uint32(10).fork()).ldelim();if(null!=e.operations&&e.operations.length)for(r=0;r<e.operations.length;++r)l.dataform.Operation.encode(e.operations[r],t.uint32(18).fork()).ldelim();if(null!=e.assertions&&e.assertions.length)for(r=0;r<e.assertions.length;++r)l.dataform.Assertion.encode(e.assertions[r],t.uint32(26).fork()).ldelim();if(null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&l.dataform.ProjectConfig.encode(e.projectConfig,t.uint32(34).fork()).ldelim(),null!=e.graphErrors&&Object.hasOwnProperty.call(e,"graphErrors")&&l.dataform.GraphErrors.encode(e.graphErrors,t.uint32(58).fork()).ldelim(),null!=e.tests&&e.tests.length)for(r=0;r<e.tests.length;++r)l.dataform.Test.encode(e.tests[r],t.uint32(66).fork()).ldelim();if(null!=e.declarations&&e.declarations.length)for(r=0;r<e.declarations.length;++r)l.dataform.Declaration.encode(e.declarations[r],t.uint32(74).fork()).ldelim();if(null!=e.dataformCoreVersion&&Object.hasOwnProperty.call(e,"dataformCoreVersion")&&t.uint32(82).string(e.dataformCoreVersion),null!=e.targets&&e.targets.length)for(r=0;r<e.targets.length;++r)l.dataform.Target.encode(e.targets[r],t.uint32(90).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompiledGraph;e.pos<r;){var i=e.uint32();switch(i>>>3){case 4:n.projectConfig=l.dataform.ProjectConfig.decode(e,e.uint32());break;case 1:n.tables&&n.tables.length||(n.tables=[]),n.tables.push(l.dataform.Table.decode(e,e.uint32()));break;case 2:n.operations&&n.operations.length||(n.operations=[]),n.operations.push(l.dataform.Operation.decode(e,e.uint32()));break;case 3:n.assertions&&n.assertions.length||(n.assertions=[]),n.assertions.push(l.dataform.Assertion.decode(e,e.uint32()));break;case 9:n.declarations&&n.declarations.length||(n.declarations=[]),n.declarations.push(l.dataform.Declaration.decode(e,e.uint32()));break;case 8:n.tests&&n.tests.length||(n.tests=[]),n.tests.push(l.dataform.Test.decode(e,e.uint32()));break;case 7:n.graphErrors=l.dataform.GraphErrors.decode(e,e.uint32());break;case 10:n.dataformCoreVersion=e.string();break;case 11:n.targets&&n.targets.length||(n.targets=[]),n.targets.push(l.dataform.Target.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=l.dataform.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+r;if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t)if(r=l.dataform.Table.verify(e.tables[t]))return"tables."+r}if(null!=e.operations&&e.hasOwnProperty("operations")){if(!Array.isArray(e.operations))return"operations: array expected";for(t=0;t<e.operations.length;++t)if(r=l.dataform.Operation.verify(e.operations[t]))return"operations."+r}if(null!=e.assertions&&e.hasOwnProperty("assertions")){if(!Array.isArray(e.assertions))return"assertions: array expected";for(t=0;t<e.assertions.length;++t)if(r=l.dataform.Assertion.verify(e.assertions[t]))return"assertions."+r}if(null!=e.declarations&&e.hasOwnProperty("declarations")){if(!Array.isArray(e.declarations))return"declarations: array expected";for(t=0;t<e.declarations.length;++t)if(r=l.dataform.Declaration.verify(e.declarations[t]))return"declarations."+r}if(null!=e.tests&&e.hasOwnProperty("tests")){if(!Array.isArray(e.tests))return"tests: array expected";for(t=0;t<e.tests.length;++t)if(r=l.dataform.Test.verify(e.tests[t]))return"tests."+r}if(null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(r=l.dataform.GraphErrors.verify(e.graphErrors)))return"graphErrors."+r;if(null!=e.dataformCoreVersion&&e.hasOwnProperty("dataformCoreVersion")&&!s.isString(e.dataformCoreVersion))return"dataformCoreVersion: string expected";if(null!=e.targets&&e.hasOwnProperty("targets")){if(!Array.isArray(e.targets))return"targets: array expected";for(t=0;t<e.targets.length;++t){var r;if(r=l.dataform.Target.verify(e.targets[t]))return"targets."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.CompiledGraph)return e;var t=new l.dataform.CompiledGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".dataform.CompiledGraph.projectConfig: object expected");t.projectConfig=l.dataform.ProjectConfig.fromObject(e.projectConfig)}if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".dataform.CompiledGraph.tables: array expected");t.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".dataform.CompiledGraph.tables: object expected");t.tables[r]=l.dataform.Table.fromObject(e.tables[r])}}if(e.operations){if(!Array.isArray(e.operations))throw TypeError(".dataform.CompiledGraph.operations: array expected");for(t.operations=[],r=0;r<e.operations.length;++r){if("object"!=typeof e.operations[r])throw TypeError(".dataform.CompiledGraph.operations: object expected");t.operations[r]=l.dataform.Operation.fromObject(e.operations[r])}}if(e.assertions){if(!Array.isArray(e.assertions))throw TypeError(".dataform.CompiledGraph.assertions: array expected");for(t.assertions=[],r=0;r<e.assertions.length;++r){if("object"!=typeof e.assertions[r])throw TypeError(".dataform.CompiledGraph.assertions: object expected");t.assertions[r]=l.dataform.Assertion.fromObject(e.assertions[r])}}if(e.declarations){if(!Array.isArray(e.declarations))throw TypeError(".dataform.CompiledGraph.declarations: array expected");for(t.declarations=[],r=0;r<e.declarations.length;++r){if("object"!=typeof e.declarations[r])throw TypeError(".dataform.CompiledGraph.declarations: object expected");t.declarations[r]=l.dataform.Declaration.fromObject(e.declarations[r])}}if(e.tests){if(!Array.isArray(e.tests))throw TypeError(".dataform.CompiledGraph.tests: array expected");for(t.tests=[],r=0;r<e.tests.length;++r){if("object"!=typeof e.tests[r])throw TypeError(".dataform.CompiledGraph.tests: object expected");t.tests[r]=l.dataform.Test.fromObject(e.tests[r])}}if(null!=e.graphErrors){if("object"!=typeof e.graphErrors)throw TypeError(".dataform.CompiledGraph.graphErrors: object expected");t.graphErrors=l.dataform.GraphErrors.fromObject(e.graphErrors)}if(null!=e.dataformCoreVersion&&(t.dataformCoreVersion=String(e.dataformCoreVersion)),e.targets){if(!Array.isArray(e.targets))throw TypeError(".dataform.CompiledGraph.targets: array expected");for(t.targets=[],r=0;r<e.targets.length;++r){if("object"!=typeof e.targets[r])throw TypeError(".dataform.CompiledGraph.targets: object expected");t.targets[r]=l.dataform.Target.fromObject(e.targets[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tables=[],r.operations=[],r.assertions=[],r.tests=[],r.declarations=[],r.targets=[]),t.defaults&&(r.projectConfig=null,r.graphErrors=null,r.dataformCoreVersion=""),e.tables&&e.tables.length){r.tables=[];for(var n=0;n<e.tables.length;++n)r.tables[n]=l.dataform.Table.toObject(e.tables[n],t)}if(e.operations&&e.operations.length)for(r.operations=[],n=0;n<e.operations.length;++n)r.operations[n]=l.dataform.Operation.toObject(e.operations[n],t);if(e.assertions&&e.assertions.length)for(r.assertions=[],n=0;n<e.assertions.length;++n)r.assertions[n]=l.dataform.Assertion.toObject(e.assertions[n],t);if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r.projectConfig=l.dataform.ProjectConfig.toObject(e.projectConfig,t)),null!=e.graphErrors&&e.hasOwnProperty("graphErrors")&&(r.graphErrors=l.dataform.GraphErrors.toObject(e.graphErrors,t)),e.tests&&e.tests.length)for(r.tests=[],n=0;n<e.tests.length;++n)r.tests[n]=l.dataform.Test.toObject(e.tests[n],t);if(e.declarations&&e.declarations.length)for(r.declarations=[],n=0;n<e.declarations.length;++n)r.declarations[n]=l.dataform.Declaration.toObject(e.declarations[n],t);if(null!=e.dataformCoreVersion&&e.hasOwnProperty("dataformCoreVersion")&&(r.dataformCoreVersion=e.dataformCoreVersion),e.targets&&e.targets.length)for(r.targets=[],n=0;n<e.targets.length;++n)r.targets[n]=l.dataform.Target.toObject(e.targets[n],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompiledGraph"},t}(),i.CoreExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.compile=null,Object.defineProperty(t.prototype,"request",{get:s.oneOfGetter(r=["compile"]),set:s.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&l.dataform.CompileExecutionRequest.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CoreExecutionRequest;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compile=l.dataform.CompileExecutionRequest.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=l.dataform.CompileExecutionRequest.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CoreExecutionRequest)return e;var t=new l.dataform.CoreExecutionRequest;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".dataform.CoreExecutionRequest.compile: object expected");t.compile=l.dataform.CompileExecutionRequest.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.compile&&e.hasOwnProperty("compile")&&(r.compile=l.dataform.CompileExecutionRequest.toObject(e.compile,t),t.oneofs&&(r.request="compile")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CoreExecutionRequest"},t}(),i.CoreExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.compile=null,Object.defineProperty(t.prototype,"response",{get:s.oneOfGetter(r=["compile"]),set:s.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compile&&Object.hasOwnProperty.call(e,"compile")&&l.dataform.CompileExecutionResponse.encode(e.compile,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CoreExecutionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compile=l.dataform.CompileExecutionResponse.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compile&&e.hasOwnProperty("compile")){var t=l.dataform.CompileExecutionResponse.verify(e.compile);if(t)return"compile."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CoreExecutionResponse)return e;var t=new l.dataform.CoreExecutionResponse;if(null!=e.compile){if("object"!=typeof e.compile)throw TypeError(".dataform.CoreExecutionResponse.compile: object expected");t.compile=l.dataform.CompileExecutionResponse.fromObject(e.compile)}return t},t.toObject=function(e,t){t||(t={});var r={};return null!=e.compile&&e.hasOwnProperty("compile")&&(r.compile=l.dataform.CompileExecutionResponse.toObject(e.compile,t),t.oneofs&&(r.response="compile")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CoreExecutionResponse"},t}(),i.CompileExecutionRequest=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compileConfig=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compileConfig&&Object.hasOwnProperty.call(e,"compileConfig")&&l.dataform.CompileConfig.encode(e.compileConfig,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompileExecutionRequest;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compileConfig=l.dataform.CompileConfig.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compileConfig&&e.hasOwnProperty("compileConfig")){var t=l.dataform.CompileConfig.verify(e.compileConfig);if(t)return"compileConfig."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CompileExecutionRequest)return e;var t=new l.dataform.CompileExecutionRequest;if(null!=e.compileConfig){if("object"!=typeof e.compileConfig)throw TypeError(".dataform.CompileExecutionRequest.compileConfig: object expected");t.compileConfig=l.dataform.CompileConfig.fromObject(e.compileConfig)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.compileConfig=null),null!=e.compileConfig&&e.hasOwnProperty("compileConfig")&&(r.compileConfig=l.dataform.CompileConfig.toObject(e.compileConfig,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompileExecutionRequest"},t}(),i.CompileExecutionResponse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.compiledGraph=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.compiledGraph&&Object.hasOwnProperty.call(e,"compiledGraph")&&l.dataform.CompiledGraph.encode(e.compiledGraph,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.CompileExecutionResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.compiledGraph=l.dataform.CompiledGraph.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")){var t=l.dataform.CompiledGraph.verify(e.compiledGraph);if(t)return"compiledGraph."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.CompileExecutionResponse)return e;var t=new l.dataform.CompileExecutionResponse;if(null!=e.compiledGraph){if("object"!=typeof e.compiledGraph)throw TypeError(".dataform.CompileExecutionResponse.compiledGraph: object expected");t.compiledGraph=l.dataform.CompiledGraph.fromObject(e.compiledGraph)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.compiledGraph=null),null!=e.compiledGraph&&e.hasOwnProperty("compiledGraph")&&(r.compiledGraph=l.dataform.CompiledGraph.toObject(e.compiledGraph,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.CompileExecutionResponse"},t}(),i.SupportedFeatures=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FEATURE"]=0,t[e[1]="ARRAY_BUFFER_IPC"]=1,t}(),i.QueryEvaluationError=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.message="",t.prototype.errorLocation=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.message&&Object.hasOwnProperty.call(e,"message")&&t.uint32(10).string(e.message),null!=e.errorLocation&&Object.hasOwnProperty.call(e,"errorLocation")&&l.dataform.QueryEvaluationError.ErrorLocation.encode(e.errorLocation,t.uint32(18).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.QueryEvaluationError;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.message=e.string();break;case 2:n.errorLocation=l.dataform.QueryEvaluationError.ErrorLocation.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.message&&e.hasOwnProperty("message")&&!s.isString(e.message))return"message: string expected";if(null!=e.errorLocation&&e.hasOwnProperty("errorLocation")){var t=l.dataform.QueryEvaluationError.ErrorLocation.verify(e.errorLocation);if(t)return"errorLocation."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.QueryEvaluationError)return e;var t=new l.dataform.QueryEvaluationError;if(null!=e.message&&(t.message=String(e.message)),null!=e.errorLocation){if("object"!=typeof e.errorLocation)throw TypeError(".dataform.QueryEvaluationError.errorLocation: object expected");t.errorLocation=l.dataform.QueryEvaluationError.ErrorLocation.fromObject(e.errorLocation)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.message="",r.errorLocation=null),null!=e.message&&e.hasOwnProperty("message")&&(r.message=e.message),null!=e.errorLocation&&e.hasOwnProperty("errorLocation")&&(r.errorLocation=l.dataform.QueryEvaluationError.ErrorLocation.toObject(e.errorLocation,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.QueryEvaluationError"},t.ErrorLocation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.line=0,t.prototype.column=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.line&&Object.hasOwnProperty.call(e,"line")&&t.uint32(8).int32(e.line),null!=e.column&&Object.hasOwnProperty.call(e,"column")&&t.uint32(16).int32(e.column),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.QueryEvaluationError.ErrorLocation;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.line=e.int32();break;case 2:n.column=e.int32();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.line&&e.hasOwnProperty("line")&&!s.isInteger(e.line)?"line: integer expected":null!=e.column&&e.hasOwnProperty("column")&&!s.isInteger(e.column)?"column: integer expected":null},t.fromObject=function(e){if(e instanceof l.dataform.QueryEvaluationError.ErrorLocation)return e;var t=new l.dataform.QueryEvaluationError.ErrorLocation;return null!=e.line&&(t.line=0|e.line),null!=e.column&&(t.column=0|e.column),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.line=0,r.column=0),null!=e.line&&e.hasOwnProperty("line")&&(r.line=e.line),null!=e.column&&e.hasOwnProperty("column")&&(r.column=e.column),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.QueryEvaluationError.ErrorLocation"},t}(),t}(),i.QueryEvaluation=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.status=0,t.prototype.error=null,t.prototype.incremental=!1,t.prototype.query="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.error&&Object.hasOwnProperty.call(e,"error")&&l.dataform.QueryEvaluationError.encode(e.error,t.uint32(18).fork()).ldelim(),null!=e.incremental&&Object.hasOwnProperty.call(e,"incremental")&&t.uint32(24).bool(e.incremental),null!=e.query&&Object.hasOwnProperty.call(e,"query")&&t.uint32(34).string(e.query),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.QueryEvaluation;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.status=e.int32();break;case 2:n.error=l.dataform.QueryEvaluationError.decode(e,e.uint32());break;case 3:n.incremental=e.bool();break;case 4:n.query=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:}if(null!=e.error&&e.hasOwnProperty("error")){var t=l.dataform.QueryEvaluationError.verify(e.error);if(t)return"error."+t}return null!=e.incremental&&e.hasOwnProperty("incremental")&&"boolean"!=typeof e.incremental?"incremental: boolean expected":null!=e.query&&e.hasOwnProperty("query")&&!s.isString(e.query)?"query: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.QueryEvaluation)return e;var t=new l.dataform.QueryEvaluation;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"SUCCESS":case 0:t.status=0;break;case"FAILURE":case 1:t.status=1}if(null!=e.error){if("object"!=typeof e.error)throw TypeError(".dataform.QueryEvaluation.error: object expected");t.error=l.dataform.QueryEvaluationError.fromObject(e.error)}return null!=e.incremental&&(t.incremental=Boolean(e.incremental)),null!=e.query&&(t.query=String(e.query)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.status=t.enums===String?"SUCCESS":0,r.error=null,r.incremental=!1,r.query=""),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.QueryEvaluation.QueryEvaluationStatus[e.status]?e.status:l.dataform.QueryEvaluation.QueryEvaluationStatus[e.status]:e.status),null!=e.error&&e.hasOwnProperty("error")&&(r.error=l.dataform.QueryEvaluationError.toObject(e.error,t)),null!=e.incremental&&e.hasOwnProperty("incremental")&&(r.incremental=e.incremental),null!=e.query&&e.hasOwnProperty("query")&&(r.query=e.query),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.QueryEvaluation"},t.QueryEvaluationStatus=function(){var e={},t=Object.create(e);return t[e[0]="SUCCESS"]=0,t[e[1]="FAILURE"]=1,t}(),t}(),i.RunConfig=function(){function t(e){if(this.actions=[],this.tags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.actions=s.emptyArray,t.prototype.tags=s.emptyArray,t.prototype.includeDependencies=!1,t.prototype.includeDependents=!1,t.prototype.fullRefresh=!1,t.prototype.timeoutMillis=0,t.prototype.disableSetMetadata=!1,t.prototype.useRunCache=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.actions&&e.actions.length)for(var r=0;r<e.actions.length;++r)t.uint32(10).string(e.actions[r]);if(null!=e.fullRefresh&&Object.hasOwnProperty.call(e,"fullRefresh")&&t.uint32(16).bool(e.fullRefresh),null!=e.includeDependencies&&Object.hasOwnProperty.call(e,"includeDependencies")&&t.uint32(24).bool(e.includeDependencies),null!=e.tags&&e.tags.length)for(r=0;r<e.tags.length;++r)t.uint32(42).string(e.tags[r]);return null!=e.timeoutMillis&&Object.hasOwnProperty.call(e,"timeoutMillis")&&t.uint32(56).int32(e.timeoutMillis),null!=e.useRunCache&&Object.hasOwnProperty.call(e,"useRunCache")&&t.uint32(64).bool(e.useRunCache),null!=e.disableSetMetadata&&Object.hasOwnProperty.call(e,"disableSetMetadata")&&t.uint32(72).bool(e.disableSetMetadata),null!=e.includeDependents&&Object.hasOwnProperty.call(e,"includeDependents")&&t.uint32(88).bool(e.includeDependents),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.RunConfig;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.actions&&n.actions.length||(n.actions=[]),n.actions.push(e.string());break;case 5:n.tags&&n.tags.length||(n.tags=[]),n.tags.push(e.string());break;case 3:n.includeDependencies=e.bool();break;case 11:n.includeDependents=e.bool();break;case 2:n.fullRefresh=e.bool();break;case 7:n.timeoutMillis=e.int32();break;case 9:n.disableSetMetadata=e.bool();break;case 8:n.useRunCache=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(!s.isString(e.actions[t]))return"actions: string[] expected"}if(null!=e.tags&&e.hasOwnProperty("tags")){if(!Array.isArray(e.tags))return"tags: array expected";for(t=0;t<e.tags.length;++t)if(!s.isString(e.tags[t]))return"tags: string[] expected"}return null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&"boolean"!=typeof e.includeDependencies?"includeDependencies: boolean expected":null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&"boolean"!=typeof e.includeDependents?"includeDependents: boolean expected":null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&"boolean"!=typeof e.fullRefresh?"fullRefresh: boolean expected":null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&!s.isInteger(e.timeoutMillis)?"timeoutMillis: integer expected":null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&"boolean"!=typeof e.disableSetMetadata?"disableSetMetadata: boolean expected":null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&"boolean"!=typeof e.useRunCache?"useRunCache: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.RunConfig)return e;var t=new l.dataform.RunConfig;if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".dataform.RunConfig.actions: array expected");t.actions=[];for(var r=0;r<e.actions.length;++r)t.actions[r]=String(e.actions[r])}if(e.tags){if(!Array.isArray(e.tags))throw TypeError(".dataform.RunConfig.tags: array expected");for(t.tags=[],r=0;r<e.tags.length;++r)t.tags[r]=String(e.tags[r])}return null!=e.includeDependencies&&(t.includeDependencies=Boolean(e.includeDependencies)),null!=e.includeDependents&&(t.includeDependents=Boolean(e.includeDependents)),null!=e.fullRefresh&&(t.fullRefresh=Boolean(e.fullRefresh)),null!=e.timeoutMillis&&(t.timeoutMillis=0|e.timeoutMillis),null!=e.disableSetMetadata&&(t.disableSetMetadata=Boolean(e.disableSetMetadata)),null!=e.useRunCache&&(t.useRunCache=Boolean(e.useRunCache)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.actions=[],r.tags=[]),t.defaults&&(r.fullRefresh=!1,r.includeDependencies=!1,r.timeoutMillis=0,r.useRunCache=!1,r.disableSetMetadata=!1,r.includeDependents=!1),e.actions&&e.actions.length){r.actions=[];for(var n=0;n<e.actions.length;++n)r.actions[n]=e.actions[n]}if(null!=e.fullRefresh&&e.hasOwnProperty("fullRefresh")&&(r.fullRefresh=e.fullRefresh),null!=e.includeDependencies&&e.hasOwnProperty("includeDependencies")&&(r.includeDependencies=e.includeDependencies),e.tags&&e.tags.length)for(r.tags=[],n=0;n<e.tags.length;++n)r.tags[n]=e.tags[n];return null!=e.timeoutMillis&&e.hasOwnProperty("timeoutMillis")&&(r.timeoutMillis=e.timeoutMillis),null!=e.useRunCache&&e.hasOwnProperty("useRunCache")&&(r.useRunCache=e.useRunCache),null!=e.disableSetMetadata&&e.hasOwnProperty("disableSetMetadata")&&(r.disableSetMetadata=e.disableSetMetadata),null!=e.includeDependents&&e.hasOwnProperty("includeDependents")&&(r.includeDependents=e.includeDependents),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.RunConfig"},t}(),i.ExecutionTask=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.type="",t.prototype.statement="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(10).string(e.type),null!=e.statement&&Object.hasOwnProperty.call(e,"statement")&&t.uint32(18).string(e.statement),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionTask;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.type=e.string();break;case 2:n.statement=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.type&&e.hasOwnProperty("type")&&!s.isString(e.type)?"type: string expected":null!=e.statement&&e.hasOwnProperty("statement")&&!s.isString(e.statement)?"statement: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionTask)return e;var t=new l.dataform.ExecutionTask;return null!=e.type&&(t.type=String(e.type)),null!=e.statement&&(t.statement=String(e.statement)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.type="",r.statement=""),null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.statement&&e.hasOwnProperty("statement")&&(r.statement=e.statement),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionTask"},t}(),i.ExecutionAction=function(){function t(e){if(this.dependencyTargets=[],this.tasks=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.fileName="",t.prototype.type="",t.prototype.tableType="",t.prototype.dependencyTargets=s.emptyArray,t.prototype.hermeticity=0,t.prototype.tasks=s.emptyArray,t.prototype.actionDescriptor=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.tasks&&e.tasks.length)for(var r=0;r<e.tasks.length;++r)l.dataform.ExecutionTask.encode(e.tasks[r],t.uint32(18).fork()).ldelim();if(null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(34).string(e.type),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(42).fork()).ldelim(),null!=e.tableType&&Object.hasOwnProperty.call(e,"tableType")&&t.uint32(50).string(e.tableType),null!=e.fileName&&Object.hasOwnProperty.call(e,"fileName")&&t.uint32(66).string(e.fileName),null!=e.actionDescriptor&&Object.hasOwnProperty.call(e,"actionDescriptor")&&l.dataform.ActionDescriptor.encode(e.actionDescriptor,t.uint32(74).fork()).ldelim(),null!=e.hermeticity&&Object.hasOwnProperty.call(e,"hermeticity")&&t.uint32(80).int32(e.hermeticity),null!=e.dependencyTargets&&e.dependencyTargets.length)for(r=0;r<e.dependencyTargets.length;++r)l.dataform.Target.encode(e.dependencyTargets[r],t.uint32(90).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionAction;e.pos<r;){var i=e.uint32();switch(i>>>3){case 5:n.target=l.dataform.Target.decode(e,e.uint32());break;case 8:n.fileName=e.string();break;case 4:n.type=e.string();break;case 6:n.tableType=e.string();break;case 11:n.dependencyTargets&&n.dependencyTargets.length||(n.dependencyTargets=[]),n.dependencyTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 10:n.hermeticity=e.int32();break;case 2:n.tasks&&n.tasks.length||(n.tasks=[]),n.tasks.push(l.dataform.ExecutionTask.decode(e,e.uint32()));break;case 9:n.actionDescriptor=l.dataform.ActionDescriptor.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.fileName&&e.hasOwnProperty("fileName")&&!s.isString(e.fileName))return"fileName: string expected";if(null!=e.type&&e.hasOwnProperty("type")&&!s.isString(e.type))return"type: string expected";if(null!=e.tableType&&e.hasOwnProperty("tableType")&&!s.isString(e.tableType))return"tableType: string expected";if(null!=e.dependencyTargets&&e.hasOwnProperty("dependencyTargets")){if(!Array.isArray(e.dependencyTargets))return"dependencyTargets: array expected";for(var t=0;t<e.dependencyTargets.length;++t)if(r=l.dataform.Target.verify(e.dependencyTargets[t]))return"dependencyTargets."+r}if(null!=e.hermeticity&&e.hasOwnProperty("hermeticity"))switch(e.hermeticity){default:return"hermeticity: enum value expected";case 0:case 1:case 2:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(t=0;t<e.tasks.length;++t){var r;if(r=l.dataform.ExecutionTask.verify(e.tasks[t]))return"tasks."+r}}return null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r=l.dataform.ActionDescriptor.verify(e.actionDescriptor))?"actionDescriptor."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionAction)return e;var t=new l.dataform.ExecutionAction;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.ExecutionAction.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}if(null!=e.fileName&&(t.fileName=String(e.fileName)),null!=e.type&&(t.type=String(e.type)),null!=e.tableType&&(t.tableType=String(e.tableType)),e.dependencyTargets){if(!Array.isArray(e.dependencyTargets))throw TypeError(".dataform.ExecutionAction.dependencyTargets: array expected");t.dependencyTargets=[];for(var r=0;r<e.dependencyTargets.length;++r){if("object"!=typeof e.dependencyTargets[r])throw TypeError(".dataform.ExecutionAction.dependencyTargets: object expected");t.dependencyTargets[r]=l.dataform.Target.fromObject(e.dependencyTargets[r])}}switch(e.hermeticity){default:if("number"==typeof e.hermeticity){t.hermeticity=e.hermeticity;break}break;case"UNKNOWN":case 0:t.hermeticity=0;break;case"HERMETIC":case 1:t.hermeticity=1;break;case"NON_HERMETIC":case 2:t.hermeticity=2}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".dataform.ExecutionAction.tasks: array expected");for(t.tasks=[],r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".dataform.ExecutionAction.tasks: object expected");t.tasks[r]=l.dataform.ExecutionTask.fromObject(e.tasks[r])}}if(null!=e.actionDescriptor){if("object"!=typeof e.actionDescriptor)throw TypeError(".dataform.ExecutionAction.actionDescriptor: object expected");t.actionDescriptor=l.dataform.ActionDescriptor.fromObject(e.actionDescriptor)}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tasks=[],r.dependencyTargets=[]),t.defaults&&(r.type="",r.target=null,r.tableType="",r.fileName="",r.actionDescriptor=null,r.hermeticity=t.enums===String?"UNKNOWN":0),e.tasks&&e.tasks.length){r.tasks=[];for(var n=0;n<e.tasks.length;++n)r.tasks[n]=l.dataform.ExecutionTask.toObject(e.tasks[n],t)}if(null!=e.type&&e.hasOwnProperty("type")&&(r.type=e.type),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),null!=e.tableType&&e.hasOwnProperty("tableType")&&(r.tableType=e.tableType),null!=e.fileName&&e.hasOwnProperty("fileName")&&(r.fileName=e.fileName),null!=e.actionDescriptor&&e.hasOwnProperty("actionDescriptor")&&(r.actionDescriptor=l.dataform.ActionDescriptor.toObject(e.actionDescriptor,t)),null!=e.hermeticity&&e.hasOwnProperty("hermeticity")&&(r.hermeticity=t.enums===String?void 0===l.dataform.ActionHermeticity[e.hermeticity]?e.hermeticity:l.dataform.ActionHermeticity[e.hermeticity]:e.hermeticity),e.dependencyTargets&&e.dependencyTargets.length)for(r.dependencyTargets=[],n=0;n<e.dependencyTargets.length;++n)r.dependencyTargets[n]=l.dataform.Target.toObject(e.dependencyTargets[n],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionAction"},t}(),i.WarehouseState=function(){function t(e){if(this.tables=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.tables=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.tables&&e.tables.length)for(var r=0;r<e.tables.length;++r)l.dataform.TableMetadata.encode(e.tables[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.WarehouseState;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.tables&&n.tables.length||(n.tables=[]),n.tables.push(l.dataform.TableMetadata.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.tables&&e.hasOwnProperty("tables")){if(!Array.isArray(e.tables))return"tables: array expected";for(var t=0;t<e.tables.length;++t){var r=l.dataform.TableMetadata.verify(e.tables[t]);if(r)return"tables."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.WarehouseState)return e;var t=new l.dataform.WarehouseState;if(e.tables){if(!Array.isArray(e.tables))throw TypeError(".dataform.WarehouseState.tables: array expected");t.tables=[];for(var r=0;r<e.tables.length;++r){if("object"!=typeof e.tables[r])throw TypeError(".dataform.WarehouseState.tables: object expected");t.tables[r]=l.dataform.TableMetadata.fromObject(e.tables[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tables=[]),e.tables&&e.tables.length){r.tables=[];for(var n=0;n<e.tables.length;++n)r.tables[n]=l.dataform.TableMetadata.toObject(e.tables[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.WarehouseState"},t}(),i.ExecutionGraph=function(){function t(e){if(this.declarationTargets=[],this.actions=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectConfig=null,t.prototype.runConfig=null,t.prototype.warehouseState=null,t.prototype.declarationTargets=s.emptyArray,t.prototype.actions=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.projectConfig&&Object.hasOwnProperty.call(e,"projectConfig")&&l.dataform.ProjectConfig.encode(e.projectConfig,t.uint32(10).fork()).ldelim(),null!=e.runConfig&&Object.hasOwnProperty.call(e,"runConfig")&&l.dataform.RunConfig.encode(e.runConfig,t.uint32(18).fork()).ldelim(),null!=e.actions&&e.actions.length)for(var r=0;r<e.actions.length;++r)l.dataform.ExecutionAction.encode(e.actions[r],t.uint32(26).fork()).ldelim();if(null!=e.warehouseState&&Object.hasOwnProperty.call(e,"warehouseState")&&l.dataform.WarehouseState.encode(e.warehouseState,t.uint32(34).fork()).ldelim(),null!=e.declarationTargets&&e.declarationTargets.length)for(r=0;r<e.declarationTargets.length;++r)l.dataform.Target.encode(e.declarationTargets[r],t.uint32(42).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionGraph;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectConfig=l.dataform.ProjectConfig.decode(e,e.uint32());break;case 2:n.runConfig=l.dataform.RunConfig.decode(e,e.uint32());break;case 4:n.warehouseState=l.dataform.WarehouseState.decode(e,e.uint32());break;case 5:n.declarationTargets&&n.declarationTargets.length||(n.declarationTargets=[]),n.declarationTargets.push(l.dataform.Target.decode(e,e.uint32()));break;case 3:n.actions&&n.actions.length||(n.actions=[]),n.actions.push(l.dataform.ExecutionAction.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r=l.dataform.ProjectConfig.verify(e.projectConfig)))return"projectConfig."+r;if(null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(r=l.dataform.RunConfig.verify(e.runConfig)))return"runConfig."+r;if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(r=l.dataform.WarehouseState.verify(e.warehouseState)))return"warehouseState."+r;if(null!=e.declarationTargets&&e.hasOwnProperty("declarationTargets")){if(!Array.isArray(e.declarationTargets))return"declarationTargets: array expected";for(var t=0;t<e.declarationTargets.length;++t)if(r=l.dataform.Target.verify(e.declarationTargets[t]))return"declarationTargets."+r}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(t=0;t<e.actions.length;++t){var r;if(r=l.dataform.ExecutionAction.verify(e.actions[t]))return"actions."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionGraph)return e;var t=new l.dataform.ExecutionGraph;if(null!=e.projectConfig){if("object"!=typeof e.projectConfig)throw TypeError(".dataform.ExecutionGraph.projectConfig: object expected");t.projectConfig=l.dataform.ProjectConfig.fromObject(e.projectConfig)}if(null!=e.runConfig){if("object"!=typeof e.runConfig)throw TypeError(".dataform.ExecutionGraph.runConfig: object expected");t.runConfig=l.dataform.RunConfig.fromObject(e.runConfig)}if(null!=e.warehouseState){if("object"!=typeof e.warehouseState)throw TypeError(".dataform.ExecutionGraph.warehouseState: object expected");t.warehouseState=l.dataform.WarehouseState.fromObject(e.warehouseState)}if(e.declarationTargets){if(!Array.isArray(e.declarationTargets))throw TypeError(".dataform.ExecutionGraph.declarationTargets: array expected");t.declarationTargets=[];for(var r=0;r<e.declarationTargets.length;++r){if("object"!=typeof e.declarationTargets[r])throw TypeError(".dataform.ExecutionGraph.declarationTargets: object expected");t.declarationTargets[r]=l.dataform.Target.fromObject(e.declarationTargets[r])}}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".dataform.ExecutionGraph.actions: array expected");for(t.actions=[],r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".dataform.ExecutionGraph.actions: object expected");t.actions[r]=l.dataform.ExecutionAction.fromObject(e.actions[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.actions=[],r.declarationTargets=[]),t.defaults&&(r.projectConfig=null,r.runConfig=null,r.warehouseState=null),null!=e.projectConfig&&e.hasOwnProperty("projectConfig")&&(r.projectConfig=l.dataform.ProjectConfig.toObject(e.projectConfig,t)),null!=e.runConfig&&e.hasOwnProperty("runConfig")&&(r.runConfig=l.dataform.RunConfig.toObject(e.runConfig,t)),e.actions&&e.actions.length){r.actions=[];for(var n=0;n<e.actions.length;++n)r.actions[n]=l.dataform.ExecutionAction.toObject(e.actions[n],t)}if(null!=e.warehouseState&&e.hasOwnProperty("warehouseState")&&(r.warehouseState=l.dataform.WarehouseState.toObject(e.warehouseState,t)),e.declarationTargets&&e.declarationTargets.length)for(r.declarationTargets=[],n=0;n<e.declarationTargets.length;++n)r.declarationTargets[n]=l.dataform.Target.toObject(e.declarationTargets[n],t);return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionGraph"},t}(),i.Timing=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.startTimeMillis=0,t.prototype.endTimeMillis=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.startTimeMillis&&Object.hasOwnProperty.call(e,"startTimeMillis")&&t.uint32(8).int64(e.startTimeMillis),null!=e.endTimeMillis&&Object.hasOwnProperty.call(e,"endTimeMillis")&&t.uint32(16).int64(e.endTimeMillis),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Timing;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.startTimeMillis=e.int64();break;case 2:n.endTimeMillis=e.int64();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&!(s.isInteger(e.startTimeMillis)||e.startTimeMillis&&s.isInteger(e.startTimeMillis.low)&&s.isInteger(e.startTimeMillis.high))?"startTimeMillis: integer|Long expected":null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&!(s.isInteger(e.endTimeMillis)||e.endTimeMillis&&s.isInteger(e.endTimeMillis.low)&&s.isInteger(e.endTimeMillis.high))?"endTimeMillis: integer|Long expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Timing)return e;var t=new l.dataform.Timing;return null!=e.startTimeMillis&&(s.Long?(t.startTimeMillis=s.Long.fromValue(e.startTimeMillis)).unsigned=!1:"string"==typeof e.startTimeMillis?t.startTimeMillis=parseInt(e.startTimeMillis,10):"number"==typeof e.startTimeMillis?t.startTimeMillis=e.startTimeMillis:"object"==typeof e.startTimeMillis&&(t.startTimeMillis=new s.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber())),null!=e.endTimeMillis&&(s.Long?(t.endTimeMillis=s.Long.fromValue(e.endTimeMillis)).unsigned=!1:"string"==typeof e.endTimeMillis?t.endTimeMillis=parseInt(e.endTimeMillis,10):"number"==typeof e.endTimeMillis?t.endTimeMillis=e.endTimeMillis:"object"==typeof e.endTimeMillis&&(t.endTimeMillis=new s.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.startTimeMillis=0,r.endTimeMillis=0),null!=e.startTimeMillis&&e.hasOwnProperty("startTimeMillis")&&("number"==typeof e.startTimeMillis?r.startTimeMillis=t.longs===String?String(e.startTimeMillis):e.startTimeMillis:r.startTimeMillis=t.longs===String?s.Long.prototype.toString.call(e.startTimeMillis):t.longs===Number?new s.LongBits(e.startTimeMillis.low>>>0,e.startTimeMillis.high>>>0).toNumber():e.startTimeMillis),null!=e.endTimeMillis&&e.hasOwnProperty("endTimeMillis")&&("number"==typeof e.endTimeMillis?r.endTimeMillis=t.longs===String?String(e.endTimeMillis):e.endTimeMillis:r.endTimeMillis=t.longs===String?s.Long.prototype.toString.call(e.endTimeMillis):t.longs===Number?new s.LongBits(e.endTimeMillis.low>>>0,e.endTimeMillis.high>>>0).toNumber():e.endTimeMillis),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Timing"},t}(),i.RunResult=function(){function t(e){if(this.actions=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.status=0,t.prototype.actions=s.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.actions&&e.actions.length)for(var r=0;r<e.actions.length;++r)l.dataform.ActionResult.encode(e.actions[r],t.uint32(18).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&l.dataform.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.RunResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.status=e.int32();break;case 2:n.actions&&n.actions.length||(n.actions=[]),n.actions.push(l.dataform.ActionResult.decode(e,e.uint32()));break;case 3:n.timing=l.dataform.Timing.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}if(null!=e.actions&&e.hasOwnProperty("actions")){if(!Array.isArray(e.actions))return"actions: array expected";for(var t=0;t<e.actions.length;++t)if(r=l.dataform.ActionResult.verify(e.actions[t]))return"actions."+r}var r;return null!=e.timing&&e.hasOwnProperty("timing")&&(r=l.dataform.Timing.verify(e.timing))?"timing."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.RunResult)return e;var t=new l.dataform.RunResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"CANCELLED":case 4:t.status=4;break;case"TIMED_OUT":case 5:t.status=5}if(e.actions){if(!Array.isArray(e.actions))throw TypeError(".dataform.RunResult.actions: array expected");t.actions=[];for(var r=0;r<e.actions.length;++r){if("object"!=typeof e.actions[r])throw TypeError(".dataform.RunResult.actions: object expected");t.actions[r]=l.dataform.ActionResult.fromObject(e.actions[r])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".dataform.RunResult.timing: object expected");t.timing=l.dataform.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.actions=[]),t.defaults&&(r.status=t.enums===String?"UNKNOWN":0,r.timing=null),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.RunResult.ExecutionStatus[e.status]?e.status:l.dataform.RunResult.ExecutionStatus[e.status]:e.status),e.actions&&e.actions.length){r.actions=[];for(var n=0;n<e.actions.length;++n)r.actions[n]=l.dataform.ActionResult.toObject(e.actions[n],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(r.timing=l.dataform.Timing.toObject(e.timing,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.RunResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="CANCELLED"]=4,t[e[5]="TIMED_OUT"]=5,t}(),t}(),i.ActionResult=function(){function t(e){if(this.tasks=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.status=0,t.prototype.tasks=s.emptyArray,t.prototype.timing=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(16).int32(e.status),null!=e.tasks&&e.tasks.length)for(var r=0;r<e.tasks.length;++r)l.dataform.TaskResult.encode(e.tasks[r],t.uint32(26).fork()).ldelim();return null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&l.dataform.Timing.encode(e.timing,t.uint32(34).fork()).ldelim(),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(42).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ActionResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 5:n.target=l.dataform.Target.decode(e,e.uint32());break;case 2:n.status=e.int32();break;case 3:n.tasks&&n.tasks.length||(n.tasks=[]),n.tasks.push(l.dataform.TaskResult.decode(e,e.uint32()));break;case 4:n.timing=l.dataform.Timing.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:}if(null!=e.tasks&&e.hasOwnProperty("tasks")){if(!Array.isArray(e.tasks))return"tasks: array expected";for(var t=0;t<e.tasks.length;++t){var r;if(r=l.dataform.TaskResult.verify(e.tasks[t]))return"tasks."+r}}return null!=e.timing&&e.hasOwnProperty("timing")&&(r=l.dataform.Timing.verify(e.timing))?"timing."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.ActionResult)return e;var t=new l.dataform.ActionResult;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.ActionResult.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"DISABLED":case 5:t.status=5;break;case"CANCELLED":case 6:t.status=6}if(e.tasks){if(!Array.isArray(e.tasks))throw TypeError(".dataform.ActionResult.tasks: array expected");t.tasks=[];for(var r=0;r<e.tasks.length;++r){if("object"!=typeof e.tasks[r])throw TypeError(".dataform.ActionResult.tasks: object expected");t.tasks[r]=l.dataform.TaskResult.fromObject(e.tasks[r])}}if(null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".dataform.ActionResult.timing: object expected");t.timing=l.dataform.Timing.fromObject(e.timing)}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.tasks=[]),t.defaults&&(r.status=t.enums===String?"UNKNOWN":0,r.timing=null,r.target=null),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.ActionResult.ExecutionStatus[e.status]?e.status:l.dataform.ActionResult.ExecutionStatus[e.status]:e.status),e.tasks&&e.tasks.length){r.tasks=[];for(var n=0;n<e.tasks.length;++n)r.tasks[n]=l.dataform.TaskResult.toObject(e.tasks[n],t)}return null!=e.timing&&e.hasOwnProperty("timing")&&(r.timing=l.dataform.Timing.toObject(e.timing,t)),null!=e.target&&e.hasOwnProperty("target")&&(r.target=l.dataform.Target.toObject(e.target,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ActionResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="DISABLED"]=5,t[e[6]="CANCELLED"]=6,t}(),t}(),i.ExecutionMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&l.dataform.ExecutionMetadata.BigqueryMetadata.encode(e.bigquery,t.uint32(10).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionMetadata;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.bigquery=l.dataform.ExecutionMetadata.BigqueryMetadata.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.bigquery&&e.hasOwnProperty("bigquery")){var t=l.dataform.ExecutionMetadata.BigqueryMetadata.verify(e.bigquery);if(t)return"bigquery."+t}return null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionMetadata)return e;var t=new l.dataform.ExecutionMetadata;if(null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".dataform.ExecutionMetadata.bigquery: object expected");t.bigquery=l.dataform.ExecutionMetadata.BigqueryMetadata.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.bigquery=null),null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r.bigquery=l.dataform.ExecutionMetadata.BigqueryMetadata.toObject(e.bigquery,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionMetadata"},t.BigqueryMetadata=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.jobId="",t.prototype.totalBytesProcessed=0,t.prototype.totalBytesBilled=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.jobId&&Object.hasOwnProperty.call(e,"jobId")&&t.uint32(10).string(e.jobId),null!=e.totalBytesProcessed&&Object.hasOwnProperty.call(e,"totalBytesProcessed")&&t.uint32(16).int64(e.totalBytesProcessed),null!=e.totalBytesBilled&&Object.hasOwnProperty.call(e,"totalBytesBilled")&&t.uint32(24).int64(e.totalBytesBilled),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.ExecutionMetadata.BigqueryMetadata;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.jobId=e.string();break;case 2:n.totalBytesProcessed=e.int64();break;case 3:n.totalBytesBilled=e.int64();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.jobId&&e.hasOwnProperty("jobId")&&!s.isString(e.jobId)?"jobId: string expected":null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&!(s.isInteger(e.totalBytesProcessed)||e.totalBytesProcessed&&s.isInteger(e.totalBytesProcessed.low)&&s.isInteger(e.totalBytesProcessed.high))?"totalBytesProcessed: integer|Long expected":null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&!(s.isInteger(e.totalBytesBilled)||e.totalBytesBilled&&s.isInteger(e.totalBytesBilled.low)&&s.isInteger(e.totalBytesBilled.high))?"totalBytesBilled: integer|Long expected":null},t.fromObject=function(e){if(e instanceof l.dataform.ExecutionMetadata.BigqueryMetadata)return e;var t=new l.dataform.ExecutionMetadata.BigqueryMetadata;return null!=e.jobId&&(t.jobId=String(e.jobId)),null!=e.totalBytesProcessed&&(s.Long?(t.totalBytesProcessed=s.Long.fromValue(e.totalBytesProcessed)).unsigned=!1:"string"==typeof e.totalBytesProcessed?t.totalBytesProcessed=parseInt(e.totalBytesProcessed,10):"number"==typeof e.totalBytesProcessed?t.totalBytesProcessed=e.totalBytesProcessed:"object"==typeof e.totalBytesProcessed&&(t.totalBytesProcessed=new s.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber())),null!=e.totalBytesBilled&&(s.Long?(t.totalBytesBilled=s.Long.fromValue(e.totalBytesBilled)).unsigned=!1:"string"==typeof e.totalBytesBilled?t.totalBytesBilled=parseInt(e.totalBytesBilled,10):"number"==typeof e.totalBytesBilled?t.totalBytesBilled=e.totalBytesBilled:"object"==typeof e.totalBytesBilled&&(t.totalBytesBilled=new s.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber())),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.jobId="",r.totalBytesProcessed=0,r.totalBytesBilled=0),null!=e.jobId&&e.hasOwnProperty("jobId")&&(r.jobId=e.jobId),null!=e.totalBytesProcessed&&e.hasOwnProperty("totalBytesProcessed")&&("number"==typeof e.totalBytesProcessed?r.totalBytesProcessed=t.longs===String?String(e.totalBytesProcessed):e.totalBytesProcessed:r.totalBytesProcessed=t.longs===String?s.Long.prototype.toString.call(e.totalBytesProcessed):t.longs===Number?new s.LongBits(e.totalBytesProcessed.low>>>0,e.totalBytesProcessed.high>>>0).toNumber():e.totalBytesProcessed),null!=e.totalBytesBilled&&e.hasOwnProperty("totalBytesBilled")&&("number"==typeof e.totalBytesBilled?r.totalBytesBilled=t.longs===String?String(e.totalBytesBilled):e.totalBytesBilled:r.totalBytesBilled=t.longs===String?s.Long.prototype.toString.call(e.totalBytesBilled):t.longs===Number?new s.LongBits(e.totalBytesBilled.low>>>0,e.totalBytesBilled.high>>>0).toNumber():e.totalBytesBilled),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.ExecutionMetadata.BigqueryMetadata"},t}(),t}(),i.TaskResult=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.status=0,t.prototype.errorMessage="",t.prototype.timing=null,t.prototype.metadata=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.status&&Object.hasOwnProperty.call(e,"status")&&t.uint32(8).int32(e.status),null!=e.errorMessage&&Object.hasOwnProperty.call(e,"errorMessage")&&t.uint32(18).string(e.errorMessage),null!=e.timing&&Object.hasOwnProperty.call(e,"timing")&&l.dataform.Timing.encode(e.timing,t.uint32(26).fork()).ldelim(),null!=e.metadata&&Object.hasOwnProperty.call(e,"metadata")&&l.dataform.ExecutionMetadata.encode(e.metadata,t.uint32(34).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.TaskResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.status=e.int32();break;case 2:n.errorMessage=e.string();break;case 3:n.timing=l.dataform.Timing.decode(e,e.uint32());break;case 4:n.metadata=l.dataform.ExecutionMetadata.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.status&&e.hasOwnProperty("status"))switch(e.status){default:return"status: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:}return null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&!s.isString(e.errorMessage)?"errorMessage: string expected":null!=e.timing&&e.hasOwnProperty("timing")&&(t=l.dataform.Timing.verify(e.timing))?"timing."+t:null!=e.metadata&&e.hasOwnProperty("metadata")&&(t=l.dataform.ExecutionMetadata.verify(e.metadata))?"metadata."+t:null;var t},t.fromObject=function(e){if(e instanceof l.dataform.TaskResult)return e;var t=new l.dataform.TaskResult;switch(e.status){default:if("number"==typeof e.status){t.status=e.status;break}break;case"UNKNOWN":case 0:t.status=0;break;case"RUNNING":case 1:t.status=1;break;case"SUCCESSFUL":case 2:t.status=2;break;case"FAILED":case 3:t.status=3;break;case"SKIPPED":case 4:t.status=4;break;case"CANCELLED":case 5:t.status=5}if(null!=e.errorMessage&&(t.errorMessage=String(e.errorMessage)),null!=e.timing){if("object"!=typeof e.timing)throw TypeError(".dataform.TaskResult.timing: object expected");t.timing=l.dataform.Timing.fromObject(e.timing)}if(null!=e.metadata){if("object"!=typeof e.metadata)throw TypeError(".dataform.TaskResult.metadata: object expected");t.metadata=l.dataform.ExecutionMetadata.fromObject(e.metadata)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.status=t.enums===String?"UNKNOWN":0,r.errorMessage="",r.timing=null,r.metadata=null),null!=e.status&&e.hasOwnProperty("status")&&(r.status=t.enums===String?void 0===l.dataform.TaskResult.ExecutionStatus[e.status]?e.status:l.dataform.TaskResult.ExecutionStatus[e.status]:e.status),null!=e.errorMessage&&e.hasOwnProperty("errorMessage")&&(r.errorMessage=e.errorMessage),null!=e.timing&&e.hasOwnProperty("timing")&&(r.timing=l.dataform.Timing.toObject(e.timing,t)),null!=e.metadata&&e.hasOwnProperty("metadata")&&(r.metadata=l.dataform.ExecutionMetadata.toObject(e.metadata,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TaskResult"},t.ExecutionStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="RUNNING"]=1,t[e[2]="SUCCESSFUL"]=2,t[e[3]="FAILED"]=3,t[e[4]="SKIPPED"]=4,t[e[5]="CANCELLED"]=5,t}(),t}(),i.TestResult=function(){function t(e){if(this.messages=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.name="",t.prototype.successful=!1,t.prototype.messages=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.successful&&Object.hasOwnProperty.call(e,"successful")&&t.uint32(16).bool(e.successful),null!=e.messages&&e.messages.length)for(var r=0;r<e.messages.length;++r)t.uint32(26).string(e.messages[r]);return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.TestResult;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.name=e.string();break;case 2:n.successful=e.bool();break;case 3:n.messages&&n.messages.length||(n.messages=[]),n.messages.push(e.string());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name))return"name: string expected";if(null!=e.successful&&e.hasOwnProperty("successful")&&"boolean"!=typeof e.successful)return"successful: boolean expected";if(null!=e.messages&&e.hasOwnProperty("messages")){if(!Array.isArray(e.messages))return"messages: array expected";for(var t=0;t<e.messages.length;++t)if(!s.isString(e.messages[t]))return"messages: string[] expected"}return null},t.fromObject=function(e){if(e instanceof l.dataform.TestResult)return e;var t=new l.dataform.TestResult;if(null!=e.name&&(t.name=String(e.name)),null!=e.successful&&(t.successful=Boolean(e.successful)),e.messages){if(!Array.isArray(e.messages))throw TypeError(".dataform.TestResult.messages: array expected");t.messages=[];for(var r=0;r<e.messages.length;++r)t.messages[r]=String(e.messages[r])}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.messages=[]),t.defaults&&(r.name="",r.successful=!1),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.successful&&e.hasOwnProperty("successful")&&(r.successful=e.successful),e.messages&&e.messages.length){r.messages=[];for(var n=0;n<e.messages.length;++n)r.messages[n]=e.messages[n]}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TestResult"},t}(),i.Field=function(){function t(e){if(this.flags=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}var r;return t.prototype.name="",t.prototype.flags=s.emptyArray,t.prototype.primitive=null,t.prototype.struct=null,t.prototype.description="",Object.defineProperty(t.prototype,"type",{get:s.oneOfGetter(r=["primitive","struct"]),set:s.oneOfSetter(r)}),t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.name&&Object.hasOwnProperty.call(e,"name")&&t.uint32(10).string(e.name),null!=e.struct&&Object.hasOwnProperty.call(e,"struct")&&l.dataform.Fields.encode(e.struct,t.uint32(26).fork()).ldelim(),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.flags&&e.flags.length){t.uint32(50).fork();for(var r=0;r<e.flags.length;++r)t.int32(e.flags[r]);t.ldelim()}return null!=e.primitive&&Object.hasOwnProperty.call(e,"primitive")&&t.uint32(56).int32(e.primitive),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Field;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.name=e.string();break;case 6:if(n.flags&&n.flags.length||(n.flags=[]),2==(7&i))for(var a=e.uint32()+e.pos;e.pos<a;)n.flags.push(e.int32());else n.flags.push(e.int32());break;case 7:n.primitive=e.int32();break;case 3:n.struct=l.dataform.Fields.decode(e,e.uint32());break;case 5:n.description=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t={};if(null!=e.name&&e.hasOwnProperty("name")&&!s.isString(e.name))return"name: string expected";if(null!=e.flags&&e.hasOwnProperty("flags")){if(!Array.isArray(e.flags))return"flags: array expected";for(var r=0;r<e.flags.length;++r)switch(e.flags[r]){default:return"flags: enum value[] expected";case 0:case 1:}}if(null!=e.primitive&&e.hasOwnProperty("primitive"))switch(t.type=1,e.primitive){default:return"primitive: enum value expected";case 0:case 1:case 2:case 5:case 3:case 4:case 6:case 7:case 8:case 9:case 10:case 11:case 12:}if(null!=e.struct&&e.hasOwnProperty("struct")){if(1===t.type)return"type: multiple values";t.type=1;var n=l.dataform.Fields.verify(e.struct);if(n)return"struct."+n}return null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description)?"description: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Field)return e;var t=new l.dataform.Field;if(null!=e.name&&(t.name=String(e.name)),e.flags){if(!Array.isArray(e.flags))throw TypeError(".dataform.Field.flags: array expected");t.flags=[];for(var r=0;r<e.flags.length;++r)switch(e.flags[r]){default:if("number"==typeof e.flags[r]){t.flags[r]=e.flags[r];break}case"UNKNOWN_FLAG":case 0:t.flags[r]=0;break;case"REPEATED":case 1:t.flags[r]=1}}switch(e.primitive){default:if("number"==typeof e.primitive){t.primitive=e.primitive;break}break;case"UNKNOWN":case 0:t.primitive=0;break;case"INTEGER":case 1:t.primitive=1;break;case"FLOAT":case 2:t.primitive=2;break;case"NUMERIC":case 5:t.primitive=5;break;case"BOOLEAN":case 3:t.primitive=3;break;case"STRING":case 4:t.primitive=4;break;case"DATE":case 6:t.primitive=6;break;case"DATETIME":case 7:t.primitive=7;break;case"TIMESTAMP":case 8:t.primitive=8;break;case"TIME":case 9:t.primitive=9;break;case"BYTES":case 10:t.primitive=10;break;case"ANY":case 11:t.primitive=11;break;case"GEOGRAPHY":case 12:t.primitive=12}if(null!=e.struct){if("object"!=typeof e.struct)throw TypeError(".dataform.Field.struct: object expected");t.struct=l.dataform.Fields.fromObject(e.struct)}return null!=e.description&&(t.description=String(e.description)),t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.flags=[]),t.defaults&&(r.name="",r.description=""),null!=e.name&&e.hasOwnProperty("name")&&(r.name=e.name),null!=e.struct&&e.hasOwnProperty("struct")&&(r.struct=l.dataform.Fields.toObject(e.struct,t),t.oneofs&&(r.type="struct")),null!=e.description&&e.hasOwnProperty("description")&&(r.description=e.description),e.flags&&e.flags.length){r.flags=[];for(var n=0;n<e.flags.length;++n)r.flags[n]=t.enums===String?void 0===l.dataform.Field.Flag[e.flags[n]]?e.flags[n]:l.dataform.Field.Flag[e.flags[n]]:e.flags[n]}return null!=e.primitive&&e.hasOwnProperty("primitive")&&(r.primitive=t.enums===String?void 0===l.dataform.Field.Primitive[e.primitive]?e.primitive:l.dataform.Field.Primitive[e.primitive]:e.primitive,t.oneofs&&(r.type="primitive")),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Field"},t.Primitive=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="INTEGER"]=1,t[e[2]="FLOAT"]=2,t[e[5]="NUMERIC"]=5,t[e[3]="BOOLEAN"]=3,t[e[4]="STRING"]=4,t[e[6]="DATE"]=6,t[e[7]="DATETIME"]=7,t[e[8]="TIMESTAMP"]=8,t[e[9]="TIME"]=9,t[e[10]="BYTES"]=10,t[e[11]="ANY"]=11,t[e[12]="GEOGRAPHY"]=12,t}(),t.Flag=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN_FLAG"]=0,t[e[1]="REPEATED"]=1,t}(),t}(),i.Fields=function(){function t(e){if(this.fields=[],e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.fields=s.emptyArray,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.fields&&e.fields.length)for(var r=0;r<e.fields.length;++r)l.dataform.Field.encode(e.fields[r],t.uint32(10).fork()).ldelim();return t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Fields;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.fields&&n.fields.length||(n.fields=[]),n.fields.push(l.dataform.Field.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var r=l.dataform.Field.verify(e.fields[t]);if(r)return"fields."+r}}return null},t.fromObject=function(e){if(e instanceof l.dataform.Fields)return e;var t=new l.dataform.Fields;if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".dataform.Fields.fields: array expected");t.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".dataform.Fields.fields: object expected");t.fields[r]=l.dataform.Field.fromObject(e.fields[r])}}return t},t.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.fields=[]),e.fields&&e.fields.length){r.fields=[];for(var n=0;n<e.fields.length;++n)r.fields[n]=l.dataform.Field.toObject(e.fields[n],t)}return r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Fields"},t}(),i.TableMetadata=function(){function t(e){if(this.fields=[],this.labels={},e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.target=null,t.prototype.type=0,t.prototype.fields=s.emptyArray,t.prototype.description="",t.prototype.labels=s.emptyObject,t.prototype.lastUpdatedMillis=0,t.prototype.bigquery=null,t.create=function(e){return new t(e)},t.encode=function(e,t){if(t||(t=a.create()),null!=e.target&&Object.hasOwnProperty.call(e,"target")&&l.dataform.Target.encode(e.target,t.uint32(10).fork()).ldelim(),null!=e.fields&&e.fields.length)for(var r=0;r<e.fields.length;++r)l.dataform.Field.encode(e.fields[r],t.uint32(26).fork()).ldelim();if(null!=e.lastUpdatedMillis&&Object.hasOwnProperty.call(e,"lastUpdatedMillis")&&t.uint32(32).int64(e.lastUpdatedMillis),null!=e.description&&Object.hasOwnProperty.call(e,"description")&&t.uint32(42).string(e.description),null!=e.type&&Object.hasOwnProperty.call(e,"type")&&t.uint32(48).int32(e.type),null!=e.labels&&Object.hasOwnProperty.call(e,"labels")){var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.uint32(58).fork().uint32(10).string(n[r]).uint32(18).string(e.labels[n[r]]).ldelim()}return null!=e.bigquery&&Object.hasOwnProperty.call(e,"bigquery")&&l.dataform.TableMetadata.BigQuery.encode(e.bigquery,t.uint32(66).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r,n,i=void 0===t?e.len:e.pos+t,a=new l.dataform.TableMetadata;e.pos<i;){var c=e.uint32();switch(c>>>3){case 1:a.target=l.dataform.Target.decode(e,e.uint32());break;case 6:a.type=e.int32();break;case 3:a.fields&&a.fields.length||(a.fields=[]),a.fields.push(l.dataform.Field.decode(e,e.uint32()));break;case 5:a.description=e.string();break;case 7:a.labels===s.emptyObject&&(a.labels={});var u=e.uint32()+e.pos;for(r="",n="";e.pos<u;){var p=e.uint32();switch(p>>>3){case 1:r=e.string();break;case 2:n=e.string();break;default:e.skipType(7&p)}}a.labels[r]=n;break;case 4:a.lastUpdatedMillis=e.int64();break;case 8:a.bigquery=l.dataform.TableMetadata.BigQuery.decode(e,e.uint32());break;default:e.skipType(7&c)}}return a},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(null!=e.target&&e.hasOwnProperty("target")&&(r=l.dataform.Target.verify(e.target)))return"target."+r;if(null!=e.type&&e.hasOwnProperty("type"))switch(e.type){default:return"type: enum value expected";case 0:case 1:case 2:}if(null!=e.fields&&e.hasOwnProperty("fields")){if(!Array.isArray(e.fields))return"fields: array expected";for(var t=0;t<e.fields.length;++t){var r;if(r=l.dataform.Field.verify(e.fields[t]))return"fields."+r}}if(null!=e.description&&e.hasOwnProperty("description")&&!s.isString(e.description))return"description: string expected";if(null!=e.labels&&e.hasOwnProperty("labels")){if(!s.isObject(e.labels))return"labels: object expected";var n=Object.keys(e.labels);for(t=0;t<n.length;++t)if(!s.isString(e.labels[n[t]]))return"labels: string{k:string} expected"}return null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&!(s.isInteger(e.lastUpdatedMillis)||e.lastUpdatedMillis&&s.isInteger(e.lastUpdatedMillis.low)&&s.isInteger(e.lastUpdatedMillis.high))?"lastUpdatedMillis: integer|Long expected":null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(r=l.dataform.TableMetadata.BigQuery.verify(e.bigquery))?"bigquery."+r:null},t.fromObject=function(e){if(e instanceof l.dataform.TableMetadata)return e;var t=new l.dataform.TableMetadata;if(null!=e.target){if("object"!=typeof e.target)throw TypeError(".dataform.TableMetadata.target: object expected");t.target=l.dataform.Target.fromObject(e.target)}switch(e.type){default:if("number"==typeof e.type){t.type=e.type;break}break;case"UNKNOWN":case 0:t.type=0;break;case"TABLE":case 1:t.type=1;break;case"VIEW":case 2:t.type=2}if(e.fields){if(!Array.isArray(e.fields))throw TypeError(".dataform.TableMetadata.fields: array expected");t.fields=[];for(var r=0;r<e.fields.length;++r){if("object"!=typeof e.fields[r])throw TypeError(".dataform.TableMetadata.fields: object expected");t.fields[r]=l.dataform.Field.fromObject(e.fields[r])}}if(null!=e.description&&(t.description=String(e.description)),e.labels){if("object"!=typeof e.labels)throw TypeError(".dataform.TableMetadata.labels: object expected");t.labels={};var n=Object.keys(e.labels);for(r=0;r<n.length;++r)t.labels[n[r]]=String(e.labels[n[r]])}if(null!=e.lastUpdatedMillis&&(s.Long?(t.lastUpdatedMillis=s.Long.fromValue(e.lastUpdatedMillis)).unsigned=!1:"string"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=parseInt(e.lastUpdatedMillis,10):"number"==typeof e.lastUpdatedMillis?t.lastUpdatedMillis=e.lastUpdatedMillis:"object"==typeof e.lastUpdatedMillis&&(t.lastUpdatedMillis=new s.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber())),null!=e.bigquery){if("object"!=typeof e.bigquery)throw TypeError(".dataform.TableMetadata.bigquery: object expected");t.bigquery=l.dataform.TableMetadata.BigQuery.fromObject(e.bigquery)}return t},t.toObject=function(e,t){t||(t={});var r,n={};if((t.arrays||t.defaults)&&(n.fields=[]),(t.objects||t.defaults)&&(n.labels={}),t.defaults&&(n.target=null,n.lastUpdatedMillis=0,n.description="",n.type=t.enums===String?"UNKNOWN":0,n.bigquery=null),null!=e.target&&e.hasOwnProperty("target")&&(n.target=l.dataform.Target.toObject(e.target,t)),e.fields&&e.fields.length){n.fields=[];for(var i=0;i<e.fields.length;++i)n.fields[i]=l.dataform.Field.toObject(e.fields[i],t)}if(null!=e.lastUpdatedMillis&&e.hasOwnProperty("lastUpdatedMillis")&&("number"==typeof e.lastUpdatedMillis?n.lastUpdatedMillis=t.longs===String?String(e.lastUpdatedMillis):e.lastUpdatedMillis:n.lastUpdatedMillis=t.longs===String?s.Long.prototype.toString.call(e.lastUpdatedMillis):t.longs===Number?new s.LongBits(e.lastUpdatedMillis.low>>>0,e.lastUpdatedMillis.high>>>0).toNumber():e.lastUpdatedMillis),null!=e.description&&e.hasOwnProperty("description")&&(n.description=e.description),null!=e.type&&e.hasOwnProperty("type")&&(n.type=t.enums===String?void 0===l.dataform.TableMetadata.Type[e.type]?e.type:l.dataform.TableMetadata.Type[e.type]:e.type),e.labels&&(r=Object.keys(e.labels)).length)for(n.labels={},i=0;i<r.length;++i)n.labels[r[i]]=e.labels[r[i]];return null!=e.bigquery&&e.hasOwnProperty("bigquery")&&(n.bigquery=l.dataform.TableMetadata.BigQuery.toObject(e.bigquery,t)),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TableMetadata"},t.Type=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="TABLE"]=1,t[e[2]="VIEW"]=2,t}(),t.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.hasStreamingBuffer=!1,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.hasStreamingBuffer&&Object.hasOwnProperty.call(e,"hasStreamingBuffer")&&t.uint32(8).bool(e.hasStreamingBuffer),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.TableMetadata.BigQuery;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.hasStreamingBuffer=e.bool();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&"boolean"!=typeof e.hasStreamingBuffer?"hasStreamingBuffer: boolean expected":null},t.fromObject=function(e){if(e instanceof l.dataform.TableMetadata.BigQuery)return e;var t=new l.dataform.TableMetadata.BigQuery;return null!=e.hasStreamingBuffer&&(t.hasStreamingBuffer=Boolean(e.hasStreamingBuffer)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.hasStreamingBuffer=!1),null!=e.hasStreamingBuffer&&e.hasOwnProperty("hasStreamingBuffer")&&(r.hasStreamingBuffer=e.hasStreamingBuffer),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.TableMetadata.BigQuery"},t}(),t}(),i.JDBC=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.host="",t.prototype.port=0,t.prototype.username="",t.prototype.password="",t.prototype.databaseName="",t.prototype.ssl=null,t.prototype.sshTunnel=null,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(18).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(24).int32(e.port),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(34).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(42).string(e.password),null!=e.databaseName&&Object.hasOwnProperty.call(e,"databaseName")&&t.uint32(50).string(e.databaseName),null!=e.sshTunnel&&Object.hasOwnProperty.call(e,"sshTunnel")&&l.dataform.JDBC.SshTunnel.encode(e.sshTunnel,t.uint32(58).fork()).ldelim(),null!=e.ssl&&Object.hasOwnProperty.call(e,"ssl")&&l.dataform.JDBC.SslConfiguration.encode(e.ssl,t.uint32(66).fork()).ldelim(),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.JDBC;e.pos<r;){var i=e.uint32();switch(i>>>3){case 2:n.host=e.string();break;case 3:n.port=e.int32();break;case 4:n.username=e.string();break;case 5:n.password=e.string();break;case 6:n.databaseName=e.string();break;case 8:n.ssl=l.dataform.JDBC.SslConfiguration.decode(e,e.uint32());break;case 7:n.sshTunnel=l.dataform.JDBC.SshTunnel.decode(e,e.uint32());break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!s.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.databaseName&&e.hasOwnProperty("databaseName")&&!s.isString(e.databaseName)?"databaseName: string expected":null!=e.ssl&&e.hasOwnProperty("ssl")&&(t=l.dataform.JDBC.SslConfiguration.verify(e.ssl))?"ssl."+t:null!=e.sshTunnel&&e.hasOwnProperty("sshTunnel")&&(t=l.dataform.JDBC.SshTunnel.verify(e.sshTunnel))?"sshTunnel."+t:null;var t},t.fromObject=function(e){if(e instanceof l.dataform.JDBC)return e;var t=new l.dataform.JDBC;if(null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=0|e.port),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.databaseName&&(t.databaseName=String(e.databaseName)),null!=e.ssl){if("object"!=typeof e.ssl)throw TypeError(".dataform.JDBC.ssl: object expected");t.ssl=l.dataform.JDBC.SslConfiguration.fromObject(e.ssl)}if(null!=e.sshTunnel){if("object"!=typeof e.sshTunnel)throw TypeError(".dataform.JDBC.sshTunnel: object expected");t.sshTunnel=l.dataform.JDBC.SshTunnel.fromObject(e.sshTunnel)}return t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.host="",r.port=0,r.username="",r.password="",r.databaseName="",r.sshTunnel=null,r.ssl=null),null!=e.host&&e.hasOwnProperty("host")&&(r.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=e.databaseName),null!=e.sshTunnel&&e.hasOwnProperty("sshTunnel")&&(r.sshTunnel=l.dataform.JDBC.SshTunnel.toObject(e.sshTunnel,t)),null!=e.ssl&&e.hasOwnProperty("ssl")&&(r.ssl=l.dataform.JDBC.SslConfiguration.toObject(e.ssl,t)),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.JDBC"},t.SslConfiguration=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.serverCertificate="",t.prototype.clientCertificate="",t.prototype.clientPrivateKey="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.serverCertificate&&Object.hasOwnProperty.call(e,"serverCertificate")&&t.uint32(10).string(e.serverCertificate),null!=e.clientCertificate&&Object.hasOwnProperty.call(e,"clientCertificate")&&t.uint32(18).string(e.clientCertificate),null!=e.clientPrivateKey&&Object.hasOwnProperty.call(e,"clientPrivateKey")&&t.uint32(26).string(e.clientPrivateKey),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.JDBC.SslConfiguration;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.serverCertificate=e.string();break;case 2:n.clientCertificate=e.string();break;case 3:n.clientPrivateKey=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.serverCertificate&&e.hasOwnProperty("serverCertificate")&&!s.isString(e.serverCertificate)?"serverCertificate: string expected":null!=e.clientCertificate&&e.hasOwnProperty("clientCertificate")&&!s.isString(e.clientCertificate)?"clientCertificate: string expected":null!=e.clientPrivateKey&&e.hasOwnProperty("clientPrivateKey")&&!s.isString(e.clientPrivateKey)?"clientPrivateKey: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.JDBC.SslConfiguration)return e;var t=new l.dataform.JDBC.SslConfiguration;return null!=e.serverCertificate&&(t.serverCertificate=String(e.serverCertificate)),null!=e.clientCertificate&&(t.clientCertificate=String(e.clientCertificate)),null!=e.clientPrivateKey&&(t.clientPrivateKey=String(e.clientPrivateKey)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serverCertificate="",r.clientCertificate="",r.clientPrivateKey=""),null!=e.serverCertificate&&e.hasOwnProperty("serverCertificate")&&(r.serverCertificate=e.serverCertificate),null!=e.clientCertificate&&e.hasOwnProperty("clientCertificate")&&(r.clientCertificate=e.clientCertificate),null!=e.clientPrivateKey&&e.hasOwnProperty("clientPrivateKey")&&(r.clientPrivateKey=e.clientPrivateKey),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.JDBC.SslConfiguration"},t}(),t.SshTunnel=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.privateKey="",t.prototype.username="",t.prototype.password="",t.prototype.host="",t.prototype.port=0,t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.privateKey&&Object.hasOwnProperty.call(e,"privateKey")&&t.uint32(10).string(e.privateKey),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(18).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(26).string(e.password),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(34).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(40).int32(e.port),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.JDBC.SshTunnel;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.privateKey=e.string();break;case 2:n.username=e.string();break;case 3:n.password=e.string();break;case 4:n.host=e.string();break;case 5:n.port=e.int32();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.privateKey&&e.hasOwnProperty("privateKey")&&!s.isString(e.privateKey)?"privateKey: string expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.host&&e.hasOwnProperty("host")&&!s.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null},t.fromObject=function(e){if(e instanceof l.dataform.JDBC.SshTunnel)return e;var t=new l.dataform.JDBC.SshTunnel;return null!=e.privateKey&&(t.privateKey=String(e.privateKey)),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=0|e.port),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.privateKey="",r.username="",r.password="",r.host="",r.port=0),null!=e.privateKey&&e.hasOwnProperty("privateKey")&&(r.privateKey=e.privateKey),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.host&&e.hasOwnProperty("host")&&(r.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.JDBC.SshTunnel"},t}(),t}(),i.Snowflake=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.accountId="",t.prototype.username="",t.prototype.password="",t.prototype.role="",t.prototype.databaseName="",t.prototype.warehouse="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.accountId&&Object.hasOwnProperty.call(e,"accountId")&&t.uint32(18).string(e.accountId),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(26).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(34).string(e.password),null!=e.role&&Object.hasOwnProperty.call(e,"role")&&t.uint32(42).string(e.role),null!=e.databaseName&&Object.hasOwnProperty.call(e,"databaseName")&&t.uint32(50).string(e.databaseName),null!=e.warehouse&&Object.hasOwnProperty.call(e,"warehouse")&&t.uint32(58).string(e.warehouse),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Snowflake;e.pos<r;){var i=e.uint32();switch(i>>>3){case 2:n.accountId=e.string();break;case 3:n.username=e.string();break;case 4:n.password=e.string();break;case 5:n.role=e.string();break;case 6:n.databaseName=e.string();break;case 7:n.warehouse=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.accountId&&e.hasOwnProperty("accountId")&&!s.isString(e.accountId)?"accountId: string expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.role&&e.hasOwnProperty("role")&&!s.isString(e.role)?"role: string expected":null!=e.databaseName&&e.hasOwnProperty("databaseName")&&!s.isString(e.databaseName)?"databaseName: string expected":null!=e.warehouse&&e.hasOwnProperty("warehouse")&&!s.isString(e.warehouse)?"warehouse: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Snowflake)return e;var t=new l.dataform.Snowflake;return null!=e.accountId&&(t.accountId=String(e.accountId)),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.role&&(t.role=String(e.role)),null!=e.databaseName&&(t.databaseName=String(e.databaseName)),null!=e.warehouse&&(t.warehouse=String(e.warehouse)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.accountId="",r.username="",r.password="",r.role="",r.databaseName="",r.warehouse=""),null!=e.accountId&&e.hasOwnProperty("accountId")&&(r.accountId=e.accountId),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.role&&e.hasOwnProperty("role")&&(r.role=e.role),null!=e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=e.databaseName),null!=e.warehouse&&e.hasOwnProperty("warehouse")&&(r.warehouse=e.warehouse),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Snowflake"},t}(),i.BigQuery=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectId="",t.prototype.credentials="",t.prototype.location="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.projectId&&Object.hasOwnProperty.call(e,"projectId")&&t.uint32(10).string(e.projectId),null!=e.credentials&&Object.hasOwnProperty.call(e,"credentials")&&t.uint32(26).string(e.credentials),null!=e.location&&Object.hasOwnProperty.call(e,"location")&&t.uint32(34).string(e.location),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.BigQuery;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectId=e.string();break;case 3:n.credentials=e.string();break;case 4:n.location=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectId&&e.hasOwnProperty("projectId")&&!s.isString(e.projectId)?"projectId: string expected":null!=e.credentials&&e.hasOwnProperty("credentials")&&!s.isString(e.credentials)?"credentials: string expected":null!=e.location&&e.hasOwnProperty("location")&&!s.isString(e.location)?"location: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.BigQuery)return e;var t=new l.dataform.BigQuery;return null!=e.projectId&&(t.projectId=String(e.projectId)),null!=e.credentials&&(t.credentials=String(e.credentials)),null!=e.location&&(t.location=String(e.location)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.projectId="",r.credentials="",r.location=""),null!=e.projectId&&e.hasOwnProperty("projectId")&&(r.projectId=e.projectId),null!=e.credentials&&e.hasOwnProperty("credentials")&&(r.credentials=e.credentials),null!=e.location&&e.hasOwnProperty("location")&&(r.location=e.location),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.BigQuery"},t}(),i.SQLDataWarehouse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.server="",t.prototype.port=0,t.prototype.username="",t.prototype.password="",t.prototype.database="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.server&&Object.hasOwnProperty.call(e,"server")&&t.uint32(10).string(e.server),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).int32(e.port),null!=e.username&&Object.hasOwnProperty.call(e,"username")&&t.uint32(26).string(e.username),null!=e.password&&Object.hasOwnProperty.call(e,"password")&&t.uint32(34).string(e.password),null!=e.database&&Object.hasOwnProperty.call(e,"database")&&t.uint32(42).string(e.database),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.SQLDataWarehouse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.server=e.string();break;case 2:n.port=e.int32();break;case 3:n.username=e.string();break;case 4:n.password=e.string();break;case 5:n.database=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.server&&e.hasOwnProperty("server")&&!s.isString(e.server)?"server: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null!=e.username&&e.hasOwnProperty("username")&&!s.isString(e.username)?"username: string expected":null!=e.password&&e.hasOwnProperty("password")&&!s.isString(e.password)?"password: string expected":null!=e.database&&e.hasOwnProperty("database")&&!s.isString(e.database)?"database: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.SQLDataWarehouse)return e;var t=new l.dataform.SQLDataWarehouse;return null!=e.server&&(t.server=String(e.server)),null!=e.port&&(t.port=0|e.port),null!=e.username&&(t.username=String(e.username)),null!=e.password&&(t.password=String(e.password)),null!=e.database&&(t.database=String(e.database)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.server="",r.port=0,r.username="",r.password="",r.database=""),null!=e.server&&e.hasOwnProperty("server")&&(r.server=e.server),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),null!=e.username&&e.hasOwnProperty("username")&&(r.username=e.username),null!=e.password&&e.hasOwnProperty("password")&&(r.password=e.password),null!=e.database&&e.hasOwnProperty("database")&&(r.database=e.database),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.SQLDataWarehouse"},t}(),i.Presto=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.host="",t.prototype.port=0,t.prototype.user="",t.prototype.catalog="",t.prototype.schema="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.host&&Object.hasOwnProperty.call(e,"host")&&t.uint32(10).string(e.host),null!=e.port&&Object.hasOwnProperty.call(e,"port")&&t.uint32(16).int32(e.port),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(26).string(e.user),null!=e.catalog&&Object.hasOwnProperty.call(e,"catalog")&&t.uint32(34).string(e.catalog),null!=e.schema&&Object.hasOwnProperty.call(e,"schema")&&t.uint32(42).string(e.schema),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.Presto;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.host=e.string();break;case 2:n.port=e.int32();break;case 3:n.user=e.string();break;case 4:n.catalog=e.string();break;case 5:n.schema=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.host&&e.hasOwnProperty("host")&&!s.isString(e.host)?"host: string expected":null!=e.port&&e.hasOwnProperty("port")&&!s.isInteger(e.port)?"port: integer expected":null!=e.user&&e.hasOwnProperty("user")&&!s.isString(e.user)?"user: string expected":null!=e.catalog&&e.hasOwnProperty("catalog")&&!s.isString(e.catalog)?"catalog: string expected":null!=e.schema&&e.hasOwnProperty("schema")&&!s.isString(e.schema)?"schema: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.Presto)return e;var t=new l.dataform.Presto;return null!=e.host&&(t.host=String(e.host)),null!=e.port&&(t.port=0|e.port),null!=e.user&&(t.user=String(e.user)),null!=e.catalog&&(t.catalog=String(e.catalog)),null!=e.schema&&(t.schema=String(e.schema)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.host="",r.port=0,r.user="",r.catalog="",r.schema=""),null!=e.host&&e.hasOwnProperty("host")&&(r.host=e.host),null!=e.port&&e.hasOwnProperty("port")&&(r.port=e.port),null!=e.user&&e.hasOwnProperty("user")&&(r.user=e.user),null!=e.catalog&&e.hasOwnProperty("catalog")&&(r.catalog=e.catalog),null!=e.schema&&e.hasOwnProperty("schema")&&(r.schema=e.schema),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.Presto"},t}(),i.server=((n={}).Empty=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.server.Empty;e.pos<r;){var i=e.uint32();e.skipType(7&i)}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null},t.fromObject=function(e){return e instanceof l.dataform.server.Empty?e:new l.dataform.server.Empty},t.toObject=function(){return{}},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.server.Empty"},t}(),n.MetadataResponse=function(){function t(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return t.prototype.projectDir="",t.create=function(e){return new t(e)},t.encode=function(e,t){return t||(t=a.create()),null!=e.projectDir&&Object.hasOwnProperty.call(e,"projectDir")&&t.uint32(10).string(e.projectDir),t},t.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},t.decode=function(e,t){e instanceof o||(e=o.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new l.dataform.server.MetadataResponse;e.pos<r;){var i=e.uint32();switch(i>>>3){case 1:n.projectDir=e.string();break;default:e.skipType(7&i)}}return n},t.decodeDelimited=function(e){return e instanceof o||(e=new o(e)),this.decode(e,e.uint32())},t.verify=function(e){return"object"!=typeof e||null===e?"object expected":null!=e.projectDir&&e.hasOwnProperty("projectDir")&&!s.isString(e.projectDir)?"projectDir: string expected":null},t.fromObject=function(e){if(e instanceof l.dataform.server.MetadataResponse)return e;var t=new l.dataform.server.MetadataResponse;return null!=e.projectDir&&(t.projectDir=String(e.projectDir)),t},t.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.projectDir=""),null!=e.projectDir&&e.hasOwnProperty("projectDir")&&(r.projectDir=e.projectDir),r},t.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},t.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/dataform.server.MetadataResponse"},t}(),n.Service=function(){function t(t,r,n){e.rpc.Service.call(this,t,r,n)}return(t.prototype=Object.create(e.rpc.Service.prototype)).constructor=t,t.create=function(e,t,r){return new this(e,t,r)},Object.defineProperty(t.prototype.metadata=function e(t,r){return this.rpcCall(e,l.dataform.server.Empty,l.dataform.server.MetadataResponse,t,r)},"name",{value:"Metadata"}),t}(),n),i),l})?n.apply(t,i):n)||(e.exports=o)},function(e,t,r){"use strict";var n,i,o=e.exports=r(7),a=r(50);o.codegen=r(114),o.fetch=r(115),o.path=r(116),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var s=/\\/g,l=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(s,"\\\\").replace(l,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var c=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(c,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;n||(n=r(33));var i=new n(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var u=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=r(6));var t=new i("Enum"+u++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var i=r.shift();if("__proto__"===i||"prototype"===i)return t;if(r.length>0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(38)))}})},function(e,t,r){const n=r(18),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(17),{safeRe:a,t:s}=r(14),l=r(22),{compareIdentifiers:c}=r(42);class u{constructor(e,t){if(t=l(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[s.LOOSE]:a[s.FULL]);if(!r)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof u)){if("string"==typeof e&&e===this.version)return 0;e=new u(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof u||(e=new u(e,this.options)),c(this.major,e.major)||c(this.minor,e.minor)||c(this.patch,e.patch)}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return c(r,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return c(r,i)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error("invalid increment argument: "+e)}return this.raw=this.format(),this.build.length&&(this.raw+="+"+this.build.join(".")),this}}e.exports=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);function i(e){return e.split(t.pathSeperator).slice(-1)[0].split(".")[0]}t.pathSeperator="undefined"!=typeof process&&"win32"===process.platform?"\\":"/",t.baseFilename=i,t.getEscapedFileName=function(e){return i(e).replace(/\\/g,"\\\\")},t.matchPatterns=function(e,t){const r=[];return e.forEach(e=>{if(e.includes("."))t.includes(e)&&r.push(e);else{const n=t.filter(t=>e===t.split(".").slice(-1)[0]);if(0===n.length)return;if(n.length>1)throw new Error(s(e,n));r.push(n[0])}}),r},t.getCallerFile=function(e){let r;const n=function(){const e=Error.stackTraceLimit,t=Error.prepareStackTrace;try{return Error.stackTraceLimit=Number.POSITIVE_INFINITY,Error.prepareStackTrace=(e,t)=>t,(new Error).stack}finally{Error.stackTraceLimit=e,Error.prepareStackTrace=t}}();for(;n.length;){const i=n.shift().getFileName();if(i&&(i.includes(e)&&!i.includes("node_modules")&&(r=i,i.includes("definitions"+t.pathSeperator)||i.includes("models"+t.pathSeperator))))break}if(!r)throw new Error("Unable to find valid caller file; please report this issue.");return function(e,r){if(0===r.length)return e;const n=e.substr(r.length);return n.startsWith(t.pathSeperator)?n.substr(1):n}(r,e)},t.graphHasErrors=function(e){var t;return(null===(t=e.graphErrors)||void 0===t?void 0:t.compilationErrors.length)>0};const o="Invalid input. Accepted inputs include: a single object containing an (optional) 'database', (optional) 'schema', and 'name', or 1-3 inputs consisting of an (optional) database, (optional) schema, and 'name'.";function a(e){return"string"==typeof e?e:JSON.stringify(e)}function s(e,t){const r="string"==typeof t[0]?t:t.map(e=>`${e.proto.target.schema}.${e.proto.target.name}`);return`Ambiguous Action name: ${a(e)}. Did you mean one of: ${r.join(", ")}.`}function l(e,t,r,i,o){return i=i||t.defaultSchema,o=o||t.defaultDatabase,n.dataform.Target.create({name:e.normalizeIdentifier(r),schema:i?e.normalizeIdentifier(i||t.defaultSchema):void 0,database:o?e.normalizeIdentifier(o):void 0})}function c(e,t){switch(e){case"table":return n.dataform.TableType.TABLE;case"incremental":return n.dataform.TableType.INCREMENTAL;case"view":return n.dataform.TableType.VIEW;case"inline":return n.dataform.TableType.INLINE;default:if(t)throw new Error("Unexpected table type: "+e);return n.dataform.TableType.UNKNOWN_TYPE}}function u(e){return n.dataform.TableType[e].toLowerCase()}t.toResolvable=function(e,t=[]){if(Array.isArray(e)&&t.length>0)throw new Error(o);if(0===t.length&&!Array.isArray(e))return e;const r=Array.isArray(e)?e.reverse():[e,...t].reverse();if(!function(e){if(e.some(e=>"string"!=typeof e))return!1;return e.length>0&&e.length<=3}(r))throw new Error(o);const[n,i,a]=r;return{database:a,schema:i,name:n}},t.resolvableAsTarget=function(e){return"string"==typeof e?{name:e}:e},t.stringifyResolvable=a,t.ambiguousActionNameMsg=s,t.target=l,t.setNameAndTarget=function(e,t,r,n,i){t.target=l(e.adapter(),e.config,r,n,i),t.canonicalTarget=l(e.adapter(),e.canonicalConfig,r,n,i)},t.strictKeysOf=function(){return e=>e},t.checkExcessProperties=function(e,t,r,n){const i=Object.keys(t).filter(e=>!r.includes(e));i.length>0&&e(new Error(`Unexpected property "${i[0]}"${n?" in "+n:""}. Supported properties are: ${JSON.stringify(r)}`))},t.validateQueryString=function(e,t,r){";"===(null==t?void 0:t.trim().slice(-1))&&e.compileError(new Error("Semi-colons are not allowed at the end of SQL statements."),r)},t.throwIfInvalid=function(e,t){const r=t(e);if(r)throw new Error(r)},t.tableTypeStringToEnum=c,t.tableTypeEnumToString=u,t.setOrValidateTableEnumType=function(e){let t=null;if(""!==e.type&&void 0!==e.type&&(t=c(e.type,!0)),e.enumType===n.dataform.TableType.UNKNOWN_TYPE||void 0===e.enumType)e.enumType=t;else if(null!==t&&e.enumType!==t)throw new Error(`Table str type "${e.type}" and enumType "${u(e.enumType)}" are not equivalent.`)}},function(e,t,r){const n=r(2);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},function(e,t,r){class n{constructor(e,t){if(t=o(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(e=>this.parseRange(e)).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!m(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&g(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&h)|(this.options.loose&&y))+":"+e,r=i.get(t);if(r)return r;const n=this.options.loose,o=n?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(o,x(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],p),s("comparator trim",e);let l=(e=(e=e.replace(c[u.TILDETRIM],f)).replace(c[u.CARETTRIM],d)).split(" ").map(e=>O(e,this.options)).join(" ").split(/\s+/).map(e=>k(e,this.options));n&&(l=l.filter(e=>(s("loose invalid filter",e,this.options),!!e.match(c[u.COMPARATORLOOSE])))),s("range list",l);const g=new Map,b=l.map(e=>new a(e,this.options));for(const e of b){if(m(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const v=[...g.values()];return i.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some(r=>b(r,t)&&e.set.some(e=>b(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(N(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const i=new(r(79))({max:1e3}),o=r(22),a=r(20),s=r(18),l=r(2),{safeRe:c,t:u,comparatorTrimReplace:p,tildeTrimReplace:f,caretTrimReplace:d}=r(14),{FLAG_INCLUDE_PRERELEASE:h,FLAG_LOOSE:y}=r(17),m=e=>"<0.0.0-0"===e.value,g=e=>""===e.value,b=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},O=(e,t)=>(s("comp",e,t),e=E(e,t),s("caret",e),e=T(e,t),s("tildes",e),e=j(e,t),s("xrange",e),e=A(e,t),s("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,T=(e,t)=>e.trim().split(/\s+/).map(e=>w(e,t)).join(" "),w=(e,t)=>{const r=t.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(r,(t,r,n,i,o)=>{let a;return s("tilde",e,t,r,n,i,o),v(r)?a="":v(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:v(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(s("replaceTilde pr",o),a=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,s("tilde return",a),a})},E=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{s("caret",e,t);const r=t.loose?c[u.CARETLOOSE]:c[u.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,a)=>{let l;return s("caret",e,t,r,i,o,a),v(r)?l="":v(i)?l=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(o)?l="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(s("replaceCaret pr",a),l="0"===r?"0"===i?`>=${r}.${i}.${o}-${a} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${a} <${+r+1}.0.0-0`):(s("no pr"),l="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),s("caret return",l),l})},j=(e,t)=>(s("replaceXRanges",e,t),e.split(/\s+/).map(e=>P(e,t)).join(" ")),P=(e,t)=>{e=e.trim();const r=t.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(r,(r,n,i,o,a,l)=>{s("xRange",e,r,n,i,o,a,l);const c=v(i),u=c||v(o),p=u||v(a),f=p;return"="===n&&f&&(n=""),l=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(u&&(o=0),a=0,">"===n?(n=">=",u?(i=+i+1,o=0,a=0):(o=+o+1,a=0)):"<="===n&&(n="<",u?i=+i+1:o=+o+1),"<"===n&&(l="-0"),r=`${n+i}.${o}.${a}${l}`):u?r=`>=${i}.0.0${l} <${+i+1}.0.0-0`:p&&(r=`>=${i}.${o}.0${l} <${i}.${+o+1}.0-0`),s("xRange return",r),r})},A=(e,t)=>(s("replaceStars",e,t),e.trim().replace(c[u.STAR],"")),k=(e,t)=>(s("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?u.GTE0PRE:u.GTE0],"")),x=e=>(t,r,n,i,o,a,s,l,c,u,p,f,d)=>`${r=v(n)?"":v(i)?`>=${n}.0.0${e?"-0":""}`:v(o)?`>=${n}.${i}.0${e?"-0":""}`:a?">="+r:`>=${r}${e?"-0":""}`} ${l=v(c)?"":v(u)?`<${+c+1}.0.0-0`:v(p)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${p}-${f}`:e?`<${c}.${u}.${+p+1}-0`:"<="+l}`.trim(),N=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(s(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},function(e,t,r){"use strict";e.exports=a;var n=r(11);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var i=r(15),o=r(1);function a(e,t,r,i,o,a){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.valuesOptions=a,this.reserved=void 0,t)for(var s=Object.keys(t),l=0;l<s.length;++l)"number"==typeof t[s[l]]&&(this.valuesById[this.values[s[l]]=t[s[l]]]=s[l])}a.fromJSON=function(e,t){var r=new a(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},a.prototype.add=function(e,t,r,n){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return n&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=r||null,this},a.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=r(47),n.base64=r(93),n.EventEmitter=r(94),n.float=r(95),n.inquire=r(48),n.utf8=r(96),n.pool=r(97),n.LongBits=r(98),n.isNode=Boolean("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),n.global=n.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(0);function i(e,t){return e.filter(e=>!!e).map(e=>e.trim()).map(e=>e.length>0&&";"===e.charAt(e.length-1)?e.substring(0,e.length-1):e).map(e=>t?t(e):e).join("\n;\n")}t.concatenateQueries=i;class o{constructor(){this.tasks=[]}static create(){return new o}add(e){return this.tasks.push(e),this}addAll(e){return this.tasks=this.tasks.concat(e.tasks),this}build(){return this.tasks.map(e=>e.build())}concatenate(){return o.create().add(a.statement(i(this.tasks.map(e=>e.getStatement()))))}}t.Tasks=o;class a{constructor(){this.proto=n.dataform.ExecutionTask.create()}static create(){return new a}static statement(e){return a.create().type("statement").statement(e)}static assertion(e){return a.create().type("assertion").statement(e)}type(e){return this.proto.type=e,this}statement(e){return this.proto.statement=e,this}getStatement(){return this.proto.statement}build(){return n.dataform.ExecutionTask.create(this.proto)}}t.Task=a},function(e,t,r){"use strict";e.exports=c;var n=r(11);((c.prototype=Object.create(n.prototype)).constructor=c).className="Field";var i,o=r(6),a=r(12),s=r(1),l=/^required|optional|repeated$/;function c(e,t,r,i,o,c,u){if(s.isObject(i)?(u=o,c=i,i=o=void 0):s.isObject(o)&&(u=c,c=o,o=void 0),n.call(this,e,c),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!l.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!s.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=u}c.fromJSON=function(e,t){return new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(c.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),c.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},c.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(i,o){s.decorateType(i.constructor).add(new c(o,e,t,r,{default:n}))}},c._configure=function(e){i=e}},function(e,t,r){const n=r(2);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},function(e,t,r){"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(1);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var a=o[e];i.setProperty(a,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var s={};s[e]=t,n.push(s)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},o.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},o._configure=function(e){n=e}},function(e,t,r){"use strict";var n=t,i=r(1),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}n.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),n.long=a([0,0,0,1,1],7),n.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(41)),o=r(8),a=r(3),s=r(0);t.Adapter=class{constructor(e){this.dataformCoreVersion=e}normalizeIdentifier(e){return e}sqlString(e){return`'${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}dropIfExists(e,t){return`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)} ${t===s.dataform.TableMetadata.Type.TABLE?"cascade":""}`}baseTableType(e){switch(e){case s.dataform.TableType.TABLE:case s.dataform.TableType.INCREMENTAL:return s.dataform.TableMetadata.Type.TABLE;case s.dataform.TableType.VIEW:return s.dataform.TableMetadata.Type.VIEW;default:throw new Error("Unexpected table type: "+a.tableTypeEnumToString(e))}}tableTypeAsSql(e){switch(e){case s.dataform.TableMetadata.Type.TABLE:return"table";case s.dataform.TableMetadata.Type.VIEW:return"view";default:throw new Error("Unexpected table type: "+e)}}indexAssertion(e,t){const r=t.join(", ");return`\nSELECT\n *\nFROM (\n SELECT\n ${r},\n COUNT(1) AS index_row_count\n FROM ${e}\n GROUP BY ${r}\n ) AS data\nWHERE index_row_count > 1\n`}rowConditionsAssertion(e,t){return t.map(t=>`\nSELECT\n ${this.sqlString(t)} AS failing_row_condition,\n *\nFROM ${e}\nWHERE NOT (${t})\n`).join("UNION ALL")}insertInto(e,t,r){return`\t\ninsert into ${this.resolveTarget(e)}\t\n(${t.join(",")})\t\nselect ${t.join(",")}\t\nfrom (${r}) as insertions`}oppositeTableType(e){switch(e){case s.dataform.TableMetadata.Type.TABLE:return s.dataform.TableMetadata.Type.VIEW;case s.dataform.TableMetadata.Type.VIEW:return s.dataform.TableMetadata.Type.TABLE;default:throw new Error("Unexpected table type: "+e)}}where(e,t){return t?`\n select * from (${e}) as subquery\n where ${t}`:e}shouldWriteIncrementally(e,t){return!e.fullRefresh&&t&&t.type!==s.dataform.TableMetadata.Type.VIEW}preOps(e,t,r){let n=e.preOps;return i.gt(this.dataformCoreVersion,"1.4.8")&&e.enumType===s.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)&&(n=e.incrementalPreOps),(n||[]).map(e=>o.Task.statement(e))}postOps(e,t,r){let n=e.postOps;return i.gt(this.dataformCoreVersion,"1.4.8")&&e.enumType===s.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)&&(n=e.incrementalPostOps),(n||[]).map(e=>o.Task.statement(e))}}},function(e,t,r){const{MAX_SAFE_COMPONENT_LENGTH:n}=r(17),i=r(18),o=(t=e.exports={}).re=[],a=t.safeRe=[],s=t.src=[],l=t.t={};let c=0;const u=(e,t,r)=>{const n=t.split("\\s*").join("\\s{0,1}").split("\\s+").join("\\s"),u=c++;i(e,u,t),l[e]=u,s[u]=t,o[u]=new RegExp(t,r?"g":void 0),a[u]=new RegExp(n,r?"g":void 0)};u("NUMERICIDENTIFIER","0|[1-9]\\d*"),u("NUMERICIDENTIFIERLOOSE","[0-9]+"),u("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),u("MAINVERSION",`(${s[l.NUMERICIDENTIFIER]})\\.(${s[l.NUMERICIDENTIFIER]})\\.(${s[l.NUMERICIDENTIFIER]})`),u("MAINVERSIONLOOSE",`(${s[l.NUMERICIDENTIFIERLOOSE]})\\.(${s[l.NUMERICIDENTIFIERLOOSE]})\\.(${s[l.NUMERICIDENTIFIERLOOSE]})`),u("PRERELEASEIDENTIFIER",`(?:${s[l.NUMERICIDENTIFIER]}|${s[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASEIDENTIFIERLOOSE",`(?:${s[l.NUMERICIDENTIFIERLOOSE]}|${s[l.NONNUMERICIDENTIFIER]})`),u("PRERELEASE",`(?:-(${s[l.PRERELEASEIDENTIFIER]}(?:\\.${s[l.PRERELEASEIDENTIFIER]})*))`),u("PRERELEASELOOSE",`(?:-?(${s[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[l.PRERELEASEIDENTIFIERLOOSE]})*))`),u("BUILDIDENTIFIER","[0-9A-Za-z-]+"),u("BUILD",`(?:\\+(${s[l.BUILDIDENTIFIER]}(?:\\.${s[l.BUILDIDENTIFIER]})*))`),u("FULLPLAIN",`v?${s[l.MAINVERSION]}${s[l.PRERELEASE]}?${s[l.BUILD]}?`),u("FULL",`^${s[l.FULLPLAIN]}$`),u("LOOSEPLAIN",`[v=\\s]*${s[l.MAINVERSIONLOOSE]}${s[l.PRERELEASELOOSE]}?${s[l.BUILD]}?`),u("LOOSE",`^${s[l.LOOSEPLAIN]}$`),u("GTLT","((?:<|>)?=?)"),u("XRANGEIDENTIFIERLOOSE",s[l.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*"),u("XRANGEIDENTIFIER",s[l.NUMERICIDENTIFIER]+"|x|X|\\*"),u("XRANGEPLAIN",`[v=\\s]*(${s[l.XRANGEIDENTIFIER]})(?:\\.(${s[l.XRANGEIDENTIFIER]})(?:\\.(${s[l.XRANGEIDENTIFIER]})(?:${s[l.PRERELEASE]})?${s[l.BUILD]}?)?)?`),u("XRANGEPLAINLOOSE",`[v=\\s]*(${s[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[l.XRANGEIDENTIFIERLOOSE]})(?:${s[l.PRERELEASELOOSE]})?${s[l.BUILD]}?)?)?`),u("XRANGE",`^${s[l.GTLT]}\\s*${s[l.XRANGEPLAIN]}$`),u("XRANGELOOSE",`^${s[l.GTLT]}\\s*${s[l.XRANGEPLAINLOOSE]}$`),u("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),u("COERCERTL",s[l.COERCE],!0),u("LONETILDE","(?:~>?)"),u("TILDETRIM",`(\\s*)${s[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",u("TILDE",`^${s[l.LONETILDE]}${s[l.XRANGEPLAIN]}$`),u("TILDELOOSE",`^${s[l.LONETILDE]}${s[l.XRANGEPLAINLOOSE]}$`),u("LONECARET","(?:\\^)"),u("CARETTRIM",`(\\s*)${s[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",u("CARET",`^${s[l.LONECARET]}${s[l.XRANGEPLAIN]}$`),u("CARETLOOSE",`^${s[l.LONECARET]}${s[l.XRANGEPLAINLOOSE]}$`),u("COMPARATORLOOSE",`^${s[l.GTLT]}\\s*(${s[l.LOOSEPLAIN]})$|^$`),u("COMPARATOR",`^${s[l.GTLT]}\\s*(${s[l.FULLPLAIN]})$|^$`),u("COMPARATORTRIM",`(\\s*)${s[l.GTLT]}\\s*(${s[l.LOOSEPLAIN]}|${s[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",u("HYPHENRANGE",`^\\s*(${s[l.XRANGEPLAIN]})\\s+-\\s+(${s[l.XRANGEPLAIN]})\\s*$`),u("HYPHENRANGELOOSE",`^\\s*(${s[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[l.XRANGEPLAINLOOSE]})\\s*$`),u("STAR","(<|>)?=?\\s*\\*"),u("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),u("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},function(e,t,r){"use strict";e.exports=p;var n=r(11);((p.prototype=Object.create(n.prototype)).constructor=p).className="Namespace";var i,o,a,s=r(9),l=r(1),c=r(16);function u(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function p(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function f(e){return e._nestedArray=null,e}p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=u,p.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},p.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=l.toArray(this.nested))}}),p.prototype.toJSON=function(e){return l.toObject(["options",this.options,"nested",u(this.nestedArray,e)])},p.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?s.fromJSON:p.fromJSON)(r[n],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof i||e instanceof c||e instanceof a||e instanceof o||e instanceof p))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof p&&e instanceof p)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),f(this)},p.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),f(this)},p.prototype.define=function(e,t){if(l.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof p))throw Error("path conflicts with non-namespace objects")}else r.add(r=new p(n))}return t&&r.addJSON(t),r},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this.resolve()},p.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),l.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof p&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof p&&(n=this._nestedArray[i].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},p.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},p.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._configure=function(e,t,r){i=e,o=t,a=r}},function(e,t,r){"use strict";e.exports=a;var n=r(11);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var i=r(9),o=r(1);function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},function(e,t){const r=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},function(e,t){const r="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=r},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)>0},function(e,t,r){const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR],r=e.match(t);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new p(e.value,t).test(this.value):""===e.operator?""===e.value||new p(this.value,t).test(e.semver):(!(t=o(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=i;const o=r(22),{safeRe:a,t:s}=r(14),l=r(45),c=r(18),u=r(2),p=r(5)},function(e,t,r){const n=r(5);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},function(e,t){const r=Object.freeze({loose:!0}),n=Object.freeze({});e.exports=e=>e?"object"!=typeof e?r:e:n},function(e,t,r){const n=r(2);e.exports=(e,t,r)=>{const i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)}},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)<0},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)>=0},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(e,t,r)<=0},function(e,t,r){const n=r(2),i=r(20),{ANY:o}=i,a=r(5),s=r(21),l=r(19),c=r(24),u=r(26),p=r(25);e.exports=(e,t,r,f)=>{let d,h,y,m,g;switch(e=new n(e,f),t=new a(t,f),r){case">":d=l,h=u,y=c,m=">",g=">=";break;case"<":d=c,h=p,y=l,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,f))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let a=null,s=null;if(n.forEach(e=>{e.semver===o&&(e=new i(">=0.0.0")),a=a||e,s=s||e,d(e.semver,a.semver,f)?a=e:y(e.semver,s.semver,f)&&(s=e)}),a.operator===m||a.operator===g)return!1;if((!s.operator||s.operator===m)&&h(e,s.semver))return!1;if(s.operator===g&&y(e,s.semver))return!1}return!0}},function(e,t,r){"use strict";e.exports=p;var n,i=r(7),o=i.LongBits,a=i.base64,s=i.utf8;function l(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function p(){this.len=0,this.head=new l(c,0,0),this.tail=this.head,this.states=null}var f=function(){return i.Buffer?function(){return(p.create=function(){return new n})()}:function(){return new p}};function d(e,t,r){t[r]=255&e}function h(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function m(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}p.create=f(),p.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(p.alloc=i.pool(p.alloc,i.Array.prototype.subarray)),p.prototype._push=function(e,t,r){return this.tail=this.tail.next=new l(e,t,r),this.len+=t,this},h.prototype=Object.create(l.prototype),h.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},p.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new h((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},p.prototype.int32=function(e){return e<0?this._push(y,10,o.fromNumber(e)):this.uint32(e)},p.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},p.prototype.uint64=function(e){var t=o.from(e);return this._push(y,t.length(),t)},p.prototype.int64=p.prototype.uint64,p.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(y,t.length(),t)},p.prototype.bool=function(e){return this._push(d,1,e?1:0)},p.prototype.fixed32=function(e){return this._push(m,4,e>>>0)},p.prototype.sfixed32=p.prototype.fixed32,p.prototype.fixed64=function(e){var t=o.from(e);return this._push(m,4,t.lo)._push(m,4,t.hi)},p.prototype.sfixed64=p.prototype.fixed64,p.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},p.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var g=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};p.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=p.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},p.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},p.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new l(c,0,0),this.len=0,this},p.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(c,0,0),this.len=0),this},p.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},p.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},p._configure=function(e){n=e,p.create=f(),n._configure()}},function(e,t,r){"use strict";e.exports=l;var n,i=r(7),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var c,u="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},p=function(){return i.Buffer?function(e){return(l.create=function(e){return i.Buffer.isBuffer(e)?new n(e):u(e)})(e)}:u};function f(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function d(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new o(d(this.buf,this.pos+=4),d(this.buf,this.pos+=4))}l.create=p(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=(c=4294967295,function(){if(c=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return c;if(c=(c|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return c;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return c}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return d(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|d(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},l.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){n=e,l.create=p(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return h.call(this)[t](!0)},sfixed64:function(){return h.call(this)[t](!1)}})}},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(107),o=n(r(3)),a=r(0);class s{static mapToColumnProtoArray(e,t){return Object.keys(e).map(r=>s.mapColumnDescriptionToProto([r],e[r],t)).flat()}static mapColumnDescriptionToProto(e,t,r){if("string"==typeof t)return[a.dataform.ColumnDescriptor.create({description:t,path:e})];o.checkExcessProperties(r,t,i.IRecordDescriptorProperties(),e.join(".")+" column descriptor");const n=t?[a.dataform.ColumnDescriptor.create({path:e,description:t.description,displayName:t.displayName,dimensionType:s.mapDimensionType(t.dimension),aggregation:s.mapAggregation(t.aggregator),expression:t.expression,tags:"string"==typeof t.tags?[t.tags]:t.tags,bigqueryPolicyTags:"string"==typeof t.bigqueryPolicyTags?[t.bigqueryPolicyTags]:t.bigqueryPolicyTags})]:[],l=t.columns?Object.keys(t.columns):[];return n.concat(l.map(n=>s.mapColumnDescriptionToProto(e.concat([n]),t.columns[n],r)).flat())}static mapAggregation(e){switch(e){case"sum":return a.dataform.ColumnDescriptor.Aggregation.SUM;case"distinct":return a.dataform.ColumnDescriptor.Aggregation.DISTINCT;case"derived":return a.dataform.ColumnDescriptor.Aggregation.DERIVED;case void 0:return;default:throw new Error(`'${e}' is not a valid aggregation option.`)}}static mapFromAggregation(e){switch(e){case a.dataform.ColumnDescriptor.Aggregation.SUM:return"sum";case a.dataform.ColumnDescriptor.Aggregation.DISTINCT:return"distinct";case a.dataform.ColumnDescriptor.Aggregation.DERIVED:return"derived";case a.dataform.ColumnDescriptor.Aggregation.UNKNOWN_AGGREGATION:case void 0:return;default:throw new Error("Aggregation type not recognized: "+e)}}static mapDimensionType(e){switch(e){case"category":return a.dataform.ColumnDescriptor.DimensionType.CATEGORY;case"timestamp":return a.dataform.ColumnDescriptor.DimensionType.TIMESTAMP;case"number":return a.dataform.ColumnDescriptor.DimensionType.NUMBER;case void 0:return;default:throw new Error(`'${e}' is not a valid dimension type.`)}}static mapFromDimensionType(e){switch(e){case a.dataform.ColumnDescriptor.DimensionType.CATEGORY:return"category";case a.dataform.ColumnDescriptor.DimensionType.TIMESTAMP:return"timestamp";case a.dataform.ColumnDescriptor.DimensionType.NUMBER:return"number";case a.dataform.ColumnDescriptor.DimensionType.UNKNOWN_DIMENSION:case void 0:return;default:throw new Error("Dimension type not recognized: "+e)}}}t.ColumnDescriptors=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(30),i=r(3),o=r(0);t.TableType=["table","view","incremental","inline"],t.DistStyleType=["even","key","all"],t.SortStyleType=["compound","interleaved"];t.ITableConfigProperties=()=>i.strictKeysOf()(["type","disabled","protected","name","redshift","bigquery","snowflake","sqldatawarehouse","presto","tags","uniqueKey","dependencies","hermetic","schema","assertions","database","columns","description","materialized"]);class a{constructor(){this.proto=o.dataform.Table.create({type:"view",enumType:o.dataform.TableType.VIEW,disabled:!1,tags:[]}),this.contextablePreOps=[],this.contextablePostOps=[],this.uniqueKeyAssertions=[]}config(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,t.ITableConfigProperties(),"table config"),e.type&&this.type(e.type),e.dependencies&&this.dependencies(e.dependencies),void 0!==e.hermetic&&this.hermetic(e.hermetic),e.disabled&&this.disabled(),e.protected&&this.protected(),e.redshift&&this.redshift(e.redshift),e.bigquery&&this.bigquery(e.bigquery),e.snowflake&&this.snowflake(e.snowflake),e.sqldatawarehouse&&this.sqldatawarehouse(e.sqldatawarehouse),e.presto&&this.presto(e.presto),e.tags&&this.tags(e.tags),e.description&&this.description(e.description),e.columns&&this.columns(e.columns),e.database&&this.database(e.database),e.schema&&this.schema(e.schema),e.assertions&&this.assertions(e.assertions),e.uniqueKey&&this.uniqueKey(e.uniqueKey),e.materialized&&this.materialized(e.materialized),this}type(e){return this.proto.type=e,this.proto.enumType=i.tableTypeStringToEnum(e,!1),this}query(e){return this.contextableQuery=e,this}where(e){return this.contextableWhere=e,this}preOps(e){return this.contextablePreOps.push(e),this}postOps(e){return this.contextablePostOps.push(e),this}disabled(){var e;return this.proto.disabled=!0,this.uniqueKeyAssertions.forEach(e=>e.disabled()),null===(e=this.rowConditionsAssertion)||void 0===e||e.disabled(),this}protected(){return this.proto.protected=!0,this}uniqueKey(e){this.proto.uniqueKey=e}materialized(e){this.proto.materialized=e}snowflake(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["secure","transient","clusterBy"]),"snowflake config"),this.proto.snowflake=o.dataform.SnowflakeOptions.create(e),this}sqldatawarehouse(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["distribution"]),"sqldatawarehouse config"),this.proto.sqlDataWarehouse=o.dataform.SQLDataWarehouseOptions.create(e),this}redshift(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["distKey","distStyle","sortKeys","sortStyle"]),"redshift config"),this.proto.redshift=o.dataform.RedshiftOptions.create(e),this}bigquery(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["partitionBy","clusterBy","updatePartitionFilter","labels","partitionExpirationDays","requirePartitionFilter","additionalOptions"]),"bigquery config"),this.proto.bigquery=o.dataform.BigQueryOptions.create(e),e.labels&&(this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.bigqueryLabels=e.labels),this}presto(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["partitionBy"]),"presto config"),this.proto.presto=o.dataform.PrestoOptions.create(e),this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach(e=>{this.proto.dependencyTargets.push(i.resolvableAsTarget(e))}),this}hermetic(e){this.proto.hermeticity=e?o.dataform.ActionHermeticity.HERMETIC:o.dataform.ActionHermeticity.NON_HERMETIC}tags(e){var t;return("string"==typeof e?[e]:e).forEach(e=>{this.proto.tags.push(e)}),this.uniqueKeyAssertions.forEach(t=>t.tags(e)),null===(t=this.rowConditionsAssertion)||void 0===t||t.tags(e),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=n.ColumnDescriptors.mapToColumnProtoArray(e,e=>this.session.compileError(e)),this}database(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,this.proto.target.schema,e),this}schema(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,e,this.proto.target.database),this}assertions(e){i.checkExcessProperties(e=>this.session.compileError(e),e,i.strictKeysOf()(["uniqueKey","uniqueKeys","nonNull","rowConditions"]),"assertions config"),e.uniqueKey&&e.uniqueKeys&&this.session.compileError(new Error("Specify at most one of 'assertions.uniqueKey' and 'assertions.uniqueKeys'."));let t=e.uniqueKeys;e.uniqueKey&&(t="string"==typeof e.uniqueKey?[[e.uniqueKey]]:[e.uniqueKey]),t&&t.forEach((e,t)=>{const r=this.session.assert(`${this.proto.target.schema}_${this.proto.target.name}_assertions_uniqueKey_${t}`,t=>this.session.adapter().indexAssertion(t.ref(this.proto.target),e));this.proto.tags&&r.tags(this.proto.tags),r.proto.parentAction=this.proto.target,this.proto.disabled&&r.disabled(),this.uniqueKeyAssertions.push(r)});const r=e.rowConditions||[];if(e.nonNull){("string"==typeof e.nonNull?[e.nonNull]:e.nonNull).forEach(e=>r.push(e+" IS NOT NULL"))}return r&&r.length>0&&(this.rowConditionsAssertion=this.session.assert(`${this.proto.target.schema}_${this.proto.target.name}_assertions_rowConditions`,e=>this.session.adapter().rowConditionsAssertion(e.ref(this.proto.target),r)),this.rowConditionsAssertion.proto.parentAction=this.proto.target,this.proto.disabled&&this.rowConditionsAssertion.disabled(),this.proto.tags&&this.rowConditionsAssertion.tags(this.proto.tags)),this}compile(){const e=new s(this),t=new s(this,!0);return this.proto.query=e.apply(this.contextableQuery),this.proto.enumType===o.dataform.TableType.INCREMENTAL&&(this.proto.incrementalQuery=t.apply(this.contextableQuery),this.proto.incrementalPreOps=this.contextifyOps(this.contextablePreOps,t),this.proto.incrementalPostOps=this.contextifyOps(this.contextablePostOps,t)),this.contextableWhere&&(this.proto.where=e.apply(this.contextableWhere)),this.proto.preOps=this.contextifyOps(this.contextablePreOps,e).filter(e=>!!e.trim()),this.proto.postOps=this.contextifyOps(this.contextablePostOps,e).filter(e=>!!e.trim()),i.validateQueryString(this.session,this.proto.query,this.proto.fileName),i.validateQueryString(this.session,this.proto.incrementalQuery,this.proto.fileName),this.proto}contextifyOps(e,t){let r=[];return e.forEach(e=>{const n=t.apply(e);r=r.concat("string"==typeof n?[n]:n)}),r}}t.Table=a,a.INLINE_IGNORED_PROPS=["bigquery","redshift","snowflake","sqlDataWarehouse","presto","preOps","postOps","actionDescriptor","disabled","where"];class s{constructor(e,t=!1){this.table=e,this.isIncremental=t}config(e){return this.table.config(e),""}self(){return this.resolve(this.table.proto.target)}name(){return this.table.session.finalizeName(this.table.proto.target.name)}ref(e,...t){return e=i.toResolvable(e,t),i.resolvableAsTarget(e)?(this.table.dependencies(e),this.resolve(e)):(this.table.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.table.session.resolve(e,...t)}schema(){return this.table.session.finalizeSchema(this.table.proto.target.schema)}database(){return this.table.proto.target.database?this.table.session.finalizeDatabase(this.table.proto.target.database):(this.table.session.compileError(new Error("Warehouse does not support multiple databases")),"")}type(e){return this.table.type(e),""}where(e){return this.table.where(e),""}when(e,t,r=""){return e?t:r}incremental(){return!!this.isIncremental}preOps(e){return this.table.preOps(e),""}postOps(e){return this.table.postOps(e),""}disabled(){return this.table.disabled(),""}redshift(e){return this.table.redshift(e),""}bigquery(e){return this.table.bigquery(e),""}presto(e){return this.table.presto(e),""}dependencies(e){return this.table.dependencies(e),""}apply(e){return"function"==typeof e?e(this):e}tags(e){return this.table.tags(e),""}}t.TableContext=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(111);function i(e,t={}){return function(e){return n.util.base64.encode(e,0,e.length)}(e.encode(e.create(t)).finish())}function o(e,t){return t?e.decode(function(e){const t=new Uint8Array(n.util.base64.length(e));return n.util.base64.decode(e,t,0),t}(t)):e.create()}t.encode64=i,t.decode64=o,t.equals=function(e,t,r){return i(e,t)===i(e,r)},t.deepClone=function(e,t){return e.fromObject(e.toObject(e.create(t)))};class a{constructor(e){this.protoType=e}static create(e){return new a(e)}stringify(e){return i(this.protoType,e)}parse(e){return o(this.protoType,e)}}t.ProtoStringifier=a},function(e,t,r){"use strict";e.exports=b;var n=r(15);((b.prototype=Object.create(n.prototype)).constructor=b).className="Type";var i=r(6),o=r(16),a=r(9),s=r(34),l=r(35),c=r(37),u=r(29),p=r(28),f=r(1),d=r(53),h=r(54),y=r(55),m=r(56),g=r(57);function b(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function O(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(b.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=f.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=f.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=b.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,f.merge(e.prototype,t)),e.$type=e.prototype.$type=this,f.merge(e,c,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:f.oneOfGetter(this._oneofsArray[r].oneof),set:f.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),b.generateConstructor=function(e){for(var t,r=f.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",f.safeProp(t.name)):t.repeated&&r("this%s=[]",f.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},b.fromJSON=function(e,t){var r=new b(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var c=Object.keys(t.fields),u=0;u<c.length;++u)r.add((void 0!==t.fields[c[u]].keyType?s.fromJSON:a.fromJSON)(c[u],t.fields[c[u]]));if(t.oneofs)for(c=Object.keys(t.oneofs),u=0;u<c.length;++u)r.add(o.fromJSON(c[u],t.oneofs[c[u]]));if(t.nested)for(c=Object.keys(t.nested),u=0;u<c.length;++u){var p=t.nested[c[u]];r.add((void 0!==p.id?a.fromJSON:void 0!==p.fields?b.fromJSON:void 0!==p.values?i.fromJSON:void 0!==p.methods?l.fromJSON:n.fromJSON)(c[u],p))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},b.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return f.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},b.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},b.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},b.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),O(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),O(this)):n.prototype.add.call(this,e)},b.prototype.remove=function(e){if(e instanceof a&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),O(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),O(this)}return n.prototype.remove.call(this,e)},b.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},b.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},b.prototype.create=function(e){return new this.ctor(e)},b.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:p,types:t,util:f}),this.decode=h(this)({Reader:u,types:t,util:f}),this.verify=y(this)({types:t,util:f}),this.fromObject=m.fromObject(this)({types:t,util:f}),this.toObject=m.toObject(this)({types:t,util:f});var n=g[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},b.prototype.encode=function(e,t){return this.setup().encode(e,t)},b.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},b.prototype.decode=function(e,t){return this.setup().decode(e,t)},b.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},b.prototype.verify=function(e){return this.setup().verify(e)},b.prototype.fromObject=function(e){return this.setup().fromObject(e)},b.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},b.d=function(e){return function(t){f.decorateType(t,e)}}},function(e,t,r){"use strict";e.exports=a;var n=r(9);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var i=r(12),o=r(1);function a(e,t,r,i,a,s){if(n.call(this,e,t,i,void 0,void 0,a,s),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=o.decorateType(r).name:r&&"object"==typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new a(i,e,t,r))}}},function(e,t,r){"use strict";e.exports=s;var n=r(15);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var i=r(36),o=r(1),a=r(49);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function l(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return o.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,l(this)):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,l(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,i=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var l=o.lcFirst((n=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[l]=o.codegen(["r","c"],o.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},function(e,t,r){"use strict";e.exports=o;var n=r(11);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(1);function o(e,t,r,o,a,s,l,c,u){if(i.isObject(a)?(l=a,a=s=void 0):i.isObject(s)&&(l=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,l),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=o,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c,this.parsedOptions=u}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},function(e,t,r){"use strict";e.exports=i;var n=r(7);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},function(e,t,r){"use strict";e.exports=p;var n=r(15);((p.prototype=Object.create(n.prototype)).constructor=p).className="Root";var i,o,a,s=r(9),l=r(6),c=r(16),u=r(1);function p(e){n.call(this,"",e),this.deferred=[],this.files=[]}function f(){}p.fromJSON=function(e,t){return t||(t=new p),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},p.prototype.resolvePath=u.path.resolve,p.prototype.fetch=u.fetch,p.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return u.asPromise(e,i,t,r);var s=n===f;function l(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function c(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function p(e,t){try{if(u.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),u.isString(t)){o.filename=e;var n,a=o(t,i,r),p=0;if(a.imports)for(;p<a.imports.length;++p)(n=c(a.imports[p])||i.resolvePath(e,a.imports[p]))&&d(n);if(a.weakImports)for(p=0;p<a.weakImports.length;++p)(n=c(a.weakImports[p])||i.resolvePath(e,a.weakImports[p]))&&d(n,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(e){l(e)}s||h||l(null,i)}function d(e,t){if(e=c(e)||e,!(i.files.indexOf(e)>-1))if(i.files.push(e),e in a)s?p(e,a[e]):(++h,setTimeout((function(){--h,p(e,a[e])})));else if(s){var r;try{r=u.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||l(e))}p(e,r)}else++h,i.fetch(e,(function(r,o){--h,n&&(r?t?h||l(null,i):l(r):p(e,o))}))}var h=0;u.isString(t)&&(t=[t]);for(var y,m=0;m<t.length;++m)(y=i.resolvePath("",t[m]))&&d(y);if(s)return i;h||l(null,i)},p.prototype.loadSync=function(e,t){if(!u.isNode)throw Error("not supported");return this.load(e,t,f)},p.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function h(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return r.get(n.name)||(n.declaringField=t,t.extensionField=n,r.add(n)),!0}return!1}p.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||h(0,e)||this.deferred.push(e);else if(e instanceof l)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof c)){if(e instanceof i)for(var t=0;t<this.deferred.length;)h(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},p.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof l)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},p._configure=function(e,t,r){i=e,o=t,a=r}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(122));class o{static create(){return new o}stringify(e){return JSON.stringify(e)}parse(e){return JSON.parse(e)}}t.JSONStringifier=o;class a{static create(){return new a}stringify(e){return JSON.stringify(Object.keys(e).sort().reduce((t,r)=>Object.assign(Object.assign({},t),{[r]:e[r]}),{}))}parse(e){return JSON.parse(e)}}t.JSONObjectStringifier=a;class s{static create(){return new s}stringify(e){return e.toString()}parse(e){return i.default.fromString(e)}}t.LongStringifier=s;class l{constructor(e){this.stringifier=e}static create(e){return new l(e)}stringify(e){return JSON.stringify(e.map(e=>this.stringifier.stringify(e)))}parse(e){return JSON.parse(e).map(e=>this.stringifier.parse(e))}}t.ArrayStringifier=l;class c{static create(){return new c}stringify(e){return e}parse(e){return e}}t.StringStringifier=c;class u{constructor(e,t){this.stringifier=e,this.map=t?new Map(t.map(([t,r])=>[e.stringify(t),r])):new Map}get[Symbol.toStringTag](){return u.name}get size(){return this.map.size}clear(){return this.map.clear()}delete(e){return this.map.delete(this.stringifier.stringify(e))}forEach(e,t){return this.map.forEach((t,r,n)=>e(t,this.stringifier.parse(r),null),t)}get(e){return this.map.get(this.stringifier.stringify(e))}has(e){return this.map.has(this.stringifier.stringify(e))}set(e,t){return this.map.set(this.stringifier.stringify(e),t),this}[Symbol.iterator](){return this.entries()}entries(){const e=this.stringifier,t=this.map[Symbol.iterator]();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:[e.parse(r.value[0]),r.value[1]],done:r.done}}}}keys(){const e=this.stringifier,t=this.map.keys();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:e.parse(r.value),done:r.done}}}}values(){return this.map.values()}}t.StringifiedMap=u;class p{constructor(e,t){this.stringifier=e,this.set=t?new Set(t.map(t=>e.stringify(t))):new Set}get size(){return this.set.size}get[Symbol.toStringTag](){return p.name}add(e){return this.set.add(this.stringifier.stringify(e)),this}clear(){return this.set.clear()}delete(e){return this.set.delete(this.stringifier.stringify(e))}forEach(e,t){return this.set.forEach((t,r,n)=>e(this.stringifier.parse(t),this.stringifier.parse(r),null),t)}has(e){return this.set.has(this.stringifier.stringify(e))}[Symbol.iterator](){return this.keys()}entries(){const e=this.stringifier,t=this.set[Symbol.iterator]();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:[e.parse(r.value[0]),r.value[1]],done:r.done}}}}keys(){const e=this.stringifier,t=this.set.keys();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:e.parse(r.value),done:r.done}}}}values(){const e=this.stringifier,t=this.set.values();return new class{[Symbol.iterator](){return this}next(){const r=t.next();return{value:r.done?void 0:e.parse(r.value),done:r.done}}}}}t.StringifiedSet=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(64),i=r(65),o=r(102),a=r(103),s=r(104),l=r(105),c=r(8),u=r(0);var p;!function(e){e.BIGQUERY="bigquery",e.PRESTO="presto",e.POSTGRES="postgres",e.REDSHIFT="redshift",e.SNOWFLAKE="snowflake",e.SQLDATAWAREHOUSE="sqldatawarehouse"}(p=t.WarehouseType||(t.WarehouseType={})),t.isWarehouseType=function(e){return Object.values(p).includes(e)};const f=[p.BIGQUERY,p.SQLDATAWAREHOUSE];t.supportsCancel=function(e){return f.some(t=>t===e)};const d=["host","port","username","password","databaseName"];t.requiredWarehouseProps={[p.BIGQUERY]:["projectId"],[p.POSTGRES]:d,[p.REDSHIFT]:d,[p.SNOWFLAKE]:["accountId","username","password","role","databaseName","warehouse"],[p.SQLDATAWAREHOUSE]:["server","port","username","password","database"],[p.PRESTO]:["host","port","user"]};const h={};function y(e,t){h[e]=t}t.register=y,t.create=function(e,t){if(!h[e.warehouse])throw new Error("Unsupported warehouse: "+e.warehouse);return new h[e.warehouse](e,t)},y("bigquery",i.BigQueryAdapter),y("presto",o.PrestoAdapter),y("postgres",a.RedshiftAdapter),y("redshift",a.RedshiftAdapter),y("snowflake",s.SnowflakeAdapter),y("sqldatawarehouse",l.SQLDataWarehouseAdapter),t.collectEvaluationQueries=function(e,t,r=(e=>e)){const i=new Array;if("string"==typeof e)i.push({query:r(e)});else try{if(e instanceof u.dataform.Table){if(e.enumType===u.dataform.TableType.INCREMENTAL){const n=e.incrementalPreOps.concat(e.incrementalQuery,e.incrementalPostOps);t?i.push({query:c.concatenateQueries(n,r),incremental:!0}):n.forEach(e=>i.push({query:r(e),incremental:!0}))}const n=e.preOps.concat(e.query,e.postOps);t?i.push({query:c.concatenateQueries(n,r)}):n.forEach(e=>i.push({query:r(e)}))}else if(e instanceof u.dataform.Operation)t?i.push({query:c.concatenateQueries(e.queries,r)}):e.queries.forEach(e=>i.push({query:r(e)}));else{if(!(e instanceof u.dataform.Assertion))throw new Error("Unrecognized evaluate type.");i.push({query:r(e.query)})}}catch(e){throw new n.ErrorWithCause("Error building tasks for evaluation. "+e.message,e)}return i.map(e=>Object.assign({query:e.query.trim()},e)).filter(e=>!!e.query)}},function(e,t,r){const n=r(14),i=r(17),o=r(2),a=r(42),s=r(10),l=r(66),c=r(67),u=r(68),p=r(69),f=r(70),d=r(71),h=r(72),y=r(73),m=r(4),g=r(74),b=r(75),O=r(23),v=r(76),T=r(77),w=r(19),E=r(24),S=r(43),j=r(44),P=r(25),A=r(26),k=r(45),x=r(78),N=r(20),C=r(5),R=r(21),_=r(82),I=r(83),D=r(84),L=r(85),q=r(86),B=r(27),M=r(87),$=r(88),U=r(89),Q=r(90),G=r(91);e.exports={parse:s,valid:l,clean:c,inc:u,diff:p,major:f,minor:d,patch:h,prerelease:y,compare:m,rcompare:g,compareLoose:b,compareBuild:O,sort:v,rsort:T,gt:w,lt:E,eq:S,neq:j,gte:P,lte:A,cmp:k,coerce:x,Comparator:N,Range:C,satisfies:R,toComparators:_,maxSatisfying:I,minSatisfying:D,minVersion:L,validRange:q,outside:B,gtr:M,ltr:$,intersects:U,simplifyRange:Q,subset:G,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},function(e,t){const r=/^[0-9]+$/,n=(e,t)=>{const n=r.test(e),i=r.test(t);return n&&i&&(e=+e,t=+t),e===t?0:n&&!i?-1:i&&!n?1:e<t?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:(e,t)=>n(t,e)}},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>0===n(e,t,r)},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>0!==n(e,t,r)},function(e,t,r){const n=r(43),i=r(44),o=r(19),a=r(25),s=r(24),l=r(26);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return i(e,r,c);case">":return o(e,r,c);case">=":return a(e,r,c);case"<":return s(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError("Invalid operator: "+t)}}},function(e,t,r){"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(28),n.BufferWriter=r(99),n.Reader=r(29),n.BufferReader=r(100),n.util=r(7),n.rpc=r(49),n.roots=r(50),n.configure=i,i()},function(e,t,r){"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,o=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,a){r[n]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(e){o&&(o=!1,a(e))}}))}},function(module,exports,__webpack_require__){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},function(e,t,r){"use strict";t.Service=r(101)},function(e,t,r){"use strict";e.exports={}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3),i=r(0);t.IAssertionConfigProperties=n.strictKeysOf()(["database","dependencies","description","disabled","hermetic","name","schema","tags","type"]);t.Assertion=class{constructor(){this.proto=i.dataform.Assertion.create()}config(e){return n.checkExcessProperties(e=>this.session.compileError(e),e,t.IAssertionConfigProperties,"assertion config"),e.dependencies&&this.dependencies(e.dependencies),void 0!==e.hermetic&&this.hermetic(e.hermetic),e.disabled&&this.disabled(),e.tags&&this.tags(e.tags),e.description&&this.description(e.description),e.database&&this.database(e.database),e.schema&&this.schema(e.schema),this}query(e){return this.contextableQuery=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach(e=>{this.proto.dependencyTargets.push(n.resolvableAsTarget(e))}),this}hermetic(e){this.proto.hermeticity=e?i.dataform.ActionHermeticity.HERMETIC:i.dataform.ActionHermeticity.NON_HERMETIC}disabled(){return this.proto.disabled=!0,this}tags(e){return("string"==typeof e?[e]:e).forEach(e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)}),this}description(e){return this.proto.actionDescriptor={description:e},this}database(e){return n.setNameAndTarget(this.session,this.proto,this.proto.target.name,this.proto.target.schema,e),this}schema(e){return n.setNameAndTarget(this.session,this.proto,this.proto.target.name,e,this.proto.target.database),this}compile(){const e=new o(this);return this.proto.query=e.apply(this.contextableQuery),n.validateQueryString(this.session,this.proto.query,this.proto.fileName),this.proto}};class o{constructor(e){this.assertion=e}self(){return this.resolve(this.assertion.proto.target)}name(){return this.assertion.session.finalizeName(this.assertion.proto.target.name)}ref(e,...t){return e=n.toResolvable(e,t),n.resolvableAsTarget(e)?(this.assertion.dependencies(e),this.resolve(e)):(this.assertion.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.assertion.session.resolve(e,...t)}schema(){return this.assertion.session.finalizeSchema(this.assertion.proto.target.schema)}database(){return this.assertion.proto.target.database?this.assertion.session.finalizeDatabase(this.assertion.proto.target.database):(this.assertion.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.assertion.dependencies(e),""}tags(e){return this.assertion.tags(e),""}when(e,t,r=""){return e?t:r}apply(e){return"function"==typeof e?e(this):e}}t.AssertionContext=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(30),i=r(3),o=r(0);t.IIOperationConfigProperties=i.strictKeysOf()(["columns","database","dependencies","description","disabled","hasOutput","hermetic","name","schema","tags","type"]);t.Operation=class{constructor(){this.proto=o.dataform.Operation.create()}config(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,t.IIOperationConfigProperties,"operation config"),e.dependencies&&this.dependencies(e.dependencies),void 0!==e.hermetic&&this.hermetic(e.hermetic),e.disabled&&this.disabled(),e.tags&&this.tags(e.tags),e.hasOutput&&this.hasOutput(e.hasOutput),e.description&&this.description(e.description),e.columns&&this.columns(e.columns),e.database&&this.database(e.database),e.schema&&this.schema(e.schema),this}queries(e){return this.contextableQueries=e,this}dependencies(e){return(Array.isArray(e)?e:[e]).forEach(e=>{this.proto.dependencyTargets.push(i.resolvableAsTarget(e))}),this}hermetic(e){this.proto.hermeticity=e?o.dataform.ActionHermeticity.HERMETIC:o.dataform.ActionHermeticity.NON_HERMETIC}disabled(){return this.proto.disabled=!0,this}tags(e){return("string"==typeof e?[e]:e).forEach(e=>{this.proto.tags.indexOf(e)<0&&this.proto.tags.push(e)}),this}hasOutput(e){return this.proto.hasOutput=e,this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=n.ColumnDescriptors.mapToColumnProtoArray(e,e=>this.session.compileError(e)),this}database(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,this.proto.target.schema,e),this}schema(e){return i.setNameAndTarget(this.session,this.proto,this.proto.target.name,e,this.proto.target.database),this}compile(){var e,t;(null===(t=null===(e=this.proto.actionDescriptor)||void 0===e?void 0:e.columns)||void 0===t?void 0:t.length)>0&&!this.proto.hasOutput&&this.session.compileError(new Error("Actions of type 'operations' may only describe columns if they specify 'hasOutput: true'."),this.proto.fileName);const r=new a(this).apply(this.contextableQueries);return this.proto.queries="string"==typeof r?[r]:r,this.proto}};class a{constructor(e){this.operation=e}self(){return this.resolve(this.operation.proto.target)}name(){return this.operation.session.finalizeName(this.operation.proto.target.name)}ref(e,...t){return e=i.toResolvable(e,t),i.resolvableAsTarget(e)?(this.operation.dependencies(e),this.resolve(e)):(this.operation.session.compileError(new Error("Action name is not specified")),"")}resolve(e,...t){return this.operation.session.resolve(e,...t)}schema(){return this.operation.session.finalizeSchema(this.operation.proto.target.schema)}database(){return this.operation.proto.target.database?this.operation.session.finalizeDatabase(this.operation.proto.target.database):(this.operation.session.compileError(new Error("Warehouse does not support multiple databases")),"")}dependencies(e){return this.operation.dependencies(e),""}tags(e){return this.operation.tags(e),""}hasOutput(e){return this.operation.hasOutput(e),""}when(e,t,r=""){return e?t:r}apply(e){return"function"==typeof e?e(this):e}}t.OperationContext=a},function(e,t,r){"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(o.compareFieldsById),l=0;l<s.length;++l){var c=s[l].resolve(),u=e._fieldsArray.indexOf(c),p=c.resolvedType instanceof n?"int32":c.type,f=i.basic[p];t="m"+o.safeProp(c.name),c.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,c.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(c.id<<3|2)>>>0,8|i.mapKey[c.keyType],c.keyType),void 0===f?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",u,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|f,p,t),r("}")("}")):c.repeated?(r("if(%s!=null&&%s.length){",t,t),c.packed&&void 0!==i.packed[p]?r("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",p,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===f?a(r,c,u,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(c.id<<3|f)>>>0,p,t)),r("}")):(c.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===f?a(r,c,u,t):r("w.uint32(%i).%s(%s)",(c.id<<3|f)>>>0,p,t))}return r("return w")};var n=r(6),i=r(12),o=r(1);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var s=e._fieldsArray[r].resolve(),l=s.resolvedType instanceof n?"int32":s.type,c="m"+o.safeProp(s.name);t("case %i: {",s.id),s.map?(t("if(%s===util.emptyObject)",c)("%s={}",c)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[s.keyType]?t("k=%j",i.defaults[s.keyType]):t("k=null"),void 0!==i.defaults[l]?t("value=%j",i.defaults[l]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[l]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):t("%s[k]=value",c)):s.repeated?(t("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==i.packed[l]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",c,l)("}else"),void 0===i.basic[l]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",c,r):t("%s.push(r.%s())",c,l)):void 0===i.basic[l]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",c,r):t("%s=r.%s()",c,l),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var u=e._fieldsArray[r];u.required&&t("if(!m.hasOwnProperty(%j))",u.name)("throw util.ProtocolError(%j,{instance:m})",a(u))}return t("return m")};var n=r(6),i=r(12),o=r(1);function a(e){return"missing required '"+e.name+"'"}},function(e,t,r){"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,n={};r.length&&t("var p={}");for(var l=0;l<e.fieldsArray.length;++l){var c=e._fieldsArray[l].resolve(),u="m"+i.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",o(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),s(t,c,"k[i]"),a(t,c,l,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",o(c,"array"))("for(var i=0;i<%s.length;++i){",u),a(t,c,l,u+"[i]")("}");else{if(c.partOf){var p=i.safeProp(c.partOf.name);1===n[c.partOf.name]&&t("if(p%s===1)",p)("return%j",c.partOf.name+": multiple values"),n[c.partOf.name]=1,t("p%s=1",p)}a(t,c,l,u)}c.optional&&t("}")}return t("return null")};var n=r(6),i=r(1);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function s(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}return e}},function(e,t,r){"use strict";var n=t,i=r(6),o=r(1);function a(e,t,r,n){var o=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var a=t.resolvedType.values,s=Object.keys(a),l=0;l<s.length;++l)a[s[l]]!==t.typeDefault||o||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),t.repeated||e("break"),o=!0),e("case%j:",s[l])("case %i:",a[s[l]])("m%s=%j",n,a[s[l]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),l=o.safeProp(s.name);s.map?(r("if(d%s){",l)('if(typeof d%s!=="object")',l)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",l)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",l),a(r,s,n,l+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",l)("if(!Array.isArray(d%s))",l)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",l)("for(var i=0;i<d%s.length;++i){",l),a(r,s,n,l+"[i]")("}")("}")):(s.resolvedType instanceof i||r("if(d%s!=null){",l),a(r,s,n,l),s.resolvedType instanceof i||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],a=[],l=[],c=0;c<t.length;++c)t[c].partOf||(t[c].resolve().repeated?n:t[c].map?a:l).push(t[c]);if(n.length){for(r("if(o.arrays||o.defaults){"),c=0;c<n.length;++c)r("d%s=[]",o.safeProp(n[c].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),c=0;c<a.length;++c)r("d%s={}",o.safeProp(a[c].name));r("}")}if(l.length){for(r("if(o.defaults){"),c=0;c<l.length;++c){var u=l[c],p=o.safeProp(u.name);if(u.resolvedType instanceof i)r("d%s=o.enums===String?%j:%j",p,u.resolvedType.valuesById[u.typeDefault],u.typeDefault);else if(u.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",p)("}else")("d%s=o.longs===String?%j:%i",p,u.typeDefault.toString(),u.typeDefault.toNumber());else if(u.bytes){var f="["+Array.prototype.slice.call(u.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",p,String.fromCharCode.apply(String,u.typeDefault))("else{")("d%s=%s",p,f)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",p,p)("}")}else r("d%s=%j",p,u.typeDefault)}r("}")}var d=!1;for(c=0;c<t.length;++c){u=t[c];var h=e._fieldsArray.indexOf(u);p=o.safeProp(u.name);u.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",p,p)("d%s={}",p)("for(var j=0;j<ks2.length;++j){"),s(r,u,h,p+"[ks2[j]]")("}")):u.repeated?(r("if(m%s&&m%s.length){",p,p)("d%s=[]",p)("for(var j=0;j<m%s.length;++j){",p),s(r,u,h,p+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",p,u.name),s(r,u,h,p),u.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(u.partOf.name),u.name)),r("}")}return r("return d")}},function(e,t,r){"use strict";var n=t,i=r(37);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},function(e,t,r){"use strict";e.exports=d;var n=/[\s{}=;:[\],'"()<>]/g,i=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,a=/^ *[*/]+ */,s=/^\s*\*?\/*/,l=/\n/g,c=/\s/,u=/\\(.?)/g,p={0:"\0",r:"\r",n:"\n",t:"\t"};function f(e){return e.replace(u,(function(e,t){switch(t){case"\\":case"":return t;default:return p[t]||""}}))}function d(e,t){e=e.toString();var r=0,u=e.length,p=1,d=0,h={},y=[],m=null;function g(e){return Error("illegal "+e+" (line "+p+")")}function b(t){return e.charAt(t)}function O(r,n,i){var o,c={type:e.charAt(r++),lineEmpty:!1,leading:i},u=r-(t?2:3);do{if(--u<0||"\n"===(o=e.charAt(u))){c.lineEmpty=!0;break}}while(" "===o||"\t"===o);for(var f=e.substring(r,n).split(l),y=0;y<f.length;++y)f[y]=f[y].replace(t?s:a,"").trim();c.text=f.join("\n").trim(),h[p]=c,d=p}function v(t){var r=T(t),n=e.substring(t,r);return/^\s*\/{1,2}/.test(n)}function T(e){for(var t=e;t<u&&"\n"!==b(t);)t++;return t}function w(){if(y.length>0)return y.shift();if(m)return function(){var t="'"===m?o:i;t.lastIndex=r-1;var n=t.exec(e);if(!n)throw g("string");return r=t.lastIndex,E(m),m=null,f(n[1])}();var a,s,l,d,h,w=0===r;do{if(r===u)return null;for(a=!1;c.test(l=b(r));)if("\n"===l&&(w=!0,++p),++r===u)return null;if("/"===b(r)){if(++r===u)throw g("comment");if("/"===b(r))if(t){if(d=r,h=!1,v(r)){h=!0;do{if((r=T(r))===u)break;if(r++,!w)break}while(v(r))}else r=Math.min(u,T(r)+1);h&&(O(d,r,w),w=!0),p++,a=!0}else{for(h="/"===b(d=r+1);"\n"!==b(++r);)if(r===u)return null;++r,h&&(O(d,r-1,w),w=!0),++p,a=!0}else{if("*"!==(l=b(r)))return"/";d=r+1,h=t||"*"===b(d);do{if("\n"===l&&++p,++r===u)throw g("comment");s=l,l=b(r)}while("*"!==s||"/"!==l);++r,h&&(O(d,r-2,w),w=!0),a=!0}}}while(a);var S=r;if(n.lastIndex=0,!n.test(b(S++)))for(;S<u&&!n.test(b(S));)++S;var j=e.substring(r,r=S);return'"'!==j&&"'"!==j||(m=j),j}function E(e){y.push(e)}function S(){if(!y.length){var e=w();if(null===e)return null;E(e)}return y[0]}return Object.defineProperty({next:w,peek:S,push:E,skip:function(e,t){var r=S();if(r===e)return w(),!0;if(!t)throw g("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var r,n=null;return void 0===e?(r=h[p-1],delete h[p-1],r&&(t||"*"===r.type||r.lineEmpty)&&(n=r.leading?r.text:null)):(d<e&&S(),r=h[e],delete h[e],!r||r.lineEmpty||!t&&"/"!==r.type||(n=r.leading?null:r.text)),n}},"line",{get:function(){return p}})}d.unescape=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(39);t.targetStringifier=n.JSONObjectStringifier.create(),t.targetsAreEqual=function(e,t){return e.database===t.database&&e.schema===t.schema&&e.name===t.name},t.targetAsReadableString=function(e){const t=[e.name,e.schema];return e.database&&t.push(e.database),t.reverse().join(".")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="2.8.1"},function(e,t,r){e.exports=r(62)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(63);t.adapters=n.adapters,t.compiler=n.compiler,t.compileStandaloneSqlxQuery=n.compileStandaloneSqlxQuery,t.indexFileGenerator=n.indexFileGenerator,t.main=n.main,t.session=n.session,t.supportedFeatures=n.supportedFeatures,t.version=n.version},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(40));t.adapters=i;const o=r(106);t.compiler=o.compile,t.compileStandaloneSqlxQuery=o.compileStandaloneSqlxQuery;const a=r(110);t.indexFileGenerator=a.genIndex;const s=r(119);t.main=s.main;const l=r(120),c=r(60);t.version=c.version;const u=r(0);const p=(global._DF_SESSION||(global._DF_SESSION=new l.Session),global._DF_SESSION);t.session=p;const f=[u.dataform.SupportedFeatures.ARRAY_BUFFER_IPC];t.supportedFeatures=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class n extends Error{constructor(e,t){super("string"==typeof e?e:void 0),this.cause=t,"string"!=typeof e&&(this.cause=e),this.cause&&(this.stack+="\nCaused by: "+this.cause.stack)}}t.ErrorWithCause=n,t.coerceAsError=function(e){if(e instanceof Error)return e;const t=e,r=t.message?String(t.message):String(e),n=new Error(r);return t.stack&&(n.stack=t.stack),t.name&&(n.name=t.name),n}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`\`${e.database||this.project.defaultDatabase}.${e.schema||this.project.defaultSchema}.${e.name}\``}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);return r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.add(i.Task.statement(e.uniqueKey&&e.uniqueKey.length>0?this.mergeInto(e.target,null==r?void 0:r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where),e.uniqueKey,e.bigquery&&e.bigquery.updatePartitionFilter):this.insertInto(e.target,null==r?void 0:r.fields.map(e=>e.name).map(e=>`\`${e}\``),this.where(e.incrementalQuery||e.query,e.where)))):n.add(i.Task.statement(this.createOrReplace(e))),this.postOps(e,t,r).forEach(e=>n.add(e)),n.concatenate()}assertTasks(e,t){const r=i.Tasks.create(),n=e.target;return r.add(i.Task.statement(this.createOrReplaceView(n,e.query))),r.add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(n))),r}dropIfExists(e,t){return`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)}`}createOrReplace(e){const t=[];if(e.bigquery&&e.bigquery.partitionBy&&e.bigquery.partitionExpirationDays&&t.push("partition_expiration_days="+e.bigquery.partitionExpirationDays),e.bigquery&&e.bigquery.partitionBy&&e.bigquery.requirePartitionFilter&&t.push("require_partition_filter="+e.bigquery.requirePartitionFilter),e.bigquery&&e.bigquery.additionalOptions)for(const[r,n]of Object.entries(e.bigquery.additionalOptions))t.push(`${r}=${n}`);return`create or replace ${e.materialized?"materialized ":""}${this.tableTypeAsSql(this.baseTableType(e.enumType))} ${this.resolveTarget(e.target)} ${e.bigquery&&e.bigquery.partitionBy?`partition by ${e.bigquery.partitionBy} `:""}${e.bigquery&&e.bigquery.clusterBy&&e.bigquery.clusterBy.length>0?`cluster by ${e.bigquery.clusterBy.join(", ")} `:""}${t.length>0?`OPTIONS(${t.join(",")})`:""}as ${e.query}`}createOrReplaceView(e,t){return`\n create or replace view ${this.resolveTarget(e)} as ${t}`}mergeInto(e,t,r,n,i){const o=t.map(e=>`\`${e}\``);return`\nmerge ${this.resolveTarget(e)} T\nusing (${r}\n) S\non ${n.map(e=>`T.${e} = S.${e}`).join(" and ")}\n ${i?"and T."+i:""}\nwhen matched then\n update set ${t.map(e=>`\`${e}\` = S.${e}`).join(",")}\nwhen not matched then\n insert (${o.join(",")}) values (${o.join(",")})`}}t.BigQueryAdapter=a},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},function(e,t,r){const n=r(2);e.exports=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}}},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;const a=o>0,s=a?r:i,l=a?i:r,c=!!s.prerelease.length;if(!!l.prerelease.length&&!c)return l.patch||l.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}},function(e,t,r){const n=r(2);e.exports=(e,t)=>new n(e,t).major},function(e,t,r){const n=r(2);e.exports=(e,t)=>new n(e,t).minor},function(e,t,r){const n=r(2);e.exports=(e,t)=>new n(e,t).patch},function(e,t,r){const n=r(10);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},function(e,t,r){const n=r(4);e.exports=(e,t,r)=>n(t,e,r)},function(e,t,r){const n=r(4);e.exports=(e,t)=>n(e,t,!0)},function(e,t,r){const n=r(23);e.exports=(e,t)=>e.sort((e,r)=>n(e,r,t))},function(e,t,r){const n=r(23);e.exports=(e,t)=>e.sort((e,r)=>n(r,e,t))},function(e,t,r){const n=r(2),i=r(10),{safeRe:o,t:a}=r(14);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=o[a.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),o[a.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;o[a.COERCERTL].lastIndex=-1}else r=e.match(o[a.COERCE]);return null===r?null:i(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)}},function(e,t,r){"use strict";const n=r(80),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),p=Symbol("lruList"),f=Symbol("cache"),d=Symbol("updateAgeOnGet"),h=()=>1;const y=(e,t,r)=>{const n=e[f].get(t);if(n){const t=n.value;if(m(e,t)){if(b(e,n),!e[s])return}else r&&(e[d]&&(n.value.now=Date.now()),e[p].unshiftNode(n));return t.value}},m=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},g=e=>{if(e[o]>e[i])for(let t=e[p].tail;e[o]>e[i]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[f].delete(r.key),e[p].removeNode(t)}};class O{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const v=(e,t,r,n)=>{let i=r.value;m(e,i)&&(b(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||h;if(this[a]="function"!=typeof t?h:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[d]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,g(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,g(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[a]&&(this[a]=e,this[o]=0,this[p].forEach(e=>{e.length=this[a](e.value,e.key),this[o]+=e.length})),g(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(let r=this[p].tail;null!==r;){const n=r.prev;v(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[p].head;null!==r;){const n=r.next;v(this,e,r,t),r=n}}keys(){return this[p].toArray().map(e=>e.key)}values(){return this[p].toArray().map(e=>e.value)}reset(){this[c]&&this[p]&&this[p].length&&this[p].forEach(e=>this[c](e.key,e.value)),this[f]=new Map,this[p]=new n,this[o]=0}dump(){return this[p].map(e=>!m(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[p]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[i])return b(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[c]&&(this[u]||this[c](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),g(this),!0}const d=new O(e,t,s,n,r);return d.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=d.length,this[p].unshift(d),this[f].set(e,this[p].head),g(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!m(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[p].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[f].forEach((e,t)=>y(this,t,!1))}}},function(e,t,r){"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=s,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var a=[];for(n=0;o&&n<t;n++)a.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(n=0;n<r.length;n++)o=i(this,o,r[n]);return a},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(81)(n)}catch(e){}},function(e,t,r){"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},function(e,t,r){const n=r(5);e.exports=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},function(e,t,r){const n=r(2),i=r(5);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(o&&-1!==a.compare(e)||(o=e,a=new n(o,r)))}),o}},function(e,t,r){const n=r(2),i=r(5);e.exports=(e,t,r)=>{let o=null,a=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(o&&1!==a.compare(e)||(o=e,a=new n(o,r)))}),o}},function(e,t,r){const n=r(2),i=r(5),o=r(19);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const i=e.set[t];let a=null;i.forEach(e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":a&&!o(t,a)||(a=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}),!a||r&&!o(r,a)||(r=a)}return r&&e.test(r)?r:null}},function(e,t,r){const n=r(5);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},function(e,t,r){const n=r(27);e.exports=(e,t,r)=>n(e,t,">",r)},function(e,t,r){const n=r(27);e.exports=(e,t,r)=>n(e,t,"<",r)},function(e,t,r){const n=r(5);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},function(e,t,r){const n=r(21),i=r(4);e.exports=(e,t,r)=>{const o=[];let a=null,s=null;const l=e.sort((e,t)=>i(e,t,r));for(const e of l){n(e,t,r)?(s=e,a||(a=e)):(s&&o.push([a,s]),s=null,a=null)}a&&o.push([a,null]);const c=[];for(const[e,t]of o)e===t?c.push(e):t||e!==l[0]?t?e===l[0]?c.push("<="+t):c.push(`${e} - ${t}`):c.push(">="+e):c.push("*");const u=c.join(" || "),p="string"==typeof t.raw?t.raw:String(t);return u.length<p.length?u:t}},function(e,t,r){const n=r(5),i=r(20),{ANY:o}=i,a=r(21),s=r(4),l=[new i(">=0.0.0-0")],c=[new i(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?l:c}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=c}const n=new Set;let i,u,d,h,y,m,g;for(const t of e)">"===t.operator||">="===t.operator?i=p(i,t,r):"<"===t.operator||"<="===t.operator?u=f(u,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&u){if(d=s(i.semver,u.semver,r),d>0)return null;if(0===d&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of n){if(i&&!a(e,String(i),r))return null;if(u&&!a(e,String(u),r))return null;for(const n of t)if(!a(e,String(n),r))return!1;return!0}let b=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,O=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;b&&1===b.prerelease.length&&"<"===u.operator&&0===b.prerelease[0]&&(b=!1);for(const e of t){if(g=g||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(O&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===O.major&&e.semver.minor===O.minor&&e.semver.patch===O.patch&&(O=!1),">"===e.operator||">="===e.operator){if(h=p(i,e,r),h===e&&h!==i)return!1}else if(">="===i.operator&&!a(i.semver,String(e),r))return!1;if(u)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if(y=f(u,e,r),y===e&&y!==u)return!1}else if("<="===u.operator&&!a(u.semver,String(e),r))return!1;if(!e.operator&&(u||i)&&0!==d)return!1}return!(i&&m&&!u&&0!==d)&&(!(u&&g&&!i&&0!==d)&&(!O&&!b))},p=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},f=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=u(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},function(e,t,r){"use strict";e.exports=r(46)},function(e,t,r){"use strict";var n=t;n.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),o=new Array(123),a=0;a<64;)o[i[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;n.encode=function(e,t,r){for(var n,o=null,a=[],s=0,l=0;t<r;){var c=e[t++];switch(l){case 0:a[s++]=i[c>>2],n=(3&c)<<4,l=1;break;case 1:a[s++]=i[n|c>>4],n=(15&c)<<2,l=2;break;case 2:a[s++]=i[n|c>>6],a[s++]=i[63&c],l=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return l&&(a[s++]=i[n],a[s++]=61,1===l&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};n.decode=function(e,t,r){for(var n,i=r,a=0,s=0;s<e.length;){var l=e.charCodeAt(s++);if(61===l&&a>1)break;if(void 0===(l=o[l]))throw Error("invalid encoding");switch(a){case 0:n=l,a=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,a=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,a=3;break;case 3:t[r++]=(3&n)<<6|l,a=0}}if(1===a)throw Error("invalid encoding");return r-i},n.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},function(e,t,r){"use strict";function n(){this._listeners={}}e.exports=n,n.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},n.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},n.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},function(e,t,r){"use strict";function n(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function r(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,a=8388607&n;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,i),e.writeFloatBE=t.bind(null,o),e.readFloatLE=r.bind(null,a),e.readFloatBE=r.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,i,o){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=n*Math.pow(2,-l))>>>0,i,o+t),e((a<<31|l+1023<<20|1048576*s&1048575)>>>0,i,o+r)}}}function r(e,t,r,n,i){var o=e(n,i+t),a=e(n,i+r),s=2*(a>>31)+1,l=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===l?c?NaN:s*(1/0):0===l?5e-324*s*c:s*Math.pow(2,l-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,i,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=r.bind(null,a,0,4),e.readDoubleBE=r.bind(null,s,4,0)}(),e}function i(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function a(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=n(n)},function(e,t,r){"use strict";var n=t;n.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},n.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],a=0;t<r;)(n=e[t++])<128?o[a++]=n:n>191&&n<224?o[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},n.write=function(e,t,r){for(var n,i,o=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},function(e,t,r){"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(o=e(n),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},function(e,t,r){"use strict";e.exports=i;var n=r(7);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},function(e,t,r){"use strict";e.exports=o;var n=r(28);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(7);function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},function(e,t,r){"use strict";e.exports=o;var n=r(29);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(7);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},function(e,t,r){"use strict";e.exports=i;var n=r(7);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`"${e.database||this.project.defaultDatabase}"."${e.schema||this.project.defaultSchema}"."${e.name}"`}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);if(r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL)throw new Error("Incremental table types are not currently supported for Presto.");return n.add(i.Task.statement(this.createOrReplace(e))),this.postOps(e,t,r).forEach(e=>n.add(e)),n.concatenate()}assertTasks(e,t){const r=i.Tasks.create(),n=e.target;return r.add(i.Task.statement(this.createOrReplaceView(n,e.query))),r.add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(n))),r}createOrReplaceView(e,t){return`create or replace view ${this.resolveTarget(e)} as ${t}`}createTable(e){var t,r;return`create table if not exists ${this.resolveTarget(e.target)} as ${e.query} ${(null===(t=e.presto)||void 0===t?void 0:t.partitionBy)?`with (partitioned_by = array[${null===(r=e.presto)||void 0===r?void 0:r.partitionBy.join(", ")}]`:""}`}dropTableIfExists(e,t){return`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)}`}createOrReplace(e){return this.createTable(e)}mergeInto(){throw new Error("mergeInto unimplemented for Presto.")}}t.PrestoAdapter=a},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(41)),o=r(13),a=r(8),s=r(0);class l extends o.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`"${e.schema}"."${e.name}"`}publishTasks(e,t,r){const n=a.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const i=this.baseTableType(e.enumType);return r&&r.type!==i&&n.add(a.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(i)))),e.enumType===s.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.addAll(e.uniqueKey&&e.uniqueKey.length>0?this.mergeInto(e.target,this.where(e.incrementalQuery||e.query,e.where),e.uniqueKey):a.Tasks.create().add(a.Task.statement(this.insertInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where))))):n.addAll(this.createOrReplace(e)),this.postOps(e,t,r).forEach(e=>n.add(e)),n}assertTasks(e,t){const r=e.target;return a.Tasks.create().add(a.Task.statement(this.dropIfExists(r,s.dataform.TableMetadata.Type.VIEW))).add(a.Task.statement(this.createOrReplaceView(r,e.query,!1))).add(a.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(r)))}dropIfExists(e,t){const r=`drop ${this.tableTypeAsSql(t)} if exists ${this.resolveTarget(e)}`;return"postgres"===this.project.warehouse||this.isBindSupported()?r+" cascade":r}createOrReplaceView(e,t,r){const n=`create or replace view ${this.resolveTarget(e)} as ${t}`;return r||"postgres"===this.project.warehouse?n:n+" with no schema binding"}createOrReplace(e){if(e.enumType===s.dataform.TableType.VIEW){const t=e.redshift&&e.redshift.hasOwnProperty("bind"),r=!i.gte(this.dataformCoreVersion,"1.4.1"),n=(t?e.redshift.bind:r)&&this.isBindSupported();return a.Tasks.create().add(a.Task.statement(this.dropIfExists(e.target,this.baseTableType(e.enumType)))).add(a.Task.statement(this.createOrReplaceView(e.target,e.query,n)))}const t=s.dataform.Target.create({schema:e.target.schema,name:e.target.name+"_temp"});return a.Tasks.create().add(a.Task.statement(this.dropIfExists(t,this.baseTableType(e.enumType)))).add(a.Task.statement(this.createTable(e,t))).add(a.Task.statement(this.dropIfExists(e.target,s.dataform.TableMetadata.Type.TABLE))).add(a.Task.statement(`alter table ${this.resolveTarget(t)} rename to "${e.target.name}"`))}createTable(e,t){if(e.redshift){let r="create table "+this.resolveTarget(t);return e.redshift.distStyle&&e.redshift.distKey&&(r=`${r} diststyle ${e.redshift.distStyle} distkey (${e.redshift.distKey})`),e.redshift.sortStyle&&e.redshift.sortKeys&&(r=`${r} ${e.redshift.sortStyle} sortkey (${e.redshift.sortKeys.join(", ")})`),`${r} as ${e.query}`}return`create table ${this.resolveTarget(t)} as ${e.query}`}mergeInto(e,t,r){const n=this.resolveTarget(e),i=`"${e.schema}__${e.name}_incremental_temp"`;return a.Tasks.create().add(a.Task.statement(`drop table if exists ${i};`)).add(a.Task.statement(`create temp table ${i} as select * from (${t}\n) as data;`)).add(a.Task.statement("begin transaction;")).add(a.Task.statement(`delete from ${n} using ${i} where ${r.map(e=>`${n}."${e}" = ${i}."${e}"`).join(" and ")};`)).add(a.Task.statement(`insert into ${n} select * from ${i};`)).add(a.Task.statement("end transaction;")).add(a.Task.statement(`drop table ${i};`))}isBindSupported(){return i.lte(this.dataformCoreVersion,"1.10.0")}}t.RedshiftAdapter=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}resolveTarget(e){return`${e.database?`"${e.database}".`:""}"${e.schema}"."${e.name}"`}normalizeIdentifier(e){return e.toUpperCase()}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);return r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.add(i.Task.statement(e.uniqueKey&&e.uniqueKey.length>0?this.mergeInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where),e.uniqueKey):this.insertInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where)))):n.add(i.Task.statement(this.createOrReplace(e))),this.postOps(e,t,r).forEach(e=>n.add(e)),n}assertTasks(e,t){const r=i.Tasks.create(),n=e.target;return r.add(i.Task.statement(this.createOrReplaceView(n,e.query,!1,!1))),r.add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(n))),r}createOrReplaceView(e,t,r,n){return`create or replace ${r?"secure ":""}${n?"materialized ":""}view ${this.resolveTarget(e)} as ${t}`}createOrReplace(e){var t,r,n,i,a;return e.enumType===o.dataform.TableType.VIEW?this.createOrReplaceView(e.target,e.query,null===(t=e.snowflake)||void 0===t?void 0:t.secure,e.materialized):`create or replace ${(null===(r=e.snowflake)||void 0===r?void 0:r.transient)?"transient ":""}table ${this.resolveTarget(e.target)} ${(null===(i=null===(n=e.snowflake)||void 0===n?void 0:n.clusterBy)||void 0===i?void 0:i.length)>0?`cluster by (${null===(a=e.snowflake)||void 0===a?void 0:a.clusterBy.join(", ")}) `:""}as ${e.query}`}mergeInto(e,t,r,n){return`\nmerge into ${this.resolveTarget(e)} T\nusing (${r}\n) S\non ${n.map(e=>`T.${e} = S.${e}`).join(" and ")}\nwhen matched then\n update set ${t.map(e=>`${e} = S.${e}`).join(",")}\nwhen not matched then\n insert (${t.join(",")}) values (${t.join(",")})`}}t.SnowflakeAdapter=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(13),i=r(8),o=r(0);class a extends n.Adapter{constructor(e,t){super(t),this.project=e}sqlString(e){return`'${e.replace(/'/g,"''")}'`}resolveTarget(e){return`"${e.schema}"."${e.name}"`}publishTasks(e,t,r){const n=i.Tasks.create();this.preOps(e,t,r).forEach(e=>n.add(e));const a=this.baseTableType(e.enumType);return r&&r.type!==a&&n.add(i.Task.statement(this.dropIfExists(e.target,this.oppositeTableType(a)))),e.enumType===o.dataform.TableType.INCREMENTAL&&this.shouldWriteIncrementally(t,r)?n.add(i.Task.statement(this.insertInto(e.target,r.fields.map(e=>e.name),this.where(e.incrementalQuery||e.query,e.where)))):n.addAll(this.createOrReplace(e,!!r)),this.postOps(e,t,r).forEach(e=>n.add(e)),n.concatenate()}assertTasks(e,t){const r=e.target;return i.Tasks.create().add(i.Task.statement(this.dropIfExists(r,o.dataform.TableMetadata.Type.VIEW))).add(i.Task.statement(`\n create view ${this.resolveTarget(r)}\n as ${e.query}`)).add(i.Task.assertion("select sum(1) as row_count from "+this.resolveTarget(r)))}dropIfExists(e,t){return t===o.dataform.TableMetadata.Type.VIEW?`drop view if exists ${this.resolveTarget(e)} `:`if object_id ('${this.resolveTarget(e)}','U') is not null drop table ${this.resolveTarget(e)}`}insertInto(e,t,r){return`\ninsert into ${this.resolveTarget(e)}\n(${t.join(",")})\nselect ${t.join(",")}\nfrom (${r}\n) as insertions`}createOrReplace(e,t){if(e.enumType===o.dataform.TableType.VIEW)return i.Tasks.create().add(i.Task.statement(`${t?"alter":"create"} view ${this.resolveTarget(e.target)} as ${e.query}`));const r=o.dataform.Target.create({schema:e.target.schema,name:e.target.name+"_temp"});return i.Tasks.create().add(i.Task.statement(this.dropIfExists(r,this.baseTableType(e.enumType)))).add(i.Task.statement(this.createTable(e,r))).add(i.Task.statement(this.dropIfExists(e.target,o.dataform.TableMetadata.Type.TABLE))).add(i.Task.statement(`rename object ${this.resolveTarget(r)} to ${e.target.name} `))}createTable(e,t){const r=e.sqlDataWarehouse&&e.sqlDataWarehouse.distribution?e.sqlDataWarehouse.distribution:"ROUND_ROBIN";return`create table ${this.resolveTarget(t)}\n with(\n distribution = ${r}\n ) \n as ${e.query}`}}t.SQLDataWarehouseAdapter=a},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(51),o=r(52),a=r(31),s=n(r(3)),l=r(108);function c(e){return`ctx.${e} ? ctx.${e}.bind(ctx) : undefined`}function u(e){const t=[];return{sql:e.replace(/^\s*\/\*[jJ][sS]\s*[\r\n]+((?:[^*]|[\r\n]|(?:\*+(?:[^*/]|[\r\n])))*)\*+\/|^\s*\-\-[jJ][sS]\s(.*)/gm,(e,r,n)=>(r&&t.push(r),n&&t.push(n),"")).replace(/([^\\])`/g,(e,t)=>t+"\\`").trim(),js:t.map(e=>e.trim()).join("\n")}}function p(e){let t="",r="";e.children().filter(l.SyntaxTreeNode.isSyntaxTreeNode).filter(e=>e.type===l.SyntaxTreeNodeType.JAVASCRIPT).forEach(e=>{const n=e.concatenate();n.startsWith("config")?t=n.slice("config ".length):r+=n.slice("js {".length,-1*"}".length)});const n=d(e.children().filter(e=>"string"==typeof e||[l.SyntaxTreeNodeType.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER,l.SyntaxTreeNodeType.SQL_COMMENT,l.SyntaxTreeNodeType.SQL_LITERAL_STRING,l.SyntaxTreeNodeType.SQL_LITERAL_MULTILINE_STRING,l.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR].includes(e.type)));let i="",o=[],a=[];const s=[];return e.children().filter(l.SyntaxTreeNode.isSyntaxTreeNode).filter(e=>e.type===l.SyntaxTreeNodeType.SQL).forEach(e=>{const t=e.children()[0],r=e.children().slice(-1)[0],n=d((1===e.children().length?new l.SyntaxTreeNode(l.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1,t.lastIndexOf("}"))]):new l.SyntaxTreeNode(l.SyntaxTreeNodeType.SQL,[t.slice(t.indexOf("{")+1),...e.children().slice(1,-1),r.slice(0,r.lastIndexOf("}"))])).children());if(t.startsWith("incremental_where")){if(n.length>1)throw new Error("'incremental_where' code blocks may only contain a single SQL statement.");i=n[0]}else if(t.startsWith("pre_operations"))o=n;else if(t.startsWith("post_operations"))a=n;else if(t.startsWith("input")){if(n.length>1)throw new Error("'input' code blocks may only contain a single SQL statement.");const e=t.slice(t.indexOf('"'),t.lastIndexOf('"')+1).split(",").map(e=>e.trim().slice(1,-1));s.push({labelParts:e,value:n[0]})}}),{config:t,js:r,sql:n,incremental:i,preOperations:o,postOperations:a,inputs:s}}function f(e){return[...new Set(Object.getOwnPropertyNames(e).filter(t=>"function"==typeof e[t]&&"constructor"!==t))]}function d(e){const t=[""];return e.forEach(e=>{"string"==typeof e||e.type!==l.SyntaxTreeNodeType.SQL_STATEMENT_SEPARATOR?t[t.length-1]+=function(e){if("string"==typeof e)return h.get(l.SyntaxTreeNodeType.SQL_LITERAL_STRING)(e);return e.concatenate(h)}(e):t.push("")}),t}t.compile=function(e,t){return t.endsWith(".sqlx")?function(e,t){const{config:r,js:n,sql:i,incremental:o,preOperations:a,postOperations:l,inputs:c}=p(e),u=["self","ref","resolve","name","when","incremental","schema","database"].map(e=>`const ${e} = ctx.${e} ? ctx.${e}.bind(ctx) : undefined;`).join("\n");return`dataform.sqlxAction({\n sqlxConfig: {\n name: "${s.getEscapedFileName(t)}",\n type: "operations",\n ...${r||"{}"}\n },\n sqlStatementCount: ${i.length},\n sqlContextable: (ctx) => {\n ${u}\n ${n}\n return [${i.map(e=>`\`${e}\``)}];\n },\n incrementalWhereContextable: ${o?`(ctx) => {\n ${u}\n ${n}\n return \`${o}\`\n }`:"undefined"},\n preOperationsContextable: ${a.length>0?`(ctx) => {\n ${u}\n ${n}\n return [${a.map(e=>`\`${e}\``)}];\n }`:"undefined"},\n postOperationsContextable: ${l.length>0?`(ctx) => {\n ${u}\n ${n}\n return [${l.map(e=>`\`${e}\``)}];\n }`:"undefined"},\n inputContextables: [\n ${c.map(({labelParts:e,value:t})=>`{\n refName: [${e.map(e=>`"${e}"`).join(", ")}],\n contextable: (ctx) => {\n ${n}\n return \`${t}\`;\n }\n }`).join(",")}\n ]\n});\n`}(l.SyntaxTreeNode.create(e),t):t.endsWith(".assert.sql")?function(e,t){const{sql:r,js:n}=u(e),o=f(i.AssertionContext.prototype).map(e=>`const ${e} = ${c(e)};`);return`\n assert("${s.getEscapedFileName(t)}").query(ctx => {\n ${o.join("\n")}\n ${n}\n return \`${r}\`;\n })`}(e,t):t.endsWith(".ops.sql")?function(e,t){const{sql:r,js:n}=u(e),i=f(o.OperationContext.prototype).map(e=>`const ${e} = ${c(e)};`);return`\n operate("${s.getEscapedFileName(t)}").queries(ctx => {\n ${i.join("\n")}\n ${n}\n return \`${r}\`.split("\\n---\\n");\n })`}(e,t):t.endsWith(".sql")?function(e,t){const{sql:r,js:n}=u(e),i=f(a.TableContext.prototype).map(e=>`const ${e} = ${c(e)};`);return`\n publish("${s.getEscapedFileName(t)}").query(ctx => {\n ${i.join("\n")}\n ${n}\n return \`${r}\`;\n })`}(e,t):e},t.extractJsBlocks=u,t.compileStandaloneSqlxQuery=function(e){const{config:t,js:r,sql:n,incremental:i,preOperations:o,postOperations:a,inputs:s}=p(l.SyntaxTreeNode.create(e));if(t)throw new Error("Standalone SQLX queries may not define 'config' code blocks.");if(i)throw new Error("Standalone SQLX queries may not define 'incremental_where' code blocks.");if(o.length>0)throw new Error("Standalone SQLX queries may not define 'pre_operations' code blocks.");if(a.length>0)throw new Error("Standalone SQLX queries may not define 'post_operations' code blocks.");if(s.length>0)throw new Error("Standalone SQLX queries may not define 'input' code blocks.");return`\n const ref = dataform.resolve.bind(dataform);\n const resolve = dataform.resolve.bind(dataform);\n ${r}\n return \`${n}\`;\n `};const h=new Map([[l.SyntaxTreeNodeType.SQL_COMMENT,e=>e.replace(/`/g,"\\`").replace(/\${/g,"\\${")],[l.SyntaxTreeNodeType.SQL_LITERAL_STRING,e=>e.replace(/\\/g,"\\\\").replace(/\`/g,"\\`")]])},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3);t.IRecordDescriptorProperties=()=>n.strictKeysOf()(["description","columns","displayName","dimension","aggregator","expression","tags","bigqueryPolicyTags"])},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(109)),o="sql",a="jsBlock",s="jsTemplateString",l="innerSqlBlock",c="innerSingleQuote",u="innerDoubleQuote",p="innerTripleSingleQuote",f="innerTripleDoubleQuote",d={START_CONFIG:o+"_startConfig",START_JS:o+"_startJs",START_INCREMENTAL:o+"_startIncremental",START_PRE_OPERATIONS:o+"_startPreOperations",START_POST_OPERATIONS:o+"_startPostOperations",START_INPUT:o+"_startInput",STATEMENT_SEPERATOR:o+"_statementSeparator",SINGLE_LINE_COMMENT:o+"_singleLineComment",MULTI_LINE_COMMENT:o+"_multiLineComment",START_JS_PLACEHOLDER:o+"_startJsPlaceholder",BACKTICK:o+"_backtick",START_QUOTE_SINGLE:o+"_startQuoteSingle",START_QUOTE_DOUBLE:o+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:o+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:o+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:o+"_captureEverythingElse"},h={SINGLE_LINE_COMMENT:a+"_singleLineComment",MULTI_LINE_COMMENT:a+"_multiLineComment",SINGLE_QUOTE_STRING:a+"_singleQuoteString",DOUBLE_QUOTE_STRING:a+"_doubleQuoteString",START_JS_TEMPLATE_STRING:a+"_startJsTemplateString",START_JS_BLOCK:a+"_startJsBlock",CLOSE_BLOCK:a+"_closeBlock",CAPTURE_EVERYTHING_ELSE:a+"_captureEverythingElse"},y={ESCAPED_BACKSLASH:s+"_escapedBackslash",ESCAPED_DOLLAR_BRACE:s+"_escapedDollarBrace",START_JS_BLOCK:s+"_startJsBlock",CLOSE_STRING:s+"_closeString",CAPTURE_EVERYTHING_ELSE:s+"_captureEverythingElse"},m={STATEMENT_SEPERATOR:l+"_statementSeparator",SINGLE_LINE_COMMENT:l+"_singleLineComment",MULTI_LINE_COMMENT:l+"_multiLineComment",START_JS_PLACEHOLDER:l+"_startJsPlaceholder",CLOSE_BLOCK:l+"_closeBlock",BACKTICK:l+"_backtick",START_QUOTE_SINGLE:l+"_startQuoteSingle",START_QUOTE_DOUBLE:l+"_startQuoteDouble",START_TRIPLE_QUOTE_SINGLE:l+"_startTripleQuoteSingle",START_TRIPLE_QUOTE_DOUBLE:l+"_startTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:l+"_captureEverythingElse"},g={ESCAPED_BACKSLASH:c+"_escapedBackslash",ESCAPED_QUOTE:c+"_escapedQuoteSingle",START_JS_PLACEHOLDER:c+"_startJsPlaceholder",CLOSE_QUOTE:c+"_closeQuoteSingle",CAPTURE_EVERYTHING_ELSE:c+"_captureEverythingElse"},b={ESCAPED_BACKSLASH:u+"_escapedBackslash",ESCAPED_QUOTE:u+"_escapedQuoteDouble",START_JS_PLACEHOLDER:u+"_startJsPlaceholder",CLOSE_QUOTE:u+"_closeQuoteDouble",CAPTURE_EVERYTHING_ELSE:u+"_captureEverythingElse"},O={ESCAPED_BACKSLASH:p+"_escapedBackslash",START_JS_PLACEHOLDER:p+"_startJsPlaceholder",CLOSE_QUOTE:p+"_closeTripleQuoteSingle",CAPTURE_EVERYTHING_ELSE:p+"_captureEverythingElse"},v={ESCAPED_BACKSLASH:f+"_escapedBackslash",START_JS_PLACEHOLDER:f+"_startJsPlaceholder",CLOSE_QUOTE:f+"_closeTripleQuoteDouble",CAPTURE_EVERYTHING_ELSE:f+"_captureEverythingElse"},T=i.states(function(){const e={};e[d.START_CONFIG]={match:"config {",push:a},e[d.START_JS]={match:"js {",push:a},e[d.START_INCREMENTAL]={match:"incremental_where {",push:l},e[d.START_PRE_OPERATIONS]={match:"pre_operations {",push:l},e[d.START_POST_OPERATIONS]={match:"post_operations {",push:l},e[d.START_INPUT]={match:/input "[a-zA-Z0-9_-]+"(?:,\s*"[a-zA-Z0-9_-]+")* {/,push:l},e[d.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,e[d.SINGLE_LINE_COMMENT]=/--.*?$/,e[d.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,e[d.START_JS_PLACEHOLDER]={match:"${",push:a},e[d.BACKTICK]="`",e[d.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},e[d.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},e[d.START_QUOTE_SINGLE]={match:"'",push:c},e[d.START_QUOTE_DOUBLE]={match:'"',push:u},e[d.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const t={};t[h.SINGLE_LINE_COMMENT]=/\/\/.*?$/,t[h.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,t[h.SINGLE_QUOTE_STRING]=/'(?:\\['\\]|[^\n'\\])*'/,t[h.DOUBLE_QUOTE_STRING]=/"(?:\\["\\]|[^\n"\\])*"/,t[h.START_JS_TEMPLATE_STRING]={match:"`",push:s},t[h.START_JS_BLOCK]={match:"{",push:a},t[h.CLOSE_BLOCK]={match:"}",pop:1},t[h.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const r={};r[y.ESCAPED_BACKSLASH]=/\\\\/,r[y.ESCAPED_DOLLAR_BRACE]=/\\\${`/,r[y.START_JS_BLOCK]={match:"${",push:a},r[y.CLOSE_STRING]={match:"`",pop:1},r[y.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const n={};n[m.STATEMENT_SEPERATOR]=/[^\S\r\n]*---[^\S\r\n]*$/,n[m.SINGLE_LINE_COMMENT]=/--.*?$/,n[m.MULTI_LINE_COMMENT]=/\/\*[\s\S]*?\*\//,n[m.START_JS_PLACEHOLDER]={match:"${",push:a},n[m.CLOSE_BLOCK]={match:"}",pop:1},n[m.BACKTICK]="`",n[m.START_TRIPLE_QUOTE_SINGLE]={match:"'''",push:p},n[m.START_TRIPLE_QUOTE_DOUBLE]={match:'"""',push:f},n[m.START_QUOTE_SINGLE]={match:"'",push:c},n[m.START_QUOTE_DOUBLE]={match:'"',push:u},n[m.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const i={};i[g.ESCAPED_BACKSLASH]="\\\\",i[g.ESCAPED_QUOTE]="\\'",i[g.START_JS_PLACEHOLDER]={match:"${",push:a},i[g.CLOSE_QUOTE]={match:"'",pop:1},i[g.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const T={};T[b.ESCAPED_BACKSLASH]="\\\\",T[b.ESCAPED_QUOTE]={match:'\\"'},i[b.START_JS_PLACEHOLDER]={match:"${",push:a},T[b.CLOSE_QUOTE]={match:'"',pop:1},T[b.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const w={};w[O.ESCAPED_BACKSLASH]="\\\\",w[O.START_JS_PLACEHOLDER]={match:"${",push:a},w[O.CLOSE_QUOTE]={match:"'''",pop:1},w[O.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const E={};E[v.ESCAPED_BACKSLASH]="\\\\",E[v.START_JS_PLACEHOLDER]={match:"${",push:a},E[v.CLOSE_QUOTE]={match:'"""',pop:1},E[v.CAPTURE_EVERYTHING_ELSE]={match:/[\s\S]+?/,lineBreaks:!0};const S={};return S[o]=e,S[a]=t,S[s]=r,S[l]=n,S[c]=i,S[u]=T,S[p]=w,S[f]=E,S}());var w;!function(e){e[e.JAVASCRIPT=0]="JAVASCRIPT",e[e.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER=1]="JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER",e[e.SQL=2]="SQL",e[e.SQL_COMMENT=3]="SQL_COMMENT",e[e.SQL_LITERAL_STRING=4]="SQL_LITERAL_STRING",e[e.SQL_LITERAL_MULTILINE_STRING=5]="SQL_LITERAL_MULTILINE_STRING",e[e.SQL_STATEMENT_SEPARATOR=6]="SQL_STATEMENT_SEPARATOR"}(w=t.SyntaxTreeNodeType||(t.SyntaxTreeNodeType={}));const E=new Map([[d.START_CONFIG,w.JAVASCRIPT],[d.START_INCREMENTAL,w.SQL],[d.START_INPUT,w.SQL],[d.START_JS,w.JAVASCRIPT],[d.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[d.START_POST_OPERATIONS,w.SQL],[d.START_PRE_OPERATIONS,w.SQL],[d.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[d.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[d.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[d.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[h.START_JS_BLOCK,w.JAVASCRIPT],[y.START_JS_BLOCK,w.JAVASCRIPT],[m.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[m.START_QUOTE_SINGLE,w.SQL_LITERAL_STRING],[m.START_QUOTE_DOUBLE,w.SQL_LITERAL_STRING],[m.START_TRIPLE_QUOTE_SINGLE,w.SQL_LITERAL_MULTILINE_STRING],[m.START_TRIPLE_QUOTE_DOUBLE,w.SQL_LITERAL_MULTILINE_STRING],[g.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[b.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[O.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER],[v.START_JS_PLACEHOLDER,w.JAVASCRIPT_TEMPLATE_STRING_PLACEHOLDER]]),S=new Set([h.CLOSE_BLOCK,m.CLOSE_BLOCK,g.CLOSE_QUOTE,b.CLOSE_QUOTE,O.CLOSE_QUOTE,v.CLOSE_QUOTE]),j=new Map([[d.MULTI_LINE_COMMENT,w.SQL_COMMENT],[d.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[d.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR],[m.MULTI_LINE_COMMENT,w.SQL_COMMENT],[m.SINGLE_LINE_COMMENT,w.SQL_COMMENT],[m.STATEMENT_SEPERATOR,w.SQL_STATEMENT_SEPARATOR]]);class P{constructor(e,t=[]){this.type=e,this.allChildren=t}static create(e){const t=new P(w.SQL);let r=t;const n=[r];T.reset(e);for(const e of T){if(!e.type)throw new Error("Undefined token type encountered.");if(E.has(e.type)){const t=E.get(e.type);if(t===w.SQL&&r.type!==w.SQL)throw new Error("SQL syntax tree nodes may only be children of other SQL nodes.");const i=new P(t,[e.value]);n.push(i),r.push(i),r=i}else S.has(e.type)?(r.push(e.value),n.pop(),r=n[n.length-1]):j.has(e.type)?r.push(new P(j.get(e.type)).push(e.value)):r.push(e.value)}return t}static isSyntaxTreeNode(e){return"string"!=typeof e}children(){return this.allChildren.slice()}concatenate(e){const t=(null==e?void 0:e.has(this.type))?e.get(this.type):e=>e;return this.allChildren.map(e=>"string"==typeof e?t(e):e.concatenate()).join("")}push(e){return this.allChildren.length>0&&"string"==typeof e&&"string"==typeof this.allChildren[this.allChildren.length-1]?(this.allChildren[this.allChildren.length-1]=this.allChildren[this.allChildren.length-1]+e,this):(this.allChildren.push(e),this)}equals(e){if(this.type!==e.type)return!1;if(this.allChildren.length!==e.children().length)return!1;return!this.allChildren.some((t,r)=>{return n=t,i=e.children()[r],!(typeof n==typeof i&&("string"==typeof n||"string"==typeof i?n===i:n.equals(i)));var n,i})}}t.SyntaxTreeNode=P},function(e,t,r){var n,i,o;i=[],void 0===(o="function"==typeof(n=function(){"use strict";var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r="boolean"==typeof(new RegExp).sticky;function n(e){return e&&"[object RegExp]"===t.call(e)}function i(e){return e&&"object"==typeof e&&!n(e)&&!Array.isArray(e)}function o(e){return"("+e+")"}function a(e){return e.length?"(?:"+e.map((function(e){return"(?:"+e+")"})).join("|")+")":"(?!)"}function s(e){if("string"==typeof e)return"(?:"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(n(e)){if(e.ignoreCase)throw new Error("RegExp /i flag not allowed");if(e.global)throw new Error("RegExp /g flag is implied");if(e.sticky)throw new Error("RegExp /y flag is implied");if(e.multiline)throw new Error("RegExp /m flag is implied");return e.source}throw new Error("Not a pattern: "+e)}function l(t,r){if(i(r)||(r={match:r}),r.include)throw new Error("Matching rules cannot also include states");var o={defaultType:t,lineBreaks:!!r.error||!!r.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var a in r)e.call(r,a)&&(o[a]=r[a]);if("string"==typeof o.type&&t!==o.type)throw new Error("Type transform cannot be a string (type '"+o.type+"' for token '"+t+"')");var s=o.match;return o.match=Array.isArray(s)?s:s?[s]:[],o.match.sort((function(e,t){return n(e)&&n(t)?0:n(t)?-1:n(e)?1:t.length-e.length})),o}function c(e){return Array.isArray(e)?function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];if(n.include)for(var i=[].concat(n.include),o=0;o<i.length;o++)t.push({include:i[o]});else{if(!n.type)throw new Error("Rule has no type: "+JSON.stringify(n));t.push(l(n.type,n))}}return t}(e):function(e){for(var t=Object.getOwnPropertyNames(e),r=[],n=0;n<t.length;n++){var o=t[n],a=e[o],s=[].concat(a);if("include"!==o){var c=[];s.forEach((function(e){i(e)?(c.length&&r.push(l(o,c)),r.push(l(o,e)),c=[]):c.push(e)})),c.length&&r.push(l(o,c))}else for(var u=0;u<s.length;u++)r.push({include:s[u]})}return r}(e)}var u=l("error",{lineBreaks:!0,shouldThrow:!0});function p(e,t){for(var i=null,l=Object.create(null),c=!0,p=null,f=[],d=[],h=0;h<e.length;h++)e[h].fallback&&(c=!1);for(h=0;h<e.length;h++){var y=e[h];if(y.include)throw new Error("Inheritance is not allowed in stateless lexers");if(y.error||y.fallback){if(i)throw!y.fallback==!i.fallback?new Error("Multiple "+(y.fallback?"fallback":"error")+" rules not allowed (for token '"+y.defaultType+"')"):new Error("fallback and error are mutually exclusive (for token '"+y.defaultType+"')");i=y}var m=y.match.slice();if(c)for(;m.length&&"string"==typeof m[0]&&1===m[0].length;)l[m.shift().charCodeAt(0)]=y;if(y.pop||y.push||y.next){if(!t)throw new Error("State-switching options are not allowed in stateless lexers (for token '"+y.defaultType+"')");if(y.fallback)throw new Error("State-switching options are not allowed on fallback tokens (for token '"+y.defaultType+"')")}if(0!==m.length){c=!1,f.push(y);for(var g=0;g<m.length;g++){var b=m[g];if(n(b))if(null===p)p=b.unicode;else if(p!==b.unicode&&!1===y.fallback)throw new Error("If one rule is /u then all must be")}var O=a(m.map(s)),v=new RegExp(O);if(v.test(""))throw new Error("RegExp matches empty string: "+v);if(new RegExp("|"+O).exec("").length-1>0)throw new Error("RegExp has capture groups: "+v+"\nUse (?: … ) instead");if(!y.lineBreaks&&v.test("\n"))throw new Error("Rule should declare lineBreaks: "+v);d.push(o(O))}}var T=i&&i.fallback,w=r&&!T?"ym":"gm",E=r||T?"":"|";return!0===p&&(w+="u"),{regexp:new RegExp(a(d)+E,w),groups:f,fast:l,error:i||u}}function f(e,t,r){var n=e&&(e.push||e.next);if(n&&!r[n])throw new Error("Missing state '"+n+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw new Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var d=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};d.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},d.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedThrow:this.queuedThrow}},d.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},d.prototype.popState=function(){this.setState(this.stack.pop())},d.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var h=r?function(e,t){return e.exec(t)}:function(e,t){var r=e.exec(t);return 0===r[0].length?null:r};function y(){return this.value}if(d.prototype._getGroup=function(e){for(var t=this.groups.length,r=0;r<t;r++)if(void 0!==e[r+1])return this.groups[r];throw new Error("Cannot find token type for matched text")},d.prototype.next=function(){var e=this.index;if(this.queuedGroup){var t=this._token(this.queuedGroup,this.queuedText,e);return this.queuedGroup=null,this.queuedText="",t}var r=this.buffer;if(e!==r.length){if(a=this.fast[r.charCodeAt(e)])return this._token(a,r.charAt(e),e);var n=this.re;n.lastIndex=e;var i=h(n,r),o=this.error;if(null==i)return this._token(o,r.slice(e,r.length),e);var a=this._getGroup(i),s=i[0];return o.fallback&&i.index!==e?(this.queuedGroup=a,this.queuedText=s,this._token(o,r.slice(e,i.index),e)):this._token(a,s,e)}},d.prototype._token=function(e,t,r){var n=0;if(e.lineBreaks){var i=/\n/g,o=1;if("\n"===t)n=1;else for(;i.exec(t);)n++,o=i.lastIndex}var a={type:"function"==typeof e.type&&e.type(t)||e.defaultType,value:"function"==typeof e.value?e.value(t):t,text:t,toString:y,offset:r,lineBreaks:n,line:this.line,col:this.col},s=t.length;if(this.index+=s,this.line+=n,0!==n?this.col=s-o+1:this.col+=s,e.shouldThrow)throw new Error(this.formatError(a,"invalid syntax"));return e.pop?this.popState():e.push?this.pushState(e.push):e.next&&this.setState(e.next),a},"undefined"!=typeof Symbol&&Symbol.iterator){var m=function(e){this.lexer=e};m.prototype.next=function(){var e=this.lexer.next();return{value:e,done:!e}},m.prototype[Symbol.iterator]=function(){return this},d.prototype[Symbol.iterator]=function(){return new m(this)}}return d.prototype.formatError=function(e,t){if(null==e){var r=this.buffer.slice(this.index);e={text:r,offset:this.index,lineBreaks:-1===r.indexOf("\n")?0:1,line:this.line,col:this.col}}var n=Math.max(0,e.offset-e.col+1),i=e.lineBreaks?e.text.indexOf("\n"):e.text.length,o=this.buffer.substring(n,e.offset+i);return t+=" at line "+e.line+" col "+e.col+":\n\n",t+=" "+o+"\n",t+=" "+Array(e.col).join(" ")+"^"},d.prototype.clone=function(){return new d(this.states,this.state)},d.prototype.has=function(e){return!0},{compile:function(e){var t=p(c(e));return new d({start:t},"start")},states:function(e,t){var r=e.$all?c(e.$all):[];delete e.$all;var n=Object.getOwnPropertyNames(e);t||(t=n[0]);for(var i=Object.create(null),o=0;o<n.length;o++){var a=n[o];i[a]=c(e[a]).concat(r)}for(o=0;o<n.length;o++){a=n[o];for(var s=i[a],l=Object.create(null),u=0;u<s.length;u++){var h=s[u];if(h.include){var y=[u,1];if(h.include!==a&&!l[h.include]){l[h.include]=!0;var m=i[h.include];if(!m)throw new Error("Cannot include nonexistent state '"+h.include+"' (in state '"+a+"')");for(var g=0;g<m.length;g++){var b=m[g];-1===s.indexOf(b)&&y.push(b)}}s.splice.apply(s,y),u--}}}var O=Object.create(null);for(o=0;o<n.length;o++)a=n[o],O[a]=p(i[a],!0);for(o=0;o<n.length;o++){var v=n[o],T=O[v],w=T.groups;for(u=0;u<w.length;u++)f(w[u],v,O);var E=Object.getOwnPropertyNames(T.fast);for(u=0;u<E.length;u++)f(T.fast[E[u]],v,O)}return new d(O,t)},error:Object.freeze({error:!0}),fallback:Object.freeze({fallback:!0}),keywords:function(e){for(var t=Object.create(null),r=Object.create(null),n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var o=n[i],a=e[o];(Array.isArray(a)?a:[a]).forEach((function(e){if((r[e.length]=r[e.length]||[]).push(e),"string"!=typeof e)throw new Error("keyword must be string (in keyword '"+o+"')");t[e]=o}))}function s(e){return JSON.stringify(e)}var l="";for(var c in l+="switch (value.length) {\n",r){var u=r[c];l+="case "+c+":\n",l+="switch (value) {\n",u.forEach((function(e){var r=t[e];l+="case "+s(e)+": return "+s(r)+"\n"})),l+="}\n"}return l+="}\n",Function("value",l)}}})?n.apply(t,i):n)||(e.exports=o)},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(32),o=n(r(3)),a=r(0);t.genIndex=function(e){const t=i.decode64(a.dataform.GenerateIndexConfig,e),r=t.includePaths.map(e=>`\n try { global.${o.baseFilename(e)} = require("./${e}"); } catch (e) {\n session.compileError(e, "${e}");\n }`).join("\n"),n=t.definitionPaths.map(e=>`\n try { require("./${e}"); } catch (e) {\n session.compileError(e, "${e}");\n }`).join("\n"),s=JSON.stringify(a.dataform.ProjectConfig.create(t.compileConfig.projectConfigOverride).toJSON());return`\n// Read the project config.\nconst originalProjectConfig = require("./dataform.json");\n\n// Stop using the deprecated 'gcloudProjectId' field.\nif (!originalProjectConfig.defaultDatabase) {\n originalProjectConfig.defaultDatabase = originalProjectConfig.gcloudProjectId;\n}\ndelete originalProjectConfig.gcloudProjectId;\n\nlet projectConfig = { ...originalProjectConfig };\n\n// Merge in general project config overrides.\nprojectConfig = { ...projectConfig, ...${s}, vars: { ...projectConfig.vars, ...${s}.vars } };\n\n// Initialize the compilation session.\nconst session = require("@dataform/core").session;\nsession.init("${t.compileConfig.projectDir.replace(/\\/g,"\\\\")}", projectConfig, originalProjectConfig);\n\n// Allow "includes" files to use the current session object.\nglobal.dataform = session;\n\n// Require "includes" *.js files.\n${r}\n\n// Bind various @dataform/core APIs to the 'global' object.\nglobal.publish = session.publish.bind(session);\nglobal.operate = session.operate.bind(session);\nglobal.assert = session.assert.bind(session);\nglobal.declare = session.declare.bind(session);\nglobal.test = session.test.bind(session);\n\n// Require all "definitions" files (attaching them to the session).\n${n}\n\n// Return a base64 encoded proto via NodeVM. Returning a Uint8Array directly causes issues.\nreturn session.compileToBase64();`}},function(e,t,r){"use strict";e.exports=r(112)},function(e,t,r){"use strict";var n=e.exports=r(113);n.build="full",n.tokenize=r(58),n.parse=r(117),n.common=r(118),n.Root._configure(n.Type,n.parse,n.common)},function(e,t,r){"use strict";var n=e.exports=r(46);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(53),n.decoder=r(54),n.verifier=r(55),n.converter=r(56),n.ReflectionObject=r(11),n.Namespace=r(15),n.Root=r(38),n.Enum=r(6),n.Type=r(33),n.Field=r(9),n.OneOf=r(16),n.MapField=r(34),n.Service=r(35),n.Method=r(36),n.Message=r(37),n.wrappers=r(57),n.types=r(12),n.util=r(1),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},function(e,t,r){"use strict";function n(e,t){"string"==typeof e&&(t=e,e=void 0);var r=[];function i(e){if("string"!=typeof e){var t=o();if(n.verbose&&console.log("codegen: "+t),t="return "+t,e){for(var a=Object.keys(e),s=new Array(a.length+1),l=new Array(a.length),c=0;c<a.length;)s[c]=a[c],l[c]=e[a[c++]];return s[c]=t,Function.apply(null,s).apply(null,l)}return Function(t)()}for(var u=new Array(arguments.length-1),p=0;p<u.length;)u[p]=arguments[++p];if(p=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=u[p++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),p!==u.length)throw Error("parameter count mismatch");return r.push(e),i}function o(n){return"function "+(n||t||"")+"("+(e&&e.join(",")||"")+"){\n "+r.join("\n ")+"\n}"}return i.toString=o,i}e.exports=n,n.verbose=!1},function(e,t,r){"use strict";e.exports=o;var n=r(47),i=r(48)("fs");function o(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},function(e,t,r){"use strict";var n=t,i=n.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=n.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=i(e),n="";r&&(n=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return n+t.join("/")};n.resolve=function(e,t,r){return r||(t=o(t)),i(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},function(e,t,r){"use strict";e.exports=S,S.filename=null,S.defaults={keepCase:!1};var n=r(58),i=r(38),o=r(33),a=r(9),s=r(34),l=r(16),c=r(6),u=r(35),p=r(36),f=r(12),d=r(1),h=/^[1-9][0-9]*$/,y=/^-?[1-9][0-9]*$/,m=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,b=/^0[0-7]+$/,O=/^-?0[0-7]+$/,v=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,w=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,E=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function S(e,t,r){t instanceof i||(r=t,t=new i),r||(r=S.defaults);var j,P,A,k,x,N=r.preferTrailingComment||!1,C=n(e,r.alternateCommentMode||!1),R=C.next,_=C.push,I=C.peek,D=C.skip,L=C.cmnt,q=!0,B=!1,M=t,$=r.keepCase?function(e){return e}:d.camelCase;function U(e,t,r){var n=S.filename;return r||(S.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+C.line+")")}function Q(){var e,t=[];do{if('"'!==(e=R())&&"'"!==e)throw U(e);t.push(R()),D(e),e=I()}while('"'===e||"'"===e);return t.join("")}function G(e){var t=R();switch(t){case"'":case'"':return _(t),Q();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(h.test(e))return r*parseInt(e,10);if(m.test(e))return r*parseInt(e,16);if(b.test(e))return r*parseInt(e,8);if(v.test(e))return r*parseFloat(e);throw U(e,"number",t)}(t,!0)}catch(r){if(e&&w.test(t))return t;throw U(t,"value")}}function J(e,t){var r,n;do{!t||'"'!==(r=I())&&"'"!==r?e.push([n=K(R()),D("to",!0)?K(R()):n]):e.push(Q())}while(D(",",!0));D(";")}function K(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw U(e,"id");if(y.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(O.test(e))return parseInt(e,8);throw U(e,"id")}function F(){if(void 0!==j)throw U("package");if(j=R(),!w.test(j))throw U(j,"name");M=M.define(j),D(";")}function W(){var e,t=I();switch(t){case"weak":e=A||(A=[]),R();break;case"public":R();default:e=P||(P=[])}t=Q(),D(";"),e.push(t)}function V(){if(D("="),k=Q(),!(B="proto3"===k)&&"proto2"!==k)throw U(k,"syntax");D(";")}function z(e,t){switch(t){case"option":return ee(e,t),D(";"),!0;case"message":return Y(e,t),!0;case"enum":return Z(e,t),!0;case"service":return function(e,t){if(!T.test(t=R()))throw U(t,"service name");var r=new u(t);H(r,(function(e){if(!z(r,e)){if("rpc"!==e)throw U(e);!function(e,t){var r=L(),n=t;if(!T.test(t=R()))throw U(t,"name");var i,o,a,s,l=t;D("("),D("stream",!0)&&(o=!0);if(!w.test(t=R()))throw U(t);i=t,D(")"),D("returns"),D("("),D("stream",!0)&&(s=!0);if(!w.test(t=R()))throw U(t);a=t,D(")");var c=new p(l,n,i,a,o,s);c.comment=r,H(c,(function(e){if("option"!==e)throw U(e);ee(c,e),D(";")})),e.add(c)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!w.test(t=R()))throw U(t,"reference");var r=t;H(null,(function(t){switch(t){case"required":case"repeated":X(e,t,r);break;case"optional":X(e,B?"proto3_optional":"optional",r);break;default:if(!B||!w.test(t))throw U(t);_(t),X(e,"optional",r)}}))}(e,t),!0}return!1}function H(e,t,r){var n=C.line;if(e&&("string"!=typeof e.comment&&(e.comment=L()),e.filename=S.filename),D("{",!0)){for(var i;"}"!==(i=R());)t(i);D(";",!0)}else r&&r(),D(";"),e&&("string"!=typeof e.comment||N)&&(e.comment=L(n)||e.comment)}function Y(e,t){if(!T.test(t=R()))throw U(t,"type name");var r=new o(t);H(r,(function(e){if(!z(r,e))switch(e){case"map":!function(e){D("<");var t=R();if(void 0===f.mapKey[t])throw U(t,"type");D(",");var r=R();if(!w.test(r))throw U(r,"type");D(">");var n=R();if(!T.test(n))throw U(n,"name");D("=");var i=new s($(n),K(R()),t,r);H(i,(function(e){if("option"!==e)throw U(e);ee(i,e),D(";")}),(function(){ne(i)})),e.add(i)}(r);break;case"required":case"repeated":X(r,e);break;case"optional":X(r,B?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=R()))throw U(t,"name");var r=new l($(t));H(r,(function(e){"option"===e?(ee(r,e),D(";")):(_(e),X(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":J(r.extensions||(r.extensions=[]));break;case"reserved":J(r.reserved||(r.reserved=[]),!0);break;default:if(!B||!w.test(e))throw U(e);_(e),X(r,"optional")}})),e.add(r)}function X(e,t,r){var n=R();if("group"!==n){for(;n.endsWith(".")||I().startsWith(".");)n+=R();if(!w.test(n))throw U(n,"type");var i=R();if(!T.test(i))throw U(i,"name");i=$(i),D("=");var s=new a(i,K(R()),n,t,r);if(H(s,(function(e){if("option"!==e)throw U(e);ee(s,e),D(";")}),(function(){ne(s)})),"proto3_optional"===t){var c=new l("_"+i);s.setOption("proto3_optional",!0),c.add(s),e.add(c)}else e.add(s);B||!s.repeated||void 0===f.packed[n]&&void 0!==f.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=R();if(!T.test(r))throw U(r,"name");var n=d.lcFirst(r);r===n&&(r=d.ucFirst(r));D("=");var i=K(R()),s=new o(r);s.group=!0;var l=new a(n,i,r,t);l.filename=S.filename,H(s,(function(e){switch(e){case"option":ee(s,e),D(";");break;case"required":case"repeated":X(s,e);break;case"optional":X(s,B?"proto3_optional":"optional");break;case"message":Y(s,e);break;case"enum":Z(s,e);break;default:throw U(e)}})),e.add(s).add(l)}(e,t)}function Z(e,t){if(!T.test(t=R()))throw U(t,"name");var r=new c(t);H(r,(function(e){switch(e){case"option":ee(r,e),D(";");break;case"reserved":J(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw U(t,"name");D("=");var r=K(R(),!0),n={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};H(n,(function(e){if("option"!==e)throw U(e);ee(n,e),D(";")}),(function(){ne(n)})),e.add(t,r,n.comment,n.options)}(r,e)}})),e.add(r)}function ee(e,t){var r=D("(",!0);if(!w.test(t=R()))throw U(t,"name");var n,i=t,o=i;r&&(D(")"),o=i="("+i+")",t=I(),E.test(t)&&(n=t.slice(1),i+=t,R())),D("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,o,te(e,i),n)}function te(e,t){if(D("{",!0)){for(var r={};!D("}",!0);){if(!T.test(x=R()))throw U(x,"name");var n,i=x;if(D(":",!0),"{"===I())n=te(e,t+"."+x);else if("["===I()){var o;if(n=[],D("[",!0)){do{o=G(!0),n.push(o)}while(D(",",!0));D("]"),void 0!==o&&re(e,t+"."+x,o)}}else n=G(!0),re(e,t+"."+x,n);var a=r[i];a&&(n=[].concat(a).concat(n)),r[i]=n,D(",",!0),D(";",!0)}return r}var s=G(!0);return re(e,t,s),s}function re(e,t,r){e.setOption&&e.setOption(t,r)}function ne(e){if(D("[",!0)){do{ee(e,"option")}while(D(",",!0));D("]")}return e}for(;null!==(x=R());)switch(x){case"package":if(!q)throw U(x);F();break;case"import":if(!q)throw U(x);W();break;case"syntax":if(!q)throw U(x);V();break;case"option":ee(M,x),D(";");break;default:if(z(M,x)){q=!1;continue}throw U(x)}return S.filename=null,{package:j,imports:P,weakImports:A,syntax:k,root:t}}},function(e,t,r){"use strict";e.exports=o;var n,i=/\/|\./;function o(e,t){i.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:n={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:n}),o("empty",{Empty:{fields:{}}}),o("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),o("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(32),o=n(r(3)),a=r(0),s=require;t.main=function(e){var t;const r=global;let n;n="string"==typeof e?i.decode64(a.dataform.CoreExecutionRequest,e):a.dataform.CoreExecutionRequest.decode(e);const l=n.compile,c=s("dataform.json"),u=null!==(t=l.compileConfig.projectConfigOverride)&&void 0!==t?t:{};c.defaultDatabase||(c.defaultDatabase=c.gcloudProjectId),delete c.gcloudProjectId;let p=Object.assign({},c);p=Object.assign(Object.assign(Object.assign({},p),u),{vars:Object.assign(Object.assign({},p.vars),u.vars)});const f=s("@dataform/core").session;f.init(l.compileConfig.projectDir,p,c),r.dataform=f;const d={};l.compileConfig.filePaths.filter(e=>e.startsWith("includes"+o.pathSeperator)).filter(e=>2===e.split(o.pathSeperator).length).filter(e=>e.endsWith(".js")).forEach(e=>{try{d[o.baseFilename(e)]=s(e)}catch(t){f.compileError(t,e)}}),Object.assign(r,d),r.publish=f.publish.bind(f),r.operate=f.operate.bind(f),r.assert=f.assert.bind(f),r.declare=f.declare.bind(f),r.test=f.test.bind(f),l.compileConfig.filePaths.filter(e=>e.startsWith("definitions"+o.pathSeperator)).filter(e=>e.endsWith(".js")||e.endsWith(".sqlx")).forEach(e=>{try{s(e)}catch(t){f.compileError(t,e)}});const h=a.dataform.CoreExecutionResponse.create({compile:{compiledGraph:f.compile()}});return"string"==typeof e?i.encode64(a.dataform.CoreExecutionResponse,h):a.dataform.CoreExecutionResponse.encode(h).finish()}},function(e,t,r){"use strict";(function(e){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(121)),a=r(32),s=r(39),l=i(r(40)),c=r(51),u=r(123),p=r(52),f=r(31),d=r(59),h=i(r(124)),y=i(r(3)),m=r(3),g=r(60),b=r(0),O=new RegExp("HASH\\s*\\(\\s*\\w*\\s*\\)\\s*"),v={defaultSchema:"dataform",assertionSchema:"dataform_assertions"};function T(e){return"view"===e||"table"===e||"inline"===e||"incremental"===e}function w(e){return e.map(e=>`"${e}"`).join(" | ")}t.Session=class{constructor(e,t,r){this.init(e,t,r)}init(e,t,r){this.rootDir=e,this.config=t||v,this.canonicalConfig=function(e){return{warehouse:e.warehouse,defaultSchema:e.defaultSchema,defaultDatabase:e.defaultDatabase,assertionSchema:e.assertionSchema}}(r||t||v),this.actions=[],this.tests={},this.graphErrors={compilationErrors:[]}}get projectConfig(){return Object.freeze({warehouse:this.config.warehouse,defaultDatabase:this.config.defaultDatabase,defaultSchema:this.config.defaultSchema,assertionSchema:this.config.assertionSchema,databaseSuffix:this.config.databaseSuffix,schemaSuffix:this.config.schemaSuffix,tablePrefix:this.config.tablePrefix,vars:Object.freeze(Object.assign({},this.config.vars))})}adapter(){return l.create(this.config,g.version)}sqlxAction(e){const{sqlxConfig:t}=e;switch(e.sqlStatementCount>1&&"operations"!==t.type&&this.compileError("Actions may only contain more than one SQL statement if they are of type 'operations'."),t.hasOwnProperty("protected")&&"incremental"!==t.type&&this.compileError("Actions may only specify 'protected: true' if they are of type 'incremental'."),e.incrementalWhereContextable&&"incremental"!==t.type&&this.compileError("Actions may only include incremental_where if they are of type 'incremental'."),t.hasOwnProperty("schema")||"declaration"!==t.type||this.compileError("Actions of type 'declaration' must specify a value for 'schema'."),e.inputContextables.length>0&&"test"!==t.type&&this.compileError("Actions may only include input blocks if they are of type 'test'."),e.preOperationsContextable&&!T(t.type)&&this.compileError("Actions may only include pre_operations if they create a dataset."),e.postOperationsContextable&&!T(t.type)&&this.compileError("Actions may only include post_operations if they create a dataset."),t.hasOwnProperty("sqldatawarehouse")&&!["bigquery","snowflake"].includes(this.config.warehouse)&&this.compileError("Actions may only specify 'database' in projects whose warehouse is 'BigQuery' or 'Snowflake'."),t.type){case"view":case"table":case"inline":case"incremental":const r=this.publish(t.name).config(t).query(t=>e.sqlContextable(t)[0]);e.incrementalWhereContextable&&r.where(e.incrementalWhereContextable),e.preOperationsContextable&&r.preOps(e.preOperationsContextable),e.postOperationsContextable&&r.postOps(e.postOperationsContextable);break;case"assertion":this.assert(t.name).config(t).query(t=>e.sqlContextable(t)[0]);break;case"operations":this.operate(t.name).config(t).queries(e.sqlContextable);break;case"declaration":this.declare({database:t.database,schema:t.schema,name:t.name}).config(t);break;case"test":const n=this.test(t.name).config(t).expect(t=>e.sqlContextable(t)[0]);e.inputContextables.forEach(({refName:e,contextable:t})=>{n.input(e,t)});break;default:throw new Error("Unrecognized action type: "+t.type)}}resolve(e,...t){e=m.toResolvable(e,t);const r=this.indexedActions.find(y.resolvableAsTarget(e));r.length>1&&this.compileError(new Error(y.ambiguousActionNameMsg(e,r)));const n=r.length>0?r[0]:void 0;return n&&n instanceof f.Table&&n.proto.enumType===b.dataform.TableType.INLINE?`(${n.proto.query})`:(n&&n instanceof p.Operation&&!n.proto.hasOutput&&this.compileError(new Error("Actions cannot resolve operations which do not produce output.")),n?n instanceof u.Declaration?this.adapter().resolveTarget(n.proto.target):this.adapter().resolveTarget(Object.assign(Object.assign({},n.proto.target),{database:n.proto.target.database&&this.finalizeDatabase(n.proto.target.database),schema:this.finalizeSchema(n.proto.target.schema),name:this.finalizeName(n.proto.target.name)})):"string"==typeof e?this.adapter().resolveTarget(y.target(this.adapter(),this.config,this.finalizeName(e),this.finalizeSchema(this.config.defaultSchema),this.config.defaultDatabase&&this.finalizeDatabase(this.config.defaultDatabase))):this.adapter().resolveTarget(y.target(this.adapter(),this.config,this.finalizeName(e.name),this.finalizeSchema(e.schema),e.database&&this.finalizeName(e.database))))}operate(e,t){const r=new p.Operation;return r.session=this,y.setNameAndTarget(this,r.proto,e),t&&r.queries(t),r.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(r),r}publish(e,t){const r=new f.Table;return r.session=this,y.setNameAndTarget(this,r.proto,e),t&&("object"==typeof t?r.config(t):r.query(t)),r.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(r),r}assert(e,t){const r=new c.Assertion;return r.session=this,y.setNameAndTarget(this,r.proto,e,this.config.assertionSchema),t&&r.query(t),r.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(r),r}declare(e){const t=new u.Declaration;return t.session=this,y.setNameAndTarget(this,t.proto,e.name,e.schema,e.database),t.proto.fileName=y.getCallerFile(this.rootDir),this.actions.push(t),t}test(e){const t=new h.Test;return t.session=this,t.proto.name=e,t.proto.fileName=y.getCallerFile(this.rootDir),this.tests[e]=t,t}compileError(t,r,n){const i=r||y.getCallerFile(this.rootDir)||e,o=b.dataform.CompilationError.create({fileName:i,actionName:n?d.targetAsReadableString(n):void 0,actionTarget:n});"string"==typeof t?o.message=t:(o.message=t.message,o.stack=t.stack),this.graphErrors.compilationErrors.push(o)}compile(){if(this.indexedActions=new E(this.adapter(),this.actions),"bigquery"!==this.config.warehouse||this.config.defaultLocation||this.compileError("A defaultLocation is required for BigQuery. This can be configured in dataform.json.","dataform.json"),this.config.vars&&!Object.values(this.config.vars).every(e=>"string"==typeof e))throw new Error("Custom variables defined in dataform.json can only be strings.");const e=b.dataform.CompiledGraph.create({projectConfig:this.config,tables:this.compileGraphChunk(this.actions.filter(e=>e instanceof f.Table),b.dataform.Table.verify),operations:this.compileGraphChunk(this.actions.filter(e=>e instanceof p.Operation),b.dataform.Operation.verify),assertions:this.compileGraphChunk(this.actions.filter(e=>e instanceof c.Assertion),b.dataform.Assertion.verify),declarations:this.compileGraphChunk(this.actions.filter(e=>e instanceof u.Declaration),b.dataform.Declaration.verify),tests:this.compileGraphChunk(Object.values(this.tests),b.dataform.Test.verify),graphErrors:this.graphErrors,dataformCoreVersion:g.version,targets:this.actions.map(e=>e.proto.target)});return this.fullyQualifyDependencies([].concat(e.tables,e.assertions,e.operations)),this.alterActionName([].concat(e.tables,e.assertions,e.operations),[].concat(e.declarations.map(e=>e.target))),this.removeNonUniqueActionsFromCompiledGraph(e),this.checkTestNameUniqueness(e.tests),this.checkTableConfigValidity(e.tables),this.checkCircularity([].concat(e.tables,e.assertions,e.operations)),this.config.useRunCache&&this.checkRunCachingCorrectness([].concat(e.tables,e.assertions,e.operations.filter(e=>e.hasOutput))),y.throwIfInvalid(e,b.dataform.CompiledGraph.verify),e}compileToBase64(){return a.encode64(b.dataform.CompiledGraph,this.compile())}finalizeDatabase(e){return this.adapter().normalizeIdentifier(`${e}${this.getDatabaseSuffixWithUnderscore()}`)}finalizeSchema(e){return this.adapter().normalizeIdentifier(`${e}${this.getSchemaSuffixWithUnderscore()}`)}finalizeName(e){return this.adapter().normalizeIdentifier(`${this.getTablePrefixWithUnderscore()}${e}`)}getDatabaseSuffixWithUnderscore(){return this.config.databaseSuffix?"_"+this.config.databaseSuffix:""}getSchemaSuffixWithUnderscore(){return this.config.schemaSuffix?"_"+this.config.schemaSuffix:""}getTablePrefixWithUnderscore(){return this.config.tablePrefix?this.config.tablePrefix+"_":""}compileGraphChunk(e,t){const r=[];return e.forEach(e=>{try{const n=e.compile();y.throwIfInvalid(n,t),r.push(n)}catch(t){this.compileError(t,e.proto.fileName,e.proto.target)}}),r}fullyQualifyDependencies(e){e.forEach(e=>{const t={};for(const r of e.dependencyTargets){const n=this.indexedActions.find(r);if(0===n.length)this.compileError(new Error(`Missing dependency detected: Action "${d.targetAsReadableString(e.target)}" depends on "${y.stringifyResolvable(r)}" which does not exist`),e.fileName,e.target);else if(1===n.length){const r=n[0].proto;r instanceof b.dataform.Table&&r.enumType===b.dataform.TableType.INLINE?r.dependencyTargets.forEach(t=>e.dependencyTargets.push(t)):t[d.targetAsReadableString(r.target)]=r.target}else this.compileError(new Error(y.ambiguousActionNameMsg(r,n)),e.fileName,e.target)}e.dependencyTargets=Object.values(t)})}alterActionName(e,t){const{tablePrefix:r,schemaSuffix:n,databaseSuffix:i}=this.config;if(!r&&!n&&!i)return;const o=new s.StringifiedMap(d.targetStringifier);t.forEach(e=>o.set(e,e)),e.forEach(e=>{o.set(e.target,Object.assign(Object.assign({},e.target),{database:e.target.database&&this.adapter().normalizeIdentifier(`${e.target.database}${this.getDatabaseSuffixWithUnderscore()}`),schema:this.adapter().normalizeIdentifier(`${e.target.schema}${this.getSchemaSuffixWithUnderscore()}`),name:this.adapter().normalizeIdentifier(`${this.getTablePrefixWithUnderscore()}${e.target.name}`)})),e.target=o.get(e.target)});const a=e=>o.has(e)?o.get(e):e;e.forEach(e=>{e.dependencyTargets=(e.dependencyTargets||[]).map(a),e.parentAction&&(e.parentAction=a(e.parentAction))})}checkTableConfigValidity(e){e.forEach(e=>{var t,r;if(e.enumType===b.dataform.TableType.UNKNOWN_TYPE&&this.compileError("Wrong type of table detected. Should only use predefined types: "+w(f.TableType),e.fileName,e.target),e.materialized&&(e.enumType!==b.dataform.TableType.VIEW||"snowflake"!==this.config.warehouse&&"bigquery"!==this.config.warehouse)&&this.compileError(new Error("The 'materialized' option is only valid for Snowflake and BigQuery views"),e.fileName,e.target),e.snowflake&&(e.snowflake.secure&&e.enumType!==b.dataform.TableType.VIEW&&this.compileError(new Error("The 'secure' option is only valid for Snowflake views"),e.fileName,e.target),e.snowflake.transient&&e.enumType!==b.dataform.TableType.TABLE&&this.compileError(new Error("The 'transient' option is only valid for Snowflake tables"),e.fileName,e.target),(null===(t=e.snowflake.clusterBy)||void 0===t?void 0:t.length)>0&&e.enumType!==b.dataform.TableType.TABLE&&e.enumType!==b.dataform.TableType.INCREMENTAL&&this.compileError(new Error("The 'clusterBy' option is only valid for Snowflake tables"),e.fileName,e.target)),e.sqlDataWarehouse&&(e.uniqueKey&&e.uniqueKey.length>0&&this.compileError(new Error("Merging using unique keys for SQLDataWarehouse has not yet been implemented"),e.fileName,e.target),e.sqlDataWarehouse.distribution)){const t=e.sqlDataWarehouse.distribution.toUpperCase();"REPLICATE"===t||"ROUND_ROBIN"===t||O.test(t)||this.compileError(new Error("Invalid value for sqldatawarehouse distribution: "+t),e.fileName,e.target)}if(e.redshift){const t=(t,r)=>{const n=t[r];t.hasOwnProperty(r)?n instanceof Array&&0===n.length&&this.compileError(`Property "${r}" is not defined`,e.fileName,e.target):this.compileError(`Property "${r}" is not defined`,e.fileName,e.target)},r=(e,r)=>r.forEach(r=>t(e,r)),n=(t,r,n)=>{t[r]&&!n.includes(t[r])&&this.compileError(`Wrong value of "${r}" property. Should only use predefined values: ${w(n)}`,e.fileName,e.target)};(e.redshift.distStyle||e.redshift.distKey)&&(r(e.redshift,["distStyle","distKey"]),n(e.redshift,"distStyle",f.DistStyleType)),(e.redshift.sortStyle||e.redshift.sortKeys&&e.redshift.sortKeys.length)&&(r(e.redshift,["sortStyle","sortKeys"]),n(e.redshift,"sortStyle",f.SortStyleType))}e.bigquery&&((e.bigquery.partitionBy||(null===(r=e.bigquery.clusterBy)||void 0===r?void 0:r.length)||e.bigquery.partitionExpirationDays||e.bigquery.requirePartitionFilter)&&e.enumType===b.dataform.TableType.VIEW?this.compileError("partitionBy/clusterBy/requirePartitionFilter/partitionExpirationDays are not valid for BigQuery views; they are only valid for tables",e.fileName,e.target):e.bigquery.partitionBy||!e.bigquery.partitionExpirationDays&&!e.bigquery.requirePartitionFilter||e.enumType!==b.dataform.TableType.TABLE?e.bigquery.additionalOptions&&(e.bigquery.partitionExpirationDays&&e.bigquery.additionalOptions.partition_expiration_days&&this.compileError("partitionExpirationDays has been declared twice",e.fileName,e.target),e.bigquery.requirePartitionFilter&&e.bigquery.additionalOptions.require_partition_filter&&this.compileError("requirePartitionFilter has been declared twice",e.fileName,e.target)):this.compileError("requirePartitionFilter/partitionExpirationDays are not valid for non partitioned BigQuery tables",e.fileName,e.target)),e.enumType===b.dataform.TableType.INLINE&&f.Table.INLINE_IGNORED_PROPS.forEach(t=>{(function(e){if(!e)return!1;return Array.isArray(e)&&!!e.length||!Array.isArray(e)&&"object"==typeof e&&!!Object.keys(e).length||"object"!=typeof e})(e[t])&&this.compileError(`Unused property was detected: "${t}". This property is not used for tables with type "inline" and will be ignored`,e.fileName,e.target)})})}checkTestNameUniqueness(e){const t=[];e.forEach(e=>{t.includes(e.name)&&this.compileError(new Error(`Duplicate test name detected: "${e.name}"`),e.fileName),t.push(e.name)})}checkCircularity(e){const t=new Map(e.map(e=>[d.targetStringifier.stringify(e.target),e])),r=new o.default;e.forEach(e=>{const n=(e.dependencyTargets||[]).filter(e=>!!t.get(d.targetStringifier.stringify(e)));r.add(d.targetStringifier.stringify(e.target),n.map(e=>d.targetStringifier.stringify(e)))});r.getCycles().forEach(e=>{const r=t.get(e[0].name),n=`Circular dependency detected in chain: [${e.map(e=>e.name).join(" > ")} > ${d.targetAsReadableString(r.target)}]`;this.compileError(new Error(n),r.fileName,r.target)})}checkRunCachingCorrectness(e){e.forEach(e=>{var t;(null===(t=e.dependencyTargets)||void 0===t?void 0:t.length)>0||[b.dataform.ActionHermeticity.HERMETIC,b.dataform.ActionHermeticity.NON_HERMETIC].includes(e.hermeticity)||this.compileError(new Error("Zero-dependency actions which create datasets are required to explicitly declare 'hermetic: (true|false)' when run caching is turned on."),e.fileName,e.target)})}removeNonUniqueActionsFromCompiledGraph(e){function t(e){const t=new s.StringifiedSet(d.targetStringifier),r=new s.StringifiedSet(d.targetStringifier);return e.forEach(e=>{t.has(e)&&r.add(e),t.add(e)}),r}const r=[].concat(e.tables,e.assertions,e.operations,e.declarations),n=t(r.map(e=>e.target)),i=t(r.map(e=>e.canonicalTarget)),o=e=>{const t=n.has(e.target),r=i.has(e.canonicalTarget);return t&&this.compileError(new Error("Duplicate action name detected. Names within a schema must be unique across tables, declarations, assertions, and operations"),e.fileName,e.target),r&&this.compileError(new Error(`Duplicate canonical target detected. Canonical targets must be unique across tables, declarations, assertions, and operations:\n"${JSON.stringify(e.canonicalTarget)}"`),e.fileName,e.target),!t&&!r};e.tables=e.tables.filter(o),e.operations=e.operations.filter(o),e.declarations=e.declarations.filter(o),e.assertions=e.assertions.filter(o)}};class E{constructor(e,t){this.adapter=e,this.byName=new Map,this.bySchemaAndName=new Map,this.byDatabaseAndName=new Map,this.byDatabaseSchemaAndName=new Map;for(const e of t){this.byName.has(e.proto.target.name)||this.byName.set(e.proto.target.name,[]),this.byName.get(e.proto.target.name).push(e),this.bySchemaAndName.has(e.proto.target.schema)||this.bySchemaAndName.set(e.proto.target.schema,new Map);const t=this.bySchemaAndName.get(e.proto.target.schema);if(t.has(e.proto.target.name)||t.set(e.proto.target.name,[]),t.get(e.proto.target.name).push(e),e.proto.target.database){this.byDatabaseAndName.has(e.proto.target.database)||this.byDatabaseAndName.set(e.proto.target.database,new Map);const t=this.byDatabaseAndName.get(e.proto.target.database);t.has(e.proto.target.name)||t.set(e.proto.target.name,[]),t.get(e.proto.target.name).push(e),this.byDatabaseSchemaAndName.has(e.proto.target.database)||this.byDatabaseSchemaAndName.set(e.proto.target.database,new Map);const r=this.byDatabaseSchemaAndName.get(e.proto.target.database);r.has(e.proto.target.schema)||r.set(e.proto.target.schema,new Map);const n=r.get(e.proto.target.schema);n.has(e.proto.target.name)||n.set(e.proto.target.name,[]),n.get(e.proto.target.name).push(e)}}}find(e){return e.database?e.schema?this.byDatabaseSchemaAndName.get(this.adapter.normalizeIdentifier(e.database)).get(this.adapter.normalizeIdentifier(e.schema)).get(this.adapter.normalizeIdentifier(e.name))||[]:this.byDatabaseAndName.get(this.adapter.normalizeIdentifier(e.database)).get(this.adapter.normalizeIdentifier(e.name))||[]:e.schema?this.bySchemaAndName.get(this.adapter.normalizeIdentifier(e.schema)).get(this.adapter.normalizeIdentifier(e.name))||[]:this.byName.get(this.adapter.normalizeIdentifier(e.name))||[]}}}).call(this,"/index.js")},function(e,t){class r{constructor(e,t){this.name=e,this.successors=t,this.reset()}reset(){this.index=-1,this.lowLink=-1,this.onStack=!1,this.visited=!1}}class n{constructor(){this.vertices={}}add(e,t){const n=(t=Array.isArray(t)?t:[t]).map(e=>(this.vertices[e]||(this.vertices[e]=new r(e,[])),this.vertices[e]));return this.vertices[e]||(this.vertices[e]=new r(e)),this.vertices[e].successors=n.concat([]).reverse(),this}reset(){Object.keys(this.vertices).forEach(e=>{this.vertices[e].reset()})}addAndVerify(e,t){this.add(e,t);const r=this.getCycles();if(r.length){let e=`Detected ${r.length} cycle${1===r.length?"":"s"}:`;e+="\n"+r.map(e=>{const t=e.map(e=>e.name);return` ${t.join(" -> ")} -> ${t[0]}`}).join("\n");const t=new Error(e);throw t.cycles=r,t}return this}dfs(e,t){this.reset();const r=[this.vertices[e]];let n;for(;n=r.pop();)n.visited||(t(n),n.visited=!0,n.successors.forEach(e=>r.push(e)))}getDescendants(e){const t=[];let r=!0;return this.dfs(e,e=>{r?r=!1:t.push(e.name)}),t}hasCycle(){return this.getCycles().length>0}getStronglyConnectedComponents(){const e=Object.keys(this.vertices).map(e=>(this.vertices[e].reset(),this.vertices[e]));let t=0;const r=[],n=[],i=e=>{if(e.index=t,e.lowLink=t,t++,r.push(e),e.onStack=!0,e.successors.forEach(t=>{t.index<0?(i(t),e.lowLink=Math.min(e.lowLink,t.lowLink)):t.onStack&&(e.lowLink=Math.min(e.lowLink,t.index))}),e.lowLink===e.index){const t=[];let i;do{i=r.pop(),i.onStack=!1,t.push(i)}while(i!==e);n.push(t)}};return e.forEach((function(e){e.index<0&&i(e)})),n}getCycles(){return this.getStronglyConnectedComponents().filter(e=>{if(e.length>1)return!0;const t=e[0];return t&&t.successors.some(e=>e===t)})}clone(){const e=new n;return Object.keys(this.vertices).forEach(t=>{const r=this.vertices[t];e.add(r.name,r.successors.map(e=>e.name))}),e}toDot(){const e=this.vertices,t=["digraph {"];return this.getCycles().forEach((e,r)=>{t.push(" subgraph cluster"+r+" {"),t.push(" color=red;"),t.push(" "+e.map(e=>e.name).join("; ")+";"),t.push(" }")}),Object.keys(e).forEach(r=>{const n=e[r];n.successors.length&&n.successors.forEach(e=>{t.push(` ${n.name} -> ${e.name}`)})}),t.push("}"),t.join("\n")+"\n"}}e.exports=n},function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},a={};function s(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=c(e,(0|e)<0?-1:0,!0),i&&(a[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function l(e,t){if(isNaN(e))return t?b:g;if(t){if(e<0)return b;if(e>=h)return E}else{if(e<=-y)return S;if(e+1>=y)return w}return e<0?l(-e,t).neg():c(e%d|0,e/d|0,t)}function c(e,t,r){return new n(e,t,r)}n.fromInt=s,n.fromNumber=l,n.fromBits=c;var u=Math.pow;function p(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return p(e.substring(1),t,r).neg();for(var i=l(u(r,8)),o=g,a=0;a<e.length;a+=8){var s=Math.min(8,e.length-a),c=parseInt(e.substring(a,a+s),r);if(s<8){var f=l(u(r,s));o=o.mul(f).add(l(c))}else o=(o=o.mul(i)).add(l(c))}return o.unsigned=t,o}function f(e,t){return"number"==typeof e?l(e,t):"string"==typeof e?p(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=p,n.fromValue=f;var d=4294967296,h=d*d,y=h/2,m=s(1<<24),g=s(0);n.ZERO=g;var b=s(0,!0);n.UZERO=b;var O=s(1);n.ONE=O;var v=s(1,!0);n.UONE=v;var T=s(-1);n.NEG_ONE=T;var w=c(-1,2147483647,!1);n.MAX_VALUE=w;var E=c(-1,-1,!0);n.MAX_UNSIGNED_VALUE=E;var S=c(0,-2147483648,!1);n.MIN_VALUE=S;var j=n.prototype;j.toInt=function(){return this.unsigned?this.low>>>0:this.low},j.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},j.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(S)){var t=l(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=l(u(e,6),this.unsigned),o=this,a="";;){var s=o.div(i),c=(o.sub(s.mul(i)).toInt()>>>0).toString(e);if((o=s).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},j.getHighBits=function(){return this.high},j.getHighBitsUnsigned=function(){return this.high>>>0},j.getLowBits=function(){return this.low},j.getLowBitsUnsigned=function(){return this.low>>>0},j.getNumBitsAbs=function(){if(this.isNegative())return this.eq(S)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},j.isZero=function(){return 0===this.high&&0===this.low},j.eqz=j.isZero,j.isNegative=function(){return!this.unsigned&&this.high<0},j.isPositive=function(){return this.unsigned||this.high>=0},j.isOdd=function(){return 1==(1&this.low)},j.isEven=function(){return 0==(1&this.low)},j.equals=function(e){return i(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},j.eq=j.equals,j.notEquals=function(e){return!this.eq(e)},j.neq=j.notEquals,j.ne=j.notEquals,j.lessThan=function(e){return this.comp(e)<0},j.lt=j.lessThan,j.lessThanOrEqual=function(e){return this.comp(e)<=0},j.lte=j.lessThanOrEqual,j.le=j.lessThanOrEqual,j.greaterThan=function(e){return this.comp(e)>0},j.gt=j.greaterThan,j.greaterThanOrEqual=function(e){return this.comp(e)>=0},j.gte=j.greaterThanOrEqual,j.ge=j.greaterThanOrEqual,j.compare=function(e){if(i(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},j.comp=j.compare,j.negate=function(){return!this.unsigned&&this.eq(S)?S:this.not().add(O)},j.neg=j.negate,j.add=function(e){i(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,a=e.high>>>16,s=65535&e.high,l=e.low>>>16,u=0,p=0,d=0,h=0;return d+=(h+=o+(65535&e.low))>>>16,p+=(d+=n+l)>>>16,u+=(p+=r+s)>>>16,u+=t+a,c((d&=65535)<<16|(h&=65535),(u&=65535)<<16|(p&=65535),this.unsigned)},j.subtract=function(e){return i(e)||(e=f(e)),this.add(e.neg())},j.sub=j.subtract,j.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=f(e)),r)return c(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(S))return e.isOdd()?S:g;if(e.eq(S))return this.isOdd()?S:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return l(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,a=65535&this.low,s=e.high>>>16,u=65535&e.high,p=e.low>>>16,d=65535&e.low,h=0,y=0,b=0,O=0;return b+=(O+=a*d)>>>16,y+=(b+=o*d)>>>16,b&=65535,y+=(b+=a*p)>>>16,h+=(y+=n*d)>>>16,y&=65535,h+=(y+=o*p)>>>16,y&=65535,h+=(y+=a*u)>>>16,h+=t*d+n*p+o*u+a*s,c((b&=65535)<<16|(O&=65535),(h&=65535)<<16|(y&=65535),this.unsigned)},j.mul=j.multiply,j.divide=function(e){if(i(e)||(e=f(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?b:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return b;if(e.gt(this.shru(1)))return v;o=b}else{if(this.eq(S))return e.eq(O)||e.eq(T)?S:e.eq(S)?O:(t=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?O:T:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(S))return this.unsigned?b:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=g}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(t)/Math.LN2),s=a<=48?1:u(2,a-48),p=l(t),d=p.mul(e);d.isNegative()||d.gt(n);)d=(p=l(t-=s,this.unsigned)).mul(e);p.isZero()&&(p=O),o=o.add(p),n=n.sub(d)}return o},j.div=j.divide,j.modulo=function(e){return i(e)||(e=f(e)),r?c((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},j.mod=j.modulo,j.rem=j.modulo,j.not=function(){return c(~this.low,~this.high,this.unsigned)},j.and=function(e){return i(e)||(e=f(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},j.or=function(e){return i(e)||(e=f(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},j.xor=function(e){return i(e)||(e=f(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},j.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},j.shl=j.shiftLeft,j.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},j.shr=j.shiftRight,j.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},j.shru=j.shiftRightUnsigned,j.shr_u=j.shiftRightUnsigned,j.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},j.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},j.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},j.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},j.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(30),i=r(3),o=r(0);t.IDeclarationConfigProperties=i.strictKeysOf()(["columns","database","description","name","schema","type"]);t.Declaration=class{constructor(){this.proto=o.dataform.Declaration.create()}config(e){return i.checkExcessProperties(e=>this.session.compileError(e),e,t.IDeclarationConfigProperties,"declaration config"),e.description&&this.description(e.description),e.columns&&this.columns(e.columns),this}description(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.description=e,this}columns(e){return this.proto.actionDescriptor||(this.proto.actionDescriptor={}),this.proto.actionDescriptor.columns=n.ColumnDescriptors.mapToColumnProtoArray(e,e=>this.session.compileError(e)),this}compile(){return this.proto}}},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const i=r(39),o=n(r(31)),a=r(59),s=r(3),l=r(0),c=s.strictKeysOf()(["type","dataset","name"]);t.Test=class{constructor(){this.proto=l.dataform.Test.create(),this.contextableInputs=new i.StringifiedMap(a.targetStringifier)}config(e){return s.checkExcessProperties(e=>this.session.compileError(e),e,c,"test config"),e.dataset&&this.dataset(e.dataset),this}dataset(e){return this.datasetToTest=e,this}input(e,t){return this.contextableInputs.set(s.resolvableAsTarget(s.toResolvable(e)),t),this}expect(e){return this.contextableQuery=e,this}compile(){const e=new u(this);if(this.datasetToTest){const t=this.session.indexedActions.find(s.resolvableAsTarget(this.datasetToTest));t.length>1&&this.session.compileError(new Error(s.ambiguousActionNameMsg(this.datasetToTest,t)),this.proto.fileName);const r=t.length>0?t[0]:void 0;if(r&&r instanceof o.Table)if(r.proto.enumType===l.dataform.TableType.INCREMENTAL)this.session.compileError(new Error("Running tests on incremental datasets is not yet supported."),this.proto.fileName);else{const t=new p(e);this.proto.testQuery=t.apply(r.contextableQuery)}else this.session.compileError(new Error(`Dataset ${s.stringifyResolvable(this.datasetToTest)} could not be found.`),this.proto.fileName)}else this.session.compileError(new Error("Tests must operate upon a specified dataset."),this.proto.fileName);return this.proto.expectedOutputQuery=e.apply(this.contextableQuery),this.proto}};class u{constructor(e){this.test=e}apply(e){return"function"==typeof e?e(this):e}}t.TestContext=u;class p{constructor(e){this.testContext=e}ref(e,...t){return this.resolve(e,...t)}resolve(e,...t){const r=s.resolvableAsTarget(s.toResolvable(e,t));return this.testContext.test.contextableInputs.has(r)?`(${this.testContext.apply(this.testContext.test.contextableInputs.get(r))})`:(this.testContext.test.session.compileError(new Error(`Input for dataset "${JSON.stringify(r)}" has not been provided. Provided inputs: ${Array.from(this.testContext.test.contextableInputs.keys()).map(e=>JSON.stringify(e))}`)),"")}apply(e){return"function"==typeof e?e(this):e}config(e){return""}self(){return""}name(){return""}type(e){return""}schema(){return""}database(){return""}where(e){return""}when(e,t,r=""){return e?t:r}incremental(){return!1}preOps(e){return""}postOps(e){return""}disabled(){return""}redshift(e){return""}bigquery(e){return""}dependencies(e){return""}tags(e){return""}}}]);