@malloy-publisher/app 0.0.218 → 0.0.220
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api-doc.yaml +262 -25
- package/dist/assets/{EnvironmentPage-DxOiCxcd.js → EnvironmentPage-BqLiaatL.js} +1 -1
- package/dist/assets/{HomePage-i8qAtD6x.js → HomePage-G_xpt9XE.js} +1 -1
- package/dist/assets/LightMode-s1PDRIsF.js +1 -0
- package/dist/assets/MainPage-C6TfpC92.js +2 -0
- package/dist/assets/{MaterializationsPage-6OEVM543.js → MaterializationsPage-BMO1afhm.js} +1 -1
- package/dist/assets/ModelPage-zHOJwMnU.js +1 -0
- package/dist/assets/{PackagePage-BVmoVsPQ.js → PackagePage-GCaWmELQ.js} +1 -1
- package/dist/assets/{RouteError-DFX521_t.js → RouteError-CIC588k4.js} +1 -1
- package/dist/assets/ThemeEditorPage-BdbIfIGO.js +1 -0
- package/dist/assets/{WorkbookPage-CzucDJ-T.js → WorkbookPage-C8ucK_H8.js} +1 -1
- package/dist/assets/{core-B95VQkAV.es-Cbn-yKG-.js → core-DFvqRVqM.es-NtfPVC7h.js} +1 -1
- package/dist/assets/github-dark-DenFmJkN.es-DHJKELXO.js +1 -0
- package/dist/assets/index-8E2uLeV9.js +2541 -0
- package/dist/assets/index-B3NcDPbp.js +18 -0
- package/dist/assets/index-BxDMCn3s.js +527 -0
- package/dist/assets/index-aYNf0kTZ.js +1 -0
- package/dist/assets/index-aYtt-ovi.js +1761 -0
- package/dist/assets/index-w_0OQJgZ.js +23 -0
- package/dist/index.html +1 -1
- package/package.json +3 -2
- package/dist/assets/MainPage-B58d5pmX.js +0 -2
- package/dist/assets/ModelPage-8d5l7YkU.js +0 -1
- package/dist/assets/index--xJ1pzL-.js +0 -455
- package/dist/assets/index-Bxkza-hz.js +0 -40
- package/dist/assets/index-DxRKma36.js +0 -1760
- package/dist/assets/index.umd-o-yUIEtS.js +0 -2467
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
var te={},ae={},me;function $e(){if(me)return ae;me=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.Tag=void 0,ae.interfaceFromTag=E,ae.interfaceFromDict=M;class a{get parent(){return this._parent}get root(){let i=this;for(;i._parent!==void 0;)i=i._parent;return i}static id(i){let e=a.ids.get(i);return e===void 0&&(e=a.nextTagId,a.ids.set(i,e),a.nextTagId+=1),e}peek(i=0){const e=" ".repeat(i);let t=`#${a.id(this)}`;if(this.properties===void 0&&this.eq&&typeof this.eq=="string")return t+`=${this.eq}`;if(t+=" {",this.eq!==void 0&&(Array.isArray(this.eq)?t+=`
|
|
2
|
+
${e} =: [
|
|
3
|
+
${e} ${this.eq.map(n=>n.peek(i+4)).join(`
|
|
4
|
+
${e} `)}
|
|
5
|
+
${e} ]`:t+=`
|
|
6
|
+
${e} =: ${this.eq}`),this.properties)for(const n in this.properties)t+=`
|
|
7
|
+
${e} ${n}: ${this.properties[n].peek(i+2)}`;return t+=`
|
|
8
|
+
${e}}`,t}constructor(i={},e){if(this._read=!1,e!==void 0&&(this._parent=e),i.eq!==void 0&&(Array.isArray(i.eq)?this.eq=i.eq.map(t=>t instanceof a?t:new a(t,this)):this.eq=i.eq),i.properties){this.properties={};for(const[t,n]of Object.entries(i.properties))this.properties[t]=n instanceof a?n:new a(n,this)}i.deleted&&(this.deleted=i.deleted),i.prefix&&(this.prefix=i.prefix)}static withPrefix(i){return new a({prefix:i})}tag(...i){return this.find(i)}text(...i){var e;const t=(e=this.find(i))===null||e===void 0?void 0:e.getEq();if(!(t===void 0||Array.isArray(t)))return t instanceof Date?t.toISOString():String(t)}scalarType(...i){var e;const t=i.length>0?(e=this.find(i))===null||e===void 0?void 0:e.getEq():this.getEq();if(!(t===void 0||Array.isArray(t)))return t instanceof Date?"date":typeof t}numeric(...i){var e;const t=(e=this.find(i))===null||e===void 0?void 0:e.getEq();if(typeof t=="number")return t;if(typeof t=="string"){const n=Number.parseFloat(t);if(!Number.isNaN(n))return n}}boolean(...i){var e;const t=(e=this.find(i))===null||e===void 0?void 0:e.getEq();if(typeof t=="boolean")return t}isTrue(...i){var e;return((e=this.find(i))===null||e===void 0?void 0:e.getEq())===!0}isFalse(...i){var e;return((e=this.find(i))===null||e===void 0?void 0:e.getEq())===!1}date(...i){var e;const t=(e=this.find(i))===null||e===void 0?void 0:e.getEq();if(t instanceof Date)return t}bare(...i){const e=this.find(i);if(e!==void 0)return!e.hasProperties()}getEq(){return this.eq}getProperty(i){var e;return(e=this.properties)===null||e===void 0?void 0:e[i]}getArrayElement(i){if(Array.isArray(this.eq)&&i<this.eq.length)return this.eq[i]}get dict(){var i;return(i=this.properties)!==null&&i!==void 0?i:{}}*entries(){if(this.properties)for(const i in this.properties)yield[i,this.properties[i]]}*keys(){if(this.properties)for(const i in this.properties)yield i}hasProperties(){return this.properties!==void 0&&Object.keys(this.properties).length>0}array(...i){const e=this.find(i);if(e===void 0)return;const t=e.getEq();if(Array.isArray(t))return t.map((n,u)=>e.getArrayElement(u))}textArray(...i){const e=this.find(i);if(e===void 0)return;const t=e.getEq();if(Array.isArray(t))return t.reduce((n,u,d)=>{const s=e.getArrayElement(d),o=s?.getEq();return o===void 0||Array.isArray(o)?n:o instanceof Date?n.concat(o.toISOString()):n.concat(String(o))},[])}numericArray(...i){const e=this.find(i);if(e===void 0)return;const t=e.getEq();if(Array.isArray(t))return t.reduce((n,u,d)=>{const s=e.getArrayElement(d),o=s?.getEq();if(typeof o=="number")return n.concat(o);if(typeof o=="string"){const g=Number.parseFloat(o);if(!Number.isNaN(g))return n.concat(g)}return n},[])}getProperties(){return this.properties===void 0&&(this.properties={}),this.properties}clone(i){this._read=!0;const e=new a({},i);if(e.prefix=this.prefix,e.deleted=this.deleted,e.location=this.location,e._clonedFrom=this,this.eq!==void 0&&(Array.isArray(this.eq)?e.eq=this.eq.map(t=>t.clone(e)):e.eq=this.eq instanceof Date?new Date(this.eq):this.eq),this.properties){e.properties={};for(const[t,n]of Object.entries(this.properties))e.properties[t]=n.clone(e)}return e}toJSON(){const i={};if(this.eq!==void 0&&(Array.isArray(this.eq)?i.eq=this.eq.map(e=>e.toJSON()):i.eq=this.eq),this.properties!==void 0){i.properties={};for(const[e,t]of Object.entries(this.properties))i.properties[e]=t.toJSON()}return this.deleted&&(i.deleted=!0),this.prefix&&(i.prefix=this.prefix),this.location&&(i.location=this.location),i}validateReferences(){const i=[];return this.collectReferenceErrors(i,[]),i}collectReferenceErrors(i,e){if(this.properties)for(const[t,n]of Object.entries(this.properties))n.deleted||n.collectReferenceErrors(i,[...e,t]);Array.isArray(this.eq)&&this.eq.forEach((t,n)=>{t.collectReferenceErrors(i,[...e,`[${n}]`])})}static escapeString(i){return i.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n")}static escapeProp(i){return i.replace(/\\/g,"\\\\").replace(/`/g,"\\`")}static quoteAndEscape(i,e=!1){return i.match(/^[0-9A-Za-z_]+$/)?i:e?`\`${a.escapeProp(i)}\``:`"${a.escapeString(i)}"`}static serializeScalar(i){return typeof i=="boolean"?i?"@true":"@false":i instanceof Date?`@${i.toISOString()}`:typeof i=="number"?String(i):a.quoteAndEscape(i)}toString(){var i;let e=(i=this.prefix)!==null&&i!==void 0?i:"# ";function t(d){var s;const o=Object.keys((s=d.properties)!==null&&s!==void 0?s:{});for(let g=0;g<o.length;g++)u(o[g],d.properties[o[g]]),g<o.length-1&&(e+=" ")}function n(d,s=!1){if(d.eq!==void 0)if(s||(e+=" = "),Array.isArray(d.eq)){e+="[";for(let o=0;o<d.eq.length;o++)n(d.eq[o],!0),o!==d.eq.length-1&&(e+=", ");e+="]"}else e+=a.serializeScalar(d.eq);if(d.properties){const o=Object.keys(d.properties);!s&&o.length===1&&!o.some(g=>{var y;return((y=d.properties)!==null&&y!==void 0?y:{})[g].deleted})&&d.eq===void 0?(e+=".",t(d)):((!s||d.eq!==void 0)&&(e+=" "),e+="{ ",t(d),e+=" }")}}function u(d,s){if(s.deleted){e+=`-${a.quoteAndEscape(d,!0)}`;return}e+=a.quoteAndEscape(d,!0),n(s)}return t(this),e+=`
|
|
9
|
+
`,e}find(i){let e=this;for(const t of i){let n;if(typeof t=="number"?n=e.getArrayElement(t):n=e.getProperty(t),n===void 0)return;n.markRead(),e=n}return e.deleted?void 0:e}markRead(){this._read=!0,this._clonedFrom&&(this._clonedFrom._read=!0)}get wasRead(){return this._read}*walk(i=[]){if(this.properties)for(const[e,t]of Object.entries(this.properties)){if(t.deleted)continue;const n=[...i,e];yield{path:n,tag:t},yield*t.walk(n)}if(Array.isArray(this.eq))for(let e=0;e<this.eq.length;e++){const t=[...i,e.toString()];yield{path:t,tag:this.eq[e]},yield*this.eq[e].walk(t)}}resetReadTracking(){this._read=!1;for(const{tag:i}of this.walk())i._read=!1}getUnreadProperties(i=[]){const e=[];if(this.properties)for(const[t,n]of Object.entries(this.properties)){if(n.deleted)continue;const u=[...i,t];n._read?e.push(...n.getUnreadProperties(u)):e.push(u)}return e}has(...i){return this.find(i)!==void 0}set(i,e=null){let t=this,n,u;for(const d of i)if(n=t,u=d,typeof d=="number"){if(t.eq===void 0||!Array.isArray(t.eq))t.eq=Array.from({length:d+1}).map(()=>new a({},t));else if(t.eq.length<=d){const s=t.eq,o=Array.from({length:d+1}).map((g,y)=>y<s.length?s[y]:new a({},t));t.eq=o}t=t.eq[d]}else{const s=t.properties;s===void 0?(t.properties={[d]:new a({},t)},t=t.properties[d]):d in s?(t=s[d],t.deleted&&(t.deleted=!1)):(s[d]=new a({},t),t=s[d])}if(e===null)t.eq=void 0;else if(e instanceof a){const d=e.clone(n);n&&u!==void 0&&(typeof u=="number"&&Array.isArray(n.eq)?n.eq[u]=d:typeof u=="string"&&n.properties&&(n.properties[u]=d))}else typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e instanceof Date?t.eq=e:Array.isArray(e)&&(t.eq=e.map(d=>new a({eq:d},t)));return this}delete(...i){return this.remove(i,!1)}unset(...i){return this.remove(i,!0)}remove(i,e=!1){var t;let n=this;for(const d of i.slice(0,i.length-1))if(typeof d=="number"){if(n.eq===void 0||!Array.isArray(n.eq)){if(!e)return this;n.eq=Array.from({length:d}).map(()=>new a({},n))}else if(n.eq.length<=d){if(!e)return this;const s=n.eq,o=Array.from({length:d}).map((g,y)=>y<s.length?s[y]:new a({},n));n.eq=o}n=n.eq[d]}else{const s=n.properties;if(s===void 0){if(!e)return this;n.properties={[d]:new a({},n)},n=n.properties[d]}else if(d in s)n=s[d];else{if(!e)return this;s[d]=new a({},n),n=s[d]}}const u=i[i.length-1];return typeof u=="string"?n.properties&&u in n.properties?delete n.properties[u]:e&&((t=n.properties)!==null&&t!==void 0||(n.properties={}),n.properties[u]=new a({deleted:!0},n)):Array.isArray(n.eq)&&n.eq.splice(u,1),this}}ae.Tag=a,a.ids=new Map,a.nextTagId=1e3;function E(C){const i={};return C.eq!==void 0&&(Array.isArray(C.eq)?i.eq=C.eq.map(e=>E(e)):i.eq=C.eq),C.properties!==void 0&&(i.properties=M(C.properties)),C.deleted&&(i.deleted=!0),i}function M(C){const i={};for(const[e,t]of Object.entries(C))i[e]=E(t);return i}return ae}var ue={},ve={},se={},ke;function le(){if(ke)return se;ke=1,Object.defineProperty(se,"__esModule",{value:!0}),se.formatRef=a,se.isRef=E,se.isDataNode=M,se.isEnvRef=C,se.isMotlyError=i;function a(e){let t="$";for(let u=0;u<e.linkUps;u++)t+="^";let n=!0;for(const u of e.linkTo)typeof u=="string"?((!n||e.linkUps>0)&&(t+="."),t+=u,n=!1):t+=`[${u}]`;return t}function E(e){return typeof e=="object"&&e!==null&&"linkTo"in e&&"linkUps"in e&&!Array.isArray(e)&&!(e instanceof Date)}function M(e){return typeof e=="object"&&e!==null&&!E(e)}function C(e){return typeof e=="object"&&e!==null&&"env"in e&&!Array.isArray(e)&&!(e instanceof Date)}function i(e){return typeof e=="object"&&e!==null&&"code"in e&&"message"in e&&"begin"in e&&"end"in e}return se}var oe={},be;function Pe(){if(be)return oe;be=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.MotValue=oe.Mot=void 0,oe.buildMot=d;const a=le();class E{text(...o){return this.get(...o)._text()}numeric(...o){return this.get(...o)._numeric()}boolean(...o){return this.get(...o)._boolean()}date(...o){return this.get(...o)._date()}valueType(...o){return this.get(...o)._valueType()}values(...o){return this.get(...o)._values()}texts(...o){const g=this.get(...o)._values();if(!g)return;const y=[];for(const P of g){const I=P._text();if(I===void 0)return;y.push(I)}return y}numerics(...o){const g=this.get(...o)._values();if(!g)return;const y=[];for(const P of g){const I=P._numeric();if(I===void 0)return;y.push(I)}return y}booleans(...o){const g=this.get(...o)._values();if(!g)return;const y=[];for(const P of g){const I=P._boolean();if(I===void 0)return;y.push(I)}return y}dates(...o){const g=this.get(...o)._values();if(!g)return;const y=[];for(const P of g){const I=P._date();if(I===void 0)return;y.push(I)}return y}has(...o){return this.get(...o).exists}}oe.Mot=E;class M extends E{constructor(o,g,y=!0){super(),this.isRef=!1,this._val=o,this._props=g,this.exists=y}_text(){return this._val?.type==="string"?this._val.value:void 0}_numeric(){return this._val?.type==="number"?this._val.value:void 0}_boolean(){return this._val?.type==="boolean"?this._val.value:void 0}_date(){return this._val?.type==="date"?this._val.value:void 0}_values(){return this._val?.type==="array"?this._val.value:void 0}_valueType(){return this._val?.type}get keys(){return this._props.keys()}get entries(){return this._props.entries()}get(...o){let g=this;for(const y of o){if(typeof y=="number"){const P=g.values();if(!P||!Number.isInteger(y)||y<0||y>=P.length)return t;g=P[y]}else g===this?g=this._props.get(y)??t:g=g.get(y);if(!g.exists)return t}return g}}oe.MotValue=M;class C extends E{constructor(o,g){super(),this.exists=!0,this.isRef=!0,this._target=g}_text(){return this._target.text()}_numeric(){return this._target.numeric()}_boolean(){return this._target.boolean()}_date(){return this._target.date()}_values(){return this._target.values()}_valueType(){return this._target.valueType()}get keys(){return this._target.keys}get entries(){return this._target.entries}get(...o){return this._target.get(...o)}}const i={[Symbol.iterator]:()=>({next:()=>({done:!0,value:void 0})})};class e extends E{constructor(){super(...arguments),this.exists=!1,this.isRef=!1}_text(){}_numeric(){}_boolean(){}_date(){}_values(){}_valueType(){}get keys(){return i}get entries(){return i}get(...o){return this}}const t=new e,n={createMot(s,o){return new M(s,o)},createRefMot(s,o){return new C(s,o)},undefinedMot:t};function u(s,o,g,y){let P,I;if(s.linkUps===0)P=o,I=[];else{const O=g.length-s.linkUps;if(O<0||O>=g.length)return;P=g[O],I=g.slice(0,O)}let N=P,W=I,Q=P;for(let O=0;O<s.linkTo.length;O++){if((0,a.isRef)(N)){if(y.has(N))return;y.add(N);const H=u(N,o,W,y);if(y.delete(N),!H)return;N=H.target,W=H.ancestors,Q=N,O--;continue}const B=N,z=s.linkTo[O];if(typeof z=="string"){if(!B.properties||!(z in B.properties))return;O>0&&(W=[...W,Q]),Q=B,N=B.properties[z]}else{if(!B.eq||!Array.isArray(B.eq)||z>=B.eq.length)return;O>0&&(W=[...W,Q]),Q=B,N=B.eq[z]}}if((0,a.isRef)(N)){if(y.has(N))return;y.add(N);const O=u(N,o,W,y);return y.delete(N),O}return{target:N,ancestors:W}}function d(s,o){const g=o?.env,y=o?.factory??n,P=y.undefinedMot,I=new Map;function N(O,B,z){if(O.deleted)return P;if(I.has(O))return I.get(O);const H=new Map,Y=Q(O.eq,B,z,O),J=y.createMot(Y,H);if(I.set(O,J),O.properties)for(const[K,c]of Object.entries(O.properties)){const m=W(c,B,z,O);m.exists&&H.set(K,m)}return J}function W(O,B,z,H){if((0,a.isRef)(O)){const J=new Set;J.add(O);const K=u(O,B,z,J);if(!K||K.target.deleted)return P;const c=N(K.target,B,K.ancestors);return y.createRefMot(O,c)}const Y=O;return Y.deleted?P:N(Y,B,[...z,H])}function Q(O,B,z,H){if(O!==void 0){if((0,a.isEnvRef)(O)){const Y=g?g[O.env]:void 0;return Y===void 0?void 0:{type:"string",value:Y}}if(Array.isArray(O)){const Y=[...z,H],J=[];for(const K of O)J.push(W(K,B,Y,H));return{type:"array",value:J}}if(typeof O=="string")return{type:"string",value:O};if(typeof O=="number")return{type:"number",value:O};if(typeof O=="boolean")return{type:"boolean",value:O};if(O instanceof Date)return{type:"date",value:O}}}return N(s,s,[s])}return oe}var ne={},de={},qe;function Me(){if(qe)return de;qe=1,Object.defineProperty(de,"__esModule",{value:!0}),de.parse=C;class a{constructor(e){this.input=e,this.pos=0}peekChar(){return this.pos<this.input.length?this.input[this.pos]:void 0}advance(e){this.pos+=e}startsWith(e){return this.input.startsWith(e,this.pos)}eatChar(e){return this.peekChar()===e?(this.advance(1),!0):!1}expectChar(e){if(!this.eatChar(e)){const t=this.peekChar();throw this.errorPoint(`Expected '${e}', found ${t===void 0?"end of input":`'${t}'`}`)}}position(){const e=this.input.substring(0,this.pos),t=(e.match(/\n/g)||[]).length,n=e.lastIndexOf(`
|
|
10
|
+
`),u=this.pos-(n===-1?0:n+1);return{line:t,column:u,offset:this.pos}}errorPoint(e){const t=this.position();return{code:"tag-parse-syntax-error",message:e,begin:t,end:t}}errorSpan(e,t){return{code:"tag-parse-syntax-error",message:e,begin:t,end:this.position()}}skipWs(){for(;;){for(;this.pos<this.input.length;){const e=this.input[this.pos];if(e===" "||e===" "||e==="\r"||e===`
|
|
11
|
+
`)this.pos++;else break}if(this.peekChar()==="#")for(;this.pos<this.input.length;){const e=this.input[this.pos];if(e==="\r"||e===`
|
|
12
|
+
`)break;this.pos++}else break}}skipWsAndCommas(){for(this.skipWs();this.peekChar()===",";)this.advance(1),this.skipWs()}parseStatements(){const e=[];for(this.skipWsAndCommas();this.pos<this.input.length;)e.push(this.parseStatement()),this.skipWsAndCommas();return e}parseStatement(){const e=this.position();if(this.startsWith("-..."))return this.advance(4),{kind:"clearAll",span:{begin:e,end:this.position()}};if(this.peekChar()==="-")return this.advance(1),{kind:"define",path:this.parsePropName(),deleted:!0,span:{begin:e,end:this.position()}};const t=this.parsePropName();this.skipWs();const n=this.peekChar();if(n===":"&&this.startsWith(":=")){this.advance(2),this.skipWs();const u=this.parseEqValue();if(this.skipWs(),this.peekChar()==="{"){const d=this.parsePropertiesBlock();return{kind:"assignBoth",path:t,value:u,properties:d,span:{begin:e,end:this.position()}}}return{kind:"assignBoth",path:t,value:u,properties:null,span:{begin:e,end:this.position()}}}if(n==="="){if(this.advance(1),this.skipWs(),this.peekChar()==="{")throw this.errorPoint("'=' requires a value; use ': { ... }' to replace properties");const u=this.parseEqValue();if(this.skipWs(),this.peekChar()==="{"){const d=this.parsePropertiesBlock();return{kind:"setEq",path:t,value:u,properties:d,span:{begin:e,end:this.position()}}}return{kind:"setEq",path:t,value:u,properties:null,span:{begin:e,end:this.position()}}}if(n===":"){this.advance(1),this.skipWs();const u=this.parsePropertiesBlock();return{kind:"replaceProperties",path:t,properties:u,span:{begin:e,end:this.position()}}}if(n==="{"){const u=this.parsePropertiesBlock();return{kind:"updateProperties",path:t,properties:u,span:{begin:e,end:this.position()}}}return{kind:"define",path:t,deleted:!1,span:{begin:e,end:this.position()}}}parsePropName(){const t=[this.parseIdentifier()];for(;this.peekChar()===".";)this.advance(1),t.push(this.parseIdentifier());return t}parseIdentifier(){return this.peekChar()==="`"?this.parseBacktickString():this.parseBareString()}parseEqValue(e=!0){const t=this.peekChar();if(e&&t==="[")return{kind:"array",elements:this.parseArray()};if(this.startsWith("<<<"))return{kind:"scalar",value:{kind:"string",value:this.parseHeredoc()}};if(t==="@")return{kind:"scalar",value:this.parseAtValue()};if(t==="$")return{kind:"scalar",value:this.parseReference()};if(t==='"')return this.startsWith('"""')?{kind:"scalar",value:{kind:"string",value:this.parseTripleString()}}:{kind:"scalar",value:{kind:"string",value:this.parseDoubleQuotedString()}};if(t==="'")return this.startsWith("'''")?{kind:"scalar",value:{kind:"string",value:this.parseTripleSingleQuotedString()}}:{kind:"scalar",value:{kind:"string",value:this.parseSingleQuotedString()}};if(t!==void 0&&(t==="-"||t>="0"&&t<="9"||t==="."))return this.parseNumberOrString();if(t!==void 0&&E(t))return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}};throw this.errorPoint("Expected a value")}parseAtValue(){const e=this.position();if(this.expectChar("@"),this.startsWith("true")&&!this.isBareCharAt(4))return this.advance(4),{kind:"boolean",value:!0};if(this.startsWith("false")&&!this.isBareCharAt(5))return this.advance(5),{kind:"boolean",value:!1};if(this.startsWith("none")&&!this.isBareCharAt(4))return this.advance(4),{kind:"none"};if(this.startsWith("env."))return this.advance(4),{kind:"env",name:this.parseIdentifier()};const t=this.peekChar();if(t!==void 0&&t>="0"&&t<="9")return this.parseDate(e);const n=this.pos;for(;this.pos<this.input.length&&E(this.input[this.pos]);)this.pos++;const u=this.pos>n?this.input.substring(n,this.pos):"";throw this.errorSpan(`Illegal constant @${u}; expected @true, @false, @none, @env.NAME, or @date`,e)}isBareCharAt(e){const t=this.pos+e;return t<this.input.length&&E(this.input[t])}parseDate(e){const t=this.pos;if(this.consumeDigits(4,e),this.expectChar("-"),this.consumeDigits(2,e),this.expectChar("-"),this.consumeDigits(2,e),this.peekChar()==="T"){if(this.advance(1),this.consumeDigits(2,e),this.expectChar(":"),this.consumeDigits(2,e),this.peekChar()===":"&&(this.advance(1),this.consumeDigits(2,e),this.peekChar()===".")){this.advance(1);const d=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.pos++;if(this.pos===d)throw this.errorSpan("Expected fractional digits in date",e)}const u=this.peekChar();u==="Z"?this.advance(1):(u==="+"||u==="-")&&(this.advance(1),this.consumeDigits(2,e),this.peekChar()===":"&&this.advance(1),this.consumeDigits(2,e))}return{kind:"date",value:this.input.substring(t,this.pos)}}consumeDigits(e,t){for(let n=0;n<e;n++){const u=this.peekChar();if(u===void 0||u<"0"||u>"9")throw this.errorSpan("Expected digit",t);this.advance(1)}}parseOptionalExponent(e){const t=this.peekChar();if(t!=="e"&&t!=="E")return;this.advance(1);const n=this.peekChar();(n==="+"||n==="-")&&this.advance(1);const u=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.advance(1);if(this.pos===u)throw this.errorSpan("Expected exponent digits",e)}parseNumberOrString(){const e=this.pos,t=this.position(),n=this.peekChar()==="-";n&&this.advance(1);let u=!1,d=!1;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)u=!0,this.advance(1);if(this.peekChar()==="."){d=!0,this.advance(1);const y=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.advance(1);if(this.pos===y)return this.pos=e,this.parseIntegerOrBare(e,n)}if(!u&&!d){if(this.pos=e,n)throw this.errorPoint("Expected a value");return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}this.parseOptionalExponent(t);const s=this.peekChar();if(s!==void 0&&E(s)&&!(s>="0"&&s<="9")){if(this.pos=e,n)throw this.errorPoint("Expected a value");return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}const o=this.input.substring(e,this.pos),g=parseFloat(o);if(isNaN(g))throw this.errorSpan(`Invalid number: ${o}`,t);return{kind:"scalar",value:{kind:"number",value:g}}}parseIntegerOrBare(e,t){this.pos=e;const n=this.position();t&&this.advance(1);const u=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.advance(1);if(this.pos===u){if(this.pos=e,t)throw this.errorPoint("Expected a value");return{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}if(!t){const o=this.peekChar();if(o!==void 0&&E(o)&&!(o>="0"&&o<="9"))return this.pos=e,{kind:"scalar",value:{kind:"string",value:this.parseBareString()}}}this.parseOptionalExponent(n);const d=this.input.substring(e,this.pos),s=parseFloat(d);if(isNaN(s))throw this.errorSpan(`Invalid number: ${d}`,n);return{kind:"scalar",value:{kind:"number",value:s}}}parseBareString(){const e=this.pos;for(;this.pos<this.input.length&&E(this.input[this.pos]);)this.pos++;if(this.pos===e)throw this.errorPoint("Expected an identifier");return this.input.substring(e,this.pos)}parseDoubleQuotedString(){const e=this.position();this.expectChar('"');let t="";for(;;){const n=this.peekChar();if(n===void 0||n==="\r"||n===`
|
|
13
|
+
`)throw this.errorSpan("Unterminated string",e);if(n==='"')return this.advance(1),t;n==="\\"?(this.advance(1),t+=this.parseEscapeChar()):(this.advance(1),t+=n)}}parseSingleQuotedString(){const e=this.position();this.expectChar("'");let t="";for(;;){const n=this.peekChar();if(n===void 0||n==="\r"||n===`
|
|
14
|
+
`)throw this.errorSpan("Unterminated string",e);if(n==="'")return this.advance(1),t;if(n==="\\"){this.advance(1),t+="\\";const u=this.peekChar();if(u===void 0||u==="\r"||u===`
|
|
15
|
+
`)throw this.errorSpan("Unterminated string",e);this.advance(1),t+=u}else this.advance(1),t+=n}}parseTripleSingleQuotedString(){const e=this.position();if(!this.startsWith("'''"))throw this.errorPoint("Expected triple-single-quoted string");this.advance(3);let t="";for(;;){if(this.startsWith("'''"))return this.advance(3),t;const n=this.peekChar();if(n===void 0)throw this.errorSpan("Unterminated triple-single-quoted string",e);if(n==="\\"){this.advance(1),t+="\\";const u=this.peekChar();if(u===void 0)throw this.errorSpan("Unterminated triple-single-quoted string",e);this.advance(1),t+=u}else this.advance(1),t+=n}}parseBacktickString(){const e=this.position();this.expectChar("`");let t="";for(;;){const n=this.peekChar();if(n===void 0||n==="\r"||n===`
|
|
16
|
+
`)throw this.errorSpan("Unterminated backtick string",e);if(n==="`")return this.advance(1),t;n==="\\"?(this.advance(1),t+=this.parseEscapeChar()):(this.advance(1),t+=n)}}parseTripleString(){const e=this.position();if(!this.startsWith('"""'))throw this.errorPoint("Expected triple-quoted string");this.advance(3);let t="";for(;;){if(this.startsWith('"""'))return this.advance(3),t;const n=this.peekChar();if(n===void 0)throw this.errorSpan("Unterminated triple-quoted string",e);n==="\\"?(this.advance(1),t+=this.parseEscapeChar()):(this.advance(1),t+=n)}}parseEscapeChar(){const e=this.peekChar();if(e===void 0)throw this.errorPoint("Unterminated escape sequence");switch(e){case"b":return this.advance(1),"\b";case"f":return this.advance(1),"\f";case"n":return this.advance(1),`
|
|
17
|
+
`;case"r":return this.advance(1),"\r";case"t":return this.advance(1)," ";case"u":{const t=this.position();this.advance(1);const n=this.pos;for(let s=0;s<4;s++){const o=this.peekChar();if(o===void 0||!M(o))throw this.errorSpan("Expected 4 hex digits in \\uXXXX",t);this.advance(1)}const u=this.input.substring(n,this.pos),d=parseInt(u,16);return String.fromCharCode(d)}default:return this.advance(1),e}}parseHeredoc(){const e=this.position();for(this.advance(3);this.pos<this.input.length;){const s=this.input[this.pos];if(s===" "||s===" ")this.pos++;else break}if(this.pos<this.input.length&&this.input[this.pos]==="\r"&&this.advance(1),this.pos>=this.input.length||this.input[this.pos]!==`
|
|
18
|
+
`)throw this.errorSpan("Expected newline after <<<",e);this.advance(1);const t=[];let n=!1;for(;this.pos<this.input.length;){const s=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]!==`
|
|
19
|
+
`;)this.pos++;let o=this.input.substring(s,this.pos);if(o.endsWith("\r")&&(o=o.substring(0,o.length-1)),this.pos<this.input.length&&this.input[this.pos]===`
|
|
20
|
+
`&&this.advance(1),o.trim()===">>>"){n=!0;break}t.push(o)}if(!n)throw this.errorSpan("Unterminated heredoc (expected >>>)",e);if(t.length===0)return"";let u=0;for(const s of t){const o=s.trimStart();if(o.length>0){u=s.length-o.length;break}}return t.map(s=>s.trimStart().length===0?"":u<=s.length?s.substring(u):s).join(`
|
|
21
|
+
`)+`
|
|
22
|
+
`}parseArray(){const e=this.position();if(this.expectChar("["),this.skipWs(),this.eatChar("]"))return[];const t=[];for(t.push(this.parseArrayElement());;){if(this.skipWs(),this.eatChar("]"))return t;if(this.eatChar(",")){if(this.skipWs(),this.peekChar()==="]")return this.advance(1),t;t.push(this.parseArrayElement())}else throw this.pos>=this.input.length?this.errorSpan("Unclosed '['",e):this.errorPoint("Expected ',' or ']' in array")}}parseArrayElement(){this.skipWs();const e=this.position(),t=this.peekChar();if(t==="{")return{value:null,properties:this.parsePropertiesBlock(),span:{begin:e,end:this.position()}};if(t==="["){const u=this.parseArray();if(this.skipWs(),this.peekChar()==="{"){const d=this.parsePropertiesBlock();return{value:{kind:"array",elements:u},properties:d,span:{begin:e,end:this.position()}}}return{value:{kind:"array",elements:u},properties:null,span:{begin:e,end:this.position()}}}const n=this.parseEqValue(!1);if(this.skipWs(),this.peekChar()==="{"){const u=this.parsePropertiesBlock();return{value:n,properties:u,span:{begin:e,end:this.position()}}}return{value:n,properties:null,span:{begin:e,end:this.position()}}}parsePropertiesBlock(){const e=this.position();this.expectChar("{");const t=[];for(;;){if(this.skipWsAndCommas(),this.eatChar("}"))return t;if(this.pos>=this.input.length)throw this.errorSpan("Unclosed '{'",e);t.push(this.parseStatement())}}parseReference(){this.expectChar("$");let e=0;for(;this.peekChar()==="^";)this.advance(1),e++;if(e>0){if(this.peekChar()!==".")return{kind:"reference",ups:e,path:[]};this.advance(1)}const t=[],n=this.parseIdentifier();if(t.push({kind:"name",name:n}),this.peekChar()==="["){this.advance(1),this.skipWs();const u=this.parseRefIndex();t.push({kind:"index",index:u}),this.skipWs(),this.expectChar("]")}for(;this.peekChar()===".";){this.advance(1);const u=this.parseIdentifier();if(t.push({kind:"name",name:u}),this.peekChar()==="["){this.advance(1),this.skipWs();const d=this.parseRefIndex();t.push({kind:"index",index:d}),this.skipWs(),this.expectChar("]")}}return{kind:"reference",ups:e,path:t}}parseRefIndex(){const e=this.position(),t=this.pos;for(;this.pos<this.input.length&&this.input[this.pos]>="0"&&this.input[this.pos]<="9";)this.pos++;if(this.pos===t)throw this.errorPoint("Expected array index");const n=parseInt(this.input.substring(t,this.pos),10);if(isNaN(n))throw this.errorSpan("Invalid array index",e);return n}}function E(i){const e=i.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===95||e>=192&&e<=591||e>=7680&&e<=7935}function M(i){const e=i.charCodeAt(0);return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function C(i){return new a(i).parseStatements()}return de}var fe={},re={},we;function Oe(){if(we)return re;we=1,Object.defineProperty(re,"__esModule",{value:!0}),re.clonePropertyValue=re.cloneValue=void 0,re.cloneNode=E,re.cloneMotlyNode=M;const a=le();function E(C){const i={};if(C.deleted&&(i.deleted=!0),C.eq!==void 0&&(C.eq instanceof Date?i.eq=new Date(C.eq.getTime()):Array.isArray(C.eq)?i.eq=C.eq.map(M):(0,a.isEnvRef)(C.eq)?i.eq={env:C.eq.env}:i.eq=C.eq),C.properties){const e={};for(const t of Object.keys(C.properties))e[t]=M(C.properties[t]);i.properties=e}return C.location&&(i.location={parseId:C.location.parseId,begin:{...C.location.begin},end:{...C.location.end}}),i}function M(C){return(0,a.isRef)(C)?{linkTo:[...C.linkTo],linkUps:C.linkUps}:E(C)}return re.cloneValue=E,re.clonePropertyValue=M,re}var Ae;function Te(){if(Ae)return fe;Ae=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.flatten=M,fe.chunk=e,fe.topoSort=o,fe.executeChunked=g;const a=le(),E=Oe();function M(r,l){const p=[];return C(r,[],l.parseId,p),p}function C(r,l,p,h){for(const f of r)i(f,l,p,h)}function i(r,l,p,h){switch(r.kind){case"setEq":{const f=[...l,...r.path];if(r.value.kind==="scalar"&&r.value.value.kind==="reference"){const b=r.value.value;h.push({path:f,op:{kind:"link",ups:b.ups,refPath:b.path},span:r.span,parseId:p})}else h.push({path:f,op:{kind:"setValue",value:r.value},span:r.span,parseId:p}),r.properties!==null&&C(r.properties,f,p,h);break}case"assignBoth":{const f=[...l,...r.path];if(r.value.kind==="scalar"&&r.value.value.kind==="reference"){const b=r.value.value;h.push({path:f,op:{kind:"clone",ups:b.ups,refPath:b.path},span:r.span,parseId:p}),r.properties!==null&&(h.push({path:f,op:{kind:"clearProperties"},span:r.span,parseId:p}),C(r.properties,f,p,h))}else h.push({path:f,op:{kind:"assignValue",value:r.value},span:r.span,parseId:p}),r.properties!==null&&C(r.properties,f,p,h);break}case"replaceProperties":{const f=[...l,...r.path];h.push({path:f,op:{kind:"clearProperties"},span:r.span,parseId:p}),C(r.properties,f,p,h);break}case"updateProperties":{const f=[...l,...r.path];h.push({path:f,op:{kind:"define"},span:r.span,parseId:p}),C(r.properties,f,p,h);break}case"define":{const f=[...l,...r.path];h.push({path:f,op:{kind:r.deleted?"delete":"define"},span:r.span,parseId:p});break}case"clearAll":{h.push({path:[...l],op:{kind:"clearAll"},span:r.span,parseId:p});break}}}function e(r){const l=r.length;if(l===0)return{splits:[0],deps:[]};const p=new Map;for(let D=0;D<l;D++)p.set(t(r[D].path),D);const h=new Set([0,l]),f=new Set,b=[];for(let D=0;D<l;D++){const F=r[D],G=t(F.path);if(F.op.kind==="link"||F.op.kind==="clone"){const Z=d(F.path,F.op.ups,F.op.refPath);if(!n(f,Z)){b.push({refIdx:D,targetKey:Z}),h.add(D),h.add(D+1);const ie=u(p,Z);ie>D&&h.add(ie)}}f.add(G)}const w=Array.from(h).sort((D,F)=>D-F),$=w.length-1,_=Array.from({length:$},()=>new Set);for(const{refIdx:D,targetKey:F}of b){const G=s(w,D),Z=u(p,F);if(Z!==-1){const ee=s(w,Z);ee!==G&&_[G].add(ee)}const ie=t(r[D].path);for(let ee=D+1;ee<l;ee++){const ce=t(r[ee].path);if(ce===ie||ce.startsWith(ie+"\0")){const he=s(w,ee);he!==G&&_[he].add(G)}}}const x=_.map(D=>Array.from(D));return{splits:w,deps:x}}function t(r){return r.join("\0")}function n(r,l){for(const p of r)if(p===l||p.startsWith(l+"\0"))return!0;return!1}function u(r,l){let p=-1;for(const[h,f]of r)(h===l||h.startsWith(l+"\0")||l.startsWith(h+"\0"))&&(p=Math.max(p,f));return p}function d(r,l,p){const h=[];if(l>0){const f=Math.max(0,r.length-1-l);for(let b=0;b<f;b++)h.push(r[b])}for(const f of p)f.kind==="name"?h.push(f.name):h.push(`[${f.index}]`);return h.join("\0")}function s(r,l){let p=0,h=r.length-2;for(;p<h;){const f=p+h+1>>1;r[f]<=l?p=f:h=f-1}return p}function o(r){const l=r.length,p=new Array(l).fill(0),h=Array.from({length:l},()=>[]);for(let _=0;_<l;_++)for(const x of r[_])h[x].push(_),p[_]++;const f=[];for(let _=0;_<l;_++)p[_]===0&&f.push(_);const b=[];let w=0;for(;w<f.length;){const _=f[w++];b.push(_);for(const x of h[_])--p[x]===0&&f.push(x)}const $=[];if(b.length<l){const _=new Set(b);for(let x=0;x<l;x++)_.has(x)||$.push(x)}return{order:b,cycles:$}}function g(r,l,p,h,f){const b=[],w=[];for(const $ of p){const _=l[$],x=l[$+1];for(let D=_;D<x;D++)P(r[D],h,f,b,w)}return y(b,w),b}function y(r,l){if(l.length<2)return;const p=new Map;for(const w of l)p.set(w.sourcePath,w);const h=new Set,f=new Set;for(const w of l){if(f.has(w.sourcePath))continue;const $=[],_=new Set;let x=w;for(;x&&!_.has(x.sourcePath)&&!f.has(x.sourcePath);)$.push(x),_.add(x.sourcePath),x=p.get(x.targetPath);if(x&&_.has(x.sourcePath)){const D=x.sourcePath,F=[];let G=!1;for(const X of $)X.sourcePath===D&&(G=!0),G&&F.push(X);const Z=X=>X.replace(/\0/g,"."),ie=F.map(X=>Z(X.sourcePath)),ee=F.map(X=>`$${Z(X.targetPath)}`);let ce=ie[0];for(let X=0;X<ee.length;X++)ce+=` clones ${ee[X]}`,X<ee.length-1&&(ce+=`, ${ie[X+1]}`);for(const X of F)h.add(X.errorIndex);const he=F[0].errorIndex,ye={line:0,column:0,offset:0};r[he]={code:"circular-reference",message:`Circular clone dependency: ${ce}`,begin:ye,end:ye}}for(const D of $)f.add(D.sourcePath)}const b=Array.from(h).sort((w,$)=>$-w);for(const w of b)r[w].code!=="circular-reference"&&r.splice(w,1)}function P(r,l,p,h,f){const b={parseId:r.parseId,options:p};switch(r.op.kind){case"setValue":I(r.path,r.op.value,l,b,r.span,h);break;case"assignValue":N(r.path,r.op.value,l,b,r.span,h);break;case"clearProperties":W(r.path,l,b,r.span,h);break;case"clearAll":Q(r.path,l,b,r.span,h);break;case"define":O(r.path,l,b,r.span,h);break;case"delete":B(r.path,l,b,r.span,h);break;case"link":z(r.path,r.op.ups,r.op.refPath,l,b,r.span,h);break;case"clone":H(r.path,r.op.ups,r.op.refPath,l,b,r.span,h,f);break}}function I(r,l,p,h,f,b){if(r.length===0){c(p,l,h,b);return}const w=K(p,r,h,f,b);if(!w)return;const[$,_]=w,x=T(_);x[$]===void 0&&(x[$]={});const D=V(x,$);J(D,h,f),c(D,l,h,b)}function N(r,l,p,h,f,b){if(r.length===0){delete p.properties,p.location=Y(h,f),c(p,l,h,b);return}const w=K(p,r,h,f,b);if(!w)return;const[$,_]=w,x={};x.location=Y(h,f),c(x,l,h,b),T(_)[$]=x}function W(r,l,p,h,f){if(r.length===0){delete l.properties;return}const b=K(l,r,p,h,f);if(!b)return;const[w,$]=b,_=T($),x=_[w];if(x!==void 0&&!(0,a.isRef)(x))delete x.properties;else{const D={};D.location=Y(p,h),_[w]=D}}function Q(r,l,p,h,f){if(r.length===0){delete l.eq,l.properties={};return}const b=K(l,r,p,h,f);if(!b)return;const[w,$]=b,_=T($),x=_[w];x!==void 0&&!(0,a.isRef)(x)?(delete x.eq,x.properties={}):_[w]={}}function O(r,l,p,h,f){const b=K(l,r,p,h,f);if(!b)return;const[w,$]=b,_=T($);if(_[w]===void 0){const x={};x.location=Y(p,h),_[w]=x}}function B(r,l,p,h,f){const b=K(l,r,p,h,f);if(!b)return;const[w,$]=b,_={deleted:!0};_.location=Y(p,h),T($)[w]=_}function z(r,l,p,h,f,b,w){f.options.disableReferences&&w.push({code:"ref-not-allowed",message:"References are not allowed in this session. Use := for cloning.",begin:b.begin,end:b.end});const $=K(h,r,f,b,w);if(!$)return;const[_,x]=$;T(x)[_]=v(l,p)}function H(r,l,p,h,f,b,w,$){const _=K(h,r,f,b,w);if(!_)return;const[x,D]=_;let F;try{F=R(h,r,l,p)}catch(G){if((0,a.isMotlyError)(G)){const Z=w.length;w.push(G),$.push({sourcePath:t(r),targetPath:d(r,l,p),errorIndex:Z})}return}j(F,0,w),F.location=Y(f,b),T(D)[x]=F}function Y(r,l){return{parseId:r.parseId,begin:l.begin,end:l.end}}function J(r,l,p){r.location||(r.location=Y(l,p))}function K(r,l,p,h,f){let b=r;for(let w=0;w<l.length-1;w++){const $=l[w],_=T(b);if(_[$]!==void 0&&(0,a.isRef)(_[$]))return f.push({code:"write-through-link",message:`Cannot write through link reference "${$}"`,begin:h.begin,end:h.end}),null;if(_[$]===void 0){const x={};x.location=Y(p,h),_[$]=x}b=V(_,$),J(b,p,h)}return[l[l.length-1],b]}function c(r,l,p,h){if(l.kind==="array")r.eq=m(l.elements,h,p);else{const f=l.value;switch(f.kind){case"string":r.eq=f.value;break;case"number":r.eq=f.value;break;case"boolean":r.eq=f.value;break;case"date":r.eq=new Date(f.value);break;case"reference":throw new Error("References should be handled before calling setEqSlot");case"env":r.eq={env:f.name};break;case"none":delete r.eq;break}}}function m(r,l,p){return r.map(h=>q(h,l,p))}function q(r,l,p){if(r.value!==null&&r.value.kind==="scalar"&&r.value.value.kind==="reference"){if(p.options.disableReferences&&l.push({code:"ref-not-allowed",message:"References are not allowed in this session. Use := for cloning.",begin:r.span.begin,end:r.span.end}),r.properties!==null){const f={line:0,column:0,offset:0};l.push({code:"ref-with-properties",message:"Cannot add properties to a reference. Did you mean := (clone)?",begin:f,end:f})}return v(r.value.value.ups,r.value.value.path)}const h={};if(h.location=Y(p,r.span),r.value!==null&&c(h,r.value,p,l),r.properties!==null){const f=M(r.properties,p),{splits:b,deps:w}=e(f),{order:$}=o(w);l.push(...g(f,b,$,h,p.options))}return h}function v(r,l){return{linkTo:l.map(p=>p.kind==="name"?p.name:p.index),linkUps:r}}function k(r,l){let p="$";for(let f=0;f<r;f++)p+="^";let h=!0;for(const f of l)f.kind==="name"?((!h||r>0)&&(p+="."),p+=f.name,h=!1):p+=`[${f.index}]`;return p}function R(r,l,p,h){const f=k(p,h);let b;if(p===0)b=r;else{const $=l.length-1-p;if($<0)throw A(`Clone reference ${f} goes ${p} level(s) up but only ${l.length-1} ancestor(s) available`);b=r;for(let _=0;_<$;_++){if(!b.properties)throw A(`Clone reference ${f} could not be resolved: path segment "${l[_]}" not found`);const x=b.properties[l[_]];if(x===void 0)throw A(`Clone reference ${f} could not be resolved: path segment "${l[_]}" not found`);if((0,a.isRef)(x)){const D=S(r,x);if(!D)throw A(`Clone reference ${f} could not be resolved: path segment "${l[_]}" is an unresolvable link reference`);b=D;continue}b=x}}let w=b;for(const $ of h)if($.kind==="name"){if(!w.properties)throw A(`Clone reference ${f} could not be resolved: property "${$.name}" not found`);const _=w.properties[$.name];if(_===void 0)throw A(`Clone reference ${f} could not be resolved: property "${$.name}" not found`);if((0,a.isRef)(_)){const x=S(r,_);if(!x)throw A(`Clone reference ${f} could not be resolved: property "${$.name}" is an unresolvable link reference`);w=x;continue}w=_}else{if(!w.eq||!Array.isArray(w.eq))throw A(`Clone reference ${f} could not be resolved: index [${$.index}] used on non-array`);if($.index>=w.eq.length)throw A(`Clone reference ${f} could not be resolved: index [${$.index}] out of bounds (array length ${w.eq.length})`);const _=w.eq[$.index];if((0,a.isRef)(_)){const x=S(r,_);if(!x)throw A(`Clone reference ${f} could not be resolved: index [${$.index}] is an unresolvable link reference`);w=x;continue}w=_}return(0,E.cloneNode)(w)}function A(r){const l={line:0,column:0,offset:0};return{code:"unresolved-clone-reference",message:r,begin:l,end:l}}function S(r,l,p){p||(p=new Set);const h=(0,a.formatRef)(l);if(p.has(h)||(p.add(h),l.linkUps>0))return null;let f=r;for(const b of l.linkTo){if(f===void 0)return null;if((0,a.isRef)(f)){const $=S(r,f,p);if(!$)return null;f=$}if(!(0,a.isDataNode)(f))return null;const w=f;if(typeof b=="string"){if(!w.properties||!(b in w.properties))return null;f=w.properties[b]}else{if(!w.eq||!Array.isArray(w.eq)||b>=w.eq.length)return null;f=w.eq[b]}}return f!==void 0&&(0,a.isRef)(f)?S(r,f,p):f??null}function j(r,l,p){if(r.eq!==void 0&&Array.isArray(r.eq))for(let h=0;h<r.eq.length;h++)U(r.eq,h,l+1,p);if(r.properties)for(const h of Object.keys(r.properties))L(r.properties,h,l+1,p)}function U(r,l,p,h){const f=r[l];if((0,a.isRef)(f)){if(f.linkUps>0&&f.linkUps>p){const b={line:0,column:0,offset:0};h.push({code:"clone-reference-out-of-scope",message:`Cloned reference "${(0,a.formatRef)(f)}" escapes the clone boundary (${f.linkUps} level(s) up from depth ${p})`,begin:b,end:b}),r[l]={}}}else j(f,p,h)}function L(r,l,p,h){const f=r[l];if((0,a.isRef)(f)){if(f.linkUps>0&&f.linkUps>p){const b={line:0,column:0,offset:0};h.push({code:"clone-reference-out-of-scope",message:`Cloned reference "${(0,a.formatRef)(f)}" escapes the clone boundary (${f.linkUps} level(s) up from depth ${p})`,begin:b,end:b}),r[l]={}}}else j(f,p,h)}function T(r){return r.properties||(r.properties={}),r.properties}function V(r,l){const p=r[l];if((0,a.isRef)(p)){const h={};return r[l]=h,h}return p}return fe}var pe={},Re;function je(){if(Re)return pe;Re=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.validateReferences=M,pe.validateSchema=d;const a=le();function E(c,m,q,v,k){const R={code:m,message:q,path:v};k?.location&&(R.location=k.location),c.push(R)}function M(c){const m=[];return C(c,[],[c],c,m),m}function C(c,m,q,v,k){if(c.eq!==void 0&&Array.isArray(c.eq)&&i(c.eq,m,q,c,v,k),c.properties)for(const R of Object.keys(c.properties)){const A=c.properties[R];if(m.push(R),(0,a.isRef)(A)){const S=e(A,q,v);if(S!==null){const j={message:S,path:[...m],code:"unresolved-reference"};c.location&&(j.location=c.location),k.push(j)}}else q.push(c),C(A,m,q,v,k),q.pop();m.pop()}}function i(c,m,q,v,k,R){for(let A=0;A<c.length;A++){const S=c[A],j=`[${A}]`;if(m.push(j),(0,a.isRef)(S)){const U=e(S,q,k);U!==null&&R.push({message:U,path:[...m],code:"unresolved-reference"})}else q.push(v),C(S,m,q,k,R),q.pop();m.pop()}}function e(c,m,q){const v=(0,a.formatRef)(c);let k;if(c.linkUps===0)k=q;else{const R=m.length-c.linkUps;if(R<0||R>=m.length)return`Reference "${v}" goes ${c.linkUps} level(s) up but only ${m.length} ancestor(s) available`;k=m[R]}return t(k,c.linkTo,v)}function t(c,m,q){let v=c;for(const k of m){if(v==="terminal")return`Reference "${q}" could not be resolved: cannot follow path through a link`;if(typeof k=="string"){if(!v.properties)return`Reference "${q}" could not be resolved: property "${k}" not found (node has no properties)`;const R=v.properties[k];if(R===void 0)return`Reference "${q}" could not be resolved: property "${k}" not found`;(0,a.isRef)(R)?v="terminal":v=R}else{if(v.eq===void 0||!Array.isArray(v.eq))return`Reference "${q}" could not be resolved: index [${k}] used on non-array`;if(k>=v.eq.length)return`Reference "${q}" could not be resolved: index [${k}] out of bounds (array length ${v.eq.length})`;const R=v.eq[k];(0,a.isRef)(R)?v="terminal":v=R}}return null}const n=64,u={string:{properties:{VALUE:{eq:"string"}}},number:{properties:{VALUE:{eq:"number"}}},integer:{properties:{VALUE:{eq:"integer"}}},boolean:{properties:{VALUE:{eq:"boolean"}}},date:{properties:{VALUE:{eq:"date"}}},flag:{properties:{ADDITIONAL:{eq:"reject"}}},tag:{properties:{ADDITIONAL:{eq:"accept"}}},any:{properties:{ADDITIONAL:{eq:"accept"}}}};function d(c,m){const q=[],v=s(m,q);return g(c,m,v,[],q,0),q}function s(c,m){const q={...u},v=o(c,"TYPES");if(v?.properties){for(const[k,R]of Object.entries(v.properties))if(!(0,a.isRef)(R)){if(k in u){m.push({message:`Type "${k}" cannot shadow pre-loaded type`,path:["TYPES",k],code:"invalid-schema"});continue}q[k]=R}}return q}function o(c,m){if(!c.properties)return;const q=c.properties[m];if(!(q===void 0||(0,a.isRef)(q)))return q}function g(c,m,q,v,k,R){if(R>n){E(k,"invalid-schema","Maximum validation depth exceeded (possible recursive type cycle)",[...v],c);return}const A=o(m,"ONEOF");if(A&&Array.isArray(A.eq)){Y(c,A.eq,q,v,k,R);return}const S=o(m,"VALUE");S&&y(c,S,q,v,k),O(c,m,q,v,k,R)}function y(c,m,q,v,k,R){const A=typeof m.eq=="string"?m.eq:void 0;if(!A)return;const S=c.eq;switch(A){case"string":if(typeof S!="string"){E(k,"wrong-type",`Expected string, got ${P(S)}`,[...v],c);return}I(S,m,v,k,c);break;case"number":if(typeof S!="number"){E(k,"wrong-type",`Expected number, got ${P(S)}`,[...v],c);return}N(S,m,v,k,c);break;case"integer":if(typeof S!="number"||!Number.isInteger(S)){E(k,"wrong-type",`Expected integer, got ${P(S)}`,[...v],c);return}N(S,m,v,k,c);break;case"boolean":if(typeof S!="boolean"){E(k,"wrong-type",`Expected boolean, got ${P(S)}`,[...v],c);return}W(S,m,v,k,c);break;case"date":if(!(S instanceof Date)){E(k,"wrong-type",`Expected date, got ${P(S)}`,[...v],c);return}W(S,m,v,k,c);break;default:{const j=q[A];if(!j){E(k,"invalid-schema",`Unknown VALUE type "${A}"`,[...v],c);return}const U=o(j,"VALUE");if(!U){E(k,"invalid-schema",`Type "${A}" cannot be used as a VALUE type (no VALUE constraint)`,[...v],c);return}y(c,U,q,v,k)}}}function P(c){return c===void 0?"no value":c instanceof Date?`date ${c.toISOString()}`:Array.isArray(c)?"array":typeof c=="string"?`string ${JSON.stringify(c)}`:typeof c=="number"||typeof c=="boolean"?`${typeof c} ${c}`:typeof c}function I(c,m,q,v,k){W(c,m,q,v,k);const R=o(m,"MATCHES");if(R&&typeof R.eq=="string")try{new RegExp(R.eq).test(c)||E(v,"pattern-mismatch",`Value "${c}" does not match pattern "${R.eq}"`,[...q],k)}catch(j){E(v,"invalid-schema",`Invalid regex pattern "${R.eq}": ${j}`,[...q],k)}const A=o(m,"MIN_LENGTH");A&&typeof A.eq=="number"&&c.length<A.eq&&E(v,"length-violation",`String length ${c.length} is less than minimum ${A.eq}`,[...q],k);const S=o(m,"MAX_LENGTH");S&&typeof S.eq=="number"&&c.length>S.eq&&E(v,"length-violation",`String length ${c.length} exceeds maximum ${S.eq}`,[...q],k)}function N(c,m,q,v,k){W(c,m,q,v,k);const R=o(m,"MIN");R&&typeof R.eq=="number"&&c<R.eq&&E(v,"out-of-range",`Value ${c} is less than minimum ${R.eq}`,[...q],k);const A=o(m,"MAX");A&&typeof A.eq=="number"&&c>A.eq&&E(v,"out-of-range",`Value ${c} exceeds maximum ${A.eq}`,[...q],k)}function W(c,m,q,v,k){const R=o(m,"ENUM");if(!R||!Array.isArray(R.eq))return;if(!R.eq.some(S=>{if((0,a.isRef)(S))return!1;const j=S.eq;return j instanceof Date&&c instanceof Date?j.getTime()===c.getTime():j===c})){const S=R.eq.filter(j=>!(0,a.isRef)(j)).map(j=>String(j.eq));E(v,"invalid-enum-value",`${P(c)} is not one of: [${S.join(", ")}]`,[...q],k)}}function Q(c){if(!c.properties)return{kind:"reject"};const m=c.properties.ADDITIONAL;return m===void 0?{kind:"reject"}:(0,a.isRef)(m)?{kind:"reject"}:typeof m.eq=="string"?m.eq==="reject"?{kind:"reject"}:m.eq==="accept"?{kind:"accept"}:{kind:"type",typeName:m.eq}:m.properties&&Object.keys(m.properties).some(v=>v==="VALUE"||v==="REQUIRED"||v==="OPTIONAL"||v==="ADDITIONAL"||v==="ONEOF")?{kind:"inline",constraint:m}:{kind:"accept"}}function O(c,m,q,v,k,R){const A=o(m,"REQUIRED")?.properties,S=o(m,"OPTIONAL")?.properties,j=Q(m),U=c.properties;if(A)for(const[L,T]of Object.entries(A)){if((0,a.isRef)(T))continue;const V=[...v,L],r=U?.[L];r===void 0?E(k,"missing-required",`Missing required property "${L}"`,V,c):B(r,T,q,V,k,R)}if(S&&U)for(const[L,T]of Object.entries(S)){if((0,a.isRef)(T))continue;const V=U[L];V!==void 0&&B(V,T,q,[...v,L],k,R)}if(U){const L=new Set;if(A)for(const T of Object.keys(A))L.add(T);if(S)for(const T of Object.keys(S))L.add(T);for(const T of Object.keys(U)){if(L.has(T))continue;const V=[...v,T];switch(j.kind){case"reject":{const r=U[T];E(k,"unknown-property",`Unknown property "${T}"`,V,(0,a.isRef)(r)?void 0:r);break}case"accept":break;case"type":B(U[T],{eq:j.typeName},q,V,k,R);break;case"inline":{const r=U[T];(0,a.isRef)(r)?E(k,"wrong-type",`Expected a value but found a link ${(0,a.formatRef)(r)}`,V):g(r,j.constraint,q,V,k,R+1);break}}}}J(A,S,U,v,k),K(A,S,U,v,k)}function B(c,m,q,v,k,R){if((0,a.isRef)(c)){E(k,"wrong-type",`Expected a value but found a link ${(0,a.formatRef)(c)}`,[...v]);return}const A=typeof m.eq=="string"?m.eq:void 0;if(A){z(c,A,q,v,k,R);return}g(c,m,q,v,k,R+1)}function z(c,m,q,v,k,R){if(m.endsWith("[]")){H(c,m.slice(0,-2),q,v,k,R);return}const A=q[m];if(!A){E(k,"invalid-schema",`Unknown type "${m}" in schema`,[...v],c);return}if(Array.isArray(A.eq)){Y(c,A.eq,q,v,k,R);return}g(c,A,q,v,k,R+1)}function H(c,m,q,v,k,R){if(!Array.isArray(c.eq)){E(k,"wrong-type",`Expected ${m}[], got ${P(c.eq)}`,[...v],c);return}for(let A=0;A<c.eq.length;A++){const S=[...v,`[${A}]`],j=c.eq[A];(0,a.isRef)(j)?E(k,"wrong-type",`Expected ${m}, got link ${(0,a.formatRef)(j)}`,S):z(j,m,q,S,k,R)}}function Y(c,m,q,v,k,R){const A=[];let S,j;for(const L of m){if((0,a.isRef)(L))continue;const T=typeof L.eq=="string"?L.eq:void 0;if(!T)continue;A.push(T);const V=[];if(z(c,T,q,v,V,R),V.length===0)return;(!S||V.length<S.length)&&(S=V,j=T)}let U=`Value does not match any type in oneOf: [${A.join(", ")}]`;if(S&&S.length>0&&A.length>1){const L=S.map(T=>T.message).join("; ");U+=`. Closest match "${j}": ${L}`}E(k,"wrong-type",U,[...v],c)}function J(c,m,q,v,k){if(!q)return;const R={};function A(S){if(S)for(const[j,U]of Object.entries(S)){if((0,a.isRef)(U))continue;const L=o(U,"EXCLUSIVE");if(!L)continue;let T;if(typeof L.eq=="string")T=[L.eq];else if(Array.isArray(L.eq))T=L.eq.filter(V=>!(0,a.isRef)(V)).map(V=>String(V.eq));else continue;for(const V of T)R[V]||(R[V]=[]),R[V].push(j)}}A(c),A(m);for(const[S,j]of Object.entries(R)){const U=j.filter(L=>q[L]!==void 0);U.length>1&&E(k,"exclusive-violation",`Properties [${U.join(", ")}] are mutually exclusive (group "${S}")`,[...v])}}function K(c,m,q,v,k){if(!q)return;function R(A){if(A)for(const[S,j]of Object.entries(A)){if((0,a.isRef)(j)||q[S]===void 0)continue;const U=o(j,"REQUIRES");if(!(!U||!Array.isArray(U.eq)))for(const L of U.eq){if((0,a.isRef)(L))continue;const T=typeof L.eq=="string"?L.eq:void 0;T&&q[T]===void 0&&E(k,"requires-violation",`Property "${S}" requires "${T}" to be present`,[...v,S])}}}R(c),R(m)}return pe}var Ee;function De(){if(Ee)return ne;Ee=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.MOTLYSchema=ne.MOTLYResult=ne.MOTLYSession=void 0;const a=le(),E=Me(),M=Te(),C=je(),i=Oe(),e=Pe();class t{constructor(s){this.accumulated=[],this.nextParseId=0,this.finished=!1,this.disposed=!1,this.options=s??{}}parse(s){if(this.ensureAlive(),this.finished)throw new Error("MOTLYSession is spent after finish() — create a new session");const o=this.nextParseId++;try{const g=(0,E.parse)(s);return this.accumulated.push({stmts:g,parseId:o}),{parseId:o,errors:[]}}catch(g){if((0,a.isMotlyError)(g))return{parseId:o,errors:[g]};throw g}}finish(){if(this.ensureAlive(),this.finished)throw new Error("finish() has already been called on this session");this.finished=!0;const s=[],o={},g=[];for(const{stmts:W,parseId:Q}of this.accumulated){const O={parseId:Q,options:{disableReferences:this.options.disableReferences}};g.push(...(0,M.flatten)(W,O))}const{splits:y,deps:P}=(0,M.chunk)(g),{order:I}=(0,M.topoSort)(P),N=(0,M.executeChunked)(g,y,I,o,this.options);if(s.push(...N),!this.options.disableReferences){const W=(0,C.validateReferences)(o);for(const Q of W)s.push({code:Q.code,message:Q.message,begin:{line:0,column:0,offset:0},end:{line:0,column:0,offset:0}})}return new n(o,s)}dispose(){this.disposed=!0}ensureAlive(){if(this.disposed)throw new Error("MOTLYSession has been disposed")}}ne.MOTLYSession=t;class n{constructor(s,o){this.value=s,this.errors=o}getValue(){return(0,i.cloneNode)(this.value)}getMot(s){return(0,e.buildMot)(this.value,s)}}ne.MOTLYResult=n;class u{constructor(s){this.tree=s}static parse(s){const o={disableReferences:!0},g={parseId:0,options:o};try{const y=(0,E.parse)(s),P={},I=(0,M.flatten)(y,g),{splits:N,deps:W}=(0,M.chunk)(I),{order:Q}=(0,M.topoSort)(W),O=(0,M.executeChunked)(I,N,Q,P,o);return{schema:new u(P),errors:O}}catch(y){if((0,a.isMotlyError)(y))return{schema:new u({}),errors:[y]};throw y}}validate(s){return(0,C.validateSchema)(s,this.tree)}}return ne.MOTLYSchema=u,ne}var Se;function Ie(){return Se||(Se=1,(function(a){Object.defineProperty(a,"__esModule",{value:!0}),a.MOTLYSchema=a.MOTLYResult=a.MOTLYSession=a.MotValue=a.Mot=a.formatRef=a.isMotlyError=a.isEnvRef=a.isDataNode=a.isRef=void 0;var E=le();Object.defineProperty(a,"isRef",{enumerable:!0,get:function(){return E.isRef}}),Object.defineProperty(a,"isDataNode",{enumerable:!0,get:function(){return E.isDataNode}}),Object.defineProperty(a,"isEnvRef",{enumerable:!0,get:function(){return E.isEnvRef}}),Object.defineProperty(a,"isMotlyError",{enumerable:!0,get:function(){return E.isMotlyError}}),Object.defineProperty(a,"formatRef",{enumerable:!0,get:function(){return E.formatRef}});var M=Pe();Object.defineProperty(a,"Mot",{enumerable:!0,get:function(){return M.Mot}}),Object.defineProperty(a,"MotValue",{enumerable:!0,get:function(){return M.MotValue}});var C=De();Object.defineProperty(a,"MOTLYSession",{enumerable:!0,get:function(){return C.MOTLYSession}}),Object.defineProperty(a,"MOTLYResult",{enumerable:!0,get:function(){return C.MOTLYResult}}),Object.defineProperty(a,"MOTLYSchema",{enumerable:!0,get:function(){return C.MOTLYSchema}})})(ve)),ve}var _e;function Ne(){if(_e)return ue;_e=1;var a={};Object.defineProperty(ue,"__esModule",{value:!0}),ue.TagParser=void 0,ue.parseTag=u,ue.parseAnnotation=d;const E=Ie(),M=$e();function C(s){const o=s.search(/[ \t\r\n]/);return o>0?s.slice(o):""}function i(s){return{code:s.code,message:s.message,line:s.begin.line,offset:s.begin.column}}function e(s,o){const g=o.get(s.parseId);if(g)return{url:g.url,range:{start:{line:g.startLine+s.begin.line,character:s.begin.line===0?g.startColumn+s.begin.column:s.begin.column},end:{line:g.startLine+s.end.line,character:s.end.line===0?g.startColumn+s.end.column:s.end.column}}}}function t(s,o,g){if((0,E.isRef)(s))return new M.Tag({deleted:!0},o);const y=new M.Tag({},o);if(s.location&&g&&(y.location=e(s.location,g)),s.eq!==void 0)if(Array.isArray(s.eq))y.eq=s.eq.map(P=>t(P,y,g));else if((0,E.isEnvRef)(s.eq)){const P=a[s.eq.env];P!==void 0&&(y.eq=P)}else s.eq instanceof Date?y.eq=new Date(s.eq):y.eq=s.eq;if(s.properties!==void 0){y.properties={};for(const[P,I]of Object.entries(s.properties))y.properties[P]=t(I,y,g)}return s.deleted&&(y.deleted=!0),y}class n{constructor(){this.origins=new Map,this.session=new E.MOTLYSession}parse(o,g){return this.parseSource(o,0,g)}parseAnnotation(o,g){const y=C(o),P=o.length-y.length;return this.parseSource(y,P,g)}parseSource(o,g,y){const{parseId:P,errors:I}=this.session.parse(o);y&&this.origins.set(P,{url:y.url,startLine:y.startLine,startColumn:y.startColumn+g});const N=I.map(i);return{tag:new M.Tag,log:N}}finish(){const g=this.session.finish().getValue();return this.session.dispose(),t(g,void 0,this.origins)}}ue.TagParser=n;function u(s){const o=new n;if(typeof s=="string"){const{log:y}=o.parse(s);return{tag:o.finish(),log:y}}const g=[];for(let y=0;y<s.length;y++){const P=o.parse(s[y]);for(const I of P.log)g.push({...I,line:y+I.line})}return{tag:o.finish(),log:g}}function d(s){const o=new n;if(typeof s=="string"){const{log:y}=o.parseAnnotation(s);return{tag:o.finish(),log:y}}const g=[];for(let y=0;y<s.length;y++){const P=o.parseAnnotation(s[y]);for(const I of P.log)g.push({...I,line:y+I.line})}return{tag:o.finish(),log:g}}return ue}var ge={},Ce;function Ue(){if(Ce)return ge;Ce=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.parseString=E;var a;(function(M){M[M.Normal=0]="Normal",M[M.ReverseVirgule=1]="ReverseVirgule",M[M.Unicode=2]="Unicode"})(a||(a={}));function E(M,C=""){let i=M.slice(C.length),e=a.Normal;C.length&&(i=i.slice(0,-C.length));let t="",n="";for(const u of i)switch(e){case a.Normal:{u==="\\"?e=a.ReverseVirgule:t+=u;break}case a.ReverseVirgule:{let d=u;if(u==="u"){e=a.Unicode,n="";continue}u==="b"?d="\b":u==="f"?d="\f":u==="n"?d=`
|
|
23
|
+
`:u==="r"?d="\r":u==="t"&&(d=" "),t+=d,e=a.Normal;break}case a.Unicode:"ABCDEFabcdef0123456789".includes(u)?(n+=u,n.length===4&&(t+=String.fromCharCode(parseInt(n,16)),e=a.Normal)):e=a.Normal}return t}return ge}var xe;function Le(){return xe||(xe=1,(function(a){var E=te&&te.__createBinding||(Object.create?(function(t,n,u,d){d===void 0&&(d=u);var s=Object.getOwnPropertyDescriptor(n,u);(!s||("get"in s?!n.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return n[u]}}),Object.defineProperty(t,d,s)}):(function(t,n,u,d){d===void 0&&(d=u),t[d]=n[u]})),M=te&&te.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),C=te&&te.__exportStar||function(t,n){for(var u in t)u!=="default"&&!Object.prototype.hasOwnProperty.call(n,u)&&E(n,t,u)},i=te&&te.__importStar||(function(){var t=function(n){return t=Object.getOwnPropertyNames||function(u){var d=[];for(var s in u)Object.prototype.hasOwnProperty.call(u,s)&&(d[d.length]=s);return d},t(n)};return function(n){if(n&&n.__esModule)return n;var u={};if(n!=null)for(var d=t(n),s=0;s<d.length;s++)d[s]!=="default"&&E(u,n,d[s]);return M(u,n),u}})();Object.defineProperty(a,"__esModule",{value:!0}),a.ParseUtil=a.TagParser=a.parseAnnotation=a.parseTag=void 0,C($e(),a);var e=Ne();Object.defineProperty(a,"parseTag",{enumerable:!0,get:function(){return e.parseTag}}),Object.defineProperty(a,"parseAnnotation",{enumerable:!0,get:function(){return e.parseAnnotation}}),Object.defineProperty(a,"TagParser",{enumerable:!0,get:function(){return e.TagParser}}),a.ParseUtil=i(Ue())})(te)),te}export{Le as r};
|
package/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap"
|
|
12
12
|
/>
|
|
13
13
|
<title>Malloy Publisher</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-BxDMCn3s.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-5eLCcNmP.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@malloy-publisher/app",
|
|
3
3
|
"description": "Malloy Publisher App",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.220",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"module": "dist/index.es.js",
|
|
@@ -41,11 +41,12 @@
|
|
|
41
41
|
"test:playwright:headed": "bunx playwright test --config=playwright.config.ts --headed"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@malloy-publisher/sdk": "^0.0.
|
|
44
|
+
"@malloy-publisher/sdk": "^0.0.220",
|
|
45
45
|
"@mui/icons-material": "^7.0.2",
|
|
46
46
|
"@mui/material": "^7.0.2",
|
|
47
47
|
"@tanstack/react-query": "^5.59.16",
|
|
48
48
|
"@vitejs/plugin-react": "^4.3.1",
|
|
49
|
+
"react-colorful": "^5.6.1",
|
|
49
50
|
"react-router-dom": "^7.6.2"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{u as we,g as ke,r as u,R as Se,a as Pe,c as H,j as t,s as I,B as Ee,m as _,e as ne,b as se,d as ae,f as ie,h as Ce,i as O,k as le,T as K,l as G,n as Ie,o as Me,q as Re,t as ce,v as ze,w as oe,x as De,y as Te,z as Be,A,C as L,M as He,P as $e,D as Le,E as Ne,S as Ae,F as de,H as J,G as x,I as We,J as Y,K as Z,L as Oe,N as q,O as Ve,Q as Ue,U as pe,V as ue,W as he,X as Qe,Y as Fe,Z as Ye}from"./index--xJ1pzL-.js";function Xe(e,r,n,o,s){const[a,i]=u.useState(()=>s&&n?n(e).matches:o?o(e).matches:r);return Pe(()=>{if(!n)return;const c=n(e),h=()=>{i(c.matches)};return h(),c.addEventListener("change",h),()=>{c.removeEventListener("change",h)}},[e,n]),a}const _e={...Se},fe=_e.useSyncExternalStore;function Ke(e,r,n,o,s){const a=u.useCallback(()=>r,[r]),i=u.useMemo(()=>{if(s&&n)return()=>n(e).matches;if(o!==null){const{matches:p}=o(e);return()=>p}return a},[a,e,o,s,n]),[c,h]=u.useMemo(()=>{if(n===null)return[a,()=>()=>{}];const p=n(e);return[()=>p.matches,m=>(p.addEventListener("change",m),()=>{p.removeEventListener("change",m)})]},[a,n,e]);return fe(h,c,i)}function me(e={}){const{themeId:r}=e;return function(o,s={}){let a=we();a&&r&&(a=a[r]||a);const i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:c=!1,matchMedia:h=i?window.matchMedia:null,ssrMatchMedia:f=null,noSsr:p=!1}=ke({name:"MuiUseMediaQuery",props:s,theme:a});let m=typeof o=="function"?o(a):o;return m=m.replace(/^@media( ?)/m,""),m.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
|
|
2
|
-
`)),(fe!==void 0?Ke:Xe)(m,c,h,f,p)}}me();const Ge=H(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),Je=I(Ee,{name:"MuiBreadcrumbCollapsed"})(_(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:ne(e.palette.grey[200],.12)}:{backgroundColor:ne(e.palette.grey[600],.12)}}}))),Ze=I(Ge)({width:24,height:16});function qe(e){const{slots:r={},slotProps:n={},...o}=e,s=e;return t.jsx("li",{children:t.jsx(Je,{focusRipple:!0,...o,ownerState:s,children:t.jsx(Ze,{as:r.CollapsedIcon,ownerState:s,...n.collapsedIcon})})})}function et(e){return ae("MuiBreadcrumbs",e)}const tt=se("MuiBreadcrumbs",["root","ol","li","separator"]),rt=e=>{const{classes:r}=e;return le({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},et,r)},nt=I(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${tt.li}`]:r.li},r.root]})({}),ot=I("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),st=I("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function at(e,r,n,o){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(st,{"aria-hidden":!0,className:r,ownerState:o,children:n},`separator-${i}`)):s.push(a),s),[])}const it=u.forwardRef(function(r,n){const o=ie({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:c={},slotProps:h={},expandText:f="Show path",itemsAfterCollapse:p=1,itemsBeforeCollapse:m=1,maxItems:y=8,separator:S="/",...$}=o,[M,P]=u.useState(!1),v={...o,component:i,expanded:M,expandText:f,itemsAfterCollapse:p,itemsBeforeCollapse:m,maxItems:y,separator:S},E=rt(v),R=Ce({elementType:c.CollapsedIcon,externalSlotProps:h.collapsedIcon,ownerState:v}),j=u.useRef(null),w=d=>{const k=()=>{P(!0);const b=j.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return m+p>=d.length?d:[...d.slice(0,m),t.jsx(qe,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:k},"ellipsis"),...d.slice(d.length-p,d.length)]},z=u.Children.toArray(s).filter(d=>u.isValidElement(d)).map((d,k)=>t.jsx("li",{className:E.li,children:d},`child-${k}`));return t.jsx(nt,{ref:n,component:i,color:"textSecondary",className:O(E.root,a),ownerState:v,...$,children:t.jsx(ot,{className:E.ol,ref:j,ownerState:v,children:at(M||y&&z.length<=y?z:w(z),E.separator,S,v)})})});function lt(e,r,n){const o=r.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),a=ce(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const f=a.getComputedStyle(r);i=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let c=0,h=0;if(i&&i!=="none"&&typeof i=="string"){const f=i.split("(")[1].split(")")[0].split(",");c=parseInt(f[4],10),h=parseInt(f[5],10)}return e==="left"?s?`translateX(${s.right+c-o.left}px)`:`translateX(${a.innerWidth+c-o.left}px)`:e==="right"?s?`translateX(-${o.right-s.left-c}px)`:`translateX(-${o.left+o.width-c}px)`:e==="up"?s?`translateY(${s.bottom+h-o.top}px)`:`translateY(${a.innerHeight+h-o.top}px)`:s?`translateY(-${o.top-s.top+o.height-h}px)`:`translateY(-${o.top+o.height-h}px)`}function ct(e){return typeof e=="function"?e():e}function W(e,r,n){const o=ct(n),s=lt(e,r,o);s&&(r.style.webkitTransform=s,r.style.transform=s)}const dt=u.forwardRef(function(r,n){const o=G(),s={enter:o.transitions.easing.easeOut,exit:o.transitions.easing.sharp},a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{addEndListener:i,appear:c=!0,children:h,container:f,direction:p="down",easing:m=s,in:y,onEnter:S,onEntered:$,onEntering:M,onExit:P,onExited:v,onExiting:E,style:R,timeout:j=a,TransitionComponent:w=Ie,...z}=r,d=u.useRef(null),k=Me(Re(h),d,n),b=l=>g=>{l&&(g===void 0?l(d.current):l(d.current,g))},V=b((l,g)=>{W(p,l,f),De(l),S&&S(l,g)}),ee=b((l,g)=>{const B=oe({timeout:j,style:R,easing:m},{mode:"enter"});l.style.webkitTransition=o.transitions.create("-webkit-transform",{...B}),l.style.transition=o.transitions.create("transform",{...B}),l.style.webkitTransform="none",l.style.transform="none",M&&M(l,g)}),D=b($),T=b(E),C=b(l=>{const g=oe({timeout:j,style:R,easing:m},{mode:"exit"});l.style.webkitTransition=o.transitions.create("-webkit-transform",g),l.style.transition=o.transitions.create("transform",g),W(p,l,f),P&&P(l)}),U=b(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),Q=l=>{i&&i(d.current,l)},N=u.useCallback(()=>{d.current&&W(p,d.current,f)},[p,f]);return u.useEffect(()=>{if(y||p==="down"||p==="right")return;const l=ze(()=>{d.current&&W(p,d.current,f)}),g=ce(d.current);return g.addEventListener("resize",l),()=>{l.clear(),g.removeEventListener("resize",l)}},[p,y,f]),u.useEffect(()=>{y||N()},[y,N]),t.jsx(w,{nodeRef:d,onEnter:V,onEntered:D,onEntering:ee,onExit:C,onExited:U,onExiting:T,addEndListener:Q,appear:c,in:y,timeout:j,...z,children:(l,{ownerState:g,...B})=>u.cloneElement(h,{ref:k,style:{visibility:l==="exited"&&!y?"hidden":void 0,...R,...h.props.style},...B})})});function pt(e){return ae("MuiDrawer",e)}se("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const xe=(e,r)=>{const{ownerState:n}=e;return[r.root,(n.variant==="permanent"||n.variant==="persistent")&&r.docked,r.modal]},ut=e=>{const{classes:r,anchor:n,variant:o}=e,s={root:["root",`anchor${L(n)}`],docked:[(o==="permanent"||o==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${L(n)}`,o!=="temporary"&&`paperAnchorDocked${L(n)}`]};return le(s,pt,r)},ht=I(He,{name:"MuiDrawer",slot:"Root",overridesResolver:xe})(_(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ft=I("div",{shouldForwardProp:Le,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:xe})({flex:"0 0 auto"}),mt=I($e,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:n}=e;return[r.paper,r[`paperAnchor${L(n.anchor)}`],n.variant!=="temporary"&&r[`paperAnchorDocked${L(n.anchor)}`]]}})(_(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ge={left:"right",right:"left",top:"down",bottom:"up"};function xt(e){return["left","right"].includes(e)}function gt({direction:e},r){return e==="rtl"&&xt(r)?ge[r]:r}const yt=u.forwardRef(function(r,n){const o=ie({props:r,name:"MuiDrawer"}),s=G(),a=Te(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:c="left",BackdropProps:h,children:f,className:p,elevation:m=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:S,...$}={},onClose:M,open:P=!1,PaperProps:v={},SlideProps:E,TransitionComponent:R,transitionDuration:j=i,variant:w="temporary",slots:z={},slotProps:d={},...k}=o,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const V=gt({direction:a?"rtl":"ltr"},c),D={...o,anchor:c,elevation:m,open:P,variant:w,...k},T=ut(D),C={slots:{transition:R,...z},slotProps:{paper:v,transition:E,...d,backdrop:Be(d.backdrop||{...h,...S},{transitionDuration:j})}},[U,Q]=A("root",{ref:n,elementType:ht,className:O(T.root,T.modal,p),shouldForwardComponentProp:!0,ownerState:D,externalForwardedProps:{...C,...k,...$},additionalProps:{open:P,onClose:M,hideBackdrop:y,slots:{backdrop:C.slots.backdrop},slotProps:{backdrop:C.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:mt,shouldForwardComponentProp:!0,className:O(T.paper,v.className),ownerState:D,externalForwardedProps:C,additionalProps:{elevation:w==="temporary"?m:0,square:!0,...w==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[g,B]=A("docked",{elementType:ft,ref:n,className:O(T.root,T.docked,p),ownerState:D,externalForwardedProps:C,additionalProps:k}),[ve,je]=A("transition",{elementType:dt,ownerState:D,externalForwardedProps:C,additionalProps:{in:P,direction:ge[V],timeout:j,appear:b.current}}),te=t.jsx(N,{...l,children:f});if(w==="permanent")return t.jsx(g,{...B,children:te});const re=t.jsx(ve,{...je,children:te});return w==="persistent"?t.jsx(g,{...B,children:re}):t.jsx(U,{...Q,children:re})}),bt=me({themeId:Ne}),vt=H([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),jt=H(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),wt=H(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),kt=H(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),St=H(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Pt=H(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}));function X(e){return t.jsxs(Ae,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}function F({label:e,onClick:r}){return t.jsx(We,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:{backgroundColor:"background.paper",color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:"grey.100"}}})}function Et(){const e=de(),r=e["*"],n=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(x,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(it,{"aria-label":"breadcrumb",separator:t.jsx(jt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(F,{label:e.environmentName,onClick:o=>n(`/${e.environmentName}/`,o)}),e.packageName&&t.jsx(F,{label:e.packageName,onClick:o=>n(`/${e.environmentName}/${e.packageName}/`,o)}),r&&t.jsx(F,{label:r,onClick:o=>n(`/${e.environmentName}/${e.packageName}/${r}`,o)})]})})}const Ct=260,It=64;function ye({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){return t.jsxs(x,{sx:{height:"100dvh",width:e?It:Ct,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Mt,{isCollapsed:e,onToggleCollapse:r,logoHeader:n}),t.jsxs(x,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Rt,{isCollapsed:e}),t.jsx(zt,{isCollapsed:e})]}),t.jsx(Dt,{isCollapsed:e})]})}function Mt({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){const o=J();return n?t.jsxs(x,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[n,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(X,{fontSize:"small"})})]}):t.jsxs(x,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(x,{onClick:s=>o("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(x,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(Z,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(X,{fontSize:"small"})})})]})}function Rt({isCollapsed:e}){const n=Oe().pathname==="/";return t.jsx(q,{sx:{py:0},children:t.jsx(be,{icon:t.jsx(St,{fontSize:"small"}),label:"Home",to:"/",selected:n,isCollapsed:e})})}function zt({isCollapsed:e}){const{apiClients:r}=Ve(),n=de(),{data:o}=Ue({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=o?.data??[];return s.length===0?null:t.jsxs(x,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(q,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(be,{icon:t.jsx(kt,{fontSize:"small"}),label:i,to:`/${i}`,selected:n.environmentName===i,isCollapsed:e},i)})})]})}function Dt({isCollapsed:e}){const r=[{label:"Malloy Docs",href:"https://docs.malloydata.dev/documentation/",icon:t.jsx(vt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:"https://github.com/malloydata/publisher/blob/main/README.md",icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(wt,{fontSize:"small"}),external:!1}];return t.jsx(q,{sx:{py:1},children:r.map(n=>t.jsx(Tt,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))})}function be({icon:e,label:r,to:n,selected:o,isCollapsed:s}){const a=J(),i=t.jsxs(pe,{selected:o,onClick:c=>a(n,c),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:o?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(he,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(Z,{title:r,placement:"right",children:t.jsx(x,{children:i})}):i}function Tt({label:e,href:r,icon:n,external:o,isCollapsed:s}){const a=t.jsxs(pe,{component:"a",href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:n}),!s&&t.jsx(he,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(Z,{title:e,placement:"right",children:t.jsx(x,{children:a})}):a}function Bt({open:e,onClose:r,logoHeader:n}){return t.jsx(yt,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ye,{isCollapsed:!1,onToggleCollapse:r,logoHeader:n})})}function $t({headerProps:e}){const r=G(),n=bt(r.breakpoints.up("md")),[o,s]=u.useState(!1),[a,i]=u.useState(!1);return u.useEffect(()=>{n&&o&&s(!1)},[n,o]),t.jsxs(x,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[n&&t.jsx(ye,{isCollapsed:a,onToggleCollapse:()=>i(c=>!c),logoHeader:e?.logoHeader}),t.jsxs(x,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(x,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(x,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(X,{fontSize:"small"})})}),t.jsx(x,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Et,{})}),t.jsx(x,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:e?.endCap})]}),t.jsx(x,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Ye,{}),children:t.jsx(Fe,{})})})]}),t.jsx(Bt,{open:o,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{$t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as c,j as e,_ as t,$ as l,G as r,a0 as x,a1 as d}from"./index--xJ1pzL-.js";function u(){const n=c(),a=n["*"];if(!n.environmentName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})});if(!n.packageName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});const s={p:3,maxWidth:1200,mx:"auto"};if(a?.startsWith("pages/")&&!a.endsWith(".malloy")&&!a.endsWith(".malloynb")){const m=a.slice(6),o=t({environmentName:n.environmentName,packageName:n.packageName,modelPath:m});return e.jsx(l,{resourceUri:o})}const i=t({environmentName:n.environmentName,packageName:n.packageName,modelPath:a});return a?.endsWith(".malloy")?e.jsx(r,{sx:s,children:e.jsx(x,{resourceUri:i,runOnDemand:!0,maxResultSize:512*1024})}):a?.endsWith(".malloynb")?e.jsx(r,{sx:s,children:e.jsx(d,{resourceUri:i,maxResultSize:1024*1024})}):e.jsx(r,{sx:s,children:e.jsxs("h2",{children:["Unrecognized file type: ",a]})})}export{u as default};
|