jbrowse-plugin-protein3d 0.0.8 → 0.0.9
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/ProteinView/util.js +1 -1
- package/dist/ProteinView/util.js.map +1 -1
- package/dist/jbrowse-plugin-protein3d.umd.production.min.js +3 -3
- package/dist/jbrowse-plugin-protein3d.umd.production.min.js.map +3 -3
- package/dist/out.js +517 -505
- package/package.json +1 -1
- package/src/ProteinView/util.ts +1 -1
|
@@ -17,7 +17,7 @@ ${s.join(`
|
|
|
17
17
|
#
|
|
18
18
|
`)}writeCategory(t,r,n){if(this.encoded)throw new Error("The writer contents have already been encoded, no more writing.");if(!this.dataBlockCreated)throw new Error("No data block created.");if(!n?.ignoreFilter&&!this.filter.includeCategory(t.name))return;let{instance:o,rowCount:i,source:a}=G4(t,r);i&&(i===1?Glt(t,o,a,this.builder,this.filter,this.formatter):Hlt(t,o,a,this.builder,this.filter,this.formatter))}encode(){this.encoded=!0}writeTo(t){let r=Nt.getChunks(this.builder);for(let n=0,o=r.length;n<o;n++)t.writeString(r[n])}getSize(){return Nt.getSize(this.builder)}getData(){return Nt.getString(this.builder)}}});var ex,_2,K4,Y4,_T=M(()=>{tx();ex={is(e){return typeof e.charCodeAt=="function"},toString(e){try{return e.toString()}catch(t){throw new Error(`Failed to convert StringLike object into string. This might be because the length ${e.length} exceeds maximum allowed string length ${_2}. (${t})`)}}},_2=536870888,K4=28,Y4=class e{get length(){return this._length}constructor(t=K4){this._chunks=[],this._length=0,this._tmpArray=[],this.STRING_CHUNK_SIZE=2**t,this.STRING_CHUNK_SHIFT=t,this.STRING_CHUNK_MASK=2**t-1}static fromString(t,r=K4){let n=new e(r);return n._append(t),n}static fromStrings(t,r=K4){let n=new e(r);for(let o of t)n._append(o);return n}static fromUtf8Data(t,r=0,n=t.length,o=K4){let i=2**o,a=[],s=r;for(;s<n;){let l=Math.min(s+i,n);if(l<n){for(;(t[l]&192)===128;)if(l--,l===s)throw new Error("Input is rubbish, no UTF-8 character start found in a chunk")}let c=B0(t,s,l-s);a.push(c),s=l}return e.fromStrings(a,o)}_append(t){let r=this.STRING_CHUNK_SIZE,n=this._chunks.length===0||this._chunks[this._chunks.length-1].length===r?"":this._chunks.pop(),o=r-n.length;for(this._chunks.push(n+t.substring(0,o));o<t.length;)this._chunks.push(t.substring(o,o+r)),o+=r;this._length+=t.length}_getChunkIndex(t){return t>>>this.STRING_CHUNK_SHIFT}_getIndexInChunk(t){return t&this.STRING_CHUNK_MASK}_isOutOfRange(t){return t<0||t>=this.length}at(t){return-this.length<=t&&t<0?this.at(t+this.length):this.charAt(t)||void 0}charAt(t){if(this._isOutOfRange(t))return"";let r=this._getChunkIndex(t),n=this._getIndexInChunk(t);return this._chunks[r][n]}charCodeAt(t){if(this._isOutOfRange(t))return NaN;let r=this._getChunkIndex(t),n=this._getIndexInChunk(t);return this._chunks[r].charCodeAt(n)}substring(t,r){let n=Math.min(Math.max(t??0,0),this.length),o=Math.min(Math.max(r??this.length,0),this.length);if(n>o)return this.substring(o,n);if(n===o)return"";if(o-n>_2)throw new Error(`Trying to create get a substring longer (${o-n}) than maximum allowed string length (${_2}).`);let i=this._getChunkIndex(n),a=this._getIndexInChunk(n),s=this._getChunkIndex(o),l=this._getIndexInChunk(o);if(i===s)return this._chunks[i].substring(a,l);{let c=this._getTmpArray();c.push(this._chunks[i].substring(a,this.STRING_CHUNK_SIZE));for(let u=i+1;u<s;u++)c.push(this._chunks[u]);return c.push(this._chunks[s].substring(0,l)),c.join("")}}_getTmpArray(){for(;this._tmpArray.length;)this._tmpArray.pop();return this._tmpArray}indexOf(t,r=0){if(t.length>this.STRING_CHUNK_SIZE)throw new Error("NotImplementedError: indexOf is only implemented for searchString shorter than STRING_CHUNK_SIZE");r<0&&(r=0);let n=this._getChunkIndex(r);for(let o=n;o<this._chunks.length;o++){let i=this._chunks[o],a=o===n?this._getIndexInChunk(r):0,s=i.indexOf(t,a);if(s>=0)return o*this.STRING_CHUNK_SIZE+s;if(o!==this._chunks.length-1){let l=Math.max(this.STRING_CHUNK_SIZE-t.length+1,a),u=(i.substring(l,void 0)+this._chunks[o+1].substring(0,t.length-1)).indexOf(t);if(u>=0)return o*this.STRING_CHUNK_SIZE+l+u}}return-1}includes(t,r=0){return this.indexOf(t,r)>=0}startsWith(t,r=0){if(t.length>this.STRING_CHUNK_SIZE)throw new Error("NotImplementedError: startsWith is only implemented for searchString shorter than STRING_CHUNK_SIZE");return this.substring(r,r+t.length)===t}toString(){try{return this._chunks.join("")}catch(t){throw new Error(`Failed to convert StringLike object into string. This might be because the length ${this.length} exceeds maximum allowed string length ${_2}. (${t})`)}}}});function rx(e,t,r){for(let n=0,o=r.length;n<o;n++){let i=r.charCodeAt(n);if(i<128){e[t++]=i>>>0&127|0;continue}if(i<2048){e[t++]=i>>>6&31|192,e[t++]=i>>>0&63|128;continue}if(i<65536){e[t++]=i>>>12&15|224,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128;continue}if(i<1114112){e[t++]=i>>>18&7|240,e[t++]=i>>>12&63|128,e[t++]=i>>>6&63|128,e[t++]=i>>>0&63|128;continue}throw new Error("bad codepoint "+i)}}function xge(e){throw new Error(e)}function Jlt(e,t,r){let n=Qlt,o,i=0,a=[],s=512;for(let l=t,c=t+r;l<c;l++){let u=e[l];(u&128)===0?a[i++]=n[u]:(u&224)===192?a[i++]=n[(u&15)<<6|e[++l]&63]:(u&240)===224?a[i++]=String.fromCharCode((u&15)<<12|(e[++l]&63)<<6|(e[++l]&63)<<0):(u&248)===240?a[i++]=String.fromCharCode((u&7)<<18|(e[++l]&63)<<12|(e[++l]&63)<<6|(e[++l]&63)<<0):xge("Invalid byte "+u.toString(16)),i===s&&(o=o||[],o[o.length]=a.join(""),i=0)}return o?(i>0&&(o[o.length]=a.slice(0,i).join("")),o.join("")):a.slice(0,i).join("")}function B0(e,t=0,r=e.length){if(bge){let n=t||r!==e.length?e.subarray(t,t+r):e;return bge.decode(n)}else return Jlt(e,t,r)}function X4(e,t=0,r=e.length){if(r<=_2)return B0(e,t,r);let n=Y4.fromUtf8Data(e,t,t+r);return n.length<=_2?n.toString():n}function CT(e){let t=0;for(let r=0,n=e.length;r<n;r++){let o=e.charCodeAt(r);if(o<128){t+=1;continue}if(o<2048){t+=2;continue}if(o<65536){t+=3;continue}if(o<1114112){t+=4;continue}xge("bad codepoint "+o)}return t}var Qlt,bge,tx=M(()=>{_T();Qlt=(function(){let e=[];for(let t=0;t<1024;t++)e[t]=String.fromCharCode(t);return e})();bge=typeof TextDecoder<"u"?new TextDecoder:void 0});function Sge(e){let t=new ArrayBuffer(Z4(e)),r=new DataView(t),n=new Uint8Array(t);return $4(e,r,n,0),n}function Z4(e){let t=typeof e;if(t==="string"){let r=CT(e);if(r<32)return 1+r;if(r<256)return 2+r;if(r<65536)return 3+r;if(r<4294967296)return 5+r}if(e instanceof Uint8Array){let r=e.byteLength;if(r<256)return 2+r;if(r<65536)return 3+r;if(r<4294967296)return 5+r}if(t==="number"){if(Math.floor(e)!==e)return 9;if(e>=0){if(e<128)return 1;if(e<256)return 2;if(e<65536)return 3;if(e<4294967296)return 5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return 1;if(e>=-128)return 2;if(e>=-32768)return 3;if(e>=-2147483648)return 5;throw new Error("Number too small -0x"+e.toString(16).substr(1))}if(t==="boolean"||e===null||e===void 0)return 1;if(t==="object"){let r,n=0;if(Array.isArray(e)){r=e.length;for(let o=0;o<r;o++)n+=Z4(e[o])}else{let o=Object.keys(e);r=o.length;for(let i=0;i<r;i++){let a=o[i];n+=Z4(a)+Z4(e[a])}}if(r<16)return 1+n;if(r<65536)return 3+n;if(r<4294967296)return 5+n;throw new Error("Array or object too long 0x"+r.toString(16))}throw new Error("Unknown type "+t)}function $4(e,t,r,n){let o=typeof e;if(o==="string"){let i=CT(e);if(i<32)return t.setUint8(n,i|160),rx(r,n+1,e),1+i;if(i<256)return t.setUint8(n,217),t.setUint8(n+1,i),rx(r,n+2,e),2+i;if(i<65536)return t.setUint8(n,218),t.setUint16(n+1,i),rx(r,n+3,e),3+i;if(i<4294967296)return t.setUint8(n,219),t.setUint32(n+1,i),rx(r,n+5,e),5+i}if(e instanceof Uint8Array){let i=e.byteLength,a=new Uint8Array(t.buffer);if(i<256)return t.setUint8(n,196),t.setUint8(n+1,i),a.set(e,n+2),2+i;if(i<65536)return t.setUint8(n,197),t.setUint16(n+1,i),a.set(e,n+3),3+i;if(i<4294967296)return t.setUint8(n,198),t.setUint32(n+1,i),a.set(e,n+5),5+i}if(o==="number"){if(!isFinite(e))throw new Error("Number not finite: "+e);if(Math.floor(e)!==e)return t.setUint8(n,203),t.setFloat64(n+1,e),9;if(e>=0){if(e<128)return t.setUint8(n,e),1;if(e<256)return t.setUint8(n,204),t.setUint8(n+1,e),2;if(e<65536)return t.setUint8(n,205),t.setUint16(n+1,e),3;if(e<4294967296)return t.setUint8(n,206),t.setUint32(n+1,e),5;throw new Error("Number too big 0x"+e.toString(16))}if(e>=-32)return t.setInt8(n,e),1;if(e>=-128)return t.setUint8(n,208),t.setInt8(n+1,e),2;if(e>=-32768)return t.setUint8(n,209),t.setInt16(n+1,e),3;if(e>=-2147483648)return t.setUint8(n,210),t.setInt32(n+1,e),5;throw new Error("Number too small -0x"+(-e).toString(16).substr(1))}if(e==null)return t.setUint8(n,192),1;if(o==="boolean")return t.setUint8(n,e?195:194),1;if(o==="object"){let i,a=0,s=Array.isArray(e),l;if(s?i=e.length:(l=Object.keys(e),i=l.length),i<16?(t.setUint8(n,i|(s?144:128)),a=1):i<65536?(t.setUint8(n,s?220:222),t.setUint16(n+1,i),a=3):i<4294967296&&(t.setUint8(n,s?221:223),t.setUint32(n+1,i),a=5),s)for(let c=0;c<i;c++)a+=$4(e[c],t,r,n+a);else for(let c=0,u=l.length;c<u;c++){let d=l[c];a+=$4(d,t,r,n+a),a+=$4(e[d],t,r,n+a)}return a}throw new Error("Unknown type "+o)}var _ge=M(()=>{tx()});function ect(e,t){return t&&t.typedArray?t.typedArray:e.defaultFormat&&e.defaultFormat.typedArray?e.defaultFormat.typedArray:e.type===sl.Type.Str?Array:e.type===sl.Type.Int?Int32Array:Float64Array}function tct(e){return e===sl.Type.Str?cg.by(Nn.stringArray):cg.by(Nn.byteArray)}function rct(e,t,r,n){return r&&r.encoder?r.encoder:t.defaultFormat&&t.defaultFormat.encoder?t.defaultFormat.encoder:n?n.get(e,t.name):void 0}function nct(e,t){return e===sl.Type.Str?cg.by(Nn.stringArray):e===sl.Type.Int?yD(t):dge(t)}function oct(e,t,r,n,o,i,a){let{array:s,allPresent:l,mask:c}=ict(t,ect(t,o),n,r),u;t.type===sl.Type.Str?u=cg.by(Nn.stringArray):u=rct(e,t,o,i),u||(a?u=nct(t.type,s):u=tct(t.type));let d=u.encode(s),f;if(!l){let m=cg.by(Nn.runLength).and(Nn.byteArray).encode(c);m.data.length<c.length?f=m:f=cg.by(Nn.byteArray).encode(c)}return{name:t.name,data:d,mask:f}}function ict(e,t,r,n){let o=e.type===sl.Type.Str,i=new t(r),a=new Uint8Array(r),s=e.valueKind,l=e.value,c=!0,u=0;for(let d=0;d<n.length;d++){let f=n[d].data,m=n[d].keys();for(;m.hasNext;){let p=m.move(),h=s?s(p,f):G.ValueKinds.Present;if(h!==G.ValueKinds.Present)a[u]=h,o&&(i[u]=""),c=!1;else{let g=l(p,f,u);typeof g=="string"&&!g?(a[u]=G.ValueKinds.NotPresent,c=!1):a[u]=G.ValueKinds.Present,i[u]=g}u++}}return{array:i,allPresent:c,mask:a}}var Q4,Cge=M(()=>{Tr();_ge();vD();j4();HW();V4();Q4=class{setFilter(t){this.filter=t||ld.DefaultFilter}isCategoryIncluded(t){return this.filter.includeCategory(t)}setFormatter(t){this.formatter=t||ld.DefaultFormatter}startDataBlock(t){this.dataBlocks.push({header:(t||"").replace(/[ \n\t]/g,"").toUpperCase(),categories:[]})}writeCategory(t,r,n){if(!this.data)throw new Error("The writer contents have already been encoded, no more writing.");if(!this.dataBlocks.length)throw new Error("No data block created.");if(!n?.ignoreFilter&&!this.filter.includeCategory(t.name))return;let{instance:o,rowCount:i,source:a}=G4(t,r);if(!i)return;let s={name:"_"+t.name,columns:[],rowCount:i},l=xD(o);for(let c of l){if(!this.filter.includeField(t.name,c.name))continue;let u=this.formatter.getFormat(t.name,c.name);s.columns.push(oct(t.name,c,a,i,u,this.binaryEncodingProvider,this.autoClassify))}s.columns.length&&this.dataBlocks[this.dataBlocks.length-1].categories.push(s)}encode(){this.encodedData||(this.encodedData=Sge(this.data),this.data=null,this.dataBlocks=null)}writeTo(t){t.writeBinary(this.encodedData)}getData(){return this.encode(),this.encodedData}getSize(){return this.encodedData.length}constructor(t,r,n){this.autoClassify=n,this.dataBlocks=[],this.filter=ld.DefaultFilter,this.formatter=ld.DefaultFormatter,this.isBinary=!0,this.binaryEncodingProvider=void 0,this.binaryEncodingProvider=r,this.data={encoder:t,version:rge,dataBlocks:this.dataBlocks}}}});var Di,Om=M(()=>{vge();Cge();j4();vD();(function(e){e.Encoder=q4,e.Category=ld,e.Field=sl,e.Encoding=Nn;function t(l){let{binary:c=!1,encoderName:u="mol*"}=l||{};return c?new Q4(u,l?l.binaryEncodingPovider:void 0,l?!!l.binaryAutoClassifyEncoding:!1):new W4}e.createEncoder=t;function r(){return e.Field.build()}e.fields=r;var n=e.Encoding;e.Encodings={deltaRLE:n.by(n.delta).and(n.runLength).and(n.integerPacking),fixedPoint2:n.by(n.fixedPoint(100)).and(n.delta).and(n.integerPacking),fixedPoint3:n.by(n.fixedPoint(1e3)).and(n.delta).and(n.integerPacking)};function o(l,c){return{fields:l,source:[c]}}e.categoryInstance=o;function i(l){return{get(c,u){let d=l.categories[c];if(!d)return;let f=d.getField(u);return f&&f.binaryEncoding?cg.fromEncoding(f.binaryEncoding):void 0}}}e.createEncodingProviderFromCifFrame=i;function a(l){return{get(c,u){for(let d=0;d<l.length;d++){let f=l[d];if(f.categoryName===c&&f.columnName===u)return s(f)}}}}e.createEncodingProviderFromJsonConfig=a;function s(l){let c=l.precision;if(c!==void 0){let u=Math.pow(10,c),d=n.by(n.fixedPoint(u));switch(l.encoding){case"pack":return d.and(n.integerPacking);case"rle":return d.and(n.runLength).and(n.integerPacking);case"delta":return d.and(n.delta).and(n.integerPacking);case"delta-rle":return d.and(n.delta).and(n.runLength).and(n.integerPacking)}}else switch(l.encoding){case"pack":return n.by(n.integerPacking);case"rle":return n.by(n.runLength).and(n.integerPacking);case"delta":return n.by(n.delta).and(n.integerPacking);case"delta-rle":return n.by(n.delta).and(n.runLength).and(n.integerPacking)}throw new Error("cannot be reached")}})(Di||(Di={}))});var nb,WW=M(()=>{Br();J1();Om();Tr();I0();(function(e){e.Descriptor={name:"chem_comp_bond",cifExport:{prefix:"",categories:[{name:"chem_comp_bond",instance(o){let i=e.Provider.get(o.firstModel);if(!i)return Di.Category.Empty;let a=i.data;if(!a)return Di.Category.Empty;let s=o.structures[0].uniqueResidueNames,{comp_id:l,_rowCount:c}=a,u=[];for(let d=0;d<c;d++)s.has(l.value(d))&&(u[u.length]=d);return Di.Category.ofTable(a,u)}}]}},e.Provider=Xl.create(e.Descriptor);function t(o,i){return Or.pick(i,Dn.chem_comp_bond,a=>o.properties.chemicalComponentMap.has(i.comp_id.value(a)))}e.chemCompBondFromTable=t;function r(o){let i=new Map;function a(h){if(i.has(h))return i.get(h);let g=new n(h);return i.set(h,g),g}let{comp_id:s,atom_id_1:l,atom_id_2:c,value_order:u,pdbx_aromatic_flag:d,_rowCount:f,pdbx_ordinal:m}=o,p=a(s.value(0));for(let h=0;h<f;h++){let g=s.value(h),y=l.value(h),b=c.value(h),x=u.value(h),C=d.value(h)==="y",S=m.value(h);p.id!==g&&(p=a(g));let w=Tt.Flag.Covalent,A=1;switch(C&&(w|=Tt.Flag.Aromatic),x.toLowerCase()){case"delo":w|=Tt.Flag.Aromatic;break;case"doub":A=2;break;case"trip":A=3;break;case"quad":A=4;break}p.add(y,b,A,w,S)}return i}e.getEntriesFromChemCompBond=r;class n{add(i,a,s,l,c,u=!0){let d=this.map.get(i);if(d!==void 0)d.get(a)===void 0&&d.set(a,{order:s,flags:l,key:c});else{let f=new Map;f.set(a,{order:s,flags:l,key:c}),this.map.set(i,f)}u&&this.add(a,i,s,l,c,!1)}constructor(i){this.id=i,this.map=new Map}}e.Entry=n})(nb||(nb={}))});var cd,SD=M(()=>{Br();Tr();Ut();Om();L4();I0();(function(e){e.Descriptor={name:"struct_conn",cifExport:{prefix:"",categories:[{name:"struct_conn",instance(i){let a=e.Provider.get(i.firstModel);if(!a||a.entries.length===0)return Di.Category.Empty;let s=i.structures[0],l=[];for(let c of a.entries)r(s,c.partnerA.atomIndex)&&r(s,c.partnerB.atomIndex)&&(l[l.length]=c.rowIndex);return Di.Category.ofTable(a.data,l)}}]}},e.Provider=Xl.create(e.Descriptor);function t(i){let a=e.Provider.get(i);return!!a&&a.entries.length/i.atomicConformation.atomId.rowCount>.95}e.isExhaustive=t;function r({units:i},a){for(let s=0,l=i.length;s<l;s++)if(je.indexOf(i[s].elements,a)>=0)return!0;return!1}function n(i){let a=new Map;for(let s of i){let{partnerA:{atomIndex:l},partnerB:{atomIndex:c}}=s;a.has(l)?a.get(l).push(s):a.set(l,[s]),a.has(c)?a.get(c).push(s):a.set(c,[s])}return a}e.getAtomIndexFromEntries=n;function o(i,a){let{conn_type_id:s,pdbx_dist_value:l,pdbx_value_order:c}=i,u={label_asym_id:i.ptnr1_label_asym_id,label_seq_id:i.ptnr1_label_seq_id,auth_seq_id:i.ptnr1_auth_seq_id,label_atom_id:i.ptnr1_label_atom_id,label_alt_id:i.pdbx_ptnr1_label_alt_id,ins_code:i.pdbx_ptnr1_PDB_ins_code,symmetry:i.ptnr1_symmetry},d={label_asym_id:i.ptnr2_label_asym_id,label_seq_id:i.ptnr2_label_seq_id,auth_seq_id:i.ptnr2_auth_seq_id,label_atom_id:i.ptnr2_label_atom_id,label_alt_id:i.pdbx_ptnr2_label_alt_id,ins_code:i.pdbx_ptnr2_PDB_ins_code,symmetry:i.ptnr2_symmetry},f=Array.from(a.entities.data.id.toArray()),m=(h,g)=>{if(g.label_asym_id.valueKind(h)!==G.ValueKinds.Present)return;let y=g.label_asym_id.value(h),b=g.label_atom_id.value(h);if(!b)return;let x=g.auth_seq_id.valueKind(h)===G.ValueKind.Present?g.auth_seq_id.value(h):g.label_seq_id.value(h),C=g.ins_code.value(h),S=g.label_alt_id.value(h);for(let w of f){let A=a.atomicHierarchy.index.findResidue(w,y,x,C);if(A<0)continue;let T=a.atomicHierarchy.index.findAtomOnResidue(A,b,S);if(!(T<0))return{residueIndex:A,atomIndex:T,symmetry:g.symmetry.value(h)}}},p=[];for(let h=0;h<i._rowCount;h++){let g=m(h,u),y=m(h,d);if(g===void 0||y===void 0)continue;let b=s.value(h),x=c.value(h)||"",C=Tt.Flag.None,S=1;switch(x){case"sing":S=1;break;case"doub":S=2;break;case"trip":S=3;break;case"quad":S=4;break;default:S=O4(i.ptnr1_label_comp_id.value(h),i.ptnr1_label_atom_id.value(h),i.ptnr2_label_comp_id.value(h),i.ptnr2_label_atom_id.value(h))}switch(b){case"covale":C=Tt.Flag.Covalent;break;case"disulf":C=Tt.Flag.Covalent|Tt.Flag.Disulfide;break;case"hydrog":C=Tt.Flag.HydrogenBond;break;case"metalc":C=Tt.Flag.MetallicCoordination;break}p.push({rowIndex:h,flags:C,order:S,distance:l.value(h),partnerA:g,partnerB:y})}return p}e.getEntriesFromStructConn=o})(cd||(cd={}))});function KW(e,t,r,n,o,i,a){let s=new Ns.EdgeBuilder(i,e,t),l=new Uint16Array(s.slotCount),c=new Int8Array(s.slotCount),u=new Uint32Array(s.slotCount);for(let d=0,f=s.edgeCount;d<f;d++)s.addNextEdge(),s.assignProperty(l,n[d]),s.assignProperty(c,r[d]),s.assignProperty(u,o[d]);return s.createGraph({flags:l,order:c,key:u},a)}function uct(e,t,r){return e.conformation.position(t,wge),e.conformation.position(r,Tge),act(wge,Tge)}function fct(e){let t=ui.Provider.get(e.model),{elements:r}=e,{type_symbol:n}=e.model.atomicHierarchy.atoms,o=e.elements.length,{maxDistance:i}=t,{offset:a,b:s,edgeProps:{order:l,distance:c,flag:u,key:d,operatorA:f,operatorB:m}}=t.bonds,{atomSourceIndex:p}=e.model.atomicHierarchy,{invertedIndex:h}=Ht.getInvertedAtomSourceIndex(e.model),g=[],y=[],b=[],x=[],C=[],S=e.conformation.operator.key;for(let w=0;w<o;w++){let A=r[w],T=zf(n.value(A)),D=kp(T),E=p.value(A);for(let I=a[E],k=a[E+1];I<k;++I){let R=h[s[I]];if(A>=R)continue;let B=je.indexOf(e.elements,R);if(B<0)continue;let O=f[I],F=m[I];if(O>=0&&O!==S||F>=0&&F!==S)continue;let q=zf(n.value(R)),W=c[I],j=uct(e,A,R),L=!1;if(W>=0)L=Lo(j,W,.3);else if(i>=0)L=j<i;else{let V=bT(T,q,M0(T),M0(q));L=j<V,D&&kp(q)&&(L=!1)}L&&(g[g.length]=w,y[y.length]=B,x[x.length]=l[I],b[b.length]=u[I],C[C.length]=d[I])}}return KW(g,y,x,b,C,o,{canRemap:!1,cacheable:t.cacheable})}function mct(e,t){let r=Ht.isCoarseGrained(e.model),n=r?sct:t.maxRadius,{x:o,y:i,z:a}=e.model.atomicConformation,s=e.elements.length,{elements:l,residueIndex:c,chainIndex:u}=e,{type_symbol:d,label_atom_id:f,label_alt_id:m,label_comp_id:p}=e.model.atomicHierarchy.atoms,{label_seq_id:h}=e.model.atomicHierarchy.residues,{traceElementIndex:g}=e.model.atomicHierarchy.derived.residue,{index:y}=e.model.atomicHierarchy,{byEntityKey:b}=e.model.sequence,x=e.lookup3d,C=cd.Provider.get(e.model),S=nb.Provider.get(e.model),w=cd.isExhaustive(e.model),A=[],T=[],D=[],E=[],I=[],k=-1,R,B=!0,O=!0,F=!0,q=dct,W=!!C?.residueCantorPairs.size;for(let j=0;j<s;j++){let L=l[j],V=d.value(L);B&&V!=="H"&&V!=="O"&&(B=!1);let U=t.forceCompute?void 0:C&&C.byAtomIndex.get(L),z=!1;if(U)for(let re of U){let{partnerA:ee,partnerB:le}=re;if(ee.symmetry!==le.symmetry)continue;let pe=ee.atomIndex===L?le:ee,ke=je.indexOf(e.elements,pe.atomIndex);ke<0||l[ke]<L||(A[A.length]=j,T[T.length]=ke,D[D.length]=re.flags,E[E.length]=re.order,I[I.length]=re.rowIndex,z||q.clear(),z=!0,q.add(ke))}if(w)continue;let ie=c[L],oe=h.value(ie),X=p.value(L);if(!t.forceCompute&&ie!==k)if(S&&S.entries.has(X)){let re=b[y.getEntityFromChain(u[L])];re&&re.sequence.microHet.has(oe)?R=void 0:R=S.entries.get(X).map}else R=void 0;k=ie;let Y=zf(V),ne=f.value(L),K=R?R.get(ne):void 0,{indices:$,count:Z,squaredDistances:de}=x.find(o[L],i[L],a[L],n),Q=kp(Y),ae=M0(Y),ye=m.value(L),we=$1.has(Y);for(let re=0;re<Z;re++){let ee=$[re];if(z&&q.has(ee))continue;let le=l[ee];if(le<=L)continue;let pe=m.value(le);if(ye&&pe&&ye!==pe)continue;if(W){let Re=Wd(c[L],c[le]);if(C.residueCantorPairs.has(Re))continue}let ke=zf(d.value(le)),Ve=kp(ke);if(Q&&Ve)continue;let Xe=(we||$1.has(ke))&&!(Q||Ve),pt=c[le];if(ie===pt&&K){let Re=K.get(f.value(le));if(Re){A[A.length]=j,T[T.length]=ee,E[E.length]=Re.order;let ze=Re.flags;Xe&&(ze|Tt.Flag.Covalent&&(ze^=Tt.Flag.Covalent),ze|=Tt.Flag.MetallicCoordination),D[D.length]=ze,I[I.length]=Re.key}continue}let _e=Math.sqrt(de[re]);if(_e===0)continue;let Ie=!1;if(r)ie===pt?Ie=_e<=lct:Ie=_e<=cct&&g[ie]===L&&g[pt]===le;else{let Re=bT(Y,ke,ae,M0(ke));Ie=_e<=Re}if(Ie){A[A.length]=j,T[T.length]=ee,E[E.length]=tge(X,ne,f.value(le)),D[D.length]=(Xe?Tt.Flag.MetallicCoordination:Tt.Flag.Covalent)|Tt.Flag.Computed,I[I.length]=-1;let Re=h.value(pt);oe===Re&&(O=!1),Math.abs(oe-Re)>1&&(F=!1)}}}return KW(A,T,E,D,I,s,{canRemap:B||O&&F})}function pct(e){if(e.conformation.operator.key===-1)return!1;let t=ui.Provider.get(e.model);return!!t?.hasOperators}function hct(e){let t=ui.Provider.get(e.model),r=t.bySameOperator.get(e.conformation.operator.key);if(!r)return vT.Empty;let{a:n,b:o,edgeProps:{key:i,flag:a,order:s}}=t.bonds,{invertedIndex:l}=Ht.getInvertedAtomSourceIndex(e.model),{elements:c}=e,u=[],d=[],f=[],m=[],p=[];for(let h=0,g=r.length;h<g;++h){let y=r[h];if(n[y]>=o[y])continue;let b=l[n[y]],x=je.indexOf(c,b);if(x<0)continue;let C=l[o[y]],S=je.indexOf(c,C);S<0||(u[u.length]=x,d[d.length]=S,f[f.length]=a[y],m[m.length]=s[y],p[p.length]=i[y])}return KW(u,d,m,f,p,c.length,{canRemap:!1,cacheable:t.cacheable})}function Age(e,t){let r={...R4,...t};return r.noCompute?vT.Empty:e.elements.length<=1?vT.Empty:!r.forceCompute&&ui.Provider.get(e.model)?pct(e)?hct(e):fct(e):mct(e,r)}var act,sct,lct,cct,wge,Tge,dct,Pge=M(()=>{Br();B4();P0();mD();Ut();L4();ag();WW();SD();Ge();Gd();_D();tn();act=v.distance,sct=6,lct=5.5,cct=3.9;wge=v(),Tge=v();dct=new Set});function Dge(e,t,r,n){return e.conformation.position(t,Ige),r.conformation.position(n,Ege),gct(Ige,Ege)}function Sct(e,t,r,n){let{maxRadius:o}=r,{elements:i,residueIndex:a}=e,{x:s,y:l,z:c}=e.model.atomicConformation,{elements:u,residueIndex:d}=t,f=e.elements.length,{type_symbol:m,label_alt_id:p,label_atom_id:h,label_comp_id:g}=e.model.atomicHierarchy.atoms,{type_symbol:y,label_alt_id:b,label_atom_id:x,label_comp_id:C}=t.model.atomicHierarchy.atoms,{auth_seq_id:S}=e.model.atomicHierarchy.residues,{auth_seq_id:w}=t.model.atomicHierarchy.residues,{occupancy:A}=e.model.atomicConformation,{occupancy:T}=t.model.atomicConformation,D=A.isDefined&&T.isDefined,E=e.model===t.model&&cd.Provider.get(e.model),I=!r.forceCompute&&e.model===t.model&&ui.Provider.get(e.model),{atomSourceIndex:k}=e.model.atomicHierarchy,{invertedIndex:R}=I?Ht.getInvertedAtomSourceIndex(t.model):{invertedIndex:void 0},B=e.model===t.model&&cd.isExhaustive(e.model),O=H.mul(xct,t.conformation.operator.inverse,e.conformation.operator.matrix),F=!H.isIdentity(O),{center:q,radius:W}=t.boundary.sphere,j=(W+o)*(W+o);n.startUnitPair(e.id,t.id);let L=e.conformation.operator.key,V=t.conformation.operator.key;for(let U=0;U<f;U++){let z=i[U];if(yct(C2,s[z],l[z],c[z]),F&&bct(C2,C2,O),vct(C2,q)>j)continue;if(!r.forceCompute&&I){let{maxDistance:re}=I,{offset:ee,b:le,edgeProps:{order:pe,distance:ke,flag:Ve,key:Xe,operatorA:pt,operatorB:_e}}=I.bonds,Ie=k.value(z),Re=zf(m.value(z));for(let ze=ee[Ie],N=ee[Ie+1];ze<N;++ze){let J=R[le[ze]],Ae=je.indexOf(t.elements,J);if(Ae<0)continue;let qe=pt[ze],Be=_e[ze];if(qe>=0&&Be>=0&&(qe===Be||qe!==L||Be!==V))continue;let Qe=zf(m.value(J)),at=ke[ze],ft=Dge(e,z,t,J),mt=!1;if(at>=0)mt=Lo(ft,at,.3);else if(re>=0)mt=ft<re;else{let dt=bT(Re,Qe,M0(Re),M0(Qe));mt=ft<dt,kp(Re)&&kp(Qe)&&(mt=!1)}mt&&n.add(U,Ae,{order:pe[ze],flag:Ve[ze],key:Xe[ze]})}continue}let ie=r.forceCompute?void 0:E&&E.byAtomIndex.get(z);if(ie&&ie.length){let re=!1;for(let ee of ie){let{partnerA:le,partnerB:pe}=ee,ke=le.atomIndex===z?pe:le,Ve=je.indexOf(t.elements,ke.atomIndex);Ve<0||Dge(e,z,t,ke.atomIndex)>o||(n.add(U,Ve,{order:ee.order,flag:ee.flags,key:ee.rowIndex}),re=!0)}if(re)continue}if(B)continue;let oe=A.value(z),{lookup3d:X}=t,{indices:Y,count:ne,squaredDistances:K}=X.find(C2[0],C2[1],C2[2],o);if(ne===0)continue;let $=zf(m.value(z)),Z=kp($),de=M0($),Q=p.value(z),ae=$1.has($),ye=h.value(z),we=g.value(a[z]);for(let re=0;re<ne;re++){let ee=Y[re],le=u[ee],pe=b.value(le);if(Q&&pe&&Q!==pe||D&&T.value(le)<1&&oe<1&&S.value(a[z])===w.value(d[le]))continue;if(E&&e.model===t.model){let Ie=Wd(a[z],d[le]);if(E.residueCantorPairs.has(Ie))continue}let ke=zf(y.value(le)),Ve=kp(ke);if(Z&&Ve)continue;let Xe=(ae||$1.has(ke))&&!(Z||Ve),pt=Math.sqrt(K[re]);if(pt===0)continue;let _e=bT($,ke,de,M0(ke));if(pt<=_e){let Ie=x.value(le),Re=C.value(d[le]);n.add(U,ee,{order:O4(we,Re,ye,Ie),flag:(Xe?Tt.Flag.MetallicCoordination:Tt.Flag.Covalent)|Tt.Flag.Computed,key:-1})}}}n.finishUnitPair()}function _ct(e){for(let t of e.models){let r=ui.Provider.get(t);if(!r?.hasOperators)return!1}for(let t of e.units)if(t.conformation.operator.key===-1)return!1;return!0}function Cct(e,t){let r=new Map;for(let n of e.units){let{key:o}=n.conformation.operator;r.has(o)?r.get(o).add(n):r.set(o,new Set([n]))}for(let n of e.models){let o=ui.Provider.get(n),{a:i,b:a}=o.bonds,{order:s,flag:l,key:c,operatorA:u,operatorB:d}=o.bonds.edgeProps,{invertedIndex:f}=Ht.getInvertedAtomSourceIndex(n),m=new Map;for(let g of e.units)if(g.model===n)for(let y=0,b=g.elements.length;y<b;++y){let x=g.elements[y];m.has(x)?m.get(x).add(g):m.set(x,new Set([g]))}let p=new Map;for(let g=0,y=u.length;g<y;++g){let b,x;if(u[g]===d[g]?(b=m.get(f[i[g]]),x=m.get(f[a[g]])):(b=r.get(u[g]),x=r.get(d[g])),!(!b||!x)){for(let C of b)if(u[g]===C.conformation.operator.key)for(let S of x){if(d[g]!==S.conformation.operator.key||C===S||!fe.isAtomic(C)||!fe.isAtomic(S)||C.id>S.id)continue;let w=Xa(C.id,S.id);p.has(w)?p.get(w).add(g):p.set(w,new Set([g]))}}}let h=[-1,-1];p.forEach((g,y)=>{let[b,x]=iT(h,y),C=e.unitMap.get(b),S=e.unitMap.get(x);t.startUnitPair(b,x),g.forEach(w=>{let A=f[i[w]],T=je.indexOf(C.elements,A);if(T<0)return;let D=f[a[w]],E=je.indexOf(S.elements,D);E<0||t.add(T,E,{order:s[w],flag:l[w],key:c[w]})}),t.finishUnitPair()})}}function Tct(e,t){let r=new Rm.Builder,n=e.models.some(i=>ui.Provider.get(i)),o=e.models.some(i=>cd.isExhaustive(i));return t.noCompute||e.isCoarseGrained&&!n&&!o?new k0(r.getMap()):!t.forceCompute&&_ct(e)?(Cct(e,r),new k0(r.getMap())):(Oe.eachUnitPair(e,(i,a)=>{Sct(i,a,t,r)},{maxRadius:t.maxRadius,validUnit:i=>t.validUnit(i),validUnitPair:(i,a)=>t.validUnitPair(e,i,a)}),new k0(r.getMap()))}function kge(e,t){let r={...wct,...t};return Tct(e,{...r,validUnit:t&&t.validUnit||(n=>fe.isAtomic(n)),validUnitPair:t&&t.validUnitPair||((n,o,i)=>{if(!Oe.validUnitPair(n,o,i))return!1;let s=o.model.atomicHierarchy.derived.residue.moleculeType,l=i.model.atomicHierarchy.derived.residue.moleculeType,c=(!fe.isAtomic(o)||s[o.residueIndex[o.elements[0]]]!==_r.Water)&&(!fe.isAtomic(i)||l[i.residueIndex[i.elements[0]]]!==_r.Water),u=!fe.isAtomic(o)||s[o.residueIndex[o.elements[0]]]!==_r.Ion,d=!fe.isAtomic(i)||l[i.residueIndex[i.elements[0]]]!==_r.Ion,f=u&&d;return(c||!r.ignoreWater)&&(f||!r.ignoreIon)?!0:Act(o,i)})})}function Act(e,t){if(e.model!==t.model||!fe.isAtomic(e)||!fe.isAtomic(t))return!1;let r=cd.Provider.get(e.model);if(!r)return!1;let n=e.elements.length<t.elements.length?e:t,o=e.elements.length>=t.elements.length?e:t,{elements:i}=n,{elements:a}=o,{indexOf:s}=je;for(let l=0,c=i.length;l<c;l++){let u=i[l],d=r.byAtomIndex.get(u);if(d?.length)for(let f of d){let m=f.partnerA.atomIndex===u?f.partnerB.atomIndex:f.partnerA.atomIndex;if(s(a,m)>=0)return!0}}return!1}var gct,yct,vct,bct,Ige,Ege,xct,C2,wct,Mge=M(()=>{Br();ug();sd();mD();B4();Ut();Ge();L4();ag();fD();SD();Gd();nx();tn();gct=v.distance,yct=v.set,vct=v.squaredDistance,bct=v.transformMat4,Ige=v(),Ege=v();xct=H(),C2=v();wct={...R4,ignoreWater:!0,ignoreIon:!0}});var kt,CD=M(()=>{zs();Br();Ut();v2();B4();Pge();Mge();(function(e){function t(g,y,b,x,C,S){return{kind:"bond-location",aStructure:g,aUnit:y,aIndex:b,bStructure:x,bUnit:C,bIndex:S}}e.Location=t;function r(g){return!!g&&g.kind==="bond-location"}e.isLocation=r;function n(g,y){return g.aStructure.label===y.aStructure.label&&g.bStructure.label===y.bStructure.label&&g.aIndex===y.aIndex&&g.bIndex===y.bIndex&&g.aUnit.id===y.aUnit.id&&g.bUnit.id===y.bUnit.id}e.areLocationsEqual=n;function o(g,y){return{kind:"bond-loci",structure:g,bonds:y}}e.Loci=o;function i(g){return!!g&&g.kind==="bond-loci"}e.isLoci=i;function a(g,y){if(g.structure!==y.structure||g.bonds.length!==y.bonds.length)return!1;for(let b=0,x=g.bonds.length;b<x;++b)if(!n(g.bonds[b],y.bonds[b]))return!1;return!0}e.areLociEqual=a;function s(g){return g.bonds.length===0}e.isLociEmpty=s;function l(g,y){if(y===g.structure)return g;let b=[];return g.bonds.forEach(x=>{let C=y.unitMap.get(x.aUnit.id);if(!C)return;let S=y.unitMap.get(x.bUnit.id);if(!S)return;let w=x.aUnit.elements[x.aIndex],A=je.indexOf(C.elements,w);if(A===-1)return;let T=x.bUnit.elements[x.bIndex],D=je.indexOf(S.elements,T);D!==-1&&b.push(t(g.structure,C,A,g.structure,S,D))}),o(y,b)}e.remapLoci=l;function c(g){let y=[],b=new Map;for(let x of g.bonds){let{aIndex:C,aUnit:S,bIndex:w,bUnit:A}=x;S===A?b.has(S.id)?b.get(S.id).push(C,w):b.set(S.id,[C,w]):(b.has(S.id)?b.get(S.id).push(C):b.set(S.id,[C]),b.has(A.id)?b.get(A.id).push(w):b.set(A.id,[w]))}return b.forEach((x,C)=>{y.push({unit:g.structure.unitMap.get(C),indices:je.deduplicate(je.ofUnsortedArray(x))})}),te.Loci(g.structure,y)}e.toStructureElementLoci=c;function u(g){let{aUnit:y,aIndex:b}=g.bonds[0];return te.Loci(g.structure,[{unit:y,indices:Se.ofSingleton(b)}])}e.toFirstStructureElementLoci=u;function d(g,y){if(y.aUnit===y.bUnit){let b=y.aUnit.bonds,x=b.getEdgeIndex(y.aIndex,y.bIndex);return x<0?Tt.create(Tt.Flag.None):Tt.create(b.edgeProps.flags[x])}else{let b=g.interUnitBonds.getBondFromLocation(y);return b?Tt.create(b.props.flag):Tt.create(Tt.Flag.None)}}e.getType=d;function f(g,y){if(y.aUnit===y.bUnit){let b=y.aUnit.bonds,x=b.getEdgeIndex(y.aIndex,y.bIndex);return x<0?0:b.edgeProps.order[x]}else{let b=g.interUnitBonds.getBondFromLocation(y);return b?b.props.order:0}}e.getOrder=f;function m(g){let y=0;for(let b of g.unitSymmetryGroups){let x=b.units[0];fe.isAtomic(x)&&(y+=x.bonds.edgeCount*b.units.length)}return y}e.getIntraUnitBondCount=m;class p{move(){return this.advance(),this.current}setElement(y,b,x){this.structure=y,this.unit=b,this.index=x,this.interBondIndices=y.interUnitBonds.getEdgeIndices(x,b.id),this.interBondCount=this.interBondIndices.length,this.interBondIndex=0,this.intraBondEnd=b.bonds.offset[x+1],this.intraBondIndex=b.bonds.offset[x],this.hasNext=this.interBondIndex<this.interBondCount||this.intraBondIndex<this.intraBondEnd}advance(){if(this.intraBondIndex<this.intraBondEnd)this.current.otherUnit=this.unit,this.current.otherIndex=this.unit.bonds.b[this.intraBondIndex],this.current.type=this.unit.bonds.edgeProps.flags[this.intraBondIndex],this.current.order=this.unit.bonds.edgeProps.order[this.intraBondIndex],this.intraBondIndex+=1;else if(this.interBondIndex<this.interBondCount){let y=this.structure.interUnitBonds.edges[this.interBondIndices[this.interBondIndex]];this.current.otherUnit=this.structure.unitMap.get(y.unitA!==this.unit.id?y.unitA:y.unitB),this.current.otherIndex=y.indexA!==this.index?y.indexA:y.indexB,this.current.type=y.props.flag,this.current.order=y.props.order,this.interBondIndex+=1}else{this.hasNext=!1;return}this.hasNext=this.interBondIndex<this.interBondCount||this.intraBondIndex<this.intraBondEnd}constructor(){this.current={},this.hasNext=!1}}e.ElementBondIterator=p;function h(g,y){return Ru.fromPairProvider(g.bonds.length,(b,x,C)=>{let{aUnit:S,aIndex:w,bUnit:A,bIndex:T}=g.bonds[b];S.conformation.position(S.elements[w],x),A.conformation.position(A.elements[T],C)},y)}e.getBoundingSphere=h})(kt||(kt={}))});function Uge(e){let t=Ict(e),r=Pct(e,t),n=nr.transientSegments(e.model.atomicHierarchy.residueAtomSegments,e.elements);for(;n.hasNext;){let o=n.move();Ect(r,o.start,o.end)}return r.rings}function Pct(e,t){return{startVertex:0,endVertex:0,count:0,isRingAtom:new Int32Array(t),marked:new Int32Array(t),queue:new Int32Array(t),pred:new Int32Array(t),depth:new Int32Array(t),left:new Int32Array(ox.MaxDepth),right:new Int32Array(ox.MaxDepth),color:new Int32Array(t),currentColor:0,currentAltLoc:"",hasAltLoc:!1,rings:[],currentRings:[],unit:e,bonds:e.bonds,altLoc:e.model.atomicHierarchy.atoms.label_alt_id}}function Bge(e){e.count=e.endVertex-e.startVertex;let{isRingAtom:t,pred:r,color:n,depth:o,marked:i}=e;for(let a=0;a<e.count;a++)t[a]=0,r[a]=-1,i[a]=-1,n[a]=0,o[a]=0;e.currentColor=0,e.currentAltLoc="",e.hasAltLoc=!1}function Rge(e){let{depth:t}=e;for(let r=0;r<e.count;r++)t[r]=e.count+1}function Ict(e){let t=nr.transientSegments(e.model.atomicHierarchy.residueAtomSegments,e.elements),r=0;for(;t.hasNext;){let n=t.move();r=Math.max(r,n.end-n.start)}return r}function Oge(e,t){let r=e.bonds.offset,n=e.startVertex+t,o=r[n],a=r[n+1]-o;return!(a<=1||e.isRingAtom[t]&&a===2)}function Ect(e,t,r){if(e.startVertex=t,e.endVertex=r,e.endVertex-e.startVertex<3)return;e.currentRings=[];let{elements:n}=e.unit,o=[];for(let a=e.startVertex;a<e.endVertex;a++){let s=e.altLoc.value(n[a]);Li(o,s)}Ip(o,"");let i=1;if(o.length===0){Bge(e);for(let a=0;a<e.count;a++)Oge(e,a)&&(Rge(e),i=Lge(e,a,i))}else for(let a=0;a<o.length;a++){Bge(e),e.hasAltLoc=!0,e.currentAltLoc=o[a];for(let s=0;s<e.count;s++){if(!Oge(e,s))continue;let l=e.altLoc.value(n[e.startVertex+s]);l&&l!==e.currentAltLoc||(Rge(e),i=Lge(e,s,i))}}for(let a=0,s=e.currentRings.length;a<s;a++)e.rings.push(e.currentRings[a])}function Dct(e,t,r,n){if(r<t)return!1;let{pred:o,color:i,left:a,right:s}=e,l=++e.currentColor,c=t;for(let y=0;y<ox.MaxDepth&&(i[c]=l,c=o[c],!(c<0));y++);let u=0,d=0,f=!1,m=0;c=r;for(let y=0;y<ox.MaxDepth;y++){if(i[c]===l){m=c,f=!0;break}if(s[d++]=c,c=o[c],c<0)break}if(!f)return!1;c=t;for(let y=0;y<ox.MaxDepth&&(a[u++]=c,!(m===c||(c=o[c],c<0)));y++);let p=u+d;if(p<3)return!1;let h=new Int32Array(p),g=0;for(let y=0;y<u;y++)h[g++]=e.startVertex+a[y],n[a[y]]=1;for(let y=d-1;y>=0;y--)h[g++]=e.startVertex+s[y],n[s[y]]=1;Yl(h);for(let y=0,b=e.currentRings.length;y<b;y++){let x=e.currentRings[y];if(h.length===x.length){if(je.areEqual(h,x))return!1}else if(h.length>x.length&&je.isSubset(h,x))return!1}return e.currentRings.push(je.ofSortedArray(h)),!0}function Lge(e,t,r){let{bonds:n,startVertex:o,endVertex:i,isRingAtom:a,marked:s,queue:l,pred:c,depth:u}=e,{elements:d}=e.unit,{b:f,edgeProps:{flags:m},offset:p}=n;s[t]=r,u[t]=0,l[0]=t;let h=0,g=1;for(;h<g;){let y=l[h++],b=u[y],x=o+y,C=p[x],S=p[x+1];for(let w=C;w<S;w++){let A=f[w];if(A<o||A>=i||!Tt.isCovalent(m[w]))continue;if(e.hasAltLoc){let E=e.altLoc.value(d[A]);if(E&&e.currentAltLoc!==E)continue}let T=A-o;if(s[T]===r){if(c[T]!==y&&c[y]!==T&&Dct(e,y,T,a))return r+1;continue}let D=Math.min(u[T],b+1);D>ox.MaxDepth||(u[T]=D,s[T]=r,l[g++]=T,c[T]=y)}}return r+1}function Vge(e){let t=e.length,r=new Array(t);for(let a=0;a<t;a++)r[a]=e[t-a-1];let n=Fge(e),o=Fge(r),i=!1;for(let a=0;a<t;a++){let s=e[(a+n)%t],l=r[(a+o)%t];if(s!==l){i=s<l;break}}return i?Nge(e,n):Nge(r,o)}function Fge(e){let t=e.length,r=new Int32Array(t*2);for(let a=0;a<r.length;a++)r[a]=-1;let n="",o="",i=0;for(let a=1;a<r.length;a++){let s=r[a-i-1];for(;s!==-1&&(n=e[a%t],o=e[(i+s+1)%t],n!==o);)n<o&&(i=a-s-1),s=r[s];s===-1?(n=e[a%t],o=e[(i+s+1)%t],n!==o?(n<o&&(i=a),r[a-i]=-1):r[a-i]=s+1):r[a-i]=s+1}return i}function Nge(e,t){let r=e.length,n=[],o;for(o=0;o<r-1;o++)n.push(e[(o+t)%r]),n.push("-");return n.push(e[(o+t)%r]),n.join("")}function zge(e,t){let r=new Map,n=new Map;for(let l=0,c=e.length;l<c;l++){let u=e[l];for(let d=0,f=u.length;d<f;d++){let m=u[d];r.has(m)?r.get(m).push(l):r.set(m,[l])}}for(let l=0,c=t.length;l<c;l++){let u=t[l],d=e[u];for(let f=0,m=d.length;f<m;f++){let p=d[f];n.has(p)?n.get(p).push(u):n.set(p,[u])}}let o=new Ns.UniqueEdgeBuilder(e.length);for(let l=0,c=e.length;l<c;l++){let u=e[l];for(let d=0,f=u.length;d<f;d++){let m=u[d],p=r.get(m);if(p.length!==1)for(let h=0,g=p.length;h<g;h++){let y=p[h];l>=y||o.addEdge(l,y)}}}let i=Ns.connectedComponents(o.getGraph()),a=i.componentIndex,s=[];for(let l=0;l<i.componentCount;l++)s[l]=[];for(let l=0,c=e.length;l<c;l++)s[a[l]].push(l);return{elementRingIndices:r,elementAromaticRingIndices:n,ringComponentIndex:a,ringComponents:s}}var ox,qge=M(()=>{Ut();P0();Br();tn();Jn();(function(e){e[e.MaxDepth=5]="MaxDepth"})(ox||(ox={}))});function R0(e){let t=wD[e];return t===void 0?Bct:kct[t]}function jge(e){let t=wD[e];return t===void 0?Rct:Mct[t]}function ix(e){let t=wD[e];return t===void 0?Oct:t}var wD,kct,Mct,Bct,Rct,Oct,YW=M(()=>{wD={H:1,D:1,T:1,HE:2,LI:3,BE:4,B:5,C:6,N:7,O:8,F:9,NE:10,NA:11,MG:12,AL:13,SI:14,P:15,S:16,CL:17,AR:18,K:19,CA:20,SC:21,TI:22,V:23,CR:24,MN:25,FE:26,CO:27,NI:28,CU:29,ZN:30,GA:31,GE:32,AS:33,SE:34,BR:35,KR:36,RB:37,SR:38,Y:39,ZR:40,NB:41,MO:42,TC:43,RU:44,RH:45,PD:46,AG:47,CD:48,IN:49,SN:50,SB:51,TE:52,I:53,XE:54,CS:55,BA:56,LA:57,CE:58,PR:59,ND:60,PM:61,SM:62,EU:63,GD:64,TB:65,DY:66,HO:67,ER:68,TM:69,YB:70,LU:71,HF:72,TA:73,W:74,RE:75,OS:76,IR:77,PT:78,AU:79,HG:80,TL:81,PB:82,BI:83,PO:84,AT:85,RN:86,FR:87,RA:88,AC:89,TH:90,PA:91,U:92,NP:93,PU:94,AM:95,CM:96,BK:97,CF:98,ES:99,FM:100,MD:101,NO:102,LR:103,RF:104,DB:105,SG:106,BH:107,HS:108,MT:109},kct={1:1.1,2:1.4,3:1.81,4:1.53,5:1.92,6:1.7,7:1.55,8:1.52,9:1.47,10:1.54,11:2.27,12:1.73,13:1.84,14:2.1,15:1.8,16:1.8,17:1.75,18:1.88,19:2.75,20:2.31,21:2.3,22:2.15,23:2.05,24:2.05,25:2.05,26:2.05,27:2,28:2,29:2,30:2.1,31:1.87,32:2.11,33:1.85,34:1.9,35:1.83,36:2.02,37:3.03,38:2.49,39:2.4,40:2.3,41:2.15,42:2.1,43:2.05,44:2.05,45:2,46:2.05,47:2.1,48:2.2,49:2.2,50:1.93,51:2.17,52:2.06,53:1.98,54:2.16,55:3.43,56:2.68,57:2.5,58:2.48,59:2.47,60:2.45,61:2.43,62:2.42,63:2.4,64:2.38,65:2.37,66:2.35,67:2.33,68:2.32,69:2.3,70:2.28,71:2.27,72:2.25,73:2.2,74:2.1,75:2.05,76:2,77:2,78:2.05,79:2.1,80:2.05,81:1.96,82:2.02,83:2.07,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:2.4,91:2,92:2.3,93:2,94:2,95:2,96:2,97:2,98:2,99:2,100:2,101:2,102:2,103:2,104:2,105:2,106:2,107:2,108:2,109:2},Mct={1:1.008,2:4.0026,3:6.94,4:9.0122,5:10.81,6:10.81,7:14.007,8:15.999,9:18.998,10:20.18,11:22.99,12:24.305,13:26.982,14:28.085,15:30.974,16:32.06,17:35.45,18:39.948,19:39.098,20:40.078,21:44.956,22:47.867,23:50.942,24:51.996,25:54.938,26:55.845,27:58.933,28:58.693,29:63.546,30:65.38,31:69.723,32:72.63,33:74.922,34:78.971,35:79.904,36:83.798,37:85.468,38:87.62,39:88.906,40:91.224,41:92.906,42:95.95,43:96.906,44:101.07,45:102.91,46:106.42,47:107.87,48:112.41,49:114.82,50:118.71,51:121.76,52:127.6,53:127.6,54:131.29,55:132.91,56:137.33,57:138.91,58:140.12,59:140.91,60:144.24,61:144.912,62:150.36,63:151.96,64:157.25,65:158.93,66:162.5,67:164.93,68:167.26,69:168.93,70:173.05,71:174.97,72:178.49,73:180.95,74:183.84,75:186.21,76:190.23,77:192.22,78:195.08,79:196.97,80:200.59,81:204.38,82:207.2,83:208.98,84:1.97,85:2.02,86:2.2,87:3.48,88:2.83,89:2,90:232.04,91:231.04,92:238.03,93:237.048,94:244.064,95:243.061,96:247.07,97:247.07,98:251.079,99:252.083,100:257.095,101:258.098,102:259.101,103:262.11,104:267.122,105:270.131,106:271.134,107:270.133,108:270.134,109:278.156},Bct=1.7,Rct=10.81,Oct=0});function Fct(e){return Lct.has(e)}function Uct(e){return Nct.has(e)}function zct(e){return Vct.has(e)}function XW(e){return qct.has(e)}function ZW(e){let t=ix(e);return t>=21&&t<=29||t>=39&&t<=47||t>=72&&t<=79||t>=104&&t<=108}function jct(e){let t=ix(e);return t>=57&&t<=71}function Gct(e){let t=ix(e);return t>=89&&t<=103}function Hge(e){return Fct(e)||Uct(e)||jct(e)||Gct(e)||ZW(e)||zct(e)}var bt,Gge,Lct,Nct,Vct,qct,Mp=M(()=>{YW();(function(e){e.H="H",e.D="D",e.T="T",e.HE="HE",e.LI="LI",e.BE="BE",e.B="B",e.C="C",e.N="N",e.O="O",e.F="F",e.NE="NE",e.NA="NA",e.MG="MG",e.AL="AL",e.SI="SI",e.P="P",e.S="S",e.CL="CL",e.AR="AR",e.K="K",e.CA="CA",e.SC="SC",e.TI="TI",e.V="V",e.CR="CR",e.MN="MN",e.FE="FE",e.CO="CO",e.NI="NI",e.CU="CU",e.ZN="ZN",e.GA="GA",e.GE="GE",e.AS="AS",e.SE="SE",e.BR="BR",e.KR="KR",e.RB="RB",e.SR="SR",e.Y="Y",e.ZR="ZR",e.NB="NB",e.MO="MO",e.TC="TC",e.RU="RU",e.RH="RH",e.PD="PD",e.AG="AG",e.CD="CD",e.IN="IN",e.SN="SN",e.SB="SB",e.TE="TE",e.I="I",e.XE="XE",e.CS="CS",e.BA="BA",e.LA="LA",e.CE="CE",e.PR="PR",e.ND="ND",e.PM="PM",e.SM="SM",e.EU="EU",e.GD="GD",e.TB="TB",e.DY="DY",e.HO="HO",e.ER="ER",e.TM="TM",e.YB="YB",e.LU="LU",e.HF="HF",e.TA="TA",e.W="W",e.RE="RE",e.OS="OS",e.IR="IR",e.PT="PT",e.AU="AU",e.HG="HG",e.TL="TL",e.PB="PB",e.BI="BI",e.PO="PO",e.AT="AT",e.RN="RN",e.FR="FR",e.RA="RA",e.AC="AC",e.TH="TH",e.PA="PA",e.U="U",e.NP="NP",e.PU="PU",e.AM="AM",e.CM="CM",e.BK="BK",e.CF="CF",e.ES="ES",e.FM="FM",e.MD="MD",e.NO="NO",e.LR="LR",e.RF="RF",e.DB="DB",e.SG="SG",e.BH="BH",e.HS="HS",e.MT="MT",e.DS="DS",e.RG="RG",e.CN="CN",e.NH="NH",e.FL="FL",e.MC="MC",e.LV="LV",e.TS="TS",e.OG="OG"})(bt||(bt={}));Gge={H:"Hydrogen",HE:"Helium",LI:"Lithium",BE:"Beryllium",B:"Boron",C:"Carbon",N:"Nitrogen",O:"Oxygen",F:"Fluorine",NE:"Neon",NA:"Sodium",MG:"Magnesium",AL:"Aluminum",SI:"Silicon",P:"Phosphorus",S:"Sulfur",CL:"Chlorine",AR:"Argon",K:"Potassium",CA:"Calcium",SC:"Scandium",TI:"Titanium",V:"Vanadium",CR:"Chromium",MN:"Manganese",FE:"Iron",CO:"Cobalt",NI:"Nickel",CU:"Copper",ZN:"Zinc",GA:"Gallium",GE:"Germanium",AS:"Arsenic",SE:"Selenium",BR:"Bromine",KR:"Krypton",RB:"Rubidium",SR:"Strontium",Y:"Yttrium",ZR:"Zirconium",NB:"Niobium",MO:"Molybdenum",TC:"Technetium",RU:"Ruthenium",RH:"Rhodium",PD:"Palladium",AG:"Silver",CD:"Cadmium",IN:"Indium",SN:"Tin",SB:"Antimony",TE:"Tellurium",I:"Iodine",XE:"Xenon",CS:"Cesium",BA:"Barium",LA:"Lanthanum",CE:"Cerium",PR:"Praseodymium",ND:"Neodymium",PM:"Promethium",SM:"Samarium",EU:"Europium",GD:"Gadolinium",TB:"Terbium",DY:"Dysprosium",HO:"Holmium",ER:"Erbium",TM:"Thulium",YB:"Ytterbium",LU:"Lutetium",HF:"Hafnium",TA:"Tantalum",W:"Wolfram",RE:"Rhenium",OS:"Osmium",IR:"Iridium",PT:"Platinum",AU:"Gold",HG:"Mercury",TL:"Thallium",PB:"Lead",BI:"Bismuth",PO:"Polonium",AT:"Astatine",RN:"Radon",FR:"Francium",RA:"Radium",AC:"Actinium",TH:"Thorium",PA:"Protactinium",U:"Uranium",NP:"Neptunium",PU:"Plutonium",AM:"Americium",CM:"Curium",BK:"Berkelium",CF:"Californium",ES:"Einsteinium",FM:"Fermium",MD:"Mendelevium",NO:"Nobelium",LR:"Lawrencium",RF:"Rutherfordium",DB:"Dubnium",SG:"Seaborgium",BH:"Bohrium",HS:"Hassium",MT:"Meitnerium",DS:"Darmstadtium",RG:"Roentgenium",CN:"Copernicium",NH:"Nihonium",FL:"Flerovium",MC:"Moscovium",LV:"Livermorium",TS:"Tennessine",OG:"Oganesson"},Lct=new Set(["LI","NA","K","RB","CS","FR"]);Nct=new Set(["BE","MG","CA","SR","BA","RA"]);Vct=new Set(["ZN","GA","CD","IN","SN","HG","TI","PB","BI","PO","CN"]);qct=new Set(["F","CL","BR","I","AT"])});function Hct(e,t){let r=e.coarseElements.entityKey[t],n=e.model.sequence.byEntityKey[r].sequence,o=e.coarseElements.seq_id_begin.value(t);return n.compId.value(o-1)}function wT(e,t){switch(e.kind){case fe.Kind.Atomic:return e.model.atomicHierarchy.derived.residue.moleculeType[e.residueIndex[t]];case fe.Kind.Spheres:case fe.Kind.Gaussians:let r=Hct(e,t),n=e.model.properties.chemicalComponentMap.get(r);if(n)return qc(n.type,r)}return _r.Unknown}function O0(e,t){let r=xhe[e];if(r!==void 0){let n=r[t];if(n!==void 0)return n}return Wct}function J4(e,t){let r=e.conformation,n=new Float32Array(t.length*3),{elements:o}=e;for(let i=0,a=t.length;i<a;++i)r.position(o[t[i]],Wge),v.toArray(Wge,n,i*3);return n}var Wct,Wge,ax=M(()=>{Br();Ge();zs();Wct=new Set;Wge=v.zero()});function Kct(e,t){let r=new Map,n=0;for(let o=0,i=t.length;o<i;o++){let a=t[o],s=qf.fingerprint(e,a);r.has(s)?r.get(s).push(n):r.set(s,[n]),n++}return r}function Yct(e,t){let{elements:r}=e,n=e.model.atomicHierarchy.residueAtomSegments.index,o=n[r[t[0]]];for(let i=1,a=t.length;i<a;i++)if(o!==n[r[t[i]]])return-1;return o}function Xct(e,t,r){let n=e.byFingerprint.get(t);if(n)for(let o=0,i=n.length;o<i;o++){let a=n[o],s=Yct(e.unit,e.all[a]);s>=0&&(r.has(s)?r.get(s).push(a):r.set(s,[a]))}}function Zct(e,t){let r=[];for(let n=0,o=t.length;n<o;++n)qf.isAromatic(e,t[n])&&r.push(n);return r}var sx,qf,eL=M(()=>{qge();sd();Ut();Br();Mp();ax();Y1();Ge();sx=class{get index(){return this._index?this._index:(this._index=zge(this.all,this.aromaticRings),this._index)}get byFingerprint(){return this._byFingerprint?this._byFingerprint:(this._byFingerprint=Kct(this.unit,this.all),this._byFingerprint)}get elementRingIndices(){return this.index.elementRingIndices}get elementAromaticRingIndices(){return this.index.elementAromaticRingIndices}get ringComponentIndex(){return this.index.ringComponentIndex}get ringComponents(){return this.index.ringComponents}get aromaticRings(){return this._aromaticRings?this._aromaticRings:(this._aromaticRings=Zct(this.unit,this.all),this._aromaticRings)}constructor(t,r){this.unit=r,this.all=t}};(function(e){function t(s,l){let{elements:c}=s,{type_symbol:u}=s.model.atomicHierarchy.atoms,d=[];for(let f=0,m=l.length;f<m;f++)d[d.length]=u.value(c[l[f]]);return r(d)}e.fingerprint=t;function r(s){return Vge(s)}e.elementFingerprint=r;let n=new Set([bt.B,bt.C,bt.N,bt.O,bt.SI,bt.P,bt.S,bt.GE,bt.AS,bt.SN,bt.SB,bt.BI]),o=.05;function i(s,l){let{elements:c,bonds:{b:u,offset:d,edgeProps:{flags:f}}}=s,{type_symbol:m,label_comp_id:p}=s.model.atomicHierarchy.atoms;if(p.value(s.elements[l[0]])==="PRO")return!1;let h=0,g=!1;for(let b=0,x=l.length;b<x;++b){let C=l[b];!g&&n.has(m.value(c[C]))&&(g=!0);for(let S=d[C],w=d[C+1];S<w;++S)Tt.is(Tt.Flag.Aromatic,f[S])&&je.has(l,u[S])&&(h+=1)}if(h===2*l.length)return!0;if(!g||l.length<5||h>0)return!1;let y=jc.calculateMomentsAxes(J4(s,l));return v.magnitude(y.dirC)<o}e.isAromatic=i;function a(s,l){let{label_alt_id:c}=s.model.atomicHierarchy.atoms,{elements:u}=s;for(let d=0,f=l.length;d<f;++d){let m=u[l[d]],p=c.value(m);if(p)return p}return""}e.getAltId=a})(qf||(qf={}));(function(e){function t(n){if(fe.Traits.is(n.traits,fe.Trait.Water)||fe.Traits.is(n.traits,fe.Trait.CoarseGrained))return new e([],n);let o=Uge(n);return new e(o,n)}e.create=t;function r(n,o){let i=new Map;for(let a=0,s=o.length;a<s;a++){let l=o[a];Xct(n,l,i)}return i}e.byFingerprintAndResidue=r})(sx||(sx={}))});var lo,dg=M(()=>{Ut();(function(e){function t(C){return je.ofSortedArray(C)}e.ofSortedRanges=t;function r(C){return C[0]}e.start=r;function n(C){return C[C.length-1]+1}e.end=n;function o(C){return C[0]}e.min=o;function i(C){return C[C.length-1]}e.max=i;function a(C){let S=0;for(let w=0,A=C.length;w<A;w+=2)S+=C[w+1]-C[w]+1;return S}e.size=a;function s(C){return C.length/2}e.count=s;function l(C,S){return C[S*2]}e.startAt=l;function c(C,S){return C[S*2+1]+1}e.endAt=c;function u(C,S){return C[S*2]}e.minAt=u;function d(C,S){return C[S*2+1]}e.maxAt=d;function f(C,S){if(C.length!==S.length)return!1;for(let w=0,A=C.length;w<A;++w)if(C[w]!==S[w])return!1;return!0}e.areEqual=f;function m(C,S){let w=0;for(let A=0,T=C.length;A<T;A+=2)for(let D=C[A],E=C[A+1];D<=E;++D)S(D,w),++w}e.forEach=m;function p(C,S){return g(C,S)!==-1}e.has=p;function h(C,S,w){return y(C,S,w)!==-1}e.hasFrom=h;function g(C,S){return y(C,S,0)}e.firstIntersectionIndex=g;function y(C,S,w){if(u(C,w)>Se.max(S)||i(C)<Se.min(S))return-1;for(let A=w,T=s(C);A<T;++A){let D=xe.ofRange(u(C,A),d(C,A));if(Se.areIntersecting(D,S))return A}return-1}e.firstIntersectionIndexFrom=y;function b(C,S){return new x(C,S)}e.transientSegments=b;class x{updateValue(){this.value.index=this.curIndex,this.value.start=Se.findPredecessorIndex(this.set,l(this.ranges,this.curIndex)),this.value.end=Se.findPredecessorIndex(this.set,c(this.ranges,this.curIndex))}move(){return this.hasNext&&(this.updateValue(),this.curIndex=y(this.ranges,this.set,this.curIndex+1),this.hasNext=this.curIndex!==-1),this.value}constructor(S,w){this.ranges=S,this.set=w,this.value={index:0,start:0,end:0},this.curIndex=0,this.hasNext=!1,this.curIndex=g(S,w),this.hasNext=this.curIndex!==-1}}e.Iterator=x})(lo||(lo={}))});function Kge(e){let t=[],{elements:r,model:n}=e,{residueAtomSegments:o}=e.model.atomicHierarchy,{traceElementIndex:i}=n.atomicHierarchy.derived.residue,a=lo.transientSegments(e.model.atomicRanges.polymerRanges,r),s=nr.transientSegments(o,r);for(;a.hasNext;){let l=a.move();for(s.setSegment(l);s.hasNext;){let c=s.move(),{start:u,end:d,index:f}=c;if(Se.areIntersecting(xe.ofRange(r[u],r[d-1]),r)){let m=i[f];t.push(m===-1?o.offsets[f]:m)}}}return je.ofSortedArray(t)}function Yge(e){let t=[],{elements:r,model:n}=e,{spheres:o,gaussians:i}=n.coarseHierarchy,a=fe.isSpheres(e)?o.polymerRanges:i.polymerRanges,s=lo.transientSegments(a,r);for(;s.hasNext;){let{start:l,end:c}=s.move();for(let u=l;u<c;++u)t.push(r[u])}return je.ofSortedArray(t)}function Xge(e){let t=[],{elements:r,model:n,residueIndex:o}=e,{residueAtomSegments:i}=e.model.atomicHierarchy,{traceElementIndex:a}=n.atomicHierarchy.derived.residue,s=lo.transientSegments(e.model.atomicRanges.gapRanges,e.elements);for(;s.hasNext;){let l=s.move(),c=o[r[l.start]],u=o[r[l.end-1]],d=a[c],f=a[u];t.push(d===-1?i.offsets[c]:d),t.push(f===-1?i.offsets[u]:f)}return je.ofSortedArray(t)}function Zge(e){let t=[],{elements:r,model:n}=e,{spheres:o,gaussians:i}=n.coarseHierarchy,a=fe.isSpheres(e)?o.gapRanges:i.gapRanges,s=lo.transientSegments(a,r);for(;s.hasNext;){let{start:l,end:c}=s.move();t.push(r[l],r[c-1])}return je.ofSortedArray(t)}function $ge(e){let t=[],{elements:r,model:n}=e,{chainAtomSegments:o,residueAtomSegments:i}=n.atomicHierarchy,{moleculeType:a,traceElementIndex:s}=n.atomicHierarchy.derived.residue,l=nr.transientSegments(o,r),c=nr.transientSegments(i,r);for(;l.hasNext;)for(c.setSegment(l.move());c.hasNext;){let{index:u}=c.move();if($a(a[u])){let d=s[u];t.push(d===-1?i.offsets[u]:d)}}return je.ofSortedArray(t)}function Qge(e){let t=[],{elements:r,model:n}=e,{chainAtomSegments:o,residueAtomSegments:i}=n.atomicHierarchy,{moleculeType:a,traceElementIndex:s}=n.atomicHierarchy.derived.residue,l=nr.transientSegments(o,r),c=nr.transientSegments(i,r);for(;l.hasNext;)for(c.setSegment(l.move());c.hasNext;){let{index:u}=c.move();if(TW(a[u])){let d=s[u];t.push(d===-1?i.offsets[u]:d)}}return je.ofSortedArray(t)}var Jge=M(()=>{gt();Ut();dg();Br()});function $ct(e){let{elements:t,conformation:r}=e,n=new Float32Array(t.length*3);for(let o=0,i=t.length;o<i;o++)r.invariantPosition(t[o],e0e),v.toArray(e0e,n,o*3);return n}function $W(e){let t=$ct(e);return jc.ofPositions(t)}var e0e,t0e=M(()=>{Y1();Ge();e0e=v()});function eut(e){let t;switch(e){case"6":t=[...tL];break;case"14":t=[...tL,...QW];break;case"26":t=[...tL,...QW,...o0e];break;case"98":t=[...tL,...QW,...o0e,...tut,...rut,...nut];break}return t.map(r=>{let n=v.create(r[0],r[1],r[2]);return v.normalize(n,n)})}var r0e,n0e,Qct,Jct,Va,tL,QW,o0e,tut,rut,nut,Bp=M(()=>{$i();v2();sg();X1();r0e=v.dot,n0e=v.copy,Qct=v.scaleAndSub,Jct=v.scaleAndAdd,Va=class{computeExtrema(t,r){let n=r0e(this.dir[t],r);n<this.minDist[t]&&(this.minDist[t]=n,n0e(this.extrema[t*2],r)),n>this.maxDist[t]&&(this.maxDist[t]=n,n0e(this.extrema[t*2+1],r))}computeSphereExtrema(t,r,n){let o=this.dir[t],i=r0e(o,r);i-n<this.minDist[t]&&(this.minDist[t]=i-n,Qct(this.extrema[t*2],r,o,n)),i+n>this.maxDist[t]&&(this.maxDist[t]=i+n,Jct(this.extrema[t*2+1],r,o,n))}includeSphere(t){if(be.hasExtrema(t)&&t.extrema.length>1)for(let r of t.extrema)this.includePosition(r);else this.includePositionRadius(t.center,t.radius)}includePosition(t){for(let r=0;r<this.dirLength;++r)this.computeExtrema(r,t)}includePositionRadius(t,r){for(let n=0;n<this.dirLength;++n)this.computeSphereExtrema(n,t,r)}finishedIncludeStep(){for(let t=0;t<this.extrema.length;t++)this.centroidHelper.includeStep(this.extrema[t]);this.centroidHelper.finishedIncludeStep()}radiusSphere(t){if(be.hasExtrema(t)&&t.extrema.length>1)for(let r of t.extrema)this.radiusPosition(r);else this.radiusPositionRadius(t.center,t.radius)}radiusPosition(t){this.centroidHelper.radiusStep(t)}radiusPositionRadius(t,r){this.centroidHelper.radiusSphereStep(t,r)}getSphere(t){return be.setExtrema(this.centroidHelper.getSphere(t),this.extrema.slice())}getBox(t){return Ct.fromVec3Array(t||Ct(),this.extrema)}reset(){for(let t=0;t<this.dirLength;++t)this.minDist[t]=1/0,this.maxDist[t]=-1/0,this.extrema[t*2]=v(),this.extrema[t*2+1]=v();this.centroidHelper.reset()}constructor(t){this.minDist=[],this.maxDist=[],this.extrema=[],this.centroidHelper=new Ru,this.dir=eut(t),this.dirLength=this.dir.length,this.reset()}};tL=[[1,0,0],[0,1,0],[0,0,1]],QW=[[1,1,1],[-1,1,1],[-1,-1,1],[1,-1,1]],o0e=[[1,1,0],[1,-1,0],[1,0,1],[1,0,-1],[0,1,1],[0,1,-1]],tut=[[0,1,2],[0,2,1],[1,0,2],[2,0,1],[1,2,0],[2,1,0],[0,1,-2],[0,2,-1],[1,0,-2],[2,0,-1],[1,-2,0],[2,-1,0]],rut=[[1,1,2],[2,1,1],[1,2,1],[1,-1,2],[1,1,-2],[1,-1,-2],[2,-1,1],[2,1,-1],[2,-1,-1],[1,-2,1],[1,2,-1],[1,-2,-1]],nut=[[2,2,1],[1,2,2],[2,1,2],[2,-2,1],[2,2,-1],[2,-2,-1],[1,-2,2],[1,2,-2],[1,-2,-2],[2,-1,2],[2,1,-2],[2,-1,-2]]});function aut(e){return e>1e4?out:iut}function nL(e){let t=Ct.computeBounding(e);return{box:t,sphere:be.fromBox3D(be(),t)}}function fg(e){let{x:t,y:r,z:n,radius:o,indices:i}=e,a=Se.size(i);if(a>25e4)return nL(e);let s=aut(a);s.reset();for(let c=0;c<a;c++){let u=Se.getAt(i,c);i0e(rL,t[u],r[u],n[u]),s.includePositionRadius(rL,o&&o[u]||0)}s.finishedIncludeStep();for(let c=0;c<a;c++){let u=Se.getAt(i,c);i0e(rL,t[u],r[u],n[u]),s.radiusPositionRadius(rL,o&&o[u]||0)}let l=s.getSphere();if(!o&&be.hasExtrema(l)&&a<=l.extrema.length){let c=[];for(let u=0;u<a;u++){let d=Se.getAt(i,u);c.push(v.create(t[d],r[d],n[d]))}be.setExtrema(l,c)}return{box:s.getBox(),sphere:l}}var i0e,out,iut,rL,TD=M(()=>{Ge();Ut();Bp();X1();sg();i0e=v.set,out=new Va("14"),iut=new Va("98");rL=v()});var oL,a0e=M(()=>{Ut();oL=class e{constructor(){this.data=new Map}get(t){let r=je.hashCode(t);if(this.data.has(r)){for(let[n,o]of this.data.get(r))if(je.areEqual(t,n))return o}}set(t,r){let n=je.hashCode(t);if(this.data.has(n)){let o=this.data.get(n);for(let i of o)if(je.areEqual(t,i[0])){i[1]=r;return}o.push([t,r])}else this.data.set(n,[[t,r]])}static get(t){return t._dynamicPropertyData.ElementSetIntraBondCache||(t._dynamicPropertyData.ElementSetIntraBondCache=new e),t._dynamicPropertyData.ElementSetIntraBondCache}}});var TT,ob,iL=M(()=>{tn();or();Rp();la();TT=class{get operatorGroups(){return this._operators?this._operators:(this._operators=this.operatorsProvider(),this._operators)}constructor(t,r,n){this.operatorsProvider=n,this.id=t,this.details=r}};(function(e){function t(r,n,o){return new e(r,n,o)}e.create=t})(TT||(TT={}));(function(e){e.Default={assemblies:[],spacegroup:Rl.ZeroP1,isNonStandardCrystalFrame:!1};function t(n,o){let i=o.toLocaleLowerCase(),a=di.Provider.get(n);return a?aT(a.assemblies,s=>s.id.toLowerCase()===i):void 0}e.findAssembly=t;function r(n){let{cell:o,name:i,num:a}=n.spacegroup,{size:s,anglesInRadians:l}=o,c=s[0].toFixed(2),u=s[1].toFixed(2),d=s[2].toFixed(2),f=Bl(l[0]).toFixed(2),m=Bl(l[1]).toFixed(2),p=Bl(l[2]).toFixed(2),h=[];return h.push(`Unit Cell <b>${i}</b> #${a}`),h.push(`${c}\xD7${u}\xD7${d} \u212B`),h.push(`\u03B1=${f}\xB0 \u03B2=${m}\xB0 \u03B3=${p}\xB0`),h.join(" | ")}e.getUnitcellLabel=r})(ob||(ob={}))});function s0e(e,t,r){if(!e._rowCount)return[];let n=cut(r),o=[];for(let i=0;i<e._rowCount;i++)o[o.length]=sut(e,t,i,n);return o}function sut(e,t,r,n){let o=e.id.value(r),i=e.details.value(r),a=[],{assembly_id:s,oper_expression:l,asym_id_list:c}=t;for(let u=0,d=t._rowCount;u<d;u++)s.value(u)===o&&(a[a.length]={assemblyId:o,expression:l.value(u),asymIds:c.value(u)});return TT.create(o,i,lut(a,n))}function lut(e,t){return()=>{let r=[],n=0;for(let o=0;o<e.length;o++){let i=e[o],a=fut(i.expression),s=uut(a),l=dut(t,s,n,i.assemblyId),c=ho.generators.atoms({chainTest:ho.pred.and(ho.pred.eq(u=>nt.unit.operator_name(u.element),mo.DefaultName),ho.pred.inSet(u=>nt.chain.label_asym_id(u.element),i.asymIds))});r[r.length]={selector:c,operators:l,asymIds:i.asymIds},n+=l.length}return r}}function cut(e){let{id:t,matrix:r,vector:n,_schema:o}=e,i=new Map,a=v();for(let s=0,l=e._rowCount;s<l;s++){let c=Rr.toMat4(H(),o.matrix.space,r.value(s));Rr.toVec3(a,o.vector.space,n.value(s)),H.setTranslation(c,a),H.setValue(c,3,3,1),i.set(t.value(s),c)}return i}function uut(e){let t=[],r=[];for(let n=0;n<e.length;n++)r[n]="";return l0e(e,t,e.length-1,r),t}function l0e(e,t,r,n){if(r<0){t[t.length]=n.slice(0);return}let o=e[r],i=o.length;for(let a=0;a<i;a++)n[r]=o[a],l0e(e,t,r-1,n)}function dut(e,t,r,n){let o=[],i=r;for(let a of t){let s=H.identity();for(let u=0;u<a.length;u++)H.mul(s,s,e.get(a[u]));i++;let l=`ASM_${i}`,c=mo.getAssemblyOperatorName(a);o[o.length]=mo.create(l,s,{instanceId:c,assembly:{id:n,operId:i,operList:a}})}return o}function fut(e){let t=/\(?([^\(\)]+)\)?]*/g,r=[],n=[],o;for(;o=t.exec(e);)r[r.length]=o[1];return r.forEach(i=>{let a=[];i.split(",").forEach(s=>{let l=s.indexOf("-");if(l>0){let c=parseInt(s.substring(0,l)),u=parseInt(s.substr(l+1));for(let d=c;d<=u;d++)a[a.length]=d.toString()}else a[a.length]=s.trim()}),n[n.length]=a}),n}var c0e=M(()=>{Ge();hT();iL();gt();gt()});function mut(e,t){return e._rowCount===0,!1}function put(e){let t=e.Int_Tables_number.value(0),r=e["space_group_name_H-M"].value(0);return e.Int_Tables_number.isDefined?e["space_group_name_H-M"].isDefined?r:t:r}function hut(e,t){if(e._rowCount===0||t._rowCount===0)return Rl.ZeroP1;let r=t.length_a.value(0),n=t.length_b.value(0),o=t.length_c.value(0);if(r===0||n===0||o===0)return Rl.ZeroP1;let i=t.angle_alpha.value(0),a=t.angle_beta.value(0),s=t.angle_gamma.value(0);if(i===0||a===0||s===0)return Rl.ZeroP1;let l=put(e),c=Ua.create(l,v.create(r,n,o),v.scale(v(),v.create(i,a,s),Math.PI/180));return Rl.create(c)}function gut(e){if(e._rowCount===0)return;let{id:t,matrix:r,vector:n}=e,o=Dn.struct_ncs_oper.matrix.space,i=Dn.struct_ncs_oper.vector.space,a=[];for(let s=0;s<e._rowCount;s++){let l=Rr.toMat3(Yt(),o,r.value(s)),c=Rr.toVec3(v(),i,n.value(s));if(!mo.checkIfRotationAndTranslation(l,c)||e.code.value(s)==="given"&&!Yt.isIdentity(l)&&!v.isZero(c))continue;let u=t.value(s);a[a.length]=mo.ofRotationAndOffset(`ncs_${u}`,l,c,u)}return a}var di,Rp=M(()=>{J1();or();Ge();c0e();I0();(function(e){e.Descriptor={name:"model_symmetry"},e.Provider=Xl.create(e.Descriptor);function t(n){let o=s0e(n.pdbx_struct_assembly,n.pdbx_struct_assembly_gen,n.pdbx_struct_oper_list),i=hut(n.symmetry,n.cell),a=mut(n.atom_sites,i);return{assemblies:o,spacegroup:i,isNonStandardCrystalFrame:a,ncsOperators:gut(n.struct_ncs_oper)}}e.fromData=t;function r(n,o){let i=Ua.create("P 1",n,o),a=Rl.create(i);return{assemblies:[],spacegroup:a,isNonStandardCrystalFrame:!1}}e.fromCell=r})(di||(di={}))});function u0e(e){return fe.Traits.is(e.traits,fe.Trait.Water)||fe.Traits.is(e.traits,fe.Trait.CoarseGrained)?yut:{delocalizedTriplets:vut(e)}}function vut(e){let t=e.bonds,{b:r,edgeProps:n,offset:o}=t,{order:i,flags:a}=n,{elementAromaticRingIndices:s}=e.rings,l=[],c=new Map,u=new Map,d=(f,m,p)=>{let h=l.length;l.push(je.ofUnsortedArray([f,m,p])),c.set(Wd(f,m),p),u.has(f)?u.get(f).push(h):u.set(f,[h])};for(let f=0;f<e.elements.length;f++){if(s.has(f)||o[f+1]-o[f]+1<2)continue;let p=[];for(let h=o[f],g=o[f+1];h<g;h++){let y=a[h];Tt.is(y,Tt.Flag.Aromatic)&&p.push(r[h])}if(p.length>=2){d(f,p[0],p[1]);for(let h=1,g=p.length;h<g;h++)d(f,p[h],p[0])}}return{getThirdElement:(f,m)=>c.get(Wd(f,m)),getTripletIndices:f=>u.get(f),triplets:l}}var yut,d0e=M(()=>{u2();tn();Br();sd();yut={delocalizedTriplets:{getThirdElement:()=>{},getTripletIndices:()=>{},triplets:[]}}});var fe,sd=M(()=>{hT();nx();or();CD();Vt();eL();Ut();tn();Jge();t0e();TD();Ge();ag();a0e();Rp();d0e();(function(e){let t;(function(j){j[j.Atomic=0]="Atomic",j[j.Spheres=1]="Spheres",j[j.Gaussians=2]="Gaussians"})(t=e.Kind||(e.Kind={}));let r;(function(j){j[j.Atomic=0]="Atomic",j[j.Spheres=1]="Spheres",j[j.Gaussians=2]="Gaussians"})(r=e.Kinds||(e.Kinds={}));function n(j){return j.kind===t.Atomic}e.isAtomic=n;function o(j){return j.kind===t.Spheres||j.kind===t.Gaussians}e.isCoarse=o;function i(j){return j.kind===t.Spheres}e.isSpheres=i;function a(j){return j.kind===t.Gaussians}e.isGaussians=a;function s(j,L,V,U,z,ie,oe,X,Y){switch(z){case t.Atomic:return new b(j,L,V,U,ie,X,mo.createMapping(oe,ie.atomicConformation),Y??x());case t.Spheres:return D(j,L,V,U,ie,t.Spheres,X,mo.createMapping(oe,ie.coarseConformation.spheres,g(ie)),Y??w());case t.Gaussians:return D(j,L,V,U,ie,t.Gaussians,X,mo.createMapping(oe,ie.coarseConformation.gaussians,y(ie)),Y??w())}}e.create=s;function l(j){let L=Pc.Mutable();for(let V=0,U=j.length;V<U;V++)L.set(j[V].id,V);return L}function c(j){let L=[];for(let V=0,U=j.length;V<U;V++)L.push(j[V].id);return Fi(L)}function u(j){let L={};return{elements:j[0].elements,units:j,get unitIndexMap(){return L.unitIndexMap||(L.unitIndexMap=l(j)),L.unitIndexMap},hashCode:f(j[0]),transformHash:c(j)}}e.SymmetryGroup=u,(function(j){function L(U,z){return U.hashCode!==z.hashCode?!1:je.areEqual(U.elements,z.elements)}j.areInvariantElementsEqual=L;function V(U){let z=Pc.Mutable();for(let ie=0,oe=U.length;ie<oe;++ie){let X=U[ie];for(let Y=0,ne=X.units.length;Y<ne;++Y)z.set(X.units[Y].id,ie)}return z}j.getUnitSymmetryGroupsIndexMap=V})(u=e.SymmetryGroup||(e.SymmetryGroup={}));function d(j){return e.isAtomic(j)?j.model.atomicConformation.id:j.model.coarseConformation.id}e.conformationId=d;function f(j){return od(j.invariantId,je.hashCode(j.elements))}e.hashUnit=f;let m;(function(j){j[j.None=0]="None",j[j.MultiChain=1]="MultiChain",j[j.Partitioned=2]="Partitioned",j[j.FastBoundary=4]="FastBoundary",j[j.Water=8]="Water",j[j.CoarseGrained=16]="CoarseGrained"})(m=e.Trait||(e.Trait={}));let p;(function(j){j.is=Ka.has,j.create=Ka.create})(p=e.Traits||(e.Traits={}));function h(){return{}}function g(j){let L=j.coarseConformation.spheres.radius;return V=>L[V]}function y(j){return L=>0}class b{get transientCache(){return this._transientCache===void 0&&(this._transientCache=new Map),this._transientCache}getChild(L){return L.length===this.elements.length?this:new b(this.id,this.invariantId,this.chainGroupId,this.traits,this.model,L,this.conformation,x())}getCopy(L,V,U,z){let ie=new b(L,V,U,this.traits,this.model,this.elements,this.conformation,this.props);return z?.propagateTransientCache&&(ie._transientCache=this._transientCache),ie}applyOperator(L,V,U=!1){let z=U?V:mo.compose(this.conformation.operator,V);return new b(L,this.invariantId,this.chainGroupId,this.traits,this.model,this.elements,mo.createMapping(z,this.model.atomicConformation,this.conformation.r),this.props)}remapModel(L,V,U){var z,ie;U||(U={...this.props,bonds:V&&!(!((ie=(z=this.props.bonds)===null||z===void 0?void 0:z.props)===null||ie===void 0)&&ie.canRemap)?void 0:R(this,this.props.bonds,L,V)},e.isSameConformation(this,L)||(U.boundary=void 0,U.lookup3d=void 0,U.principalAxes=void 0));let oe=this.conformation.operator,X=di.Provider.get(L);if(oe.spgrOp!==-1&&X&&X!==di.Provider.get(this.model)){let[ne,K,$]=oe.hkl,{toFractional:Z}=X.spacegroup.cell,de=v.transformMat4(v(),Ht.getCenter(L),Z);oe=Rl.getSymmetryOperatorRef(X.spacegroup,oe.spgrOp,ne,K,$,de)}let Y=this.model.atomicConformation!==L.atomicConformation||oe!==this.conformation.operator?mo.createMapping(oe,L.atomicConformation):this.conformation;return new b(this.id,this.invariantId,this.chainGroupId,this.traits,L,this.elements,Y,U)}get boundary(){if(this.props.boundary)return this.props.boundary;let{x:L,y:V,z:U}=this.model.atomicConformation;return this.props.boundary=p.is(this.traits,m.FastBoundary)?nL({x:L,y:V,z:U,indices:this.elements}):fg({x:L,y:V,z:U,indices:this.elements}),this.props.boundary}get lookup3d(){if(this.props.lookup3d)return this.props.lookup3d;let{x:L,y:V,z:U}=this.model.atomicConformation;return this.props.lookup3d=Kd({x:L,y:V,z:U,indices:this.elements},this.boundary),this.props.lookup3d}get principalAxes(){return this.props.principalAxes?this.props.principalAxes:(this.props.principalAxes=$W(this),this.props.principalAxes)}get bonds(){var L;if(this.props.bonds)return this.props.bonds;let V=oL.get(this.model),U=V.get(this.elements);return U||(U=Age(this),!((L=U.props)===null||L===void 0)&&L.cacheable&&V.set(this.elements,U)),this.props.bonds=U,this.props.bonds}get rings(){return this.props.rings?this.props.rings:(this.props.rings=sx.create(this),this.props.rings)}get resonance(){return this.props.resonance?this.props.resonance:(this.props.resonance=u0e(this),this.props.resonance)}get polymerElements(){return this.props.polymerElements?this.props.polymerElements:(this.props.polymerElements=Kge(this),this.props.polymerElements)}get gapElements(){return this.props.gapElements?this.props.gapElements:(this.props.gapElements=Xge(this),this.props.gapElements)}get nucleotideElements(){return this.props.nucleotideElements?this.props.nucleotideElements:(this.props.nucleotideElements=$ge(this),this.props.nucleotideElements)}get proteinElements(){return this.props.proteinElements?this.props.proteinElements:(this.props.proteinElements=Qge(this),this.props.proteinElements)}get residueCount(){if(this.props.residueCount!==void 0)return this.props.residueCount;let L=0,V=nr.transientSegments(this.model.atomicHierarchy.residueAtomSegments,this.elements);for(;V.hasNext;)V.move(),L+=1;return this.props.residueCount=L,this.props.residueCount}getResidueIndex(L){return this.residueIndex[this.elements[L]]}constructor(L,V,U,z,ie,oe,X,Y){this.kind=t.Atomic,this.objectPrimitive="atomistic",this._transientCache=void 0,this.id=L,this.invariantId=V,this.chainGroupId=U,this.traits=z,this.model=ie,this.elements=oe,this.conformation=X,this.residueIndex=ie.atomicHierarchy.residueAtomSegments.index,this.chainIndex=ie.atomicHierarchy.chainAtomSegments.index,this.props=Y}}e.Atomic=b;function x(){return h()}class C{get transientCache(){return this._transientCache===void 0&&(this._transientCache=new Map),this._transientCache}getChild(L){return L.length===this.elements.length?this:D(this.id,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,L,this.conformation,w())}getCopy(L,V,U,z){let ie=D(L,V,U,this.traits,this.model,this.kind,this.elements,this.conformation,this.props);return z?.propagateTransientCache&&(ie._transientCache=this._transientCache),ie}applyOperator(L,V,U=!1){let z=U?V:mo.compose(this.conformation.operator,V);return D(L,this.invariantId,this.chainGroupId,this.traits,this.model,this.kind,this.elements,mo.createMapping(z,this.getCoarseConformation(),this.conformation.r),this.props)}remapModel(L,V,U){let z=this.getCoarseConformation(),ie=S(this.kind,L);U||(U={...this.props},e.isSameConformation(this,L)||(U.boundary=void 0,U.lookup3d=void 0,U.principalAxes=void 0));let oe=z!==ie?mo.createMapping(this.conformation.operator,ie,this.kind===e.Kind.Spheres?g(L):y(L)):this.conformation;return new C(this.id,this.invariantId,this.chainGroupId,this.traits,L,this.kind,this.elements,oe,U)}get boundary(){if(this.props.boundary)return this.props.boundary;let{x:L,y:V,z:U}=this.getCoarseConformation();return this.props.boundary=p.is(this.traits,m.FastBoundary)?nL({x:L,y:V,z:U,indices:this.elements}):fg({x:L,y:V,z:U,indices:this.elements}),this.props.boundary}get lookup3d(){if(this.props.lookup3d)return this.props.lookup3d;let{x:L,y:V,z:U}=this.getCoarseConformation();return this.props.lookup3d=Kd({x:L,y:V,z:U,indices:this.elements},this.boundary),this.props.lookup3d}get principalAxes(){return this.props.principalAxes?this.props.principalAxes:(this.props.principalAxes=$W(this),this.props.principalAxes)}get polymerElements(){return this.props.polymerElements?this.props.polymerElements:(this.props.polymerElements=Yge(this),this.props.polymerElements)}get gapElements(){return this.props.gapElements?this.props.gapElements:(this.props.gapElements=Zge(this),this.props.gapElements)}getCoarseConformation(){return S(this.kind,this.model)}constructor(L,V,U,z,ie,oe,X,Y,ne){this._transientCache=void 0,this.kind=oe,this.objectPrimitive=oe===t.Spheres?"sphere":"gaussian",this.id=L,this.invariantId=V,this.chainGroupId=U,this.traits=z,this.model=ie,this.elements=X,this.conformation=Y,this.coarseElements=oe===t.Spheres?ie.coarseHierarchy.spheres:ie.coarseHierarchy.gaussians,this.coarseConformation=oe===t.Spheres?ie.coarseConformation.spheres:ie.coarseConformation.gaussians,this.props=ne}}function S(j,L){return j===t.Spheres?L.coarseConformation.spheres:L.coarseConformation.gaussians}function w(){return h()}class A extends C{}e.Spheres=A;class T extends C{}e.Gaussians=T;function D(j,L,V,U,z,ie,oe,X,Y){return new C(j,L,V,U,z,ie,oe,X,Y)}function E(j,L){return j.chainGroupId===L.chainGroupId&&j.conformation.operator.name===L.conformation.operator.name}e.areSameChainOperatorGroup=E;function I(j,L){return H.areEqual(j.conformation.operator.matrix,L.conformation.operator.matrix,1e-6)}e.areOperatorsEqual=I;function k(j,L){return j===L?!0:je.areEqual(j.elements,L.elements)?B(j,L.model):!1}e.areConformationsEqual=k;function R(j,L,V,U){var z;if(!L)return;if(j.model.atomicConformation.id===V.atomicConformation.id)return L;let ie=ui.Provider.get(j.model);if(ie){let oe=ui.Provider.get(V);return!oe||ie===oe?L:void 0}return!((z=L.props)===null||z===void 0)&&z.canRemap||!U||B(j,V)?L:void 0}function B(j,L){let V=Ht.CoordinatesHistory.get(Ht.getRoot(L));if(V)return V.areEqual(j.elements,j.kind,L);let U=j.elements,{x:z,y:ie,z:oe}=j.conformation.coordinates,{x:X,y:Y,z:ne}=O(j.kind,L);for(let K=0,$=U.length;K<$;K++){let Z=U[K];if(z[Z]!==X[Z]||ie[Z]!==Y[Z]||oe[Z]!==ne[Z])return!1}return!0}e.isSameConformation=B;function O(j,L){return j===t.Atomic?L.atomicConformation:j===t.Spheres?L.coarseConformation.spheres:L.coarseConformation.gaussians}e.getModelConformationOfKind=O;function F(j){return O(j.kind,j.model)}e.getConformation=F;function q(j,L){return j===t.Atomic?L.atomicHierarchy:j===t.Spheres?L.coarseHierarchy.spheres:L.coarseHierarchy.gaussians}e.getModelHierarchyOfKind=q;function W(j){return q(j.kind,j.model)}e.getHierarchy=W})(fe||(fe={}))});function AT(){return{result:w2.create(),closeUnitsResult:Bu.create(),unitGroupResult:Bu.create()}}var w2,aL,sL=M(()=>{or();Ge();Ut();ib();RW();(function(e){function t(o,i,a,s){o.indices[o.count]=a,o.units[o.count]=i,o.squaredDistances[o.count]=s,o.count++}e.add=t;function r(){return{count:0,indices:[],units:[],squaredDistances:[]}}e.create=r;function n(o,i){for(let a=0;a<i.count;++a)o.indices[a]=i.indices[a],o.units[a]=i.units[a],o.squaredDistances[a]=i.squaredDistances[a];return o.count=i.count,o}e.copy=n})(w2||(w2={}));aL=class{findUnitIndices(t,r,n,o){return this.unitLookup.find(t,r,n,o)}find(t,r,n,o,i){return this._find(t,r,n,o,i??this.findContext)}_find(t,r,n,o,i){Bu.reset(i.result);let{units:a}=this.structure,s=this.unitLookup.find(t,r,n,o,i.closeUnitsResult);if(s.count===0)return i.result;for(let l=0,c=s.count;l<c;l++){let u=a[s.indices[l]];v.set(this.pivot,t,r,n),u.conformation.operator.isIdentity||v.transformMat4(this.pivot,this.pivot,u.conformation.operator.inverse);let f=u.lookup3d.find(this.pivot[0],this.pivot[1],this.pivot[2],o,i.unitGroupResult);for(let m=0,p=f.count;m<p;m++)w2.add(i.result,u,f.indices[m],f.squaredDistances[m])}return i.result}nearest(t,r,n,o=1,i){return this._nearest(t,r,n,o,i??this.findContext)}_nearest(t,r,n,o,i){let a=i.result,s=this.heap;Bu.reset(a),s.clear();let{units:l}=this.structure,c=0,u=this.unitLookup.nearest(t,r,n,l.length,m=>(c+=l[m].elements.length)>=o,i.closeUnitsResult);if(u.count===0)return a;let d=0,f=-Number.MAX_VALUE;for(let m=0,p=u.count;m<p;m++){let h=u.squaredDistances[m];if(d>=o&&f<h)break;v.set(this.pivot,t,r,n);let g=l[u.indices[m]];g.conformation.operator.isIdentity||v.transformMat4(this.pivot,this.pivot,g.conformation.operator.inverse);let b=g.lookup3d.nearest(this.pivot[0],this.pivot[1],this.pivot[2],o,void 0,i.unitGroupResult);if(b.count!==0){d+=b.count,f=Math.max(f,b.squaredDistances[b.count-1]);for(let x=0,C=b.count;x<C;x++)s.insert(b.squaredDistances[x],{index:b.indices[x],unit:g})}}if(o===1){let m=s.findMinimum();if(m){let{key:p}=m,{unit:h,index:g}=m.value;w2.add(a,h,g,p)}}else for(;!s.isEmpty()&&a.count<o;){let m=s.extractMinimum(),{key:p}=m,{unit:h,index:g}=m.value;w2.add(a,h,g,p)}return a}findIntoBuilder(t,r,n,o,i){let{units:a}=this.structure,s=this.unitLookup.find(t,r,n,o);if(s.count!==0)for(let l=0,c=s.count;l<c;l++){let u=a[s.indices[l]];v.set(this.pivot,t,r,n),u.conformation.operator.isIdentity||v.transformMat4(this.pivot,this.pivot,u.conformation.operator.inverse);let f=u.lookup3d.find(this.pivot[0],this.pivot[1],this.pivot[2],o);if(f.count===0)continue;let m=u.elements;i.beginUnit(u.id);for(let p=0,h=f.count;p<h;p++)i.addElement(m[f.indices[p]]);i.commitUnit()}}findIntoBuilderIf(t,r,n,o,i,a){let{units:s}=this.structure,l=this.unitLookup.find(t,r,n,o);if(l.count===0)return;let c=te.Location.create(this.structure);for(let u=0,d=l.count;u<d;u++){let f=s[l.indices[u]];v.set(this.pivot,t,r,n),f.conformation.operator.isIdentity||v.transformMat4(this.pivot,this.pivot,f.conformation.operator.inverse);let p=f.lookup3d.find(this.pivot[0],this.pivot[1],this.pivot[2],o);if(p.count===0)continue;let h=f.elements;c.unit=f,i.beginUnit(f.id);for(let g=0,y=p.count;g<y;g++)c.element=h[p.indices[g]],a(c)&&i.addElement(c.element);i.commitUnit()}}findIntoBuilderWithRadius(t,r,n,o,i,a,s,l){let{units:c}=this.structure,u=this.unitLookup.find(t,r,n,a);if(u.count===0)return;let d=te.Location.create(this.structure),f=o+i+a;for(let m=0,p=u.count;m<p;m++){let h=c[u.indices[m]];v.set(this.pivot,t,r,n),h.conformation.operator.isIdentity||v.transformMat4(this.pivot,this.pivot,h.conformation.operator.inverse);let y=h.lookup3d.find(this.pivot[0],this.pivot[1],this.pivot[2],f);if(y.count===0)continue;let b=h.elements;d.unit=h,l.beginUnit(h.id);for(let x=0,C=y.count;x<C;x++){d.element=b[y.indices[x]];let S=s(d);Math.sqrt(y.squaredDistances[x])-o-S>a||l.addElement(b[y.indices[x]])}l.commitUnit()}}check(t,r,n,o){let{units:i}=this.structure,a=this.unitLookup.find(t,r,n,o);if(a.count===0)return!1;for(let s=0,l=a.count;s<l;s++){let c=i[a.indices[s]];if(v.set(this.pivot,t,r,n),c.conformation.operator.isIdentity||v.transformMat4(this.pivot,this.pivot,c.conformation.operator.inverse),c.lookup3d.check(this.pivot[0],this.pivot[1],this.pivot[2],o))return!0}return!1}approxNearest(t,r,n,o,i){return this._approxNearest(t,r,n,o,i??this.findContext)}_approxNearest(t,r,n,o,i){Bu.reset(i.result);let{units:a}=this.structure,s=this.unitLookup.find(t,r,n,o,i.closeUnitsResult);if(s.count===0)return i.result;let l=Number.MAX_VALUE;for(let c=0,u=s.count;c<u;c++){let d=a[s.indices[c]];v.set(this.pivot,t,r,n),d.conformation.operator.isIdentity||v.transformMat4(this.pivot,this.pivot,d.conformation.operator.inverse);let m=d.lookup3d.approxNearest(this.pivot[0],this.pivot[1],this.pivot[2],o,i.unitGroupResult);for(let p=0,h=m.count;p<h;p++)m.squaredDistances[p]<l&&(w2.add(i.result,d,m.indices[p],m.squaredDistances[p]),l=m.squaredDistances[p])}return i.result}get boundary(){return this.structure.boundary}constructor(t){this.structure=t,this.pivot=v(),this.heap=new gT,this.findContext=AT();let{units:r,boundary:n}=t,o=r.length,i=new Float32Array(o),a=new Float32Array(o),s=new Float32Array(o),l=new Float32Array(o),c=v();for(let d=0;d<o;d++){let f=r[d],m=f.boundary.sphere;v.transformMat4(c,m.center,f.conformation.operator.matrix),i[d]=c[0],a[d]=c[1],s[d]=c[2],l[d]=m.radius}let u={x:i,y:a,z:s,radius:l,indices:Se.ofBounds(0,o)};this.unitLookup=Kd(u,n)}}});function ab(e,t){if(t.length===0)return Oe.Empty;if(t.length===1)return t[0];let r=new Map,n=new Set;for(let{units:i}of t)for(let a=0,s=i.length;a<s;a++){let l=i[a];if(r.has(l.id)){if(n.has(l.id))continue;let c=je.union(r.get(l.id),l.elements);r.set(l.id,c),c.length===e.unitMap.get(l.id).elements.length&&n.add(l.id)}else r.set(l.id,l.elements),l.elements.length===e.unitMap.get(l.id).elements.length&&n.add(l.id)}let o=e.subsetBuilder(!0);return r.forEach(but,o),o.getStructure()}function but(e,t){this.setUnit(t,e)}function f0e(e,t){if(e===t)return!0;if(e.units.length!==t.units.length)return!1;let r=e.units,n=t.unitMap;for(let o=0,i=r.length;o<i;o++){let a=r[o];if(!n.has(a.id))return!1;let s=n.get(a.id);if(!je.areEqual(a.elements,s.elements))return!1}return!0}function PT(e,t){if(e===t)return!0;let r,n;e.units.length<t.units.length?(r=e,n=t):(r=t,n=e);let o=r.units,i=n.unitMap;for(let a=0,s=o.length;a<s;a++){let l=o[a];if(!i.has(l.id))continue;let c=i.get(l.id);if(je.areIntersecting(l.elements,c.elements))return!0}return!1}function lL(e,t){if(e===t)return e;if(!PT(e,t))return Oe.Empty;let r,n;e.units.length<t.units.length?(r=e,n=t):(r=t,n=e);let o=r.units,i=n.unitMap,a=[];for(let s=0,l=o.length;s<l;s++){let c=o[s];if(!i.has(c.id))continue;let u=i.get(c.id);if(je.areIntersecting(c.elements,u.elements)){let d=je.intersect(c.elements,u.elements);a[a.length]=c.getChild(d)}}return Oe.create(a,{parent:e.parent||t.parent})}function IT(e,t){if(e===t)return Oe.Empty;if(!PT(e,t))return e;let r=e.units,n=t.unitMap,o=[];for(let i=0,a=r.length;i<a;i++){let s=r[i];if(!n.has(s.id)){o[o.length]=s;continue}let l=n.get(s.id),c=je.subtract(s.elements,l.elements);c.length>0&&(o[o.length]=s.getChild(c))}return Oe.create(o,{parent:e.parent||t.parent})}var T2=M(()=>{zs();Ut()});var ht,mg=M(()=>{ku();zs();T2();Ut();(function(e){function t(y,b){return{kind:"singletons",source:y,structure:b}}e.Singletons=t;function r(y,b){return{kind:"sequence",source:y,structures:b}}e.Sequence=r;function n(y){return t(y,Oe.Empty)}e.Empty=n;function o(y){return y.kind==="singletons"}e.isSingleton=o;function i(y){return o(y)?y.structure.units.length===0:y.structures.length===0}e.isEmpty=i;function a(y){return o(y)?y.structure.elementCount:y.structures.length}e.structureCount=a;function s(y){return i(y)?Oe.Empty:o(y)?y.structure:ab(y.source,y.structures)}e.unionStructure=s;function l(y){let b=[],{unitMap:x}=y.source;for(let C of s(y).units)C===x.get(C.id)?b[b.length]={unit:C,indices:Se.ofBounds(0,C.elements.length)}:b[b.length]={unit:C,indices:Se.ofSortedArray(je.indicesOf(x.get(C.id).elements,C.elements))};return te.Loci(y.source,b)}e.toLociWithCurrentUnits=l;function c(y){let b=[],{unitMap:x}=y.source;for(let C of s(y).units){let S=x.get(C.id);S===C?b[b.length]={unit:S,indices:Se.ofBounds(0,S.elements.length)}:b[b.length]={unit:S,indices:Se.ofSortedArray(je.indicesOf(S.elements,C.elements))}}return te.Loci(y.source,b)}e.toLociWithSourceUnits=c;function u(y,b,x){return b.length===0?n(y):x?t(y,ab(y,b)):r(y,b)}class d{add(b){let x=b.elementCount;x!==0&&(this.structures[this.structures.length]=b,x!==1&&(this.allSingletons=!1))}getSelection(){return u(this.source,this.structures,this.allSingletons)}constructor(b){this.source=b,this.structures=[],this.allSingletons=!0}}class f{add(b){let x=b.elementCount;x===0||!this.uniqueSets.add(b)||(this.structures[this.structures.length]=b,x!==1&&(this.allSingletons=!1))}getSelection(){return u(this.structure,this.structures,this.allSingletons)}constructor(b){this.structure=b,this.structures=[],this.allSingletons=!0,this.uniqueSets=Gw(Oe.hashCode,Oe.areUnitIdsAndIndicesEqual)}}function m(y){return new d(y)}e.LinearBuilder=m;function p(y){return new f(y)}e.UniqueBuilder=p;function h(y,b){let x=0;if(e.isSingleton(y))for(let C of y.structure.units){let{elements:S}=C;for(let w=0,A=S.length;w<A;w++){let T=Oe.create([C.getChild(je.ofSingleton(S[w]))],{parent:y.source});b(T,x++)}}else for(let C of y.structures)b(C,x++)}e.forEach=h;function g(y,b){return o(y)?t(b,y.structure):r(b,y.structures)}e.withInputStructure=g})(ht||(ht={}))});function xut(e){return!!e.items}function Sut(e){let{and:t}=se.core.logic,{eq:r,gre:n,lte:o}=se.core.rel,{macromolecular:i,ihm:a,core:s}=se.struct.atomProperty,l={};Ic(e.label_entity_id)&&(l["entity-test"]=r([i.label_entity_id(),e.label_entity_id]));let c=[];Ic(e.operator_name)&&c.push(r([s.operatorName(),e.operator_name])),Ic(e.instance_id)&&c.push(r([s.instanceId(),e.instance_id])),Ic(e.label_asym_id)&&c.push(r([i.label_asym_id(),e.label_asym_id])),Ic(e.auth_asym_id)&&c.push(r([i.auth_asym_id(),e.auth_asym_id])),c.length===1?l["chain-test"]=c[0]:c.length>1&&(l["chain-test"]=t(c));let u=[];Ic(e.label_seq_id)&&u.push(a.hasSeqId({0:e.label_seq_id})),Ic(e.auth_seq_id)&&u.push(r([i.auth_seq_id(),e.auth_seq_id])),Ic(e.pdbx_PDB_ins_code)&&u.push(r([i.pdbx_PDB_ins_code(),e.pdbx_PDB_ins_code])),(Ic(e.beg_label_seq_id)||Ic(e.end_label_seq_id))&&u.push(a.overlapsSeqIdRange({beg:e.beg_label_seq_id,end:e.end_label_seq_id})),Ic(e.beg_auth_seq_id)&&u.push(n([i.auth_seq_id(),e.beg_auth_seq_id])),Ic(e.end_auth_seq_id)&&u.push(o([i.auth_seq_id(),e.end_auth_seq_id])),u.length===1?l["residue-test"]=u[0]:u.length>1&&(l["residue-test"]=t(u));let d=[];return Ic(e.label_comp_id)&&d.push(r([i.label_comp_id(),e.label_comp_id])),Ic(e.auth_comp_id)&&d.push(r([i.auth_comp_id(),e.auth_comp_id])),Ic(e.atom_id)&&d.push(r([i.id(),e.atom_id])),Ic(e.atom_index)&&d.push(r([se.struct.atomProperty.core.sourceIndex(),e.atom_index])),Ic(e.label_atom_id)&&d.push(r([i.label_atom_id(),e.label_atom_id])),Ic(e.auth_atom_id)&&d.push(r([i.auth_atom_id(),e.auth_atom_id])),Ic(e.type_symbol)&&d.push(r([se.struct.atomProperty.core.elementSymbol(),e.type_symbol.toUpperCase()])),d.length===1?l["atom-test"]=d[0]:d.length>1&&(l["atom-test"]=t(d)),se.struct.generator.atomGroups(l)}function m0e(e){let t=[];return p0e(e,r=>t.push(Sut(r))),t.length===1?t[0]:_ut(t)}function _ut(e){return se.struct.combinator.merge(e.map(t=>se.struct.modifier.union([t])))}function Ic(e){return e!=null}function p0e(e,t){if(xut(e))if(Array.isArray(e.items))if(e.prefix)for(let r of e.items)t(Object.assign({},e.prefix,r));else for(let r of e.items)t(r);else{let r={...e.prefix},n=Object.keys(e.items),o=e.items[n[0]].length;for(let i=0;i<o;i++){for(let a of n)r[a]=e.items[a][i];t(r)}}else t(e)}function h0e(e,t,r){let n=m0e(t);return Op.fromExpression(e,n,r)}function Cut(e,t,r){let n=h0e(e,t,r);return A2.fromLoci(n)}var AD,cL=M(()=>{wa();uL();PD();AD={forEachItem:p0e,toExpression:m0e,toLoci:h0e,toBundle:Cut}});var A2,uL=M(()=>{Ut();ug();tn();dg();PD();wa();ID();cL();(function(e){e.Empty={hash:-1,elements:[]};function t(m,p){return a(ht.toLociWithSourceUnits(ht.Singletons(m,p)))}e.fromSubStructure=t;function r(m){return a(ht.toLociWithSourceUnits(m))}e.fromSelection=r;function n(m,p,h){return a(Op.fromExpression(m,p,h))}e.fromExpression=n;function o(m,p,h){return a(Op.fromQuery(m,p,h))}e.fromQuery=o;function i(m,p,h){return AD.toBundle(m,p,h)}e.fromSchema=i;function a(m){let p=[];for(let y of m.elements){let{unit:b,indices:x}=y;if(Se.size(x)===0)continue;let C=[],S=[];if(Se.isInterval(x))Se.size(x)===1?S.push(xe.min(x)):C.push(xe.min(x),xe.max(x));else{let w=0,A=x.length;for(;w<A;){let T=w;for(w++;w<A&&x[w-1]+1===x[w];)w++;let D=w;if(D-T>2)C.push(x[T],x[D-1]);else for(let E=T;E<D;E++)S[S.length]=x[E]}}p.push({unit:b,set:je.ofSortedArray(S),ranges:lo.ofSortedRanges(C)})}let h=new Map;for(let y=0,b=p.length;y<b;++y){let x=p[y],C=od(Fi(x.ranges),Fi(x.set));if(h.has(C)){let{groupedUnits:S}=h.get(C);S.has(x.unit.invariantId)?S.get(x.unit.invariantId).push(x.unit.id):S.set(x.unit.invariantId,[x.unit.id])}else{let S=new Map;S.set(x.unit.invariantId,[x.unit.id]),h.set(C,{groupedUnits:S,set:x.set,ranges:x.ranges})}}let g=[];return h.forEach(y=>{let b=[];y.groupedUnits.forEach(x=>b.push(je.ofUnsortedArray(x))),b.sort((x,C)=>x[0]-C[0]),g.push({groupedUnits:b,set:y.set,ranges:y.ranges})}),{hash:m.structure.hashCode,elements:g}}e.fromLoci=a;function s(m,p){let h=[];for(let g=0,y=m.length;g<y;++g){let b=m[g];p.unitMap.has(b)&&h.push(p.unitMap.get(b))}return h}function l(m,p){m.hash!==-1&&m.hash!==p.hashCode&&new Error("Bundle not compatible with given structure");let h=[];for(let g of m.elements)for(let y of g.groupedUnits){let b=s(y,p);if(b.length===0)continue;let x;if(g.ranges.length===0)x=g.set;else if(g.set.length===0)if(g.ranges.length===2)x=xe.ofRange(g.ranges[0],g.ranges[1]);else{let C=new Int32Array(lo.size(g.ranges));lo.forEach(g.ranges,(S,w)=>C[w]=S),x=je.ofSortedArray(C)}else{let C=lo.size(g.ranges),S=new Int32Array(g.set.length+C);lo.forEach(g.ranges,(w,A)=>S[A]=w),S.set(g.set,C),x=je.ofUnsortedArray(S)}for(let C of b)h.push({unit:C,indices:x})}return Op(p,h)}e.toLoci=l;function c(m,p){m.hash!==-1&&m.hash!==p.hashCode&&new Error("Bundle not compatible with given structure");let h=[];for(let g of m.elements)for(let y of g.groupedUnits){let b=s(y,p);if(b.length===0)continue;let x=b[0].elements,C=lo.size(g.ranges),S=g.set.length,w=new Int32Array(S+C),A;if(C===0){for(let T=0,D=S;T<D;++T)w[T]=x[g.set[T]];A=je.ofSortedArray(w)}else if(S===0)lo.forEach(g.ranges,(T,D)=>w[D]=x[T]),A=je.ofSortedArray(w);else if(je.min(g.set)>lo.max(g.ranges)){lo.forEach(g.ranges,(T,D)=>w[D]=x[T]);for(let T=0,D=S;T<D;++T)w[T+C]=x[g.set[T]];A=je.ofSortedArray(w)}else if(lo.min(g.ranges)>je.max(g.set)){for(let T=0,D=S;T<D;++T)w[T]=x[g.set[T]];lo.forEach(g.ranges,(T,D)=>w[D+S]=x[T]),A=je.ofSortedArray(w)}else{lo.forEach(g.ranges,(T,D)=>w[D]=x[T]);for(let T=0,D=S;T<D;++T)w[T+C]=x[g.set[T]];A=je.ofUnsortedArray(w)}for(let T of b)h.push(T.getChild(A))}return Oe.create(h,{parent:p})}e.toStructure=c;function u(m){return se.internal.generator.bundleElement({groupedUnits:se.core.type.list(m.groupedUnits.map(p=>se.core.type.list(p))),ranges:se.core.type.list(m.ranges),set:se.core.type.list(m.set)})}function d(m){return se.internal.generator.bundle({elements:se.core.type.list(m.elements.map(u))})}e.toExpression=d;function f(m,p){if(m.elements.length!==p.elements.length)return!1;for(let h=0,g=m.elements.length;h<g;++h){let y=m.elements[h],b=p.elements[h];if(y.groupedUnits.length!==b.groupedUnits.length)return!1;for(let x=0,C=b.groupedUnits.length;x<C;++x)if(!je.areEqual(y.groupedUnits[x],b.groupedUnits[x]))return!1;if(!je.areEqual(y.set,b.set)||!lo.areEqual(y.ranges,b.ranges))return!1}return!0}e.areEqual=f})(A2||(A2={}))});var tK={};ci(tK,{atomicHet:()=>Aut,atomicSequence:()=>wut,bundleElementImpl:()=>JW,bundleGenerator:()=>eK,defaultBondTest:()=>dL,spheres:()=>Put,water:()=>Tut});function dL(e){return Tt.isCovalent(e.atomicBond.type)}function wut(){return function(t){let{inputStructure:r}=t,n=te.Location.create(r),o=[];for(let i of r.units){if(i.kind!==fe.Kind.Atomic)continue;n.unit=i;let a=i.elements;if(n.element=a[0],nt.entity.type(n)!=="polymer")continue;let s=nr.transientSegments(i.model.atomicHierarchy.residueAtomSegments,a),l=0;for(;s.hasNext;)l++,s.move();l<8||o.push(i)}return ht.Singletons(r,Oe.create(o,{parent:r}))}}function Tut(){return function(t){let{inputStructure:r}=t,n=te.Location.create(r),o=[];for(let i of r.units){if(i.kind!==fe.Kind.Atomic)continue;n.unit=i;let a=i.elements;n.element=a[0],nt.entity.type(n)==="water"&&o.push(i)}return ht.Singletons(r,Oe.create(o,{parent:r}))}}function Aut(){return function(t){let{inputStructure:r}=t,n=te.Location.create(r),o=[];for(let i of r.units){if(i.kind!==fe.Kind.Atomic)continue;n.unit=i;let a=i.elements;if(n.element=a[0],nt.entity.type(n)!=="water"){if(nt.entity.type(n)==="polymer"){let s=nr.transientSegments(i.model.atomicHierarchy.residueAtomSegments,a),l=0;for(;s.hasNext;)l++,s.move();if(l>=8)continue}o.push(i)}}return ht.Singletons(r,Oe.create(o,{parent:r}))}}function Put(){return function(t){let{inputStructure:r}=t,n=[];for(let o of r.units)o.kind===fe.Kind.Spheres&&n.push(o);return ht.Singletons(r,Oe.create(n,{parent:r}))}}function JW(e,t,r){return{groupedUnits:e,ranges:t,set:r}}function eK(e){return function(r){let n={hash:r.inputStructure.hashCode,elements:e};return ht.Sequence(r.inputStructure,[A2.toStructure(n,r.inputStructure)])}}var fL=M(()=>{Ut();ib();zs();ug();mg();Br();uL()});var Si,mL,rK=M(()=>{zs();ed();Br();fL();Si=class{pushCurrentElement(){return this.currentElementStack[this.currentElementStack.length]=this.element,this.element=te.Location.create(void 0),this.element}popCurrentElement(){this.element=this.currentElementStack.pop()}pushCurrentBond(){return this.atomicBond&&this.currentAtomicBondStack.push(this.atomicBond),this.atomicBond=new mL,this.atomicBond}popCurrentBond(){this.currentAtomicBondStack.length>0?this.atomicBond=this.currentAtomicBondStack.pop():this.atomicBond=void 0}pushCurrentStructure(){this.currentStructure&&this.currentStructureStack.push(this.currentStructure)}popCurrentStructure(){this.currentStructureStack.length?this.currentStructure=this.currentStructureStack.pop():this.currentStructure=void 0}pushInputStructure(t){this.inputStructureStack.push(this.inputStructure),this.inputStructure=t}popInputStructure(){if(this.inputStructureStack.length===0)throw new Error("Must push before pop.");this.inputStructure=this.inputStructureStack.pop()}throwIfTimedOut(){if(this.timeoutMs!==0&&Kn()-this.timeCreated>this.timeoutMs)throw new Error(`The query took too long to execute (> ${this.timeoutMs/1e3}s).`)}tryGetCurrentSelection(){if(!this.currentSelection)throw new Error("The current selection is not assigned.");return this.currentSelection}constructor(t,r){this.currentElementStack=[],this.currentAtomicBondStack=[],this.currentStructureStack=[],this.inputStructureStack=[],this.timeCreated=Kn(),this.element=te.Location.create(void 0),this.currentStructure=void 0,this.atomicBond=new mL,this.currentSelection=void 0,this.inputStructure=t,this.timeoutMs=r&&r.timeoutMs||0,this.currentSelection=r&&r.currentSelection}},mL=class{constructor(){this.a=te.Location.create(void 0),this.aIndex=0,this.b=te.Location.create(void 0),this.bIndex=0,this.type=Tt.Flag.None,this.order=0,this.key=-1,this.testFn=dL}setStructure(t){this.a.structure=t,this.b.structure=t}setTestFn(t){this.testFn=t||dL}test(t,r){return this.testFn(t)?!0:r?(this.swap(),this.testFn(t)):!1}swap(){let t=this.aIndex;this.aIndex=this.bIndex,this.bIndex=t;let r=this.a.unit;this.a.unit=this.b.unit,this.b.unit=r;let n=this.a.element;this.a.element=this.b.element,this.b.element=n}get length(){return te.Location.distance(this.a,this.b)}}});var ED,g0e=M(()=>{mg();rK();(function(e){function t(n,o,i){return n(new Si(o,i))}e.run=t;function r(n,o,i){let a=n(new Si(o,i));return ht.toLociWithSourceUnits(a)}e.loci=r})(ED||(ED={}))});var ET,pL,nK=M(()=>{zs();mg();ku();T2();ET=class{add(t){t.elementCount&&(t.elementCount!==1&&(this.allSingletons=!1),this.set.add(t)&&(this.structures[this.structures.length]=t))}getSelection(){return this.allSingletons?ht.Singletons(this.source,ab(this.source,this.structures)):ht.Sequence(this.source,this.structures)}constructor(t){this.source=t,this.set=Gw(Oe.hashCode,Oe.areUnitIdsAndIndicesEqual),this.structures=[],this.allSingletons=!0}},pL=class{add(t,r,n){let o=this.builderMap.get(t);o||(o=this.source.subsetBuilder(!0),this.builders[this.builders.length]=o,this.builderMap.set(t,o)),o.addToUnit(r,n)}allSingletons(){for(let t=0,r=this.builders.length;t<r;t++)if(this.builders[t].elementCount>1)return!1;return!0}singletonSelection(){let t=this.source.subsetBuilder(!0),r=te.Location.create(this.source);for(let n=0,o=this.builders.length;n<o;n++)this.builders[n].setSingletonLocation(r),t.addToUnit(r.unit.id,r.element);return ht.Singletons(this.source,t.getStructure())}fullSelection(){let t=new Array(this.builders.length);for(let r=0,n=this.builders.length;r<n;r++)t[r]=this.builders[r].getStructure();return ht.Sequence(this.source,t)}getSelection(){return this.builders.length===0?ht.Empty(this.source):this.allSingletons()?this.singletonSelection():this.fullSelection()}constructor(t){this.source=t,this.builders=[],this.builderMap=new Map}}});var aK={};ci(aK,{all:()=>y0e,atoms:()=>iK,bondedAtomicPairs:()=>Lut,chains:()=>Eut,none:()=>hL,querySelection:()=>Out,residues:()=>Iut,rings:()=>Rut});function Iut(e){return iK({...e,groupBy:t=>nt.residue.key(t.element)})}function Eut(e){return iK({...e,groupBy:t=>nt.chain.key(t.element)})}function lx(e){return!0}function Dut(e){return 0}function iK(e){if(!e||!e.atomTest&&!e.residueTest&&!e.chainTest&&!e.entityTest&&!e.unitTest&&!e.groupBy)return y0e;if(e.atomTest&&!e.residueTest&&!e.chainTest&&!e.entityTest&&!e.unitTest&&!e.groupBy)return kut(e.atomTest);let t={unitTest:e.unitTest||lx,entityTest:e.entityTest||lx,chainTest:e.chainTest||lx,residueTest:e.residueTest||lx,atomTest:e.atomTest||lx,groupBy:e.groupBy||Dut};return e.groupBy?But(t):Mut(t)}function kut(e){return function(r){let{inputStructure:n}=r,{units:o}=n,i=r.pushCurrentElement(),a=n.subsetBuilder(!0);i.structure=n;for(let s of o){i.unit=s;let l=s.elements;a.beginUnit(s.id);for(let c=0,u=l.length;c<u;c++)i.element=l[c],e(r)&&a.addElement(i.element);a.commitUnit(),r.throwIfTimedOut()}return r.popCurrentElement(),ht.Singletons(n,a.getStructure())}}function Mut({unitTest:e,entityTest:t,chainTest:r,residueTest:n,atomTest:o}){return function(a){let{inputStructure:s}=a,{units:l}=s,c=a.pushCurrentElement(),u=s.subsetBuilder(!0),d=n===lx&&o===lx,f=o===lx;c.structure=s;for(let m of l){if(c.unit=m,!e(a))continue;let{elements:p,model:h}=m;if(u.beginUnit(m.id),m.kind===fe.Kind.Atomic){let g=nr.transientSegments(m.model.atomicHierarchy.chainAtomSegments,p),y=nr.transientSegments(m.model.atomicHierarchy.residueAtomSegments,p);for(;g.hasNext;){let b=g.move();if(c.element=p[b.start],!(!t(a)||!r(a))){if(d){u.addElementRange(p,b.start,b.end);continue}for(y.setSegment(b);y.hasNext;){let x=y.move();if(c.element=p[x.start],!!n(a)){if(f){u.addElementRange(p,x.start,x.end);continue}for(let C=x.start,S=x.end;C<S;C++)c.element=p[C],o(a)&&u.addElement(c.element)}}}}}else{let{chainElementSegments:g}=m.kind===fe.Kind.Spheres?h.coarseHierarchy.spheres:h.coarseHierarchy.gaussians,y=nr.transientSegments(g,p);for(;y.hasNext;){let b=y.move();if(c.element=p[b.start],!(!t(a)||!r(a))){if(d){u.addElementRange(p,b.start,b.end);continue}for(let x=b.start,C=b.end;x<C;x++)c.element=p[x],n(a)&&u.addElement(c.element)}}}u.commitUnit(),a.throwIfTimedOut()}return a.popCurrentElement(),ht.Singletons(s,u.getStructure())}}function But({unitTest:e,entityTest:t,chainTest:r,residueTest:n,atomTest:o,groupBy:i}){return function(s){let{inputStructure:l}=s,{units:c}=l,u=s.pushCurrentElement(),d=new pL(l);u.structure=l;for(let f of c){if(u.unit=f,!e(s))continue;let{elements:m,model:p}=f;if(f.kind===fe.Kind.Atomic){let h=nr.transientSegments(p.atomicHierarchy.chainAtomSegments,m),g=nr.transientSegments(p.atomicHierarchy.residueAtomSegments,m);for(;h.hasNext;){let y=h.move();if(u.element=m[y.start],!(!t(s)||!r(s)))for(g.setSegment(y);g.hasNext;){let b=g.move();if(u.element=m[b.start],!!n(s))for(let x=b.start,C=b.end;x<C;x++)u.element=m[x],o(s)&&d.add(i(s),f.id,u.element)}}}else{let{chainElementSegments:h}=f.kind===fe.Kind.Spheres?p.coarseHierarchy.spheres:p.coarseHierarchy.gaussians,g=nr.transientSegments(h,m);for(;g.hasNext;){let y=g.move();if(u.element=m[y.start],!(!t(s)||!r(s)))for(let b=y.start,x=y.end;b<x;b++)u.element=m[b],n(s)&&d.add(i(s),f.id,u.element)}}s.throwIfTimedOut()}return s.popCurrentElement(),d.getSelection()}}function oK(e,t,r){let n=new Int32Array(t.length);for(let o=0,i=t.length;o<i;o++)n[o]=e.elements[t[o]];return Oe.create([e.getChild(je.ofSortedArray(n))],{parent:r})}function Rut(e,t){return function(n){let{units:o}=n.inputStructure,i=ht.LinearBuilder(n.inputStructure);if(!e||e.length===0){for(let a of o)if(fe.isAtomic(a))if(t)for(let s of a.rings.aromaticRings)i.add(oK(a,a.rings.all[s],n.inputStructure));else for(let s of a.rings.all)i.add(oK(a,s,n.inputStructure))}else{let a=$n.create();for(let s=0;s<e.length;s++)$n.add(a,e[s],e[s]);for(let s of o){if(!fe.isAtomic(s))continue;let l=s.rings;for(let c of a.array)if(l.byFingerprint.has(c))for(let u of l.byFingerprint.get(c))t&&!l.aromaticRings.includes(u)||i.add(oK(s,l.all[u],n.inputStructure))}}return i.getSelection()}}function Out(e,t,r=!1){return function(o){let i=e(o);if(ht.structureCount(i)===0)return i;let a=r?IT(o.inputStructure,ht.unionStructure(i)):ht.unionStructure(i);if(a.elementCount===0)return ht.Empty(o.inputStructure);o.throwIfTimedOut(),o.pushInputStructure(a);let s=t(o);return o.popInputStructure(),ht.withInputStructure(s,o.inputStructure)}}function Lut(e){return function(r){let n=r.inputStructure,o=n.interUnitBonds,i=ht.UniqueBuilder(r.inputStructure);r.pushCurrentBond();let a=r.atomicBond;a.setTestFn(e),a.setStructure(n);for(let s of n.units){if(s.kind!==fe.Kind.Atomic)continue;let{offset:l,b:c,edgeProps:{flags:u,order:d,key:f}}=s.bonds;a.a.unit=s,a.b.unit=s;for(let m=0,p=s.elements.length;m<p;m++){a.aIndex=m,a.a.element=s.elements[m];for(let h=l[m],g=l[m+1];h<g;h++)if(a.bIndex=c[h],a.b.element=s.elements[c[h]],a.type=u[h],a.order=d[h],a.key=f[h],a.test(r,!1)){let y=n.subsetBuilder(!1);y.beginUnit(s.id),y.addElement(a.a.element),y.addElement(a.b.element),y.commitUnit(),i.add(y.getStructure())}}}for(let s of o.edges)if(a.a.unit=n.unitMap.get(s.unitA),a.a.element=a.a.unit.elements[s.indexA],a.aIndex=s.indexA,a.b.unit=n.unitMap.get(s.unitB),a.b.element=a.b.unit.elements[s.indexB],a.bIndex=s.indexB,a.order=s.props.order,a.type=s.props.flag,a.key=s.props.key,a.test(r,!1)){let l=n.subsetBuilder(!1);l.addToUnit(a.a.unit.id,a.a.element),l.addToUnit(a.b.unit.id,a.b.element),i.add(l.getStructure())}return r.popCurrentBond(),i.getSelection()}}var hL,y0e,sK=M(()=>{ku();Ut();zs();ug();mg();nK();T2();hL=e=>ht.Sequence(e.inputStructure,[]),y0e=e=>ht.Singletons(e.inputStructure,e.inputStructure)});var P2,v0e=M(()=>{Ut();tn();DD();ug();ku();P2=class{addToUnit(t,r){let n=this.unitMap.get(t);if(n)$n.add(n,r,r)&&this.elementCount++;else{let o=$n.create();$n.add(o,r,r),this.unitMap.set(t,o),this.ids[this.ids.length]=t,this.elementCount++}}has(t,r){let n=this.unitMap.get(t);return n?$n.has(n,r):!1}beginUnit(t){this.parentId=t,this.unitMap.has(t)?this.currentUnit=this.unitMap.get(t):this.currentUnit=this.currentUnit.array.length>0?$n.create():this.currentUnit}addElement(t){$n.add(this.currentUnit,t,t)&&this.elementCount++}commitUnit(){this.currentUnit.array.length===0||this.unitMap.has(this.parentId)||(this.ids[this.ids.length]=this.parentId,this.unitMap.set(this.parentId,this.currentUnit),this.parentId=-1)}getStructure(){if(this.isEmpty)return Oe.Empty;let t=[];Yl(this.ids);let r=Yd.UnitEquivalenceBuilder();for(let n=0,o=this.ids.length;n<o;n++){let i=this.ids[n],a=this.parent.unitMap.get(i),s=this.unitMap.get(i).array,l=s.length;if(s.length===a.elements.length){t[t.length]=a,r.add(a.id,a);continue}l>1&&Yl(s);let c=a.getChild(je.ofSortedArray(s)),u=r.add(c.id,c);c!==u&&(c=u.applyOperator(c.id,c.conformation.operator,!0)),t[t.length]=c}return Oe.create(t,{parent:this.parent})}get isEmpty(){return this.elementCount===0}constructor(t){this.parent=t,this.ids=[],this.unitMap=Pc.Mutable(),this.parentId=-1,this.currentUnit=$n.create(),this.elementCount=0}}});var b0e=M(()=>{});var x0e,S0e,_0e,gL,cx,lK=M(()=>{Tr();J1();x0e={type_symbol:G.Schema.Aliased(Dn.atom_site.type_symbol),label_atom_id:Dn.atom_site.label_atom_id,auth_atom_id:Dn.atom_site.auth_atom_id,label_alt_id:Dn.atom_site.label_alt_id,label_comp_id:Dn.atom_site.label_comp_id,auth_comp_id:Dn.atom_site.auth_comp_id,pdbx_formal_charge:Dn.atom_site.pdbx_formal_charge},S0e={group_PDB:Dn.atom_site.group_PDB,label_seq_id:Dn.atom_site.label_seq_id,auth_seq_id:Dn.atom_site.auth_seq_id,pdbx_PDB_ins_code:Dn.atom_site.pdbx_PDB_ins_code},_0e={label_asym_id:Dn.atom_site.label_asym_id,auth_asym_id:Dn.atom_site.auth_asym_id,label_entity_id:Dn.atom_site.label_entity_id};(function(e){function t(){return{label_entity_id:"",label_asym_id:"",auth_seq_id:0,pdbx_PDB_ins_code:void 0}}e.EmptyResidueKey=t})(gL||(gL={}));(function(e){function t(s,l){return s.residueAtomSegments.index[s.chainAtomSegments.offsets[l]]}e.chainStartResidueIndex=t;function r(s,l){return s.residueAtomSegments.index[s.chainAtomSegments.offsets[l+1]-1]+1}e.chainEndResidueIndexExcl=r;function n(s,l){return r(s,l)-t(s,l)}e.chainResidueCount=n;function o(s,l){return s.residueAtomSegments.offsets[l]}e.residueFirstAtomIndex=o;function i(s,l){return s.chainAtomSegments.index[l]}e.atomChainIndex=i;function a(s,l){return s.chainAtomSegments.index[s.residueAtomSegments.offsets[l]]}e.residueChainIndex=a})(cx||(cx={}))});var L0=M(()=>{b0e();lK();YW()});function DT(e,t,r,n){return{type:e,key:t,elements:r,getIndex:n}}var yL=M(()=>{});function Fut(){if(typeof File>"u"||pg){class e{arrayBuffer(){return this.blob.arrayBuffer()}slice(r,n,o){return this.blob.slice(r,n,o)}stream(){return this.blob.stream()}text(){return this.blob.text()}bytes(){return this.blob.bytes()}constructor(r,n,o){var i;this.blob=new Blob(r,o),this.size=this.blob.size,this.type=this.blob.type,this.name=n,this.lastModified=(i=o?.lastModified)!==null&&i!==void 0?i:0,this.webkitRelativePath=""}}return e}else return File}var pg,cK,vL=M(()=>{pg=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,cK=Fut()});function C0e(e){return e>>0}function F0(e,t){return e[t]|e[t+1]<<8}function ux(e,t,r){e[t]=r&255,e[t+1]=r>>8&255}function dx(e,t){return e[t+3]*(256*256*256)+(e[t+2]<<16|e[t+1]<<8|e[t])}function N0(e,t,r){e[t]=r&255,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255}function Nut(e,t,r){let n="";for(let o=0;o<r;o++)n+=String.fromCharCode(e[t+o]);return n}function Uut(e){return e.length<2?"0"+e:e}function w0e(e,t,r){let n="",o;for(let i=0;i<r;i++)n+="%"+Uut(e[t+i].toString(16));try{o=decodeURIComponent(n)}catch{return Nut(e,t,r)}return o}function T0e(e,t,r){let n=r.length,o=0;for(let i=0;i<n;i++){let a=r.charCodeAt(i);if((a&4294967168)===0)e[t+o]=a,o++;else if((a&4294965248)===0)e[t+o]=192|a>>6,e[t+o+1]=128|a>>0&63,o+=2;else if((a&4294901760)===0)e[t+o]=224|a>>12,e[t+o+1]=128|a>>6&63,e[t+o+2]=128|a>>0&63,o+=3;else if((a&4294967295-(1<<21)+1)===0)e[t+o]=240|a>>18,e[t+o+1]=128|a>>12&63,e[t+o+2]=128|a>>6&63,e[t+o+3]=128|a>>0&63,o+=4;else throw new Error("e")}return o}function uK(e){let t=e.length,r=0;for(let n=0;n<t;n++){let o=e.charCodeAt(n);if((o&4294967168)===0)r++;else if((o&4294965248)===0)r+=2;else if((o&4294901760)===0)r+=3;else if((o&4294967295-(1<<21)+1)===0)r+=4;else throw new Error("e")}return r}var A0e=M(()=>{});function zut(e,t,r,n){for(let o=0;o<n;o++)e=Vut[(e^t[r+o])&255]^e>>>8;return e}function dK(e,t,r){return zut(4294967295,e,t,r)^4294967295}var Vut,P0e=M(()=>{Vut=(function(){let e=new Uint32Array(256);for(let t=0;t<256;t++){let r=t;for(let n=0;n<8;n++)r&1?r=3988292384^r>>>1:r=r>>>1;e[t]=r}return e})()});function xL(e){if(bL[e]===void 0)try{new CompressionStream(e),bL[e]=!0}catch{bL[e]=!1}return!!bL[e]}function kT(e,t,r){let n=e.length,o=qt.rev15;for(let i=0;i<n;i+=2)if(e[i+1]!==0){let a=i>>1,s=e[i+1],l=a<<4|s,c=t-s,u=e[i]<<c,d=u+(1<<c);for(;u!==d;){let f=o[u]>>>15-t;r[f]=l,u++}}}function U0(e,t){let r=e.length,n=qt.bl_count;for(let a=0;a<=t;a++)n[a]=0;for(let a=1;a<r;a+=2)n[e[a]]++;let o=qt.next_code,i=0;n[0]=0;for(let a=1;a<=t;a++)i=i+n[a-1]<<1,o[a]=i;for(let a=0;a<r;a+=2){let s=e[a+1];s!==0&&(e[a]=o[s],o[s]++)}}function MT(e,t){let r=qt.rev15,n=15-t;for(let o=0;o<e.length;o+=2){let i=e[o]<<t-e[o+1];e[o]=r[i]>>>n}}var bL,qt,fK=M(()=>{bL={deflate:void 0,"deflate-raw":void 0,gzip:void 0};qt=(function(){let e=Uint16Array,t=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}})();(function(){for(let r=0;r<32768;r++){let n=r;n=(n&2863311530)>>>1|(n&1431655765)<<1,n=(n&3435973836)>>>2|(n&858993459)<<2,n=(n&4042322160)>>>4|(n&252645135)<<4,n=(n&4278255360)>>>8|(n&16711935)<<8,qt.rev15[r]=(n>>>16|n<<16)>>>17}function t(r,n,o){for(;n--!==0;)r.push(0,o)}for(let r=0;r<32;r++)qt.ldef[r]=qt.of0[r]<<3|qt.exb[r],qt.ddef[r]=qt.df0[r]<<4|qt.dxb[r];t(qt.fltree,144,8),t(qt.fltree,112,9),t(qt.fltree,24,7),t(qt.fltree,8,8),U0(qt.fltree,9),kT(qt.fltree,9,qt.flmap),MT(qt.fltree,9),t(qt.fdtree,32,5),U0(qt.fdtree,5),kT(qt.fdtree,5,qt.fdmap),MT(qt.fdtree,5),t(qt.itree,19,0),t(qt.ltree,286,0),t(qt.dtree,30,0),t(qt.ttree,320,0)})()});function qut(e,t){let r=t===void 0;return t===void 0&&(t=new Uint8Array(e.length>>>2<<3)),{data:e,buf:t,noBuf:r,BFINAL:0,off:0,pos:0}}function jut(e,t){let{data:r,noBuf:n}=e,{buf:o,BFINAL:i,off:a,pos:s}=e,l=0;for(;i===0&&l<t;){let c,u,d=0,f=0;i=pK(r,s,1),l+=1;let m=pK(r,s+1,2);if(s+=3,m===0){(s&7)!==0&&(s+=8-(s&7));let p=(s>>>3)+4,h=r[p-4]|r[p-3]<<8;n&&(o=mK(o,a+h)),o.set(new Uint8Array(r.buffer,r.byteOffset+p,h),a),s=p+h<<3,a+=h;continue}if(n&&(o=mK(o,a+(1<<17))),m===1)c=qt.flmap,u=qt.fdmap,d=511,f=31;else if(m===2){let p=fx(r,s,5)+257,h=fx(r,s+5,5)+1,g=fx(r,s+10,4)+4;s+=14;for(let C=0;C<38;C+=2)qt.itree[C]=0,qt.itree[C+1]=0;let y=1;for(let C=0;C<g;C++){let S=fx(r,s+C*3,3);qt.itree[(qt.ordr[C]<<1)+1]=S,S>y&&(y=S)}s+=3*g,U0(qt.itree,y),kT(qt.itree,y,qt.imap),c=qt.lmap,u=qt.dmap,s=Gut(qt.imap,(1<<y)-1,p+h,r,s,qt.ttree);let b=I0e(qt.ttree,0,p,qt.ltree);d=(1<<b)-1;let x=I0e(qt.ttree,p,h,qt.dtree);f=(1<<x)-1,U0(qt.ltree,b),kT(qt.ltree,b,c),U0(qt.dtree,x),kT(qt.dtree,x,u)}else throw new Error(`unknown BTYPE ${m}`);for(;;){let p=c[hK(r,s)&d];s+=p&15;let h=p>>>4;if(!(h>>>8))o[a++]=h;else{if(h===256)break;{let g=a+h-254;if(h>264){let S=qt.ldef[h-257];g=a+(S>>>3)+fx(r,s,S&7),s+=S&7}let y=u[hK(r,s)&f];s+=y&15;let b=y>>>4,x=qt.ddef[b],C=(x>>>4)+pK(r,s,x&15);for(s+=x&15,n&&(o=mK(o,a+(1<<17)));a<g;)o[a]=o[a++-C],o[a]=o[a++-C],o[a]=o[a++-C],o[a]=o[a++-C];a=g}}}}e.buf=o,e.BFINAL=i,e.off=a,e.pos=s}async function E0e(e,t,r){if(t[0]===3&&t[1]===0)return r||new Uint8Array(0);if(xL("deflate-raw")){let o=new DecompressionStream("deflate-raw"),a=new Blob([t]).stream().pipeThrough(o),s=0,l=[],c=a.getReader(),u=async()=>{let{done:d,value:f}=await c.read();if(!d)return e.shouldUpdate&&await e.update({message:"Inflating blocks...",current:s,max:r?.length}),r?r.set(f,s):l.push(f),s+=f.length,u()};if(await u(),!r){r=new Uint8Array(s);for(let d=0,f=0;d<l.length;d++)r.set(l[d],f),f+=l[d].length}return r}let n=qut(t,r);for(;n.BFINAL===0;)e.shouldUpdate&&await e.update({message:"Inflating blocks...",current:n.pos,max:t.length}),jut(n,100);return n.buf.length===n.off?n.buf:n.buf.slice(0,n.off)}function mK(e,t){let r=e.length;if(t<=r)return e;let n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n}function Gut(e,t,r,n,o,i){let a=0;for(;a<r;){let s=e[hK(n,o)&t];o+=s&15;let l=s>>>4;if(l<=15)i[a]=l,a++;else{let c=0,u=0;l===16?(u=3+fx(n,o,2),o+=2,c=i[a-1]):l===17?(u=3+fx(n,o,3),o+=3):l===18&&(u=11+fx(n,o,7),o+=7);let d=a+u;for(;a<d;)i[a]=c,a++}}return o}function I0e(e,t,r,n){let o=0,i=0,a=n.length>>>1;for(;i<r;){let s=e[i+t];n[i<<1]=0,n[(i<<1)+1]=s,s>o&&(o=s),i++}for(;i<a;)n[i<<1]=0,n[(i<<1)+1]=0,i++;return o}function fx(e,t,r){return(e[t>>>3]|e[(t>>>3)+1]<<8)>>>(t&7)&(1<<r)-1}function pK(e,t,r){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)&(1<<r)-1}function hK(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)}var D0e=M(()=>{fK()});function SL(e,t,r){let n=[],o=e.length,i=t.length;for(let p=0;p<i;p+=2)t[p]=0,t[p+1]=0;for(let p=0;p<o;p++)e[p]!==0&&n.push({lit:p,f:e[p],d:void 0});let a=n.length,s=n.slice(0);if(a===0)return 0;if(a===1){let p=n[0].lit,h=p===0?1:0;return t[(p<<1)+1]=1,t[(h<<1)+1]=1,1}n.sort(function(p,h){return p.f-h.f});let l=n[0],c=n[1],u=0,d=1,f=2;for(n[0]={lit:-1,f:l.f+c.f,l,r:c,d:0};d!==a-1;)u!==d&&(f===a||n[u].f<n[f].f)?l=n[u++]:l=n[f++],u!==d&&(f===a||n[u].f<n[f].f)?c=n[u++]:c=n[f++],n[d++]={lit:-1,f:l.f+c.f,l,r:c,d:void 0};let m=gK(n[d-1],0);m>r&&(Hut(s,r,m),m=r);for(let p=0;p<a;p++)t[(s[p].lit<<1)+1]=s[p].d;return m}function gK(e,t){return e.lit!==-1?(e.d=t,t):Math.max(gK(e.l,t+1),gK(e.r,t+1))}function Hut(e,t,r){let n=0,o=0,i=1<<r-t;for(e.sort(function(a,s){return s.d===a.d?a.f-s.f:s.d-a.d}),n=0;n<e.length&&e[n].d>t;n++){let a=e[n].d;e[n].d=t,o+=i-(1<<r-a)}for(o=o>>>r-t;o>0;){let a=e[n].d;a<t?(e[n].d++,o-=1<<t-a-1):n++}for(;n>=0;n--)e[n].d===t&&o<0&&(e[n].d--,o++);o!==0&&console.log("debt left")}var k0e=M(()=>{});function Wut(e,t,r,n){let{lits:o,strt:i,prev:a}=qt;return{data:e,out:t,opt:Yut[n],i:0,pos:r<<3,cvrd:0,dlen:e.length,li:0,lc:0,bs:0,ebits:0,c:0,nc:0,lits:o,strt:i,prev:a}}function Kut(e,t){let{data:r,dlen:n,out:o,opt:i}=e,{i:a,pos:s,cvrd:l,li:c,lc:u,bs:d,ebits:f,c:m,nc:p}=e,{lits:h,strt:g,prev:y}=qt,b=Math.min(a+t,n);for(;a<b;a++){if(m=p,a+1<n-2){p=yK(r,a+1);let x=a+1&32767;y[x]=g[p],g[p]=x}if(l<=a){(c>14e3||u>26697)&&n-a>100&&(l<a&&(h[c]=a-l,c+=2,l=a),s=L0e(a===n-1||l===n?1:0,h,c,f,r,d,a-d,o,s),c=u=f=0,d=a);let x=0;if(a<n-2&&(x=Xut(r,a,y,m,Math.min(i[2],n-a),i[3])),x!==0){let C=x>>>16,S=x&65535,w=R0e(C,qt.of0);qt.lhst[257+w]++;let A=R0e(S,qt.df0);qt.dhst[A]++,f+=qt.exb[w]+qt.dxb[A],h[c]=C<<23|a-l,h[c+1]=S<<16|w<<8|A,c+=2,l=a+C}else qt.lhst[r[a]]++;u++}}e.i=a,e.pos=s,e.cvrd=l,e.li=c,e.lc=u,e.bs=d,e.ebits=f,e.c=m,e.nc=p}async function O0e(e,t,r,n,o){if(xL("deflate-raw")){let p=new CompressionStream("deflate-raw"),y=new Blob([t]).stream().pipeThrough(p).getReader(),b=n,x=async()=>{let{done:C,value:S}=await y.read();if(!C)return e.shouldUpdate&&await e.update({message:"Deflating...",current:b,max:r.length}),r.set(S,b),b+=S.length,x()};return await x(),b}let i=Wut(t,r,n,o),{dlen:a}=i;if(o===0){let{i:p,pos:h}=i;for(;p<a;){let g=Math.min(65535,a-p);I2(r,h,p+g===a?1:0),h=F0e(t,p,g,r,h+8),p+=g}return h>>>3}for(a>2&&(i.nc=yK(t,0),i.strt[i.nc]=0);i.i<a;)e.shouldUpdate&&await e.update({message:"Deflating...",current:i.i,max:a}),Kut(i,1024*1024);let{li:s,cvrd:l,pos:c}=i,{i:u,lits:d,bs:f,ebits:m}=i;for((f!==u||t.length===0)&&(l<u&&(d[s]=u-l,s+=2,l=u),c=L0e(1,d,s,m,t,f,u-f,r,c));(c&7)!==0;)c++;return c>>>3}function Xut(e,t,r,n,o,i){let a=t&32767,s=r[a],l=a-s+32768&32767;if(s===a||n!==yK(e,t-l))return 0;let c=0,u=0,d=Math.min(32767,t);for(;l<=d&&--i!==0&&s!==a;){if(c===0||e[t+c]===e[t+c-l]){let f=Zut(e,t,l);if(f>c){if(c=f,u=l,c>=o)break;l+2<f&&(f=l+2);let m=0;for(let p=0;p<f-2;p++){let h=t-l+p+32768&32767,g=r[h],y=h-g+32768&32767;y>m&&(m=y,s=h)}}}a=s,s=r[a],l+=a-s+32768&32767}return c<<16|u}function Zut(e,t,r){if(e[t]!==e[t-r]||e[t+1]!==e[t+1-r]||e[t+2]!==e[t+2-r])return 0;let n=t,o=Math.min(e.length,t+258);for(t+=3;t<o&&e[t]===e[t-r];)t++;return t-n}function yK(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535}function L0e(e,t,r,n,o,i,a,s,l){qt.lhst[256]++;let[c,u,d,f,m,p,h,g]=$ut(),y=((l+3&7)===0?0:8-(l+3&7))+32+(a<<3),b=n+kD(qt.fltree,qt.lhst)+kD(qt.fdtree,qt.dhst),x=n+kD(qt.ltree,qt.lhst)+kD(qt.dtree,qt.dhst);x+=14+3*p+kD(qt.itree,qt.ihst)+(qt.ihst[16]*2+qt.ihst[17]*3+qt.ihst[18]*7);for(let S=0;S<286;S++)qt.lhst[S]=0;for(let S=0;S<30;S++)qt.dhst[S]=0;for(let S=0;S<19;S++)qt.ihst[S]=0;let C=y<b&&y<x?0:b<x?1:2;if(_L(s,l,e),_L(s,l+1,C),l+=3,C===0){for(;(l&7)!==0;)l++;l=F0e(o,i,a,s,l)}else{let S,w;if(C===1)S=qt.fltree,w=qt.fdtree;else if(C===2){U0(qt.ltree,c),MT(qt.ltree,c),U0(qt.dtree,u),MT(qt.dtree,u),U0(qt.itree,d),MT(qt.itree,d),S=qt.ltree,w=qt.dtree,I2(s,l,f-257),l+=5,I2(s,l,m-1),l+=5,I2(s,l,p-4),l+=4;for(let T=0;T<p;T++)I2(s,l+T*3,qt.itree[(qt.ordr[T]<<1)+1]);l+=3*p,l=M0e(h,qt.itree,s,l),l=M0e(g,qt.itree,s,l)}else Er(C);let A=i;for(let T=0;T<r;T+=2){let D=t[T],E=D>>>23,I=A+(D&(1<<23)-1);for(;A<I;)l=MD(o[A++],S,s,l);if(E!==0){let k=t[T+1],R=k>>16,B=k>>8&255,O=k&255;l=MD(257+B,S,s,l),I2(s,l,E-qt.of0[B]),l+=qt.exb[B],l=MD(O,w,s,l),_L(s,l,R-qt.df0[O]),l+=qt.dxb[O],A+=E}}l=MD(256,S,s,l)}return l}function F0e(e,t,r,n,o){let i=o>>>3;return n[i]=r,n[i+1]=r>>>8,n[i+2]=255-n[i],n[i+3]=255-n[i+1],i+=4,n.set(new Uint8Array(e.buffer,t,r),i),o+(r+4<<3)}function $ut(){let e=SL(qt.lhst,qt.ltree,15),t=SL(qt.dhst,qt.dtree,15),r=[],n=B0e(qt.ltree,r),o=[],i=B0e(qt.dtree,o);for(let l=0;l<r.length;l+=2)qt.ihst[r[l]]++;for(let l=0;l<o.length;l+=2)qt.ihst[o[l]]++;let a=SL(qt.ihst,qt.itree,7),s=19;for(;s>4&&qt.itree[(qt.ordr[s-1]<<1)+1]===0;)s--;return[e,t,a,n,i,s,r,o]}function kD(e,t){let r=0;for(let n=0;n<t.length;n++)r+=t[n]*e[(n<<1)+1];return r}function M0e(e,t,r,n){for(let o=0;o<e.length;o+=2){let i=e[o],a=e[o+1];n=MD(i,t,r,n);let s=i===16?2:i===17?3:7;i>15&&(I2(r,n,a),n+=s)}return n}function B0e(e,t){let r=e.length;for(;r!==2&&e[r-1]===0;)r-=2;for(let n=0;n<r;n+=2){let o=e[n+1],i=n+3<r?e[n+3]:-1,a=n+5<r?e[n+5]:-1,s=n===0?-1:e[n-1];if(o===0&&i===o&&a===o){let l=n+5;for(;l+2<r&&e[l+2]===o;)l+=2;let c=Math.min(l+1-n>>>1,138);c<11?t.push(17,c-3):t.push(18,c-11),n+=c*2-2}else if(o===s&&i===o&&a===o){let l=n+5;for(;l+2<r&&e[l+2]===o;)l+=2;let c=Math.min(l+1-n>>>1,6);t.push(16,c-3),n+=c*2-2}else t.push(o,0)}return r>>>1}function R0e(e,t){let r=0;return t[r|16]<=e&&(r|=16),t[r|8]<=e&&(r|=8),t[r|4]<=e&&(r|=4),t[r|2]<=e&&(r|=2),t[r|1]<=e&&(r|=1),r}function MD(e,t,r,n){return _L(r,n,t[e<<1]),n+t[(e<<1)+1]}function I2(e,t,r){r=r<<(t&7);let n=t>>>3;e[n]|=r,e[n+1]|=r>>>8}function _L(e,t,r){r=r<<(t&7);let n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16}var Yut,N0e=M(()=>{Oo();k0e();fK();Yut=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]]});async function BT(e,t,r=!1){let n=Object.create(null),o=new Uint8Array(t);if(F0(o,0)!==19280)throw new Error('Invalid ZIP file. A valid ZIP file must start with two magic bytes \\x50\\x4b ("PK" in ASCII).');let i=o.length-4;for(;dx(o,i)!==101010256;)i--;let a=i;a+=4,a+=4;let s=F0(o,a);a+=2,a+=2,a+=4;let l=dx(o,a);a+=4,a=l;for(let c=0;c<s;c++){a+=4,a+=4,a+=4,a+=4,a+=4,a+=4,a+=4;let u=F0(o,a),d=F0(o,a+2),f=F0(o,a+4);a+=6,a+=8;let m=dx(o,a);a+=4,a+=u+d+f,await Qut(e,o,m,n,r)}return n}async function Qut(e,t,r,n,o){r+=4,r+=2,r+=2;let i=F0(t,r);r+=2,r+=4,r+=4;let a=dx(t,r);r+=4;let s=dx(t,r);r+=4;let l=F0(t,r);r+=2;let c=F0(t,r);r+=2;let u=w0e(t,r,l);if(r+=l,r+=c,o){n[u]={size:s,csize:a};return}let d=new Uint8Array(t.buffer,r,a);if(i===0)n[u]=d;else if(i===8){let f=new Uint8Array(s);await V0e(e,d,f),n[u]=f}else throw new Error(`unknown compression method: ${i}`)}async function V0e(e,t,r){return E0e(e,t,r)}async function CL(e,t,r){let n=t[3],o=10;if(n&4){let u=F0(t,o);o+=u}if(n&8){let u=o;for(;t[u]!==0;)++u;o=u+1}if(n&16){let u=o;for(;t[u]!==0;)++u;o=u+1}n&1&&(o+=2);let i=C0e(dx(t,t.length-8)),a=dx(t,t.length-4);r===void 0&&(r=new Uint8Array(a));let s=new Uint8Array(t.buffer,t.byteOffset+o,t.length-o-8),l=await V0e(e,s,r),c=dK(l,0,l.length);return i!==c&&console.error("ungzip: checksums don't match"),l}async function Jut(e,t,r){r===void 0&&(r={level:6});let n=new Uint8Array(50+Math.floor(t.length*1.1)),o=await O0e(e,t,n,0,r.level);return new Uint8Array(n.buffer,0,o)}function z0e(e,t=!1){return Me.create("Zip",r=>BD(r,e,t))}async function BD(e,t,r=!1){let n=0,o={};for(let d in t){let f=!edt(d)&&!r,m=t[d],p=dK(m,0,m.length);o[d]={cpr:f,usize:m.length,crc:p,file:f?await Jut(e,m):m}}for(let d in o)n+=o[d].file.length+30+46+2*uK(d);n+=22;let i=new Uint8Array(n),a=0,s=[];for(let d in o){let f=o[d];s.push(a),a=U0e(i,a,d,f,0)}let l=0,c=a;for(let d in o){let f=o[d];s.push(a),a=U0e(i,a,d,f,1,s[l++])}let u=a-c;return N0(i,a,101010256),a+=4,a+=4,ux(i,a,l),a+=2,ux(i,a,l),a+=2,N0(i,a,u),a+=4,N0(i,a,c),a+=4,a+=2,i.buffer}function edt(e){let t=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(t)!==-1}function U0e(e,t,r,n,o,i=0){let a=n.file;N0(e,t,o===0?67324752:33639248),t+=4,o===1&&(t+=2),ux(e,t,20),t+=2,ux(e,t,0),t+=2,ux(e,t,n.cpr?8:0),t+=2,N0(e,t,0),t+=4,N0(e,t,n.crc),t+=4,N0(e,t,a.length),t+=4,N0(e,t,n.usize),t+=4,ux(e,t,uK(r)),t+=2,ux(e,t,0),t+=2,o===1&&(t+=2,t+=2,t+=6,N0(e,t,i),t+=4);let s=T0e(e,t,r);return t+=s,o===0&&(e.set(a,t),t+=a.length),t}var E2=M(()=>{A0e();P0e();D0e();N0e();hr()});function V0(e,t){return odt(e,t)}function RD(e){return typeof e=="string"?j0e(e,e,"string"):j0e(e.title,e.url,e.type||"string",e.body,e.headers)}function tdt(e){if(pg)throw new Error("`isDone` should not be used when running in Node.js");if(e instanceof FileReader)return e.readyState===FileReader.DONE;if(e instanceof XMLHttpRequest)return e.readyState===XMLHttpRequest.DONE;throw new Error("unknown data type")}function q0e(e){return e?"Failed to download data. Possible reasons: Resource is not available, or CORS is not allowed on the server.":"Failed to open file."}function K0e(e,t,r){if(pg)throw new Error("`readData` should not be used when running in Node.js");return new Promise((n,o)=>{if(tdt(r)){let{error:a}=r;a!=null?o(a??q0e(r instanceof XMLHttpRequest)):n(r);return}let i=!1;r.onerror=a=>{if(i)return;let{error:s}=a.target;o(s??q0e(r instanceof XMLHttpRequest))},r.onprogress=a=>{if(!(!e.shouldUpdate||i))try{a.lengthComputable?e.update({message:t,isIndeterminate:!1,current:a.loaded,max:a.total}):e.update({message:`${t} ${(a.loaded/1024/1024).toFixed(2)} MB`,isIndeterminate:!0})}catch(s){i=!0,o(s)}},r.onload=a=>{n(r)}})}function Y0e(e){return/\.gz$/i.test(e)?hg.Gzip:/\.zip$/i.test(e)?hg.Zip:hg.None}async function ndt(e,t,r){switch(r){case hg.None:return t;case hg.Gzip:return CL(e,t);case hg.Zip:let n=await BT(e,t.buffer),o=Object.keys(n).filter(i=>!rdt.test(i));if(o.length!==1)throw new Error("can only decompress zip files with a single entry");return n[o[0]]}}async function wL(e,t,r,n){if(t===null)throw new Error("no data given");let o=new Uint8Array(t);if(n!==hg.None&&r!=="zip"&&(o=await ndt(e,o,n)),r==="binary")return o;if(r==="zip")return await BT(e,o.buffer);if(r==="string")return X4(o);if(r==="xml")return new DOMParser().parseFromString(B0(o),"application/xml");if(r==="json")return JSON.parse(B0(o));throw new Error(`could not get requested response data '${r}'`)}function odt(e,t){if(pg)return idt(e,t);let r;return Me.create("Read File",async n=>{try{await n.update({message:"Opening file...",canAbort:!0}),r=new FileReader,r.readAsArrayBuffer(e);let i=(await K0e(n,"Reading...",r)).result;return await n.update({message:"Processing file...",canAbort:!1}),await wL(n,i,t,Y0e(e.name))}finally{r=void 0}},()=>{r&&r.abort()})}function idt(e,t){return Me.create("Read File",async r=>{await r.update({message:"Opening file...",canAbort:!1});let n=await e.arrayBuffer();return await r.update({message:"Processing file...",canAbort:!1}),await wL(r,n,t,Y0e(e.name))})}function adt(e,t){if(e.status>=200&&e.status<400){let{response:r}=e;if(D2.deposit(e),(t==="binary"||t==="zip")&&r instanceof ArrayBuffer)return new Uint8Array(r);if(t==="string"&&typeof r=="string")return r;if(t==="xml"&&r instanceof XMLDocument)return r;if(t==="json"&&typeof r=="object")return r;throw new Error(`could not get requested response data '${t}'`)}else throw D2.deposit(e),new Error(`Download failed with status code ${e.status}`)}function sdt(e){switch(e){case"json":return"json";case"xml":return"document";case"string":return"text";case"binary":return"arraybuffer";case"zip":return"arraybuffer"}}function j0e(e,t,r,n,o){if(pg)return t.startsWith("file://")?udt(e,t,r,n,o):ddt(e,t,r,n,o);let i;return Me.create(e||"Download",async a=>{if(i=D2.get(),i.open(n?"post":"get",t,!0),o)for(let[c,u]of o)i.setRequestHeader(c,u);i.responseType=sdt(r),i.send(n),await a.update({message:"Waiting for server...",canAbort:!0});let s=await K0e(a,"Downloading...",i);return i=void 0,await a.update({message:"Parsing response...",canAbort:!1}),adt(s,r)},()=>{i&&(i.abort(),i=void 0)})}function ldt(){if(!G0e)throw new Error("When running in Node.js and reading from files, call mol-util/data-source's setFSModule function first.");return G0e}function cdt(e){return new Promise((t,r)=>{ldt().readFile(e,(n,o)=>{n?r(n):t(o)})})}function udt(e,t,r,n,o){if(!pg)throw new Error("This function should only be used when running in Node.js");if(!t.startsWith("file://"))throw new Error("This function is only for URLs with protocol file://");return Me.create(e??"Download",async i=>{let a=t.substring(7);await i.update({message:"Loading file...",canAbort:!1});let s=await cdt(a);return await i.update({message:"Parsing response...",canAbort:!1}),await wL(i,s.buffer,r,hg.None)})}function ddt(e,t,r,n,o){if(!pg)throw new Error("This function should only be used when running in Node.js");let i=new AbortController;return Me.create(e??"Download",async a=>{await a.update({message:"Downloading...",canAbort:!0});let s=await fetch(t,{signal:i.signal});if(!(s.status>=200&&s.status<400))throw new Error(`Download failed with status code ${s.status}`);let l=await s.bytes();return await a.update({message:"Parsing response...",canAbort:!1}),await wL(a,l.buffer,r,hg.None)},()=>{i.abort()})}async function X0e(e,t,r,n){let o=r.length,i=new Array(r.length);await e.update({message:"Downloading...",current:0,max:o});let a=[],s=[],l=0;for(let u=Math.min(o,n);l<u;l++){let d=r[l];a.push(W0e(l,d.id,t.resolve(Un.getUrlAsset(t,d.url),d.isBinary?"binary":"string").runAsChild(e))),s.push(l)}let c=0;for(;a.length>0;){let u=await Promise.race(a),d=r[u.index],f=s.indexOf(u.index);if(c++,u.kind==="error"&&!d.canFail)throw new Error(`${d.url}: ${u.error}`);if(e.shouldUpdate&&await e.update({message:"Downloading...",current:c,max:o}),i[u.index]=u,a=a.filter(H0e,f),s=s.filter(H0e,f),l<o){let m=r[l],p=t.resolve(Un.getUrlAsset(t,m.url),m.isBinary?"binary":"string").runAsChild(e);a.push(W0e(l,m.id,p)),s.push(l),l++}}return i}function H0e(e,t){return this!==t}async function W0e(e,t,r){try{return{kind:"ok",result:await r,index:e,id:t}}catch(n){return{kind:"error",error:n,index:e,id:t}}}var hg,rdt,D2,G0e,OD=M(()=>{tx();hr();Lm();vL();E2();(function(e){e[e.None=0]="None",e[e.Gzip=1]="Gzip",e[e.Zip=2]="Zip"})(hg||(hg={}));rdt=/^(__MACOSX|.DS_Store)/;D2=class e{static get(){if(pg)throw new Error("`RequestPool.get` should not be used when running in Node.js");return this.pool.length?this.pool.pop():new XMLHttpRequest}static emptyFunc(){}static deposit(t){this.pool.length<this.poolSize&&(t.onabort=e.emptyFunc,t.onerror=e.emptyFunc,t.onload=e.emptyFunc,t.onprogress=e.emptyFunc,this.pool.push(t))}};D2.pool=[];D2.poolSize=15});var Un,TL,Lm=M(()=>{Qw();tn();OD();hr();vL();(function(e){function t(l,c){return{kind:"url",id:En.create22(),url:l,...c}}e.Url=t;function r(l){return{kind:"file",id:En.create22(),name:l.name,file:l}}e.File=r;function n(l){return l?.kind==="url"}e.isUrl=n;function o(l){return l?.kind==="file"}e.isFile=o;function i(l,c,u){return{data:l,dispose:()=>{u.release(c)}}}e.Wrapper=i;function a(l){return typeof l=="string"?l:l.url}e.getUrl=a;function s(l,c,u){return typeof c=="string"?l.tryFindUrl(c,u)||t(c,{body:u}):c}e.getUrlAsset=s})(Un||(Un={}));TL=class{constructor(){this._assets=new Map}get assets(){return sT(this._assets.values())}tryFindUrl(t,r){let n=this.assets.values();for(;;){let o=n.next();if(o.done)return;let i=o.value.asset;if(Un.isUrl(i)&&i.url===t&&(i.body||"")===(r||""))return i}}tryFindFilename(t){let r=this._assets.values();for(;;){let{done:n,value:o}=r.next();if(n)break;if(o.file.name===t)return o.asset}}set(t,r,n){this._assets.set(t.id,{asset:t,file:r,refCount:0,tag:n?.tag,isStatic:n?.isStatic})}get(t){return this._assets.get(t.id)}delete(t){return this._assets.delete(t.id)}has(t){return this._assets.has(t.id)}resolve(t,r,n=!0){return Un.isUrl(t)?Me.create(`Download ${t.title||t.url}`,async o=>{if(this._assets.has(t.id)){let s=this._assets.get(t.id);return s.refCount++,Un.Wrapper(await V0(s.file,r).runInContext(o),t,this)}if(!n)return Un.Wrapper(await RD({...t,type:r}).runInContext(o),t,this);let i=await RD({...t,type:"binary"}).runInContext(o),a=new cK([i],"raw-data");return this._assets.set(t.id,{asset:t,file:a,refCount:1}),Un.Wrapper(await V0(a,r).runInContext(o),t,this)}):Me.create(`Read ${t.name}`,async o=>{if(this._assets.has(t.id)){let i=this._assets.get(t.id);return i.refCount++,Un.Wrapper(await V0(i.file,r).runInContext(o),t,this)}if(!(t.file instanceof cK))throw new Error(`Cannot resolve file asset '${t.name}' (${t.id})`);return n&&this._assets.set(t.id,{asset:t,file:t.file,refCount:1}),Un.Wrapper(await V0(t.file,r).runInContext(o),t,this)})}release(t){let r=this._assets.get(t.id);r&&(r.refCount--,r.refCount<=0&&!r.isStatic&&this._assets.delete(t.id))}clearTag(t){let r=Array.from(this._assets.keys());for(let n of r){let o=this._assets.get(n);o&&o.tag===t&&this._assets.delete(n)}}clear(){this._assets.clear()}dispose(){this.clear()}}});var _,Ue=M(()=>{Vt();Ge();Aa();wc();km();Lm();(function(e){e.Essential={isEssential:!0};function t(re,ee){return ee&&(ee.label&&(re.label=ee.label),ee.description&&(re.description=ee.description),ee.legend&&(re.legend=ee.legend),ee.fieldLabels&&(re.fieldLabels=ee.fieldLabels),ee.isHidden&&(re.isHidden=ee.isHidden),ee.shortLabel&&(re.shortLabel=ee.shortLabel),ee.twoColumns&&(re.twoColumns=ee.twoColumns),ee.isEssential&&(re.isEssential=ee.isEssential),ee.category&&(re.category=ee.category),ee.hideIf&&(re.hideIf=ee.hideIf),ee.help&&(re.help=ee.help)),re}function r(re){let ee={...re};return ee.isOptional=!0,ee}e.Optional=r;function n(re,ee){return t({type:"value",defaultValue:re},ee)}e.Value=n;function o(re,ee,le){return t({type:"select",defaultValue:ye(re,ee),options:ee,cycle:le?.cycle},le)}e.Select=o;function i(re,ee,le){let pe=t({type:"multi-select",defaultValue:re,options:ee},le);return le?.emptyValue&&(pe.emptyValue=le.emptyValue),pe}e.MultiSelect=i;function a(re,ee){return t({type:"boolean",defaultValue:re},ee)}e.Boolean=a;function s(re="",ee){return t({type:"text",defaultValue:re,multiline:ee?.multiline,placeholder:ee?.placeholder,disableInteractiveUpdates:ee?.disableInteractiveUpdates},ee)}e.Text=s;function l(re,ee){let le=t({type:"color",defaultValue:re},ee);return ee?.isExpanded&&(le.isExpanded=ee.isExpanded),le}e.Color=l;function c(re,ee){let le;if(typeof re=="string"){let pe=Us(re);le={kind:pe.type!=="qualitative"?"interpolate":"set",colors:pe.list}}else le=re;return t({type:"color-list",presetKind:ee?.presetKind||"all",defaultValue:le,offsets:!!ee?.offsets},ee)}e.ColorList=c;function u(re,ee,le){return t(h({type:"vec3",defaultValue:re},ee),le)}e.Vec3=u;function d(re,ee){return t({type:"mat4",defaultValue:re},ee)}e.Mat4=d;function f(re,ee){let le=typeof re=="string"?Un.Url(re):Un.Url(re.url,{body:re.body});return t({type:"url",defaultValue:le},ee)}e.Url=f;function m(re){let ee=t({type:"file",defaultValue:null},re);return re?.accept&&(ee.accept=re.accept),ee}e.File=m;function p(re){let ee=t({type:"file-list",defaultValue:null},re);return re?.accept&&(ee.accept=re.accept),ee}e.FileList=p;function h(re,ee){return ee&&(typeof ee.min<"u"&&(re.min=ee.min),typeof ee.max<"u"&&(re.max=ee.max),typeof ee.step<"u"&&(re.step=ee.step)),re}function g(re,ee,le){let pe=t(h({type:"number",defaultValue:re},ee),le);return le?.immediateUpdate&&(pe.immediateUpdate=!0),pe}e.Numeric=g;function y(re,ee,le){return t(h({type:"interval",defaultValue:re},ee),le)}e.Interval=y;function b(re,ee){let le=t({type:"line-graph",defaultValue:re},ee);return ee?.getVolume&&(le.getVolume=ee.getVolume),le}e.LineGraph=b;function x(re,ee){let le=t({type:"group",defaultValue:ee?.customDefault||F(re),params:re},ee);return ee?.presets&&(le.presets=ee.presets),ee?.isExpanded&&(le.isExpanded=ee.isExpanded),ee?.isFlat&&(le.isFlat=ee.isFlat),ee?.pivot&&(le.pivot=ee.pivot),le}e.Group=x;function C(re){return x({},re)}e.EmptyGroup=C;function S(re,ee,le,pe){let ke=ye(re,ee);return t({type:"mapped",defaultValue:{name:ke,params:le(ke).defaultValue},select:o(ke,ee,pe),map:le},pe)}e.Mapped=S;function w(re,ee,le){let pe=le?.options?le.options:Object.keys(ee).map(Ve=>[Ve,ee[Ve].label||Ml(Ve)]),ke=ye(re,pe);return t({type:"mapped",defaultValue:{name:ke,params:ee[ke].defaultValue},select:o(ke,pe,le),map:Ve=>ee[Ve]},le)}e.MappedStatic=w;function A(re,ee,le){return t({type:"object-list",element:re,getLabel:ee,ctor:T,defaultValue:le?.defaultValue||[]},le)}e.ObjectList=A;function T(){return F(this.element)}function D(){throw new Error("getValue not set. Fix runtime.")}function E(re,ee,le){var pe;return t({type:"value-ref",defaultValue:{ref:(pe=le?.defaultRef)!==null&&pe!==void 0?pe:"",getValue:D},getOptions:re,resolveRef:ee},le)}e.ValueRef=E;function I(re){var ee;return t({type:"data-ref",defaultValue:{ref:(ee=re?.defaultRef)!==null&&ee!==void 0?ee:"",getValue:D}},re)}e.DataRef=I;function k(re,ee,le){return t({type:"converted",defaultValue:ee(le.defaultValue),converted:le,fromValue:re,toValue:ee},le)}e.Converted=k;function R(re,ee,le,pe,ke){let Ve=Object.keys(ee).map(Xe=>[Xe,Xe]);return t({type:"conditioned",select:o(le(re),Ve,ke),defaultValue:re,conditionParams:ee,conditionForValue:le,conditionedValue:pe},ke)}e.Conditioned=R;function B(re,ee){return t({type:"script",defaultValue:re},ee)}e.Script=B;function O(re){return 0}e.For=O;function F(re){let ee={};for(let le of Object.keys(re))re[le].isOptional||(ee[le]=re[le].defaultValue);return ee}e.getDefaultValues=F;function q(re,ee,le){return()=>re(ee,le)}function W(re,ee,le){if(ee){if(re.type==="value-ref"){let pe=ee;pe.ref?pe.getValue=q(re.resolveRef,pe.ref,le):pe.getValue=()=>{throw new Error("Unset ref in ValueRef value.")}}else if(re.type==="data-ref"){let pe=ee;pe.ref?pe.getValue=q(le,pe.ref,le):pe.getValue=()=>{throw new Error("Unset ref in ValueRef value.")}}else if(re.type==="group")V(re.params,ee,le);else if(re.type==="mapped"){let pe=ee,ke=re.map(pe.name);W(ke,pe.params,le)}else if(re.type==="object-list"){if(!L(re.element))return;for(let pe of ee)V(re.element,pe,le)}}}function j(re){if(re.type==="value-ref"||re.type==="data-ref")return!0;if(re.type==="group"){if(L(re.params))return!0}else if(re.type==="mapped"){for(let[ee]of re.select.options)if(j(re.map(ee)))return!0}else if(re.type==="object-list")return L(re.element);return!1}function L(re){for(let ee of Object.keys(re))if(j(re[ee]))return!0;return!1}function V(re,ee,le){for(let pe of Object.keys(re))W(re[pe],ee?.[pe],le)}e.resolveRefs=V;function U(re,ee){for(let le of Object.keys(re))re[le].isOptional||(re[le].defaultValue=ee[le])}e.setDefaultValues=U;function z(re){return ol(re)}e.clone=z;function ie(re,ee){}e.validate=ie;function oe(re,ee,le){if(ee===le)return!0;if(typeof ee!="object"||typeof le!="object")return!1;for(let pe of Object.keys(re))if(!X(re[pe],ee[pe],le[pe]))return!1;return!0}e.areEqual=oe;function X(re,ee,le){if(ee===le)return!0;if(re.type==="group")return oe(re.params,ee,le);if(re.type==="mapped"){let pe=ee,ke=le;if(pe.name!==ke.name)return!1;let Ve=re.map(pe.name);return X(Ve,pe.params,ke.params)}else if(re.type==="multi-select"){let pe=ee,ke=le;if(pe.length!==ke.length)return!1;if(pe.length<10){for(let Ve=0,Xe=pe.length;Ve<Xe;Ve++)if(pe[Ve]!==ke[Ve]&&ke.indexOf(pe[Ve])<0)return!1}else{let Ve=new Set(ke);for(let Xe=0,pt=pe.length;Xe<pt;Xe++)if(pe[Xe]!==ke[Xe]&&!Ve.has(pe[Xe]))return!1}return!0}else{if(re.type==="interval")return ee[0]===le[0]&&ee[1]===le[1];if(re.type==="line-graph"){let pe=ee,ke=le;if(pe.length!==ke.length)return!1;for(let Ve=0,Xe=pe.length;Ve<Xe;Ve++)if(!Ce.areEqual(pe[Ve],ke[Ve]))return!1;return!0}else{if(re.type==="vec3")return v.equals(ee,le);if(re.type==="mat4")return H.areEqual(ee,le,1e-6);if(re.type==="script"){let pe=ee,ke=le;return pe.language===ke.language&&pe.expression===ke.expression}else if(re.type==="object-list"){let pe=ee,ke=le,Ve=pe.length;if(Ve!==ke.length)return!1;for(let Xe=0;Xe<Ve;Xe++)if(!oe(re.element,pe[Xe],ke[Xe]))return!1;return!0}else if(typeof ee=="object"&&typeof le=="object")return T0(ee,le)}}return!1}e.isParamEqual=X;function Y(re,ee,le){if(ee===void 0)return{...le};if(le===void 0)return{...ee};let pe={};for(let ke of Object.keys(re))pe[ke]=ne(re[ke],ee[ke],le[ke]);return pe}e.merge=Y;function ne(re,ee,le){if(ee===void 0)return typeof le=="object"&&!Array.isArray(le)?{...le}:le;if(le===void 0)return typeof ee=="object"&&!Array.isArray(ee)?{...ee}:ee;if(re.type==="group")return Y(re.params,ee,le);if(re.type==="mapped"){let pe=ee,ke=le;if(pe.name!==ke.name)return{...ke};let Ve=re.map(ke.name);return{name:ke.name,params:ne(Ve,pe.params,ke.params)}}else return re.type==="value"?le:typeof ee=="object"&&typeof le=="object"?Array.isArray(le)?le:{...ee,...le}:le}e.mergeParam=ne;function K(re,ee){for(let le of re.options)if(le[0]===ee)return!0;return!1}function $(re,ee,le){if(ee==null)return le?re.defaultValue:void 0;if(re.type==="value")return ee;if(re.type==="group"){let pe={};for(let ke of Object.keys(re.params)){let Ve=re.params[ke];ee[ke]===void 0?le&&(pe[ke]=Ve.defaultValue):pe[ke]=$(Ve,ee[ke],le)}return pe}else if(re.type==="mapped"){let pe=ee;if(typeof pe.name!="string")return re.defaultValue;if(typeof pe.params>"u")return le?re.defaultValue:void 0;if(!K(re.select,pe.name))return re.defaultValue;let ke=re.map(pe.name);return{name:pe.name,params:$(ke,pe.params,le)}}else{if(re.type==="select")return K(re,ee)?ee:re.defaultValue;if(re.type==="multi-select"){if(!Array.isArray(ee))return re.defaultValue;let pe=ee.filter(function(ke){return K(this,ke)},re);return ee.length>0&&pe.length===0?re.defaultValue:pe}else if(re.type==="object-list")return Array.isArray(ee)?ee.map(pe=>Z(re.element,pe,le?"all":"skip")):re.defaultValue}return ee}function Z(re,ee,le){if(typeof ee!="object"||ee===null)return le?F(re):ee;let pe={};for(let ke of Object.keys(re)){let Ve=re[ke];ee[ke]===void 0?le==="all"&&(pe[ke]=Ve.defaultValue):pe[ke]=$(Ve,ee[ke],le!=="skip")}return pe}e.normalizeParams=Z;function de(re,ee){let le=[];for(let pe of Object.keys(re))if(!ee)typeof re[pe]=="string"?le.push([pe,re[pe]]):le.push([pe,ee===null?pe:Ml(pe)]);else{let ke=ee(pe,re[pe]);le.push(typeof ke=="string"?[pe,ke]:[pe,ke[0],ke[1]])}return le}e.objectToOptions=de;function Q(re,ee){let le=[];for(let pe of re)ee?le.push([pe,ee(pe)]):le.push([pe,ee===null?pe:Ml(pe)]);return le}e.arrayToOptions=Q;function ae(re,ee){for(let le of re.options)if(le[0]===ee)return le[1];return""}e.optionLabel=ae;function ye(re,ee){for(let le of ee)if(le[0]===re)return re;return ee.length>0?ee[0][0]:void 0}function we(re,ee){let le={};for(let pe of Object.keys(ee)){let ke=ee[pe];!re[pe]||ke===null||ke===void 0||re[pe].defaultValue===ke||(le[pe]={...re[pe],defaultValue:ke})}return{...re,...le}}e.withDefaults=we})(_||(_={}))});var _t,Fm,k2,mx=M(()=>{Vt();(function(e){e.is=Ka.has,e.create=Ka.create;let t;(function(r){r[r._=0]="_",r[r.H=1]="H",r[r.B=2]="B",r[r.E=4]="E",r[r.G=8]="G",r[r.I=16]="I",r[r.S=32]="S",r[r.T=64]="T",r[r.T3=128]="T3",r[r.T4=256]="T4",r[r.T5=512]="T5",r[r.T3S=1024]="T3S",r[r.T4S=2048]="T4S",r[r.T5S=4096]="T5S"})(t=e.Flag||(e.Flag={}))})(_t||(_t={}));(function(e){e[e.PARALLEL=0]="PARALLEL",e[e.ANTI_PARALLEL=1]="ANTI_PARALLEL"})(Fm||(Fm={}));k2=class{constructor(t,r,n){this.partner1=Math.min(t,r),this.partner2=Math.max(t,r),this.type=n}}});function Z0e(e){let{unit:t,flags:r,proteinInfo:n}=e,o=t.conformation,{traceElementIndex:i}=t.model.atomicHierarchy.derived.residue,{residueIndices:a,nIndices:s}=n,l=a.length,c=(y,b)=>y===-1?v.setNaN(b):o.position(y,b),u=v(),d=v(),f=v(),m=v(),p=v(),h=v(),g=v();e:for(let y=2;y<l-2;y++){for(let D=0;D<4;D++){let E=y+D-2;if(c(i[E],m),c(s[E+1],p),v.squaredDistance(m,p)>6.25)continue e}let b=a[y-2],x=a[y],C=a[y+2],S=i[b],w=i[x],A=i[C];c(S,u),c(w,d),c(A,f),v.sub(h,u,d),v.sub(g,d,f);let T=Bl(v.angle(h,g));T&&T>70&&(r[y]|=_t.Flag.S)}}var $0e=M(()=>{Ge();la();mx()});function pdt(e,t,r,n){let o=v.distance(e,n),i=v.distance(t,n),a=v.distance(t,r),s=v.distance(e,r),l=AL/o-AL/i,c=AL/a-AL/s,u=l+c;return u<Q0e?Q0e:u}function J0e(e,t,r){let{residueIndices:n,cIndices:o,hIndices:i,nIndices:a,oIndices:s}=t,{index:l}=e.model.atomicHierarchy,c=e.conformation,{traceElementIndex:u}=e.model.atomicHierarchy.derived.residue,d=n.length,f=[],m=[],p=[],h=v(),g=v(),y=v(),b=v(),x=v(),C=v(),S=v();for(let w=0,A=n.length;w<A;++w){let T=w,D=n[w],E=s[T],I=o[T],k=u[D];if(E===-1||I===-1||l.findAtomOnResidue(D,"OXT")!==-1)continue;c.invariantPosition(E,h),c.invariantPosition(I,g),c.invariantPosition(k,y);let{indices:R,count:B}=r.find(y[0],y[1],y[2],fdt);for(let O=0;O<B;++O){let F=R[O];if(F===T||F-1===T||F+1===T)continue;let q=a[F];if(q===-1)continue;c.invariantPosition(q,b);let W=i[F];if(W===-1){if(F===0)continue;let L=F-1,V=s[L],U=o[L];if(V===-1||U===-1)continue;c.invariantPosition(V,S),c.invariantPosition(U,C),v.sub(x,C,S);let z=v.distance(S,C);v.scaleAndAdd(x,b,x,1/z)}else c.invariantPosition(W,x);let j=pdt(h,g,b,x);j>mdt||(f[f.length]=T,m[m.length]=F,p[p.length]=j)}}return hdt(d,f,m,p)}function hdt(e,t,r,n){let o=new Ns.DirectedEdgeBuilder(e,t,r),i=new Float32Array(o.slotCount);for(let a=0,s=o.edgeCount;a<s;a++)o.addNextEdge(),o.assignProperty(i,n[a]);return o.createGraph({energies:n})}var fdt,AL,mdt,Q0e,eye=M(()=>{P0();Ge();fdt=9,AL=-27.888,mdt=-.5,Q0e=-9.9});function tye(e){let{proteinInfo:t,hbonds:r,flags:n}=e,o=[_t.Flag.T3S,_t.Flag.T4S,_t.Flag.T5S,_t.Flag.T3,_t.Flag.T4,_t.Flag.T5];for(let i=0;i<3;i++)for(let a=0,s=t.residueIndices.length-1;a<s;++a)if(r.getDirectedEdgeIndex(a,a+i+3)!==-1)if(n[a]|=o[i+3]|o[i],e.params.oldDefinition)for(let l=1;l<i+3;++l)n[a+l]|=o[i+3]|_t.Flag.T;else for(let l=0;l<=i+3;++l)n[a+l]|=o[i+3]|_t.Flag.T}var rye=M(()=>{mx()});function nye(e){let{proteinInfo:t,flags:r}=e,n=t.residueIndices.length,o=[_t.Flag.T3S,_t.Flag.T4S,_t.Flag.T5S,_t.Flag.T3,_t.Flag.T4,_t.Flag.T5],i=[0,0,0,_t.Flag.G,_t.Flag.H,_t.Flag.I],a=e.params.oldOrdering?[4,3,5]:[3,4,5];for(let s=0;s<a.length;s++){let l=a[s];for(let c=1,u=n-l;c<u;c++){let d=_t.create(r[c]),f=_t.create(r[c-1]),m=_t.create(r[c+1]);if(e.params.oldOrdering){if(l===3&&(_t.is(d,_t.Flag.H)||_t.is(m,_t.Flag.H))||l===5&&(_t.is(d,_t.Flag.H)||_t.is(d,_t.Flag.G)||_t.is(m,_t.Flag.H)||_t.is(m,_t.Flag.G)))continue}else if(l===4&&(_t.is(d,_t.Flag.G)||_t.is(m,_t.Flag.G))||l===5&&(_t.is(d,_t.Flag.H)||_t.is(d,_t.Flag.G)||_t.is(m,_t.Flag.H)||_t.is(m,_t.Flag.G)))continue;if(_t.is(d,o[l])&&_t.is(d,o[l-3])&&_t.is(f,o[l])&&_t.is(f,o[l-3]))if(e.params.oldDefinition)for(let p=0;p<l;p++)r[c+p]|=i[l];else for(let p=-1;p<=l;p++)r[c+p]|=i[l]}}}var oye=M(()=>{mx()});function gdt(e,t){if(t.type!==e.type||t.partner1!==e.firstEnd+1)return!1;if(t.type===Fm.PARALLEL){if(t.partner2===e.secondEnd+1)return!0}else if(t.partner2===e.secondStart-1)return!0;return!1}function ydt(e,t){return e.type===t.type&&t.firstStart-e.firstEnd<6&&e.firstStart<t.firstStart&&t.nextLadder===0?e.type===Fm.PARALLEL?iye(e,t):iye(t,e):!1}function iye(e,t){return t.secondStart-e.secondEnd>0&&(t.secondStart-e.secondEnd<6&&t.firstStart-e.firstEnd<3||t.secondStart-e.secondEnd<3)}function aye(e){let{bridges:t,ladders:r}=e;for(let n=0;n<t.length;n++){let o=t[n],i=!1;for(let a=0;a<r.length;a++){let s=r[a];gdt(s,o)&&(i=!0,s.firstEnd++,o.type===Fm.PARALLEL?s.secondEnd++:s.secondStart--)}i||(r[r.length]={previousLadder:0,nextLadder:0,firstStart:o.partner1,firstEnd:o.partner1,secondStart:o.partner2,secondEnd:o.partner2,type:o.type})}for(let n=0;n<r.length;n++){let o=r[n];for(let i=n;i<r.length;i++){let a=r[i];ydt(o,a)&&(o.nextLadder=i,a.previousLadder=n)}}}var sye=M(()=>{mx()});function lye(e){let{proteinInfo:t,hbonds:r,flags:n,bridges:o}=e,{offset:i,b:a}=r,s,l;for(let c=0,u=t.residueIndices.length;c<u;++c)for(let d=i[c],f=i[c+1];d<f;d++){let m=a[d];c>m||(s=c+1,l=m,s!==l&&r.getDirectedEdgeIndex(l,s+1)!==-1&&(n[s]|=_t.Flag.B,n[l]|=_t.Flag.B,o[o.length]=new k2(s,l,Fm.PARALLEL)),s=c,l=m-1,s!==l&&r.getDirectedEdgeIndex(l-1,s)!==-1&&(n[s]|=_t.Flag.B,n[l]|=_t.Flag.B,o[o.length]=new k2(l,s,Fm.PARALLEL)),s=c,l=m,s!==l&&r.getDirectedEdgeIndex(l,s)!==-1&&(n[s]|=_t.Flag.B,n[l]|=_t.Flag.B,o[o.length]=new k2(l,s,Fm.ANTI_PARALLEL)),s=c+1,l=m-1,s!==l&&r.getDirectedEdgeIndex(l-1,s+1)!==-1&&(n[s]|=_t.Flag.B,n[l]|=_t.Flag.B,o[o.length]=new k2(l,s,Fm.ANTI_PARALLEL)))}o.sort((c,u)=>c.partner1>u.partner1?1:c.partner1<u.partner1?-1:0)}var cye=M(()=>{mx()});function uye(e){return _t.is(e,_t.Flag.G)||_t.is(e,_t.Flag.H)||_t.is(e,_t.Flag.I)}function dye(e){let{ladders:t,flags:r}=e;for(let n=0;n<t.length;n++){let o=t[n];for(let a=o.firstStart;a<=o.firstEnd;a++){let s=o.firstStart-a,l=o.secondStart-s;o.firstStart!==o.firstEnd?(r[a]|=_t.Flag.E,r[l]|=_t.Flag.E):(!uye(r[a])&&_t.is(r[a],_t.Flag.E)&&(r[a]|=_t.Flag.B),!uye(r[l])&&_t.is(r[l],_t.Flag.E)&&(r[l]|=_t.Flag.B))}if(o.nextLadder===0)continue;let i=t[o.nextLadder];for(let a=o.firstStart;a<=i.firstEnd;a++)r[a]|=_t.Flag.E;if(o.type===Fm.PARALLEL)for(let a=o.secondStart;a<=i.secondEnd;a++)r[a]|=_t.Flag.E;else for(let a=i.secondEnd;a<=o.secondStart;a++)r[a]|=_t.Flag.E}}var fye=M(()=>{mx()});function mye(e,t){let{cIndices:r,nIndices:n,residueIndices:o}=t,i=e.conformation,{index:a}=e.model.atomicHierarchy,{traceElementIndex:s}=e.model.atomicHierarchy.derived.residue,l=o.length,c=(S,w)=>S===-1?v.setNaN(w):i.position(S,w),u=v(),d=v(),f=v(),m=v(),p=v(),h=v(),g=v(),y=v(),b=v();if(l===0)return{phi:new Float32Array(0),psi:new Float32Array(0)};let x=new Float32Array(l-1),C=new Float32Array(l-1);c(-1,u),c(-1,d),c(-1,f),c(r[0],m),c(s[o[0]],p),c(n[0],h),c(r[1],g),c(s[o[1]],y),c(n[1],b);for(let S=0;S<l-1;++S)a.findAtomOnResidue(o[S],"OXT")===-1&&(x[S]=Bl(v.dihedralAngle(u,h,p,m)),C[S]=Bl(v.dihedralAngle(h,p,m,b)),u=m,d=p,f=h,m=g,p=y,h=b,c(r[S+1],g),c(s[o[S+1]],y),c(n[S+1],b));return{phi:x,psi:C}}var pye=M(()=>{Ge();la()});function hye(e,t){let{x:r,y:n,z:o}=e.model.atomicConformation,{traceElementIndex:i}=e.model.atomicHierarchy.derived.residue,a=new Uint32Array(t.length);for(let l=0,c=t.length;l<c;++l)a[l]=i[t[l]];let s={x:r,y:n,z:o,indices:je.ofSortedArray(a)};return Kd(s,fg(s))}var gye=M(()=>{or();Ut();TD()});function yye(e){let{index:t}=e.model.atomicHierarchy,{proteinElements:r,residueIndex:n}=e,o=r.length,i=new Uint32Array(o),a=new Int32Array(o),s=new Int32Array(o),l=new Int32Array(o),c=new Int32Array(o);for(let u=0;u<o;++u){let d=n[r[u]];i[u]=d,a[u]=t.findAtomOnResidue(d,"C"),s[u]=t.findAtomOnResidue(d,"H"),l[u]=t.findAtomOnResidue(d,"O"),c[u]=t.findAtomOnResidue(d,"N")}return{residueIndices:je.ofSortedArray(i),cIndices:a,hIndices:s,oIndices:l,nIndices:c}}var vye=M(()=>{Ut()});async function bK(e,t){let r=yye(e),{residueIndices:n}=r,o=hye(e,n),i=J0e(e,r,o),a=n.length,s=new Uint32Array(a),l=mye(e,r),c=[],u=[],d=t.oldDefinition?xdt:_dt,f=t.oldOrdering?Sdt:Cdt,m={params:t,getResidueFlag:d,getFlagName:f,unit:e,proteinInfo:r,flags:s,hbonds:i,torsionAngles:l,ladders:c,bridges:u};tye(m),nye(m),Z0e(m),lye(m),aye(m),dye(m);let p=wdt(s,d),h=new Uint32Array(a),g=[],y=[],b=x=>je.indexOf(n,x);for(let x=0,C=n.length;x<C;++x){let S=p[x];h[x]=S;let w=d(s[x]);(y.length===0||w!==y[y.length-1].flags)&&(y[y.length]=vdt(bdt(S),s[x],d)),g[x]=y.length-1}return DT(h,g,y,b)}function vdt(e,t,r){return e==="helix"?{kind:"helix",flags:r(t)}:e==="sheet"?{kind:"sheet",flags:r(t)}:e==="turn"||e==="bend"?{kind:"turn",flags:r(t)}:{kind:"none"}}function bdt(e){return e===cr.SecondaryStructureDssp.H||e===cr.SecondaryStructureDssp.G||e===cr.SecondaryStructureDssp.I?"helix":e===cr.SecondaryStructureDssp.B||e===cr.SecondaryStructureDssp.E?"sheet":e===cr.SecondaryStructureDssp.T?"turn":e===cr.SecondaryStructureDssp.S?"bend":"none"}function xdt(e){return _t.is(e,_t.Flag.H)?cr.SecondaryStructureDssp.H:_t.is(e,_t.Flag.E)?cr.SecondaryStructureDssp.E:_t.is(e,_t.Flag.B)?cr.SecondaryStructureDssp.B:_t.is(e,_t.Flag.G)?cr.SecondaryStructureDssp.G:_t.is(e,_t.Flag.I)?cr.SecondaryStructureDssp.I:_t.is(e,_t.Flag.T)?cr.SecondaryStructureDssp.T:_t.is(e,_t.Flag.S)?cr.SecondaryStructureDssp.S:cr.Flag.None}function Sdt(e){return _t.is(e,_t.Flag.H)?"H":_t.is(e,_t.Flag.E)?"E":_t.is(e,_t.Flag.B)?"B":_t.is(e,_t.Flag.G)?"G":_t.is(e,_t.Flag.I)?"I":_t.is(e,_t.Flag.T)?"T":_t.is(e,_t.Flag.S)?"S":"-"}function _dt(e){return _t.is(e,_t.Flag.I)?cr.SecondaryStructureDssp.I:_t.is(e,_t.Flag.H)?cr.SecondaryStructureDssp.H:_t.is(e,_t.Flag.E)?cr.SecondaryStructureDssp.E:_t.is(e,_t.Flag.B)?cr.SecondaryStructureDssp.B:_t.is(e,_t.Flag.G)?cr.SecondaryStructureDssp.G:_t.is(e,_t.Flag.T)?cr.SecondaryStructureDssp.T:_t.is(e,_t.Flag.S)?cr.SecondaryStructureDssp.S:cr.Flag.None}function Cdt(e){return _t.is(e,_t.Flag.I)?"I":_t.is(e,_t.Flag.H)?"H":_t.is(e,_t.Flag.E)?"E":_t.is(e,_t.Flag.B)?"B":_t.is(e,_t.Flag.G)?"G":_t.is(e,_t.Flag.T)?"T":_t.is(e,_t.Flag.S)?"S":"-"}function wdt(e,t){let r=new Uint32Array(e.length);for(let n=0,o=e.length;n<o;++n){let i=_t.create(e[n]);r[n]=t(i)}return r}var vK,bye,xye=M(()=>{yL();Br();Ue();$0e();eye();mx();rye();oye();sye();cye();fye();pye();gye();vye();Ut();vK={oldDefinition:_.Boolean(!0,{description:"Whether to use the old DSSP convention for the annotation of turns and helices, causes them to be two residues shorter"}),oldOrdering:_.Boolean(!0,{description:"Alpha-helices are preferred over 3-10 helices"})},bye=_.getDefaultValues(vK)});var Xd,M2=M(()=>{Ue();Vt();Fs();wc();(function(e){function t(n){let o=n.descriptor.name,i=n.type==="root"?"inheritedPropertyData":"currentPropertyData",a=l=>(o in l[i]||(l[i][o]={props:{..._.getDefaultValues(n.getParams(l))},data:w0.create(void 0)}),l[i][o]),s=(l,c,u)=>{let d=a(l);l[i][o]={props:c,data:w0.withValue(d.data,u)}};return{label:n.label,descriptor:n.descriptor,isHidden:n.isHidden,getParams:l=>{let c=_.clone(n.getParams(l));return _.setDefaultValues(c,a(l).props),c},defaultParams:n.defaultParams,isApplicable:n.isApplicable,attach:async(l,c,u={},d)=>{d&&c.customPropertyDescriptors.reference(n.descriptor,!0),n.type==="root"&&(c=c.root);let f=a(c.root).props,m=a(c),p=_.merge(n.defaultParams,f,u);if(m.data.value&&_.areEqual(n.defaultParams,m.props,p))return;let{value:h,assets:g}=await n.obtain(l,c,p);c.customPropertyDescriptors.add(n.descriptor),c.customPropertyDescriptors.assets(n.descriptor,g),s(c,p,h)},ref:(l,c)=>l.customPropertyDescriptors.reference(n.descriptor,c),get:l=>a(l).data,set:(l,c={},u)=>{n.type==="root"&&(l=l.root);let d=a(l),f=_.merge(n.defaultParams,d.props,c);_.areEqual(n.defaultParams,d.props,f)||(s(l,f,u),l.customPropertyDescriptors.assets(n.descriptor))},props:l=>a(l).props}}e.createProvider=t;function r(n,o,i){let a={value:_.Value(i,{isHidden:!0})};return t({label:Ml(n),descriptor:ss({name:n}),isHidden:!0,type:o,defaultParams:a,getParams:()=>({value:_.Value(i,{isHidden:!0})}),isApplicable:()=>!0,obtain:async(s,l,c)=>({..._.getDefaultValues(a),...c})})}e.createSimple=r})(Xd||(Xd={}))});function Tdt(e,t){if(e._rowCount>0){if(e.beg_label_seq_id.valueKind(0)!==G.ValueKinds.Present||e.end_label_seq_id.valueKind(0)!==G.ValueKinds.Present)return"auth"}else if(t&&(t.beg_label_seq_id.valueKind(0)!==G.ValueKinds.Present||t.end_label_seq_id.valueKind(0)!==G.ValueKinds.Present))return"auth";return"label"}function Adt(e,t,r,n){if(!e._rowCount)return;let{beg_label_asym_id:o,beg_label_seq_id:i,beg_auth_seq_id:a,pdbx_beg_PDB_ins_code:s}=e,{end_label_seq_id:l,end_auth_seq_id:c,pdbx_end_PDB_ins_code:u}=e,{pdbx_PDB_helix_class:d,conf_type_id:f,details:m}=e,p=t==="label"?i:a,h=t==="label"?l:c;for(let g=0,y=e._rowCount;g<y;g++){let b=cr.create(d.valueKind(g)===G.ValueKinds.Present?cr.SecondaryStructurePdb[d.value(g)]:f.valueKind(g)===G.ValueKinds.Present?cr.SecondaryStructureMmcif[f.value(g)]:cr.Flag.NA),x={kind:"helix",flags:b,type_id:f.valueKind(g)===G.ValueKinds.Present?f.value(g):"helx_p",helix_class:d.value(g),details:m.valueKind(g)===G.ValueKinds.Present?m.value(g):void 0},C={startSeqId:p.value(g),startInsCode:s.value(g),endSeqId:h.value(g),endInsCode:u.value(g),type:b,key:n.length};n[n.length]=x;let S=o.value(g);if(r.has(S)){let w=r.get(S);w.has(C.startSeqId)?w.get(C.startSeqId).push(C):w.set(C.startSeqId,[C])}else r.set(S,new Map([[C.startSeqId,[C]]]))}}function Pdt(e,t,r,n,o){if(!e._rowCount)return;let{beg_label_asym_id:i,beg_label_seq_id:a,beg_auth_seq_id:s,pdbx_beg_PDB_ins_code:l}=e,{end_label_seq_id:c,end_auth_seq_id:u,pdbx_end_PDB_ins_code:d}=e,{sheet_id:f}=e,m=t==="label"?a:s,p=t==="label"?c:u,h=new Map,g=n+1;for(let y=0,b=e._rowCount;y<b;y++){let x=f.value(y),C;h.has(x)?C=h.get(x):(C=g++,h.set(x,C));let S=cr.create(cr.Flag.Beta|cr.Flag.BetaSheet),w={kind:"sheet",flags:S,sheet_id:x,symmetry:void 0},A={startSeqId:m.value(y),startInsCode:l.value(y),endSeqId:p.value(y),endInsCode:d.value(y),type:S,key:o.length};o[o.length]=w;let T=i.value(y);if(r.has(T)){let D=r.get(T);D.has(A.startSeqId)?D.get(A.startSeqId).push(A):D.set(A.startSeqId,[A])}else r.set(T,new Map([[A.startSeqId,[A]]]))}}function Idt(e,t,r,n,o,i){let{auth_seq_id:a,label_seq_id:s,pdbx_PDB_ins_code:l}=e.residues,{endSeqId:c,endInsCode:u,key:d,type:f}=r,m=t==="label"?s:a,p=n;for(;p<o;){let h=m.value(p);if(i.type[p]=f,i.key[p]=d,h>c||h===c&&l.value(p)===u)break;p++}}function Edt(e,t,r,n){let{count:o}=e.chainAtomSegments,{label_asym_id:i}=e.chains,{auth_seq_id:a,label_seq_id:s,pdbx_PDB_ins_code:l}=e.residues,c=t==="label"?s:a;for(let u=0;u<o;u++){let d=cx.chainStartResidueIndex(e,u),f=cx.chainEndResidueIndexExcl(e,u),m=i.value(u);if(r.has(m)){let p=r.get(m);for(let h=d;h<f;h++){let g=c.value(h);if(p.has(g)){let y=p.get(g);for(let b of y){let x=l.value(h);b.startInsCode===x&&Idt(e,t,b,h,f,n)}}}}}}var gg,LD=M(()=>{Br();L0();yL();Tr();I0();(function(e){e.Descriptor={name:"model_secondary_structure"},e.Provider=Xl.create(e.Descriptor);function t(r,n,o){let i=new Map,a=[{kind:"none"}],s=Tdt(r,n);Adt(r,s,i,a),Pdt(n,s,i,r._rowCount,a);let l=o.residues._rowCount,c=d=>d,u={type:new Int32Array(l),key:new Int32Array(l),elements:a};return i.size>0&&Edt(o,s,i,u),DT(u.type,u.key,u.elements,c)}e.fromStruct=t})(gg||(gg={}))});function Cye(e,t,r,n,o){let i=e.conformation,{traceElementIndex:a}=e.model.atomicHierarchy.derived.residue;for(let s=Math.max(0,r-2);s<=r;++s)for(let l=2;l<5;++l){if(s+l>=t.length)return!1;let c=t[s],u=t[s+l],d=a[c],f=a[u];if(d===-1||f===-1)return!1;i.invariantPosition(d,Sye),i.invariantPosition(f,_ye);let m=v.distance(Sye,_ye);if(Math.abs(m-n[l-2])>=o)return!1}return!0}async function xK(e){let t=e.proteinElements.length,r=new Uint32Array(t),n=[],o=[],{proteinElements:i,residueIndex:a}=e,s=i.length,l=new Uint32Array(s);for(let d=0;d<s;++d){let f=a[i[d]];l[d]=f}let c=je.ofSortedArray(l),u=d=>je.indexOf(c,d);for(let d=0,f=c.length;d<f;++d){let m=cr.Flag.None;Cye(e,c,d,Ddt,kdt)?m=cr.Flag.Helix:Cye(e,c,d,Mdt,Bdt)&&(m=cr.Flag.Beta),r[d]=m,(o.length===0||m!==Ldt(o[o.length-1]))&&(o[o.length]=Rdt(Odt(m),m)),n[d]=o.length-1}return DT(r,n,o,u)}function Rdt(e,t){return e==="helix"?{kind:"helix",flags:t}:e==="sheet"?{kind:"sheet",flags:t}:{kind:"none"}}function Odt(e){return e===cr.Flag.Helix?"helix":e===cr.Flag.Beta?"sheet":"none"}function Ldt(e){return e.kind==="helix"||e.kind==="sheet"?e.flags:cr.Flag.None}var Ddt,kdt,Mdt,Bdt,Sye,_ye,wye=M(()=>{yL();Br();Ut();$i();Ddt=[5.45,5.18,6.37],kdt=2.1,Mdt=[6.1,10.4,13],Bdt=1.42,Sye=v(),_ye=v()});function Aye(e){return{type:_.MappedStatic("auto",{auto:_.EmptyGroup({label:"Automatic"}),model:_.EmptyGroup({label:"Model"}),dssp:_.Group(vK,{label:"DSSP",isFlat:!0}),"zhang-skolnick":_.EmptyGroup({label:"Zhang-Skolnick"})},{options:[["auto","Automatic"],["model","Model"],["dssp","DSSP"],["zhang-skolnick","Zhang-Skolnick"]]})}}async function Fdt(e){let t=new Map;for(let r=0,n=e.unitSymmetryGroups.length;r<n;++r){let o=e.unitSymmetryGroups[r].units[0],i=o.model;if(Ht.isFromPdbArchive(i)&&Ht.isExperimental(i)&&!Ht.isCoarseGrained(i)||Ht.hasSecondaryStructure(i)){let a=gg.Provider.get(i);a&&t.set(o.invariantId,a)}else if(fe.isAtomic(o)&&!Ht.isCoarseGrained(i)){let a=await bK(o,bye);t.set(o.invariantId,a)}else if(fe.isAtomic(o)){let a=await xK(o);t.set(o.invariantId,a)}}return t}async function Ndt(e,t){let r=new Map;for(let n=0,o=e.unitSymmetryGroups.length;n<o;++n){let i=e.unitSymmetryGroups[n].units[0];if(fe.isAtomic(i)&&!Ht.isCoarseGrained(i.model)){let a=await bK(i,t);r.set(i.invariantId,a)}}return r}async function Udt(e){let t=new Map;for(let r=0,n=e.unitSymmetryGroups.length;r<n;++r){let o=e.unitSymmetryGroups[r].units[0];if(fe.isAtomic(o)){let i=await xK(o);t.set(o.invariantId,i)}}return t}async function Vdt(e){let t=new Map;for(let r=0,n=e.unitSymmetryGroups.length;r<n;++r){let o=e.unitSymmetryGroups[r].units[0];if(fe.isAtomic(o)){let i=gg.Provider.get(o.model);i&&t.set(o.invariantId,i)}}return t}var Tye,$l,px=M(()=>{xye();Ue();zs();M2();LD();Fs();nx();wye();Tye=Aye(),$l=Xd.createProvider({label:"Secondary Structure",descriptor:ss({name:"molstar_computed_secondary_structure"}),type:"root",defaultParams:Tye,getParams:Aye,isApplicable:e=>!0,obtain:async(e,t,r)=>{let n={..._.getDefaultValues(Tye),...r};switch(n.type.name){case"auto":return{value:await Fdt(t)};case"dssp":return{value:await Ndt(t,n.type.params)};case"model":return{value:await Vdt(t)};case"zhang-skolnick":return{value:await Udt(t)}}}})});function xs(){throw new Error("Property only available for atomic models.")}function sb(e){throw e?new Error(`Property only available for coarse models (${e}).`):new Error("Property only available for coarse models.")}function PL(e){return fe.isAtomic(e.unit)||xs(),e.unit.model.atomicHierarchy.atoms.label_comp_id.value(e.element)}function SK(e){return fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.label_seq_id.value(e.unit.residueIndex[e.element]):xs()}function qdt(e){fe.isAtomic(e.unit)||xs();let t=e.unit.model.sequence.byEntityKey[ud(e)];return t&&t.sequence.microHet.has(SK(e))}function Pye(e){fe.isAtomic(e.unit)||xs();let t=e.unit.model.sequence.byEntityKey[ud(e)];return t?t.sequence.microHet.get(SK(e))||[PL(e)]:[PL(e)]}function ud(e){switch(e.unit.kind){case fe.Kind.Atomic:return e.unit.model.atomicHierarchy.index.getEntityFromChain(e.unit.chainIndex[e.element]);case fe.Kind.Spheres:return e.unit.model.coarseHierarchy.spheres.entityKey[e.element];case fe.Kind.Gaussians:return e.unit.model.coarseHierarchy.gaussians.entityKey[e.element]}}var zdt,FD,jdt,Gdt,Hdt,Wdt,Kdt,Ydt,nt,lb=M(()=>{sd();L0();Br();px();or();zdt={true:e=>!0,false:e=>!1,zero:e=>0};FD={key:e=>e.element,x:e=>e.unit.conformation.x(e.element),y:e=>e.unit.conformation.y(e.element),z:e=>e.unit.conformation.z(e.element),id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicConformation.atomId.value(e.element):xs(),occupancy:e=>fe.isAtomic(e.unit)?e.unit.model.atomicConformation.occupancy.value(e.element):xs(),B_iso_or_equiv:e=>fe.isAtomic(e.unit)?e.unit.model.atomicConformation.B_iso_or_equiv.value(e.element):xs(),sourceIndex:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atomSourceIndex.value(e.element):e.element,type_symbol:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.type_symbol.value(e.element):xs(),label_atom_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.label_atom_id.value(e.element):xs(),auth_atom_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.auth_atom_id.value(e.element):xs(),label_alt_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.label_alt_id.value(e.element):xs(),label_comp_id:PL,auth_comp_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.auth_comp_id.value(e.element):xs(),pdbx_formal_charge:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.atoms.pdbx_formal_charge.value(e.element):xs(),vdw_radius:e=>fe.isAtomic(e.unit)?R0(e.unit.model.atomicHierarchy.atoms.type_symbol.value(e.element)):xs()};jdt={key:e=>fe.isAtomic(e.unit)?e.unit.residueIndex[e.element]:xs(),group_PDB:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.group_PDB.value(e.unit.residueIndex[e.element]):xs(),label_seq_id:SK,auth_seq_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.auth_seq_id.value(e.unit.residueIndex[e.element]):xs(),pdbx_PDB_ins_code:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.residues.pdbx_PDB_ins_code.value(e.unit.residueIndex[e.element]):xs(),isNonStandard:e=>fe.isAtomic(e.unit)?Pye(e).some(t=>e.unit.model.properties.chemicalComponentMap.get(t).mon_nstd_flag[0]==="n"):xs(),hasMicroheterogeneity:qdt,microheterogeneityCompIds:Pye,secondary_structure_type:e=>{var t;fe.isAtomic(e.unit)||xs();let r=(t=$l.get(e.structure).value)===null||t===void 0?void 0:t.get(e.unit.invariantId);return r?r.type[r.getIndex(e.unit.residueIndex[e.element])]:cr.Flag.NA},secondary_structure_key:e=>{var t;fe.isAtomic(e.unit)||xs();let r=(t=$l.get(e.structure).value)===null||t===void 0?void 0:t.get(e.unit.invariantId);return r?r.key[r.getIndex(e.unit.residueIndex[e.element])]:-1},chem_comp_type:e=>fe.isAtomic(e.unit)?e.unit.model.properties.chemicalComponentMap.get(PL(e)).type:xs()},Gdt={key:e=>fe.isAtomic(e.unit)?e.unit.chainIndex[e.element]:xs(),label_asym_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.chains.label_asym_id.value(e.unit.chainIndex[e.element]):e.unit.coarseElements.asym_id.value(e.element),auth_asym_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.chains.auth_asym_id.value(e.unit.chainIndex[e.element]):xs(),label_entity_id:e=>fe.isAtomic(e.unit)?e.unit.model.atomicHierarchy.chains.label_entity_id.value(e.unit.chainIndex[e.element]):e.unit.coarseElements.entity_id.value(e.element)},Hdt={key:FD.key,entityKey:e=>fe.isCoarse(e.unit)?e.unit.coarseElements.entityKey[e.element]:sb(),x:FD.x,y:FD.y,z:FD.z,asym_id:e=>fe.isCoarse(e.unit)?e.unit.coarseElements.asym_id.value(e.element):sb(),entity_id:e=>fe.isCoarse(e.unit)?e.unit.coarseElements.entity_id.value(e.element):sb(),seq_id_begin:e=>fe.isCoarse(e.unit)?e.unit.coarseElements.seq_id_begin.value(e.element):sb(),seq_id_end:e=>fe.isCoarse(e.unit)?e.unit.coarseElements.seq_id_end.value(e.element):sb(),sphere_radius:e=>fe.isSpheres(e.unit)?e.unit.coarseConformation.radius[e.element]:sb("spheres"),sphere_rmsf:e=>fe.isSpheres(e.unit)?e.unit.coarseConformation.rmsf[e.element]:sb("spheres"),gaussian_weight:e=>fe.isGaussians(e.unit)?e.unit.coarseConformation.weight[e.element]:sb("gaussians"),gaussian_covariance_matrix:e=>fe.isGaussians(e.unit)?e.unit.coarseConformation.covariance_matrix[e.element]:sb("gaussians")};Wdt={key:ud,id:e=>e.unit.model.entities.data.id.value(ud(e)),type:e=>e.unit.model.entities.data.type.value(ud(e)),src_method:e=>e.unit.model.entities.data.src_method.value(ud(e)),pdbx_description:e=>e.unit.model.entities.data.pdbx_description.value(ud(e)),formula_weight:e=>e.unit.model.entities.data.formula_weight.value(ud(e)),pdbx_number_of_molecules:e=>e.unit.model.entities.data.pdbx_number_of_molecules.value(ud(e)),details:e=>e.unit.model.entities.data.details.value(ud(e)),pdbx_mutation:e=>e.unit.model.entities.data.pdbx_mutation.value(ud(e)),pdbx_fragment:e=>e.unit.model.entities.data.pdbx_fragment.value(ud(e)),pdbx_ec:e=>e.unit.model.entities.data.pdbx_ec.value(ud(e)),pdbx_parent_entity_id:e=>e.unit.model.entities.data.pdbx_parent_entity_id.value(ud(e)),subtype:e=>e.unit.model.entities.subtype.value(ud(e)),prd_id:e=>{var t,r;return(r=(t=e.unit.model.entities.prd_id)===null||t===void 0?void 0:t.value(ud(e)))!==null&&r!==void 0?r:""}},Kdt=[],Ydt={id:e=>e.unit.id,chainGroupId:e=>e.unit.chainGroupId,multiChain:e=>fe.Traits.is(e.unit.traits,fe.Trait.MultiChain),object_primitive:e=>e.unit.objectPrimitive,operator_name:e=>e.unit.conformation.operator.name,instance_id:e=>e.unit.conformation.operator.instanceId,operator_key:e=>e.unit.conformation.operator.key,model_index:e=>e.unit.model.modelNum,model_label:e=>e.unit.model.label,model_entry_id:e=>e.unit.model.entryId,hkl:e=>e.unit.conformation.operator.hkl,spgrOp:e=>e.unit.conformation.operator.spgrOp,model_num:e=>e.unit.model.modelNum,pdbx_struct_assembly_id:e=>{var t;return((t=e.unit.conformation.operator.assembly)===null||t===void 0?void 0:t.id)||mo.DefaultName},pdbx_struct_oper_list_ids:e=>{var t;return((t=e.unit.conformation.operator.assembly)===null||t===void 0?void 0:t.operList)||Kdt},struct_ncs_oper_id:e=>e.unit.conformation.operator.ncsId},nt={constant:zdt,atom:FD,residue:jdt,chain:Gdt,entity:Wdt,unit:Ydt,coarse:Hdt}});var hx,Iye=M(()=>{lb();hx=class{add(t){let r=this.index.get(t.label_asym_id);r||(r=new Map,this.index.set(t.label_asym_id,r));let n=r.get(t.label_seq_id);return n||(n=[],r.set(t.label_seq_id,n)),this._find(t,n)?!1:(n.push(t),!0)}hasLabelAsymId(t){return this.index.has(t)}has(t){var r,n;let o=this._asym_id(t);if(!this.index.has(o))return;let i=this.index.get(o),a=this._seq_id(t);if(!i.has(a))return;let s=i.get(a),l=this._comp_id(t),c=this._alt_id(t),u=this._ins_code(t),d=(r=this._op_name(t))!==null&&r!==void 0?r:"1_555";for(let f of s)if(!(f.label_comp_id!==l||f.label_alt_id!==c||f.ins_code!==u)&&!(this.checkOperator&&((n=f.operator_name)!==null&&n!==void 0?n:"1_555")!==d))return f}static getLabel(t,r=!1){var n;return`${t.label_asym_id} ${t.label_comp_id} ${t.label_seq_id}:${t.ins_code}:${t.label_alt_id}${r?" "+((n=t.operator_name)!==null&&n!==void 0?n:"1_555"):""}`}static getEntryFromLocation(t){var r;return{label_asym_id:nt.chain.label_asym_id(t),label_comp_id:nt.atom.label_comp_id(t),label_seq_id:nt.residue.label_seq_id(t),label_alt_id:nt.atom.label_alt_id(t),ins_code:nt.residue.pdbx_PDB_ins_code(t),operator_name:(r=nt.unit.operator_name(t))!==null&&r!==void 0?r:"1_555"}}_find(t,r){var n,o;for(let i of r)if(!(i.label_comp_id!==t.label_comp_id||i.label_alt_id!==t.label_alt_id||i.ins_code!==t.ins_code)&&!(this.checkOperator&&((n=i.operator_name)!==null&&n!==void 0?n:"1_555")!==((o=t.operator_name)!==null&&o!==void 0?o:"1_555")))return!0;return!1}constructor(t){var r;this.index=new Map,this.checkOperator=!1,this._asym_id=nt.chain.label_asym_id,this._seq_id=nt.residue.label_seq_id,this._comp_id=nt.atom.label_comp_id,this._alt_id=nt.atom.label_alt_id,this._ins_code=nt.residue.pdbx_PDB_ins_code,this._op_name=nt.unit.operator_name,this.checkOperator=(r=t?.checkOperator)!==null&&r!==void 0?r:!1}}});var wK={};ci(wK,{exceptBy:()=>tft,expandProperty:()=>nft,includeConnected:()=>oft,includeSurroundings:()=>Qdt,intersectBy:()=>eft,querySelection:()=>Jdt,surroundingLigands:()=>aft,union:()=>rft,wholeResidues:()=>Xdt});function RT(e,t,r){let n=t.subsetBuilder(!0);for(let o of r.units){if(o.kind!==fe.Kind.Atomic){n.setUnit(o.id,o.elements);continue}let{residueAtomSegments:i}=o.model.atomicHierarchy,a=t.unitMap.get(o.id).elements,s=o.elements;n.beginUnit(o.id);let l=nr.transientSegments(i,s);for(;l.hasNext;){let c=l.move().index;for(let u=i.offsets[c],d=i.offsets[c+1];u<d;u++)je.has(a,u)&&n.addElement(u)}n.commitUnit(),e.throwIfTimedOut()}return n.getStructure()}function Xdt(e){return function(r){let n=e(r);if(ht.isSingleton(n))return ht.Singletons(r.inputStructure,RT(r,r.inputStructure,n.structure));{let o=new ET(r.inputStructure);for(let i of n.structures)o.add(RT(r,r.inputStructure,i));return o.getSelection()}}}function _K(e,t,r,n){let o=new P2(t),i=t.lookup3d,a=n.radius;for(let s of r.units){let l=s.conformation,c=s.elements;for(let u=0,d=c.length;u<d;u++){let f=c[u];i.findIntoBuilder(l.x(f),l.y(f),l.z(f),a,o)}e.throwIfTimedOut()}return n.wholeResidues?RT(e,t,o.getStructure()):o.getStructure()}function Eye(e,t,r,n){let o=new P2(t),i=t.lookup3d,{elementRadius:a,elementRadiusClosure:s,sourceMaxRadius:l,radius:c}=n;e.pushCurrentElement(),e.element.structure=r;for(let u of r.units){e.element.unit=u;let d=u.conformation,f=u.elements;for(let m=0,p=f.length;m<p;m++){let h=f[m];e.element.element=h;let g=a(e);i.findIntoBuilderWithRadius(d.x(h),d.y(h),d.z(h),g,l,c,s,o)}e.throwIfTimedOut()}return e.popCurrentElement(),n.wholeResidues?RT(e,t,o.getStructure()):o.getStructure()}function Zdt(e,t){return r=>(e.element.structure=r.structure,e.element.unit=r.unit,e.element.element=r.element,t(e))}function $dt(e,t){let r=0;e.element.structure=e.inputStructure;for(let n of e.inputStructure.units){e.element.unit=n;let o=n.elements;for(let i=0,a=o.length;i<a;i++){let s=o[i];e.element.element=s;let l=t(e);l>r&&(r=l)}}return e.throwIfTimedOut(),r}function Qdt(e,t){return function(n){let o=e(n);if(t.elementRadius){let i={...t,elementRadius:t.elementRadius,elementRadiusClosure:Zdt(n,t.elementRadius),sourceMaxRadius:$dt(n,t.elementRadius)};if(ht.isSingleton(o)){let a=Eye(n,n.inputStructure,o.structure,i);return ht.Singletons(n.inputStructure,a)}else{let a=new ET(n.inputStructure);for(let s of o.structures)a.add(Eye(n,n.inputStructure,s,i));return a.getSelection()}}if(ht.isSingleton(o)){let i=_K(n,n.inputStructure,o.structure,t);return ht.Singletons(n.inputStructure,i)}else{let i=new ET(n.inputStructure);for(let a of o.structures)i.add(_K(n,n.inputStructure,a,t));return i.getSelection()}}}function Jdt(e,t){return function(n){let o=e(n);if(ht.structureCount(o)===0)return o;let i=ht.UniqueBuilder(n.inputStructure),a=s=>i.add(s);return ht.forEach(o,(s,l)=>{n.pushInputStructure(s),ht.forEach(t(n),a),n.popInputStructure(),l%10===0&&n.throwIfTimedOut()}),i.getSelection()}}function eft(e,t){return function(n){let o=e(n);if(ht.structureCount(o)===0)return o;let i=t(n);if(ht.structureCount(i)===0)return ht.Empty(n.inputStructure);let a=ht.unionStructure(i),s=ht.UniqueBuilder(n.inputStructure);return ht.forEach(o,(l,c)=>{let u=lL(a,l);u.elementCount!==0&&s.add(u),c%50===0&&n.throwIfTimedOut()}),s.getSelection()}}function tft(e,t){return function(n){let o=e(n);if(ht.structureCount(o)===0)return o;let i=t(n);if(ht.structureCount(i)===0)return o;let a=ht.unionStructure(i),s=ht.UniqueBuilder(n.inputStructure);return ht.forEach(o,(l,c)=>{let u=IT(l,a);u.elementCount!==0&&s.add(u),c%50===0&&n.throwIfTimedOut()}),s.getSelection()}}function rft(e){return function(r){let n=ht.LinearBuilder(r.inputStructure);return n.add(ht.unionStructure(e(r))),n.getSelection()}}function nft(e,t){return function(n){let o=e(n),i=new Map,a=[];n.pushCurrentElement(),ht.forEach(o,(l,c)=>{n.element.structure=l;for(let u of l.units){n.element.unit=u;let d=u.elements;for(let f=0,m=d.length;f<m;f++){n.element.element=d[f];let p=t(n),h;i.has(p)?h=i.get(p):(h=$n.create(),i.set(p,h)),$n.add(h,c,c)}}a[c]=n.inputStructure.subsetBuilder(!0),c%10===0&&n.throwIfTimedOut()}),n.element.structure=n.inputStructure;for(let l of n.inputStructure.units){n.element.unit=l;let c=l.elements;for(let u=0,d=c.length;u<d;u++){n.element.element=c[u];let f=t(n);if(!i.has(f))continue;let m=i.get(f).array;for(let p=0,h=m.length;p<h;p++)a[m[p]].addToUnit(l.id,c[u])}}n.popCurrentElement();let s=ht.UniqueBuilder(n.inputStructure);for(let l of a)s.add(l.getStructure());return s.getSelection()}}function oft({query:e,layerCount:t,wholeResidues:r,bondTest:n,fixedPoint:o}){let i=Math.max(t,0);return function(s){let l=ht.UniqueBuilder(s.inputStructure),c=e(s);return s.pushCurrentBond(),s.atomicBond.setTestFn(n),ht.forEach(c,(u,d)=>{let f=u;if(o)for(;;){let m=f.elementCount;if(f=Dye(s,r,f),f.elementCount===m)break}else for(let m=0;m<i;m++)f=Dye(s,r,f);l.add(f),d%10===0&&s.throwIfTimedOut()}),s.popCurrentBond(),l.getSelection()}}function Dye(e,t,r){let n=ift(e,r);return t?RT(e,e.inputStructure,n):n}function ift(e,t){let r=e.inputStructure,n=r.interUnitBonds,o=new P2(r),i=e.atomicBond;for(let a of t.units){if(a.kind!==fe.Kind.Atomic){o.beginUnit(a.id);for(let m=0,p=a.elements.length;m<p;m++)o.addElement(a.elements[m]);o.commitUnit();continue}let s=r.unitMap.get(a.id),{offset:l,b:c,edgeProps:{flags:u,order:d,key:f}}=s.bonds;i.setStructure(r),i.a.unit=s,i.b.unit=s;for(let m=0,p=a.elements.length;m<p;m++){o.addToUnit(a.id,a.elements[m]);let h=je.indexOf(s.elements,a.elements[m]);for(let g=l[h],y=l[h+1];g<y;g++){let b=c[g],x=s.elements[b];je.has(a.elements,x)||o.has(a.id,x)||(i.aIndex=h,i.a.element=a.elements[m],i.bIndex=b,i.b.element=x,i.type=u[g],i.order=d[g],i.key=f[g],i.test(e,!0)&&o.addToUnit(a.id,x))}}for(let m of n.getConnectedUnits(s.id)){let p=t.unitMap.get(m.unitB),h=r.unitMap.get(m.unitB);for(let g of m.connectedIndices)if(je.has(a.elements,s.elements[g]))for(let y of m.getEdges(g)){let b=h.elements[y.indexB];p&&je.has(p.elements,b)||o.has(m.unitB,b)||(i.a.unit=s,i.aIndex=g,i.a.element=s.elements[g],i.b.unit=h,i.bIndex=y.indexB,i.b.element=b,i.type=y.props.flag,i.order=y.props.order,i.key=y.props.key,i.test(e,!0)&&o.addToUnit(m.unitB,b))}}}return o.getStructure()}function aft({query:e,radius:t,includeWater:r}){let n=nt.entity.type;function o(i){return n(i)==="water"}return function(a){let s=ht.unionStructure(e(a)),l=RT(a,a.inputStructure,_K(a,a.inputStructure,s,{radius:t})),c=sft(a.inputStructure),u=lft(a.inputStructure),d=te.Location.create(l),f=new Map,m=new hx({checkOperator:!0});for(let g of l.units){if(g.kind!==fe.Kind.Atomic)continue;d.unit=g;let{elements:y}=g,b=nr.transientSegments(g.model.atomicHierarchy.chainAtomSegments,y),x=nr.transientSegments(g.model.atomicHierarchy.residueAtomSegments,y);for(;b.hasNext;){let C=b.move();d.element=y[C.start];let S=nt.chain.label_asym_id(d),w=nt.unit.operator_name(d);if(c.has(S)){f.has(S)?Li(f.get(S),w):f.set(S,[w]);continue}let A=nt.entity.type(d);if(!(A==="water"||A==="polymer"))for(x.setSegment(C);x.hasNext;){let T=x.move();d.element=y[T.start],u.addComponent(hx.getEntryFromLocation(d),m)}}a.throwIfTimedOut()}let p=a.inputStructure.subsetBuilder(!0);for(let g of a.inputStructure.units){if(g.kind!==fe.Kind.Atomic)continue;d.unit=g;let{elements:y}=g,b=nr.transientSegments(g.model.atomicHierarchy.chainAtomSegments,y),x=nr.transientSegments(g.model.atomicHierarchy.residueAtomSegments,y);for(p.beginUnit(g.id);b.hasNext;){let C=b.move();d.element=y[C.start];let S=nt.chain.label_asym_id(d),w=nt.unit.operator_name(d);if(f.has(S)&&f.get(S).indexOf(w)>=0){p.addElementRange(y,C.start,C.end);continue}if(m.hasLabelAsymId(S))for(x.setSegment(C);x.hasNext;){let A=x.move();d.element=y[A.start],m.has(d)&&p.addElementRange(y,A.start,A.end)}}p.commitUnit(),a.throwIfTimedOut()}let h=ab(a.inputStructure,[p.getStructure(),s]);if(r){let g=new P2(a.inputStructure),y=a.inputStructure.lookup3d;for(let b of h.units){let x=b.conformation,C=b.elements;for(let S=0,w=C.length;S<w;S++){let A=C[S];y.findIntoBuilderIf(x.x(A),x.y(A),x.z(A),t,g,o),g.addToUnit(b.id,A)}a.throwIfTimedOut()}return ht.Sequence(a.inputStructure,[g.getStructure()])}else return ht.Sequence(a.inputStructure,[h])}}function sft(e){var t;let r=e.models[0],n=new Set;if(((t=r.sourceData)===null||t===void 0?void 0:t.kind)!=="mmCIF")return n;let{_rowCount:o,asym_id:i}=r.sourceData.data.db.pdbx_molecule;for(let a=0;a<o;a++)n.add(i.value(a));return n}function lft(e){var t,r,n;let o=e.models[0],i=new CK;if(((t=o.sourceData)===null||t===void 0?void 0:t.kind)!=="mmCIF")return i;let a=o.sourceData.data.db.struct_conn,{conn_type_id:s}=a,{ptnr1_label_asym_id:l,ptnr1_label_comp_id:c,ptnr1_label_seq_id:u,ptnr1_symmetry:d,pdbx_ptnr1_label_alt_id:f,pdbx_ptnr1_PDB_ins_code:m}=a,{ptnr2_label_asym_id:p,ptnr2_label_comp_id:h,ptnr2_label_seq_id:g,ptnr2_symmetry:y,pdbx_ptnr2_label_alt_id:b,pdbx_ptnr2_PDB_ins_code:x}=a;for(let C=0;C<a._rowCount;C++){let S=s.value(C);if(S!=="covale"&&S!=="metalc")continue;let w={label_asym_id:l.value(C),label_comp_id:c.value(C),label_seq_id:u.value(C),label_alt_id:f.value(C),ins_code:m.value(C),operator_name:(r=d.value(C))!==null&&r!==void 0?r:"1_555"},A={label_asym_id:p.value(C),label_comp_id:h.value(C),label_seq_id:g.value(C),label_alt_id:b.value(C),ins_code:x.value(C),operator_name:(n=y.value(C))!==null&&n!==void 0?n:"1_555"};i.addEdge(w,A)}return i}var CK,kye=M(()=>{Ut();zs();mg();nK();v0e();T2();ku();ib();Iye();lb();Jn();CK=class{constructor(){this.vertices=new Map,this.edges=new Map}addVertex(t,r){this.vertices.has(r)||(this.vertices.set(r,t),this.edges.set(r,[]))}addEdge(t,r){let n=hx.getLabel(t),o=hx.getLabel(r);this.addVertex(t,n),this.addVertex(r,o),Li(this.edges.get(n),o),Li(this.edges.get(o),n)}addComponent(t,r){let n=hx.getLabel(t);if(!this.vertices.has(n)){r.add(t);return}let o=new Set,i=new Set,a=[n];for(i.add(n),r.add(t);a.length>0;){let s=a.pop();o.add(s);let l=this.vertices.get(s);for(let c of this.edges.get(s)){if(o.has(c)||(a.push(c),i.has(c)))continue;i.add(c);let u=this.vertices.get(c);l.operator_name===u.operator_name?r.add({...u,operator_name:t.operator_name}):r.add(u)}}}}});function Mye(e,t,r,n,o,i){return t.elementCount===0||r.elementCount===0?!0:t.elementCount<=r.elementCount?IL.check(e,t,r,n,o,i):IL.check(e,r,t,n,o,i)}function Bye(e,t,r,n,o){return t.elementCount===0||r.elementCount===0?!0:t.elementCount<=r.elementCount?EL.check(e,t,r,n,o):EL.check(e,r,t,n,o)}var IL,EL,Rye=M(()=>{Ge();(function(e){let t;(function(s){s[s.BelowMin=0]="BelowMin",s[s.WithinMax=1]="WithinMax",s[s.Miss=2]="Miss"})(t||(t={}));let r=v();function n(s,l,c,u,d,f,m){let{elements:p,conformation:h}=l,g=r;s.element.unit=l;let y=!1;for(let b=0,x=p.length;b<x;b++){let C=p[b];s.element.element=C;let S=Math.max(0,v.distance(c,h.position(C,g))-u-m(s));if(S<d)return t.BelowMin;S<f&&(y=!0)}return y?t.WithinMax:t.Miss}function o(s,l,c,u,d,f,m){let{units:p}=l,h=!1;for(let g=0,y=p.length;g<y;g++){let b=n(s,p[g],c,u,d,f,m);if(b===t.BelowMin)return t.BelowMin;b===t.WithinMax&&(h=!0)}return h?t.WithinMax:t.Miss}let i=v();function a(s,l,c,u,d,f){if(l.elementCount===0||c.elementCount===0)return 0;let{units:m}=l,p=!1;s.element.structure=l;for(let h=0,g=m.length;h<g;h++){let y=m[h],{elements:b,conformation:x}=y;s.element.unit=y;for(let C=0,S=b.length;C<S;C++){let w=b[C];s.element.element=w;let A=o(s,c,x.position(w,i),f(s),u,d,f);if(A===t.BelowMin)return!1;A===t.WithinMax&&(p=!0)}}return p}e.check=a})(IL||(IL={}));(function(e){let t=v();function r(a,s,l,c,u,d){let{elements:f,conformation:m}=s,p=t;a.element.unit=s;for(let h=0,g=f.length;h<g;h++){let y=f[h];if(a.element.element=y,Math.max(0,v.distance(l,m.position(y,p))-c-d(a))<=u)return!0}return!1}function n(a,s,l,c,u,d){let{units:f}=s;for(let m=0,p=f.length;m<p;m++)if(r(a,f[m],l,c,u,d))return!0;return!1}let o=v();function i(a,s,l,c,u){if(s.elementCount===0||l.elementCount===0)return 0;let{units:d}=s;a.element.structure=s;for(let f=0,m=d.length;f<m;f++){let p=d[f];a.element.unit=p;let{elements:h,conformation:g}=p;for(let y=0,b=h.length;y<b;y++){let x=h[y];if(a.element.element=x,n(a,l,g.position(x,o),u(a),c,u))return!0}}return!1}e.check=i})(EL||(EL={}))});var TK={};ci(TK,{areIntersectedBy:()=>mft,first:()=>uft,getCurrentStructureProperties:()=>ND,isConnectedTo:()=>bft,pick:()=>cft,withSameAtomProperties:()=>fft,within:()=>pft});function cft(e,t){return r=>{let n=e(r),o=ht.LinearBuilder(r.inputStructure);return r.pushCurrentElement(),ht.forEach(n,(i,a)=>{r.currentStructure=i,t(r)&&o.add(i),a%100&&r.throwIfTimedOut()}),r.popCurrentStructure(),o.getSelection()}}function uft(e){return t=>{let r=e(t),n=ht.LinearBuilder(t.inputStructure);if(r.kind==="singletons"){if(r.structure.elementCount>0){let o=r.structure.units[0],i=Oe.create([o.getChild(je.ofSingleton(o.elements[0]))],{parent:t.inputStructure});n.add(i)}}else r.structures.length>0&&n.add(r.structures[0]);return n.getSelection()}}function ND(e,t,r){let{units:n}=e.currentStructure,o=e.pushCurrentElement();o.structure=e.currentStructure;for(let i of n){o.unit=i;let a=i.elements,s=t;if(s){for(let l=0,c=a.length;l<c;l++)o.element=a[l],r.add(s(e));e.throwIfTimedOut()}}return e.popCurrentElement(),r}function dft(e,t,r){let n=new Set,o=t(e);return e.pushCurrentElement(),ht.forEach(o,(i,a)=>{e.currentStructure=i,ND(e,r,n),a%10&&e.throwIfTimedOut()}),e.popCurrentElement(),n}function fft(e,t,r){return n=>{let o=e(n),i=dft(n,t,r),a=ht.LinearBuilder(n.inputStructure);return n.pushCurrentStructure(),ht.forEach(o,(s,l)=>{n.currentStructure=s;let c=ND(n,r,new Set);So.isSuperset(i,c)&&a.add(s),l%10&&n.throwIfTimedOut()}),n.popCurrentStructure(),a.getSelection()}}function mft(e,t){return r=>{let n=ht.unionStructure(t(r)),o=ht.LinearBuilder(r.inputStructure);return ht.forEach(e(r),(i,a)=>{PT(n,i)&&o.add(i),a%10&&r.throwIfTimedOut()}),o.getSelection()}}function pft(e){return t=>{let r={queryCtx:t,selection:e.query(t),target:e.target(t),maxRadius:e.maxRadius,minRadius:e.minRadius?Math.max(0,e.minRadius):0,elementRadius:e.elementRadius,invert:!!e.invert};return r.minRadius===0&&typeof e.minRadius>"u"?hft(r):r.minRadius===0?gft(r):yft(r)}}function hft({queryCtx:e,selection:t,target:r,maxRadius:n,invert:o}){let i=ht.unionStructure(r).lookup3d,a=ht.LinearBuilder(e.inputStructure),s=v.zero();return ht.forEach(t,(l,c)=>{let{units:u}=l,d=!1;for(let f=0,m=u.length;f<m;f++){let p=u[f],{elements:h,conformation:g}=p;for(let y=0,b=h.length;y<b;y++){let x=h[y];if(g.position(x,s),i.check(s[0],s[1],s[2],n+g.r(x))){d=!0;break}}if(d)break}o&&(d=!d),d&&a.add(l),c%10===0&&e.throwIfTimedOut()}),a.getSelection()}function gft({queryCtx:e,selection:t,target:r,maxRadius:n,invert:o,elementRadius:i}){let a=ht.unionStructure(r),s=ht.LinearBuilder(e.inputStructure);return e.pushCurrentElement(),ht.forEach(t,(l,c)=>{let u=Bye(e,a,l,n,i);o&&(u=!u),u&&s.add(l),c%10===0&&e.throwIfTimedOut()}),e.popCurrentElement(),s.getSelection()}function yft({queryCtx:e,selection:t,target:r,minRadius:n,maxRadius:o,invert:i,elementRadius:a}){let s=ht.unionStructure(r),l=ht.LinearBuilder(e.inputStructure);return e.pushCurrentElement(),ht.forEach(t,(c,u)=>{let d=Mye(e,s,c,n,o,a);i&&(d=!d),d&&l.add(c),u%10===0&&e.throwIfTimedOut()}),e.popCurrentElement(),l.getSelection()}function vft(e,t){let{queryCtx:r,input:n,target:o,disjunct:i}=e,a=r.atomicBond,s=n.interUnitBonds;a.setStructure(n);for(let l of t.units){if(!fe.isAtomic(l))continue;let c=n.unitMap.get(l.id),{offset:u,b:d,edgeProps:{flags:f,order:m,key:p}}=c.bonds,h=s.getConnectedUnits(l.id),g=h.length,y=l.elements,b=c.elements;for(let x=0,C=y.length;x<C;x++){let S=je.indexOf(b,y[x]);a.a.unit=c,a.b.unit=c;for(let w=u[S],A=u[S+1];w<A;w++)if(a.b.element=c.elements[d[w]],!(i&&je.has(l.elements,a.b.element))&&o.hasElement(a.b)&&(a.aIndex=S,a.a.element=y[x],a.bIndex=d[w],a.type=f[w],a.order=m[w],a.key=p[w],a.test(r,!0)))return!0;for(let w=0;w<g;w++){let A=h[w],T=n.unitMap.get(A.unitB),D=T.elements,E=A.getEdges(S);for(let I=0,k=E.length;I<k;I++){let R=E[I];if(a.b.unit=T,a.b.element=D[R.indexB],!!o.hasElement(a.b)&&!(i&&t.hasElement(a.b))&&(a.a.unit=c,a.aIndex=S,a.a.element=y[x],a.bIndex=R.indexB,a.type=R.props.flag,a.order=R.props.order,a.key=R.props.key,a.test(r,!0)))return!0}}}}return!1}function bft({query:e,target:t,disjunct:r,invert:n,bondTest:o}){return i=>{let a=t(i);if(ht.isEmpty(a))return a;let s=e(i);if(ht.isEmpty(s))return s;let l={queryCtx:i,input:i.inputStructure,disjunct:r,target:ht.unionStructure(a)},c=ht.LinearBuilder(i.inputStructure);return i.pushCurrentBond(),i.atomicBond.setTestFn(o),ht.forEach(s,(u,d)=>{(vft(l,u)||n)&&c.add(u),d%5===0&&i.throwIfTimedOut()}),i.popCurrentBond(),c.getSelection()}}var AK=M(()=>{Nf();zs();mg();T2();Ge();Rye();ug();Ut()});var PK={};ci(PK,{intersect:()=>Sft,merge:()=>xft});function xft(e){return e.length===0?hL:e.length===1?e[0]:t=>{let r=ht.UniqueBuilder(t.inputStructure);for(let n=0;n<e.length;n++)ht.forEach(e[n](t),(o,i)=>{r.add(o),n%100&&t.throwIfTimedOut()});return r.getSelection()}}function Sft(e){return e.length===0?hL:e.length===1?e[0]:t=>{let r=[];for(let s=0;s<e.length;s++)r.push(e[s](t));let n=0,o=ht.structureCount(r[0]);for(let s=1;s<r.length;s++){let l=ht.structureCount(r[s]);l<o&&(n=s,o=l)}t.throwIfTimedOut();let i=Gw(s=>s.hashCode,Oe.areUnitIdsAndIndicesEqual);ht.forEach(r[n],s=>i.add(s));let a=ht.UniqueBuilder(t.inputStructure);for(let s=0;s<r.length;s++)s!==n&&(ht.forEach(r[s],l=>{i.has(l)&&a.add(l)}),t.throwIfTimedOut());return a.getSelection()}}var Oye=M(()=>{mg();sK();ku();zs()});var IK={};ci(IK,{atomCount:()=>_ft,countQuery:()=>Cft,propertySet:()=>wft});function _ft(e){return e.currentStructure.elementCount}function Cft(e){return t=>{let r=e(t);return ht.structureCount(r)}}function wft(e){return t=>ND(t,e,new Set)}var Lye=M(()=>{mg();AK()});var DL,Fye=M(()=>{(function(e){function t(f){return!!f&&!!f.has}function r(f,m){return p=>f(p)===m}e.eq=r;function n(f,m){return p=>f(p)<m}e.lt=n;function o(f,m){return p=>f(p)<=m}e.lte=o;function i(f,m){return p=>f(p)>m}e.gt=i;function a(f,m){return p=>f(p)>=m}e.gte=a;function s(f){return!0}function l(f){return!1}function c(f,m){if(t(m))return p=>m.has(f(p));{if(m.length===0)return l;let p=new Set;for(let h=0;h<m.length;h++)p.add(m[h]);return h=>p.has(f(h))}}e.inSet=c;function u(...f){switch(f.length){case 0:return s;case 1:return f[0];case 2:{let m=f[0],p=f[1];return h=>m(h)&&p(h)}case 3:{let m=f[0],p=f[1],h=f[2];return g=>m(g)&&p(g)&&h(g)}case 4:{let m=f[0],p=f[1],h=f[2],g=f[3];return y=>m(y)&&p(y)&&h(y)&&g(y)}case 5:{let m=f[0],p=f[1],h=f[2],g=f[3],y=f[4];return b=>m(b)&&p(b)&&h(b)&&g(b)&&y(b)}case 6:{let m=f[0],p=f[1],h=f[2],g=f[3],y=f[4],b=f[5];return x=>m(x)&&p(x)&&h(x)&&g(x)&&y(x)&&b(x)}default:{let m=f.length;return p=>{for(let h=0;h<m;h++)if(!f[h])return!1;return!0}}}}e.and=u;function d(...f){switch(f.length){case 0:return l;case 1:return f[0];case 2:{let m=f[0],p=f[1];return h=>m(h)||p(h)}case 3:{let m=f[0],p=f[1],h=f[2];return g=>m(g)||p(g)||h(g)}case 4:{let m=f[0],p=f[1],h=f[2],g=f[3];return y=>m(y)||p(y)||h(y)||g(y)}case 5:{let m=f[0],p=f[1],h=f[2],g=f[3],y=f[4];return b=>m(b)||p(b)||h(b)||g(b)||y(b)}case 6:{let m=f[0],p=f[1],h=f[2],g=f[3],y=f[4],b=f[5];return x=>m(x)||p(x)||h(x)||g(x)||y(x)||b(x)}default:{let m=f.length;return p=>{for(let h=0;h<m;h++)if(f[h])return!0;return!1}}}}e.or=d})(DL||(DL={}))});var ho,ID=M(()=>{mg();g0e();rK();sK();kye();AK();Oye();fL();Lye();Fye();ho={generators:aK,filters:TK,modifiers:wK,combinators:PK,pred:DL,internal:tK,atomset:IK}});function Tft(e){return ho.generators.atoms({chainTest:ho.pred.and(ho.pred.eq(t=>nt.unit.operator_name(t.element),mo.DefaultName),ho.pred.inSet(t=>nt.chain.label_asym_id(t.element),e))})}function Nye(e,t,r,n,o,i){let{spacegroup:a,ncsOperators:s}=e,l=[],{toFractional:c}=a.cell,u=v.transformMat4(v(),i,c),d=Rl.getSymmetryOperatorRef(a,t,r,n,o,u);if(s&&s.length)for(let f=0,m=s.length;f<m;++f){let p=s[f],h=H.mul(H(),d.matrix,p.matrix),g=mo.create(`${d.name} ${p.name}`,h,{assembly:d.assembly,ncsId:p.ncsId,hkl:d.hkl,spgrOp:d.spgrOp});l.push(g)}else l.push(d);return l}function Uye(e,t,r,n){let{spacegroup:o,ncsOperators:i}=e,a=i&&i.length||0,s=[];!a&&t[0]<=0&&r[0]>=0&&t[1]<=0&&r[1]>=0&&t[2]<=0&&r[2]>=0&&(s[0]=Rl.getSymmetryOperator(o,0,0,0,0));for(let l=0;l<o.operators.length;l++)for(let c=t[0];c<=r[0];c++)for(let u=t[1];u<=r[1];u++)for(let d=t[2];d<=r[2];d++)!a&&l===0&&c===0&&u===0&&d===0||s.push(...Nye(e,l,c,u,d,n));return s}function Aft(e,t){return e._operators_333&&v.equals(t,e._operators_333.ref)||(e._operators_333={ref:v.clone(t),operators:Uye(e,v.create(-3,-3,-3),v.create(3,3,3),t)}),e._operators_333.operators}function Vye(e,t){let r=Oe.Builder({label:e.label,dynamicBonds:e.dynamicBonds}),{units:n}=e;for(let o of t)for(let i of n)r.addWithOperator(i,o);return r.getStructure()}async function Pft(e,t){let r=t.models;if(r.length!==1)throw new Error("Can only build NCS from structures based on 1 model.");let n=di.Provider.get(r[0]);if(!n)return t;let o=n.ncsOperators;return!o||!o.length?t:Vye(t,o)}async function Ift(e,t,r,n){let o=t.models;if(o.length!==1)throw new Error("Can only build symmetries from structures based on 1 model.");let i=di.Provider.get(o[0]);if(!i)return t;let{spacegroup:a}=i;if(Ua.isZero(a.cell))return t;let s=Ht.getCenter(o[0]),l=Uye(i,r,n,s);return Vye(t,l)}async function Eft(e,t,r){let n=t.models;if(n.length!==1)throw new Error("Can only build symmetries from structures based on 1 model.");let o=di.Provider.get(n[0]);if(!o)return t;let{spacegroup:i}=o;if(Ua.isZero(i.cell))return t;e.shouldUpdate&&await e.update("Initialing...");let a=Ht.getCenter(n[0]),s=Aft(o,a),l=t.lookup3d,c=new Set;function u(p,h){return`${p.invariantId}|${h.name}`}let d=Oe.Builder({label:t.label,dynamicBonds:t.dynamicBonds}),{units:f}=t,m=v.zero();for(let p of s){for(let h of f){let g=h.lookup3d.boundary.sphere;v.transformMat4(m,g.center,p.matrix);let y=l.findUnitIndices(m[0],m[1],m[2],g.radius+r);for(let b=0,x=y.count;b<x;b++){if(!f[y.indices[b]].lookup3d.check(m[0],m[1],m[2],g.radius+r))continue;let S=u(h,p);c.has(S)||(d.addWithOperator(h,p),c.add(S))}}e.shouldUpdate&&await e.update("Building symmetry...")}return d.getStructure()}var Yd,DD=M(()=>{Ut();tn();or();Ge();hr();nx();ID();ug();sd();Rp();lb();(function(e){function t(u,d){return Me.create("Build Assembly",async f=>{let m=u.models;if(m.length!==1)throw new Error("Can only build assemblies from structures based on 1 model.");let p=ob.findAssembly(m[0],d);if(!p)throw new Error(`Assembly '${d}' is not defined.`);let h=mo.create(p.id,H.identity(),{assembly:{id:p.id,operId:0,operList:[]}}),g=Oe.Builder({coordinateSystem:h,label:u.label,dynamicBonds:u.dynamicBonds}),y=new Si(u);for(let b of p.operatorGroups){let x=b.selector(y);if(ht.structureCount(x)===0)continue;let{units:C}=ht.unionStructure(x);for(let S of b.operators)for(let w of C)g.addWithOperator(w,S)}return g.getStructure()})}e.buildAssembly=t;function r(u,d,f){return Me.create("Build Symmetry Assembly",async m=>{let p=u.models;if(p.length!==1)throw new Error("Can only build symmetry assemblies from structures based on 1 model.");let h=v(),g=Oe.Builder({label:u.label,representativeModel:p[0],dynamicBonds:u.dynamicBonds}),y=new Si(u);for(let b of d){let C=Tft(b.asymIds)(y);if(ht.structureCount(C)===0)continue;let{units:S}=ht.unionStructure(C);for(let{index:w,shift:[A,T,D]}of b.operators){let E=Nye(f,w,A,T,D,h);for(let I of S)for(let k of E)g.addWithOperator(I,k)}}return g.getStructure()})}e.buildSymmetryAssembly=r;function n(u,d){return Me.create("Find Symmetry Mates",f=>Eft(f,u,d))}e.builderSymmetryMates=n;function o(u,d,f){return Me.create("Build Symmetry",m=>Ift(m,u,d,f))}e.buildSymmetryRange=o;function i(u){return Me.create("Build NCS",d=>Pft(d,u))}e.buildNcs=i;function a(u,d){return u.invariantId===d.invariantId&&u.model.id===d.model.id&&je.areEqual(u.elements,d.elements)}e.areUnitsEquivalent=a;function s(){return Pme(fe.hashUnit,a)}e.UnitEquivalenceBuilder=s;function l(u){let d=s();for(let m of u.units)d.add(m.id,m);let f=[];for(let m of d.groups)f.push(fe.SymmetryGroup(m.map(p=>u.unitMap.get(p))));return f}e.computeTransformGroups=l;function c(u,d){if(u.length!==d.length)return!1;for(let f=0,m=u.length;f<m;++f){let p=u[f].units,h=d[f].units;if(p.length!==h.length||u[f].hashCode!==d[f].hashCode)return!1;for(let g=0,y=p.length;g<y;g++)if(p[g].conformation!==h[g].conformation)return!1}return!0}e.areTransformGroupsEquivalent=c})(Yd||(Yd={}))});var kL,zye=M(()=>{Ut();tn();DD();ug();kL=class{addToUnit(t,r){let n=this.unitMap.get(t);n?n[n.length]=r:(this.unitMap.set(t,[r]),this.ids[this.ids.length]=t),this.elementCount++}beginUnit(t){this.parentId=t,this.currentUnit=this.currentUnit.length>0?[]:this.currentUnit}addElement(t){this.currentUnit[this.currentUnit.length]=t,this.elementCount++}addElementRange(t,r,n){for(let o=r;o<n;o++)this.currentUnit[this.currentUnit.length]=t[o],this.elementCount++}commitUnit(){this.currentUnit.length!==0&&(this.ids[this.ids.length]=this.parentId,this.unitMap.set(this.parentId,this.currentUnit),this.parentId=-1)}setUnit(t,r){this.ids[this.ids.length]=t,this.unitMap.set(t,r),this.elementCount+=r.length}_getStructure(t){if(this.isEmpty)return Oe.Empty;let r=[];Yl(this.ids);let n=Yd.UnitEquivalenceBuilder();for(let o=0,i=this.ids.length;o<i;o++){let a=this.ids[o],s=this.parent.unitMap.get(a),l=this.unitMap.get(a),c=!1;t&&(this.isSorted||Yl(l),l=je.deduplicate(je.ofSortedArray(this.currentUnit)),c=!0);let u=l.length;if(l.length===s.elements.length){r[r.length]=s,n.add(s.id,s);continue}!this.isSorted&&!c&&u>1&&Yl(l);let d=s.getChild(je.ofSortedArray(l)),f=n.add(d.id,d);d!==f&&(d=f.applyOperator(d.id,d.conformation.operator,!0)),r[r.length]=d}return Oe.create(r,{parent:this.parent})}getStructure(){return this._getStructure(!1)}getStructureDeduplicate(){return this._getStructure(!0)}setSingletonLocation(t){let r=this.ids[0];t.unit=this.parent.unitMap.get(r),t.element=this.unitMap.get(r)[0]}get isEmpty(){return this.elementCount===0}constructor(t,r){this.parent=t,this.isSorted=r,this.ids=[],this.unitMap=Pc.Mutable(),this.parentId=-1,this.currentUnit=[],this.elementCount=0}}});function qye(e,t){let r=1;for(;t--;)r*=e--;return r}function Dft(e,t){return t>e?0:qye(e,t)/qye(t,t)}function kft(e){let t=e&-e,r=e+t,o=((r&-r)/t>>1)-1;return r|o}function DK(e,t){let r=[],n=new EK(e,t);for(;n.hasNext;)r.push(n.move().slice());return r}var EK,jye=M(()=>{EK=class{move(){if(this.hasNext){let t=0,r=0,n=this.index;for(;n;n>>>=1,t++)n&1&&(this.value[r++]=this.array[t]);this.index=kft(this.index),this.hasNext=this.index<this.maxIndex}return this.value}constructor(t,r){this.array=t,this.hasNext=!1,this.index=(1<<r)-1,this.size=Dft(t.length,r),this.maxIndex=1<<t.length,this.value=new Array(r),this.hasNext=r>0&&r<=t.length}}});var B2,Gye,Hye=M(()=>{B2=[],Gye={links:B2,terminalLinks:B2,elements:B2,partialElements:B2,getElementIndices:()=>B2,getLinkIndices:()=>B2,getTerminalLinkIndices:()=>B2}});function Bft(e,t){let r=-1,n=-1,o=-1,i=-1,{elements:a}=e,{type_symbol:s,label_atom_id:l}=e.model.atomicHierarchy.atoms,{b:c,offset:u}=e.bonds;for(let d=0,f=t.length;d<f;++d){let m=a[t[d]];if(s.value(m)!==Ql)continue;let p=0,h=0;for(let g=u[t[d]],y=u[t[d]+1];g<y;++g){let b=a[c[g]],x=s.value(b);x===UD?++p:x===Ql&&++h}if(p===2){r=m;break}else p===1&&h===1?n=m:l.value(m).startsWith("C1")?o=m:i=m}return r!==-1?r:n!==-1?n:o!==-1?o:i!==-1?i:a[t[0]]}function Rft(e,t){let{elements:r}=e,{label_alt_id:n}=e.model.atomicHierarchy.atoms;return n.value(r[t])}function Oft(e,t,r,n){let o=t.conformation;return v.normalize(e,v.sub(e,n,o.position(r,e))),e}function Wye(e,t){let{elements:r}=e,{label_atom_id:n}=e.model.atomicHierarchy.atoms;return n.value(r[t])}function Lft(e,t){if(!t||!t.length)return;let{unit:r,all:n}=e,o=new Set,i=DK(ls(new Array(t.length)),2);for(let a=0,s=i.length;a<s;++a){let l=i[a],c=n[t[l[0]]],u=n[t[l[1]]];je.areIntersecting(c,u)&&qf.getAltId(r,c)===qf.getAltId(r,u)&&(o.add(t[l[0]]),o.add(t[l[1]]))}if(o.size){let a=[];for(let s=0,l=t.length;s<l;++s)o.has(t[s])||a.push(t[s]);return a}else return t}function Fft(e,t){return t.properties.saccharideComponentMap.get(e)}function Kye(e){if(e.models.reduce((f,m)=>f+m.properties.saccharideComponentMap.size,0)===0)return Gye;let t=[],r=[],n=[],o=[],i=new Map;function a(f,m,p){return`${f}|${m}|${p}`}function s(f,m){i.has(f)?i.get(f).push(m):i.set(f,[m])}function l(f,m){v.sub(n[f].geometry.direction,n[m].geometry.center,n[f].geometry.center),v.normalize(n[f].geometry.direction,n[f].geometry.direction)}let c=v();function u(f,m,p){let h=p.conformation,g=n[f].geometry;v.sub(g.direction,h.position(p.elements[m],c),g.center),v.normalize(g.direction,g.direction)}for(let f=0,m=e.units.length;f<m;++f){let p=e.units[f];if(!fe.isAtomic(p))continue;let{model:h,rings:g}=p,{chainAtomSegments:y,residueAtomSegments:b,atoms:x}=h.atomicHierarchy,{label_comp_id:C}=x,S=nr.transientSegments(y,p.elements),w=nr.transientSegments(b,p.elements),A;for(;S.hasNext;)for(w.setSegment(S.move());w.hasNext;){let{index:T}=w.move(),D=Fft(C.value(b.offsets[T]),h);if(!D)continue;A||(A=sx.byFingerprintAndResidue(g,Mft));let E=Lft(g,A.get(T));if(!E||!E.length){o.push({unit:p,residueIndex:T,component:D});continue}let I=[];for(let R=0,B=E.length;R<B;++R){let O=g.all[E[R]],F=Bft(p,O),q=jc.calculateMomentsAxes(J4(p,O)),W=jc.calculateNormalizedAxes(q),j=v.copy(v(),W.origin),L=v.copy(v(),W.dirC),V=Oft(v(),p,F,j);v.orthogonalize(V,L,V);let U=qf.getAltId(p,O),z=n.length;I.push(z),s(a(T,p.id,U),z),U&&s(a(T,p.id,""),z),n.push({geometry:{center:j,normal:L,direction:V},component:D,ringIndex:E[R],altId:U,unit:p,residueIndex:T})}let k=DK(ls(new Array(E.length)),2);for(let R=0,B=k.length;R<B;++R){let O=k[R],F=g.all[E[O[0]]],q=g.all[E[O[1]]];if(Ns.areVertexSetsConnected(p.bonds,F,q,3)){let W=I[O[0]],j=I[O[1]];n[W].altId===n[j].altId&&(l(W,j),l(j,W),t.push({carbohydrateIndexA:W,carbohydrateIndexB:j}),t.push({carbohydrateIndexA:j,carbohydrateIndexB:W}))}}}}function d(f,m){return i.get(a(f.getResidueIndex(m),f.id,Rft(f,m)))||[]}for(let f=0,m=n.length;f<m;++f){let p=n[f],{unit:h}=p;for(let g=f+1;g<m;++g){let y=n[g];if(h!==y.unit||p.residueIndex===y.residueIndex)continue;let b=h.rings.all[p.ringIndex],x=h.rings.all[y.ringIndex];Ns.areVertexSetsConnected(h.bonds,b,x,3)&&(l(f,g),l(g,f),t.push({carbohydrateIndexA:f,carbohydrateIndexB:g}),t.push({carbohydrateIndexA:g,carbohydrateIndexB:f}))}}for(let f=0,m=e.units.length;f<m;++f){let p=e.units[f];fe.isAtomic(p)&&e.interUnitBonds.getConnectedUnits(p.id).forEach(h=>{h.connectedIndices.forEach(g=>{h.getEdges(g).forEach(({props:y,indexB:b})=>{if(!Tt.isCovalent(y.flag))return;let x=e.unitMap.get(h.unitA),C=e.unitMap.get(h.unitB),S=d(x,g),w=d(C,b);if(S.length>0&&w.length>0){let A=S.length,T=w.length;for(let D=0,E=Math.max(A,T);D<E;++D){let I=S[Math.min(D,A-1)],k=w[Math.min(D,T-1)],R=Wye(x,g);(R.startsWith("O1")||R.startsWith("C1"))&&l(I,k),t.push({carbohydrateIndexA:I,carbohydrateIndexB:k})}}else if(w.length===0)for(let A of S){let T=Wye(x,g);(T.startsWith("O1")||T.startsWith("C1"))&&u(A,b,C),r.push({carbohydrateIndex:A,elementIndex:b,elementUnit:C,fromCarbohydrate:!0})}else if(S.length===0)for(let A of w)r.push({carbohydrateIndex:A,elementIndex:g,elementUnit:x,fromCarbohydrate:!1})})})})}return{links:t,terminalLinks:r,elements:n,partialElements:o,...Nft(n,t,r)}}function Nft(e,t,r){function n(d,f){return Xa(d.id,f)}function o(d,f,m){let p=[],h=d.get(n(f,m));if(h!==void 0)for(let g of h)Li(p,g);return p}let i=new Map;for(let d=0,f=e.length;d<f;++d){let{unit:m,ringIndex:p}=e[d],h=m.rings.all[p];for(let g=0,y=h.length;g<y;++g){let b=n(m,m.elements[h[g]]),x=i.get(b);x===void 0?i.set(b,[d]):x.push(d)}}function a(d,f){return o(i,d,f)}let s=new Map;for(let d=0,f=t.length;d<f;++d){let m=t[d],{unit:p,ringIndex:h}=e[m.carbohydrateIndexA],g=p.rings.all[h];for(let y=0,b=g.length;y<b;++y){let x=n(p,p.elements[g[y]]),C=s.get(x);C===void 0?s.set(x,[d]):C.push(d)}}function l(d,f){return o(s,d,f)}let c=new Map;for(let d=0,f=r.length;d<f;++d){let{fromCarbohydrate:m,carbohydrateIndex:p,elementUnit:h,elementIndex:g}=r[d];if(m){let{unit:y,ringIndex:b}=e[p],x=y.rings.all[b];for(let C=0,S=x.length;C<S;++C){let w=n(y,y.elements[x[C]]),A=c.get(w);A===void 0?c.set(w,[d]):A.push(d)}}else{let y=n(h,h.elements[g]),b=c.get(y);b===void 0?c.set(y,[d]):b.push(d)}}function u(d,f){return o(c,d,f)}return{getElementIndices:a,getLinkIndices:l,getTerminalLinkIndices:u}}var Ql,UD,Mft,Yye=M(()=>{Ut();jye();P0();Ge();Y1();Jn();Br();ax();sd();Hye();eL();tn();Ql=ig("C"),UD=ig("O"),Mft=[qf.elementFingerprint([Ql,Ql,Ql,UD]),qf.elementFingerprint([Ql,Ql,Ql,Ql,UD]),qf.elementFingerprint([Ql,Ql,Ql,Ql,Ql,UD]),qf.elementFingerprint([Ql,Ql,Ql,Ql,Ql,Ql,UD])]});function zft(e){return e>500?Uft:Vft}function Xye(e){let{units:t}=e,r=zft(t.length);r.reset();for(let n=0,o=t.length;n<o;n++){let i=t[n],a=i.boundary,s=i.conformation.operator;s.isIdentity?r.includeSphere(a.sphere):(be.transform(ML,a.sphere,s.matrix),r.includeSphere(ML))}r.finishedIncludeStep();for(let n=0,o=t.length;n<o;n++){let i=t[n],a=i.boundary,s=i.conformation.operator;s.isIdentity?r.radiusSphere(a.sphere):(be.transform(ML,a.sphere,s.matrix),r.radiusSphere(ML))}return{box:r.getBox(),sphere:r.getSphere()}}var ML,Uft,Vft,Zye=M(()=>{or();Bp();ML=be(),Uft=new Va("14"),Vft=new Va("98")});function $ye(e){let{units:t,elementCount:r,unitIndexMap:n}=e,o=new Uint32Array(t.length),i=new Uint32Array(r),a=new Uint32Array(r);for(let s=0,l=0,c=t.length;s<c;++s){o[s]=l;let{elements:u}=t[s];for(let d=0,f=u.length;d<f;++d){let m=l+d;i[m]=s,a[m]=u[d]}l+=u.length}return{cumulativeUnitElementCount:o,unitIndices:i,elementIndices:a,getSerialIndex:(s,l)=>o[n.get(s.id)]+Se.indexOf(s.elements,l)}}function Qye(e){let t=0,r=[];for(let l of e.unitSymmetryGroups){r.push(t);let c=l.units[0];fe.isAtomic(c)&&(t+=c.bonds.edgeCount*2*l.units.length)}let n=new Uint32Array(t),o=new Uint32Array(t),i=new Uint32Array(t),a=0,s=0;for(let l of e.unitSymmetryGroups){let c=l.units[0];if(fe.isAtomic(c)){let u=c.bonds.edgeCount*2;for(let d=0,f=l.units.length;d<f;++d)for(let m=0,p=u;m<p;++m)n[a]=s,o[a]=m,i[a]=d,a+=1}s+=1}return{bondCount:t,unitIndex:n,unitEdgeIndex:o,unitGroupIndex:i,unitGroupOffset:r}}var Jye=M(()=>{oD();sd()});function qft(e,t,r){return e[t].id-e[r].id}function jft(e){let{units:t}=e,r=$n.create();for(let n of t)$n.add(r,n.model.id,n.model);return r.array}function Gft(e){let{microheterogeneityCompIds:t}=nt.residue,r=new Set,n=te.Location.create(e);for(let o of e.unitSymmetryGroups){let i=o.units[0];if(!fe.isAtomic(i))continue;let a=nr.transientSegments(i.model.atomicHierarchy.residueAtomSegments,i.elements);for(n.unit=i;a.hasNext;){let s=a.move();n.element=i.elements[s.start];let l=t(n);for(let c of l)r.add(c)}}return r}function Hft(e){let t=nt.atom.type_symbol,r=new Set,n=te.Location.create(e);for(let o of e.unitSymmetryGroups){let i=o.units[0];if(fe.isAtomic(i)){n.unit=i;for(let a=0,s=i.elements.length;a<s;++a)n.element=i.elements[a],r.add(t(n))}}return r}function Wft(e){let{units:t}=e,r=te.Location.create(e),n=$n.create();for(let o of t){let i=o.kind===fe.Kind.Atomic?nt.entity.key:nt.coarse.entityKey;r.unit=o;let a=o.elements,s=nr.transientSegments(o.model.atomicHierarchy.chainAtomSegments,a);for(;s.hasNext;){let l=s.move();r.element=a[l.start];let c=i(r);$n.add(n,c,c)}}return Yl(n.array),n.array}function Kft(e){let t=new Map,r=[],n=e.unitSymmetryGroups;for(let i of n){let a=i.units[0];if(!fe.isAtomic(a))continue;let s;t.has(a.model.id)?s=t.get(a.model.id):(s=$n.create(),r.push(a.model.id),t.set(a.model.id,s));let l=nr.transientSegments(a.model.atomicHierarchy.residueAtomSegments,a.elements);for(;l.hasNext;){let c=l.move();$n.add(s,c.index,c.index)}}let o=new Map;for(let i of r){let a=t.get(i).array;Yl(a),o.set(i,a)}return o}function Yft(e){let{unitSymmetryGroups:t}=e,r=0;for(let n=0,o=t.length;n<o;n++)r+=t[n].elements.length;return r}function Xft(e){let{units:t}=e,r=0;for(let n=0,o=t.length;n<o;n++)r+=t[n].polymerElements.length;return r}function Zft(e){let{units:t}=e,r=0;for(let n=0,o=t.length;n<o;n++)r+=t[n].gapElements.length/2;return r}function $ft(e){let{units:t}=e,r=0;for(let n=0,o=t.length;n<o;n++)t[n].polymerElements.length>0&&(r+=1);return r}function Qft(e){let{units:t}=e,r=0;for(let n=0,o=t.length;n<o;n++){let i=t[n];if(!fe.isAtomic(i))continue;let{elements:a,residueIndex:s}=i,l=-1,c=-1;for(let u=0,d=a.length;u<d;++u)l=s[a[u]],l!==c&&(r+=1,c=l)}return r}var Oe,ug=M(()=>{Ut();ku();hT();nx();tn();ib();sd();sL();zye();CD();DD();lb();Yye();Ge();td();Fs();mg();M2();hr();Zye();Jye();Oe=class e{subsetBuilder(t){return new kL(this,t)}get elementCount(){return this.state.elementCount}get bondCount(){return this.state.bondCount===-1&&(this.state.bondCount=this.interUnitBonds.edgeCount/2+kt.getIntraUnitBondCount(this)),this.state.bondCount}get hasCustomProperties(){return!!this.state.customProps&&this.state.customProps.all.length>0}get customPropertyDescriptors(){return this.state.customProps||(this.state.customProps=new Ls),this.state.customProps}get currentPropertyData(){return this.state.propertyData||(this.state.propertyData=Object.create(null)),this.state.propertyData}get inheritedPropertyData(){return this.parent?this.parent.currentPropertyData:this.currentPropertyData}get polymerResidueCount(){return this.state.polymerResidueCount===-1&&(this.state.polymerResidueCount=Xft(this)),this.state.polymerResidueCount}get polymerGapCount(){return this.state.polymerGapCount===-1&&(this.state.polymerGapCount=Zft(this)),this.state.polymerGapCount}get polymerUnitCount(){return this.state.polymerUnitCount===-1&&(this.state.polymerUnitCount=$ft(this)),this.state.polymerUnitCount}get uniqueElementCount(){return this.state.uniqueElementCount===-1&&(this.state.uniqueElementCount=Yft(this)),this.state.uniqueElementCount}get atomicResidueCount(){return this.state.atomicResidueCount===-1&&(this.state.atomicResidueCount=Qft(this)),this.state.atomicResidueCount}get isCoarseGrained(){return this.models.some(t=>Ht.isCoarseGrained(t))}get isEmpty(){return this.units.length===0}get hashCode(){return this.state.hashCode!==-1?this.state.hashCode:this.computeHash()}get transformHash(){return this.state.transformHash!==-1?this.state.transformHash:(this.state.transformHash=Fi(this.units.map(t=>t.id)),this.state.transformHash)}computeHash(){let t=23;for(let r=0,n=this.units.length;r<n;r++){let o=this.units[r];t=31*t+o.id|0,t=31*t+je.hashCode(o.elements)|0}return t=31*t+this.elementCount|0,t=d4(t),t===-1&&(t=0),this.state.hashCode=t,t}elementLocations(){return new e.ElementLocationIterator(this)}get root(){var t;return(t=this.state.parent)!==null&&t!==void 0?t:this}get parent(){return this.state.parent}get coordinateSystem(){return this.state.coordinateSystem}get label(){return this.state.label}get boundary(){return this.state.boundary?this.state.boundary:(this.state.boundary=Xye(this),this.state.boundary)}get lookup3d(){return this.state.lookup3d?this.state.lookup3d:(this.state.lookup3d=new aL(this),this.state.lookup3d)}get interUnitBonds(){return this.state.interUnitBonds?this.state.interUnitBonds:(this.parent&&this.state.dynamicBonds===this.parent.state.dynamicBonds&&this.parent.state.interUnitBonds&&this.parent.state.interUnitBonds.edgeCount===0?this.state.interUnitBonds=new k0(new Map):this.state.interUnitBonds=kge(this,{ignoreWater:!this.dynamicBonds,ignoreIon:!this.dynamicBonds,validUnit:this.state.interBondsValidUnit,validUnitPair:this.state.interBondsValidUnitPair}),this.state.interUnitBonds)}get dynamicBonds(){return this.state.dynamicBonds}get interBondsValidUnit(){return this.state.interBondsValidUnit}get interBondsValidUnitPair(){return this.state.interBondsValidUnitPair}get unitSymmetryGroups(){return this.state.unitSymmetryGroups?this.state.unitSymmetryGroups:(this.state.unitSymmetryGroups=Yd.computeTransformGroups(this),this.state.unitSymmetryGroups)}get unitSymmetryGroupsIndexMap(){return this.state.unitSymmetryGroupsIndexMap?this.state.unitSymmetryGroupsIndexMap:(this.state.unitSymmetryGroupsIndexMap=fe.SymmetryGroup.getUnitSymmetryGroupsIndexMap(this.unitSymmetryGroups),this.state.unitSymmetryGroupsIndexMap)}get carbohydrates(){return this.state.carbohydrates?this.state.carbohydrates:(this.state.carbohydrates=Kye(this),this.state.carbohydrates)}get models(){return this.state.models?this.state.models:(this.state.models=jft(this),this.state.models)}get uniqueResidueNames(){return this.state.uniqueResidueNames||(this.state.uniqueResidueNames=Gft(this))}get uniqueElementSymbols(){return this.state.uniqueElementSymbols||(this.state.uniqueElementSymbols=Hft(this))}get entityIndices(){return this.state.entityIndices||(this.state.entityIndices=Wft(this))}get uniqueAtomicResidueIndices(){return this.state.uniqueAtomicResidueIndices||(this.state.uniqueAtomicResidueIndices=Kft(this))}get isAtomic(){for(let t of this.units)if(!fe.isAtomic(t))return!1;return!0}get hasAtomic(){for(let t of this.units)if(fe.isAtomic(t))return!0;return!1}get isCoarse(){for(let t of this.units)if(!fe.isCoarse(t))return!1;return!0}get hasCoarse(){for(let t of this.units)if(fe.isCoarse(t))return!0;return!1}get serialMapping(){return this.state.serialMapping||(this.state.serialMapping=$ye(this))}get intraUnitBondMapping(){return this.state.intraUnitBondMapping||(this.state.intraUnitBondMapping=Qye(this))}get model(){if(this.state.model)return this.state.model;if(this.state.representativeModel)return this.state.representativeModel;if(this.state.masterModel)return this.state.masterModel;let t=this.models;if(t.length>1)throw new Error("The structure is based on multiple models and has neither a master- nor a representative-model.");return this.state.model=t[0],this.state.model}get masterModel(){return this.state.masterModel}get representativeModel(){return this.state.representativeModel}hasElement(t){return this.unitMap.has(t.unit.id)?je.has(this.unitMap.get(t.unit.id).elements,t.element):!1}getModelIndex(t){return this.models.indexOf(t)}remapModel(t){let{dynamicBonds:r,interUnitBonds:n,parent:o}=this.state,i=[];for(let a of this.unitSymmetryGroups){let s=a.units[0].remapModel(t,r);i.push(s);for(let l=1,c=a.units.length;l<c;++l){let u=a.units[l];i.push(u.remapModel(t,r,s.props))}}return e.create(i,{parent:o?.remapModel(t),label:this.label,interUnitBonds:r?void 0:n,dynamicBonds:r,interBondsValidUnit:this.state.interBondsValidUnit,interBondsValidUnitPair:this.state.interBondsValidUnitPair,coordinateSystem:this.state.coordinateSystem,masterModel:this.state.masterModel,representativeModel:this.state.representativeModel})}asParent(){if(this._proxy)return this._proxy;if(this.parent){let t=this.parent.coordinateSystem.isIdentity?this.parent:e.transform(this.parent,this.parent.coordinateSystem.inverse),r=this.coordinateSystem.isIdentity?t:e.transform(t,this.coordinateSystem.matrix);this._proxy=new e(r.units,r.unitMap,r.unitIndexMap,{...r.state,dynamicBonds:this.dynamicBonds},{child:this,target:this.parent})}else this._proxy=this;return this._proxy}get child(){return this._child}get target(){var t;return(t=this._target)!==null&&t!==void 0?t:this}constructor(t,r,n,o,i){this.units=t,this.unitMap=r,this.unitIndexMap=n,this.state=o,this._child=i?.child,this._target=i?.target,this._proxy=void 0}};(function(e){e.Empty=l([]);function t(X){return{kind:"structure-loci",structure:X}}e.Loci=t;function r(X){let Y=[];for(let ne of X.units)Y.push({unit:ne,indices:xe.ofBounds(0,ne.elements.length)});return te.Loci(X,Y)}e.toStructureElementLoci=r;function n(X,Y){return ht.toLociWithSourceUnits(ht.Singletons(X,Y))}e.toSubStructureElementLoci=n;function o(X){return!!X&&X.kind==="structure-loci"}e.isLoci=o;function i(X,Y){return X.structure===Y.structure}e.areLociEqual=i;function a(X){return X.structure.isEmpty}e.isLociEmpty=a;function s(X,Y){return Y===X.structure?X:t(Y)}e.remapLoci=s;function l(X,Y={}){let ne=Pc.Mutable(),K=Pc.Mutable(),$=0,Z=!0,de=X.length>0?X[0].id:0;for(let ae=0,ye=X.length;ae<ye;ae++){let we=X[ae];ne.set(we.id,we),$+=we.elements.length,we.id<de&&(Z=!1),de=we.id}Z||tT(X,0,X.length,qft,eg);for(let ae=0,ye=X.length;ae<ye;ae++)K.set(X[ae].id,ae);let Q={hashCode:-1,transformHash:-1,elementCount:$,bondCount:-1,uniqueElementCount:-1,atomicResidueCount:-1,polymerResidueCount:-1,polymerGapCount:-1,polymerUnitCount:-1,dynamicBonds:!1,coordinateSystem:mo.Default,label:""};return Y.parent&&(Q.parent=Y.parent.parent||Y.parent),Y.interUnitBonds&&(Q.interUnitBonds=Y.interUnitBonds),Y.interBondsValidUnit?Q.interBondsValidUnit=Y.interBondsValidUnit:Y.parent&&(Q.interBondsValidUnit=Y.parent.interBondsValidUnit),Y.interBondsValidUnitPair?Q.interBondsValidUnitPair=Y.interBondsValidUnitPair:Y.parent&&(Q.interBondsValidUnitPair=Y.parent.interBondsValidUnitPair),Y.dynamicBonds?Q.dynamicBonds=Y.dynamicBonds:Y.parent&&(Q.dynamicBonds=Y.parent.dynamicBonds),Y.coordinateSystem?Q.coordinateSystem=Y.coordinateSystem:Y.parent&&(Q.coordinateSystem=Y.parent.coordinateSystem),Y.label?Q.label=Y.label:Y.parent&&(Q.label=Y.parent.label),Y.masterModel?Q.masterModel=Y.masterModel:Y.parent&&(Q.masterModel=Y.parent.masterModel),Y.representativeModel?Q.representativeModel=Y.representativeModel:Y.parent&&(Q.representativeModel=Y.parent.representativeModel),new e(X,ne,K,Q)}e.create=l;async function c(X,Y){if(X.frameCount===0)return e.Empty;let ne=[],K,$=0;for(let Z=0,de=X.frameCount;Z<de;++Z){let Q=await Me.resolveInContext(X.getFrameAtIndex(Z),Y);K||(K=Q);let ae=u(Q);for(let ye=0,we=ae.units.length;ye<we;++ye){let re=ae.units[ye],ee=re.invariantId+$,le=re.chainGroupId+$,pe=fe.create(ne.length,ee,le,re.traits,re.kind,re.model,re.conformation.operator,re.elements);ne.push(pe)}$=ne.length}return l(ne,{representativeModel:K,label:K.label})}e.ofTrajectory=c;function u(X,Y={}){let ne=X.atomicHierarchy.chainAtomSegments,{index:K}=X.atomicHierarchy,{auth_asym_id:$}=X.atomicHierarchy.chains,{atomicChainOperatorMappinng:Z}=X,de=new h({label:X.label,...Y});for(let ae=0;ae<ne.count;ae++){let ye=Z.get(ae)||mo.Default,we=ne.offsets[ae],re=!1,ee=!1;if(d(X,ae))for(ee=!0;ae+1<ne.count&&d(X,ae+1);){let ke=Z.get(ae),Ve=Z.get(ae+1);if(ke!==Ve)break;re=!0,ae++}else for(;ae+1<ne.count&&ne.offsets[ae+1]-ne.offsets[ae]===1&&ne.offsets[ae+2]-ne.offsets[ae+1]===1;){let ke=K.getEntityFromChain(ae),Ve=K.getEntityFromChain(ae+1);if(ke!==Ve)break;let Xe=$.value(ae),pt=$.value(ae+1);if(Xe!==pt)break;let _e=Z.get(ae),Ie=Z.get(ae+1);if(_e!==Ie)break;re=!0,ae++}let le=je.ofBounds(we,ne.offsets[ae+1]),pe=fe.Trait.None;re&&(pe|=fe.Trait.MultiChain),ee&&(pe|=fe.Trait.Water),Ht.isCoarseGrained(X)&&(pe|=fe.Trait.CoarseGrained),de.addUnit(fe.Kind.Atomic,X,ye,le,pe)}let Q=X.coarseHierarchy;return Q.isDefined&&(Q.spheres.count>0&&f(de,X,X.coarseHierarchy.spheres,fe.Kind.Spheres),Q.gaussians.count>0&&f(de,X,X.coarseHierarchy.gaussians,fe.Kind.Gaussians)),de.getStructure()}e.ofModel=u;function d(X,Y){let ne=X.atomicHierarchy.index.getEntityFromChain(Y);return X.entities.data.type.value(ne)==="water"}function f(X,Y,ne,K){let{chainElementSegments:$}=ne;for(let Z=0;Z<$.count;Z++){let de=je.ofBounds($.offsets[Z],$.offsets[Z+1]);X.addUnit(K,Y,mo.Default,de,fe.Trait.None)}}function m(X,Y){if(H.isIdentity(Y))return X;if(!H.isRotationAndTranslation(Y,mo.RotationTranslationEpsilon))throw new Error("Only rotation/translation combination can be applied.");let ne=[];for(let Z of X.units){let de=Z.conformation.operator,Q=mo.create(de.name,Y,de);ne.push(Z.applyOperator(Z.id,Q))}let K=X.coordinateSystem,$=mo.compose(mo.create(K.name,Y,K),K);return l(ne,{parent:X,coordinateSystem:$})}e.transform=m;function p(X,Y){for(let $ of Y)if(!H.isRotationAndTranslation($,mo.RotationTranslationEpsilon))throw new Error("Only rotation/translation combination can be applied.");let ne=[],K=0;for(let $ of X.units){let Z=$.conformation.operator;for(let de of Y){if(H.isIdentity(de)){ne.push($);continue}let Q=mo.create(Z.name,de,Z);ne.push($.applyOperator(K++,Q))}}return l(ne,{parent:X})}e.instances=p;class h{beginChainGroup(){this.chainGroupId++,this.inChainGroup=!0}endChainGroup(){this.inChainGroup=!1}addUnit(Y,ne,K,$,Z,de){de===void 0&&(de=this.invariantId());let Q=this.inChainGroup?this.chainGroupId:++this.chainGroupId,ae=fe.create(this.units.length,de,Q,Z,Y,ne,K,$);return this.add(ae)}copyUnit(Y,ne){let K=ne?.invariantId;K===void 0&&(K=this.invariantId());let $=this.inChainGroup?this.chainGroupId:++this.chainGroupId,Z=Y.getCopy(this.units.length,K,$,ne);return this.add(Z)}add(Y){if(Y.elements.length===1){Y.conformation.position(Y.elements[0],this.p);let ne=[Y.invariantId,this.p[0],this.p[1],this.p[2]].join("|");if(this.singleElementUnits.has(ne))return this.singleElementUnits.get(ne);this.singleElementUnits.set(ne,Y)}return this.units.push(Y),Y}addWithOperator(Y,ne,K=!1){return this.add(Y.applyOperator(this.units.length,ne,K))}getStructure(){return l(this.units,this.props)}get isEmpty(){return this.units.length===0}constructor(Y={}){this.props=Y,this.units=[],this.invariantId=Zi(),this.chainGroupId=-1,this.inChainGroup=!1,this.p=v(),this.singleElementUnits=new Map}}e.StructureBuilder=h;function g(X={}){return new h(X)}e.Builder=g;function y(X){return X.hashCode}e.hashCode=y;function b(X){return eD(X.units.map(Y=>fe.conformationId(Y)).join("|"))}e.conformationHash=b;function x(X,Y){if(X===Y)return!0;if(X.elementCount!==Y.elementCount)return!1;let ne=X.units.length;if(ne!==Y.units.length)return!1;for(let K=0;K<ne;K++)if(X.units[K].id!==Y.units[K].id)return!1;return!0}e.areUnitIdsEqual=x;function C(X,Y){if(X===Y)return!0;if(!x(X,Y))return!1;for(let ne=0,K=X.units.length;ne<K;ne++)if(!je.areEqual(X.units[ne].elements,Y.units[ne].elements))return!1;return!0}e.areUnitIdsAndIndicesEqual=C;function S(X,Y){if(X.hashCode!==Y.hashCode)return!1;let ne=X.models.length;if(ne!==Y.models.length)return!1;for(let K=0;K<ne;K++)if(!Ht.areHierarchiesEqual(X.models[K],Y.models[K]))return!1;return!0}e.areHierarchiesEqual=S;function w(X,Y){return X===Y||X.hashCode===Y.hashCode&&Yd.areTransformGroupsEquivalent(X.unitSymmetryGroups,Y.unitSymmetryGroups)}e.areEquivalent=w;function A(X,Y){return w(X.root,Y.root)}e.areRootsEquivalent=A;function T(X,Y){return X.root===Y.root}e.areRootsEqual=T;class D{move(){return this.advance(),this.current.element=this.elements[this.idx],this.current}advance(){if(this.idx<this.maxIdx){this.idx++,this.idx===this.maxIdx&&(this.hasNext=this.unitIndex+1<this.structure.units.length);return}if(this.idx=0,this.unitIndex++,this.unitIndex>=this.structure.units.length){this.hasNext=!1;return}this.current.unit=this.structure.units[this.unitIndex],this.elements=this.current.unit.elements,this.maxIdx=this.elements.length-1,this.maxIdx===0&&(this.hasNext=this.unitIndex+1<this.structure.units.length)}constructor(Y){this.structure=Y,this.unitIndex=0,this.maxIdx=0,this.idx=-1,this.current=te.Location.create(Y),this.hasNext=Y.elementCount>0,this.hasNext&&(this.elements=Y.units[0].elements,this.maxIdx=this.elements.length-1,this.current.unit=Y.units[0])}}e.ElementLocationIterator=D;let E=v();function I(X,Y,ne){let{elements:K,conformation:$}=X,Z=E,de=Number.MAX_VALUE;for(let Q=0,ae=K.length;Q<ae;Q++){let ye=K[Q],we=v.distance(Y,$.position(ye,Z))-ne-$.r(ye);we<de&&(de=we)}return de}function k(X,Y,ne){let{units:K}=X,$=Number.MAX_VALUE;for(let Z=0,de=K.length;Z<de;Z++){let Q=K[Z],ae=I(Q,Y,ne);ae<$&&($=ae)}return $}e.minDistanceToPoint=k;let R=v();function B(X,Y){if(X.elementCount===0||Y.elementCount===0)return 0;let{units:ne}=X,K=Number.MAX_VALUE;for(let $=0,Z=ne.length;$<Z;$++){let de=ne[$],{elements:Q,conformation:ae}=de;for(let ye=0,we=Q.length;ye<we;ye++){let re=Q[ye],ee=k(Y,ae.position(re,R),ae.r(re));ee<K&&(K=ee)}}return K}e.distance=B;function O(X){return X.elementCount===1?"1 element":`${X.elementCount} elements`}e.elementDescription=O;function F(X,Y,ne){return X.masterModel?Y.model===ne.model||Y.model===X.masterModel||ne.model===X.masterModel:Y.model===ne.model}e.validUnitPair=F;function q(X,Y,ne){let{maxRadius:K,validUnit:$,validUnitPair:Z}=ne;if(!X.units.some(ae=>$(ae)))return;let de=X.lookup3d,Q=v();for(let ae of X.units){if(!$(ae))continue;let ye=ae.boundary.sphere;v.transformMat4(Q,ye.center,ae.conformation.operator.matrix);let we=de.findUnitIndices(Q[0],Q[1],Q[2],ye.radius+K);for(let re=0;re<we.count;re++){let ee=X.units[we.indices[re]];ae.id>=ee.id||!$(ee)||!Z(ae,ee)||(ee.elements.length>=ae.elements.length?Y(ae,ee):Y(ee,ae))}}}e.eachUnitPair=q;function W(X,{chain:Y,residue:ne,atom:K}){let $=te.Location.create(X);for(let Z of X.units){if(Z.kind!==fe.Kind.Atomic)continue;$.unit=Z;let{elements:de}=Z,Q=nr.transientSegments(Z.model.atomicHierarchy.chainAtomSegments,de),ae=nr.transientSegments(Z.model.atomicHierarchy.residueAtomSegments,de);for(;Q.hasNext;){let ye=Q.move();if(Y&&($.element=de[ye.start],Y($)),!(!ne&&!K))for(ae.setSegment(ye);ae.hasNext;){let we=ae.move();if(ne&&($.element=de[we.start],ne($)),!!K)for(let re=we.start,ee=we.end;re<ee;re++)$.element=de[re],K($)}}}}e.eachAtomicHierarchyElement=W,e.DefaultSizeThresholds={smallResidueCount:10,mediumResidueCount:5e3,largeResidueCount:3e4,highSymmetryUnitCount:10,fiberResidueCount:15};function j(X){return X.unitSymmetryGroups.filter(Y=>Y.units[0].polymerElements.length>0)}function L(X,Y){let ne=j(X);return ne.length===1&&ne[0].units.length>2&&ne[0].units[0].polymerElements.length<Y.fiberResidueCount}function V(X,Y){let ne=j(X);return ne.length>=1&&ne[0].units.length>Y.highSymmetryUnitCount}let U;(function(X){X[X.Small=0]="Small",X[X.Medium=1]="Medium",X[X.Large=2]="Large",X[X.Huge=3]="Huge",X[X.Gigantic=4]="Gigantic"})(U=e.Size||(e.Size={}));function z(X,Y={},ne=1){let K={...e.DefaultSizeThresholds,...Y};return X.polymerResidueCount>=K.largeResidueCount*ne?V(X,K)?U.Huge:U.Gigantic:L(X,K)||X.polymerResidueCount<K.smallResidueCount*ne?U.Small:X.polymerResidueCount<K.mediumResidueCount*ne?U.Medium:U.Large}e.getSize=z,e.Index=Xd.createSimple("index","root"),e.MaxIndex=Xd.createSimple("max_index","root");let ie="__PrincipalAxes__";function oe(X){if(X.currentPropertyData[ie])return X.currentPropertyData[ie];let Y=te.Loci.getPrincipalAxes(e.toStructureElementLoci(X));return X.currentPropertyData[ie]=Y,Y}e.getPrincipalAxes=oe})(Oe||(Oe={}))});function tve(e,t){return function(n){return e(n,t)}}function BK(e,t){if(gs.isLiteral(t))return R2.Const(t);if(gs.isSymbol(t)){let n=e.table.getRuntime(t.name);return n?n.compile(e):R2.Const(t.name)}if(!gs.isSymbol(t.head))throw new Error("Can only apply symbols.");let r=e.table.getRuntime(t.head.name);if(!r)throw new Error(`Symbol '${t.head.name}' is not implemented.`);return r.compile(e,t.args)}function Zd(e){let t=new MK(LT);return BK(t,e).fn}var kK,LT,MK,eve,R2,OT,gx,BL,VD=M(()=>{FE();gt();kK=class{constructor(){this.map=new Map}removeSymbol(t){this.map.delete(t.symbol.id)}addSymbol(t){this.map.has(t.symbol.id)&&console.warn(`Symbol '${t.symbol.id}' already added. Call removeSymbol/removeCustomProps re-adding the symbol.`),this.map.set(t.symbol.id,t)}addCustomProp(t){if(t.symbols)for(let r of Object.keys(t.symbols))this.addSymbol(t.symbols[r])}removeCustomProp(t){if(t.symbols)for(let r of Object.keys(t.symbols))this.removeSymbol(t.symbols[r])}getRuntime(t){return this.map.get(t)}},LT=new kK,MK=class{constructor(t){this.table=t,this.constQueryContext=new Si(Oe.Empty)}};(function(e){function t(n){return{kind:"const",value:n}}e.Const=t;function r(n){return{kind:"dynamic",runtime:n}}e.Dynamic=r})(eve||(eve={}));(function(e){function t(n){return{isConst:!0,fn:function(i){return n}}}e.Const=t;function r(n){return{isConst:!1,fn:n}}e.Dynamic=r})(R2||(R2={}));(function(e){function t(r,n,o,i){if(typeof r.length=="number")for(let a=0,s=r.length;a<s;a++)o(r[a](n),a,i);else{let a=0;for(let s of Object.keys(r))o(r[s](n),a++,i)}return i}e.forEachEval=t})(OT||(OT={}));(function(e){function t(n,o){return new BL(n,o,!0)}e.Const=t;function r(n,o){return new BL(n,o,!1)}e.Dynamic=r})(gx||(gx={}));BL=class{compile(t,r){let n,o=!1;if(!r)n=void 0,o=!0;else if(gs.isArgumentsArray(r)){n=[],o=!0;for(let i of r){let a=BK(t,i);o=o&&a.isConst,n.push(a.fn)}}else{n=Object.create(null),o=!0;for(let i of Object.keys(r)){let a=BK(t,r[i]);o=o&&a.isConst,n[i]=a.fn}}return this.isConst?this.isConst&&o?R2.Const(this.fn(t.constQueryContext,n)):R2.Dynamic(tve(this.fn,n)):R2.Dynamic(tve(this.fn,n))}constructor(t,r,n){this.symbol=t,this.fn=r,this.isConst=n}}});function Op(e,t){return{kind:"element-loci",structure:e,elements:t}}var Jft,PD=M(()=>{ku();Ut();Ge();wa();ug();sd();tn();M4();Y1();lb();Bp();f4();VD();ID();cL();Jft=Za.diff;(function(e){function t(Z){return!!Z&&Z.kind==="element-loci"}e.is=t;function r(Z,de){if(Z.structure!==de.structure||Z.elements.length!==de.elements.length)return!1;for(let Q=0,ae=Z.elements.length;Q<ae;++Q){let ye=Z.elements[Q],we=de.elements[Q];if(ye.unit.id!==we.unit.id||!Se.areEqual(ye.indices,we.indices))return!1}return!0}e.areEqual=r;function n(Z){for(let de of Z.elements)if(Se.size(de.indices)>0)return!1;return!0}e.isEmpty=n;function o(Z){return i(Z)===Z.structure.elementCount}e.isWholeStructure=o;function i(Z){let de=0;for(let{indices:Q}of Z.elements)typeof Q=="number"?de+=Jft(Q):de+=Q.length;return de}e.size=i;function a(Z){return e(Z,Z.units.map(de=>({unit:de,indices:Se.ofBounds(0,de.elements.length)})))}e.all=a;function s(Z){return e(Z,[])}e.none=s;function l(Z,de,Q){let ae;typeof de=="function"?ae=de(se):ae=de;let ye=Zd(ae)(Q??new Si(Z));return ht.toLociWithSourceUnits(ye)}e.fromExpression=l;function c(Z,de,Q){let ae=de(Q??new Si(Z));return ht.toLociWithSourceUnits(ae)}e.fromQuery=c;function u(Z,de,Q){return AD.toLoci(Z,de,Q)}e.fromSchema=u;function d(Z,de){if(n(Z))return;let Q=Z.elements[0].unit,ae=Q.elements[Se.getAt(Z.elements[0].indices,0)];return de?(de.structure=Z.structure,de.unit=Z.elements[0].unit,de.element=ae,de):$o.create(Z.structure,Q,ae)}e.getFirstLocation=d;function f(Z){return n(Z)?Z:e(Z.structure,[{unit:Z.elements[0].unit,indices:Se.ofSingleton(Se.start(Z.elements[0].indices))}])}e.firstElement=f;function m(Z){return n(Z)?Z:T(f(Z))}e.firstResidue=m;function p(Z){return n(Z)?Z:R(f(Z))}e.firstChain=p;function h(Z){let de=[];for(let Q of Z.elements){let{unit:ae,indices:ye}=Q,we=new Int32Array(Se.size(ye));Se.forEach(ye,(re,ee)=>we[ee]=ae.elements[re]),de.push(ae.getChild(je.ofSortedArray(we)))}return Oe.create(de,{parent:Z.structure.parent})}e.toStructure=h;function g(Z,de,Q){if(e.isEmpty(Z))return;let ae=Q||$o.create(Z.structure);ae.structure=Z.structure;for(let ye of Z.elements){let{unit:we,indices:re}=ye;ae.unit=we;let{elements:ee}=ye.unit;for(let le=0,pe=Se.size(re);le<pe;le++)ae.element=ee[Se.getAt(re,le)],de(ae)}}e.forEachLocation=g;function y(Z,de){if(de===Z.structure)return Z;let Q=[];return Z.elements.forEach(ae=>{if(!de.unitMap.has(ae.unit.id))return;let ye=de.unitMap.get(ae.unit.id),we=Se.indexedIntersect(ae.indices,ae.unit.elements,ye.elements);Se.size(we)>0&&Q.push({unit:ye,indices:we})}),e(de,Q)}e.remap=y;function b(Z,de){if(Z.elements.length>de.elements.length)return b(de,Z);if(e.isEmpty(Z))return de;let Q=new Map;for(let ye of Z.elements)Q.set(ye.unit.id,ye.indices);let ae=[];for(let ye of de.elements)Q.has(ye.unit.id)?(ae[ae.length]={unit:ye.unit,indices:Se.union(Q.get(ye.unit.id),ye.indices)},Q.delete(ye.unit.id)):ae[ae.length]=ye;return Q.forEach((ye,we)=>{ae[ae.length]={unit:Z.structure.unitMap.get(we),indices:ye}}),e(Z.structure,ae)}e.union=b;function x(Z,de){let Q=new Map;for(let ye of de.elements)Q.set(ye.unit.id,ye.indices);let ae=[];for(let ye of Z.elements)if(Q.has(ye.unit.id)){let we=Se.subtract(ye.indices,Q.get(ye.unit.id));if(Se.size(we)===0)continue;ae[ae.length]={unit:ye.unit,indices:we}}else ae[ae.length]=ye;return e(Z.structure,ae)}e.subtract=x;function C(Z,de){let Q=new Map;for(let ye of Z.elements)Q.set(ye.unit.id,ye.indices);let ae=[];for(let ye of de.elements){if(!Q.has(ye.unit.id))continue;let we=Se.intersect(Q.get(ye.unit.id),ye.indices);Se.size(we)!==0&&(ae[ae.length]={unit:ye.unit,indices:we})}return e(Z.structure,ae)}e.intersect=C;function S(Z,de){if(Z.elements.length>de.elements.length)return S(de,Z);if(e.isEmpty(Z))return e.isEmpty(de);let Q=new Map;for(let ae of Z.elements)Q.set(ae.unit.id,ae.indices);for(let ae of de.elements)if(Q.has(ae.unit.id)&&Se.areIntersecting(Q.get(ae.unit.id),ae.indices))return!0;return!1}e.areIntersecting=S;function w(Z,de){if(e.isEmpty(Z))return e.isEmpty(de);let Q=new Map;for(let ye of Z.elements)Q.set(ye.unit.id,ye.indices);let ae=!1;for(let ye of de.elements){if(!Q.has(ye.unit.id))return!1;if(Se.isSubset(Q.get(ye.unit.id),ye.indices))ae=!0;else return!1}return ae}e.isSubset=w;function A(Z){return Z.length>3&&je.isRange(Z)?xe.ofRange(Z[0],Z[Z.length-1]):je.ofSortedArray(Z)}function T(Z,de){let Q=[],ae=new Set;for(let ye of Z.elements){if(E(ye)){Q[Q.length]=ye;continue}if(ye.unit.kind===fe.Kind.Atomic){let we=ye.unit.elements,re=ye.unit.model.atomicHierarchy,{label_alt_id:ee}=ye.unit.model.atomicHierarchy.atoms,{index:le,offsets:pe}=re.residueAtomSegments,ke=[],Ve=ye.indices,Xe=Se.size(Ve),pt=0;for(;pt<Xe;){ae.clear();let _e=we[Se.getAt(Ve,pt)],Ie=le[_e];for(ae.add(ee.value(_e)),pt++;pt<Xe;){let ze=we[Se.getAt(Ve,pt)];if(le[ze]!==Ie)break;ae.add(ee.value(ze)),pt++}let Re=ae.has("");for(let ze=pe[Ie],N=pe[Ie+1];ze<N;ze++){let J=Se.indexOf(we,ze);if(J>=0){let Ae=ee.value(ze);(!de||Re||!Ae||ae.has(Ae))&&(ke[ke.length]=J)}}}Q[Q.length]={unit:ye.unit,indices:A(ke)}}else Q[Q.length]=ye}return e(Z.structure,Q)}e.extendToWholeResidues=T;function D(Z){switch(Z.kind){case fe.Kind.Atomic:return Z.model.atomicHierarchy.chainAtomSegments;case fe.Kind.Spheres:return Z.model.coarseHierarchy.spheres.chainElementSegments;case fe.Kind.Gaussians:return Z.model.coarseHierarchy.gaussians.chainElementSegments}}function E(Z){return Z.unit.elements.length===Se.size(Z.indices)}function I(Z,de,Q){let{index:ae}=D(Z),ye=Z.elements,we=0;for(let ee=0,le=ye.length;ee<le;ee++){let pe=ye[ee],ke=ae[pe];de.has(ke)&&we++}if(we===Z.elements.length){Q[Q.length]={unit:Z,indices:xe.ofBounds(0,we)};return}let re=new Int32Array(we);we=0;for(let ee=0,le=ye.length;ee<le;ee++){let pe=ye[ee],ke=ae[pe];de.has(ke)&&(re[we++]=ee)}re.length>0&&(Q[Q.length]={unit:Z,indices:A(re)})}function k(Z,de,Q,ae,ye){let{index:we}=D(Z.elements[0].unit),re=new Set;for(let ee=de;ee<Q;ee++){let le=Z.elements[ee],pe=le.indices,ke=le.unit.elements;for(let Ve=0,Xe=Se.size(pe);Ve<Xe;Ve++)re.add(we[ke[Se.getAt(pe,Ve)]])}if(ae){let ee=Z.elements[0].unit;for(let le of Z.structure.units)fe.areSameChainOperatorGroup(le,ee)&&I(le,re,ye)}else for(let ee=de;ee<Q;ee++)I(Z.elements[ee].unit,re,ye)}function R(Z){let de=[];for(let Q=0,ae=Z.elements.length;Q<ae;Q++){let ye=Z.elements[Q];if(fe.Traits.is(ye.unit.traits,fe.Trait.Partitioned)){let we=Q;for(;Q<ae&&fe.areSameChainOperatorGroup(Z.elements[Q].unit,ye.unit);)Q++;let re=Q;Q--,k(Z,we,re,!0,de)}else E(ye)?de[de.length]=ye:k(Z,Q,Q+1,!1,de)}return e(Z.structure,de)}e.extendToWholeChains=R;function B(Z){return`${Z.unit.model.id}|${nt.entity.id(Z)}`}function O(Z){let de=[],Q=$o.create(Z.structure),ae=new Set,{units:ye}=Z.structure;for(let we=0,re=Z.elements.length;we<re;we++){let ee=Z.elements[we];Q.unit=ee.unit,Q.element=ee.unit.elements[0],ae.add(B(Q))}for(let we=0,re=ye.length;we<re;++we){let ee=ye[we];if(Q.unit=ee,Q.element=ee.elements[0],ae.has(B(Q))){let le=Se.ofBounds(0,ee.elements.length);de[de.length]={unit:ee,indices:le}}}return e(Z.structure,de)}e.extendToWholeEntities=O;function F(Z){let de=[],Q=new Set,{units:ae}=Z.structure;for(let ye=0,we=Z.elements.length;ye<we;ye++){let re=Z.elements[ye];Q.add(re.unit.model.id)}for(let ye=0,we=ae.length;ye<we;++ye){let re=ae[ye];if(Q.has(re.model.id)){let ee=Se.ofBounds(0,re.elements.length);de[de.length]={unit:re,indices:ee}}}return e(Z.structure,de)}e.extendToWholeModels=F;function q(Z,de){let Q=[];for(let ae=0,ye=Se.size(de);ae<ye;++ae)Q.push(Z[Se.getAt(de,ae)]);return je.ofSortedArray(Q)}function W(Z,de){return je.isRange(Z)&&je.areEqual(Z,de)?xe.ofLength(Z.length):A(je.indicesOf(Z,de))}function j(Z){let de=[],Q=new Map;for(let ae=0,ye=Z.elements.length;ae<ye;ae++){let we=Z.elements[ae],{model:re}=we.unit,ee=q(we.unit.elements,we.indices);Q.has(re)?Q.set(re,je.union(ee,Q.get(re))):Q.set(re,ee)}for(let ae=0,ye=Z.structure.units.length;ae<ye;++ae){let we=Z.structure.units[ae],re=Q.get(we.model);if(!re)continue;let ee=W(we.elements,re);Se.size(ee)&&(de[de.length]={unit:we,indices:ee})}return e(Z.structure,de)}e.extendToAllInstances=j;function L(Z){let de=[],Q=new Set,{units:ae}=Z.structure;for(let ye=0,we=Z.elements.length;ye<we;ye++){let re=Z.elements[ye];Q.add(re.unit.conformation.operator.name)}for(let ye=0,we=ae.length;ye<we;++ye){let re=ae[ye];if(Q.has(re.conformation.operator.name)){let ee=Se.ofBounds(0,re.elements.length);de[de.length]={unit:re,indices:ee}}}return e(Z.structure,de)}e.extendToWholeOperators=L;let V=new Va("98"),U=v();function z(Z,de,Q){V.reset();for(let ae of Z.elements){let{indices:ye}=ae,{elements:we,conformation:re}=ae.unit;for(let ee=0,le=Se.size(ye);ee<le;ee++){let pe=we[Se.getAt(ye,ee)];re.position(pe,U),de&&v.transformMat4(U,U,de),V.includePositionRadius(U,re.r(pe))}}V.finishedIncludeStep();for(let ae of Z.elements){let{indices:ye}=ae,{elements:we,conformation:re}=ae.unit;for(let ee=0,le=Se.size(ye);ee<le;ee++){let pe=we[Se.getAt(ye,ee)];re.position(pe,U),de&&v.transformMat4(U,U,de),V.radiusPositionRadius(U,re.r(pe))}}return Q?(Q.box&&V.getBox(Q.box),Q.sphere&&V.getSphere(Q.sphere),Q):{box:V.getBox(),sphere:V.getSphere()}}e.getBoundary=z;let ie=v();function oe(Z,de,Q=0){let ae=Q;for(let ye of Z.elements){let{indices:we}=ye,{elements:re,conformation:ee}=ye.unit,le=Se.size(we);for(let pe=0;pe<le;pe++){let ke=re[Se.getAt(we,pe)];ee.position(ke,ie),v.toArray(ie,de,ae+pe*3)}ae+=le*3}return de}e.toPositionsArray=oe;function X(Z){let de=i(Z),Q=oe(Z,new Float32Array(3*de));return jc.ofPositions(Q)}e.getPrincipalAxes=X;function Y(Z){let de=0;Z.forEach(ye=>{de+=i(ye)});let Q=new Float32Array(3*de),ae=0;return Z.forEach(ye=>{oe(ye,Q,ae),ae+=i(ye)*3}),jc.ofPositions(Q)}e.getPrincipalAxesMany=Y;function ne(Z,de){return fe.isAtomic(Z)?Z.model.atomicHierarchy.atomSourceIndex.value(de):de}function K(Z){if(e.isEmpty(Z))return se.struct.generator.empty();let de=Z.structure.models,Q=new Map;for(let ee of Z.elements){let{indices:le}=ee,{elements:pe}=ee.unit,ke=ee.unit.conformation.operator.name,Ve;Q.has(ke)?Ve=Q.get(ke).xs:(Ve=$n.create(),Q.set(ke,{modelLabel:ee.unit.model.label,modelIndex:ee.unit.model.modelNum,xs:Ve}));for(let Xe=0,pt=Se.size(le);Xe<pt;Xe++){let _e=ne(ee.unit,pe[Se.getAt(le,Xe)]);$n.add(Ve,_e,_e)}}let ae=[],ye=Q.keys();for(;;){let ee=ye.next();if(ee.done)break;let le=Q.get(ee.value);ae.push($(ee.value,le.xs.array,de.length>1,le.modelLabel,le.modelIndex))}let we=new Map;for(let ee=0,le=ae.length;ee<le;++ee){let pe=ae[ee],Ve=`${od(Fi(pe.atom.ranges),Fi(pe.atom.set))}|${pe.entity?pe.entity.modelLabel+pe.entity.modelIndex:""}`;we.has(Ve)?we.get(Ve).chain.opName.push(...pe.chain.opName):we.set(Ve,pe)}let re=[];return we.forEach(ee=>{let{ranges:le,set:pe}=ee.atom,{opName:ke}=ee.chain,Ve=se.struct.atomProperty.core.operatorName(),Xe=se.struct.atomProperty.core.sourceIndex(),pt=[];pe.length>0&&(pt[pt.length]=se.core.set.has([se.core.type.set(pe),Xe]));for(let _e=0,Ie=le.length/2;_e<Ie;_e++)pt[pt.length]=se.core.rel.inRange([Xe,le[2*_e],le[2*_e+1]]);if(ee.entity){let{modelLabel:_e,modelIndex:Ie}=ee.entity;re.push(se.struct.generator.atomGroups({"atom-test":pt.length>1?se.core.logic.or(pt):pt[0],"chain-test":ke.length>1?se.core.set.has([se.core.type.set(ke),Ve]):se.core.rel.eq([Ve,ke[0]]),"entity-test":se.core.logic.and([se.core.rel.eq([se.struct.atomProperty.core.modelLabel(),_e]),se.core.rel.eq([se.struct.atomProperty.core.modelIndex(),Ie])])}))}else re.push(se.struct.generator.atomGroups({"atom-test":pt.length>1?se.core.logic.or(pt):pt[0],"chain-test":ke.length>1?se.core.set.has([se.core.type.set(ke),Ve]):se.core.rel.eq([Ve,ke[0]])}))}),se.struct.modifier.union([re.length===1?re[0]:se.struct.combinator.merge(re.map(ee=>se.struct.modifier.union([ee])))])}e.toExpression=K;function $(Z,de,Q,ae,ye){Yl(de);let we=[],re=[],ee=0,le=de.length;for(;ee<le;){let pe=ee;for(ee++;ee<le&&de[ee-1]+1===de[ee];)ee++;let ke=ee;if(ke-pe>12)we[we.length]=de[pe],we[we.length]=de[ke-1];else for(let Ve=pe;Ve<ke;Ve++)re[re.length]=de[Ve]}return Q?{atom:{set:re,ranges:we},chain:{opName:[Z]},entity:{modelLabel:ae,modelIndex:ye}}:{atom:{set:re,ranges:we},chain:{opName:[Z]}}}})(Op||(Op={}))});var RK,rve=M(()=>{Ut();sd();PD();M4();(function(e){function t(){return{elementCount:0,conformationCount:0,residueCount:0,chainCount:0,unitCount:0,structureCount:0,firstElementLoc:$o.create(void 0),firstConformationLoc:$o.create(void 0),firstResidueLoc:$o.create(void 0),firstChainLoc:$o.create(void 0),firstUnitLoc:$o.create(void 0),firstStructureLoc:$o.create(void 0)}}e.create=t;function r(l,c,u){let d=l.get(c)||0;l.set(c,d+u)}function n(l,c,u){let{indices:d,unit:f}=u,{elements:m}=f,p=Se.size(d),h=new Map,g=new Map;if(p>0&&$o.set(l.firstElementLoc,c,f,m[Se.start(d)]),p===m.length)l.unitCount+=1,l.unitCount===1&&$o.set(l.firstUnitLoc,c,f,m[Se.start(d)]);else if(p===1){if(fe.Traits.is(f.traits,fe.Trait.MultiChain))return;l.elementCount+=1,l.elementCount===1&&$o.set(l.firstElementLoc,c,f,m[Se.start(d)])}else if(fe.isAtomic(f)){let{index:y,offsets:b}=f.model.atomicHierarchy.residueAtomSegments,{label_alt_id:x}=f.model.atomicHierarchy.atoms,C=0;for(;C<p;){h.clear();let S=0,w=m[Se.getAt(d,C)],A=y[w];for(r(h,x.value(w),1),++C,++S;C<p;){let T=m[Se.getAt(d,C)];if(y[T]!==A)break;r(h,x.value(T),1),++C,++S}if(b[A+1]-b[A]===S)l.residueCount+=1,l.residueCount===1&&$o.set(l.firstResidueLoc,c,f,b[A]);else{g.clear();for(let T=b[A],D=b[A+1];T<D;++T)r(g,x.value(T),1);g.get("")===h.get("")&&h.forEach((T,D)=>{if(g.get(D)===T){if(D!==""&&(l.conformationCount+=1,l.conformationCount===1)){for(let E=b[A],I=b[A+1];E<I;++E)if(D===x.value(E)){$o.set(l.firstConformationLoc,c,f,E);break}}S-=T}}),l.elementCount+=S}}}else l.elementCount+=p,l.elementCount===1&&$o.set(l.firstElementLoc,c,f,m[Se.start(d)])}function o(l,c,u){let{indices:d,unit:f}=u,m=Se.size(d);if(m===0)return;let{elements:p}=f;if(!fe.Traits.is(f.traits,fe.Trait.MultiChain)){m===p.length&&(l.chainCount+=1,l.chainCount===1&&$o.set(l.firstChainLoc,c,f,p[Se.start(d)]));return}let h=fe.isAtomic(f)?f.model.atomicHierarchy.chainAtomSegments:fe.isSpheres(f)?f.model.coarseHierarchy.spheres.chainElementSegments:fe.isGaussians(f)?f.model.coarseHierarchy.gaussians.chainElementSegments:void 0;if(!h){console.warn("StructureElement loci stats: unknown unit type");return}let{index:g,offsets:y}=h,b=0;for(;b<m;){let x=0,C=p[Se.getAt(d,b)],S=g[C];for(++b,++x;b<m;){let w=p[Se.getAt(d,b)];if(g[w]!==S)break;++b,++x}y[S+1]-y[S]===x?(l.chainCount+=1,l.chainCount===1&&$o.set(l.firstChainLoc,c,f,y[S])):m===1&&(l.elementCount+=1,l.elementCount===1&&$o.set(l.firstElementLoc,c,f,C))}}function i(l,c,u,d,f){let m=u[d],p=fe.isAtomic(m.unit)?m.unit.model.atomicHierarchy.chainAtomSegments:fe.isSpheres(m.unit)?m.unit.model.coarseHierarchy.spheres.chainElementSegments:fe.isGaussians(m.unit)?m.unit.model.coarseHierarchy.gaussians.chainElementSegments:void 0;if(!p){console.warn("StructureElement loci stats: unknown unit type");return}let{index:h,offsets:g}=p,y=new Map;for(let x=d;x<f;x++){m=u[x];let{indices:C,unit:S}=m,w=Se.size(C);if(w===0)continue;let{elements:A}=S;if(!fe.Traits.is(S.traits,fe.Trait.MultiChain)){let D=A[Se.start(C)];r(y,h[D],A.length);continue}let T=0;for(;T<w;){let D=0,E=A[Se.getAt(C,T)],I=h[E];for(++T,++D;T<w;){let k=A[Se.getAt(C,T)];if(h[k]!==I)break;++T,++D}r(y,I,D)}}let b=-1;if(y.forEach((x,C)=>{g[C+1]-g[C]===x&&(l.chainCount+=1,l.chainCount===1&&(b=C))}),!(b<0))for(let x=d;x<f;x++){m=u[x];let{indices:C,unit:S}=m,w=Se.size(C);if(w===0)continue;let{elements:A}=S,T=0;for(;T<w;){let D=A[Se.getAt(C,T)];if(h[D]===b){$o.set(l.firstChainLoc,c,S,D);return}}}}function a(l){let c=t();if(Op.isEmpty(l))return c;let u=!1;if(Op.isWholeStructure(l)){if(c.structureCount+=1,c.structureCount===1){let{unit:d,indices:f}=l.elements[0];$o.set(c.firstStructureLoc,l.structure,d,d.elements[Se.min(f)])}}else for(let d of l.elements)n(c,l.structure,d),fe.Traits.is(d.unit.traits,fe.Trait.Partitioned)?u=!0:o(c,l.structure,d);if(u)for(let d=0,f=l.elements.length;d<f;d++){let m=l.elements[d];if(!fe.Traits.is(m.unit.traits,fe.Trait.Partitioned))continue;let p=d;for(;d<f&&fe.areSameChainOperatorGroup(l.elements[d].unit,m.unit);)d++;let h=d;d--,h-p===1?o(c,l.structure,m):i(c,l.structure,l.elements,p,h)}return c}e.ofLoci=a;function s(l,c,u){return c.elementCount===1&&u.elementCount===0?$o.copy(l.firstElementLoc,c.firstElementLoc):c.elementCount===0&&u.elementCount===1&&$o.copy(l.firstElementLoc,u.firstElementLoc),c.conformationCount===1&&u.conformationCount===0?$o.copy(l.firstConformationLoc,c.firstConformationLoc):c.conformationCount===0&&u.conformationCount===1&&$o.copy(l.firstConformationLoc,u.firstConformationLoc),c.residueCount===1&&u.residueCount===0?$o.copy(l.firstResidueLoc,c.firstResidueLoc):c.residueCount===0&&u.residueCount===1&&$o.copy(l.firstResidueLoc,u.firstResidueLoc),c.chainCount===1&&u.chainCount===0?$o.copy(l.firstChainLoc,c.firstChainLoc):c.chainCount===0&&u.chainCount===1&&$o.copy(l.firstChainLoc,u.firstChainLoc),c.unitCount===1&&u.unitCount===0?$o.copy(l.firstUnitLoc,c.firstUnitLoc):c.unitCount===0&&u.unitCount===1&&$o.copy(l.firstUnitLoc,u.firstUnitLoc),c.structureCount===1&&u.structureCount===0?$o.copy(l.firstStructureLoc,c.firstStructureLoc):c.structureCount===0&&u.structureCount===1&&$o.copy(l.firstStructureLoc,u.firstStructureLoc),l.elementCount=c.elementCount+u.elementCount,l.conformationCount=c.conformationCount+u.conformationCount,l.residueCount=c.residueCount+u.residueCount,l.chainCount=c.chainCount+u.chainCount,l.unitCount=c.unitCount+u.unitCount,l.structureCount=c.structureCount+u.structureCount,l}e.add=s})(RK||(RK={}))});function emt(e){return e}function nve(e){throw new Error(`Property only available for ${e} models.`)}function tmt(e){return t=>fe.isAtomic(t.unit)?e(t):nve("atomic")}function rmt(e){return t=>fe.isCoarse(t.unit)?e(t):nve("coarse")}function nmt(e){return fe.isAtomic(e.unit)?e.unit.residueIndex[e.element]:-1}function omt(e){return fe.isAtomic(e.unit)?e.unit.chainIndex[e.element]:-1}function imt(e){return nt.entity.key(e)}var ove=M(()=>{sd();lb()});var te={};ci(te,{Bundle:()=>A2,Location:()=>$o,Loci:()=>Op,Schema:()=>AD,Stats:()=>RK,atomicProperty:()=>tmt,chainIndex:()=>omt,coarseProperty:()=>rmt,entityIndex:()=>imt,property:()=>emt,residueIndex:()=>nmt});var ive=M(()=>{M4();PD();uL();cL();rve();ove()});var ib=M(()=>{ive()});function It(e){return{data:e,position:0,length:e.length,lineNumber:1,tokenStart:0,tokenEnd:0}}function ave(e,t,r){let n=t,o=r-1,i=e.charCodeAt(n);for(;(i===9||i===32)&&n<=o;)i=e.charCodeAt(++n);for(i=e.charCodeAt(o);(i===9||i===32)&&o>=n;)i=e.charCodeAt(--o);return e.substring(n,o+1)}var Ze,ll=M(()=>{hr();(function(e){function t(x){return x.data.substring(x.tokenStart,x.tokenEnd)}e.getTokenString=t;function r(x){x.position=0,x.lineNumber=1,x.tokenStart=0,x.tokenEnd=0}e.reset=r;function n(x){let{data:C}=x;for(;x.position<x.length;)switch(C.charCodeAt(x.position)){case 10:return x.tokenEnd=x.position,++x.position,++x.lineNumber,!0;case 13:return x.tokenEnd=x.position,++x.position,++x.lineNumber,C.charCodeAt(x.position)===10&&++x.position,!0;default:++x.position;break}return x.tokenEnd=x.position,x.tokenStart!==x.tokenEnd}e.eatLine=n;function o(x){x.tokenStart=x.position}e.markStart=o;function i(x){return x.tokenStart=x.position,n(x)}e.markLine=i;function a(x){return i(x),t(x)}e.readLine=a;function s(x){i(x);let C=x.position;return b(x,x.tokenStart,x.tokenEnd),x.position=C,t(x)}e.readLineTrim=s;function l(x,C,S){let w=0;for(let A=0;A<C;A++){if(!i(x))return w;Ze.addUnchecked(S,x.tokenStart,x.tokenEnd),w++}return w}function c(x,C){let S=Ze.create(x.data,C*2);return l(x,C,S),S}e.markLines=c;function u(x,C){let S=[];for(let w=0;w<C;w++)S.push(e.readLine(x));return S}e.readLines=u;async function d(x,C,S,w=1e5){let A=Ze.create(x.data,C*2),T=0;return await il(S,w,x,(D,E)=>{let I=Math.min(C-T,D);return l(E,I,A),T+=I,I},(D,E)=>D.update({message:"Parsing...",current:E.position,max:E.length})),A}e.readLinesAsync=d;function f(x){let C=e(x),S=Ze.create(C.data,Math.max(x.length/80,2));for(;i(C);)Ze.add(S,C.tokenStart,C.tokenEnd);return S}e.readAllLines=f;function m(x,C,S){let w=0;for(let A=0;A<C;A++){if(!i(x))return w;Ze.add(S,x.tokenStart,x.tokenEnd),w++}return w}async function p(x,C,S=1e5){let w=e(x),A=Ze.create(w.data,Math.max(x.length/80,2));return await il(C,S,w,(T,D)=>(m(D,T,A),D.position<D.length?T:0),(T,D)=>T.update({message:"Parsing...",current:D.position,max:D.length})),A}e.readAllLinesAsync=p;function h(x){for(;x.position<x.length;)switch(x.data.charCodeAt(x.position)){case 9:case 10:case 13:case 32:x.tokenEnd=x.position;return;default:++x.position;break}x.tokenEnd=x.position}e.eatValue=h;function g(x){let C=-1;for(;x.position<x.length;){let S=x.data.charCodeAt(x.position);switch(S){case 9:case 32:C=S,++x.position;break;case 10:C!==13&&++x.lineNumber,C=S,++x.position;break;case 13:C=S,++x.position,++x.lineNumber;break;default:return C}}return C}e.skipWhitespace=g;function y(x){let C=-1;for(;x.position<x.length;){let S=x.data.charCodeAt(x.position);switch(S){case 9:case 32:C=S,++x.position;break;default:return C}}return C}e.skipStrictWhitespace=y;function b(x,C,S){let{data:w}=x,A=C,T=S-1,D=w.charCodeAt(A);for(;(D===9||D===32)&&A<=T;)D=w.charCodeAt(++A);for(D=w.charCodeAt(T);(D===9||D===32)&&T>=A;)D=w.charCodeAt(--T);return x.tokenStart=A,x.tokenEnd=T+1,x.position=S,x}e.trim=b})(It||(It={}));(function(e){function t(a){let s=new Uint32Array(1.61*a.indices.length|0);s.set(a.indices),a.indices=s,a.indicesLenMinus2=s.length-2|0}function r(a,s,l){let c=a;c.offset>c.indicesLenMinus2&&t(c),c.indices[c.offset++]=s,c.indices[c.offset++]=l,a.count++}e.add=r;function n(a,s){r(a,s.tokenStart,s.tokenEnd)}e.addToken=n;function o(a,s,l){a.indices[a.offset++]=s,a.indices[a.offset++]=l,a.count++}e.addUnchecked=o;function i(a,s){return s=Math.max(10,s),{data:a,indicesLenMinus2:s-2|0,count:0,offset:0,indices:new Uint32Array(s)}}e.create=i})(Ze||(Ze={}))});var hn,qs=M(()=>{(function(e){function t(i,a=-1){return new n(i,a)}e.error=t;function r(i,a=[]){return new o(i,a)}e.success=r;class n{toString(){return this.line>=0?`[Line ${this.line}] ${this.message}`:this.message}constructor(a,s){this.message=a,this.line=s,this.isError=!0}}e.Error=n;class o{constructor(a,s){this.result=a,this.warnings=s,this.isError=!1}}e.Success=o})(hn||(hn={}))});function sve(e){for(;e.position<e.length;)switch(e.data.charCodeAt(e.position)){case 9:case 10:case 13:case 32:e.tokenEnd=e.position;return;default:++e.position;break}e.tokenEnd=e.position}function amt(e,t){let r,n;for(++e.position;e.position<e.length;)if(n=e.data.charCodeAt(e.position),n===t)switch(r=e.data.charCodeAt(e.position+1),r){case 9:case 10:case 13:case 32:e.tokenStart++,e.tokenEnd=e.position,e.isEscaped=!0,++e.position;return;default:if(r===void 0){e.tokenStart++,e.tokenEnd=e.position,e.isEscaped=!0,++e.position;return}++e.position;break}else{if(n===10||n===13){e.tokenEnd=e.position;return}++e.position}e.tokenEnd=e.position}function smt(e){for(e.position+=3;e.position<e.length;){if(e.data.charCodeAt(e.position)===39&&uve(e)){e.tokenStart+=3,e.tokenEnd=e.position,e.isEscaped=!0,e.position+=3;return}++e.position}e.tokenEnd=e.position}function lmt(e){let t=59,r=e.position+1,n;for(;r<e.length;)if(n=e.data.charCodeAt(r),n===59&&(t===10||t===13)){for(e.position=r+1,e.tokenStart++,r--,n=e.data.charCodeAt(r);n===10||n===13;)r--,n=e.data.charCodeAt(r);e.tokenEnd=r+1,e.isEscaped=!0;return}else(n===13||n===10&&t!==13)&&e.lineNumber++,t=n,++r;return e.position=r,t}function cmt(e){for(;e.position<e.length;)switch(e.data.charCodeAt(e.position)){case 93:++e.position,e.tokenEnd=e.position,e.isImportGet=!1;return;default:++e.position;break}}function umt(e){for(;e.position<e.length;){let t=e.data.charCodeAt(e.position);if(t===10||t===13)return;++e.position}}function dmt(e){let t=10;for(;e.position<e.length;){let r=e.data.charCodeAt(e.position);switch(r){case 9:case 32:t=r,++e.position;break;case 10:t!==13&&++e.lineNumber,t=r,++e.position;break;case 13:t=r,++e.position,++e.lineNumber;break;default:return t}}return t}function uve(e){return!(e.length-e.position<2||e.data.charCodeAt(e.position+1)!==39||e.data.charCodeAt(e.position+2)!==39)}function fmt(e){let t=e.data.charCodeAt(e.tokenStart);return!(t!==68&&t!==100||(t=e.data.charCodeAt(e.tokenStart+1),t!==65&&t!==97)||(t=e.data.charCodeAt(e.tokenStart+2),t!==84&&t!==116)||(t=e.data.charCodeAt(e.tokenStart+3),t!==65&&t!==97))}function mmt(e){let t=e.data.charCodeAt(e.tokenStart);return!(t!==83&&t!==115||(t=e.data.charCodeAt(e.tokenStart+1),t!==65&&t!==97)||(t=e.data.charCodeAt(e.tokenStart+2),t!==86&&t!==118)||(t=e.data.charCodeAt(e.tokenStart+3),t!==69&&t!==101))}function pmt(e){if(e.tokenEnd-e.tokenStart!==5)return!1;let t=e.data.charCodeAt(e.tokenStart);return!(t!==76&&t!==108||(t=e.data.charCodeAt(e.tokenStart+1),t!==79&&t!==111)||(t=e.data.charCodeAt(e.tokenStart+2),t!==79&&t!==111)||(t=e.data.charCodeAt(e.tokenStart+3),t!==80&&t!==112))}function hmt(e){return!(e.tokenEnd-e.tokenStart!==11||e.data.charCodeAt(e.tokenStart+1)!==105||e.data.charCodeAt(e.tokenStart+2)!==109||e.data.charCodeAt(e.tokenStart+3)!==112||e.data.charCodeAt(e.tokenStart+4)!==111||e.data.charCodeAt(e.tokenStart+5)!==114||e.data.charCodeAt(e.tokenStart+6)!==116||e.data.charCodeAt(e.tokenStart+7)!==46||e.data.charCodeAt(e.tokenStart+8)!==103||e.data.charCodeAt(e.tokenStart+9)!==101||e.data.charCodeAt(e.tokenStart+10)!==116)}function gmt(e,t,r){let n,o=r-t,i=e.tokenStart-t,a=e.tokenEnd-e.tokenStart;if(a<o)return!1;for(n=t;n<r;++n)if(e.data.charCodeAt(n)!==e.data.charCodeAt(n+i))return!1;return o===a||e.data.charCodeAt(n+i)===46}function dve(e){let t;for(t=e.tokenStart;t<e.tokenEnd;++t)if(e.data.charCodeAt(t)===46)return t;return t}function fve(e,t){return e.data.substring(e.tokenStart,t)}function ymt(e){let t;for(t=e.tokenStart;t<e.tokenEnd;++t)if(e.data.charCodeAt(t)===46)return!1;return!0}function OK(e){return e.data.substring(e.tokenStart,e.tokenEnd)}function lve(e){let t=dmt(e);if(e.position>=e.length){e.tokenType=cs.End;return}e.tokenStart=e.position,e.tokenEnd=e.position,e.isEscaped=!1;let r=e.data.charCodeAt(e.position);switch(r){case 35:umt(e),e.tokenType=cs.Comment;break;case 39:if(uve(e)){smt(e),e.tokenType=cs.Value;break}case 34:amt(e,r),e.tokenType=cs.Value;break;case 59:t===10||t===13?lmt(e):sve(e),e.tokenType=cs.Value;break;default:e.isImportGet?cmt(e):sve(e),e.isEscaped?e.tokenType=cs.Value:e.data.charCodeAt(e.tokenStart)===95?(e.inSaveFrame&&hmt(e)&&(e.isImportGet=!0),e.tokenType=cs.ColumnName):e.tokenEnd-e.tokenStart>=5&&e.data.charCodeAt(e.tokenStart+4)===95?fmt(e)?e.tokenType=cs.Data:mmt(e)?e.tokenType=cs.Save:pmt(e)?e.tokenType=cs.Loop:e.tokenType=cs.Value:e.tokenType=cs.Value;break}}function yx(e){for(lve(e);e.tokenType===cs.Comment;)lve(e)}function vmt(e,t){return{data:e,length:e.length,position:0,tokenStart:0,tokenEnd:0,tokenType:cs.End,lineNumber:1,isEscaped:!1,isImportGet:!1,inSaveFrame:!1,runtimeCtx:t}}function RL(){return{categoryNames:[],categoryData:Object.create(null)}}function FK(e,t){let r=Object.create(null);for(let n of e){let o=t[n];r[n]=Qa(o.name,o.rowCount,o.fieldNames,o.fields)}return r}function cve(e,t,r){return iD(e.categoryNames,FK(e.categoryNames,e.categoryData),t,r)}function bmt(e,t){return iD(e.categoryNames,FK(e.categoryNames,e.categoryData),t)}function LK(e,t,r,n,o){if(t in e.categoryData){let i=e.categoryData[t];i.fieldNames.push(...n),Object.assign(i.fields,o)}else e.categoryData[t]={name:t,rowCount:r,fieldNames:n,fields:o},e.categoryNames.push(t)}function xmt(e,t){let r=e.tokenStart,n=dve(e),o=fve(e,n),i=Object.create(null),a=[],s=!0;for(;s;){if(e.tokenType!==cs.ColumnName||!gmt(e,r,n)){s=!1;break}let l=OK(e).substring(o.length+1);if(yx(e),e.tokenType!==cs.Value)return{hasError:!0,errorLine:e.lineNumber,errorMessage:"Expected value."};i[l]=Bt.ofTokens({data:e.data,indices:[e.tokenStart,e.tokenEnd],count:1}),a[a.length]=l,yx(e)}return LK(t,o.substr(1),1,a,i),{hasError:!1,errorLine:0,errorMessage:""}}function Smt(e,t){let{tokenizer:r,tokens:n,fieldCount:o}=t,i=t.tokenCount,a=0;for(;r.tokenType===cs.Value&&a<e;)Ze.add(n[i++%o],r.tokenStart,r.tokenEnd),yx(r),a++;return t.tokenCount=i,a}function _mt(e,t){return e.update({message:"Parsing...",current:t.tokenizer.position,max:t.tokenizer.data.length})}async function Cmt(e,t){let r=e.lineNumber;yx(e);let n=fve(e,dve(e)),o=ymt(e),i=[];for(;e.tokenType===cs.ColumnName;)i[i.length]=o?OK(e):OK(e).substring(n.length+1),yx(e);let a=n==="_atom_site"?e.data.length/100|0:32,s=[],l=i.length;for(let d=0;d<l;d++)s[d]=Ze.create(e.data,a);let c={fieldCount:l,tokenCount:0,tokenizer:e,tokens:s};if(await il(e.runtimeCtx,1e6,c,Smt,_mt),c.tokenCount%l!==0)return{hasError:!0,errorLine:e.lineNumber,errorMessage:`The number of values for loop starting at line ${r} is not a multiple of the number of columns.`};let u=c.tokenCount/l|0;if(o)for(let d=0;d<l;d++){let f={"":Bt.ofTokens(s[d])};LK(t,i[d].substr(1),u,[""],f)}else{let d=Object.create(null);for(let f=0;f<l;f++)d[i[f]]=Bt.ofTokens(s[f]);LK(t,n.substr(1),u,i,d)}return{hasError:!1,errorLine:0,errorMessage:""}}function FT(e,t){return hn.error(t,e)}function wmt(e){return hn.success(e)}async function Tmt(e,t){let r=[],n=vmt(e,t),o="",i=RL(),a=[],s=RL(),l=Lhe(s.categoryNames,FK(s.categoryNames,s.categoryData),""),c="";for(t.update({message:"Parsing...",current:0,max:e.length}),yx(n);n.tokenType!==cs.End;){let u=n.tokenType;if(u===cs.Data){if(n.inSaveFrame)return FT(n.lineNumber,"Unexpected data block inside a save frame.");i.categoryNames.length>0&&r.push(cve(i,o,a)),o=e.substring(n.tokenStart+5,n.tokenEnd),i=RL(),a=[],yx(n)}else if(u===cs.Save){if(n.tokenEnd-n.tokenStart===5)s.categoryNames.length>0&&(a[a.length]=bmt(s,c)),n.inSaveFrame=!1;else{if(n.inSaveFrame)return FT(n.lineNumber,"Save frames cannot be nested.");n.inSaveFrame=!0,c=e.substring(n.tokenStart+5,n.tokenEnd),s=RL()}yx(n)}else if(u===cs.Loop){let d=await Cmt(n,n.inSaveFrame?s:i);if(d.hasError)return FT(d.errorLine,d.errorMessage)}else if(u===cs.ColumnName){let d=xmt(n,n.inSaveFrame?s:i);if(d.hasError)return FT(d.errorLine,d.errorMessage)}else return console.log(n.tokenType,It.getTokenString(n)),FT(n.lineNumber,"Unexpected token. Expected data_, loop_, or data name.")}return n.inSaveFrame?FT(n.lineNumber,`Unfinished save frame (${l.header}).`):((i.categoryNames.length>0||a.length>0)&&r.push(cve(i,o,a)),wmt(P4(r)))}function NK(e){return Me.create("Parse CIF",async t=>await Tmt(e,t))}var cs,mve=M(()=>{aD();ll();qs();hr();(function(e){e[e.Data=0]="Data",e[e.Save=1]="Save",e[e.Loop=2]="Loop",e[e.Value=3]="Value",e[e.ColumnName=4]="ColumnName",e[e.Comment=5]="Comment",e[e.End=6]="End"})(cs||(cs={}))});function pve(e){let t=e.mask?xT(e.mask):void 0,r=xT(e.data),n=ma.isTypedArray(r),o=n?t?c=>t[c]===G.ValueKinds.Present?""+r[c]:"":c=>""+r[c]:t?c=>t[c]===G.ValueKinds.Present?r[c]:"":c=>r[c],i=n?c=>r[c]:c=>{let u=r[c];return Pp(u,0,u.length)},a=n?c=>r[c]:c=>{let u=r[c];return Hd(u,0,u.length)},s=t?c=>t[c]:c=>G.ValueKinds.Present,l=r.length;return{__array:r,binaryEncoding:e.data.encoding,isDefined:!0,rowCount:l,str:o,int:i,float:a,valueKind:s,areValuesEqual:(c,u)=>r[c]===r[u],toStringArray:c=>ma.createAndFillArray(l,o,c),toIntArray:n?c=>ma.typedArrayWindow(r,c):c=>ma.createAndFillArray(l,i,c),toFloatArray:n?c=>ma.typedArrayWindow(r,c):c=>ma.createAndFillArray(l,a,c)}}var hve=M(()=>{Tr();vD();Kv()});function FL(e){return LL({buffer:e,offset:0,dataView:new DataView(e.buffer)})}function UK(e,t){let r={};for(let n=0;n<t;n++){let o=LL(e);r[o]=LL(e)}return r}function VK(e,t){let r=new Uint8Array(t),n=e.offset;for(let o=0;o<t;o++)r[o]=e.buffer[o+n];return e.offset+=t,r}function OL(e,t){let r=B0(e.buffer,e.offset,t);return e.offset+=t,r}function zK(e,t){let r=new Array(t);for(let n=0;n<t;n++)r[n]=LL(e);return r}function LL(e){let t=e.buffer[e.offset],r,n;if((t&128)===0)return e.offset++,t;if((t&240)===128)return n=t&15,e.offset++,UK(e,n);if((t&240)===144)return n=t&15,e.offset++,zK(e,n);if((t&224)===160)return n=t&31,e.offset++,OL(e,n);if((t&224)===224)return r=e.dataView.getInt8(e.offset),e.offset++,r;switch(t){case 192:return e.offset++,null;case 194:return e.offset++,!1;case 195:return e.offset++,!0;case 196:return n=e.dataView.getUint8(e.offset+1),e.offset+=2,VK(e,n);case 197:return n=e.dataView.getUint16(e.offset+1),e.offset+=3,VK(e,n);case 198:return n=e.dataView.getUint32(e.offset+1),e.offset+=5,VK(e,n);case 202:return r=e.dataView.getFloat32(e.offset+1),e.offset+=5,r;case 203:return r=e.dataView.getFloat64(e.offset+1),e.offset+=9,r;case 204:return r=e.buffer[e.offset+1],e.offset+=2,r;case 205:return r=e.dataView.getUint16(e.offset+1),e.offset+=3,r;case 206:return r=e.dataView.getUint32(e.offset+1),e.offset+=5,r;case 208:return r=e.dataView.getInt8(e.offset+1),e.offset+=2,r;case 209:return r=e.dataView.getInt16(e.offset+1),e.offset+=3,r;case 210:return r=e.dataView.getInt32(e.offset+1),e.offset+=5,r;case 217:return n=e.dataView.getUint8(e.offset+1),e.offset+=2,OL(e,n);case 218:return n=e.dataView.getUint16(e.offset+1),e.offset+=3,OL(e,n);case 219:return n=e.dataView.getUint32(e.offset+1),e.offset+=5,OL(e,n);case 220:return n=e.dataView.getUint16(e.offset+1),e.offset+=3,zK(e,n);case 221:return n=e.dataView.getUint32(e.offset+1),e.offset+=5,zK(e,n);case 222:return n=e.dataView.getUint16(e.offset+1),e.offset+=3,UK(e,n);case 223:return n=e.dataView.getUint32(e.offset+1),e.offset+=5,UK(e,n)}throw new Error("Unknown type 0x"+t.toString(16))}var qK=M(()=>{tx()});function Amt(e,t){for(let r=0;r<2;r++)if(e[r]>t[r])return!1;return!0}function Pmt(e){let t=Object.create(null),r=Object.create(null);for(let n of e.columns)t[n.name]=n;return{rowCount:e.rowCount,name:e.name.substring(1),fieldNames:e.columns.map(n=>n.name),getField(n){let o=t[n];if(o)return r[n]||(r[n]=pve(o)),r[n]}}}function jK(e){return Me.create("Parse BinaryCIF",async t=>{let r=[0,3];try{let n=FL(e);if(!Amt(r,n.version.match(/(\d)\.(\d)\.\d/).slice(1).map(i=>+i)))return hn.error(`Unsupported format version. Current ${n.version}, required ${r.join(".")}.`);let o=P4(n.dataBlocks.map(i=>{let a=Object.create(null);for(let s of i.categories)a[s.name.substring(1)]=Pmt(s);return iD(i.categories.map(s=>s.name.substring(1)),a,i.header)}));return hn.success(o)}catch(n){return hn.error(""+n)}})}var gve=M(()=>{aD();hve();qs();qK();hr()});var O2,Ni,Imt,yve,z0,Nm,zD,NT,vve,bve=M(()=>{Tr();O2=G.Schema,Ni=O2.str,Imt=O2.float,yve=O2.List,z0=O2.lstr,Nm=O2.Aliased,zD=O2.int,NT=O2.coord,vve={chem_comp:{formula:Ni,formula_weight:Imt,id:Ni,mon_nstd_parent_comp_id:yve(",",e=>e),name:Ni,one_letter_code:Ni,three_letter_code:Ni,type:Nm(z0),pdbx_synonyms:yve(";",e=>e),pdbx_type:Ni,pdbx_ambiguous_flag:Ni,pdbx_replaced_by:Ni,pdbx_replaces:Ni,pdbx_formal_charge:zD,pdbx_model_coordinates_details:Ni,pdbx_model_coordinates_db_code:Ni,pdbx_ideal_coordinates_details:Ni,pdbx_ideal_coordinates_missing_flag:Nm(z0),pdbx_model_coordinates_missing_flag:Nm(z0),pdbx_initial_date:Ni,pdbx_modified_date:Ni,pdbx_release_status:Nm(Ni),pdbx_processing_site:Nm(Ni)},chem_comp_atom:{alt_atom_id:Ni,atom_id:Ni,charge:zD,model_Cartn_x:NT,model_Cartn_y:NT,model_Cartn_z:NT,comp_id:Ni,type_symbol:Ni,pdbx_align:zD,pdbx_ordinal:zD,pdbx_model_Cartn_x_ideal:NT,pdbx_model_Cartn_y_ideal:NT,pdbx_model_Cartn_z_ideal:NT,pdbx_stereo_config:Nm(z0),pdbx_aromatic_flag:Nm(z0),pdbx_leaving_atom_flag:Nm(z0)},chem_comp_bond:{atom_id_1:Ni,atom_id_2:Ni,comp_id:Ni,value_order:Nm(z0),pdbx_ordinal:zD,pdbx_stereo_config:Nm(z0),pdbx_aromatic_flag:Nm(z0)},pdbx_chem_comp_descriptor:{comp_id:Ni,descriptor:Ni,type:Nm(z0),program:Ni,program_version:Ni},pdbx_chem_comp_identifier:{comp_id:Ni,identifier:Ni,type:Nm(Ni),program:Ni,program_version:Ni}}});var qD,wn,Emt,cb,$d,Lp,xve,Sve=M(()=>{Tr();qD=G.Schema,wn=qD.str,Emt=qD.float,cb=qD.lstr,$d=qD.Aliased,Lp=qD.int,xve={pdbx_reference_molecule:{prd_id:wn,formula_weight:Emt,formula:wn,type:$d(cb),type_evidence_code:wn,class:$d(cb),class_evidence_code:wn,name:wn,represent_as:$d(cb),chem_comp_id:wn,compound_details:wn,description:wn,representative_PDB_id_code:wn,release_status:$d(cb),replaces:wn,replaced_by:wn},pdbx_reference_entity_list:{prd_id:wn,ref_entity_id:wn,type:$d(cb),details:wn,component_id:Lp},pdbx_reference_entity_nonpoly:{prd_id:wn,ref_entity_id:wn,name:wn,chem_comp_id:wn},pdbx_reference_entity_link:{link_id:Lp,prd_id:wn,details:wn,ref_entity_id_1:wn,ref_entity_id_2:wn,entity_seq_num_1:Lp,entity_seq_num_2:Lp,comp_id_1:wn,comp_id_2:wn,atom_id_1:wn,atom_id_2:wn,value_order:$d(cb),component_1:Lp,component_2:Lp,link_class:$d(wn)},pdbx_reference_entity_poly_link:{link_id:Lp,prd_id:wn,ref_entity_id:wn,component_id:Lp,entity_seq_num_1:Lp,entity_seq_num_2:Lp,comp_id_1:wn,comp_id_2:wn,atom_id_1:wn,atom_id_2:wn,value_order:$d(cb)},pdbx_reference_entity_poly:{prd_id:wn,ref_entity_id:wn,type:$d(wn),db_code:wn,db_name:wn},pdbx_reference_entity_poly_seq:{prd_id:wn,ref_entity_id:wn,mon_id:wn,parent_mon_id:wn,num:Lp,observed:$d(cb),hetero:$d(cb)},pdbx_reference_entity_sequence:{prd_id:wn,ref_entity_id:wn,type:$d(wn),NRP_flag:$d(wn),one_letter_codes:wn},pdbx_reference_entity_src_nat:{prd_id:wn,ref_entity_id:wn,ordinal:Lp,organism_scientific:wn,taxid:wn,db_code:wn,db_name:wn},pdbx_prd_audit:{prd_id:wn,date:wn,processing_site:$d(wn),action_type:$d(wn)}}});var _ve,cl,Dmt,kmt,Mmt,Bmt,Rmt,Omt,Lmt,Fmt,Nmt,Cve,wve=M(()=>{Tr();_ve=G.Schema,cl=_ve.str,Dmt=_ve.float,kmt={id:cl,description:cl},Mmt={title:cl,datablock_id:cl,version:cl},Bmt={version:cl,update:cl,revision:cl},Rmt={id:cl,description:cl},Omt={id:cl,parent_id:cl,description:cl},Lmt={code:cl,primitive_code:cl,construct:cl,detail:cl},Fmt={code:cl,detail:cl},Nmt={from_code:cl,to_code:cl,operator:cl,factor:Dmt},Cve={datablock:kmt,dictionary:Mmt,dictionary_history:Bmt,sub_category:Rmt,category_group_list:Omt,item_type_list:Lmt,item_units_list:Fmt,item_units_conversion:Nmt}});var jD,q0,NL,ub,UL,vx,qwr,VL,GK=M(()=>{Tr();jD=G.Schema,q0=jD.str,NL=jD.int,ub=jD.float,UL=jD.Aliased,vx=jD.Vector,qwr={density_server_result:{server_version:q0,datetime_utc:q0,guid:q0,is_empty:UL(q0),has_error:UL(q0),error:q0,query_source_id:q0,query_type:UL(q0),query_box_type:UL(q0),query_box_a:vx(3),query_box_b:vx(3)}},VL={volume_data_3d_info:{name:q0,axis_order:vx(3,NL),origin:vx(3),dimensions:vx(3),sample_rate:NL,sample_count:vx(3,NL),spacegroup_number:NL,spacegroup_cell_size:vx(3),spacegroup_cell_angles:vx(3),mean_source:ub,mean_sampled:ub,sigma_source:ub,sigma_sampled:ub,min_source:ub,min_sampled:ub,max_source:ub,max_sampled:ub},volume_data_3d:{values:ub}}});var zL,us,Qi,Tve,Umt,Ave,Pve,Ive=M(()=>{Tr();zL=G.Schema,us=zL.float,Qi=zL.str,Tve=zL.int,Umt=zL.Matrix,Ave={cell:{angle_alpha:us,angle_beta:us,angle_gamma:us,formula_units_z:us,length_a:us,length_b:us,length_c:us,volume:us},chemical:{melting_point:us,name_common:Qi,name_systematic:Qi},chemical_formula:{moiety:Qi,sum:Qi,weight:us},space_group:{crystal_system:Qi,it_number:Tve,"name_h-m_full":Qi},space_group_symop:{operation_xyz:Qi},geom_bond:{atom_site_label_1:Qi,atom_site_label_2:Qi,distance:us,publ_flag:Qi,site_symmetry_1:Qi,site_symmetry_2:Qi,valence:us},audit:{block_doi:Qi},database_code:{cod:Qi,csd:Qi,depnum_ccdc_archive:Qi,depnum_ccdc_fiz:Qi,icsd:Qi,mdf:Qi,nbs:Qi},atom_site:{adp_type:Qi,calc_flag:Qi,disorder_assembly:Qi,disorder_group:Qi,fract_x:us,fract_y:us,fract_z:us,label:Qi,occupancy:us,refinement_flags:Qi,site_symmetry_multiplicity:Tve,type_symbol:Qi,u_iso_or_equiv:us},atom_site_aniso:{label:Qi,u_11:us,u:Umt(3,3),u_12:us,u_13:us,u_22:us,u_23:us,u_33:us},atom_type:{description:Qi,symbol:Qi},atom_type_scat:{dispersion_imag:us,dispersion_real:us,source:Qi}},Pve={"cell.formula_units_z":["cell_formula_units_Z"],"space_group.it_number":["space_group_IT_number","symmetry_Int_Tables_number"],"space_group.name_h-m_full":["symmetry_space_group_name_H-M"],"space_group_symop.operation_xyz":["symmetry_equiv_pos_as_xyz"],"geom_bond.atom_site_label_1":["geom_bond_atom_site_id_1"],"geom_bond.atom_site_label_2":["geom_bond_atom_site_id_2"],"geom_bond.distance":["geom_bond_dist"],"audit.block_doi":["audit_block_DOI"],"database_code.cod":["database_code_COD"],"database_code.csd":["database_code_CSD"],"database_code.depnum_ccdc_archive":["database_code_depnum_CCDC_archive"],"database_code.depnum_ccdc_fiz":["database_code_depnum_CCDC_fiz"],"database_code.icsd":["database_code_ICSD"],"database_code.mdf":["database_code_MDF"],"database_code.nbs":["database_code_NBS"],"atom_site.adp_type":["atom_site_ADP_type","atom_site_thermal_displace_type"],"atom_site.label":["atom_site_id"],"atom_site.site_symmetry_multiplicity":["atom_site_symmetry_multiplicity"],"atom_site.u_iso_or_equiv":["atom_site_U_iso_or_equiv"],"atom_site_aniso.label":["atom_site_anisotrop_id"],"atom_site_aniso.u_11":["atom_site_aniso_U_11","atom_site_anisotrop_U_11"],"atom_site_aniso.u_12":["atom_site_aniso_U_12","atom_site_anisotrop_U_12"],"atom_site_aniso.u_13":["atom_site_aniso_U_13","atom_site_anisotrop_U_13"],"atom_site_aniso.u_22":["atom_site_aniso_U_22","atom_site_anisotrop_U_22"],"atom_site_aniso.u_23":["atom_site_aniso_U_23","atom_site_anisotrop_U_23"],"atom_site_aniso.u_33":["atom_site_aniso_U_33","atom_site_anisotrop_U_33"]}});var Vmt,HK,Eve,Dve=M(()=>{Tr();GK();Vmt=G.Schema,HK=Vmt.int,Eve={volume_data_3d_info:VL.volume_data_3d_info,segmentation_data_table:{set_id:HK,segment_id:HK},segmentation_data_3d:{values:HK}}});var Qd,Um=M(()=>{mve();gve();sD();J1();bve();Sve();wve();GK();Ive();Dve();_T();aD();Qd={parse:e=>ex.is(e)?NK(e):jK(e),parseText:NK,parseBinary:jK,toDatabaseCollection:Vhe,toDatabase:Uf,schema:{mmCIF:e=>Uf(Dn,e),CCD:e=>Uf(vve,e),BIRD:e=>Uf(xve,e),dic:e=>Uf(Cve,e),cifCore:e=>Uf(Ave,e,Pve),densityServer:e=>Uf(VL,e),segmentation:e=>Uf(Eve,e)}}});var zmt,Jd,GD=M(()=>{J1();Om();I0();jf();zmt={U:Dn.atom_site_anisotrop.U,U_esd:Dn.atom_site_anisotrop.U_esd};(function(e){e.Schema=zmt,e.Descriptor={name:"atom_site_anisotrop",cifExport:{prefix:"",categories:[{name:"atom_site_anisotrop",instance(n){return e.Provider.get(n.firstModel)?oo.is(n.firstModel.sourceData)?Di.Category.ofTable(n.firstModel.sourceData.data.db.atom_site_anisotrop):Di.Category.Empty:Di.Category.Empty}}]}},e.Provider=Xl.create(e.Descriptor);function t(n,o){let i=new Int32Array(n.rowCount);i.fill(-1);for(let s=0,l=n.rowCount;s<l;s++)i[n.value(s)]=s;let a=new Int32Array(n.rowCount);a.fill(-1);for(let s=0,l=o.rowCount;s<l;++s){let c=i[o.value(s)];c!==-1&&(a[c]=s)}return a}e.getElementToAnsiotrop=t;function r(n,o){let i={};for(let s=0,l=n.rowCount;s<l;s++)i[n.value(s)]=s;let a=new Int32Array(n.rowCount);a.fill(-1);for(let s=0,l=o.rowCount;s<l;++s){let c=i[o.value(s)];c!==void 0&&(a[c]=s)}return a}e.getElementToAnsiotropFromLabel=r})(Jd||(Jd={}))});var j0,qL=M(()=>{I0();Fs();Tr();Om();jf();sD();(function(e){let t="molstar_global_model_transform_info";e.Schema={[t]:{matrix:G.Schema.Matrix(4,4,G.Schema.float)}},e.Descriptor=ss({name:t,cifExport:{categories:[{name:t,instance(s){let l=n(s.firstModel);if(!l)return Di.Category.Empty;let c=Or.ofRows(e.Schema.molstar_global_model_transform_info,[{matrix:l}]);return Di.Category.ofTable(c)}}],prefix:"molstar"}}),e.Provider=Xl.create(e.Descriptor);function r(s,l){s.customProperties.has(e.Descriptor)||s.customProperties.add(e.Descriptor),e.Provider.set(s,l)}e.attach=r;function n(s){return e.Provider.get(s)}e.get=n;function o(s){if(!oo.is(s.sourceData))return;let l=s.sourceData.data.frame.categories[t];if(!l)return;let c=zhe(e.Schema[t],l);if(c._rowCount!==0)return c.matrix.value(0)}e.fromMmCif=o;function i(s){if(!oo.is(s.sourceData))return!1;let l=s.sourceData.data.frame.categories[t];return!!l&&l.rowCount>0}e.hasData=i;function a(s,l){s.writeCategory({name:t,instance(){let c=Or.ofRows(e.Schema.molstar_global_model_transform_info,[{matrix:l}]);return Di.Category.ofTable(c)}})}e.writeMmCif=a})(j0||(j0={}))});var _Tr,CTr,kve,Mve=M(()=>{J1();Tr();_Tr={label_comp_id:Dn.atom_site.label_comp_id,label_seq_id:Dn.atom_site.label_seq_id,pdbx_PDB_ins_code:Dn.atom_site.pdbx_PDB_ins_code,label_asym_id:Dn.atom_site.label_asym_id,label_entity_id:Dn.atom_site.label_entity_id,auth_comp_id:Dn.atom_site.auth_atom_id,auth_seq_id:Dn.atom_site.auth_seq_id,auth_asym_id:Dn.atom_site.auth_asym_id},CTr={...Dn.chem_comp_bond,molstar_protonation_variant:G.Schema.Str()},kve={...Dn.chem_comp,type:G.Schema.Aliased(G.Schema.str)}});function Rve(e,t){let{ihm_model_group:r,ihm_model_group_link:n}=t,o=Or.pickRow(n,i=>n.model_id.value(i)===e);if(o){let i=Or.pickRow(r,a=>r.id.value(a)===o.group_id);if(i)return i.name}return""}function Bve(e){for(let t=0,r=e.rowCount;t<r;t++)if(e.valueKind(t)===G.ValueKinds.Present)return!0;return!1}function HD(e,t,r){(!e[t].isDefined||!Bve(e[t]))&&(e[t]=e[r]),(!e[r].isDefined||!Bve(e[r]))&&(e[r]=e[t])}function Ove(e){let t=Or.ofColumns(e._schema,e);return HD(t,"label_atom_id","auth_atom_id"),HD(t,"label_comp_id","auth_comp_id"),HD(t,"label_seq_id","auth_seq_id"),HD(t,"label_asym_id","auth_asym_id"),HD(t,"label_entity_id","label_asym_id"),t}var WK=M(()=>{Tr()});function za(e,t=!1){let r=Object.create(null);for(let n of Object.keys(ni))n in e?r[n]=e[n]:r[n]=Or.ofUndefinedColumns(ni[n],0);return t&&(r.atom_site=Ove(r.atom_site)),r}var ni,Gc=M(()=>{J1();Tr();Mve();WK();ni={entry:Dn.entry,struct:Dn.struct,struct_asym:Dn.struct_asym,ihm_model_list:Dn.ihm_model_list,ihm_model_group:Dn.ihm_model_group,ihm_model_group_link:Dn.ihm_model_group_link,entity:Dn.entity,entity_poly:Dn.entity_poly,entity_poly_seq:Dn.entity_poly_seq,pdbx_entity_branch:Dn.pdbx_entity_branch,chem_comp:kve,pdbx_chem_comp_identifier:Dn.pdbx_chem_comp_identifier,atom_site:Dn.atom_site,ihm_sphere_obj_site:Dn.ihm_sphere_obj_site,ihm_gaussian_obj_site:Dn.ihm_gaussian_obj_site,pdbx_unobs_or_zero_occ_residues:Dn.pdbx_unobs_or_zero_occ_residues,pdbx_molecule:Dn.pdbx_molecule}});var Pa,Gf=M(()=>{Br();Tr();Gc();Pa=class{constructor(){this.count=0,this.ids=[],this.types=[],this.descriptions=[],this.compoundsMap=new Map,this.namesMap=new Map,this.heteroMap=new Map,this.chainMap=new Map}set(t,r){this.count+=1,this.ids.push(`${this.count}`),this.types.push(t),this.descriptions.push([r])}getEntityId(t,r,n,o){return r===_r.Water?(this.waterId===void 0&&(this.set("water",o?.customName||"Water"),this.waterId=`${this.count}`),this.waterId):K1(r)?this.compoundsMap.has(n)?this.compoundsMap.get(n):(this.chainMap.has(n)||(this.set("polymer",o?.customName||`Polymer ${this.chainMap.size+1}`),this.chainMap.set(n,`${this.count}`)),this.chainMap.get(n)):(this.heteroMap.has(t)||(this.set("non-polymer",o?.customName||this.namesMap.get(t)||t),this.heteroMap.set(t,`${this.count}`)),this.heteroMap.get(t))}getEntityTable(){return Or.ofPartialColumns(ni.entity,{id:G.ofStringArray(this.ids),type:G.ofStringAliasArray(this.types),pdbx_description:G.ofStringListArray(this.descriptions)},this.count)}setCompounds(t){for(let r=0,n=t.length;r<n;++r){let{chains:o,description:i}=t[r];this.set("polymer",i);for(let a=0,s=o.length;a<s;++a)this.compoundsMap.set(o[a],`${this.count}`)}}setNames(t){t.forEach(r=>this.namesMap.set(r[0],r[1]))}}});var qmt,jmt,Gmt,Hmt,Lve,Fve,Ia,Hf=M(()=>{Tr();Br();Nf();Gc();h2();qmt=[new Set(["CA"]),new Set(["C"]),new Set(["N"])],jmt=[new Set(["P","O3'","O3*"]),new Set(["C4'","C4*"]),new Set(["O2'","O2*","F2'","F2*"])],Gmt=[new Set(["P","O3'","O3*"]),new Set(["C3'","C3*"]),new Set(["O2'","O2*","F2'","F2*"])],Hmt=new Set(["FMN","NCN","FNS","FMA","ATP","ADP","AMP","GTP","GDP","GMP","LIG"]),Lve=(function(){let e=new Map;return[{id:"HIS",name:"HISTIDINE",type:"l-peptide linking"},{id:"ARG",name:"ARGININE",type:"l-peptide linking"},{id:"LYS",name:"LYSINE",type:"l-peptide linking"},{id:"ILE",name:"ISOLEUCINE",type:"l-peptide linking"},{id:"PHE",name:"PHENYLALANINE",type:"l-peptide linking"},{id:"LEU",name:"LEUCINE",type:"l-peptide linking"},{id:"TRP",name:"TRYPTOPHAN",type:"l-peptide linking"},{id:"ALA",name:"ALANINE",type:"l-peptide linking"},{id:"MET",name:"METHIONINE",type:"l-peptide linking"},{id:"CYS",name:"CYSTEINE",type:"l-peptide linking"},{id:"ASN",name:"ASPARAGINE",type:"l-peptide linking"},{id:"VAL",name:"VALINE",type:"l-peptide linking"},{id:"GLY",name:"GLYCINE",type:"peptide linking"},{id:"SER",name:"SERINE",type:"l-peptide linking"},{id:"GLN",name:"GLUTAMINE",type:"l-peptide linking"},{id:"TYR",name:"TYROSINE",type:"l-peptide linking"},{id:"ASP",name:"ASPARTIC ACID",type:"l-peptide linking"},{id:"GLU",name:"GLUTAMIC ACID",type:"l-peptide linking"},{id:"THR",name:"THREONINE",type:"l-peptide linking"},{id:"PRO",name:"PROLINE",type:"l-peptide linking"},{id:"SEC",name:"SELENOCYSTEINE",type:"l-peptide linking"},{id:"PYL",name:"PYRROLYSINE",type:"l-peptide linking"},{id:"MSE",name:"SELENOMETHIONINE",type:"l-peptide linking"},{id:"SEP",name:"PHOSPHOSERINE",type:"l-peptide linking"},{id:"TPO",name:"PHOSPHOTHREONINE",type:"l-peptide linking"},{id:"PTR",name:"O-PHOSPHOTYROSINE",type:"l-peptide linking"},{id:"PCA",name:"PYROGLUTAMIC ACID",type:"l-peptide linking"},{id:"A",name:"ADENOSINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"C",name:"CYTIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"T",name:"THYMIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"G",name:"GUANOSINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"I",name:"INOSINIC ACID",type:"rna linking"},{id:"U",name:"URIDINE-5'-MONOPHOSPHATE",type:"rna linking"},{id:"DA",name:"2'-DEOXYADENOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DC",name:"2'-DEOXYCYTIDINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DT",name:"THYMIDINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DG",name:"2'-DEOXYGUANOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DI",name:"2'-DEOXYINOSINE-5'-MONOPHOSPHATE",type:"dna linking"},{id:"DU",name:"2'-DEOXYURIDINE-5'-MONOPHOSPHATE",type:"dna linking"}].forEach(r=>e.set(r.id,r)),e})(),Fve=(function(){let e=new Map;return[{id:"ZN2",name:"ZINC ION",type:"ion"},{id:"SOD",name:"SODIUM ION",type:"ion"},{id:"CES",name:"CESIUM ION",type:"ion"},{id:"CLA",name:"CHLORIDE ION",type:"ion"},{id:"CAL",name:"CALCIUM ION",type:"ion"},{id:"POT",name:"POTASSIUM ION",type:"ion"}].forEach(r=>e.set(r.id,r)),e})(),Ia=class{set(t){this.comps.set(t.id,t),this.ids.push(t.id),this.names.push(t.name),this.types.push(t.type),this.mon_nstd_flags.push(Jv.has(t.id)?"y":"n")}getAtomIds(t){let r=new Set,n=this.seqId.value(t);for(;t<this.seqId.rowCount;){let o=this.seqId.value(t);if(o!==n)break;r.add(this.atomId.value(t)),n-o,t+=1}return r}hasAtomIds(t,r){for(let n=0,o=r.length;n<o;++n)if(!So.areIntersecting(t,r[n]))return!1;return!0}getType(t){return this.hasAtomIds(t,qmt)?"peptide linking":this.hasAtomIds(t,jmt)?"rna linking":this.hasAtomIds(t,Gmt)?"dna linking":"other"}has(t){return this.comps.has(t)}get(t){return this.comps.get(t)}add(t,r){if(!this.has(t))if(Lve.has(t))this.set(Lve.get(t));else if(dT.has(t))this.set({id:t,name:"WATER",type:"non-polymer"});else if(Hmt.has(t.toUpperCase()))this.set({id:t,name:this.namesMap.get(t)||t,type:"non-polymer"});else if(Dp.has(t.toUpperCase()))this.set({id:t,name:this.namesMap.get(t)||t,type:"saccharide"});else{let n=this.getAtomIds(r);if(n.size===1&&Fve.has(t))this.set(Fve.get(t));else{let o=this.getType(n);this.set({id:t,name:this.namesMap.get(t)||t,type:o})}}return this.get(t)}getChemCompTable(){return Or.ofPartialColumns(ni.chem_comp,{id:G.ofStringArray(this.ids),name:G.ofStringArray(this.names),type:G.ofStringAliasArray(this.types),mon_nstd_flag:G.ofStringAliasArray(this.mon_nstd_flags)},this.ids.length)}setNames(t){t.forEach(r=>this.namesMap.set(r[0],r[1]))}constructor(t,r){this.seqId=t,this.atomId=r,this.namesMap=new Map,this.comps=new Map,this.ids=[],this.names=[],this.types=[],this.mon_nstd_flags=[]}}});var Nve,KTr,KK=M(()=>{Tr();Om();Br();zs();tn();Nve={molstar_bond_site:{atom_id_1:G.Schema.int,atom_id_2:G.Schema.int,value_order:G.Schema.Aliased(G.Schema.lstr),type_id:G.Schema.Aliased(G.Schema.lstr)}},KTr=Di.fields().int("atom_id_1",(e,t)=>t[e].atom_id_1).int("atom_id_2",(e,t)=>t[e].atom_id_2).str("value_order",(e,t)=>{var r;return(r=t[e].value_order)!==null&&r!==void 0?r:""},{valueKind:(e,t)=>t[e].value_order===void 0?G.ValueKinds.NotPresent:G.ValueKinds.Present}).str("type_id",(e,t)=>{var r;return(r=t[e].type_id)!==null&&r!==void 0?r:""},{valueKind:(e,t)=>t[e].type_id===void 0?G.ValueKinds.NotPresent:G.ValueKinds.Present}).getFields()});function Wmt(e){if(oo.is(e.sourceData))return di.fromData(e.sourceData.data.db)}function Kmt(e){if(!oo.is(e.sourceData))return;let{struct_conf:t,struct_sheet_range:r}=e.sourceData.data.db;return gg.fromStruct(t,r,e.atomicHierarchy)}function Ymt(e){if(!oo.is(e.sourceData))return;let{atom_site_anisotrop:t}=e.sourceData.data.db,r=Or.ofColumns(Jd.Schema,t),n=Jd.getElementToAnsiotrop(e.atomicConformation.atomId,t.id);return{data:r,elementToAnsiotrop:n}}function Xmt(e){return oo.is(e.sourceData)?e.sourceData.data.db.atom_site_anisotrop.U.isDefined:!1}function Zmt(e){if(!oo.is(e.sourceData))return;let{chem_comp_bond:t}=e.sourceData.data.db;if(t._rowCount!==0)return{data:t,entries:nb.getEntriesFromChemCompBond(t)}}function $mt(e){if(!oo.is(e.sourceData))return;let{struct_conn:t}=e.sourceData.data.db;if(t._rowCount===0)return;let r=cd.getEntriesFromStructConn(t,e),n=new Set;for(let o of r)o.partnerA.residueIndex!==o.partnerB.residueIndex&&n.add(Wd(o.partnerA.residueIndex,o.partnerB.residueIndex));return{data:t,byAtomIndex:cd.getAtomIndexFromEntries(r),residueCantorPairs:n,entries:r}}function Qmt(e){if(!oo.is(e.sourceData))return;let{molstar_bond_site:t}=Uf(Nve,e.sourceData.data.frame);if(t._rowCount===0)return;let r=new Map,{atomId:n}=e.atomicConformation;for(let m=0;m<n.rowCount;m++)r.set(n.value(m),m);let o=[],i=[],a=[],s=[],{atom_id_1:l,atom_id_2:c,value_order:u,type_id:d}=t;for(let m=0;m<t._rowCount;m++){o.push(r.get(l.value(m))),i.push(r.get(c.value(m)));let p=Tt.Flag.None,h=1;switch(u.value(m)){case"sing":h=1;break;case"doub":h=2;break;case"trip":h=3;break;case"quad":h=4;break;case"arom":h=1,p=Tt.Flag.Aromatic;break;default:break}switch(d.value(m)){case"covale":p|=Tt.Flag.Covalent;break;case"disulf":p|=Tt.Flag.Covalent|Tt.Flag.Disulfide;break;case"hydrog":p|=Tt.Flag.HydrogenBond;break;case"metalc":p|=Tt.Flag.MetallicCoordination;break}a.push(h),s.push(p)}return ui.fromData({pairs:{indexA:G.ofIntArray(o),indexB:G.ofIntArray(i),order:G.ofIntArray(a),flag:G.ofArray({array:s,schema:G.Schema.int})},count:e.atomicHierarchy.atoms._rowCount},{maxDistance:1/0})}function jL(e,t){let r=oo.fromFrame(e,void 0,void 0,t),n=za(r.data.db,!0);return Me.create("Create mmCIF Model",o=>js(n,r,o))}function Vve(e){let t=WD.fromFrame(e);return Me.create("Create CCD Models",r=>Jmt(t.data.db,WD.fromFrame(e),r))}async function Jmt(e,t,r){let n=await Uve(e,t,{coordinateType:"ideal",cartn_x:"pdbx_model_Cartn_x_ideal",cartn_y:"pdbx_model_Cartn_y_ideal",cartn_z:"pdbx_model_Cartn_z_ideal"},r),o=await Uve(e,t,{coordinateType:"model",cartn_x:"model_Cartn_x",cartn_y:"model_Cartn_y",cartn_z:"model_Cartn_z"},r),i=[];n&&i.push(n),o&&i.push(o);for(let a=0,s=i.length;a<s;++a)Ht.TrajectoryInfo.set(i[a],{index:a,size:i.length});return new Ec(i)}async function Uve(e,t,r,n){let{chem_comp:o,chem_comp_atom:i,chem_comp_bond:a}=e,{coordinateType:s,cartn_x:l,cartn_y:c,cartn_z:u}=r,d=o.name.value(0),f=o.id.value(0),{atom_id:m,charge:p,comp_id:h,pdbx_ordinal:g,type_symbol:y}=i,b=i._rowCount,x=[];for(let oe=0;oe<b;oe++)i[l].valueKind(oe)>0||(x[x.length]=oe);let C=x.length,S=G.ofConst("A",C,G.Schema.str),w=G.ofConst(1,C,G.Schema.int),A=G.ofConst("1",C,G.Schema.str),T=G.ofConst(1,C,G.Schema.float),D=G.ofConst(1,C,G.Schema.int),E=G.view(m,x),I=G.view(h,x),k=G.view(i[l],x),R=G.view(i[c],x),B=G.view(i[u],x),O=G.view(g,x),F=G.view(y,x),q=G.view(p,x),W=Or.ofPartialColumns(ni.atom_site,{auth_asym_id:S,auth_atom_id:E,auth_comp_id:I,auth_seq_id:w,Cartn_x:k,Cartn_y:R,Cartn_z:B,id:O,label_asym_id:S,label_atom_id:E,label_comp_id:I,label_seq_id:w,label_entity_id:A,occupancy:T,type_symbol:F,pdbx_PDB_model_num:D,pdbx_formal_charge:q},C),j=new Pa;j.setNames([[f,`${d} (${s})`]]),j.getEntityId(f,_r.Unknown,"A");let L=new Ia(w,y);L.setNames([[f,`${d} (${s})`]]),L.add(f,0);let V=za({entity:j.getEntityTable(),chem_comp:L.getChemCompTable(),atom_site:W}),U=await js(V,t,n);if(!U.representative)return;let z=U.representative,ie=nb.getEntriesFromChemCompBond(a);return nb.Provider.set(z,{data:a,entries:ie}),WD.CoordinateType.set(z,s),U.representative}var oo,WD,jf=M(()=>{_D();hr();Um();Fp();Rp();LD();Tr();GD();WW();SD();gt();qL();Gc();Gf();Br();Hf();tn();ag();sD();KK();di.Provider.formatRegistry.add("mmCIF",Wmt);gg.Provider.formatRegistry.add("mmCIF",Kmt);Jd.Provider.formatRegistry.add("mmCIF",Ymt,Xmt);nb.Provider.formatRegistry.add("mmCIF",Zmt);cd.Provider.formatRegistry.add("mmCIF",$mt);ui.Provider.formatRegistry.add("mmCIF",Qmt);j0.Provider.formatRegistry.add("mmCIF",j0.fromMmCif,j0.hasData);(function(e){function t(n){return n?.kind==="mmCIF"}e.is=t;function r(n,o,i,a){return o||(o=Qd.schema.mmCIF(n)),{kind:"mmCIF",name:o._name,data:{db:o,file:a,frame:n,source:i}}}e.fromFrame=r})(oo||(oo={}));(function(e){let t="__CcdCoordinateType__";e.CoordinateType={get(o){return o._staticPropertyData[t]},set(o,i){return o._staticPropertyData[t]=i}};function r(o){return o?.kind==="CCD"}e.is=r;function n(o,i){return i||(i=Qd.schema.CCD(o)),{kind:"CCD",name:i._name,data:{db:i,frame:o}}}e.fromFrame=n})(WD||(WD={}))});var G0,GL=M(()=>{Ue();Vt();Fs();wc();(function(e){function t(n){let o=n.descriptor.name,i=n.type==="static"?"_staticPropertyData":"_dynamicPropertyData",a=l=>(o in l[i]||(l[i][o]={props:{..._.getDefaultValues(n.getParams(l))},data:w0.create(void 0)}),l[i][o]),s=(l,c,u)=>{let d=a(l);l[i][o]={props:c,data:w0.withValue(d.data,u)}};return{label:n.label,descriptor:n.descriptor,isHidden:n.isHidden,getParams:l=>{let c=_.clone(n.getParams(l));return _.setDefaultValues(c,a(l).props),c},defaultParams:n.defaultParams,isApplicable:n.isApplicable,attach:async(l,c,u={},d)=>{d&&c.customProperties.reference(n.descriptor,!0);let f=a(c),m=_.merge(n.defaultParams,f.props,u);if(f.data.value&&_.areEqual(n.defaultParams,f.props,m))return;let{value:p,assets:h}=await n.obtain(l,c,m);c.customProperties.add(n.descriptor),c.customProperties.assets(n.descriptor,h),s(c,m,p)},ref:(l,c)=>l.customProperties.reference(n.descriptor,c),get:l=>{var c;return(c=a(l))===null||c===void 0?void 0:c.data},set:(l,c={},u)=>{let d=a(l),f=_.merge(n.defaultParams,d.props,c);_.areEqual(n.defaultParams,d.props,f)||(s(l,f,u),l.customProperties.assets(n.descriptor))},props:l=>a(l).props}}e.createProvider=t;function r(n,o,i){let a={value:_.Value(i,{isHidden:!0})};return t({label:Ml(n),descriptor:ss({name:n}),isHidden:!0,type:o,defaultParams:a,getParams:()=>({value:_.Value(i,{isHidden:!0})}),isApplicable:()=>!0,obtain:async(s,l,c)=>({..._.getDefaultValues(a),...c})})}e.createSimple=r})(G0||(G0={}))});var dd,UT=M(()=>{Tr();jf();Fs();GL();(function(e){e.Provider=G0.createProvider({label:"SIFTS Mapping",descriptor:ss({name:"sifts_sequence_mapping"}),type:"static",defaultParams:{},getParams:()=>({}),isApplicable:i=>t(i),obtain:async(i,a)=>({value:o(a)})});function t(i){if(!oo.is(i.sourceData))return!1;let{pdbx_sifts_xref_db_name:a,pdbx_sifts_xref_db_acc:s,pdbx_sifts_xref_db_num:l,pdbx_sifts_xref_db_res:c}=i.sourceData.data.db.atom_site;return a.isDefined&&s.isDefined&&l.isDefined&&c.isDefined}e.isAvailable=t;function r(i){let a=i.unit.model,s=e.Provider.get(a).value;if(!s)return"";let l=a.atomicHierarchy.residueAtomSegments.index[i.element];return s.accession[l]}e.getKey=r;function n(i){let a=i.unit.model,s=e.Provider.get(a).value;if(!s)return;let l=a.atomicHierarchy.residueAtomSegments.index[i.element],c=s.dbName[l];if(c)return`${c} ${s.accession[l]} ${s.num[l]} ${s.residue[l]}`}e.getLabel=n;function o(i){if(!oo.is(i.sourceData))return;let{pdbx_sifts_xref_db_name:a,pdbx_sifts_xref_db_acc:s,pdbx_sifts_xref_db_num:l,pdbx_sifts_xref_db_res:c}=i.sourceData.data.db.atom_site;if(!a.isDefined||!s.isDefined||!l.isDefined||!c.isDefined)return;let{atomSourceIndex:u}=i.atomicHierarchy,{count:d,offsets:f}=i.atomicHierarchy.residueAtomSegments,m=new Array(d),p=new Array(d),h=new Array(d),g=new Array(d);for(let y=0;y<d;y++){let b=u.value(f[y]);if(a.valueKind(b)!==G.ValueKinds.Present){m[y]="",p[y]="",h[y]="",g[y]="";continue}m[y]=a.value(b),p[y]=s.value(b),h[y]=l.value(b),g[y]=c.value(b)}return{dbName:m,accession:p,num:h,residue:g}}})(dd||(dd={}))});var DAr,kAr,YK=M(()=>{Om();jf();UT();zs();DAr=Di.Field,kAr=Di.Encodings});var FAr,zve=M(()=>{Ut();Om();zs();Tr();YK();LD();FAr=Di.Field});function XK(e,t){if(oo.is(e.sourceData))return e.sourceData.data.db[t]}function qve(e){if(e.length===0)return new Set;let t=e[0].model.entities.data.id;return new Set(jve(e).map(r=>t.value(r)))}function jve(e){if(e.length===0)return[];if(e.length===1)return e[0].entityIndices;let t=$n.create();for(let r of e)for(let n of r.entityIndices)$n.add(t,n,n);return Yl(t.array),t.array}var HL=M(()=>{Nf();ku();tn();Om();jf();Um()});var ePr,Gve=M(()=>{Tr();Om();HL();ePr=Di.Category});function ZK(e){return{name:e,instance({structures:t,cache:r}){return npt(t,e,r)}}}function npt(e,t,r){let n=XK(e[0].model,t);if(!n)return Hve.Empty;let{entity_id:o}=n,i=r.uniqueEntityIds||(r.uniqueEntityIds=qve(e)),a=G.indicesOf(o,s=>i.has(s));return Hve.ofTable(n,a)}var Hve,ept,tpt,rpt,Wve=M(()=>{Tr();Om();HL();Hve=Di.Category,ept=ZK("struct_asym"),tpt=ZK("entity_poly"),rpt=ZK("entity_poly_seq")});var vPr,Kve,Yve,Xve=M(()=>{Om();YK();zve();Gve();HL();Wve();Fs();$K();jf();KK();vPr=Di.Category;(function(e){function t(r){let n=Array.isArray(r)?r:[r];return{structures:n,firstModel:n[0].model,cache:Object.create(null)}}e.create=t})(Kve||(Kve={}));(function(e){e.AtomSitePositionsFieldNames=new Set(["id","Cartn_x","Cartn_y","Cartn_z"])})(Yve||(Yve={}))});var zs=M(()=>{ib();ug();sd();DD();CD();lb();eL();Xve()});var $ve,Zve,QK,jPr,$K=M(()=>{zs();sd();Ut();Om();Tr();$ve={molstar_atom_site_operator_mapping:{label_asym_id:G.Schema.Str(),auth_asym_id:G.Schema.Str(),operator_name:G.Schema.Str(),suffix:G.Schema.Str(),assembly_id:G.Schema.Str(),assembly_operator_id:G.Schema.Int(),symmetry_operator_index:G.Schema.Int(),symmetry_hkl:G.Schema.Vector(3),ncs_id:G.Schema.Int()}},Zve=(e,t)=>typeof t[e].operator.assembly>"u"?G.ValueKinds.NotPresent:G.ValueKinds.Present,QK=(e,t)=>t[e].operator.spgrOp===-1?G.ValueKinds.NotPresent:G.ValueKinds.Present,jPr=Di.fields().str("label_asym_id",(e,t)=>t[e].label_asym_id).str("auth_asym_id",(e,t)=>t[e].auth_asym_id).str("operator_name",(e,t)=>t[e].operator.name).str("suffix",(e,t)=>t[e].operator.suffix).str("assembly_id",(e,t)=>{var r;return((r=t[e].operator.assembly)===null||r===void 0?void 0:r.id)||""},{valueKind:Zve}).int("assembly_operator_id",(e,t)=>{var r;return((r=t[e].operator.assembly)===null||r===void 0?void 0:r.operId)||0},{valueKind:Zve}).int("symmetry_operator_index",(e,t)=>t[e].operator.spgrOp,{valueKind:QK}).vec("symmetry_hkl",[(e,t)=>t[e].operator.hkl[0],(e,t)=>t[e].operator.hkl[1],(e,t)=>t[e].operator.hkl[2]],{valueKind:QK}).int("ncs_id",(e,t)=>t[e].operator.ncsId,{valueKind:QK}).getFields()});function Qve(e,t,r,n){let{label_comp_id:o,type_symbol:i,_rowCount:a}=e.atoms,{_rowCount:s}=e.residues,{offsets:l}=t.residueAtomSegments,c=new Uint8Array(a);for(let y=0;y<a;++y)c[y]=ix(i.value(y));let u=new Int32Array(s),d=new Int32Array(s),f=new Int32Array(s),m=new Uint8Array(s),p=new Uint8Array(s),h=new Map,g=new Map;for(let y=0;y<s;++y){let b=o.value(l[y]),x=n,C,S;if(h.has(b))C=h.get(b),S=g.get(b);else{let E;x.has(b)?E=x.get(b).type:(q1||console.info("chemComp not found",b),E=wW(b)),C=qc(E,b),S=khe(E,C),h.set(b,C),g.set(b,S)}m[y]=C,p[y]=S;let w=O0(S,"trace"),A=r.findAtomsOnResidue(y,w);if(A===-1){let E=O0(S,"coarseBackbone");A=r.findAtomsOnResidue(y,E),A===-1&&K1(C)&&(A=r.findElementOnResidue(y,ig("C")))}u[y]=A;let T=O0(S,"directionFrom");d[y]=r.findAtomsOnResidue(y,T);let D=O0(S,"directionTo");f[y]=r.findAtomsOnResidue(y,D)}return{atom:{atomicNumber:c},residue:{traceElementIndex:u,directionFromElementIndex:d,directionToElementIndex:f,moleculeType:m,polymerType:p}}}var Jve=M(()=>{L0();Br();ax();Fn()});function VT(e,t){return t?t.length===1?Xa(t.charCodeAt(0),e):t.length===2?Xa(t.charCodeAt(0),Xa(t.charCodeAt(1),e)):`${e} ${t}`:e}function opt(e,t,r,n){if(e.has(t)){let o=e.get(t);o.has(r)||o.set(r,n)}else{let o=new Map;e.set(t,o),o.set(r,n)}}function ipt(e){throw new Error(`Missing entity entry for entity id '${e}'.`)}function apt(e,t,r){return{entities:e,segments:r,label_seq_id:je.ofSortedArray(t.residues.label_seq_id.toArray({array:Int32Array})),label_atom_id:t.atoms.label_atom_id,auth_atom_id:t.atoms.auth_atom_id,label_alt_id:t.atoms.label_alt_id,type_symbol:t.atoms.type_symbol,chain_index_entity_index:new Int32Array(t.chains._rowCount),entity_index_label_asym_id:new Map,chain_index_label_seq_id:new Map,auth_asym_id_auth_seq_id:new Map,chain_index_auth_seq_id:new Map,label_asym_id:new Map}}function JK(e,t,r,n){for(let o=e;o<t;o++)if(r.value(o)===n)return o;return-1}function spt(e,t,r,n){for(let o=e;o<t;o++)if(n.has(r.value(o)))return o;return-1}function eY(e,t,r,n,o,i){for(let a=e;a<t;a++)if(r.value(a)===o&&n.value(a)===i)return a;return-1}function lpt(e,t,r,n){for(let o=e;o<t;o++)if(r.value(o)===n)return o;return-1}function ebe(e,t,r){let n=apt(t,e,r),{label_seq_id:o,auth_seq_id:i,pdbx_PDB_ins_code:a}=e.residues,{label_entity_id:s,label_asym_id:l,auth_asym_id:c}=e.chains,u=xe.ofBounds(0,e.atoms._rowCount),d=nr.transientSegments(r.chainAtomSegments,u);for(;d.hasNext;){let f=d.move(),m=f.index,p=t.getEntityIndex(s.value(m));p<0&&ipt(s.value(m)),n.chain_index_entity_index[m]=p;let h=c.value(m),g=n.auth_asym_id_auth_seq_id.get(h);g||(g=new Map,n.auth_asym_id_auth_seq_id.set(h,g));let y=l.value(m);n.label_asym_id.has(y)||n.label_asym_id.set(y,p),opt(n.entity_index_label_asym_id,p,y,m);let b=new Map,x=new Map;n.chain_index_label_seq_id.set(m,b),n.chain_index_auth_seq_id.set(m,x);let C=nr.transientSegments(r.residueAtomSegments,u,f);for(;C.hasNext;){let w=C.move().index,A=i.value(w),T=a.value(w);b.set(VT(o.value(w),T),w),x.set(VT(A,T),w),g.set(A,m)}}return new tY(n)}var KD,tY,tbe=M(()=>{Ut();lK();tn();KD=gL.EmptyResidueKey(),tY=class{getEntityFromChain(t){return this.map.chain_index_entity_index[t]}findEntity(t){let r=this.map.label_asym_id.get(t);return r!==void 0?r:-1}findChainLabel(t){let r=this.entityIndex(t.label_entity_id);if(r<0||!this.map.entity_index_label_asym_id.has(r))return-1;let n=this.map.entity_index_label_asym_id.get(r);return n&&n.has(t.label_asym_id)?n.get(t.label_asym_id):-1}findChainAuth(t){if(!this.map.auth_asym_id_auth_seq_id.has(t.auth_asym_id))return-1;let r=this.map.auth_asym_id_auth_seq_id.get(t.auth_asym_id);return r.has(t.auth_seq_id)?r.get(t.auth_seq_id):-1}findResidue(t,r,n,o){let i;arguments.length===1?i=t:(KD.label_entity_id=t,KD.label_asym_id=r,KD.auth_seq_id=n,KD.pdbx_PDB_ins_code=o,i=KD);let a=this.findChainLabel(i);if(a<0)return-1;let s=this.map.chain_index_auth_seq_id.get(a),l=VT(i.auth_seq_id,i.pdbx_PDB_ins_code||"");return s.has(l)?s.get(l):-1}findResidueLabel(t){let r=this.findChainLabel(t);if(r<0)return-1;let n=this.map.chain_index_label_seq_id.get(r),o=VT(t.label_seq_id,t.pdbx_PDB_ins_code||"");return n.has(o)?n.get(o):-1}findResidueAuth(t){let r=this.findChainAuth(t);if(r<0)return-1;let n=this.map.chain_index_auth_seq_id.get(r),o=VT(t.auth_seq_id,t.pdbx_PDB_ins_code||"");return n.has(o)?n.get(o):-1}findResidueInsertion(t){let r=this.findChainLabel(t);if(r<0)return-1;let n=this.map.chain_index_label_seq_id.get(r),o=VT(t.label_seq_id,t.pdbx_PDB_ins_code||"");if(n.has(o))return n.get(o);let i=je.findPredecessorIndex(this.map.label_seq_id,t.label_seq_id),a=cx.chainStartResidueIndex(this.map.segments,r);if(i<a)return a;let s=cx.chainEndResidueIndexExcl(this.map.segments,r)-1;return i>=s?s:i}findAtom(t){let r=this.findResidue(t);return r<0?-1:typeof t.label_alt_id>"u"?JK(this.residueOffsets[r],this.residueOffsets[r+1],this.map.label_atom_id,t.label_atom_id):eY(this.residueOffsets[r],this.residueOffsets[r+1],this.map.label_atom_id,this.map.label_alt_id,t.label_atom_id,t.label_alt_id)}findAtomAuth(t){let r=this.findResidueAuth(t);return r<0?-1:typeof t.label_alt_id>"u"?JK(this.residueOffsets[r],this.residueOffsets[r+1],this.map.auth_atom_id,t.auth_atom_id):eY(this.residueOffsets[r],this.residueOffsets[r+1],this.map.auth_atom_id,this.map.label_alt_id,t.auth_atom_id,t.label_alt_id)}findAtomOnResidue(t,r,n){return typeof n>"u"?JK(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,r):eY(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,this.map.label_alt_id,r,n)}findAtomsOnResidue(t,r){return spt(this.residueOffsets[t],this.residueOffsets[t+1],this.map.label_atom_id,r)}findElementOnResidue(t,r){return lpt(this.residueOffsets[t],this.residueOffsets[t+1],this.map.type_symbol,r)}constructor(t){this.map=t,this.entityIndex=t.entities.getEntityIndex,this.residueOffsets=this.map.segments.residueAtomSegments.offsets}}});function cpt(e){if(e._rowCount===0)return{residues:[],chains:[]};let t=0,r=e._rowCount,n=[t],o=[t],{label_entity_id:i,label_asym_id:a,label_seq_id:s,auth_seq_id:l,pdbx_PDB_ins_code:c}=e;for(let u=t+1;u<r;u++){let d=!i.areValuesEqual(u-1,u)||!a.areValuesEqual(u-1,u);(d||!s.areValuesEqual(u-1,u)||!l.areValuesEqual(u-1,u)||!c.areValuesEqual(u-1,u))&&(n[n.length]=u),d&&(o[o.length]=u)}return{residues:n,chains:o}}function upt(e,t,r){let n=Or.ofColumns(x0e,{type_symbol:G.ofArray({array:G.mapToArray(e.type_symbol,ig),schema:G.Schema.Aliased(G.Schema.str)}),label_atom_id:e.label_atom_id,auth_atom_id:e.auth_atom_id,label_alt_id:e.label_alt_id,label_comp_id:e.label_comp_id,auth_comp_id:e.auth_comp_id,pdbx_formal_charge:e.pdbx_formal_charge}),o=Or.view(e,S0e,r.residues),i=Or.view(e,_0e,r.chains);if(!o.label_seq_id.isDefined){let a=new Int32Array(o.label_seq_id.rowCount),{residues:s,chains:l}=r,c=0,u=0;for(let d=0,f=a.length;d<f;++d)s[d]>=l[c+1]&&(c+=1,u=0),a[d]=++u;o.label_seq_id=G.ofIntArray(a)}return Or.columnToArray(o,"label_seq_id",Int32Array),Or.columnToArray(o,"auth_seq_id",Int32Array),{atoms:n,residues:o,chains:i,atomSourceIndex:t}}function dpt(e){return{id:En.create22(),atomId:e.id,occupancy:e.occupancy.isDefined?e.occupancy:G.ofConst(1,e._rowCount,G.Schema.float),B_iso_or_equiv:e.B_iso_or_equiv,xyzDefined:e.Cartn_x.isDefined&&e.Cartn_y.isDefined&&e.Cartn_z.isDefined,x:e.Cartn_x.toArray({array:Float32Array}),y:e.Cartn_y.toArray({array:Float32Array}),z:e.Cartn_z.toArray({array:Float32Array})}}function fpt(e,t){return Or.areEqual(e.chains,t.chains)&&Or.areEqual(e.residues,t.residues)&&Or.areEqual(e.atoms,t.atoms)}function mpt(e,t){let r=new Map;if(!oo.is(t))return r;let{molstar_atom_site_operator_mapping:n}=Uf($ve,t.data.frame);if(n._rowCount===0)return r;let o=new Map,i=new Map;for(let u=0;u<n._rowCount;u++){let d=n.assembly_operator_id.valueKind(u)===G.ValueKinds.Present?{id:n.assembly_id.value(u),operList:[],operId:n.assembly_operator_id.value(u)}:void 0,f=mo.create(n.operator_name.value(u),H.identity(),{assembly:d,spgrOp:n.symmetry_operator_index.valueKind(u)===G.ValueKinds.Present?n.symmetry_operator_index.value(u):void 0,hkl:v.ofArray(n.symmetry_hkl.value(u)),ncsId:n.ncs_id.value(u)}),m=n.suffix.value(u),p=n.label_asym_id.value(u);o.set(`${p}${m}`,{name:p,operator:f});let h=n.auth_asym_id.value(u);i.set(`${h}${m}`,h)}let{label_asym_id:a,auth_asym_id:s}=e.chains,l=new Array(a.rowCount),c=new Array(a.rowCount);for(let u=0;u<a.rowCount;u++){let d=a.value(u),f=s.value(u);if(!o.has(d)){l[u]=d,c[u]=f;continue}let{name:m,operator:p}=o.get(d);r.set(u,p),l[u]=m,c[u]=i.get(f)||f}return e.chains.label_asym_id=G.ofArray({array:l,valueKind:e.chains.label_asym_id.valueKind,schema:e.chains.label_asym_id.schema}),e.chains.auth_asym_id=G.ofArray({array:c,valueKind:e.chains.auth_asym_id.valueKind,schema:e.chains.auth_asym_id.schema}),r}function ppt(e,t,r,n,o,i){let a=cpt(e),s=upt(e,t,a),l=mpt(s,o);if(i&&fpt(i.atomicHierarchy,s))return{sameAsPrevious:!0,hierarchy:i.atomicHierarchy,chainOperatorMapping:l};let c={residueAtomSegments:nr.ofOffsets(a.residues,xe.ofBounds(0,e._rowCount)),chainAtomSegments:nr.ofOffsets(a.chains,xe.ofBounds(0,e._rowCount))},u=ebe(s,r,c),d=Qve(s,c,u,n);return{sameAsPrevious:!1,hierarchy:{...s,...c,index:u,derived:d},chainOperatorMapping:l}}function rY(e,t,r,n,o,i){let{sameAsPrevious:a,hierarchy:s,chainOperatorMapping:l}=ppt(e,t,r,n,o,i),c=dpt(e);return{sameAsPrevious:a,hierarchy:s,conformation:c,chainOperatorMapping:l}}var rbe=M(()=>{Tr();Ut();sD();or();Ge();$K();L0();Jve();tbe();Br();Qw();jf()});var nbe=M(()=>{});function ibe(e){return new oY(e)}function obe({count:e,entity_id:t,asym_id:r,seq_id_begin:n,seq_id_end:o}){let i={};for(let a=0;a<e;a++){let s=t.value(a),l=r.value(a);i[s]||(i[s]={}),i[s][l]||(i[s][l]={});let c=i[s][l],u=n.value(a),d=o.value(a);for(let f=u;f<=d;f++)c[f]=a}return i}var nY,abe,oY,iY=M(()=>{nY=class{findElement(t,r){return r.kind=void 0,r.index=-1,!1}findSphereElement(t){return-1}findGaussianElement(t){return-1}},abe=new nY,oY=class{get sphereMapping(){return this._sphereMapping||(this._sphereMapping=obe(this.data.spheres)),this._sphereMapping}get gaussianMapping(){return this._gaussianMapping||(this._gaussianMapping=obe(this.data.gaussians)),this._gaussianMapping}findSphereElement(t){var r;let o=this.sphereMapping[t.label_entity_id];return!o||(o=o[t.label_asym_id],!o)?-1:(r=o[t.label_seq_id])!==null&&r!==void 0?r:-1}findGaussianElement(t){var r;let o=this.gaussianMapping[t.label_entity_id];return!o||(o=o[t.label_asym_id],!o)?-1:(r=o[t.label_seq_id])!==null&&r!==void 0?r:-1}findElement(t,r){let n=this.findSphereElement(t);if(n>=0)return r.kind="spheres",r.index=n,!0;let o=this.findGaussianElement(t);return o>=0?(r.kind="gaussians",r.index=o,!0):!1}constructor(t){this.data=t,this._sphereMapping=void 0,this._gaussianMapping=void 0}}});var sbe,WL,lbe=M(()=>{Tr();Ut();dg();iY();sbe={chainKey:[],entityKey:[],findSequenceKey:()=>-1,findChainKey:()=>-1,getEntityFromChain:()=>-1,count:0,entity_id:G.Undefined(0,G.Schema.str),asym_id:G.Undefined(0,G.Schema.str),seq_id_begin:G.Undefined(0,G.Schema.int),seq_id_end:G.Undefined(0,G.Schema.int),chainElementSegments:nr.create([]),polymerRanges:lo.ofSortedRanges([]),gapRanges:lo.ofSortedRanges([])};(function(e){e.Empty={isDefined:!1,spheres:sbe,gaussians:sbe,index:abe}})(WL||(WL={}))});var cbe=M(()=>{nbe();lbe()});function hpt(e,t,r){if(e.has(t))return e.get(t);let n=r.index++;return e.set(t,n),n}function gpt(e,t){if(e.has(t))return e.get(t);let r=new Map;return e.set(t,r),r}function ypt(e,t,r){let n=e.getEntityIndex;return{findChainKey:(a,s)=>{let l=n(a);if(l<0)return-1;let c=t.get(l);return c.has(s)?c.get(s):-1},findSequenceKey:(a,s,l)=>{let c=n(a);if(c<0)return-1;let u=t.get(c);if(u===void 0)return-1;let d=u.get(s);if(d===void 0)return-1;let f=r.get(d),{elementIndices:m,seqRanges:p}=f,h=lo.firstIntersectionIndex(p,Se.ofSingleton(l));return h!==-1?m[h]:-1}}}function vpt(e){throw new Error(`Missing entity entry for entity id '${e}'.`)}function aY(e,t){let{entity_id:r,asym_id:n,seq_id_begin:o,seq_id_end:i,count:a,chainElementSegments:s}=e,l=new Map,c=new Map,u={index:0},d=new Int32Array(a),f=new Int32Array(a),m=new Int32Array(s.count);for(let y=0;y<a;y++)f[y]=t.getEntityIndex(r.value(y)),f[y]<0&&vpt(r.value(y));for(let y=0;y<s.count;y++){let b=s.offsets[y],x=s.offsets[y+1],C=f[b];m[y]=C;let S=gpt(c,C),w=hpt(S,n.value(b),u);for(let E=b;E<x;E++)d[E]=w;let A=[],T=[];for(let E=b;E<x;E++){let I=o.value(E),k=i.value(E);A.push(E),T.push(I,k)}let D={elementIndices:A,seqRanges:lo.ofSortedRanges(T)};l.set(w,D)}let{findChainKey:p,findSequenceKey:h}=ypt(t,c,l);return{chainKey:d,entityKey:f,findSequenceKey:h,findChainKey:p,getEntityFromChain:y=>m[y]}}var ube=M(()=>{dg();Ut()});function sY(e,t){let r=[],n=[],o=nr.transientSegments(e.chainElementSegments,xe.ofBounds(0,e.count)),{seq_id_begin:i,seq_id_end:a}=e;for(;o.hasNext;){let{start:s,end:l}=o.move(),c=-1,u=-1;for(let d=s;d<l;++d){let f=a.value(d);d===s?(c=d,u=a.value(d)):i.value(d)-u>1&&(r.push(c,d-1),n.push(d-1,d),c=d),d===l-1&&r.push(c,d),u=f}}return{polymerRanges:lo.ofSortedRanges(r),gapRanges:lo.ofSortedRanges(n)}}var dbe=M(()=>{Ut();dg()});function mbe(e,t){let{ihm_sphere_obj_site:r,ihm_gaussian_obj_site:n}=e;if(r._rowCount===0&&n._rowCount===0)return lY;let o=fbe(r),i=bpt(r),a=aY(o,e.entities),s=sY(o,t),l=fbe(n),c=xpt(n),u=aY(l,e.entities),d=sY(l,t);return{hierarchy:{isDefined:!0,spheres:{...o,...a,...s},gaussians:{...l,...u,...d},index:ibe({spheres:o,gaussians:l})},conformation:{id:En.create22(),spheres:i,gaussians:c}}}function bpt(e){return{x:e.Cartn_x.toArray({array:Float32Array}),y:e.Cartn_y.toArray({array:Float32Array}),z:e.Cartn_z.toArray({array:Float32Array}),radius:e.object_radius.toArray({array:Float32Array}),rmsf:e.rmsf.toArray({array:Float32Array})}}function xpt(e){let t=ni.ihm_gaussian_obj_site.covariance_matrix.space,r=[],{covariance_matrix:n}=e;for(let o=0,i=n.rowCount;o<i;o++)r[o]=Rr.toMat3(Yt(),t,n.value(o));return{x:e.mean_Cartn_x.toArray({array:Float32Array}),y:e.mean_Cartn_y.toArray({array:Float32Array}),z:e.mean_Cartn_z.toArray({array:Float32Array}),weight:e.weight.toArray({array:Float32Array}),covariance_matrix:r}}function Spt(e,t,r){let n=[0];for(let o=1,i=e.rowCount;o<i;o++)!e.areValuesEqual(o-1,o)&&(n[n.length]=o);return{chainElementSegments:nr.ofOffsets(n,xe.ofBounds(0,e.rowCount))}}function fbe(e){let{entity_id:t,seq_id_begin:r,seq_id_end:n,asym_id:o}=e;return{count:t.rowCount,entity_id:t,asym_id:o,seq_id_begin:r,seq_id_end:n,...Spt(o,r,n)}}var lY,pbe=M(()=>{cbe();ube();Vt();Ut();Ge();dbe();Gc();iY();lY={hierarchy:WL.Empty,conformation:void 0}});function cY(e){return _pt[e]||"X"}function uY(e){return wpt[e]||"X"}function dY(e){return Cpt[e]||"X"}var _pt,Cpt,wpt,hbe=M(()=>{_pt={HIS:"H",ARG:"R",LYS:"K",ILE:"I",PHE:"F",LEU:"L",TRP:"W",ALA:"A",MET:"M",PRO:"P",CYS:"C",ASN:"N",VAL:"V",GLY:"G",SER:"S",GLN:"Q",TYR:"Y",ASP:"D",GLU:"E",THR:"T",SEC:"U",PYL:"O",HSD:"H",HSE:"H",HSP:"H",LSN:"K",ASPP:"D",GLUP:"E",HID:"H",HIE:"H",HIP:"H",LYN:"K",ASH:"D",GLH:"E"},Cpt={DA:"A",DC:"C",DG:"G",DT:"T",DU:"U"},wpt={A:"A",C:"C",G:"G",T:"T",U:"U"}});var L2,gbe=M(()=>{hbe();Tr();Oo();(function(e){let t;(function(c){c.Protein="protein",c.RNA="RNA",c.DNA="DNA",c.Generic="generic"})(t=e.Kind||(e.Kind={}));function r(c){let u=c.code.toArray();return(u instanceof Array?u:Array.from(u)).join("")}e.getSequenceString=r;function n(c){for(let u=0,d=Math.min(c.rowCount,10);u<d;u++){let f=c.value(u)||"";if(cY(f)!=="X")return t.Protein;if(uY(f)!=="X")return t.RNA;if(dY(f)!=="X")return t.DNA}return t.Generic}function o(c,u){let d;switch(c){case t.Protein:d=cY;break;case t.DNA:d=dY;break;case t.RNA:d=uY;break;case t.Generic:d=()=>"X";break;default:Er(c)}return u&&u.size>0?f=>{let m=d(f);return m!=="X"||!u.has(f)?m:d(u.get(f))}:d}function i(c,u){if(u.rowCount===0)throw new Error("cannot be empty");let d=n(c);return new a(d,c,u)}e.ofResidueNames=i;class a{index(u){return this.indexMap.get(u)}constructor(u,d,f){this.kind=u,this.microHet=new Map;let m=o(u),p=[],h=[],g=[],y=new Map,b=0,x=new Map;for(let S=0,w=f.rowCount;S<w;++S){let A=f.value(S);if(x.has(A))y.has(A)?y.get(A).push(d.value(S)):y.set(A,[h[x.get(A)],d.value(S)]);else{x.set(A,b);let T=d.value(S);h[b]=T,g[b]=A,p[b]=m(T),b+=1}}let C=[];for(let S=0,w=b;S<w;++S){let A=y.get(g[S]);if(A){let T=A.map(D=>{let E=m(D);return E==="X"?D:E});C[S]=`(${T.join("|")})`}else C[S]=p[S]==="X"?h[S]:p[S]}this.length=b,this.code=G.ofStringArray(p),this.compId=G.ofStringArray(h),this.seqId=G.ofIntArray(g),this.label=G.ofStringArray(C),this.microHet=y,this.indexMap=x}}function s(c,u){let d=t.Generic;return new l(d,c,u)}e.ofSequenceRanges=s;class l{index(u){return u-this.minSeqId}constructor(u,d,f){this.kind=u,this.seqIdStart=d,this.seqIdEnd=f,this.microHet=new Map;let m=0,p=Number.MAX_SAFE_INTEGER;for(let g=0,y=this.seqIdStart.rowCount;g<y;g++){let b=this.seqIdStart.value(g),x=this.seqIdEnd.value(g);b<p&&(p=b),m<x&&(m=x)}let h=m-p+1;this.code=G.ofConst("X",h,G.Schema.str),this.label=G.ofConst("",h,G.Schema.str),this.seqId=G.ofLambda({value:g=>g+p+1,rowCount:h,schema:G.Schema.int}),this.compId=G.ofConst("",h,G.Schema.str),this.length=h,this.minSeqId=p}}})(L2||(L2={}))});var fY=M(()=>{gbe()});var YD,mY=M(()=>{Tr();fY();(function(e){let t={byEntityKey:{},sequences:[]};function r(...s){let l=[],c={};for(let u=0,d=s.length;u<d;++u)l.push(...s[u].sequences),Object.assign(c,s[u].byEntityKey);return{sequences:l,byEntityKey:c}}function n(s,l,c){let u=o(s,l),d=c.isDefined?i(s,c):t;return r(u,d)}e.fromHierarchy=n;function o(s,l){let{label_comp_id:c}=l.atoms,{label_seq_id:u}=l.residues,{chainAtomSegments:d,residueAtomSegments:f}=l,{count:m,offsets:p}=d,h={},g=[];if(m===1&&p[0]===0&&p[1]===0)return{byEntityKey:h,sequences:g};for(let y=0,b=l.chains._rowCount;y<b;y++){let x=l.index.getEntityFromChain(y);if(h[x]!==void 0||s.data.type.value(x)!=="polymer")continue;let C=y;for(y++;y<b&&x===l.index.getEntityFromChain(y)&&s.data.type.value(x)!=="polymer";)y++;y--;let S=f.index[p[C]],w=f.index[p[y+1]-1]+1,A=G.window(u,S,w),T=[];for(let E=S;E<w;++E)T.push(c.value(f.offsets[E]));let D=G.ofStringArray(T);h[x]={entityId:s.data.id.value(x),sequence:L2.ofResidueNames(D,A)},g.push(h[x])}return{byEntityKey:h,sequences:g}}e.fromAtomicHierarchy=o;function i(s,l){let c=a(s,l.spheres),u=a(s,l.gaussians);return r(c,u)}e.fromCoarseHierarchy=i;function a(s,l){let{chainElementSegments:c,seq_id_begin:u,seq_id_end:d}=l,{count:f,offsets:m}=c,p={},h=[];if(f===1&&m[0]===0&&m[1]===0)return{byEntityKey:p,sequences:h};for(let g=0,y=f;g<y;g++){let b=l.getEntityFromChain(g);if(p[b]!==void 0)continue;let x=g;for(g++;g<y&&b===l.getEntityFromChain(g);)g++;g--;let C=m[x],S=m[g+1]-1,w=G.window(u,C,S),A=G.window(d,C,S);p[b]={entityId:s.data.id.value(b),sequence:L2.ofSequenceRanges(w,A)},h.push(p[b])}return{byEntityKey:p,sequences:h}}e.fromCoarseElements=a})(YD||(YD={}))});function pY(e,t,r,n){if(!e.entity_poly_seq||!e.entity_poly_seq._rowCount)return YD.fromHierarchy(t,r,n);let{entity_id:o,num:i,mon_id:a}=e.entity_poly_seq,s={},l=[],c=o.rowCount,u=0;for(;u<c;){let d=u;for(;u<c-1&&o.areValuesEqual(u,u+1);)u++;u++;let f=o.value(d),m=G.window(a,d,u),p=G.window(i,d,u),h=t.getEntityIndex(f);s[h]={entityId:f,sequence:L2.ofResidueNames(m,p)},l.push(s[h])}return{byEntityKey:s,sequences:l}}var ybe=M(()=>{mY();Tr();fY()});async function hY(e,t,r,n){let o=tD(r,n-1),{label_entity_id:i,label_asym_id:a,label_seq_id:s}=t,l=u4(o,i.value);e.shouldUpdate&&await e.update();for(let c=0,u=l.length-1;c<u;c++){let d=u4(o,a.value,{start:l[c],end:l[c+1]});for(let f=0,m=d.length-1;f<m;f++){let p=d[f];s.valueKind(p)===G.ValueKinds.Present&&(u4(o,s.value,{sort:!0,start:p,end:d[f+1]}),e.shouldUpdate&&await e.update())}e.shouldUpdate&&await e.update()}return ome(o)&&o.length===t._rowCount?{atom_site:t,sourceIndex:G.ofIntArray(o)}:{atom_site:Or.view(t,t._schema,o),sourceIndex:G.ofIntArray(o)}}var vbe=M(()=>{tn();Tr();Jn()});function bbe(e,t,r,n,o){let{polymerType:i,traceElementIndex:a,directionFromElementIndex:s,directionToElementIndex:l}=o.residue,c=i[e],u=i[t];if(c===al.NA||u===al.NA||a[e]===-1||a[t]===-1)return!1;let d=n.findAtomsOnResidue(e,O0(c,"backboneStart")),f=n.findAtomsOnResidue(t,O0(u,"backboneEnd"));(d===-1||f===-1)&&(d=n.findAtomsOnResidue(e,O0(c,"coarseBackbone")),f=n.findAtomsOnResidue(t,O0(u,"coarseBackbone")));let{x:m,y:p,z:h}=r,g=v.create(m[d],p[d],h[d]),y=v.create(m[f],p[f],h[f]),b=s[e]===-1||l[e]===-1||s[t]===-1||l[t]===-1;return v.distance(g,y)<(b?10:3)}function gY(e,t,r,n){let o=[],i=[],a=new Map,s=nr.transientSegments(e.chainAtomSegments,xe.ofBounds(0,e.atoms._rowCount)),l=nr.transientSegments(e.residueAtomSegments,xe.ofBounds(0,e.atoms._rowCount)),{index:c,derived:u}=e,{label_seq_id:d}=e.residues,{label_entity_id:f}=e.chains,{moleculeType:m,traceElementIndex:p}=u.residue,h,g,y,b;for(;s.hasNext;){let x=s.move();l.setSegment(x),h=-1,g=-1,y=-1,b=-1;let C=t.getEntityIndex(f.value(x.index)),S=n.byEntityKey[C],w=S?S.sequence.seqId.value(S.sequence.seqId.rowCount-1):-1,A=e.residueAtomSegments.index[x.start],T=e.residueAtomSegments.index[x.end-1],D=d.value(A),E=d.value(T);for(D===1&&E===w&&r.xyzDefined&&bbe(A,T,r,c,u)&&(a.set(A,T),a.set(T,A));l.hasNext;){let I=l.move(),k=I.index,R=d.value(k);if(K1(m[k])&&p[k]!==-1)if(b!==-1)if(R!==h+1)o.push(b,y-1),i.push(g,I.end-1),b=I.start;else if(!l.hasNext)o.push(b,I.end-1);else{let B=e.residueAtomSegments.index[I.start],O=e.residueAtomSegments.index[y-1];r.xyzDefined&&!bbe(B,O,r,e.index,u)&&(o.push(b,y-1),i.push(g,I.end-1),b=I.start)}else b=I.start;else b!==-1&&(o.push(b,y-1),b=-1);g=I.start,y=I.end,h=R}}return{polymerRanges:lo.ofSortedRanges(o),gapRanges:lo.ofSortedRanges(i),cyclicPolymerMap:a}}var xbe=M(()=>{Ut();dg();Br();ax();Ge()});function Sbe(e){let t=new Map,r=(o,i,a)=>`${o}|${i}|${a}`,n=e.pdbx_unobs_or_zero_occ_residues;for(let o=0,i=n._rowCount;o<i;++o){let a=r(n.PDB_model_num.value(o),n.label_asym_id.value(o),n.label_seq_id.value(o));t.set(a,{polymer_flag:n.polymer_flag.value(o),occupancy_flag:n.occupancy_flag.value(o)})}return{has:(o,i,a)=>t.has(r(o,i,a)),get:(o,i,a)=>t.get(r(o,i,a)),size:t.size}}function _be(e){let t=new Map;if(e.chem_comp._rowCount>0){let{id:r}=e.chem_comp;for(let n=0,o=r.rowCount;n<o;++n)t.set(r.value(n),Or.getRow(e.chem_comp,n))}else wbe(e).forEach(n=>{t.set(n,Mhe(n))});return t}function Cbe(e){let t=new Map;if(e.pdbx_chem_comp_identifier._rowCount>0){let{comp_id:r,type:n,identifier:o}=e.pdbx_chem_comp_identifier;for(let i=0,a=r.rowCount;i<a;++i)if(n.value(i)==="SNFG CARBOHYDRATE SYMBOL"||n.value(i)==="SNFG CARB SYMBOL"){let s=o.value(i),l=che.get(s);l?t.set(r.value(i),l):console.warn(`Unknown SNFG name '${s}'`)}}if(e.chem_comp._rowCount>0){let{id:r,type:n}=e.chem_comp;for(let o=0,i=r.rowCount;o<i;++o){let a=r.value(o);if(t.has(a))continue;let s=n.value(o);Dp.has(a)?t.set(a,Dp.get(a)):qc(s,a)===_r.Saccharide&&t.set(a,C4)}}else{let r=wbe(e);Dp.forEach((n,o)=>{!t.has(o)&&r.has(o)&&t.set(o,n)})}return t}function yY(e,t){let r=new Map,{auth_asym_id:n,label_asym_id:o,label_entity_id:i}=e.chains;for(let a=0,s=e.chains._rowCount;a<s;a++){let l=o.value(a);r.set(l,{id:l,auth_id:n.value(a),entity_id:i.value(a)})}if(t?.struct_asym._rowCount){let{id:a,entity_id:s}=t.struct_asym;for(let l=0,c=a.rowCount;l<c;++l){let u=a.value(l);r.has(u)||r.set(u,{id:u,auth_id:"",entity_id:s.value(l)})}}return r}var wbe,Tbe=M(()=>{Tr();Br();h2();Vf();wbe=lg(e=>{let t=new Set,{label_comp_id:r,auth_comp_id:n}=e.atom_site,o=r.isDefined?r:n;for(let i=0,a=o.rowCount;i<a;++i)t.add(o.value(i));return t})});var Abe,Pbe=M(()=>{Tr();Abe=G.Schema.Aliased(G.Schema.Str())});function vY(e){let t;if(e.entity.id.isDefined)t=e.entity;else{let s=new Set,l=[],c=[],{label_entity_id:u,label_comp_id:d}=e.atom_site;for(let p=0,h=e.atom_site._rowCount;p<h;p++){let g=u.value(p);s.has(g)||(l.push(g),c.push(Bhe(d.value(p))),s.add(g))}let{entity_id:f}=e.ihm_sphere_obj_site;for(let p=0,h=e.ihm_sphere_obj_site._rowCount;p<h;p++){let g=f.value(p);s.has(g)||(l.push(g),c.push("polymer"),s.add(g))}let{entity_id:m}=e.ihm_gaussian_obj_site;for(let p=0,h=e.ihm_gaussian_obj_site._rowCount;p<h;p++){let g=m.value(p);s.has(g)||(l.push(g),c.push("polymer"),s.add(g))}t=Or.ofPartialColumns(ni.entity,{id:G.ofArray({array:l,schema:ni.entity.id}),type:G.ofArray({array:c,schema:ni.entity.type})},l.length)}let r=G.createIndexer(t.id),n=new Array(t._rowCount);n.fill("other");let o=new Set,i=!1;if(e.entity_poly&&e.entity_poly.type.isDefined){let{entity_id:s,type:l,_rowCount:c}=e.entity_poly;for(let u=0;u<c;++u){let d=s.value(u);n[r(d)]=l.value(u),o.add(d)}}else i=!0;if(e.pdbx_entity_branch&&e.pdbx_entity_branch.entity_id.isDefined){let{entity_id:s,type:l,_rowCount:c}=e.pdbx_entity_branch;for(let u=0;u<c;++u){let d=s.value(u);n[r(d)]=l.value(u),o.add(d)}}else i=!0;if(o.size<n.length&&(i=!0),i){let s=new Map;if(e.chem_comp){let{id:l,type:c}=e.chem_comp;for(let u=0,d=e.chem_comp._rowCount;u<d;u++)s.set(l.value(u),c.value(u))}if(e.atom_site){let{label_entity_id:l,label_comp_id:c}=e.atom_site;for(let u=0,d=e.atom_site._rowCount;u<d;u++){let f=l.value(u);if(!o.has(f)){let m=c.value(u),p=s.get(m)||"other";n[r(f)]=Rhe(m,p),o.add(f)}}}}let a=G.ofArray({array:n,schema:Abe});return{data:t,subtype:a,getEntityIndex:r}}function bY(e,t,r){var n;if(!e.pdbx_molecule||!e.pdbx_molecule.prd_id.isDefined)return t;let o=new Array(t.data._rowCount);o.fill("");let{asym_id:i,prd_id:a,_rowCount:s}=e.pdbx_molecule;for(let c=0;c<s;++c){let u=i.value(c),d=(n=r.get(u))===null||n===void 0?void 0:n.entity_id;d!==void 0&&(o[t.getEntityIndex(d)]=a.value(c))}let l=G.ofArray({array:o,schema:G.Schema.str});return{...t,prd_id:l}}var Ibe=M(()=>{Tr();Pbe();Br();Gc()});var Ec,XD=M(()=>{Ec=class{getFrameAtIndex(t){return this.frames[t]}constructor(t){this.frames=t,this.frameCount=t.length,this.representative=t[0],this.duration=t.length}}});async function js(e,t,r){let n=Tpt(e,t),o=e.ihm_model_list._rowCount>0?await Ept(r,e,n,t):await Ipt(r,e,n,t);for(let i=0;i<o.length;i++)Ht.TrajectoryInfo.set(o[i],{index:i,size:o.length});return new Ec(o)}function Tpt(e,t){return{missingResidues:Sbe(e),chemicalComponentMap:_be(e),saccharideComponentMap:Cbe(e)}}function Apt(e,t,r,n,o,i,a){let s=rY(t,r,n,o.chemicalComponentMap,i,a),l=t.pdbx_PDB_model_num.value(0);if(a&&s.sameAsPrevious)return{...a,id:En.create22(),modelNum:l,atomicConformation:s.conformation,_dynamicPropertyData:Object.create(null)};let c=lY,u=pY(e,n,s.hierarchy,c.hierarchy),d=gY(s.hierarchy,n,s.conformation,u),f=yY(s.hierarchy),m=e.entry.id.valueKind(0)===G.ValueKinds.Present?e.entry.id.value(0):i.name,p=[];return m&&p.push(m),e.struct.title.valueKind(0)===G.ValueKinds.Present&&p.push(e.struct.title.value(0)),{id:En.create22(),entryId:m,label:p.join(" | "),entry:m,sourceData:i,modelNum:l,parent:void 0,entities:bY(e,n,f),sequence:u,atomicHierarchy:s.hierarchy,atomicConformation:s.conformation,atomicRanges:d,atomicChainOperatorMappinng:s.chainOperatorMapping,coarseHierarchy:c.hierarchy,coarseConformation:c.conformation,properties:{...o,structAsymMap:f},customProperties:new Ls,_staticPropertyData:Object.create(null),_dynamicPropertyData:Object.create(null)}}function Ppt(e,t,r,n){let o=rY(t.atom_site,t.atom_site_sourceIndex,t.entities,r.chemicalComponentMap,n),i=mbe(t,r.chemicalComponentMap),a=pY(e,t.entities,o.hierarchy,i.hierarchy),s=gY(o.hierarchy,t.entities,o.conformation,a),l=e.entry.id.valueKind(0)===G.ValueKinds.Present?e.entry.id.value(0):n.name,c=[];l&&c.push(l),e.struct.title.valueKind(0)===G.ValueKinds.Present&&c.push(e.struct.title.value(0)),t.model_name&&c.push(t.model_name),t.model_group_name&&c.push(t.model_group_name);let u=yY(o.hierarchy,e);return{id:En.create22(),entryId:l,label:c.join(" | "),entry:l,sourceData:n,modelNum:t.model_id,parent:void 0,entities:bY(e,t.entities,u),sequence:a,atomicHierarchy:o.hierarchy,atomicConformation:o.conformation,atomicRanges:s,atomicChainOperatorMappinng:o.chainOperatorMapping,coarseHierarchy:i.hierarchy,coarseConformation:i.conformation,properties:{...r,structAsymMap:u},customProperties:new Ls,_staticPropertyData:Object.create(null),_dynamicPropertyData:Object.create(null)}}function Ebe(e,t){let r=e.rowCount;if(!e.isDefined)return r;let n=t+1;for(;n<r&&e.areValuesEqual(t,n);)n++;return n}async function Ipt(e,t,r,n){let o=[];if(t.atom_site){let i=t.atom_site.id.rowCount,a=vY(t),s=0;for(;s<i;){let l=Ebe(t.atom_site.pdbx_PDB_model_num,s),{atom_site:c,sourceIndex:u}=await hY(e,t.atom_site,s,l),d=Apt(t,c,u,a,r,n,o.length>0?o[o.length-1]:void 0);o.push(d),s=l}}return o}function xY(e,t){let r=new Map,n=e._rowCount,o=0;for(;o<n;){let i=Ebe(t,o),a=t.value(o);r.set(a,{table:Or.window(e,e._schema,o,i),start:o,end:i}),o=i}return r}async function Ept(e,t,r,n){let o=vY(t),i=t.atom_site.ihm_model_id.isDefined?t.atom_site.ihm_model_id:t.atom_site.pdbx_PDB_model_num,a=xY(t.atom_site,i),s=xY(t.ihm_sphere_obj_site,t.ihm_sphere_obj_site.model_id),l=xY(t.ihm_gaussian_obj_site,t.ihm_gaussian_obj_site.model_id),c=[];if(t.ihm_model_list){let{model_id:u,model_name:d}=t.ihm_model_list;for(let f=0;f<t.ihm_model_list._rowCount;f++){let m=u.value(f),p,h;if(a.has(m)){let b=a.get(m),{atom_site:x,sourceIndex:C}=await hY(e,t.atom_site,b.start,b.end);p=x,h=C}else p=Or.window(t.atom_site,t.atom_site._schema,0,0),h=G.ofIntArray([]);let g={model_id:m,model_name:d.value(f),model_group_name:Rve(m,t),entities:o,atom_site:p,atom_site_sourceIndex:h,ihm_sphere_obj_site:s.has(m)?s.get(m).table:Or.window(t.ihm_sphere_obj_site,t.ihm_sphere_obj_site._schema,0,0),ihm_gaussian_obj_site:l.has(m)?l.get(m).table:Or.window(t.ihm_gaussian_obj_site,t.ihm_gaussian_obj_site._schema,0,0)},y=Ppt(t,g,r,n);c.push(y)}}return c}var Fp=M(()=>{Tr();Qw();_D();Fs();rbe();pbe();ybe();vbe();xbe();Tbe();Ibe();WK();XD()});var Ht,_D=M(()=>{Qw();Fs();sme();Ge();O1();hr();ag();Fp();jf();Rp();Tr();GL();XD();Br();LD();(function(e){function t(V,U){let z=[],{frames:ie}=U,oe=r(V),X=y(V),Y=V.atomicHierarchy.atoms._rowCount;for(let ne=0,K=ie.length;ne<K;++ne){let $=ie[ne];if($.elementCount!==Y)throw new Error(`Frame element count mismatch, got ${$.elementCount} but expected ${Y}.`);let Z={...V,id:En.create22(),modelNum:ne,atomicConformation:i(V,$),customProperties:new Ls,_staticPropertyData:Object.create(null),_dynamicPropertyData:Object.create(null)};if($.cell){let de=di.fromCell($.cell.size,$.cell.anglesInRadians);di.Provider.set(Z,de)}e.TrajectoryInfo.set(Z,{index:ne,size:ie.length}),e.CoarseGrained.set(Z,X),z.push(Z)}return{trajectory:z,srcIndexArray:oe}}function r(V){let U=V.atomicHierarchy.atomSourceIndex,z;return"__srcIndexArray__"in V._staticPropertyData?z=V._dynamicPropertyData.__srcIndexArray__:(z=G.isIdentity(U)?void 0:U.toArray({array:Int32Array}),V._dynamicPropertyData.__srcIndexArray__=z),z}function n(V,U){return new Ec(t(V,U).trajectory)}e.trajectoryFromModelAndCoordinates=n;function o(V,U){return Me.create("Create Trajectory",async z=>{let ie=await js(V.basic,V.sourceData,z);if(ie.frameCount===0)throw new Error("found no model");let oe=ie.representative,{trajectory:X}=t(oe,U),Y={pairs:V.bonds,count:oe.atomicHierarchy.atoms._rowCount},ne=ui.fromData(Y),K=y(oe),$=0;for(let Z of X)ui.Provider.set(Z,ne),e.TrajectoryInfo.set(Z,{index:$++,size:X.length}),e.CoarseGrained.set(Z,K);return new Ec(X)})}e.trajectoryFromTopologyAndCoordinates=o;function i(V,U){return Lf.getAtomicConformation(U,{atomId:V.atomicConformation.atomId,occupancy:V.atomicConformation.occupancy,B_iso_or_equiv:V.atomicConformation.B_iso_or_equiv},r(V))}e.getAtomicConformationFromFrame=i;let a="__Center__";function s(V){if(V._dynamicPropertyData[a])return V._dynamicPropertyData[a];let U=ime(V.atomicConformation,V.coarseConformation);return V._dynamicPropertyData[a]=U,U}e.getCenter=s;function l(V){let U=new Int32Array(V.rowCount),z=!1;for(let ie=0,oe=V.rowCount;ie<oe;ie++){let X=V.value(ie);X!==ie&&(z=!1),U[X]=ie}return{isIdentity:z,invertedIndex:U}}let c="__InvertedAtomSrcIndex__";function u(V){if(V._staticPropertyData[c])return V._staticPropertyData[c];let U=l(V.atomicHierarchy.atomSourceIndex);return V._staticPropertyData[c]=U,U}e.getInvertedAtomSourceIndex=u;let d="__TrajectoryInfo__";e.TrajectoryInfo={get(V){return V._dynamicPropertyData[d]||{index:0,size:1}},set(V,U){return V._dynamicPropertyData[d]=U}};let f="__AsymIdCount__";e.AsymIdCount={get(V){if(V._dynamicPropertyData[f])return V._dynamicPropertyData[f];let U=ame(V);return V._dynamicPropertyData[f]=U,U}},e.AsymIdOffset=G0.createSimple("asym_id_offset","static"),e.Index=G0.createSimple("index","static"),e.MaxIndex=G0.createSimple("max_index","static");function m(V){return V.parent||V}e.getRoot=m;function p(V,U){return V.atomicHierarchy===U.atomicHierarchy&&V.coarseHierarchy===U.coarseHierarchy}e.areHierarchiesEqual=p;let h="__CoordinatesHistory__";e.CoordinatesHistory={get(V){return V._staticPropertyData[h]},set(V,U){return V._staticPropertyData[h]=U}};let g="__CoarseGrained__";e.CoarseGrained={get(V){return V._staticPropertyData[g]},set(V,U){return V._staticPropertyData[g]=U}};function y(V){let U=e.CoarseGrained.get(V);if(U===void 0){let z=0,ie=0,{polymerType:oe,directionToElementIndex:X}=V.atomicHierarchy.derived.residue;for(let Z=0;Z<oe.length;++Z)oe[Z]!==al.NA&&(z+=1,X[Z]!==-1&&(ie+=1));let Y=!1,ne=!1,{label_atom_id:K,_rowCount:$}=V.atomicHierarchy.atoms;for(let Z=0;Z<$;++Z){let de=K.value(Z);if(!Y&&de==="BB"&&(Y=!0),!ne&&de==="SC1"&&(ne=!0),Y&&ne)break}U=!1,$>0&&z>0&&(Y&&ne||$/z<3||ie===0)&&(U=!0),e.CoarseGrained.set(V,U)}return U}e.isCoarseGrained=y;function b(V){return V.properties.saccharideComponentMap.size>0}e.hasCarbohydrate=b;function x(V){let{subtype:U}=V.entities;for(let z=0,ie=U.rowCount;z<ie;++z)if(U.value(z).startsWith("polypeptide"))return!0;return!1}e.hasProtein=x;function C(V){let{subtype:U}=V.entities;for(let z=0,ie=U.rowCount;z<ie;++z){let oe=U.value(z);if(oe.endsWith("ribonucleotide hybrid")||oe.endsWith("ribonucleotide"))return!0}return!1}e.hasNucleic=C;function S(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data;for(let z=0,ie=U.database_2.database_id.rowCount;z<ie;++z)if(U.database_2.database_id.value(z)==="pdb")return!0;return!1}e.isFromPdbArchive=S;function w(V){return oo.is(V.sourceData)?V.entryId.match(/^[1-9][a-z0-9]{3,3}$/i)!==null||V.entryId.match(/^pdb_[0-9]{4,4}[1-9][a-z0-9]{3,3}$/i)!==null:!1}e.hasPdbId=w;function A(V){if(oo.is(V.sourceData)){let{db:U}=V.sourceData.data;return U.struct_conf.id.isDefined||U.struct_sheet_range.id.isDefined}else return gg.Provider.isApplicable(V)}e.hasSecondaryStructure=A;let T=v.create(1.5707963,1.5707963,1.5707963),D=v.create(1,1,1);function E(V){var U;let z=(U=di.Provider.get(V))===null||U===void 0?void 0:U.spacegroup;return!!z&&!(z.num===1&&v.equals(z.cell.anglesInRadians,T)&&v.equals(z.cell.size,D))}e.hasCrystalSymmetry=E;function I(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data;for(let z=0;z<U.exptl.method.rowCount;z++)if(U.exptl.method.value(z).toUpperCase().indexOf("DIFFRACTION")>=0)return!0;return!1}e.isFromXray=I;function k(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data;for(let z=0;z<U.exptl.method.rowCount;z++)if(U.exptl.method.value(z).toUpperCase().indexOf("MICROSCOPY")>=0)return!0;return!1}e.isFromEm=k;function R(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data;for(let z=0;z<U.exptl.method.rowCount;z++)if(U.exptl.method.value(z).toUpperCase().indexOf("NMR")>=0)return!0;return!1}e.isFromNmr=R;function B(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data;for(let z=0;z<U.struct.pdbx_structure_determination_methodology.rowCount;z++)if(U.struct.pdbx_structure_determination_methodology.value(z).toLowerCase()==="experimental")return!0;return!1}e.isExperimental=B;function O(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data;for(let z=0;z<U.struct.pdbx_structure_determination_methodology.rowCount;z++)if(U.struct.pdbx_structure_determination_methodology.value(z).toLowerCase()==="integrative")return!0;return!1}e.isIntegrative=O;function F(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data;for(let z=0;z<U.struct.pdbx_structure_determination_methodology.rowCount;z++)if(U.struct.pdbx_structure_determination_methodology.value(z).toLowerCase()==="computational")return!0;return!1}e.isComputational=F;function q(V){if(!oo.is(V.sourceData)||!I(V))return!1;let{db:U}=V.sourceData.data,{status_code_sf:z}=U.pdbx_database_status;return z.isDefined&&z.value(0)==="REL"}e.hasXrayMap=q;function W(V){if(!oo.is(V.sourceData))return!1;let{db:U}=V.sourceData.data,{db_name:z,content_type:ie}=U.pdbx_database_related;for(let oe=0,X=U.pdbx_database_related._rowCount;oe<X;++oe)if(z.value(oe).toUpperCase()==="EMDB"&&ie.value(oe)==="associated EM volume")return!0;return!1}e.hasEmMap=W;function j(V){return oo.is(V.sourceData)?q(V)||W(V):!1}e.hasDensityMap=j;function L(V){if(!oo.is(V.sourceData)||e.isIntegrative(V))return!1;let{db:U}=V.sourceData.data;return j(V)||w(V)&&(!U.exptl.method.isDefined||I(V)&&(!U.pdbx_database_status.status_code_sf.isDefined||U.pdbx_database_status.status_code_sf.valueKind(0)===G.ValueKinds.Unknown)||k(V)&&!U.pdbx_database_related.db_name.isDefined)}e.probablyHasDensityMap=L})(Ht||(Ht={}))});function SY(e){let t=new Map;for(let r=0,n=e.length;r<n;r++)t.set(r,e[r]);return t}var Dbe,zT,KL,_Y,kbe=M(()=>{zs();Ut();Vt();(function(e){function t(d,f,m){if(!f)return{rowCount:0};if(m&&m[f.id])return m[f.id];let p=f.getElements(d),h={data:p,rowCount:p.elements.length};return m&&(m[f.id]=h),h}e.getCifDataSource=t;function r(d){return new KL(d)}e.fromAtomMap=r;function n(d){return new KL(SY(d))}e.fromAtomArray=n;let o=d=>d.atomicHierarchy.residueAtomSegments;function i(d){return new zT("residue",d,o,fe.Kind.Atomic)}e.fromResidueMap=i;function a(d){return new zT("residue",SY(d),o,fe.Kind.Atomic)}e.fromResidueArray=a;let s=d=>d.atomicHierarchy.chainAtomSegments;function l(d){return new zT("chain",d,s,fe.Kind.Atomic)}e.fromChainMap=l;function c(d){return new zT("chain",SY(d),s,fe.Kind.Atomic)}e.fromChainArray=c;function u(d){return new _Y(d)}e.fromEntityMap=u})(Dbe||(Dbe={}));zT=class{has(t){return this.map.has(t)}get(t){return this.map.get(t)}getStructureElements(t){let r=t.models;if(r.length!==1)throw new Error("Only works on structures with a single model.");let n=new Set,o=t.unitSymmetryGroups,i=[],a=this.segmentGetter(r[0]);for(let s of o){let l=s.units[0];if(l.kind!==this.kind)continue;let c=nr.transientSegments(a,l.elements);for(;c.hasNext;){let u=c.move();!this.has(u.index)||n.has(u.index)||(n.add(u.index),i[i.length]=te.Location.create(t,l,l.elements[u.start]))}}return i.sort((s,l)=>s.element-l.element),i}getElements(t){let r=this.segmentGetter(t.model).index,n=this.getStructureElements(t);return{elements:n,property:o=>this.get(r[n[o].element])}}constructor(t,r,n,o){this.level=t,this.map=r,this.segmentGetter=n,this.id=En.create22(),this.kind=o}},KL=class{has(t){return this.map.has(t)}get(t){return this.map.get(t)}getStructureElements(t){if(t.models.length!==1)throw new Error("Only works on structures with a single model.");let n=new Set,o=t.unitSymmetryGroups,i=[];for(let a of o){let s=a.units[0];if(s.kind!==this.kind)continue;let l=s.elements;for(let c=0,u=l.length;c<u;c++){let d=l[c];!this.has(d)||n.has(d)||(n.add(l[c]),i[i.length]=te.Location.create(t,s,d))}}return i.sort((a,s)=>a.element-s.element),i}getElements(t){let r=this.getStructureElements(t);return{elements:r,property:n=>this.get(r[n].element)}}constructor(t){this.map=t,this.id=En.create22(),this.level="atom",this.kind=fe.Kind.Atomic}},_Y=class{has(t){return this.map.has(t)}get(t){return this.map.get(t)}getStructureElements(t){let r=t.models;if(r.length!==1)throw new Error("Only works on structures with a single model.");let n=r[0].atomicHierarchy.index,o=new Set,i=t.unitSymmetryGroups,a=[],s=r[0].atomicHierarchy.chainAtomSegments;for(let l of i){let c=l.units[0];if(c.kind!==this.kind)continue;let u=nr.transientSegments(s,c.elements);for(;u.hasNext;){let d=u.move(),f=n.getEntityFromChain(d.index);!this.has(f)||o.has(f)||(o.add(f),a[a.length]=te.Location.create(t,c,c.elements[d.start]))}}return a.sort((l,c)=>l.element-c.element),a}getElements(t){let r=this.getStructureElements(t),n=t.model.atomicHierarchy.chainAtomSegments.index,o=t.model.atomicHierarchy.index;return{elements:r,property:i=>this.get(o.getEntityFromChain(n[r[i].element]))}}constructor(t){this.map=t,this.id=En.create22(),this.level="entity",this.kind=fe.Kind.Atomic}}});var Mbe=M(()=>{});var nx=M(()=>{_D();Br();iL();mY();kbe();Mbe()});var gt=M(()=>{O1();eme();nx();zs();ID();XD()});function fi(e){return(t,r)=>e(r&&r[0]&&r[0](t)||t.element)}function Bbe(e,t){return e|(Tt.isName(t)?Tt.fromName(t):Tt.Flag.None)}function Rbe(e,t){switch(t.toLowerCase()){case"helix":return e|cr.Flag.Helix;case"alpha":return e|cr.Flag.Helix|cr.Flag.HelixAlpha;case"pi":return e|cr.Flag.Helix|cr.Flag.HelixPi;case"310":return e|cr.Flag.Helix|cr.Flag.Helix3Ten;case"beta":return e|cr.Flag.Beta;case"strand":return e|cr.Flag.Beta|cr.Flag.BetaStrand;case"sheet":return e|cr.Flag.Beta|cr.Flag.BetaSheet;case"turn":return e|cr.Flag.Turn;case"bend":return e|cr.Flag.Bend;case"coil":return e|cr.Flag.NA;default:return e}}function kpt(e,t){let r=[];if(!t)return r;if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r.push(t[n](e));else{let n=Object.keys(t);for(let o=1,i=n.length;o<i;o++)r.push(t[n[o]](e))}return r}var rn,wr,Dpt,Obe=M(()=>{VO();VD();gt();Br();Nf();wc();L0();tn();fL();Jn();rn=gx.Const,wr=gx.Dynamic,Dpt=[rn(Ee.core.type.bool,function(t,r){return!!r[0](t)}),rn(Ee.core.type.num,function(t,r){return+r[0](t)}),rn(Ee.core.type.str,function(t,r){return""+r[0](t)}),rn(Ee.core.type.list,function(t,r){return OT.forEachEval(r,t,(n,o,i)=>i[o]=n,[])}),rn(Ee.core.type.set,function(t,r){return OT.forEachEval(r,t,function(o,i,a){return a.add(o)},new Set)}),rn(Ee.core.type.regex,function(t,r){return new RegExp(r[0](t),r[1]&&r[1](t)||"")}),rn(Ee.core.type.bitflags,function(t,r){return+r[0](t)}),rn(Ee.core.type.compositeKey,function(t,r){return OT.forEachEval(r,t,(n,o,i)=>i[o]=""+n,[]).join("-")}),rn(Ee.core.logic.not,(e,t)=>!t[0](e)),rn(Ee.core.logic.and,(e,t)=>{if(typeof t.length=="number"){for(let r=0,n=t.length;r<n;r++)if(!t[r](e))return!1}else for(let r of Object.keys(t))if(!t[r](e))return!1;return!0}),rn(Ee.core.logic.or,(e,t)=>{if(typeof t.length=="number"){for(let r=0,n=t.length;r<n;r++)if(t[r](e))return!0}else for(let r of Object.keys(t))if(t[r](e))return!0;return!1}),rn(Ee.core.rel.eq,(e,t)=>t[0](e)===t[1](e)),rn(Ee.core.rel.neq,(e,t)=>t[0](e)!==t[1](e)),rn(Ee.core.rel.lt,(e,t)=>t[0](e)<t[1](e)),rn(Ee.core.rel.lte,(e,t)=>t[0](e)<=t[1](e)),rn(Ee.core.rel.gr,(e,t)=>t[0](e)>t[1](e)),rn(Ee.core.rel.gre,(e,t)=>t[0](e)>=t[1](e)),rn(Ee.core.rel.inRange,(e,t)=>{let r=t[0](e);return r>=t[1](e)&&r<=t[2](e)}),rn(Ee.core.math.add,(e,t)=>{let r=0;if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r+=t[n](e);else for(let n of Object.keys(t))r+=t[n](e);return r}),rn(Ee.core.math.sub,(e,t)=>{let r=0;if(typeof t.length=="number"){if(t.length===1)return-t[0](e);r=t[0](e)||0;for(let n=1,o=t.length;n<o;n++)r-=t[n](e)}else{let n=Object.keys(t);if(n.length===1)return-t[n[0]](e);r=t[n[0]](e)||0;for(let o=1,i=n.length;o<i;o++)r-=t[n[o]](e)}return r}),rn(Ee.core.math.mult,(e,t)=>{let r=1;if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r*=t[n](e);else for(let n of Object.keys(t))r*=t[n](e);return r}),rn(Ee.core.math.div,(e,t)=>t[0](e)/t[1](e)),rn(Ee.core.math.pow,(e,t)=>Math.pow(t[0](e),t[1](e))),rn(Ee.core.math.mod,(e,t)=>t[0](e)%t[1](e)),rn(Ee.core.math.min,(e,t)=>{let r=Number.POSITIVE_INFINITY;if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r=Math.min(t[n](e),r);else for(let n of Object.keys(t))r=Math.min(t[n](e),r);return r}),rn(Ee.core.math.max,(e,t)=>{let r=Number.NEGATIVE_INFINITY;if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r=Math.max(t[n](e),r);else for(let n of Object.keys(t))r=Math.max(t[n](e),r);return r}),rn(Ee.core.math.cantorPairing,(e,t)=>Xa(t[0](e),t[1](e))),rn(Ee.core.math.sortedCantorPairing,(e,t)=>Wd(t[0](e),t[1](e))),rn(Ee.core.math.invertCantorPairing,(e,t)=>iT([0,0],t[0](e))),rn(Ee.core.math.floor,(e,t)=>Math.floor(t[0](e))),rn(Ee.core.math.ceil,(e,t)=>Math.ceil(t[0](e))),rn(Ee.core.math.roundInt,(e,t)=>Math.round(t[0](e))),rn(Ee.core.math.trunc,(e,t)=>Math.trunc(t[0](e))),rn(Ee.core.math.abs,(e,t)=>Math.abs(t[0](e))),rn(Ee.core.math.sign,(e,t)=>Math.sign(t[0](e))),rn(Ee.core.math.sqrt,(e,t)=>Math.sqrt(t[0](e))),rn(Ee.core.math.cbrt,(e,t)=>Math.cbrt(t[0](e))),rn(Ee.core.math.sin,(e,t)=>Math.sin(t[0](e))),rn(Ee.core.math.cos,(e,t)=>Math.cos(t[0](e))),rn(Ee.core.math.tan,(e,t)=>Math.tan(t[0](e))),rn(Ee.core.math.asin,(e,t)=>Math.asin(t[0](e))),rn(Ee.core.math.acos,(e,t)=>Math.acos(t[0](e))),rn(Ee.core.math.atan,(e,t)=>Math.atan(t[0](e))),rn(Ee.core.math.sinh,(e,t)=>Math.sinh(t[0](e))),rn(Ee.core.math.cosh,(e,t)=>Math.cosh(t[0](e))),rn(Ee.core.math.tanh,(e,t)=>Math.tanh(t[0](e))),rn(Ee.core.math.exp,(e,t)=>Math.exp(t[0](e))),rn(Ee.core.math.log,(e,t)=>Math.log(t[0](e))),rn(Ee.core.math.log10,(e,t)=>Math.log10(t[0](e))),rn(Ee.core.math.atan2,(e,t)=>Math.atan2(t[0](e),t[1](e))),rn(Ee.core.str.match,(e,t)=>t[0](e).test(t[1](e))),rn(Ee.core.str.concat,(e,t)=>{let r=[];if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r.push(t[n](e).toString());else for(let n of Object.keys(t))r.push(t[n](e).toString());return r.join("")}),rn(Ee.core.list.getAt,(e,t)=>t[0](e)[t[1](e)]),rn(Ee.core.list.equal,(e,t)=>s2(t[0](e),t[1](e))),rn(Ee.core.set.has,function(t,r){return r[0](t).has(r[1](t))}),rn(Ee.core.set.isSubset,function(t,r){return So.isSuperset(r[1](t),r[0](t))}),rn(Ee.core.flags.hasAny,(e,t)=>{let r=t[1](e),n=t[0](e);return r?(n&r)!==0:!!n}),rn(Ee.core.flags.hasAll,(e,t)=>{let r=t[1](e),n=t[0](e);return r?(n&r)===r:!n}),rn(Ee.structureQuery.type.elementSymbol,(e,t)=>ig(t[0](e))),rn(Ee.structureQuery.type.atomName,(e,t)=>ife(t[0](e))),rn(Ee.structureQuery.type.bondFlags,(e,t)=>{let r=Tt.Flag.None;if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r=Bbe(r,t[n](e));else for(let n of Object.keys(t))r=Bbe(r,t[n](e));return r}),rn(Ee.structureQuery.type.ringFingerprint,(e,t)=>qf.elementFingerprint(kpt(e,t))),rn(Ee.structureQuery.type.secondaryStructureFlags,(e,t)=>{let r=cr.Flag.None;if(typeof t.length=="number")for(let n=0,o=t.length;n<o;n++)r=Rbe(r,t[n](e));else for(let n of Object.keys(t))r=Rbe(r,t[n](e));return r}),wr(Ee.structureQuery.filter.pick,(e,t)=>ho.filters.pick(t[0],t.test)(e)),wr(Ee.structureQuery.filter.first,(e,t)=>ho.filters.first(t[0])(e)),wr(Ee.structureQuery.filter.withSameAtomProperties,(e,t)=>ho.filters.withSameAtomProperties(t[0],t.source,t.property)(e)),wr(Ee.structureQuery.filter.intersectedBy,(e,t)=>ho.filters.areIntersectedBy(t[0],t.by)(e)),wr(Ee.structureQuery.filter.within,(e,t)=>{var r,n,o;return ho.filters.within({query:t[0],target:t.target,minRadius:(r=t["min-radius"])===null||r===void 0?void 0:r.call(t,e),maxRadius:(n=t["max-radius"])===null||n===void 0?void 0:n.call(t,e),elementRadius:t["atom-radius"],invert:(o=t.invert)===null||o===void 0?void 0:o.call(t,e)})(e)}),wr(Ee.structureQuery.filter.isConnectedTo,(e,t)=>{var r,n;return ho.filters.isConnectedTo({query:t[0],target:t.target,disjunct:(r=t.disjunct)===null||r===void 0?void 0:r.call(t,e),invert:(n=t.invert)===null||n===void 0?void 0:n.call(t,e),bondTest:t["bond-test"]})(e)}),wr(Ee.structureQuery.generator.atomGroups,function(t,r){return ho.generators.atoms({entityTest:r["entity-test"],chainTest:r["chain-test"],residueTest:r["residue-test"],atomTest:r["atom-test"],groupBy:r["group-by"]})(t)}),wr(Ee.structureQuery.generator.all,function(t){return ho.generators.all(t)}),wr(Ee.structureQuery.generator.empty,function(t){return ho.generators.none(t)}),wr(Ee.structureQuery.generator.bondedAtomicPairs,function(t,r){return ho.generators.bondedAtomicPairs(r&&r[0])(t)}),wr(Ee.structureQuery.generator.rings,function(t,r){var n,o;return ho.generators.rings((n=r?.fingerprint)===null||n===void 0?void 0:n.call(r,t),(o=r?.["only-aromatic"])===null||o===void 0?void 0:o.call(r,t))(t)}),wr(Ee.structureQuery.generator.queryInSelection,function(t,r){var n;return ho.generators.querySelection(r[0],r.query,(n=r["in-complement"])===null||n===void 0?void 0:n.call(r,t))(t)}),wr(Ee.structureQuery.modifier.includeSurroundings,function(t,r){return ho.modifiers.includeSurroundings(r[0],{radius:r.radius(t),wholeResidues:!!(r["as-whole-residues"]&&r["as-whole-residues"](t)),elementRadius:r["atom-radius"]})(t)}),wr(Ee.structureQuery.modifier.surroundingLigands,function(t,r){return ho.modifiers.surroundingLigands({query:r[0],radius:r.radius(t),includeWater:!!(r["include-water"]&&r["include-water"](t))})(t)}),wr(Ee.structureQuery.modifier.wholeResidues,function(t,r){return ho.modifiers.wholeResidues(r[0])(t)}),wr(Ee.structureQuery.modifier.union,function(t,r){return ho.modifiers.union(r[0])(t)}),wr(Ee.structureQuery.modifier.expandProperty,function(t,r){return ho.modifiers.expandProperty(r[0],r.property)(t)}),wr(Ee.structureQuery.modifier.exceptBy,function(t,r){return ho.modifiers.exceptBy(r[0],r.by)(t)}),wr(Ee.structureQuery.modifier.includeConnected,function(t,r){var n,o;return ho.modifiers.includeConnected({query:r[0],bondTest:r["bond-test"],wholeResidues:!!(r["as-whole-residues"]&&r["as-whole-residues"](t)),layerCount:r["layer-count"]&&r["layer-count"](t)||1,fixedPoint:(o=(n=r["fixed-point"])===null||n===void 0?void 0:n.call(r,t))!==null&&o!==void 0?o:!1})(t)}),wr(Ee.structureQuery.modifier.intersectBy,function(t,r){return ho.modifiers.intersectBy(r[0],r.by)(t)}),wr(Ee.structureQuery.combinator.merge,(e,t)=>ho.combinators.merge(t)(e)),wr(Ee.structureQuery.atomProperty.core.elementSymbol,fi(nt.atom.type_symbol)),wr(Ee.structureQuery.atomProperty.core.vdw,(e,t)=>R0(nt.atom.type_symbol(t&&t[0]&&t[0](e)||e.element))),wr(Ee.structureQuery.atomProperty.core.mass,(e,t)=>jge(nt.atom.type_symbol(t&&t[0]&&t[0](e)||e.element))),wr(Ee.structureQuery.atomProperty.core.atomicNumber,(e,t)=>ix(nt.atom.type_symbol(t&&t[0]&&t[0](e)||e.element))),wr(Ee.structureQuery.atomProperty.core.x,fi(nt.atom.x)),wr(Ee.structureQuery.atomProperty.core.y,fi(nt.atom.y)),wr(Ee.structureQuery.atomProperty.core.z,fi(nt.atom.z)),wr(Ee.structureQuery.atomProperty.core.sourceIndex,fi(nt.atom.sourceIndex)),wr(Ee.structureQuery.atomProperty.core.operatorName,fi(nt.unit.operator_name)),wr(Ee.structureQuery.atomProperty.core.instanceId,fi(nt.unit.instance_id)),wr(Ee.structureQuery.atomProperty.core.operatorKey,fi(nt.unit.operator_key)),wr(Ee.structureQuery.atomProperty.core.modelIndex,fi(nt.unit.model_index)),wr(Ee.structureQuery.atomProperty.core.modelLabel,fi(nt.unit.model_label)),wr(Ee.structureQuery.atomProperty.core.modelEntryId,fi(nt.unit.model_entry_id)),wr(Ee.structureQuery.atomProperty.core.atomKey,(e,t)=>{let r=t&&t[0]&&t[0](e)||e.element;return Xa(r.unit.id,r.element)}),wr(Ee.structureQuery.atomProperty.macromolecular.residueKey,(e,t)=>te.residueIndex(t&&t[0]&&t[0](e)||e.element)),wr(Ee.structureQuery.atomProperty.macromolecular.chainKey,(e,t)=>te.chainIndex(t&&t[0]&&t[0](e)||e.element)),wr(Ee.structureQuery.atomProperty.macromolecular.entityKey,(e,t)=>te.entityIndex(t&&t[0]&&t[0](e)||e.element)),wr(Ee.structureQuery.atomProperty.macromolecular.id,fi(nt.atom.id)),wr(Ee.structureQuery.atomProperty.macromolecular.isHet,(e,t)=>nt.residue.group_PDB(t&&t[0]&&t[0](e)||e.element)!=="ATOM"),wr(Ee.structureQuery.atomProperty.macromolecular.label_atom_id,fi(nt.atom.label_atom_id)),wr(Ee.structureQuery.atomProperty.macromolecular.label_alt_id,fi(nt.atom.label_alt_id)),wr(Ee.structureQuery.atomProperty.macromolecular.label_comp_id,fi(nt.atom.label_comp_id)),wr(Ee.structureQuery.atomProperty.macromolecular.label_seq_id,fi(nt.residue.label_seq_id)),wr(Ee.structureQuery.atomProperty.macromolecular.label_asym_id,fi(nt.chain.label_asym_id)),wr(Ee.structureQuery.atomProperty.macromolecular.label_entity_id,fi(nt.entity.id)),wr(Ee.structureQuery.atomProperty.macromolecular.auth_atom_id,fi(nt.atom.auth_atom_id)),wr(Ee.structureQuery.atomProperty.macromolecular.auth_comp_id,fi(nt.atom.auth_comp_id)),wr(Ee.structureQuery.atomProperty.macromolecular.auth_seq_id,fi(nt.residue.auth_seq_id)),wr(Ee.structureQuery.atomProperty.macromolecular.auth_asym_id,fi(nt.chain.auth_asym_id)),wr(Ee.structureQuery.atomProperty.macromolecular.pdbx_PDB_ins_code,fi(nt.residue.pdbx_PDB_ins_code)),wr(Ee.structureQuery.atomProperty.macromolecular.pdbx_formal_charge,fi(nt.atom.pdbx_formal_charge)),wr(Ee.structureQuery.atomProperty.macromolecular.occupancy,fi(nt.atom.occupancy)),wr(Ee.structureQuery.atomProperty.macromolecular.B_iso_or_equiv,fi(nt.atom.B_iso_or_equiv)),wr(Ee.structureQuery.atomProperty.macromolecular.entityType,fi(nt.entity.type)),wr(Ee.structureQuery.atomProperty.macromolecular.entitySubtype,fi(nt.entity.subtype)),wr(Ee.structureQuery.atomProperty.macromolecular.entityPrdId,fi(nt.entity.prd_id)),wr(Ee.structureQuery.atomProperty.macromolecular.entityDescription,fi(nt.entity.pdbx_description)),wr(Ee.structureQuery.atomProperty.macromolecular.objectPrimitive,fi(nt.unit.object_primitive)),wr(Ee.structureQuery.atomProperty.macromolecular.isNonStandard,fi(nt.residue.isNonStandard)),wr(Ee.structureQuery.atomProperty.macromolecular.secondaryStructureKey,fi(nt.residue.secondary_structure_key)),wr(Ee.structureQuery.atomProperty.macromolecular.secondaryStructureFlags,fi(nt.residue.secondary_structure_type)),wr(Ee.structureQuery.atomProperty.macromolecular.chemCompType,fi(nt.residue.chem_comp_type)),wr(Ee.structureQuery.atomProperty.ihm.hasSeqId,function(t,r){let n=t.element,o=r&&r[0]&&r[0](t);return n.unit.kind===fe.Kind.Atomic?o===nt.residue.label_seq_id(n):o>=nt.coarse.seq_id_begin(n)&&o<=nt.coarse.seq_id_end(n)}),wr(Ee.structureQuery.atomProperty.ihm.overlapsSeqIdRange,function(t,r){var n,o;let i=t.element,a=(n=r&&r.beg&&r.beg(t))!==null&&n!==void 0?n:-Number.MAX_VALUE,s=(o=r&&r.end&&r.end(t))!==null&&o!==void 0?o:Number.MAX_VALUE;if(i.unit.kind===fe.Kind.Atomic){let u=nt.residue.label_seq_id(i);return u>=a&&u<=s}let l=nt.coarse.seq_id_begin(i),c=nt.coarse.seq_id_end(i);return l>=a&&l<=s||c>=a&&c<=s||l<=a&&c>=s}),wr(Ee.structureQuery.atomSet.atomCount,function(t,r){return ho.atomset.atomCount(t)}),wr(Ee.structureQuery.atomSet.countQuery,function(t,r){return ho.atomset.countQuery(r[0])(t)}),wr(Ee.structureQuery.atomSet.propertySet,function(t,r){return ho.atomset.propertySet(r[0])(t)}),wr(Ee.structureQuery.bondProperty.order,(e,t)=>e.atomicBond.order),wr(Ee.structureQuery.bondProperty.flags,(e,t)=>e.atomicBond.type),wr(Ee.structureQuery.bondProperty.key,(e,t)=>e.atomicBond.key),wr(Ee.structureQuery.bondProperty.atomA,(e,t)=>e.atomicBond.a),wr(Ee.structureQuery.bondProperty.atomB,(e,t)=>e.atomicBond.b),wr(Ee.structureQuery.bondProperty.length,(e,t)=>e.atomicBond.length),wr(Ee.internal.generator.bundleElement,function(t,r){return JW(r.groupedUnits(t),r.ranges(t),r.set(t))}),wr(Ee.internal.generator.bundle,function(t,r){return eK(r.elements(t))(t)}),wr(Ee.internal.generator.current,function(t,r){return t.tryGetCurrentSelection()})];(function(){for(let e of Dpt)LT.addSymbol(e)})()});var qT=M(()=>{VD();Obe()});function Vo(e,t){return{expression:e,language:t}}var Vm=M(()=>{efe();nfe();Nfe();gt();qT();wa();Oo();(function(e){e.Info={"mol-script":"Mol-Script",pymol:"PyMOL",vmd:"VMD",jmol:"Jmol"};function t(s){return!!s&&typeof s.expression=="string"&&!!s.language}e.is=t;function r(s,l){return s.language===l.language&&s.expression===l.expression}e.areEqual=r;function n(s){switch(s.language){case"mol-script":let l=rfe(s.expression);if(l.length===0)throw new Error("No query");return Jde(l[0]);case"pymol":case"jmol":case"vmd":return Ffe(s.language,s.expression);default:Er(s.language)}}e.toExpression=n;function o(s){let l=n(s);return Zd(l)}e.toQuery=o;function i(s,l){let u=o(s)(new Si(l));return ht.toLociWithSourceUnits(u)}e.toLoci=i;function a(s,l,c){let u=typeof s=="function"?s(se):s;return Zd(u)(new Si(l,c))}e.getStructureSelection=a})(Vo||(Vo={}))});var QL=ve(($Er,Zbe)=>{Zbe.exports=JBrowseExports["@jbrowse/core/pluggableElementTypes/AdapterType"]});var ZD=ve((QEr,$be)=>{$be.exports=JBrowseExports["@jbrowse/core/configuration"]});var JL=ve((eDr,e1e)=>{e1e.exports=JBrowseExports["@jbrowse/core/data_adapters/BaseAdapter"]});var eF=ve((tDr,t1e)=>{t1e.exports=JBrowseExports["@jbrowse/core/util/io"]});var tF=ve((rDr,r1e)=>{r1e.exports=JBrowseExports["@jbrowse/core/util/rxjs"]});var a1e={};ci(a1e,{default:()=>rF});var n1e,nF,o1e,i1e,rF,s1e=M(()=>{"use strict";n1e=et(JL()),nF=et(Du()),o1e=et(eF()),i1e=et(tF()),rF=class extends n1e.BaseFeatureDataAdapter{static capabilities=["getFeatures","getRefNames"];feats;async loadDataP(){let t=JSON.parse(await(0,o1e.openLocation)(this.getConf("location")).readFile("utf8"));return t.residueNumber.map((r,n)=>({uniqueId:`feat-${n}`,start:r,end:r+1,score:t.confidenceScore[n]}))}async loadData(t={}){return this.feats??=this.loadDataP().catch(r=>{throw this.feats=void 0,r}),this.feats}async getRefNames(t={}){return[]}getFeatures(t,r={}){return(0,i1e.ObservableCreate)(async n=>{let{start:o,end:i,refName:a}=t,s=await this.loadData();for(let l of s)(0,nF.doesIntersect2)(l.start,l.end,o,i)&&n.next(new nF.SimpleFeature({...l,refName:a}));n.complete()})}freeResources(){}}});var p1e={};ci(p1e,{default:()=>oF});var d1e,bx,f1e,m1e,oF,h1e=M(()=>{"use strict";d1e=et(JL()),bx=et(Du()),f1e=et(eF()),m1e=et(tF()),oF=class extends d1e.BaseFeatureDataAdapter{static capabilities=["getFeatures","getRefNames"];feats;async loadDataP(){return(await(0,f1e.openLocation)(this.getConf("location")).readFile("utf8")).split(`
|
|
19
19
|
`).slice(1).map(r=>r.trim()).filter(r=>!!r).map((r,n)=>{let[o,i,a]=r.split(","),s=o[0],l=o.at(-1),c=o.slice(1,-1);return{uniqueId:`feat-${n}`,ref:s,variant:l,start:+c,end:+c+1,score:+i,am_class:a}})}async loadData(t={}){return this.feats??=this.loadDataP().catch(r=>{throw this.feats=void 0,r}),this.feats}async getGlobalStats(t){let r=await this.loadData(),n=(0,bx.min)(r.map(i=>i.score)),o=(0,bx.max)(r.map(i=>i.score));return{scoreMin:n,scoreMax:o}}async getMultiRegionFeatureDensityStats(t){return{featureDensity:0}}async getRefNames(t={}){return[]}getFeatures(t,r={}){return(0,m1e.ObservableCreate)(async n=>{let{start:o,end:i,refName:a}=t,s=await this.loadData();for(let l of s)(0,bx.doesIntersect2)(l.start,l.end,o,i)&&n.next(new bx.SimpleFeature({...l,refName:a,source:l.variant}));n.complete()})}async getSources(){let t=new Set,r=await this.loadData();for(let n of r)t.add(n.variant);return[...t].map(n=>({name:n,__name:n}))}freeResources(){}}});var IY=ve((pDr,y1e)=>{y1e.exports=JBrowseExports["@mui/material/utils"]});var yg,GT=M(()=>{"use client";yg=et(IY(),1)});var gn=ve((gDr,v1e)=>{v1e.exports=JBrowseExports["react/jsx-runtime"]});var xx=ve((bDr,S1e)=>{S1e.exports=JBrowseExports["@jbrowse/core/ui"]});var Jl=ve((xDr,_1e)=>{_1e.exports=JBrowseExports["@mui/material"]});var O1e=ve(R1e=>{"use strict";var XT=Wr();function Xpt(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zpt=typeof Object.is=="function"?Object.is:Xpt,$pt=XT.useState,Qpt=XT.useEffect,Jpt=XT.useLayoutEffect,eht=XT.useDebugValue;function tht(e,t){var r=t(),n=$pt({inst:{value:r,getSnapshot:t}}),o=n[0].inst,i=n[1];return Jpt(function(){o.value=r,o.getSnapshot=t,RY(o)&&i({inst:o})},[e,r,t]),Qpt(function(){return RY(o)&&i({inst:o}),e(function(){RY(o)&&i({inst:o})})},[e]),eht(r),r}function RY(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Zpt(e,r)}catch{return!0}}function rht(e,t){return t()}var nht=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?rht:tht;R1e.useSyncExternalStore=XT.useSyncExternalStore!==void 0?XT.useSyncExternalStore:nht});var F1e=ve((YDr,L1e)=>{"use strict";L1e.exports=O1e()});var cxe,TF,JY=M(()=>{"use client";GT();cxe=et(gn(),1),TF=(0,yg.createSvgIcon)((0,cxe.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help")});var mxe={};ci(mxe,{default:()=>fxe});function uxe({children:e}){return tf.default.createElement(Y0.Typography,{style:{margin:4}},e)}function fxe({handleClose:e}){return tf.default.createElement(dxe.Dialog,{open:!0,maxWidth:"lg",onClose:e,title:"Help"},tf.default.createElement(Y0.DialogContent,null,tf.default.createElement(uxe,null,"The procedure for the protein lookup is as follows:",tf.default.createElement("ul",null,tf.default.createElement("li",null,"(Automatic lookup) Searches mygene.info for the transcript ID, in order to retrieve the UniProt ID associated with a given transcript ID and then, the UniProt ID is used to lookup the structure in AlphaFoldDB"),tf.default.createElement("li",null,"(Manual) Allows you to choose your own structure file from your local machine (e.g. a PDB file predicted by e.g. ColabFold) or supply a specific URL"),tf.default.createElement("li",null,"The residues from the structure are downloaded, and then you can choose the transcript isoform from the selected gene that best represents the structure. Asterisks are displayed if there is an exact sequence match"),tf.default.createElement("li",null,"The residues from the structure are finally aligned to the to the selected transcript's protein sequence representation, and this creates a mapping from the reference genome coordinates to positions in the 3-D structure"),tf.default.createElement("li",null,"Finally the molstar panel is opened, and this contains many specialized features features, plus additional mouseover and selection features supplied by the plugin to connect mouse click actions and mouse hover with coordinates on the linear genome view"))),tf.default.createElement(uxe,null,"If you run into challenges with this workflow e.g. your transcripts are not being found in mygene.info then you can use the Manual import form, or contact colin.diesh@gmail.com for troubleshooting")),tf.default.createElement(Y0.Divider,null),tf.default.createElement(Y0.DialogActions,null,tf.default.createElement(Y0.Button,{onClick:()=>{e()},color:"primary"},"Close")))}var tf,dxe,Y0,pxe=M(()=>{"use strict";tf=et(Wr()),dxe=et(xx()),Y0=et(Jl())});function Yn(e){return e.svg?(0,rt.jsx)("span",{className:`msp-icon msp-material-icon${e.inline?" msp-icon-inline":""}`,title:e.title,style:e.style,children:(0,rt.jsx)(e.svg,{})}):null}function ok(){return Eht}function ik(){return Dht}function ak(){return kht}function V2(){return Mht}function gxe(){return Bht}function sk(){return Rht}function yxe(){return Oht}function vxe(){return Lht}function Nht(){return Fht}function bxe(){return Uht}function xxe(){return Vht}function tX(){return zht}function xg(){return qht}function Sxe(){return Ght}function wx(){return jht}function fd(){return Hht}function md(){return Wht}function Tx(){return Kht}function _xe(){return Yht}function rX(){return Xht}function fb(){return Zht}function DF(){return $ht}function Cxe(){return Qht}function wxe(){return Jht}function Txe(){return egt}function Axe(){return tgt}function lk(){return rgt}function kF(){return ngt}function Pxe(){return ogt}function jm(){return igt}function nX(){return agt}function rf(){return sgt}function Ixe(){return lgt}function Exe(){return cgt}function Dxe(){return ugt}function kxe(){return dgt}function Mxe(){return fgt}function Bxe(){return mgt}function ec(){return pgt}function oX(){return hgt}function ygt(){return ggt}function Rxe(){return vgt}function z2(){return bgt}function pd(){return xgt}function ck(){return Sgt}function Cgt(){return _gt}function Up(){return wgt}function iX(){return Tgt}function aX(){return Agt}function Oxe(){return Pgt}function MF(){return Igt}function q2(){return Egt}function uk(){return Dgt}function dk(){return kgt}function BF(){return Mgt}function Rgt(){return Bgt}function Lxe(){return Ogt}function RF(){return Lgt}function Fxe(){return Fgt}function Nxe(){return Ngt}function nf(){return Ugt}function Gm(){return Vgt}function Wf(){return zgt}function OF(){return qgt}function Uxe(){return jgt}var rt,IF,EF,Eht,Dht,kht,Mht,Bht,Rht,Oht,Lht,Fht,jkr,Gkr,Uht,Vht,zht,qht,jht,Ght,Hht,Wht,Kht,Yht,Xht,Zht,$ht,Qht,Jht,egt,tgt,rgt,ngt,ogt,igt,agt,sgt,lgt,cgt,ugt,dgt,fgt,mgt,pgt,Hkr,hgt,Wkr,ggt,vgt,bgt,xgt,Sgt,Kkr,_gt,wgt,Tgt,Agt,Pgt,Igt,Egt,Dgt,kgt,Mgt,Bgt,Ykr,Ogt,Lgt,Fgt,Ngt,Xkr,Ugt,Vgt,Zkr,$kr,Qkr,Jkr,zgt,qgt,eMr,jgt,Vxe,zxe,sX,qxe,ha=M(()=>{rt=et(gn());IF=(0,rt.jsx)("circle",{r:"6px",id:"circle-left",cy:"12px",cx:"8px",strokeWidth:"1px"}),EF=(0,rt.jsx)("circle",{r:"6px",id:"circle-right",cy:"12px",cx:"16px",strokeWidth:"1px"}),Eht=(0,rt.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,rt.jsxs)("defs",{children:[IF,EF]}),(0,rt.jsxs)("g",{children:[(0,rt.jsx)("use",{href:"#circle-left",className:"msp-shape-filled"}),(0,rt.jsx)("use",{href:"#circle-right",className:"msp-shape-filled"}),(0,rt.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"})]})]});Dht=(0,rt.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,rt.jsxs)("defs",{children:[IF,EF,(0,rt.jsxs)("mask",{id:"mask-left",children:[(0,rt.jsx)("use",{href:"#circle-left",fill:"white",stroke:"white"}),(0,rt.jsx)("use",{href:"#circle-right",fill:"black",strokeWidth:"0px",stroke:"white"})]})]}),(0,rt.jsxs)("g",{children:[(0,rt.jsx)("use",{href:"#circle-left",className:"msp-shape-filled",mask:"url(#mask-left)"}),(0,rt.jsx)("use",{href:"#circle-right",className:"msp-shape-empty"})]})]});kht=(0,rt.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,rt.jsxs)("defs",{children:[IF,EF,(0,rt.jsx)("clipPath",{id:"clip-left",children:(0,rt.jsx)("use",{href:"#circle-right"})})]}),(0,rt.jsxs)("g",{children:[(0,rt.jsx)("use",{href:"#circle-left",className:"msp-shape-filled",clipPath:"url(#clip-left)"}),(0,rt.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"}),(0,rt.jsx)("use",{href:"#circle-right",className:"msp-shape-empty"})]})]});Mht=(0,rt.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,rt.jsxs)("defs",{children:[IF,EF]}),(0,rt.jsxs)("g",{children:[(0,rt.jsx)("use",{href:"#circle-left",className:"msp-shape-empty"}),(0,rt.jsx)("use",{href:"#circle-right",className:"msp-shape-filled"})]})]});Bht=(0,rt.jsx)("svg",{width:"17px",height:"17px",viewBox:"0 0 299.463 299.463",strokeWidth:"6px",children:(0,rt.jsx)("g",{children:(0,rt.jsx)("path",{d:"M256.851,173.832v-48.201c22.916-4.918,34.151-30.668,22.556-50.771c-11.547-20.004-39.486-23.251-55.242-5.844 l-41.746-24.106C189.618,22.603,172.861,0,149.734,0c-23.132,0-39.881,22.609-32.685,44.911L75.305,69.016 C59.522,51.586,31.597,54.88,20.061,74.863c-11.63,20.163-0.298,45.862,22.557,50.769v48.2 c-22.821,4.898-34.195,30.591-22.556,50.771c11.529,19.972,39.454,23.285,55.242,5.845l41.746,24.106 c-7.199,22.308,9.559,44.911,32.685,44.911c23.132,0,39.88-22.609,32.685-44.911l41.745-24.106 c15.817,17.469,43.73,14.099,55.242-5.844c0,0,0-0.001,0.001-0.002c4.587-7.953,5.805-17.213,3.431-26.076 C279.392,185.657,269.129,176.461,256.851,173.832z M249.62,72.088c20.568,0,27.428,27.191,10.008,37.239 c-0.003,0.002-0.006,0.003-0.009,0.005c-10.04,5.81-22.85,1.762-27.877-8.475C225.206,87.548,234.938,72.088,249.62,72.088z M149.734,14.4c11.005,0,19.958,8.954,19.958,19.959c0,11.127-9.077,19.958-19.958,19.958c-10.95,0-19.958-8.9-19.958-19.958 C129.776,23.354,138.729,14.4,149.734,14.4z M39.84,109.328c-17.451-10.067-10.534-37.24,10.01-37.24 c15.311,0,24.922,16.653,17.251,29.942C61.681,111.397,49.517,114.925,39.84,109.328z M59.802,224.702 c-9.535,5.503-21.768,2.229-27.268-7.298c-7.639-13.242,1.887-29.945,17.236-29.945c0.013,0,0.027,0,0.04,0 C70.07,187.48,77.49,214.469,59.802,224.702z M149.734,285.062c-11.005,0-19.958-8.954-19.958-19.958 c0-11.127,9.077-19.958,19.958-19.958c10.954,0,19.958,8.903,19.958,19.958C169.693,276.109,160.74,285.062,149.734,285.062z M216.953,217.982l-41.727,24.095c-13.778-15.22-37.459-14.94-50.983,0l-41.728-24.096c6.196-19.289-5.541-39.835-25.498-44.149 V125.63c19.752-4.268,31.762-24.65,25.498-44.149l41.727-24.095c13.629,15.055,37.32,15.093,50.983,0l41.728,24.096 c-6.196,19.29,5.534,39.835,25.498,44.149v48.202C222.61,178.123,210.721,198.581,216.953,217.982z M266.935,217.404 c-5.501,9.528-17.732,12.802-27.261,7.302c-17.682-10.23-10.301-37.247,10.032-37.247 C264.984,187.459,274.602,204.112,266.935,217.404z"})})});Rht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{d:"M21,16.5C21,16.88 20.79,17.21 20.47,17.38L12.57,21.82C12.41,21.94 12.21,22 12,22C11.79,22 11.59,21.94 11.43,21.82L3.53,17.38C3.21,17.21 3,16.88 3,16.5V7.5C3,7.12 3.21,6.79 3.53,6.62L11.43,2.18C11.59,2.06 11.79,2 12,2C12.21,2 12.41,2.06 12.57,2.18L20.47,6.62C20.79,6.79 21,7.12 21,7.5V16.5M12,4.15L6.04,7.5L12,10.85L17.96,7.5L12,4.15M5,15.91L11,19.29V12.58L5,9.21V15.91M19,15.91V9.21L13,12.58V19.29L19,15.91Z"})});Oht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{d:"M17,22V20H20V17H22V20.5C22,20.89 21.84,21.24 21.54,21.54C21.24,21.84 20.89,22 20.5,22H17M7,22H3.5C3.11,22 2.76,21.84 2.46,21.54C2.16,21.24 2,20.89 2,20.5V17H4V20H7V22M17,2H20.5C20.89,2 21.24,2.16 21.54,2.46C21.84,2.76 22,3.11 22,3.5V7H20V4H17V2M7,2V4H4V7H2V3.5C2,3.11 2.16,2.76 2.46,2.46C2.76,2.16 3.11,2 3.5,2H7M13,17.25L17,14.95V10.36L13,12.66V17.25M12,10.92L16,8.63L12,6.28L8,8.63L12,10.92M7,14.95L11,17.25V12.66L7,10.36V14.95M18.23,7.59C18.73,7.91 19,8.34 19,8.91V15.23C19,15.8 18.73,16.23 18.23,16.55L12.75,19.73C12.25,20.05 11.75,20.05 11.25,19.73L5.77,16.55C5.27,16.23 5,15.8 5,15.23V8.91C5,8.34 5.27,7.91 5.77,7.59L11.25,4.41C11.5,4.28 11.75,4.22 12,4.22C12.25,4.22 12.5,4.28 12.75,4.41L18.23,7.59Z"})});Lht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{d:"M16,4L9,8.04V15.96L16,20L23,15.96V8.04M16,6.31L19.8,8.5L16,10.69L12.21,8.5M0,7V9H7V7M11,10.11L15,12.42V17.11L11,14.81M21,10.11V14.81L17,17.11V12.42M2,11V13H7V11M4,15V17H7V15"})});Fht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M10.07,14.27C10.57,14.03 11.16,14.25 11.4,14.75L13.7,19.74L15.5,18.89L13.19,13.91C12.95,13.41 13.17,12.81 13.67,12.58L13.95,12.5L16.25,12.05L8,5.12V15.9L9.82,14.43L10.07,14.27M13.64,21.97C13.14,22.21 12.54,22 12.31,21.5L10.13,16.76L7.62,18.78C7.45,18.92 7.24,19 7,19A1,1 0 0,1 6,18V3A1,1 0 0,1 7,2C7.24,2 7.47,2.09 7.64,2.23L7.65,2.22L19.14,11.86C19.57,12.22 19.62,12.85 19.27,13.27C19.12,13.45 18.91,13.57 18.7,13.61L15.54,14.23L17.74,18.96C18,19.46 17.76,20.05 17.26,20.28L13.64,21.97Z"})});jkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{fill:"currentColor",d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z"})}),Gkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{fill:"currentColor",d:"M20,11H23V13H20V11M1,11H4V13H1V11M13,1V4H11V1H13M4.92,3.5L7.05,5.64L5.63,7.05L3.5,4.93L4.92,3.5M16.95,5.63L19.07,3.5L20.5,4.93L18.37,7.05L16.95,5.63M12,6A6,6 0 0,1 18,12C18,14.22 16.79,16.16 15,17.2V19A1,1 0 0,1 14,20H10A1,1 0 0,1 9,19V17.2C7.21,16.16 6,14.22 6,12A6,6 0 0,1 12,6M14,21V22A1,1 0 0,1 13,23H11A1,1 0 0,1 10,22V21H14M11,18H13V15.87C14.73,15.43 16,13.86 16,12A4,4 0 0,0 12,8A4,4 0 0,0 8,12C8,13.86 9.27,15.43 11,15.87V18Z"})}),Uht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{fill:"currentColor",d:"M7.5,5.6L5,7L6.4,4.5L5,2L7.5,3.4L10,2L8.6,4.5L10,7L7.5,5.6M19.5,15.4L22,14L20.6,16.5L22,19L19.5,17.6L17,19L18.4,16.5L17,14L19.5,15.4M22,2L20.6,4.5L22,7L19.5,5.6L17,7L18.4,4.5L17,2L19.5,3.4L22,2M13.34,12.78L15.78,10.34L13.66,8.22L11.22,10.66L13.34,12.78M14.37,7.29L16.71,9.63C17.1,10 17.1,10.65 16.71,11.04L5.04,22.71C4.65,23.1 4,23.1 3.63,22.71L1.29,20.37C0.9,20 0.9,19.35 1.29,18.96L12.96,7.29C13.35,6.9 14,6.9 14.37,7.29Z"})});Vht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{d:"M3 17.25V21H6.75L17.81 9.93L14.06 6.18L3 17.25M22.61 18.36L18.36 22.61L13.16 17.41L14.93 15.64L15.93 16.64L18.4 14.16L19.82 15.58L18.36 17L19.42 18L20.84 16.6L22.61 18.36M6.61 10.83L1.39 5.64L5.64 1.39L7.4 3.16L4.93 5.64L6 6.7L8.46 4.22L9.88 5.64L8.46 7.05L9.46 8.05L6.61 10.83M20.71 7C21.1 6.61 21.1 6 20.71 5.59L18.37 3.29C18 2.9 17.35 2.9 16.96 3.29L15.12 5.12L18.87 8.87L20.71 7Z"})});zht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M22 11V3h-7v3H9V3H2v8h7V8h2v10h4v3h7v-8h-7v3h-2V8h2v3h7zM7 9H4V5h3v4zm10 6h3v4h-3v-4zm0-10h3v4h-3V5z"})});qht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})});jht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})});Ght=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M15 2c-2.71 0-5.05 1.54-6.22 3.78-1.28.67-2.34 1.72-3 3C3.54 9.95 2 12.29 2 15c0 3.87 3.13 7 7 7 2.71 0 5.05-1.54 6.22-3.78 1.28-.67 2.34-1.72 3-3C20.46 14.05 22 11.71 22 9c0-3.87-3.13-7-7-7M9 20c-2.76 0-5-2.24-5-5 0-1.12.37-2.16 1-3 0 3.87 3.13 7 7 7-.84.63-1.88 1-3 1m3-3c-2.76 0-5-2.24-5-5 0-1.12.37-2.16 1-3 0 3.86 3.13 6.99 7 7-.84.63-1.88 1-3 1m4.7-3.3c-.53.19-1.1.3-1.7.3-2.76 0-5-2.24-5-5 0-.6.11-1.17.3-1.7.53-.19 1.1-.3 1.7-.3 2.76 0 5 2.24 5 5 0 .6-.11 1.17-.3 1.7M19 12c0-3.86-3.13-6.99-7-7 .84-.63 1.87-1 3-1 2.76 0 5 2.24 5 5 0 1.12-.37 2.16-1 3"})});Hht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M7 10l5 5 5-5z"})});Wht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M10 17l5-5-5-5v10z"})});Kht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})});Yht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 6v3l4-4-4-4v3c-4.42 0-8 3.58-8 8 0 1.57.46 3.03 1.24 4.26L6.7 14.8c-.45-.83-.7-1.79-.7-2.8 0-3.31 2.69-6 6-6zm6.76 1.74L17.3 9.2c.44.84.7 1.79.7 2.8 0 3.31-2.69 6-6 6v-3l-4 4 4 4v-3c4.42 0 8-3.58 8-8 0-1.57-.46-3.03-1.24-4.26z"})});Xht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M6 13c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-3 .5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM6 5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm15 5.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zM14 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0-3.5c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zm-11 10c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm7 7c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm0-17c.28 0 .5-.22.5-.5s-.22-.5-.5-.5-.5.22-.5.5.22.5.5.5zM10 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm0 5.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm8 .5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-8c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0-4c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm3 8.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zM14 17c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm0 3.5c-.28 0-.5.22-.5.5s.22.5.5.5.5-.22.5-.5-.22-.5-.5-.5zm-4-12c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0 8.5c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm4-4.5c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5zm0-4c-.83 0-1.5.67-1.5 1.5s.67 1.5 1.5 1.5 1.5-.67 1.5-1.5-.67-1.5-1.5-1.5z"})});Zht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M15 7v12.97l-4.21-1.81-.79-.34-.79.34L5 19.97V7h10m4-6H8.99C7.89 1 7 1.9 7 3h10c1.1 0 2 .9 2 2v13l2 1V3c0-1.1-.9-2-2-2zm-4 4H5c-1.1 0-2 .9-2 2v16l7-3 7 3V7c0-1.1-.9-2-2-2z"})});$ht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M7 14c-1.66 0-3 1.34-3 3 0 1.31-1.16 2-2 2 .92 1.22 2.49 2 4 2 2.21 0 4-1.79 4-4 0-1.66-1.34-3-3-3zm13.71-9.37l-1.34-1.34a.9959.9959 0 00-1.41 0L9 12.25 11.75 15l8.96-8.96c.39-.39.39-1.02 0-1.41z"})});Qht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M22.61 18.99l-9.08-9.08c.93-2.34.45-5.1-1.44-7C9.79.61 6.21.4 3.66 2.26L7.5 6.11 6.08 7.52 2.25 3.69C.39 6.23.6 9.82 2.9 12.11c1.86 1.86 4.57 2.35 6.89 1.48l9.11 9.11c.39.39 1.02.39 1.41 0l2.3-2.3c.4-.38.4-1.01 0-1.41zm-3 1.6l-9.46-9.46c-.61.45-1.29.72-2 .82-1.36.2-2.79-.21-3.83-1.25C3.37 9.76 2.93 8.5 3 7.26l3.09 3.09 4.24-4.24-3.09-3.09c1.24-.07 2.49.37 3.44 1.31 1.08 1.08 1.49 2.57 1.24 3.96-.12.71-.42 1.37-.88 1.96l9.45 9.45-.88.89z"})});Jht=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M22.7 19l-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4z"})});egt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M14.25 2.26l-.08-.04-.01.02C13.46 2.09 12.74 2 12 2 6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10c0-4.75-3.31-8.72-7.75-9.74zM19.41 9h-7.99l2.71-4.7c2.4.66 4.35 2.42 5.28 4.7zM13.1 4.08L10.27 9l-1.15 2L6.4 6.3C7.84 4.88 9.82 4 12 4c.37 0 .74.03 1.1.08zM5.7 7.09L8.54 12l1.15 2H4.26C4.1 13.36 4 12.69 4 12c0-1.85.64-3.55 1.7-4.91zM4.59 15h7.98l-2.71 4.7c-2.4-.67-4.34-2.42-5.27-4.7zm6.31 4.91L14.89 13l2.72 4.7C16.16 19.12 14.18 20 12 20c-.38 0-.74-.04-1.1-.09zm7.4-3l-4-6.91h5.43c.17.64.27 1.31.27 2 0 1.85-.64 3.55-1.7 4.91z"})});tgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M9.4 10.5l4.77-8.26C13.47 2.09 12.75 2 12 2c-2.4 0-4.6.85-6.32 2.25l3.66 6.35.06-.1zM21.54 9c-.92-2.92-3.15-5.26-6-6.34L11.88 9h9.66zm.26 1h-7.49l.29.5 4.76 8.25C21 16.97 22 14.61 22 12c0-.69-.07-1.35-.2-2zM8.54 12l-3.9-6.75C3.01 7.03 2 9.39 2 12c0 .69.07 1.35.2 2h7.49l-1.15-2zm-6.08 3c.92 2.92 3.15 5.26 6 6.34L12.12 15H2.46zm11.27 0l-3.9 6.76c.7.15 1.42.24 2.17.24 2.4 0 4.6-.85 6.32-2.25l-3.66-6.35-.93 1.6z"})});rgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm3.59-13L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41z"})});ngt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"})});ogt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm-7 7H3v4c0 1.1.9 2 2 2h4v-2H5v-4zM5 5h4V3H5c-1.1 0-2 .9-2 2v4h2V5zm14-2h-4v2h4v4h2V5c0-1.1-.9-2-2-2zm0 16h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4z"})});igt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})});agt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})});sgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})});lgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"})});cgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"})});ugt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4H8c-1.1 0-1.99.9-1.99 2L6 21c0 1.1.89 2 1.99 2H19c1.1 0 2-.9 2-2V11l-6-6zM8 21V7h6v5h5v9H8z"})});dgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8v8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2H7z"})});fgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"})});mgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-5.04-6.71l-2.75 3.54-1.96-2.36L6.5 17h11l-3.54-4.71z"})});pgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z"})});Hkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"})}),hgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})});Wkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5C13 2.12 11.88 1 10.5 1S8 2.12 8 3.5V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5c1.38 0 2.5-1.12 2.5-2.5S21.88 11 20.5 11z"})}),ggt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{d:"M3 13h2v-2H3v2zm0 4h2v-2H3v2zm2 4v-2H3c0 1.1.89 2 2 2zM3 9h2V7H3v2zm12 12h2v-2h-2v2zm4-18H9c-1.11 0-2 .9-2 2v10c0 1.1.89 2 2 2h10c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 12H9V5h10v10zm-8 6h2v-2h-2v2zm-4 0h2v-2H7v2z"})});vgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})});bgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"})});xgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"})});Sgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 5.69l5 4.5V18h-2v-6H9v6H7v-7.81l5-4.5M12 3L2 12h3v8h6v-6h2v6h6v-8h3L12 3z"})});Kkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.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-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z"})}),_gt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19.5 9.5c-1.03 0-1.9.62-2.29 1.5h-2.92c-.39-.88-1.26-1.5-2.29-1.5s-1.9.62-2.29 1.5H6.79c-.39-.88-1.26-1.5-2.29-1.5C3.12 9.5 2 10.62 2 12s1.12 2.5 2.5 2.5c1.03 0 1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5s1.9-.62 2.29-1.5h2.92c.39.88 1.26 1.5 2.29 1.5 1.38 0 2.5-1.12 2.5-2.5s-1.12-2.5-2.5-2.5z"})});wgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.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"})});Tgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})});Agt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})});Pgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 4H5c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h4v-2H5V8h14v10h-4v2h4c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2zm-7 6l-4 4h3v6h2v-6h3l-4-4z"})});Igt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M8 5v14l11-7z"})});Egt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z"})});Dgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 13H5v-2h14v2z"})});kgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})});Mgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",strokeWidth:"0.1px",children:(0,rt.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm2 16H5V5h11.17L19 7.83V19zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3zM6 6h9v4H6z"})});Bgt=(0,rt.jsxs)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:[(0,rt.jsx)("circle",{cx:"7",cy:"14",r:"3"}),(0,rt.jsx)("circle",{cx:"11",cy:"6",r:"3"}),(0,rt.jsx)("circle",{cx:"16.6",cy:"17.6",r:"3"})]});Ykr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})}),Ogt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M6 6h2v12H6zm3.5 6l8.5 6V6z"})});Lgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M6 6h12v12H6z"})});Fgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M4 6h16v2H4zm2-4h12v2H6zm14 8H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm0 10H4v-8h16v8zm-10-7.27v6.53L16 16z"})});Ngt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M6.99 11L3 15l3.99 4v-3H14v-2H6.99v-3zM21 9l-3.99-4v3H10v2h7.01v3L21 9z"})});Xkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M21 4H7V2H5v20h2v-8h14l-2-5zm-6 5c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"})}),Ugt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z"})});Vgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5-.59 1.22-1.42 2.27-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02-1.38 0-2.5-1.12-2.5-2.5 0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75c-.23.55-.36 1.15-.36 1.78 0 2.48 2.02 4.5 4.5 4.5.63 0 1.23-.13 1.77-.36l.98.98c-.88.24-1.8.38-2.75.38-3.79 0-7.17-2.13-8.82-5.5.7-1.43 1.72-2.61 2.93-3.53z"})}),Zkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2M6 9h12v2H6zm8 5H6v-2h8zm4-6H6V6h12z"})}),$kr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M4 4h16v12H5.17L4 17.17zm0-2c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm2 10h8v2H6zm0-3h12v2H6zm0-3h12v2H6z"})}),Qkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10h-4v4h-2v-4H7v-2h4V7h2v4h4z"})}),Jkr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-2 10H7v-2h10z"})});zgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M12 6c3.79 0 7.17 2.13 8.82 5.5C19.17 14.87 15.79 17 12 17s-7.17-2.13-8.82-5.5C4.83 8.13 8.21 6 12 6m0-2C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4zm0 5c1.38 0 2.5 1.12 2.5 2.5S13.38 14 12 14s-2.5-1.12-2.5-2.5S10.62 9 12 9m0-2c-2.48 0-4.5 2.02-4.5 4.5S9.52 16 12 16s4.5-2.02 4.5-4.5S14.48 7 12 7z"})});qgt=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})});eMr=(0,rt.jsx)("svg",{width:"24px",height:"24px",viewBox:"0 0 24 24",children:(0,rt.jsx)("path",{d:"M 9.64 7.64 c 0.23 -0.5 0.36 -1.05 0.36 -1.64 c 0 -2.21 -1.79 -4 -4 -4 S 2 3.79 2 6 s 1.79 4 4 4 c 0.59 0 1.14 -0.13 1.64 -0.36 L 10 12 l -2.36 2.36 C 7.14 14.13 6.59 14 6 14 c -2.21 0 -4 1.79 -4 4 s 1.79 4 4 4 s 4 -1.79 4 -4 c 0 -0.59 -0.13 -1.14 -0.36 -1.64 L 12 14 l 7 7 h 3 v -1 L 9.64 7.64 Z M 6 8 c -1.1 0 -2 -0.89 -2 -2 s 0.9 -2 2 -2 s 2 0.89 2 2 s -0.9 2 -2 2 Z m 0 12 c -1.1 0 -2 -0.89 -2 -2 s 0.9 -2 2 -2 s 2 0.89 2 2 s -0.9 2 -2 2 Z m 6 -7.5 c -0.28 0 -0.5 -0.22 -0.5 -0.5 s 0.22 -0.5 0.5 -0.5 s 0.5 0.22 0.5 0.5 s -0.22 0.5 -0.5 0.5 Z M 19 3 l -6 6 l 2 2 l 7 -7 V 3 Z"})}),jgt=(0,rt.jsxs)("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",children:[(0,rt.jsx)("path",{d:"M8 1.248c1.857 0 3.526.641 4.65 1.794a5 5 0 0 1 2.518 1.09C13.907 1.482 11.295 0 8 0 4.75 0 2.12 1.48.844 4.122a5 5 0 0 1 2.289-1.047C4.236 1.872 5.974 1.248 8 1.248"}),(0,rt.jsx)("path",{d:"M12 12a4 4 0 0 1-2.786-1.13l-.002-.002a1.6 1.6 0 0 0-.276-.167A2.2 2.2 0 0 0 8 10.5c-.414 0-.729.103-.935.201a1.6 1.6 0 0 0-.277.167l-.002.002A4 4 0 1 1 4 4h8a4 4 0 0 1 0 8"})]});Vxe=Nht,zxe=Rgt,sX=Cgt,qxe=ygt});function jxe(e){return e}function Sg(e){return(0,Go.jsxs)("div",{className:`msp-section-header${e.accent?" msp-transform-header-brand-"+e.accent:""}`,children:[e.icon&&(0,Go.jsx)(Yn,{svg:e.icon}),e.title," ",(0,Go.jsx)("small",{children:e.desc})]})}function Cr(e){let t="msp-btn";e.inline||(t+=" msp-btn-block"),e.noOverflow&&(t+=" msp-no-overflow"),e.flex&&(t+=" msp-flex-item"),(e.commit==="on"||e.commit)&&(t+=" msp-btn-commit msp-btn-commit-on"),e.commit==="off"&&(t+=" msp-btn-commit msp-btn-commit-off"),e.children||(t+=" msp-btn-childless"),e.className&&(t+=" "+e.className);let r;return e.flex&&(typeof e.flex=="number"?r={flex:`0 0 ${e.flex}px`,padding:0,maxWidth:`${e.flex}px`}:typeof e.flex=="string"&&(r={flex:`0 0 ${e.flex}`,padding:0,maxWidth:e.flex})),e.style&&(r?Object.assign(r,e.style):r=e.style),(0,Go.jsxs)("button",{onClick:e.onClick,title:e.title,disabled:e.disabled,style:r,className:t,"data-id":e["data-id"],"data-color":e["data-color"],onContextMenu:e.onContextMenu,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,children:[e.icon&&(0,Go.jsx)(Yn,{svg:e.icon}),e.children]})}function yr(e){let t=`msp-btn msp-btn-icon${e.small?"-small":""}${e.className?" "+e.className:""}`;typeof e.toggleState<"u"&&(t+=` msp-btn-link-toggle-${e.toggleState?"on":"off"}`),e.transparent&&(t+=" msp-transparent-bg");let r;return e.flex&&(typeof e.flex=="boolean"?r={flex:"0 0 32px",padding:0}:typeof e.flex=="number"?r={flex:`0 0 ${e.flex}px`,padding:0,maxWidth:`${e.flex}px`}:r={flex:`0 0 ${e.flex}`,padding:0,maxWidth:e.flex}),e.style&&(r?Object.assign(r,e.style):r=e.style),(0,Go.jsxs)("button",{className:t,onClick:e.onClick,title:e.title,disabled:e.disabled,"data-id":e["data-id"],style:r,children:[e.svg&&(0,Go.jsx)(Yn,{svg:e.svg}),e.extraContent]})}function Yc(e){let t="msp-control-row";return e.className&&(t+=" "+e.className),(0,Go.jsxs)("div",{className:t,children:[(0,Go.jsx)("span",{className:"msp-control-row-label",title:e.title,children:e.label}),(0,Go.jsx)("div",{className:"msp-control-row-ctrl",children:e.control}),e.children]})}var Go,mb,Kc,of,LF,ca,ul,Ea=M(()=>{Go=et(gn()),mb=et(Wr());Jr();ha();Kc=class extends mb.Component{constructor(){super(...arguments),this.state={isExpanded:!!this.props.initialExpanded},this.headerClicked=()=>{this.props.onHeaderClick?this.props.onHeaderClick():this.setState({isExpanded:!this.state.isExpanded})}}render(){let t=this.props.hideOffset?"msp-control-group-children":"msp-control-group-children msp-control-offset";return this.props.childrenClassName&&(t+=" "+this.props.childrenClassName),(0,Go.jsxs)("div",{className:"msp-control-group-wrapper",style:{position:"relative",marginTop:this.props.noTopMargin?0:void 0},children:[(0,Go.jsx)("div",{className:"msp-control-group-header",style:{marginLeft:this.props.headerLeftMargin},title:this.props.title,children:(0,Go.jsxs)(Cr,{onClick:this.headerClicked,children:[!this.props.hideExpander&&(0,Go.jsx)(Yn,{svg:this.state.isExpanded?md:fd}),this.props.topRightIcon&&(0,Go.jsx)(Yn,{svg:this.props.topRightIcon,style:{position:"absolute",right:"2px",top:0}}),(0,Go.jsx)("b",{children:this.props.header})]})}),this.state.isExpanded&&(0,Go.jsx)("div",{className:t,style:{display:this.state.isExpanded?"block":"none",maxHeight:this.props.maxHeight,overflow:"hidden",overflowY:"auto"},children:this.props.children})]})}};of=class extends mb.PureComponent{constructor(){super(...arguments),this.input=mb.createRef(),this.delayHandle=void 0,this.pendingValue=void 0,this.state={originalValue:"",value:""},this.onBlur=()=>{this.setState({value:""+this.state.originalValue}),this.props.onBlur&&this.props.onBlur()},this.raiseOnChange=()=>{this.pendingValue!==void 0&&(this.props.onChange(this.pendingValue),this.pendingValue=void 0)},this.onChange=t=>{let r=t.target.value;if(this.props.isValid&&!this.props.isValid(r)||this.props.numeric&&Number.isNaN(+r)){this.clearTimeout(),this.setState({value:r});return}if(this.props.numeric)this.setState({value:r},()=>this.triggerChanged(r,+r));else{let o=(this.props.toValue||jxe)(r),i=(this.props.fromValue||jxe)(o);this.setState({value:i},()=>this.triggerChanged(i,o))}},this.onKeyUp=t=>{(t.charCode===27||t.keyCode===27||t.key==="Escape")&&this.props.blurOnEscape&&this.input.current&&this.input.current.blur()},this.onKeyPress=t=>{(t.keyCode===13||t.charCode===13||t.key==="Enter")&&(this.isPending&&(this.clearTimeout(),this.raiseOnChange()),this.props.blurOnEnter&&this.input.current&&this.input.current.blur(),this.props.onEnter&&this.props.onEnter()),t.stopPropagation()}}get isPending(){return typeof this.delayHandle<"u"}clearTimeout(){this.isPending&&(clearTimeout(this.delayHandle),this.delayHandle=void 0)}triggerChanged(t,r){this.clearTimeout(),t!==this.state.originalValue&&(this.props.delayMs?(this.pendingValue=r,this.delayHandle=setTimeout(this.raiseOnChange,this.props.delayMs)):this.props.onChange(r))}static getDerivedStateFromProps(t,r){let n=t.fromValue?t.fromValue(t.value):t.value;return n===r.originalValue?null:{originalValue:n,value:n}}render(){return(0,Go.jsx)("input",{type:"text",className:this.props.className,style:this.props.style,ref:this.input,onBlur:this.onBlur,value:this.state.value,placeholder:this.props.placeholder,onChange:this.onChange,onKeyPress:this.props.onEnter||this.props.blurOnEnter||this.props.blurOnEscape?this.onKeyPress:void 0,onKeyDown:this.props.blurOnEscape?this.onKeyUp:void 0,disabled:!!this.props.isDisabled})}},LF=class extends mb.Component{constructor(){super(...arguments),this.state={isExpanded:!1},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){let{label:t,pivot:r,controls:n}=this.props;return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)(Yc,{label:(0,Go.jsxs)(Go.Fragment,{children:[t,(0,Go.jsx)("button",{className:"msp-btn-link msp-btn-icon msp-control-group-expander",onClick:this.toggleExpanded,title:`${this.state.isExpanded?"Less":"More"} options`,style:{background:"transparent",textAlign:"left",padding:"0"},children:(0,Go.jsx)(Yn,{svg:this.state.isExpanded?uk:xg,style:{display:"inline-block"}})})]}),control:r,children:this.props.colorStripe&&(0,Go.jsx)("div",{className:"msp-expandable-group-color-stripe",style:{backgroundColor:De.toStyle(this.props.colorStripe)}})}),this.state.isExpanded&&(0,Go.jsx)("div",{className:"msp-control-offset",children:n})]})}};ca=class extends mb.PureComponent{constructor(){super(...arguments),this.onClick=t=>{t.currentTarget.blur(),this.props.toggle()}}render(){let t=this.props,r=t.label,n=t.isSelected?`${t.className||""} msp-control-current`:t.className;return(0,Go.jsx)(Cr,{icon:this.props.icon,onClick:this.onClick,title:this.props.title,inline:this.props.inline,disabled:t.disabled,style:t.style,className:n,children:r&&this.props.isSelected?(0,Go.jsx)("b",{children:r}):r})}},ul=class extends mb.PureComponent{constructor(){super(...arguments),this.state={isExpanded:!!this.props.initiallyExpanded},this.toggleExpanded=()=>this.setState({isExpanded:!this.state.isExpanded})}render(){return(0,Go.jsxs)(Go.Fragment,{children:[(0,Go.jsx)("div",{className:"msp-control-group-header",style:{marginTop:this.props.marginTop!==void 0?this.props.marginTop:"1px",marginLeft:this.props.headerLeftMargin},children:(0,Go.jsxs)("button",{className:"msp-btn msp-form-control msp-btn-block",onClick:this.toggleExpanded,style:this.props.headerStyle,children:[(0,Go.jsx)(Yn,{svg:this.state.isExpanded?fd:md}),this.props.header]})}),this.state.isExpanded&&(this.props.noOffset?this.props.children:(0,Go.jsx)("div",{className:this.props.accent?"msp-accent-offset":"msp-control-offset",children:this.props.children}))]})}}});var j2,rA,Nu,Vr,Ui,Fu,Vi=M(()=>{j2=et(gn()),rA=et(Wr());Ea();ha();Nu=rA.createContext(void 0),Vr=class extends rA.Component{subscribe(t,r){typeof this.subs>"u"&&(this.subs=[]),this.subs.push(t.subscribe(r))}componentWillUnmount(){if(this.subs){for(let t of this.subs)t.unsubscribe();this.subs=void 0}}constructor(t,r){super(t),this.subs=void 0,this.plugin=r,this.init&&this.init()}};Vr.contextType=Nu;Ui=class extends rA.PureComponent{subscribe(t,r){typeof this.subs>"u"&&(this.subs=[]),this.subs.push(t.subscribe(r))}componentWillUnmount(){if(this.subs){for(let t of this.subs)t.unsubscribe();this.subs=void 0}}constructor(t,r){super(t,r),this.subs=void 0,this.plugin=r,this.init&&this.init()}};Ui.contextType=Nu;Fu=class extends Vr{toggleCollapsed(){this.setState({isCollapsed:!this.state.isCollapsed})}componentDidUpdate(t){this.props.initiallyCollapsed!==void 0&&t.initiallyCollapsed!==this.props.initiallyCollapsed&&this.setState({isCollapsed:this.props.initiallyCollapsed})}render(){var t;if(this.state.isHidden)return null;let r=this.state.header.toLowerCase().replace(/\s/g,""),n=this.state.isCollapsed?"msp-transform-wrapper msp-transform-wrapper-collapsed":"msp-transform-wrapper";return(0,j2.jsxs)("div",{className:n,children:[(0,j2.jsx)("div",{id:r,className:"msp-transform-header",children:(0,j2.jsxs)(Cr,{icon:this.state.brand?void 0:this.state.isCollapsed?md:fd,noOverflow:!0,onClick:()=>this.toggleCollapsed(),className:this.state.brand?`msp-transform-header-brand msp-transform-header-brand-${this.state.brand.accent}`:void 0,title:`Click to ${this.state.isCollapsed?"expand":"collapse"}`,children:[(0,j2.jsx)(Yn,{svg:(t=this.state.brand)===null||t===void 0?void 0:t.svg,inline:!0}),this.state.header,(0,j2.jsx)("small",{style:{margin:"0 6px"},children:this.state.isCollapsed?"":this.state.description})]})}),!this.state.isCollapsed&&this.renderControls()]})}constructor(t,r){super(t,r);let n=this.defaultState();t.initiallyCollapsed!==void 0&&(n.isCollapsed=t.initiallyCollapsed),t.header!==void 0&&(n.header=t.header),this.state=n}}});function Gxe(e,t){let r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}var Hxe=M(()=>{});function FF(e,t){return((t||Wgt).jsx?Hgt:Ggt).test(e)}var Ggt,Hgt,Wgt,Wxe=M(()=>{Ggt=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hgt=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wgt={}});var Kxe=M(()=>{Wxe()});function lX(e){return typeof e=="object"?e.type==="text"?Yxe(e.value):!1:Yxe(e)}function Yxe(e){return e.replace(Kgt,"")===""}var Kgt,Xxe=M(()=>{Kgt=/[ \t\n\f\r]/g});var Zxe=M(()=>{Xxe()});var pb,cX=M(()=>{pb=class{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}};pb.prototype.normal={};pb.prototype.property={};pb.prototype.space=void 0});function uX(e,t){let r={},n={};for(let o of e)Object.assign(r,o.property),Object.assign(n,o.normal);return new pb(r,n,t)}var $xe=M(()=>{cX()});function fk(e){return e.toLowerCase()}var dX=M(()=>{});var Xc,fX=M(()=>{Xc=class{constructor(t,r){this.attribute=r,this.property=t}};Xc.prototype.attribute="";Xc.prototype.booleanish=!1;Xc.prototype.boolean=!1;Xc.prototype.commaOrSpaceSeparated=!1;Xc.prototype.commaSeparated=!1;Xc.prototype.defined=!1;Xc.prototype.mustUseProperty=!1;Xc.prototype.number=!1;Xc.prototype.overloadedBoolean=!1;Xc.prototype.property="";Xc.prototype.spaceSeparated=!1;Xc.prototype.space=void 0});var mk={};ci(mk,{boolean:()=>vo,booleanish:()=>dl,commaOrSpaceSeparated:()=>Kf,commaSeparated:()=>Ax,number:()=>ur,overloadedBoolean:()=>NF,spaceSeparated:()=>ga});function G2(){return 2**++Ygt}var Ygt,vo,dl,NF,ur,ga,Ax,Kf,pk=M(()=>{Ygt=0,vo=G2(),dl=G2(),NF=G2(),ur=G2(),ga=G2(),Ax=G2(),Kf=G2()});function Qxe(e,t,r){r&&(e[t]=r)}var mX,H2,pX=M(()=>{fX();pk();mX=Object.keys(mk),H2=class extends Xc{constructor(t,r,n,o){let i=-1;if(super(t,r),Qxe(this,"space",o),typeof n=="number")for(;++i<mX.length;){let a=mX[i];Qxe(this,mX[i],(n&mk[a])===mk[a])}}};H2.prototype.defined=!0});function Vp(e){let t={},r={};for(let[n,o]of Object.entries(e.properties)){let i=new H2(n,e.transform(e.attributes||{},n),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),t[n]=i,r[fk(n)]=n,r[fk(i.attribute)]=n}return new pb(t,r,e.space)}var W2=M(()=>{dX();pX();cX()});var hX,Jxe=M(()=>{W2();pk();hX=Vp({properties:{ariaActiveDescendant:null,ariaAtomic:dl,ariaAutoComplete:null,ariaBusy:dl,ariaChecked:dl,ariaColCount:ur,ariaColIndex:ur,ariaColSpan:ur,ariaControls:ga,ariaCurrent:null,ariaDescribedBy:ga,ariaDetails:null,ariaDisabled:dl,ariaDropEffect:ga,ariaErrorMessage:null,ariaExpanded:dl,ariaFlowTo:ga,ariaGrabbed:dl,ariaHasPopup:null,ariaHidden:dl,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ga,ariaLevel:ur,ariaLive:null,ariaModal:dl,ariaMultiLine:dl,ariaMultiSelectable:dl,ariaOrientation:null,ariaOwns:ga,ariaPlaceholder:null,ariaPosInSet:ur,ariaPressed:dl,ariaReadOnly:dl,ariaRelevant:null,ariaRequired:dl,ariaRoleDescription:ga,ariaRowCount:ur,ariaRowIndex:ur,ariaRowSpan:ur,ariaSelected:dl,ariaSetSize:ur,ariaSort:null,ariaValueMax:ur,ariaValueMin:ur,ariaValueNow:ur,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}})});function UF(e,t){return t in e?e[t]:t}var gX=M(()=>{});function VF(e,t){return UF(e,t.toLowerCase())}var yX=M(()=>{gX()});var eSe,tSe=M(()=>{yX();W2();pk();eSe=Vp({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ax,acceptCharset:ga,accessKey:ga,action:null,allow:null,allowFullScreen:vo,allowPaymentRequest:vo,allowUserMedia:vo,alt:null,as:null,async:vo,autoCapitalize:null,autoComplete:ga,autoFocus:vo,autoPlay:vo,blocking:ga,capture:null,charSet:null,checked:vo,cite:null,className:ga,cols:ur,colSpan:null,content:null,contentEditable:dl,controls:vo,controlsList:ga,coords:ur|Ax,crossOrigin:null,data:null,dateTime:null,decoding:null,default:vo,defer:vo,dir:null,dirName:null,disabled:vo,download:NF,draggable:dl,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:vo,formTarget:null,headers:ga,height:ur,hidden:NF,high:ur,href:null,hrefLang:null,htmlFor:ga,httpEquiv:ga,id:null,imageSizes:null,imageSrcSet:null,inert:vo,inputMode:null,integrity:null,is:null,isMap:vo,itemId:null,itemProp:ga,itemRef:ga,itemScope:vo,itemType:ga,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:vo,low:ur,manifest:null,max:null,maxLength:ur,media:null,method:null,min:null,minLength:ur,multiple:vo,muted:vo,name:null,nonce:null,noModule:vo,noValidate:vo,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:vo,optimum:ur,pattern:null,ping:ga,placeholder:null,playsInline:vo,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:vo,referrerPolicy:null,rel:ga,required:vo,reversed:vo,rows:ur,rowSpan:ur,sandbox:ga,scope:null,scoped:vo,seamless:vo,selected:vo,shadowRootClonable:vo,shadowRootDelegatesFocus:vo,shadowRootMode:null,shape:null,size:ur,sizes:null,slot:null,span:ur,spellCheck:dl,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ur,step:null,style:null,tabIndex:ur,target:null,title:null,translate:null,type:null,typeMustMatch:vo,useMap:null,value:dl,width:ur,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ga,axis:null,background:null,bgColor:null,border:ur,borderColor:null,bottomMargin:ur,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:vo,declare:vo,event:null,face:null,frame:null,frameBorder:null,hSpace:ur,leftMargin:ur,link:null,longDesc:null,lowSrc:null,marginHeight:ur,marginWidth:ur,noResize:vo,noHref:vo,noShade:vo,noWrap:vo,object:null,profile:null,prompt:null,rev:null,rightMargin:ur,rules:null,scheme:null,scrolling:dl,standby:null,summary:null,text:null,topMargin:ur,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ur,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:vo,disableRemotePlayback:vo,prefix:null,property:null,results:ur,security:null,unselectable:null},space:"html",transform:VF})});var rSe,nSe=M(()=>{gX();W2();pk();rSe=Vp({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Kf,accentHeight:ur,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ur,amplitude:ur,arabicForm:null,ascent:ur,attributeName:null,attributeType:null,azimuth:ur,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ur,by:null,calcMode:null,capHeight:ur,className:ga,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ur,diffuseConstant:ur,direction:null,display:null,dur:null,divisor:ur,dominantBaseline:null,download:vo,dx:null,dy:null,edgeMode:null,editable:null,elevation:ur,enableBackground:null,end:null,event:null,exponent:ur,externalResourcesRequired:null,fill:null,fillOpacity:ur,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ax,g2:Ax,glyphName:Ax,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ur,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ur,horizOriginX:ur,horizOriginY:ur,id:null,ideographic:ur,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ur,k:ur,k1:ur,k2:ur,k3:ur,k4:ur,kernelMatrix:Kf,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ur,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ur,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ur,overlineThickness:ur,paintOrder:null,panose1:null,path:null,pathLength:ur,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ga,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ur,pointsAtY:ur,pointsAtZ:ur,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kf,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kf,rev:Kf,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kf,requiredFeatures:Kf,requiredFonts:Kf,requiredFormats:Kf,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ur,specularExponent:ur,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ur,strikethroughThickness:ur,string:null,stroke:null,strokeDashArray:Kf,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ur,strokeOpacity:ur,strokeWidth:null,style:null,surfaceScale:ur,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kf,tabIndex:ur,tableValues:null,target:null,targetX:ur,targetY:ur,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kf,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ur,underlineThickness:ur,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ur,values:null,vAlphabetic:ur,vMathematical:ur,vectorEffect:null,vHanging:ur,vIdeographic:ur,version:null,vertAdvY:ur,vertOriginX:ur,vertOriginY:ur,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ur,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:UF})});var vX,oSe=M(()=>{W2();vX=Vp({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}})});var bX,iSe=M(()=>{W2();yX();bX=Vp({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:VF})});var xX,aSe=M(()=>{W2();xX=Vp({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}})});var SX,sSe=M(()=>{SX={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"}});function _X(e,t){let r=fk(t),n=t,o=Xc;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&Zgt.test(t)){if(t.charAt(4)==="-"){let i=t.slice(5).replace(lSe,Qgt);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{let i=t.slice(4);if(!lSe.test(i)){let a=i.replace(Xgt,$gt);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=H2}return new o(n,t)}function $gt(e){return"-"+e.toLowerCase()}function Qgt(e){return e.charAt(1).toUpperCase()}var Xgt,lSe,Zgt,cSe=M(()=>{pX();fX();dX();Xgt=/[A-Z]/g,lSe=/-[a-z]/g,Zgt=/^data[-\w.:]+$/i});var uSe,zF,dSe=M(()=>{$xe();Jxe();tSe();nSe();oSe();iSe();aSe();sSe();cSe();uSe=uX([hX,eSe,vX,bX,xX],"html"),zF=uX([hX,rSe,vX,bX,xX],"svg")});function fSe(e){return e.join(" ").trim()}var mSe=M(()=>{});var bSe=ve((dBr,vSe)=>{var pSe=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Jgt=/\n/g,e0t=/^\s*/,t0t=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,r0t=/^:\s*/,n0t=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o0t=/^[;\s]*/,i0t=/^\s+|\s+$/g,a0t=`
|
|
20
|
-
`,hSe="/",gSe="*",K2="",s0t="comment",l0t="declaration";vSe.exports=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function o(h){var g=h.match(Jgt);g&&(r+=g.length);var y=h.lastIndexOf(a0t);n=~y?h.length-y:n+h.length}function i(){var h={line:r,column:n};return function(g){return g.position=new a(h),u(),g}}function a(h){this.start=h,this.end={line:r,column:n},this.source=t.source}a.prototype.content=e;var s=[];function l(h){var g=new Error(t.source+":"+r+":"+n+": "+h);if(g.reason=h,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)s.push(g);else throw g}function c(h){var g=h.exec(e);if(g){var y=g[0];return o(y),e=e.slice(y.length),g}}function u(){c(e0t)}function d(h){var g;for(h=h||[];g=f();)g!==!1&&h.push(g);return h}function f(){var h=i();if(!(hSe!=e.charAt(0)||gSe!=e.charAt(1))){for(var g=2;K2!=e.charAt(g)&&(gSe!=e.charAt(g)||hSe!=e.charAt(g+1));)++g;if(g+=2,K2===e.charAt(g-1))return l("End of comment missing");var y=e.slice(2,g-2);return n+=2,o(y),e=e.slice(g),n+=2,h({type:s0t,comment:y})}}function m(){var h=i(),g=c(t0t);if(g){if(f(),!c(r0t))return l("property missing ':'");var y=c(n0t),b=h({type:l0t,property:ySe(g[0].replace(pSe,K2)),value:y?ySe(y[0].replace(pSe,K2)):K2});return c(o0t),b}}function p(){var h=[];d(h);for(var g;g=m();)g!==!1&&(h.push(g),d(h));return h}return u(),p()};function ySe(e){return e?e.replace(i0t,K2):K2}});var xSe=ve(hk=>{"use strict";var c0t=hk&&hk.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hk,"__esModule",{value:!0});hk.default=d0t;var u0t=c0t(bSe());function d0t(e,t){var r=null;if(!e||typeof e!="string")return r;var n=(0,u0t.default)(e),o=typeof t=="function";return n.forEach(function(i){if(i.type==="declaration"){var a=i.property,s=i.value;o?t(a,s,i):s&&(r=r||{},r[a]=s)}}),r}});var _Se=ve(qF=>{"use strict";Object.defineProperty(qF,"__esModule",{value:!0});qF.camelCase=void 0;var f0t=/^--[a-zA-Z0-9_-]+$/,m0t=/-([a-z])/g,p0t=/^[^-]+$/,h0t=/^-(webkit|moz|ms|o|khtml)-/,g0t=/^-(ms)-/,y0t=function(e){return!e||p0t.test(e)||f0t.test(e)},v0t=function(e,t){return t.toUpperCase()},SSe=function(e,t){return"".concat(t,"-")},b0t=function(e,t){return t===void 0&&(t={}),y0t(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(g0t,SSe):e=e.replace(h0t,SSe),e.replace(m0t,v0t))};qF.camelCase=b0t});var wSe=ve((wX,CSe)=>{"use strict";var x0t=wX&&wX.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},S0t=x0t(xSe()),_0t=_Se();function CX(e,t){var r={};return!e||typeof e!="string"||(0,S0t.default)(e,function(n,o){n&&o&&(r[(0,_0t.camelCase)(n,t)]=o)}),r}CX.default=CX;CSe.exports=CX});function TSe(e){return t;function t(r){let n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function TX(e){let t=nA(e),r=jF(e);if(t&&r)return{start:t,end:r}}var jF,nA,ASe=M(()=>{jF=TSe("end"),nA=TSe("start")});var GF=M(()=>{ASe()});function Px(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PSe(e.position):"start"in e||"end"in e?PSe(e):"line"in e||"column"in e?AX(e):""}function AX(e){return ISe(e&&e.line)+":"+ISe(e&&e.column)}function PSe(e){return AX(e&&e.start)+"-"+AX(e&&e.end)}function ISe(e){return e&&typeof e=="number"?e:1}var ESe=M(()=>{});var PX=M(()=>{ESe()});var Ll,DSe=M(()=>{PX();Ll=class extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let o="",i={},a=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?o=t:!i.cause&&t&&(a=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof n=="string"){let l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){let l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}let s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=s?s.line:void 0,this.name=Px(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ll.prototype.file="";Ll.prototype.name="";Ll.prototype.reason="";Ll.prototype.message="";Ll.prototype.stack="";Ll.prototype.column=void 0;Ll.prototype.line=void 0;Ll.prototype.ancestors=void 0;Ll.prototype.cause=void 0;Ll.prototype.fatal=void 0;Ll.prototype.place=void 0;Ll.prototype.ruleId=void 0;Ll.prototype.source=void 0});var IX=M(()=>{DSe()});function DX(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=R0t(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=B0t(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?zF:uSe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=BSe(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function BSe(e,t,r){if(t.type==="element")return P0t(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return I0t(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return D0t(e,t,r);if(t.type==="mdxjsEsm")return E0t(e,t);if(t.type==="root")return k0t(e,t,r);if(t.type==="text")return M0t(e,t)}function P0t(e,t,r){let n=e.schema,o=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(o=zF,e.schema=o),e.ancestors.push(t);let i=OSe(e,t.tagName,!1),a=O0t(e,t),s=MX(e,t);return T0t.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!lX(l):!0})),RSe(e,a,i,t),kX(a,s),e.ancestors.pop(),e.schema=n,e.create(t,i,a,r)}function I0t(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}gk(e,t.position)}function E0t(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);gk(e,t.position)}function D0t(e,t,r){let n=e.schema,o=n;t.name==="svg"&&n.space==="html"&&(o=zF,e.schema=o),e.ancestors.push(t);let i=t.name===null?e.Fragment:OSe(e,t.name,!0),a=L0t(e,t),s=MX(e,t);return RSe(e,a,i,t),kX(a,s),e.ancestors.pop(),e.schema=n,e.create(t,i,a,r)}function k0t(e,t,r){let n={};return kX(n,MX(e,t)),e.create(t,e.Fragment,n,r)}function M0t(e,t){return t.value}function RSe(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function kX(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function B0t(e,t,r){return n;function n(o,i,a,s){let c=Array.isArray(a.children)?r:t;return s?c(i,a,s):c(i,a)}}function R0t(e,t){return r;function r(n,o,i,a){let s=Array.isArray(i.children),l=nA(n);return t(o,i,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function O0t(e,t){let r={},n,o;for(o in t.properties)if(o!=="children"&&EX.call(t.properties,o)){let i=F0t(e,o,t.properties[o]);if(i){let[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&A0t.has(t.tagName)?n=s:r[a]=s}}if(n){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function L0t(e,t){let r={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let i=n.data.estree.body[0];i.type;let a=i.expression;a.type;let s=a.properties[0];s.type,Object.assign(r,e.evaluater.evaluateExpression(s.argument))}else gk(e,t.position);else{let o=n.name,i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let s=n.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else gk(e,t.position);else i=n.value===null?!0:n.value;r[o]=i}return r}function MX(e,t){let r=[],n=-1,o=e.passKeys?new Map:C0t;for(;++n<t.children.length;){let i=t.children[n],a;if(e.passKeys){let l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){let c=o.get(l)||0;a=l+"-"+c,o.set(l,c+1)}}let s=BSe(e,i,a);s!==void 0&&r.push(s)}return r}function F0t(e,t,r){let n=_X(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?Gxe(r):fSe(r)),n.property==="style"){let o=typeof r=="object"?r:N0t(e,String(r));return e.stylePropertyNameCase==="css"&&(o=U0t(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&n.space?SX[n.property]||n.property:n.attribute,r]}}function N0t(e,t){try{return(0,kSe.default)(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let n=r,o=new Ll("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=MSe+"#cannot-parse-style-attribute",o}}function OSe(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),i=-1,a;for(;++i<o.length;){let s=FF(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}n=a}else n=FF(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let o=n.value;return EX.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(n);gk(e)}function gk(e,t){let r=new Ll("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=MSe+"#cannot-handle-mdx-estrees-without-createevaluater",r}function U0t(e){let t={},r;for(r in e)EX.call(e,r)&&(t[V0t(r)]=e[r]);return t}function V0t(e){let t=e.replace(w0t,z0t);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function z0t(e){return"-"+e.toLowerCase()}var kSe,EX,C0t,w0t,T0t,A0t,MSe,LSe=M(()=>{Hxe();Kxe();Zxe();dSe();mSe();kSe=et(wSe(),1);GF();IX();EX={}.hasOwnProperty,C0t=new Map,w0t=/[A-Z]/g,T0t=new Set(["table","tbody","thead","tfoot","tr"]),A0t=new Set(["td","th"]),MSe="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var FSe=M(()=>{LSe()});var yk,NSe=M(()=>{yk={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]}});var USe=M(()=>{NSe()});function Y2(e,t){let r=t||q0t,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return zSe(e,n,o)}function zSe(e,t,r){if(j0t(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return VSe(e.children,t,r)}return Array.isArray(e)?VSe(e,t,r):""}function VSe(e,t,r){let n=[],o=-1;for(;++o<e.length;)n[o]=zSe(e[o],t,r);return n.join("")}function j0t(e){return!!(e&&typeof e=="object")}var q0t,qSe=M(()=>{q0t={}});var HF=M(()=>{qSe()});function oA(e){let t="&"+e+";";jSe.innerHTML=t;let r=jSe.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}var jSe,WF=M(()=>{jSe=document.createElement("i")});function Fl(e,t,r,n){let o=e.length,i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,n.length<1e4)a=Array.from(n),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);i<n.length;)a=n.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function af(e,t){return e.length>0?(Fl(e,e.length,0,t),e):t}var hb=M(()=>{});function KF(e){let t={},r=-1;for(;++r<e.length;)G0t(t,e[r]);return t}function G0t(e,t){let r;for(r in t){let o=(GSe.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r],a;if(i)for(a in i){GSe.call(o,a)||(o[a]=[]);let s=i[a];H0t(o[a],Array.isArray(s)?s:s?[s]:[])}}}function H0t(e,t){let r=-1,n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Fl(e,0,0,n)}var GSe,BX=M(()=>{hb();GSe={}.hasOwnProperty});function YF(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}var RX=M(()=>{});function hd(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var iA=M(()=>{});function X2(e){return e!==null&&(e<32||e===127)}function Dr(e){return e!==null&&e<-2}function Ho(e){return e!==null&&(e<0||e===32)}function Mn(e){return e===-2||e===-1||e===32}function Ix(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}var kc,fl,HSe,vk,WSe,KSe,Z2,X0,_i=M(()=>{kc=Ix(/[A-Za-z]/),fl=Ix(/[\dA-Za-z]/),HSe=Ix(/[#-'*+\--9=?A-Z^-~]/);vk=Ix(/\d/),WSe=Ix(/[\dA-Fa-f]/),KSe=Ix(/[!-/:-@[-`{-~]/);Z2=Ix(/\p{P}|\p{S}/u),X0=Ix(/\s/)});function zp(e){let t=[],r=-1,n=0,o=0;for(;++r<e.length;){let i=e.charCodeAt(r),a="";if(i===37&&fl(e.charCodeAt(r+1))&&fl(e.charCodeAt(r+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let s=e.charCodeAt(r+1);i<56320&&s>56319&&s<57344?(a=String.fromCharCode(i,s),o=1):a="\uFFFD"}else a=String.fromCharCode(i);a&&(t.push(e.slice(n,r),encodeURIComponent(a)),n=r+o+1,a=""),o&&(r+=o,o=0)}return t.join("")+e.slice(n)}var $2=M(()=>{_i()});function In(e,t,r,n){let o=n?n-1:Number.POSITIVE_INFINITY,i=0;return a;function a(l){return Mn(l)?(e.enter(r),s(l)):t(l)}function s(l){return Mn(l)&&i++<o?(e.consume(l),s):(e.exit(r),t(l))}}var Nl=M(()=>{_i()});function W0t(e){let t=e.attempt(this.parser.constructs.contentInitial,n,o),r;return t;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),In(e,t,"linePrefix")}function o(s){return e.enter("paragraph"),i(s)}function i(s){let l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Dr(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),a)}}var YSe,XSe=M(()=>{Nl();_i();YSe={tokenize:W0t}});function K0t(e){let t=this,r=[],n=0,o,i,a;return s;function s(x){if(n<r.length){let C=r[n];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(x)}return c(x)}function l(x){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();let C=t.events.length,S=C,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}y(n);let A=C;for(;A<t.events.length;)t.events[A][1].end={...w},A++;return Fl(t.events,S+1,0,t.events.slice(C)),t.events.length=A,c(x)}return s(x)}function c(x){if(n===r.length){if(!o)return f(x);if(o.currentConstruct&&o.currentConstruct.concrete)return p(x);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ZSe,u,d)(x)}function u(x){return o&&b(),y(n),f(x)}function d(x){return t.parser.lazy[t.now().line]=n!==r.length,a=t.now().offset,p(x)}function f(x){return t.containerState={},e.attempt(ZSe,m,p)(x)}function m(x){return n++,r.push([t.currentConstruct,t.containerState]),f(x)}function p(x){if(x===null){o&&b(),y(0),e.consume(x);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),h(x)}function h(x){if(x===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return Dr(x)?(e.consume(x),g(e.exit("chunkFlow")),n=0,t.interrupt=void 0,s):(e.consume(x),h)}function g(x,C){let S=t.sliceStream(x);if(C&&S.push(null),x.previous=i,i&&(i.next=x),i=x,o.defineSkip(x.start),o.write(S),t.parser.lazy[x.start.line]){let w=o.events.length;for(;w--;)if(o.events[w][1].start.offset<a&&(!o.events[w][1].end||o.events[w][1].end.offset>a))return;let A=t.events.length,T=A,D,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){E=t.events[T][1].end;break}D=!0}for(y(n),w=A;w<t.events.length;)t.events[w][1].end={...E},w++;Fl(t.events,T+1,0,t.events.slice(A)),t.events.length=w}}function y(x){let C=r.length;for(;C-- >x;){let S=r[C];t.containerState=S[1],S[0].exit.call(t,e)}r.length=x}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Y0t(e,t,r){return In(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var $Se,ZSe,QSe=M(()=>{Nl();_i();hb();$Se={tokenize:K0t},ZSe={tokenize:Y0t}});function gb(e){if(e===null||Ho(e)||X0(e))return 1;if(Z2(e))return 2}var XF=M(()=>{_i()});function Ex(e,t,r){let n=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}var bk=M(()=>{});function X0t(e,t){let r=-1,n,o,i,a,s,l,c,u;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[r][1].start};JSe(d,-l),JSe(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:f},i={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},o={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[n][1].end={...a.start},e[r][1].start={...s.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=af(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=af(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=af(c,Ex(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=af(c,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,c=af(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,Fl(e,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function Z0t(e,t){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,o=gb(n),i;return a;function a(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;let c=e.exit("attentionSequence"),u=gb(l),d=!u||u===2&&o||r.includes(l),f=!o||o===2&&u||r.includes(n);return c._open=!!(i===42?d:d&&(o||!f)),c._close=!!(i===42?f:f&&(u||!d)),t(l)}}function JSe(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var xk,e_e=M(()=>{hb();XF();bk();xk={name:"attention",resolveAll:X0t,tokenize:Z0t}});function $0t(e,t,r){let n=0;return o;function o(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return kc(m)?(e.consume(m),a):m===64?r(m):c(m)}function a(m){return m===43||m===45||m===46||fl(m)?(n=1,s(m)):c(m)}function s(m){return m===58?(e.consume(m),n=0,l):(m===43||m===45||m===46||fl(m))&&n++<32?(e.consume(m),s):(n=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||X2(m)?r(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),u):HSe(m)?(e.consume(m),c):r(m)}function u(m){return fl(m)?d(m):r(m)}function d(m){return m===46?(e.consume(m),n=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||fl(m))&&n++<63){let p=m===45?f:d;return e.consume(m),p}return r(m)}}var OX,t_e=M(()=>{_i();OX={name:"autolink",tokenize:$0t}});function Q0t(e,t,r){return n;function n(i){return Mn(i)?In(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Dr(i)?t(i):r(i)}}var Z0,ZF=M(()=>{Nl();_i();Z0={partial:!0,tokenize:Q0t}});function J0t(e,t,r){let n=this;return o;function o(a){if(a===62){let s=n.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return r(a)}function i(a){return Mn(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function eyt(e,t,r){let n=this;return o;function o(a){return Mn(a)?In(e,i,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt($F,t,r)(a)}}function tyt(e){e.exit("blockQuote")}var $F,r_e=M(()=>{Nl();_i();$F={continuation:{tokenize:eyt},exit:tyt,name:"blockQuote",tokenize:J0t}});function ryt(e,t,r){return n;function n(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return KSe(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}var QF,n_e=M(()=>{_i();QF={name:"characterEscape",tokenize:ryt}});function nyt(e,t,r){let n=this,o=0,i,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,a=fl,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=WSe,u):(e.enter("characterReferenceValue"),i=7,a=vk,u(d))}function u(d){if(d===59&&o){let f=e.exit("characterReferenceValue");return a===fl&&!oA(n.sliceSerialize(f))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&o++<i?(e.consume(d),u):r(d)}}var JF,o_e=M(()=>{WF();_i();JF={name:"characterReference",tokenize:nyt}});function oyt(e,t,r){let n=this,o={partial:!0,tokenize:S},i=0,a=0,s;return l;function l(w){return c(w)}function c(w){let A=n.events[n.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,s=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(w)}function u(w){return w===s?(a++,e.consume(w),u):a<3?r(w):(e.exit("codeFencedFenceSequence"),Mn(w)?In(e,d,"whitespace")(w):d(w))}function d(w){return w===null||Dr(w)?(e.exit("codeFencedFence"),n.interrupt?t(w):e.check(i_e,h,C)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===null||Dr(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(w)):Mn(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),In(e,m,"whitespace")(w)):w===96&&w===s?r(w):(e.consume(w),f)}function m(w){return w===null||Dr(w)?d(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||Dr(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(w)):w===96&&w===s?r(w):(e.consume(w),p)}function h(w){return e.attempt(o,C,g)(w)}function g(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return i>0&&Mn(w)?In(e,b,"linePrefix",i+1)(w):b(w)}function b(w){return w===null||Dr(w)?e.check(i_e,h,C)(w):(e.enter("codeFlowValue"),x(w))}function x(w){return w===null||Dr(w)?(e.exit("codeFlowValue"),b(w)):(e.consume(w),x)}function C(w){return e.exit("codeFenced"),t(w)}function S(w,A,T){let D=0;return E;function E(O){return w.enter("lineEnding"),w.consume(O),w.exit("lineEnding"),I}function I(O){return w.enter("codeFencedFence"),Mn(O)?In(w,k,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):k(O)}function k(O){return O===s?(w.enter("codeFencedFenceSequence"),R(O)):T(O)}function R(O){return O===s?(D++,w.consume(O),R):D>=a?(w.exit("codeFencedFenceSequence"),Mn(O)?In(w,B,"whitespace")(O):B(O)):T(O)}function B(O){return O===null||Dr(O)?(w.exit("codeFencedFence"),A(O)):T(O)}}}function iyt(e,t,r){let n=this;return o;function o(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}var i_e,e5,a_e=M(()=>{Nl();_i();i_e={partial:!0,tokenize:iyt},e5={concrete:!0,name:"codeFenced",tokenize:oyt}});function syt(e,t,r){let n=this;return o;function o(c){return e.enter("codeIndented"),In(e,i,"linePrefix",5)(c)}function i(c){let u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):r(c)}function a(c){return c===null?l(c):Dr(c)?e.attempt(ayt,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||Dr(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function lyt(e,t,r){let n=this;return o;function o(a){return n.parser.lazy[n.now().line]?r(a):Dr(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):In(e,i,"linePrefix",5)(a)}function i(a){let s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):Dr(a)?o(a):r(a)}}var Sk,ayt,s_e=M(()=>{Nl();_i();Sk={name:"codeIndented",tokenize:syt},ayt={partial:!0,tokenize:lyt}});function cyt(e){let t=e.length-4,r=3,n,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)o===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(o=n):(n===t||e[n][1].type==="lineEnding")&&(e[o][1].type="codeTextData",n!==o+2&&(e[o][1].end=e[n-1][1].end,e.splice(o+2,n-o-2),t-=n-o-2,n=o+2),o=void 0);return e}function uyt(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function dyt(e,t,r){let n=this,o=0,i,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),o++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?r(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(a=e.enter("codeTextSequence"),i=0,d(f)):Dr(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Dr(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}var LX,l_e=M(()=>{_i();LX={name:"codeText",previous:uyt,resolve:cyt,tokenize:dyt}});function _k(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}var t5,c_e=M(()=>{t5=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){let o=r||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return n&&_k(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),_k(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_k(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);_k(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_k(this.left,r.reverse())}}}});function r5(e){let t={},r=-1,n,o,i,a,s,l,c,u=new t5(e);for(;++r<u.length;){for(;r in t;)r=t[r];if(n=u.get(r),r&&n[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(l=n[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,fyt(u,r)),r=t[r],c=!0);else if(n[1]._container){for(i=r,o=void 0;i--;)if(a=u.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;o&&(n[1].end={...u.get(o)[1].start},s=u.slice(o,r),s.unshift(n),u.splice(o,r-o+1,s))}}return Fl(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function fyt(e,t){let r=e.get(t)[1],n=e.get(t)[2],o=t-1,i=[],a=r._tokenizer;a||(a=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));let s=a.events,l=[],c={},u,d,f=-1,m=r,p=0,h=0,g=[h];for(;m;){for(;e.get(++o)[1]!==m;);i.push(o),m._tokenizer||(u=n.sliceStream(m),m.next||u.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=r;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):g.pop(),f=g.length;f--;){let y=s.slice(g[f],g[f+1]),b=i.pop();l.push([b,b+y.length-1]),e.splice(b,2,y)}for(l.reverse(),f=-1;++f<l.length;)c[p+l[f][0]]=p+l[f][1],p+=l[f][1]-l[f][0]-1;return c}var FX=M(()=>{hb();c_e()});function pyt(e){return r5(e),e}function hyt(e,t){let r;return n;function n(s){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(s)}function o(s){return s===null?i(s):Dr(s)?e.check(myt,a,i)(s):(e.consume(s),o)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function gyt(e,t,r){let n=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),In(e,i,"linePrefix")}function i(a){if(a===null||Dr(a))return r(a);let s=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}var NX,myt,u_e=M(()=>{Nl();_i();FX();NX={resolve:pyt,tokenize:hyt},myt={partial:!0,tokenize:gyt}});function n5(e,t,r,n,o,i,a,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return d;function d(y){return y===60?(e.enter(n),e.enter(o),e.enter(i),e.consume(y),e.exit(i),f):y===null||y===32||y===41||X2(y)?r(y):(e.enter(n),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function f(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(o),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(s),f(y)):y===null||y===60||Dr(y)?r(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function h(y){return!u&&(y===null||y===41||Ho(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(n),t(y)):u<c&&y===40?(e.consume(y),u++,h):y===41?(e.consume(y),u--,h):y===null||y===32||y===40||X2(y)?r(y):(e.consume(y),y===92?g:h)}function g(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}var UX=M(()=>{_i()});function o5(e,t,r,n,o,i){let a=this,s=0,l;return c;function c(m){return e.enter(n),e.enter(o),e.consume(m),e.exit(o),e.enter(i),u}function u(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?r(m):m===93?(e.exit(i),e.enter(o),e.consume(m),e.exit(o),e.exit(n),t):Dr(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Dr(m)||s++>999?(e.exit("chunkString"),u(m)):(e.consume(m),l||(l=!Mn(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}var VX=M(()=>{_i()});function i5(e,t,r,n,o,i){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(n),e.enter(o),e.consume(f),e.exit(o),a=f===40?41:f,l):r(f)}function l(f){return f===a?(e.enter(o),e.consume(f),e.exit(o),e.exit(n),t):(e.enter(i),c(f))}function c(f){return f===a?(e.exit(i),l(a)):f===null?r(f):Dr(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),In(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===a||f===null||Dr(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===a||f===92?(e.consume(f),u):u(f)}}var zX=M(()=>{Nl();_i()});function Q2(e,t){let r;return n;function n(o){return Dr(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,n):Mn(o)?In(e,n,r?"linePrefix":"lineSuffix")(o):t(o)}}var qX=M(()=>{Nl();_i()});function vyt(e,t,r){let n=this,o;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return o5.call(n,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return o=hd(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):r(m)}function l(m){return Ho(m)?Q2(e,c)(m):c(m)}function c(m){return n5(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(yyt,d,d)(m)}function d(m){return Mn(m)?In(e,f,"whitespace")(m):f(m)}function f(m){return m===null||Dr(m)?(e.exit("definition"),n.parser.defined.push(o),t(m)):r(m)}}function byt(e,t,r){return n;function n(s){return Ho(s)?Q2(e,o)(s):r(s)}function o(s){return i5(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return Mn(s)?In(e,a,"whitespace")(s):a(s)}function a(s){return s===null||Dr(s)?t(s):r(s)}}var jX,yyt,d_e=M(()=>{UX();VX();Nl();zX();qX();_i();iA();jX={name:"definition",tokenize:vyt},yyt={partial:!0,tokenize:byt}});function xyt(e,t,r){return n;function n(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Dr(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var GX,f_e=M(()=>{_i();GX={name:"hardBreakEscape",tokenize:xyt}});function Syt(e,t){let r=e.length-2,n=3,o,i;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(o={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},i={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Fl(e,n,r-n+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function _yt(e,t,r){let n=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&n++<6?(e.consume(u),a):u===null||Ho(u)?(e.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Dr(u)?(e.exit("atxHeading"),t(u)):Mn(u)?In(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Ho(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}var HX,m_e=M(()=>{Nl();_i();hb();HX={name:"headingAtx",resolve:Syt,tokenize:_yt}});var p_e,WX,h_e=M(()=>{p_e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],WX=["pre","script","style","textarea"]});function Tyt(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ayt(e,t,r){let n=this,o,i,a,s,l;return c;function c(z){return u(z)}function u(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),d}function d(z){return z===33?(e.consume(z),f):z===47?(e.consume(z),i=!0,h):z===63?(e.consume(z),o=3,n.interrupt?t:L):kc(z)?(e.consume(z),a=String.fromCharCode(z),g):r(z)}function f(z){return z===45?(e.consume(z),o=2,m):z===91?(e.consume(z),o=5,s=0,p):kc(z)?(e.consume(z),o=4,n.interrupt?t:L):r(z)}function m(z){return z===45?(e.consume(z),n.interrupt?t:L):r(z)}function p(z){let ie="CDATA[";return z===ie.charCodeAt(s++)?(e.consume(z),s===ie.length?n.interrupt?t:k:p):r(z)}function h(z){return kc(z)?(e.consume(z),a=String.fromCharCode(z),g):r(z)}function g(z){if(z===null||z===47||z===62||Ho(z)){let ie=z===47,oe=a.toLowerCase();return!ie&&!i&&WX.includes(oe)?(o=1,n.interrupt?t(z):k(z)):p_e.includes(a.toLowerCase())?(o=6,ie?(e.consume(z),y):n.interrupt?t(z):k(z)):(o=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(z):i?b(z):x(z))}return z===45||fl(z)?(e.consume(z),a+=String.fromCharCode(z),g):r(z)}function y(z){return z===62?(e.consume(z),n.interrupt?t:k):r(z)}function b(z){return Mn(z)?(e.consume(z),b):E(z)}function x(z){return z===47?(e.consume(z),E):z===58||z===95||kc(z)?(e.consume(z),C):Mn(z)?(e.consume(z),x):E(z)}function C(z){return z===45||z===46||z===58||z===95||fl(z)?(e.consume(z),C):S(z)}function S(z){return z===61?(e.consume(z),w):Mn(z)?(e.consume(z),S):x(z)}function w(z){return z===null||z===60||z===61||z===62||z===96?r(z):z===34||z===39?(e.consume(z),l=z,A):Mn(z)?(e.consume(z),w):T(z)}function A(z){return z===l?(e.consume(z),l=null,D):z===null||Dr(z)?r(z):(e.consume(z),A)}function T(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Ho(z)?S(z):(e.consume(z),T)}function D(z){return z===47||z===62||Mn(z)?x(z):r(z)}function E(z){return z===62?(e.consume(z),I):r(z)}function I(z){return z===null||Dr(z)?k(z):Mn(z)?(e.consume(z),I):r(z)}function k(z){return z===45&&o===2?(e.consume(z),F):z===60&&o===1?(e.consume(z),q):z===62&&o===4?(e.consume(z),V):z===63&&o===3?(e.consume(z),L):z===93&&o===5?(e.consume(z),j):Dr(z)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Cyt,U,R)(z)):z===null||Dr(z)?(e.exit("htmlFlowData"),R(z)):(e.consume(z),k)}function R(z){return e.check(wyt,B,U)(z)}function B(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),O}function O(z){return z===null||Dr(z)?R(z):(e.enter("htmlFlowData"),k(z))}function F(z){return z===45?(e.consume(z),L):k(z)}function q(z){return z===47?(e.consume(z),a="",W):k(z)}function W(z){if(z===62){let ie=a.toLowerCase();return WX.includes(ie)?(e.consume(z),V):k(z)}return kc(z)&&a.length<8?(e.consume(z),a+=String.fromCharCode(z),W):k(z)}function j(z){return z===93?(e.consume(z),L):k(z)}function L(z){return z===62?(e.consume(z),V):z===45&&o===2?(e.consume(z),L):k(z)}function V(z){return z===null||Dr(z)?(e.exit("htmlFlowData"),U(z)):(e.consume(z),V)}function U(z){return e.exit("htmlFlow"),t(z)}}function Pyt(e,t,r){let n=this;return o;function o(a){return Dr(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):r(a)}function i(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}function Iyt(e,t,r){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Z0,t,r)}}var KX,Cyt,wyt,g_e=M(()=>{_i();h_e();ZF();KX={concrete:!0,name:"htmlFlow",resolveTo:Tyt,tokenize:Ayt},Cyt={partial:!0,tokenize:Iyt},wyt={partial:!0,tokenize:Pyt}});function Eyt(e,t,r){let n=this,o,i,a;return s;function s(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),c):L===47?(e.consume(L),S):L===63?(e.consume(L),x):kc(L)?(e.consume(L),T):r(L)}function c(L){return L===45?(e.consume(L),u):L===91?(e.consume(L),i=0,p):kc(L)?(e.consume(L),b):r(L)}function u(L){return L===45?(e.consume(L),m):r(L)}function d(L){return L===null?r(L):L===45?(e.consume(L),f):Dr(L)?(a=d,q(L)):(e.consume(L),d)}function f(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?F(L):L===45?f(L):d(L)}function p(L){let V="CDATA[";return L===V.charCodeAt(i++)?(e.consume(L),i===V.length?h:p):r(L)}function h(L){return L===null?r(L):L===93?(e.consume(L),g):Dr(L)?(a=h,q(L)):(e.consume(L),h)}function g(L){return L===93?(e.consume(L),y):h(L)}function y(L){return L===62?F(L):L===93?(e.consume(L),y):h(L)}function b(L){return L===null||L===62?F(L):Dr(L)?(a=b,q(L)):(e.consume(L),b)}function x(L){return L===null?r(L):L===63?(e.consume(L),C):Dr(L)?(a=x,q(L)):(e.consume(L),x)}function C(L){return L===62?F(L):x(L)}function S(L){return kc(L)?(e.consume(L),w):r(L)}function w(L){return L===45||fl(L)?(e.consume(L),w):A(L)}function A(L){return Dr(L)?(a=A,q(L)):Mn(L)?(e.consume(L),A):F(L)}function T(L){return L===45||fl(L)?(e.consume(L),T):L===47||L===62||Ho(L)?D(L):r(L)}function D(L){return L===47?(e.consume(L),F):L===58||L===95||kc(L)?(e.consume(L),E):Dr(L)?(a=D,q(L)):Mn(L)?(e.consume(L),D):F(L)}function E(L){return L===45||L===46||L===58||L===95||fl(L)?(e.consume(L),E):I(L)}function I(L){return L===61?(e.consume(L),k):Dr(L)?(a=I,q(L)):Mn(L)?(e.consume(L),I):D(L)}function k(L){return L===null||L===60||L===61||L===62||L===96?r(L):L===34||L===39?(e.consume(L),o=L,R):Dr(L)?(a=k,q(L)):Mn(L)?(e.consume(L),k):(e.consume(L),B)}function R(L){return L===o?(e.consume(L),o=void 0,O):L===null?r(L):Dr(L)?(a=R,q(L)):(e.consume(L),R)}function B(L){return L===null||L===34||L===39||L===60||L===61||L===96?r(L):L===47||L===62||Ho(L)?D(L):(e.consume(L),B)}function O(L){return L===47||L===62||Ho(L)?D(L):r(L)}function F(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):r(L)}function q(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),W}function W(L){return Mn(L)?In(e,j,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):j(L)}function j(L){return e.enter("htmlTextData"),a(L)}}var YX,y_e=M(()=>{Nl();_i();YX={name:"htmlText",tokenize:Eyt}});function Byt(e){let t=-1,r=[];for(;++t<e.length;){let n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let o=n.type==="labelImage"?4:2;n.type="data",t+=o}}return e.length!==r.length&&Fl(e,0,e.length,r),e}function Ryt(e,t){let r=e.length,n=0,o,i,a,s;for(;r--;)if(o=e[r][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=r,o.type!=="labelLink")){n=2;break}}else o.type==="labelEnd"&&(a=r);let l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[i+n+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=af(s,e.slice(i+1,i+n+3)),s=af(s,[["enter",u,t]]),s=af(s,Ex(t.parser.constructs.insideSpan.null,e.slice(i+n+4,a-3),t)),s=af(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=af(s,e.slice(a+1)),s=af(s,[["exit",l,t]]),Fl(e,i,e.length,s),e}function Oyt(e,t,r){let n=this,o=n.events.length,i,a;for(;o--;)if((n.events[o][1].type==="labelImage"||n.events[o][1].type==="labelLink")&&!n.events[o][1]._balanced){i=n.events[o][1];break}return s;function s(f){return i?i._inactive?d(f):(a=n.parser.defined.includes(hd(n.sliceSerialize({start:i.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):r(f)}function l(f){return f===40?e.attempt(Dyt,u,a?u:d)(f):f===91?e.attempt(kyt,u,a?c:d)(f):a?u(f):d(f)}function c(f){return e.attempt(Myt,u,d)(f)}function u(f){return t(f)}function d(f){return i._balanced=!0,r(f)}}function Lyt(e,t,r){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return Ho(d)?Q2(e,i)(d):i(d)}function i(d){return d===41?u(d):n5(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Ho(d)?Q2(e,l)(d):u(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?i5(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ho(d)?Q2(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):r(d)}}function Fyt(e,t,r){let n=this;return o;function o(s){return o5.call(n,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return n.parser.defined.includes(hd(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(s):r(s)}function a(s){return r(s)}}function Nyt(e,t,r){return n;function n(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}var J2,Dyt,kyt,Myt,a5=M(()=>{UX();VX();zX();qX();_i();hb();iA();bk();J2={name:"labelEnd",resolveAll:Byt,resolveTo:Ryt,tokenize:Oyt},Dyt={tokenize:Lyt},kyt={tokenize:Fyt},Myt={tokenize:Nyt}});function Uyt(e,t,r){let n=this;return o;function o(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):r(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}var XX,v_e=M(()=>{a5();XX={name:"labelStartImage",resolveAll:J2.resolveAll,tokenize:Uyt}});function Vyt(e,t,r){let n=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):t(a)}}var ZX,b_e=M(()=>{a5();ZX={name:"labelStartLink",resolveAll:J2.resolveAll,tokenize:Vyt}});function zyt(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),In(e,t,"linePrefix")}}var Ck,x_e=M(()=>{Nl();Ck={name:"lineEnding",tokenize:zyt}});function qyt(e,t,r){let n=0,o;return i;function i(c){return e.enter("thematicBreak"),a(c)}function a(c){return o=c,s(c)}function s(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||Dr(c))?(e.exit("thematicBreak"),t(c)):r(c)}function l(c){return c===o?(e.consume(c),n++,l):(e.exit("thematicBreakSequence"),Mn(c)?In(e,s,"whitespace")(c):s(c))}}var eC,$X=M(()=>{Nl();_i();eC={name:"thematicBreak",tokenize:qyt}});function Hyt(e,t,r){let n=this,o=n.events[n.events.length-1],i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return s;function s(m){let p=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:vk(m)){if(n.containerState.type||(n.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(eC,r,c)(m):c(m);if(!n.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return r(m)}function l(m){return vk(m)&&++a<10?(e.consume(m),l):(!n.interrupt||a<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):r(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,e.check(Z0,n.interrupt?r:u,e.attempt(jyt,f,d))}function u(m){return n.containerState.initialBlankLine=!0,i++,f(m)}function d(m){return Mn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):r(m)}function f(m){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Wyt(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(Z0,o,i);function o(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,In(e,t,"listItemIndent",n.containerState.size+1)(s)}function i(s){return n.containerState.furtherBlankLines||!Mn(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(Gyt,t,a)(s))}function a(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,In(e,e.attempt(gd,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Kyt(e,t,r){let n=this;return In(e,o,"listItemIndent",n.containerState.size+1);function o(i){let a=n.events[n.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(i):r(i)}}function Yyt(e){e.exit(this.containerState.type)}function Xyt(e,t,r){let n=this;return In(e,o,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){let a=n.events[n.events.length-1];return!Mn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var gd,jyt,Gyt,S_e=M(()=>{Nl();_i();ZF();$X();gd={continuation:{tokenize:Wyt},exit:Yyt,name:"list",tokenize:Hyt},jyt={partial:!0,tokenize:Xyt},Gyt={partial:!0,tokenize:Kyt}});function Zyt(e,t){let r=e.length,n,o,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=a,e.push(["exit",a,t]),e}function $yt(e,t,r){let n=this,o;return i;function i(c){let u=n.events.length,d;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){d=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),o=c,a(c)):r(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===o?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Mn(c)?In(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Dr(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}var s5,__e=M(()=>{Nl();_i();s5={name:"setextUnderline",resolveTo:Zyt,tokenize:$yt}});var l5=M(()=>{e_e();t_e();ZF();r_e();n_e();o_e();a_e();s_e();l_e();u_e();d_e();f_e();m_e();g_e();y_e();a5();v_e();b_e();x_e();S_e();__e();$X()});function Qyt(e){let t=this,r=e.attempt(Z0,n,e.attempt(this.parser.constructs.flowInitial,o,In(e,e.attempt(this.parser.constructs.flow,o,e.attempt(NX,o)),"linePrefix")));return r;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var C_e,w_e=M(()=>{l5();Nl();C_e={tokenize:Qyt}});function I_e(e){return{resolveAll:E_e(e==="text"?Jyt:void 0),tokenize:t};function t(r){let n=this,o=this.parser.constructs[e],i=r.attempt(o,a,s);return a;function a(u){return c(u)?i(u):s(u)}function s(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),i(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let d=o[u],f=-1;if(d)for(;++f<d.length;){let m=d[f];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function E_e(e){return t;function t(r,n){let o=-1,i;for(;++o<=r.length;)i===void 0?r[o]&&r[o][1].type==="data"&&(i=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==i+2&&(r[i][1].end=r[o-1][1].end,r.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(r,n):r}}function Jyt(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let n=e[r-1][1],o=t.sliceStream(n),i=o.length,a=-1,s=0,l;for(;i--;){let c=o[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(s=0),s){let c={type:r===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:n.start._bufferIndex+a,_index:n.start._index+i,line:n.end.line,column:n.end.column-s,offset:n.end.offset-s},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}var T_e,A_e,P_e,QX=M(()=>{T_e={resolveAll:E_e()},A_e=I_e("string"),P_e=I_e("text")});var JX={};ci(JX,{attentionMarkers:()=>svt,contentInitial:()=>tvt,disable:()=>lvt,document:()=>evt,flow:()=>nvt,flowInitial:()=>rvt,insideSpan:()=>avt,string:()=>ovt,text:()=>ivt});var evt,tvt,rvt,nvt,ovt,ivt,avt,svt,lvt,D_e=M(()=>{l5();QX();evt={42:gd,43:gd,45:gd,48:gd,49:gd,50:gd,51:gd,52:gd,53:gd,54:gd,55:gd,56:gd,57:gd,62:$F},tvt={91:jX},rvt={[-2]:Sk,[-1]:Sk,32:Sk},nvt={35:HX,42:eC,45:[s5,eC],60:KX,61:s5,95:eC,96:e5,126:e5},ovt={38:JF,92:QF},ivt={[-5]:Ck,[-4]:Ck,[-3]:Ck,33:XX,38:JF,42:xk,60:[OX,YX],91:ZX,92:[GX,QF],93:J2,95:xk,96:LX},avt={null:[xk,T_e]},svt={null:[42,95]},lvt={null:[]}});function k_e(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},o={},i=[],a=[],s=[],l=!0,c={attempt:D(A),check:D(T),consume:C,enter:S,exit:w,interrupt:D(T,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:m},d=t.tokenize.call(u,c),f;return t.resolveAll&&i.push(t),u;function m(R){return a=af(a,R),b(),a[a.length-1]!==null?[]:(E(t,0),u.events=Ex(i,u.events,u),u.events)}function p(R,B){return uvt(h(R),B)}function h(R){return cvt(a,R)}function g(){let{_bufferIndex:R,_index:B,line:O,column:F,offset:q}=n;return{_bufferIndex:R,_index:B,line:O,column:F,offset:q}}function y(R){o[R.line]=R.column,k()}function b(){let R;for(;n._index<a.length;){let B=a[n._index];if(typeof B=="string")for(R=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===R&&n._bufferIndex<B.length;)x(B.charCodeAt(n._bufferIndex));else x(B)}}function x(R){l=void 0,f=R,d=d(R)}function C(R){Dr(R)?(n.line++,n.column=1,n.offset+=R===-3?2:1,k()):R!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===a[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=R,l=!0}function S(R,B){let O=B||{};return O.type=R,O.start=g(),u.events.push(["enter",O,u]),s.push(O),O}function w(R){let B=s.pop();return B.end=g(),u.events.push(["exit",B,u]),B}function A(R,B){E(R,B.from)}function T(R,B){B.restore()}function D(R,B){return O;function O(F,q,W){let j,L,V,U;return Array.isArray(F)?ie(F):"tokenize"in F?ie([F]):z(F);function z(ne){return K;function K($){let Z=$!==null&&ne[$],de=$!==null&&ne.null,Q=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(de)?de:de?[de]:[]];return ie(Q)($)}}function ie(ne){return j=ne,L=0,ne.length===0?W:oe(ne[L])}function oe(ne){return K;function K($){return U=I(),V=ne,ne.partial||(u.currentConstruct=ne),ne.name&&u.parser.constructs.disable.null.includes(ne.name)?Y($):ne.tokenize.call(B?Object.assign(Object.create(u),B):u,c,X,Y)($)}}function X(ne){return l=!0,R(V,U),q}function Y(ne){return l=!0,U.restore(),++L<j.length?oe(j[L]):W}}}function E(R,B){R.resolveAll&&!i.includes(R)&&i.push(R),R.resolve&&Fl(u.events,B,u.events.length-B,R.resolve(u.events.slice(B),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function I(){let R=g(),B=u.previous,O=u.currentConstruct,F=u.events.length,q=Array.from(s);return{from:F,restore:W};function W(){n=R,u.previous=B,u.currentConstruct=O,u.events.length=F,s=q,k()}}function k(){n.line in o&&n.column<2&&(n.column=o[n.line],n.offset+=o[n.line]-1)}}function cvt(e,t){let r=t.start._index,n=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex,a;if(r===o)a=[e[r].slice(n,i)];else{if(a=e.slice(r,o),n>-1){let s=a[0];typeof s=="string"?a[0]=s.slice(n):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function uvt(e,t){let r=-1,n=[],o;for(;++r<e.length;){let i=e[r],a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
20
|
+
`,hSe="/",gSe="*",K2="",s0t="comment",l0t="declaration";vSe.exports=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var r=1,n=1;function o(h){var g=h.match(Jgt);g&&(r+=g.length);var y=h.lastIndexOf(a0t);n=~y?h.length-y:n+h.length}function i(){var h={line:r,column:n};return function(g){return g.position=new a(h),u(),g}}function a(h){this.start=h,this.end={line:r,column:n},this.source=t.source}a.prototype.content=e;var s=[];function l(h){var g=new Error(t.source+":"+r+":"+n+": "+h);if(g.reason=h,g.filename=t.source,g.line=r,g.column=n,g.source=e,t.silent)s.push(g);else throw g}function c(h){var g=h.exec(e);if(g){var y=g[0];return o(y),e=e.slice(y.length),g}}function u(){c(e0t)}function d(h){var g;for(h=h||[];g=f();)g!==!1&&h.push(g);return h}function f(){var h=i();if(!(hSe!=e.charAt(0)||gSe!=e.charAt(1))){for(var g=2;K2!=e.charAt(g)&&(gSe!=e.charAt(g)||hSe!=e.charAt(g+1));)++g;if(g+=2,K2===e.charAt(g-1))return l("End of comment missing");var y=e.slice(2,g-2);return n+=2,o(y),e=e.slice(g),n+=2,h({type:s0t,comment:y})}}function m(){var h=i(),g=c(t0t);if(g){if(f(),!c(r0t))return l("property missing ':'");var y=c(n0t),b=h({type:l0t,property:ySe(g[0].replace(pSe,K2)),value:y?ySe(y[0].replace(pSe,K2)):K2});return c(o0t),b}}function p(){var h=[];d(h);for(var g;g=m();)g!==!1&&(h.push(g),d(h));return h}return u(),p()};function ySe(e){return e?e.replace(i0t,K2):K2}});var xSe=ve(hk=>{"use strict";var c0t=hk&&hk.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(hk,"__esModule",{value:!0});hk.default=d0t;var u0t=c0t(bSe());function d0t(e,t){let r=null;if(!e||typeof e!="string")return r;let n=(0,u0t.default)(e),o=typeof t=="function";return n.forEach(i=>{if(i.type!=="declaration")return;let{property:a,value:s}=i;o?t(a,s,i):s&&(r=r||{},r[a]=s)}),r}});var _Se=ve(qF=>{"use strict";Object.defineProperty(qF,"__esModule",{value:!0});qF.camelCase=void 0;var f0t=/^--[a-zA-Z0-9_-]+$/,m0t=/-([a-z])/g,p0t=/^[^-]+$/,h0t=/^-(webkit|moz|ms|o|khtml)-/,g0t=/^-(ms)-/,y0t=function(e){return!e||p0t.test(e)||f0t.test(e)},v0t=function(e,t){return t.toUpperCase()},SSe=function(e,t){return"".concat(t,"-")},b0t=function(e,t){return t===void 0&&(t={}),y0t(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(g0t,SSe):e=e.replace(h0t,SSe),e.replace(m0t,v0t))};qF.camelCase=b0t});var wSe=ve((wX,CSe)=>{"use strict";var x0t=wX&&wX.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},S0t=x0t(xSe()),_0t=_Se();function CX(e,t){var r={};return!e||typeof e!="string"||(0,S0t.default)(e,function(n,o){n&&o&&(r[(0,_0t.camelCase)(n,t)]=o)}),r}CX.default=CX;CSe.exports=CX});function TSe(e){return t;function t(r){let n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function TX(e){let t=nA(e),r=jF(e);if(t&&r)return{start:t,end:r}}var jF,nA,ASe=M(()=>{jF=TSe("end"),nA=TSe("start")});var GF=M(()=>{ASe()});function Px(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?PSe(e.position):"start"in e||"end"in e?PSe(e):"line"in e||"column"in e?AX(e):""}function AX(e){return ISe(e&&e.line)+":"+ISe(e&&e.column)}function PSe(e){return AX(e&&e.start)+"-"+AX(e&&e.end)}function ISe(e){return e&&typeof e=="number"?e:1}var ESe=M(()=>{});var PX=M(()=>{ESe()});var Ll,DSe=M(()=>{PX();Ll=class extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let o="",i={},a=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?o=t:!i.cause&&t&&(a=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof n=="string"){let l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){let l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}let s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=s?s.line:void 0,this.name=Px(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Ll.prototype.file="";Ll.prototype.name="";Ll.prototype.reason="";Ll.prototype.message="";Ll.prototype.stack="";Ll.prototype.column=void 0;Ll.prototype.line=void 0;Ll.prototype.ancestors=void 0;Ll.prototype.cause=void 0;Ll.prototype.fatal=void 0;Ll.prototype.place=void 0;Ll.prototype.ruleId=void 0;Ll.prototype.source=void 0});var IX=M(()=>{DSe()});function DX(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");let r=t.filePath||void 0,n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=R0t(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=B0t(r,t.jsx,t.jsxs)}let o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?zF:uSe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=BSe(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function BSe(e,t,r){if(t.type==="element")return P0t(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return I0t(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return D0t(e,t,r);if(t.type==="mdxjsEsm")return E0t(e,t);if(t.type==="root")return k0t(e,t,r);if(t.type==="text")return M0t(e,t)}function P0t(e,t,r){let n=e.schema,o=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(o=zF,e.schema=o),e.ancestors.push(t);let i=OSe(e,t.tagName,!1),a=O0t(e,t),s=MX(e,t);return T0t.has(t.tagName)&&(s=s.filter(function(l){return typeof l=="string"?!lX(l):!0})),RSe(e,a,i,t),kX(a,s),e.ancestors.pop(),e.schema=n,e.create(t,i,a,r)}function I0t(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}gk(e,t.position)}function E0t(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);gk(e,t.position)}function D0t(e,t,r){let n=e.schema,o=n;t.name==="svg"&&n.space==="html"&&(o=zF,e.schema=o),e.ancestors.push(t);let i=t.name===null?e.Fragment:OSe(e,t.name,!0),a=L0t(e,t),s=MX(e,t);return RSe(e,a,i,t),kX(a,s),e.ancestors.pop(),e.schema=n,e.create(t,i,a,r)}function k0t(e,t,r){let n={};return kX(n,MX(e,t)),e.create(t,e.Fragment,n,r)}function M0t(e,t){return t.value}function RSe(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function kX(e,t){if(t.length>0){let r=t.length>1?t:t[0];r&&(e.children=r)}}function B0t(e,t,r){return n;function n(o,i,a,s){let c=Array.isArray(a.children)?r:t;return s?c(i,a,s):c(i,a)}}function R0t(e,t){return r;function r(n,o,i,a){let s=Array.isArray(i.children),l=nA(n);return t(o,i,a,s,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function O0t(e,t){let r={},n,o;for(o in t.properties)if(o!=="children"&&EX.call(t.properties,o)){let i=F0t(e,o,t.properties[o]);if(i){let[a,s]=i;e.tableCellAlignToStyle&&a==="align"&&typeof s=="string"&&A0t.has(t.tagName)?n=s:r[a]=s}}if(n){let i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function L0t(e,t){let r={};for(let n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){let i=n.data.estree.body[0];i.type;let a=i.expression;a.type;let s=a.properties[0];s.type,Object.assign(r,e.evaluater.evaluateExpression(s.argument))}else gk(e,t.position);else{let o=n.name,i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){let s=n.value.data.estree.body[0];s.type,i=e.evaluater.evaluateExpression(s.expression)}else gk(e,t.position);else i=n.value===null?!0:n.value;r[o]=i}return r}function MX(e,t){let r=[],n=-1,o=e.passKeys?new Map:C0t;for(;++n<t.children.length;){let i=t.children[n],a;if(e.passKeys){let l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){let c=o.get(l)||0;a=l+"-"+c,o.set(l,c+1)}}let s=BSe(e,i,a);s!==void 0&&r.push(s)}return r}function F0t(e,t,r){let n=_X(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?Gxe(r):fSe(r)),n.property==="style"){let o=typeof r=="object"?r:N0t(e,String(r));return e.stylePropertyNameCase==="css"&&(o=U0t(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&n.space?SX[n.property]||n.property:n.attribute,r]}}function N0t(e,t){try{return(0,kSe.default)(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};let n=r,o=new Ll("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=MSe+"#cannot-parse-style-attribute",o}}function OSe(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){let o=t.split("."),i=-1,a;for(;++i<o.length;){let s=FF(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};a=a?{type:"MemberExpression",object:a,property:s,computed:!!(i&&s.type==="Literal"),optional:!1}:s}n=a}else n=FF(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){let o=n.value;return EX.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(n);gk(e)}function gk(e,t){let r=new Ll("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=MSe+"#cannot-handle-mdx-estrees-without-createevaluater",r}function U0t(e){let t={},r;for(r in e)EX.call(e,r)&&(t[V0t(r)]=e[r]);return t}function V0t(e){let t=e.replace(w0t,z0t);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function z0t(e){return"-"+e.toLowerCase()}var kSe,EX,C0t,w0t,T0t,A0t,MSe,LSe=M(()=>{Hxe();Kxe();Zxe();dSe();mSe();kSe=et(wSe(),1);GF();IX();EX={}.hasOwnProperty,C0t=new Map,w0t=/[A-Z]/g,T0t=new Set(["table","tbody","thead","tfoot","tr"]),A0t=new Set(["td","th"]),MSe="https://github.com/syntax-tree/hast-util-to-jsx-runtime"});var FSe=M(()=>{LSe()});var yk,NSe=M(()=>{yk={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]}});var USe=M(()=>{NSe()});function Y2(e,t){let r=t||q0t,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,o=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return zSe(e,n,o)}function zSe(e,t,r){if(j0t(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return VSe(e.children,t,r)}return Array.isArray(e)?VSe(e,t,r):""}function VSe(e,t,r){let n=[],o=-1;for(;++o<e.length;)n[o]=zSe(e[o],t,r);return n.join("")}function j0t(e){return!!(e&&typeof e=="object")}var q0t,qSe=M(()=>{q0t={}});var HF=M(()=>{qSe()});function oA(e){let t="&"+e+";";jSe.innerHTML=t;let r=jSe.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}var jSe,WF=M(()=>{jSe=document.createElement("i")});function Fl(e,t,r,n){let o=e.length,i=0,a;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,r=r>0?r:0,n.length<1e4)a=Array.from(n),a.unshift(t,r),e.splice(...a);else for(r&&e.splice(t,r);i<n.length;)a=n.slice(i,i+1e4),a.unshift(t,0),e.splice(...a),i+=1e4,t+=1e4}function af(e,t){return e.length>0?(Fl(e,e.length,0,t),e):t}var hb=M(()=>{});function KF(e){let t={},r=-1;for(;++r<e.length;)G0t(t,e[r]);return t}function G0t(e,t){let r;for(r in t){let o=(GSe.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r],a;if(i)for(a in i){GSe.call(o,a)||(o[a]=[]);let s=i[a];H0t(o[a],Array.isArray(s)?s:s?[s]:[])}}}function H0t(e,t){let r=-1,n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Fl(e,0,0,n)}var GSe,BX=M(()=>{hb();GSe={}.hasOwnProperty});function YF(e,t){let r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}var RX=M(()=>{});function hd(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var iA=M(()=>{});function X2(e){return e!==null&&(e<32||e===127)}function Dr(e){return e!==null&&e<-2}function Ho(e){return e!==null&&(e<0||e===32)}function Mn(e){return e===-2||e===-1||e===32}function Ix(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}var kc,fl,HSe,vk,WSe,KSe,Z2,X0,_i=M(()=>{kc=Ix(/[A-Za-z]/),fl=Ix(/[\dA-Za-z]/),HSe=Ix(/[#-'*+\--9=?A-Z^-~]/);vk=Ix(/\d/),WSe=Ix(/[\dA-Fa-f]/),KSe=Ix(/[!-/:-@[-`{-~]/);Z2=Ix(/\p{P}|\p{S}/u),X0=Ix(/\s/)});function zp(e){let t=[],r=-1,n=0,o=0;for(;++r<e.length;){let i=e.charCodeAt(r),a="";if(i===37&&fl(e.charCodeAt(r+1))&&fl(e.charCodeAt(r+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(a=String.fromCharCode(i));else if(i>55295&&i<57344){let s=e.charCodeAt(r+1);i<56320&&s>56319&&s<57344?(a=String.fromCharCode(i,s),o=1):a="\uFFFD"}else a=String.fromCharCode(i);a&&(t.push(e.slice(n,r),encodeURIComponent(a)),n=r+o+1,a=""),o&&(r+=o,o=0)}return t.join("")+e.slice(n)}var $2=M(()=>{_i()});function In(e,t,r,n){let o=n?n-1:Number.POSITIVE_INFINITY,i=0;return a;function a(l){return Mn(l)?(e.enter(r),s(l)):t(l)}function s(l){return Mn(l)&&i++<o?(e.consume(l),s):(e.exit(r),t(l))}}var Nl=M(()=>{_i()});function W0t(e){let t=e.attempt(this.parser.constructs.contentInitial,n,o),r;return t;function n(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),In(e,t,"linePrefix")}function o(s){return e.enter("paragraph"),i(s)}function i(s){let l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,a(s)}function a(s){if(s===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(s);return}return Dr(s)?(e.consume(s),e.exit("chunkText"),i):(e.consume(s),a)}}var YSe,XSe=M(()=>{Nl();_i();YSe={tokenize:W0t}});function K0t(e){let t=this,r=[],n=0,o,i,a;return s;function s(x){if(n<r.length){let C=r[n];return t.containerState=C[1],e.attempt(C[0].continuation,l,c)(x)}return c(x)}function l(x){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&b();let C=t.events.length,S=C,w;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){w=t.events[S][1].end;break}y(n);let A=C;for(;A<t.events.length;)t.events[A][1].end={...w},A++;return Fl(t.events,S+1,0,t.events.slice(C)),t.events.length=A,c(x)}return s(x)}function c(x){if(n===r.length){if(!o)return f(x);if(o.currentConstruct&&o.currentConstruct.concrete)return p(x);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ZSe,u,d)(x)}function u(x){return o&&b(),y(n),f(x)}function d(x){return t.parser.lazy[t.now().line]=n!==r.length,a=t.now().offset,p(x)}function f(x){return t.containerState={},e.attempt(ZSe,m,p)(x)}function m(x){return n++,r.push([t.currentConstruct,t.containerState]),f(x)}function p(x){if(x===null){o&&b(),y(0),e.consume(x);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),h(x)}function h(x){if(x===null){g(e.exit("chunkFlow"),!0),y(0),e.consume(x);return}return Dr(x)?(e.consume(x),g(e.exit("chunkFlow")),n=0,t.interrupt=void 0,s):(e.consume(x),h)}function g(x,C){let S=t.sliceStream(x);if(C&&S.push(null),x.previous=i,i&&(i.next=x),i=x,o.defineSkip(x.start),o.write(S),t.parser.lazy[x.start.line]){let w=o.events.length;for(;w--;)if(o.events[w][1].start.offset<a&&(!o.events[w][1].end||o.events[w][1].end.offset>a))return;let A=t.events.length,T=A,D,E;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(D){E=t.events[T][1].end;break}D=!0}for(y(n),w=A;w<t.events.length;)t.events[w][1].end={...E},w++;Fl(t.events,T+1,0,t.events.slice(A)),t.events.length=w}}function y(x){let C=r.length;for(;C-- >x;){let S=r[C];t.containerState=S[1],S[0].exit.call(t,e)}r.length=x}function b(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Y0t(e,t,r){return In(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var $Se,ZSe,QSe=M(()=>{Nl();_i();hb();$Se={tokenize:K0t},ZSe={tokenize:Y0t}});function gb(e){if(e===null||Ho(e)||X0(e))return 1;if(Z2(e))return 2}var XF=M(()=>{_i()});function Ex(e,t,r){let n=[],o=-1;for(;++o<e.length;){let i=e[o].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}var bk=M(()=>{});function X0t(e,t){let r=-1,n,o,i,a,s,l,c,u;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;let d={...e[n][1].end},f={...e[r][1].start};JSe(d,-l),JSe(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[n][1].end}},s={type:l>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:f},i={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},o={type:l>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[n][1].end={...a.start},e[r][1].start={...s.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=af(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=af(c,[["enter",o,t],["enter",a,t],["exit",a,t],["enter",i,t]]),c=af(c,Ex(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=af(c,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",o,t]]),e[r][1].end.offset-e[r][1].start.offset?(u=2,c=af(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):u=0,Fl(e,n-1,r-n+3,c),r=n+c.length-u-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function Z0t(e,t){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,o=gb(n),i;return a;function a(l){return i=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===i)return e.consume(l),s;let c=e.exit("attentionSequence"),u=gb(l),d=!u||u===2&&o||r.includes(l),f=!o||o===2&&u||r.includes(n);return c._open=!!(i===42?d:d&&(o||!f)),c._close=!!(i===42?f:f&&(u||!d)),t(l)}}function JSe(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var xk,e_e=M(()=>{hb();XF();bk();xk={name:"attention",resolveAll:X0t,tokenize:Z0t}});function $0t(e,t,r){let n=0;return o;function o(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return kc(m)?(e.consume(m),a):m===64?r(m):c(m)}function a(m){return m===43||m===45||m===46||fl(m)?(n=1,s(m)):c(m)}function s(m){return m===58?(e.consume(m),n=0,l):(m===43||m===45||m===46||fl(m))&&n++<32?(e.consume(m),s):(n=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||X2(m)?r(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),u):HSe(m)?(e.consume(m),c):r(m)}function u(m){return fl(m)?d(m):r(m)}function d(m){return m===46?(e.consume(m),n=0,u):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||fl(m))&&n++<63){let p=m===45?f:d;return e.consume(m),p}return r(m)}}var OX,t_e=M(()=>{_i();OX={name:"autolink",tokenize:$0t}});function Q0t(e,t,r){return n;function n(i){return Mn(i)?In(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Dr(i)?t(i):r(i)}}var Z0,ZF=M(()=>{Nl();_i();Z0={partial:!0,tokenize:Q0t}});function J0t(e,t,r){let n=this;return o;function o(a){if(a===62){let s=n.containerState;return s.open||(e.enter("blockQuote",{_container:!0}),s.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),i}return r(a)}function i(a){return Mn(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function eyt(e,t,r){let n=this;return o;function o(a){return Mn(a)?In(e,i,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):i(a)}function i(a){return e.attempt($F,t,r)(a)}}function tyt(e){e.exit("blockQuote")}var $F,r_e=M(()=>{Nl();_i();$F={continuation:{tokenize:eyt},exit:tyt,name:"blockQuote",tokenize:J0t}});function ryt(e,t,r){return n;function n(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return KSe(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}var QF,n_e=M(()=>{_i();QF={name:"characterEscape",tokenize:ryt}});function nyt(e,t,r){let n=this,o=0,i,a;return s;function s(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,a=fl,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,a=WSe,u):(e.enter("characterReferenceValue"),i=7,a=vk,u(d))}function u(d){if(d===59&&o){let f=e.exit("characterReferenceValue");return a===fl&&!oA(n.sliceSerialize(f))?r(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&o++<i?(e.consume(d),u):r(d)}}var JF,o_e=M(()=>{WF();_i();JF={name:"characterReference",tokenize:nyt}});function oyt(e,t,r){let n=this,o={partial:!0,tokenize:S},i=0,a=0,s;return l;function l(w){return c(w)}function c(w){let A=n.events[n.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,s=w,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(w)}function u(w){return w===s?(a++,e.consume(w),u):a<3?r(w):(e.exit("codeFencedFenceSequence"),Mn(w)?In(e,d,"whitespace")(w):d(w))}function d(w){return w===null||Dr(w)?(e.exit("codeFencedFence"),n.interrupt?t(w):e.check(i_e,h,C)(w)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(w))}function f(w){return w===null||Dr(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(w)):Mn(w)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),In(e,m,"whitespace")(w)):w===96&&w===s?r(w):(e.consume(w),f)}function m(w){return w===null||Dr(w)?d(w):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===null||Dr(w)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(w)):w===96&&w===s?r(w):(e.consume(w),p)}function h(w){return e.attempt(o,C,g)(w)}function g(w){return e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),y}function y(w){return i>0&&Mn(w)?In(e,b,"linePrefix",i+1)(w):b(w)}function b(w){return w===null||Dr(w)?e.check(i_e,h,C)(w):(e.enter("codeFlowValue"),x(w))}function x(w){return w===null||Dr(w)?(e.exit("codeFlowValue"),b(w)):(e.consume(w),x)}function C(w){return e.exit("codeFenced"),t(w)}function S(w,A,T){let D=0;return E;function E(O){return w.enter("lineEnding"),w.consume(O),w.exit("lineEnding"),I}function I(O){return w.enter("codeFencedFence"),Mn(O)?In(w,k,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):k(O)}function k(O){return O===s?(w.enter("codeFencedFenceSequence"),R(O)):T(O)}function R(O){return O===s?(D++,w.consume(O),R):D>=a?(w.exit("codeFencedFenceSequence"),Mn(O)?In(w,B,"whitespace")(O):B(O)):T(O)}function B(O){return O===null||Dr(O)?(w.exit("codeFencedFence"),A(O)):T(O)}}}function iyt(e,t,r){let n=this;return o;function o(a){return a===null?r(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i)}function i(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}var i_e,e5,a_e=M(()=>{Nl();_i();i_e={partial:!0,tokenize:iyt},e5={concrete:!0,name:"codeFenced",tokenize:oyt}});function syt(e,t,r){let n=this;return o;function o(c){return e.enter("codeIndented"),In(e,i,"linePrefix",5)(c)}function i(c){let u=n.events[n.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?a(c):r(c)}function a(c){return c===null?l(c):Dr(c)?e.attempt(ayt,a,l)(c):(e.enter("codeFlowValue"),s(c))}function s(c){return c===null||Dr(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),s)}function l(c){return e.exit("codeIndented"),t(c)}}function lyt(e,t,r){let n=this;return o;function o(a){return n.parser.lazy[n.now().line]?r(a):Dr(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):In(e,i,"linePrefix",5)(a)}function i(a){let s=n.events[n.events.length-1];return s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):Dr(a)?o(a):r(a)}}var Sk,ayt,s_e=M(()=>{Nl();_i();Sk={name:"codeIndented",tokenize:syt},ayt={partial:!0,tokenize:lyt}});function cyt(e){let t=e.length-4,r=3,n,o;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)o===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(o=n):(n===t||e[n][1].type==="lineEnding")&&(e[o][1].type="codeTextData",n!==o+2&&(e[o][1].end=e[n-1][1].end,e.splice(o+2,n-o-2),t-=n-o-2,n=o+2),o=void 0);return e}function uyt(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function dyt(e,t,r){let n=this,o=0,i,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),l(f)}function l(f){return f===96?(e.consume(f),o++,l):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?r(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(a=e.enter("codeTextSequence"),i=0,d(f)):Dr(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),u(f))}function u(f){return f===null||f===32||f===96||Dr(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),u)}function d(f){return f===96?(e.consume(f),i++,d):i===o?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",u(f))}}var LX,l_e=M(()=>{_i();LX={name:"codeText",previous:uyt,resolve:cyt,tokenize:dyt}});function _k(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}var t5,c_e=M(()=>{t5=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){let n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){let o=r||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return n&&_k(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),_k(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),_k(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let r=this.left.splice(t,Number.POSITIVE_INFINITY);_k(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);_k(this.left,r.reverse())}}}});function r5(e){let t={},r=-1,n,o,i,a,s,l,c,u=new t5(e);for(;++r<u.length;){for(;r in t;)r=t[r];if(n=u.get(r),r&&n[1].type==="chunkFlow"&&u.get(r-1)[1].type==="listItemPrefix"&&(l=n[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,fyt(u,r)),r=t[r],c=!0);else if(n[1]._container){for(i=r,o=void 0;i--;)if(a=u.get(i),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),a[1].type="lineEnding",o=i);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;o&&(n[1].end={...u.get(o)[1].start},s=u.slice(o,r),s.unshift(n),u.splice(o,r-o+1,s))}}return Fl(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function fyt(e,t){let r=e.get(t)[1],n=e.get(t)[2],o=t-1,i=[],a=r._tokenizer;a||(a=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));let s=a.events,l=[],c={},u,d,f=-1,m=r,p=0,h=0,g=[h];for(;m;){for(;e.get(++o)[1]!==m;);i.push(o),m._tokenizer||(u=n.sliceStream(m),m.next||u.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(u),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=r;++f<s.length;)s[f][0]==="exit"&&s[f-1][0]==="enter"&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):g.pop(),f=g.length;f--;){let y=s.slice(g[f],g[f+1]),b=i.pop();l.push([b,b+y.length-1]),e.splice(b,2,y)}for(l.reverse(),f=-1;++f<l.length;)c[p+l[f][0]]=p+l[f][1],p+=l[f][1]-l[f][0]-1;return c}var FX=M(()=>{hb();c_e()});function pyt(e){return r5(e),e}function hyt(e,t){let r;return n;function n(s){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),o(s)}function o(s){return s===null?i(s):Dr(s)?e.check(myt,a,i)(s):(e.consume(s),o)}function i(s){return e.exit("chunkContent"),e.exit("content"),t(s)}function a(s){return e.consume(s),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,o}}function gyt(e,t,r){let n=this;return o;function o(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),In(e,i,"linePrefix")}function i(a){if(a===null||Dr(a))return r(a);let s=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&s&&s[1].type==="linePrefix"&&s[2].sliceSerialize(s[1],!0).length>=4?t(a):e.interrupt(n.parser.constructs.flow,r,t)(a)}}var NX,myt,u_e=M(()=>{Nl();_i();FX();NX={resolve:pyt,tokenize:hyt},myt={partial:!0,tokenize:gyt}});function n5(e,t,r,n,o,i,a,s,l){let c=l||Number.POSITIVE_INFINITY,u=0;return d;function d(y){return y===60?(e.enter(n),e.enter(o),e.enter(i),e.consume(y),e.exit(i),f):y===null||y===32||y===41||X2(y)?r(y):(e.enter(n),e.enter(a),e.enter(s),e.enter("chunkString",{contentType:"string"}),h(y))}function f(y){return y===62?(e.enter(i),e.consume(y),e.exit(i),e.exit(o),e.exit(n),t):(e.enter(s),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(s),f(y)):y===null||y===60||Dr(y)?r(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function h(y){return!u&&(y===null||y===41||Ho(y))?(e.exit("chunkString"),e.exit(s),e.exit(a),e.exit(n),t(y)):u<c&&y===40?(e.consume(y),u++,h):y===41?(e.consume(y),u--,h):y===null||y===32||y===40||X2(y)?r(y):(e.consume(y),y===92?g:h)}function g(y){return y===40||y===41||y===92?(e.consume(y),h):h(y)}}var UX=M(()=>{_i()});function o5(e,t,r,n,o,i){let a=this,s=0,l;return c;function c(m){return e.enter(n),e.enter(o),e.consume(m),e.exit(o),e.enter(i),u}function u(m){return s>999||m===null||m===91||m===93&&!l||m===94&&!s&&"_hiddenFootnoteSupport"in a.parser.constructs?r(m):m===93?(e.exit(i),e.enter(o),e.consume(m),e.exit(o),e.exit(n),t):Dr(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||Dr(m)||s++>999?(e.exit("chunkString"),u(m)):(e.consume(m),l||(l=!Mn(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),s++,d):d(m)}}var VX=M(()=>{_i()});function i5(e,t,r,n,o,i){let a;return s;function s(f){return f===34||f===39||f===40?(e.enter(n),e.enter(o),e.consume(f),e.exit(o),a=f===40?41:f,l):r(f)}function l(f){return f===a?(e.enter(o),e.consume(f),e.exit(o),e.exit(n),t):(e.enter(i),c(f))}function c(f){return f===a?(e.exit(i),l(a)):f===null?r(f):Dr(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),In(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===a||f===null||Dr(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===a||f===92?(e.consume(f),u):u(f)}}var zX=M(()=>{Nl();_i()});function Q2(e,t){let r;return n;function n(o){return Dr(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),r=!0,n):Mn(o)?In(e,n,r?"linePrefix":"lineSuffix")(o):t(o)}}var qX=M(()=>{Nl();_i()});function vyt(e,t,r){let n=this,o;return i;function i(m){return e.enter("definition"),a(m)}function a(m){return o5.call(n,e,s,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function s(m){return o=hd(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):r(m)}function l(m){return Ho(m)?Q2(e,c)(m):c(m)}function c(m){return n5(e,u,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function u(m){return e.attempt(yyt,d,d)(m)}function d(m){return Mn(m)?In(e,f,"whitespace")(m):f(m)}function f(m){return m===null||Dr(m)?(e.exit("definition"),n.parser.defined.push(o),t(m)):r(m)}}function byt(e,t,r){return n;function n(s){return Ho(s)?Q2(e,o)(s):r(s)}function o(s){return i5(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(s)}function i(s){return Mn(s)?In(e,a,"whitespace")(s):a(s)}function a(s){return s===null||Dr(s)?t(s):r(s)}}var jX,yyt,d_e=M(()=>{UX();VX();Nl();zX();qX();_i();iA();jX={name:"definition",tokenize:vyt},yyt={partial:!0,tokenize:byt}});function xyt(e,t,r){return n;function n(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Dr(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}var GX,f_e=M(()=>{_i();GX={name:"hardBreakEscape",tokenize:xyt}});function Syt(e,t){let r=e.length-2,n=3,o,i;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(o={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},i={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Fl(e,n,r-n+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function _yt(e,t,r){let n=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),a(u)}function a(u){return u===35&&n++<6?(e.consume(u),a):u===null||Ho(u)?(e.exit("atxHeadingSequence"),s(u)):r(u)}function s(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Dr(u)?(e.exit("atxHeading"),t(u)):Mn(u)?In(e,s,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),s(u))}function c(u){return u===null||u===35||Ho(u)?(e.exit("atxHeadingText"),s(u)):(e.consume(u),c)}}var HX,m_e=M(()=>{Nl();_i();hb();HX={name:"headingAtx",resolve:Syt,tokenize:_yt}});var p_e,WX,h_e=M(()=>{p_e=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],WX=["pre","script","style","textarea"]});function Tyt(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ayt(e,t,r){let n=this,o,i,a,s,l;return c;function c(z){return u(z)}function u(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),d}function d(z){return z===33?(e.consume(z),f):z===47?(e.consume(z),i=!0,h):z===63?(e.consume(z),o=3,n.interrupt?t:L):kc(z)?(e.consume(z),a=String.fromCharCode(z),g):r(z)}function f(z){return z===45?(e.consume(z),o=2,m):z===91?(e.consume(z),o=5,s=0,p):kc(z)?(e.consume(z),o=4,n.interrupt?t:L):r(z)}function m(z){return z===45?(e.consume(z),n.interrupt?t:L):r(z)}function p(z){let ie="CDATA[";return z===ie.charCodeAt(s++)?(e.consume(z),s===ie.length?n.interrupt?t:k:p):r(z)}function h(z){return kc(z)?(e.consume(z),a=String.fromCharCode(z),g):r(z)}function g(z){if(z===null||z===47||z===62||Ho(z)){let ie=z===47,oe=a.toLowerCase();return!ie&&!i&&WX.includes(oe)?(o=1,n.interrupt?t(z):k(z)):p_e.includes(a.toLowerCase())?(o=6,ie?(e.consume(z),y):n.interrupt?t(z):k(z)):(o=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(z):i?b(z):x(z))}return z===45||fl(z)?(e.consume(z),a+=String.fromCharCode(z),g):r(z)}function y(z){return z===62?(e.consume(z),n.interrupt?t:k):r(z)}function b(z){return Mn(z)?(e.consume(z),b):E(z)}function x(z){return z===47?(e.consume(z),E):z===58||z===95||kc(z)?(e.consume(z),C):Mn(z)?(e.consume(z),x):E(z)}function C(z){return z===45||z===46||z===58||z===95||fl(z)?(e.consume(z),C):S(z)}function S(z){return z===61?(e.consume(z),w):Mn(z)?(e.consume(z),S):x(z)}function w(z){return z===null||z===60||z===61||z===62||z===96?r(z):z===34||z===39?(e.consume(z),l=z,A):Mn(z)?(e.consume(z),w):T(z)}function A(z){return z===l?(e.consume(z),l=null,D):z===null||Dr(z)?r(z):(e.consume(z),A)}function T(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Ho(z)?S(z):(e.consume(z),T)}function D(z){return z===47||z===62||Mn(z)?x(z):r(z)}function E(z){return z===62?(e.consume(z),I):r(z)}function I(z){return z===null||Dr(z)?k(z):Mn(z)?(e.consume(z),I):r(z)}function k(z){return z===45&&o===2?(e.consume(z),F):z===60&&o===1?(e.consume(z),q):z===62&&o===4?(e.consume(z),V):z===63&&o===3?(e.consume(z),L):z===93&&o===5?(e.consume(z),j):Dr(z)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Cyt,U,R)(z)):z===null||Dr(z)?(e.exit("htmlFlowData"),R(z)):(e.consume(z),k)}function R(z){return e.check(wyt,B,U)(z)}function B(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),O}function O(z){return z===null||Dr(z)?R(z):(e.enter("htmlFlowData"),k(z))}function F(z){return z===45?(e.consume(z),L):k(z)}function q(z){return z===47?(e.consume(z),a="",W):k(z)}function W(z){if(z===62){let ie=a.toLowerCase();return WX.includes(ie)?(e.consume(z),V):k(z)}return kc(z)&&a.length<8?(e.consume(z),a+=String.fromCharCode(z),W):k(z)}function j(z){return z===93?(e.consume(z),L):k(z)}function L(z){return z===62?(e.consume(z),V):z===45&&o===2?(e.consume(z),L):k(z)}function V(z){return z===null||Dr(z)?(e.exit("htmlFlowData"),U(z)):(e.consume(z),V)}function U(z){return e.exit("htmlFlow"),t(z)}}function Pyt(e,t,r){let n=this;return o;function o(a){return Dr(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):r(a)}function i(a){return n.parser.lazy[n.now().line]?r(a):t(a)}}function Iyt(e,t,r){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Z0,t,r)}}var KX,Cyt,wyt,g_e=M(()=>{_i();h_e();ZF();KX={concrete:!0,name:"htmlFlow",resolveTo:Tyt,tokenize:Ayt},Cyt={partial:!0,tokenize:Iyt},wyt={partial:!0,tokenize:Pyt}});function Eyt(e,t,r){let n=this,o,i,a;return s;function s(L){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(L),l}function l(L){return L===33?(e.consume(L),c):L===47?(e.consume(L),S):L===63?(e.consume(L),x):kc(L)?(e.consume(L),T):r(L)}function c(L){return L===45?(e.consume(L),u):L===91?(e.consume(L),i=0,p):kc(L)?(e.consume(L),b):r(L)}function u(L){return L===45?(e.consume(L),m):r(L)}function d(L){return L===null?r(L):L===45?(e.consume(L),f):Dr(L)?(a=d,q(L)):(e.consume(L),d)}function f(L){return L===45?(e.consume(L),m):d(L)}function m(L){return L===62?F(L):L===45?f(L):d(L)}function p(L){let V="CDATA[";return L===V.charCodeAt(i++)?(e.consume(L),i===V.length?h:p):r(L)}function h(L){return L===null?r(L):L===93?(e.consume(L),g):Dr(L)?(a=h,q(L)):(e.consume(L),h)}function g(L){return L===93?(e.consume(L),y):h(L)}function y(L){return L===62?F(L):L===93?(e.consume(L),y):h(L)}function b(L){return L===null||L===62?F(L):Dr(L)?(a=b,q(L)):(e.consume(L),b)}function x(L){return L===null?r(L):L===63?(e.consume(L),C):Dr(L)?(a=x,q(L)):(e.consume(L),x)}function C(L){return L===62?F(L):x(L)}function S(L){return kc(L)?(e.consume(L),w):r(L)}function w(L){return L===45||fl(L)?(e.consume(L),w):A(L)}function A(L){return Dr(L)?(a=A,q(L)):Mn(L)?(e.consume(L),A):F(L)}function T(L){return L===45||fl(L)?(e.consume(L),T):L===47||L===62||Ho(L)?D(L):r(L)}function D(L){return L===47?(e.consume(L),F):L===58||L===95||kc(L)?(e.consume(L),E):Dr(L)?(a=D,q(L)):Mn(L)?(e.consume(L),D):F(L)}function E(L){return L===45||L===46||L===58||L===95||fl(L)?(e.consume(L),E):I(L)}function I(L){return L===61?(e.consume(L),k):Dr(L)?(a=I,q(L)):Mn(L)?(e.consume(L),I):D(L)}function k(L){return L===null||L===60||L===61||L===62||L===96?r(L):L===34||L===39?(e.consume(L),o=L,R):Dr(L)?(a=k,q(L)):Mn(L)?(e.consume(L),k):(e.consume(L),B)}function R(L){return L===o?(e.consume(L),o=void 0,O):L===null?r(L):Dr(L)?(a=R,q(L)):(e.consume(L),R)}function B(L){return L===null||L===34||L===39||L===60||L===61||L===96?r(L):L===47||L===62||Ho(L)?D(L):(e.consume(L),B)}function O(L){return L===47||L===62||Ho(L)?D(L):r(L)}function F(L){return L===62?(e.consume(L),e.exit("htmlTextData"),e.exit("htmlText"),t):r(L)}function q(L){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),W}function W(L){return Mn(L)?In(e,j,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):j(L)}function j(L){return e.enter("htmlTextData"),a(L)}}var YX,y_e=M(()=>{Nl();_i();YX={name:"htmlText",tokenize:Eyt}});function Byt(e){let t=-1,r=[];for(;++t<e.length;){let n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let o=n.type==="labelImage"?4:2;n.type="data",t+=o}}return e.length!==r.length&&Fl(e,0,e.length,r),e}function Ryt(e,t){let r=e.length,n=0,o,i,a,s;for(;r--;)if(o=e[r][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[r][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(a){if(e[r][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=r,o.type!=="labelLink")){n=2;break}}else o.type==="labelEnd"&&(a=r);let l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[a][1].end}},u={type:"labelText",start:{...e[i+n+2][1].end},end:{...e[a-2][1].start}};return s=[["enter",l,t],["enter",c,t]],s=af(s,e.slice(i+1,i+n+3)),s=af(s,[["enter",u,t]]),s=af(s,Ex(t.parser.constructs.insideSpan.null,e.slice(i+n+4,a-3),t)),s=af(s,[["exit",u,t],e[a-2],e[a-1],["exit",c,t]]),s=af(s,e.slice(a+1)),s=af(s,[["exit",l,t]]),Fl(e,i,e.length,s),e}function Oyt(e,t,r){let n=this,o=n.events.length,i,a;for(;o--;)if((n.events[o][1].type==="labelImage"||n.events[o][1].type==="labelLink")&&!n.events[o][1]._balanced){i=n.events[o][1];break}return s;function s(f){return i?i._inactive?d(f):(a=n.parser.defined.includes(hd(n.sliceSerialize({start:i.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):r(f)}function l(f){return f===40?e.attempt(Dyt,u,a?u:d)(f):f===91?e.attempt(kyt,u,a?c:d)(f):a?u(f):d(f)}function c(f){return e.attempt(Myt,u,d)(f)}function u(f){return t(f)}function d(f){return i._balanced=!0,r(f)}}function Lyt(e,t,r){return n;function n(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return Ho(d)?Q2(e,i)(d):i(d)}function i(d){return d===41?u(d):n5(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Ho(d)?Q2(e,l)(d):u(d)}function s(d){return r(d)}function l(d){return d===34||d===39||d===40?i5(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ho(d)?Q2(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):r(d)}}function Fyt(e,t,r){let n=this;return o;function o(s){return o5.call(n,e,i,a,"reference","referenceMarker","referenceString")(s)}function i(s){return n.parser.defined.includes(hd(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(s):r(s)}function a(s){return r(s)}}function Nyt(e,t,r){return n;function n(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}var J2,Dyt,kyt,Myt,a5=M(()=>{UX();VX();zX();qX();_i();hb();iA();bk();J2={name:"labelEnd",resolveAll:Byt,resolveTo:Ryt,tokenize:Oyt},Dyt={tokenize:Lyt},kyt={tokenize:Fyt},Myt={tokenize:Nyt}});function Uyt(e,t,r){let n=this;return o;function o(s){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(s),e.exit("labelImageMarker"),i}function i(s){return s===91?(e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelImage"),a):r(s)}function a(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}var XX,v_e=M(()=>{a5();XX={name:"labelStartImage",resolveAll:J2.resolveAll,tokenize:Uyt}});function Vyt(e,t,r){let n=this;return o;function o(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),i}function i(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):t(a)}}var ZX,b_e=M(()=>{a5();ZX={name:"labelStartLink",resolveAll:J2.resolveAll,tokenize:Vyt}});function zyt(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),In(e,t,"linePrefix")}}var Ck,x_e=M(()=>{Nl();Ck={name:"lineEnding",tokenize:zyt}});function qyt(e,t,r){let n=0,o;return i;function i(c){return e.enter("thematicBreak"),a(c)}function a(c){return o=c,s(c)}function s(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||Dr(c))?(e.exit("thematicBreak"),t(c)):r(c)}function l(c){return c===o?(e.consume(c),n++,l):(e.exit("thematicBreakSequence"),Mn(c)?In(e,s,"whitespace")(c):s(c))}}var eC,$X=M(()=>{Nl();_i();eC={name:"thematicBreak",tokenize:qyt}});function Hyt(e,t,r){let n=this,o=n.events[n.events.length-1],i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,a=0;return s;function s(m){let p=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:vk(m)){if(n.containerState.type||(n.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(eC,r,c)(m):c(m);if(!n.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return r(m)}function l(m){return vk(m)&&++a<10?(e.consume(m),l):(!n.interrupt||a<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):r(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,e.check(Z0,n.interrupt?r:u,e.attempt(jyt,f,d))}function u(m){return n.containerState.initialBlankLine=!0,i++,f(m)}function d(m){return Mn(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):r(m)}function f(m){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Wyt(e,t,r){let n=this;return n.containerState._closeFlow=void 0,e.check(Z0,o,i);function o(s){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,In(e,t,"listItemIndent",n.containerState.size+1)(s)}function i(s){return n.containerState.furtherBlankLines||!Mn(s)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,a(s)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(Gyt,t,a)(s))}function a(s){return n.containerState._closeFlow=!0,n.interrupt=void 0,In(e,e.attempt(gd,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s)}}function Kyt(e,t,r){let n=this;return In(e,o,"listItemIndent",n.containerState.size+1);function o(i){let a=n.events[n.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===n.containerState.size?t(i):r(i)}}function Yyt(e){e.exit(this.containerState.type)}function Xyt(e,t,r){let n=this;return In(e,o,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){let a=n.events[n.events.length-1];return!Mn(i)&&a&&a[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}var gd,jyt,Gyt,S_e=M(()=>{Nl();_i();ZF();$X();gd={continuation:{tokenize:Wyt},exit:Yyt,name:"list",tokenize:Hyt},jyt={partial:!0,tokenize:Xyt},Gyt={partial:!0,tokenize:Kyt}});function Zyt(e,t){let r=e.length,n,o,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(o=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);let a={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",a,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=a,e.push(["exit",a,t]),e}function $yt(e,t,r){let n=this,o;return i;function i(c){let u=n.events.length,d;for(;u--;)if(n.events[u][1].type!=="lineEnding"&&n.events[u][1].type!=="linePrefix"&&n.events[u][1].type!=="content"){d=n.events[u][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||d)?(e.enter("setextHeadingLine"),o=c,a(c)):r(c)}function a(c){return e.enter("setextHeadingLineSequence"),s(c)}function s(c){return c===o?(e.consume(c),s):(e.exit("setextHeadingLineSequence"),Mn(c)?In(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Dr(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}var s5,__e=M(()=>{Nl();_i();s5={name:"setextUnderline",resolveTo:Zyt,tokenize:$yt}});var l5=M(()=>{e_e();t_e();ZF();r_e();n_e();o_e();a_e();s_e();l_e();u_e();d_e();f_e();m_e();g_e();y_e();a5();v_e();b_e();x_e();S_e();__e();$X()});function Qyt(e){let t=this,r=e.attempt(Z0,n,e.attempt(this.parser.constructs.flowInitial,o,In(e,e.attempt(this.parser.constructs.flow,o,e.attempt(NX,o)),"linePrefix")));return r;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}var C_e,w_e=M(()=>{l5();Nl();C_e={tokenize:Qyt}});function I_e(e){return{resolveAll:E_e(e==="text"?Jyt:void 0),tokenize:t};function t(r){let n=this,o=this.parser.constructs[e],i=r.attempt(o,a,s);return a;function a(u){return c(u)?i(u):s(u)}function s(u){if(u===null){r.consume(u);return}return r.enter("data"),r.consume(u),l}function l(u){return c(u)?(r.exit("data"),i(u)):(r.consume(u),l)}function c(u){if(u===null)return!0;let d=o[u],f=-1;if(d)for(;++f<d.length;){let m=d[f];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function E_e(e){return t;function t(r,n){let o=-1,i;for(;++o<=r.length;)i===void 0?r[o]&&r[o][1].type==="data"&&(i=o,o++):(!r[o]||r[o][1].type!=="data")&&(o!==i+2&&(r[i][1].end=r[o-1][1].end,r.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(r,n):r}}function Jyt(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){let n=e[r-1][1],o=t.sliceStream(n),i=o.length,a=-1,s=0,l;for(;i--;){let c=o[i];if(typeof c=="string"){for(a=c.length;c.charCodeAt(a-1)===32;)s++,a--;if(a)break;a=-1}else if(c===-2)l=!0,s++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(s=0),s){let c={type:r===e.length||l||s<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?a:n.start._bufferIndex+a,_index:n.start._index+i,line:n.end.line,column:n.end.column-s,offset:n.end.offset-s},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}var T_e,A_e,P_e,QX=M(()=>{T_e={resolveAll:E_e()},A_e=I_e("string"),P_e=I_e("text")});var JX={};ci(JX,{attentionMarkers:()=>svt,contentInitial:()=>tvt,disable:()=>lvt,document:()=>evt,flow:()=>nvt,flowInitial:()=>rvt,insideSpan:()=>avt,string:()=>ovt,text:()=>ivt});var evt,tvt,rvt,nvt,ovt,ivt,avt,svt,lvt,D_e=M(()=>{l5();QX();evt={42:gd,43:gd,45:gd,48:gd,49:gd,50:gd,51:gd,52:gd,53:gd,54:gd,55:gd,56:gd,57:gd,62:$F},tvt={91:jX},rvt={[-2]:Sk,[-1]:Sk,32:Sk},nvt={35:HX,42:eC,45:[s5,eC],60:KX,61:s5,95:eC,96:e5,126:e5},ovt={38:JF,92:QF},ivt={[-5]:Ck,[-4]:Ck,[-3]:Ck,33:XX,38:JF,42:xk,60:[OX,YX],91:ZX,92:[GX,QF],93:J2,95:xk,96:LX},avt={null:[xk,T_e]},svt={null:[42,95]},lvt={null:[]}});function k_e(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},o={},i=[],a=[],s=[],l=!0,c={attempt:D(A),check:D(T),consume:C,enter:S,exit:w,interrupt:D(T,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:m},d=t.tokenize.call(u,c),f;return t.resolveAll&&i.push(t),u;function m(R){return a=af(a,R),b(),a[a.length-1]!==null?[]:(E(t,0),u.events=Ex(i,u.events,u),u.events)}function p(R,B){return uvt(h(R),B)}function h(R){return cvt(a,R)}function g(){let{_bufferIndex:R,_index:B,line:O,column:F,offset:q}=n;return{_bufferIndex:R,_index:B,line:O,column:F,offset:q}}function y(R){o[R.line]=R.column,k()}function b(){let R;for(;n._index<a.length;){let B=a[n._index];if(typeof B=="string")for(R=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===R&&n._bufferIndex<B.length;)x(B.charCodeAt(n._bufferIndex));else x(B)}}function x(R){l=void 0,f=R,d=d(R)}function C(R){Dr(R)?(n.line++,n.column=1,n.offset+=R===-3?2:1,k()):R!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===a[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=R,l=!0}function S(R,B){let O=B||{};return O.type=R,O.start=g(),u.events.push(["enter",O,u]),s.push(O),O}function w(R){let B=s.pop();return B.end=g(),u.events.push(["exit",B,u]),B}function A(R,B){E(R,B.from)}function T(R,B){B.restore()}function D(R,B){return O;function O(F,q,W){let j,L,V,U;return Array.isArray(F)?ie(F):"tokenize"in F?ie([F]):z(F);function z(ne){return K;function K($){let Z=$!==null&&ne[$],de=$!==null&&ne.null,Q=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(de)?de:de?[de]:[]];return ie(Q)($)}}function ie(ne){return j=ne,L=0,ne.length===0?W:oe(ne[L])}function oe(ne){return K;function K($){return U=I(),V=ne,ne.partial||(u.currentConstruct=ne),ne.name&&u.parser.constructs.disable.null.includes(ne.name)?Y($):ne.tokenize.call(B?Object.assign(Object.create(u),B):u,c,X,Y)($)}}function X(ne){return l=!0,R(V,U),q}function Y(ne){return l=!0,U.restore(),++L<j.length?oe(j[L]):W}}}function E(R,B){R.resolveAll&&!i.includes(R)&&i.push(R),R.resolve&&Fl(u.events,B,u.events.length-B,R.resolve(u.events.slice(B),u)),R.resolveTo&&(u.events=R.resolveTo(u.events,u))}function I(){let R=g(),B=u.previous,O=u.currentConstruct,F=u.events.length,q=Array.from(s);return{from:F,restore:W};function W(){n=R,u.previous=B,u.currentConstruct=O,u.events.length=F,s=q,k()}}function k(){n.line in o&&n.column<2&&(n.column=o[n.line],n.offset+=o[n.line]-1)}}function cvt(e,t){let r=t.start._index,n=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex,a;if(r===o)a=[e[r].slice(n,i)];else{if(a=e.slice(r,o),n>-1){let s=a[0];typeof s=="string"?a[0]=s.slice(n):a.shift()}i>0&&a.push(e[o].slice(0,i))}return a}function uvt(e,t){let r=-1,n=[],o;for(;++r<e.length;){let i=e[r],a;if(typeof i=="string")a=i;else switch(i){case-5:{a="\r";break}case-4:{a=`
|
|
21
21
|
`;break}case-3:{a=`\r
|
|
22
22
|
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&o)continue;a=" ";break}default:a=String.fromCharCode(i)}o=i===-2,n.push(a)}return n.join("")}var M_e=M(()=>{_i();hb();bk()});function eZ(e){let n={constructs:KF([JX,...(e||{}).extensions||[]]),content:o(YSe),defined:[],document:o($Se),flow:o(C_e),lazy:{},string:o(A_e),text:o(P_e)};return n;function o(i){return a;function a(s){return k_e(n,i,s)}}}var B_e=M(()=>{BX();XSe();QSe();w_e();QX();D_e();M_e()});function tZ(e){for(;!r5(e););return e}var R_e=M(()=>{FX()});function rZ(){let e=1,t="",r=!0,n;return o;function o(i,a,s){let l=[],c,u,d,f,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(a||void 0).decode(i)),d=0,t="",r&&(i.charCodeAt(0)===65279&&d++,r=void 0);d<i.length;){if(O_e.lastIndex=d,c=O_e.exec(i),f=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(f),!c){t=i.slice(d);break}if(m===10&&d===f&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),d<f&&(l.push(i.slice(d,f)),e+=f-d),m){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:n=!0,e=1}d=f+1}return s&&(n&&l.push(-5),t&&l.push(t),l.push(null)),l}}var O_e,L_e=M(()=>{O_e=/[\0\t\n\r]/g});var F_e=M(()=>{B_e();R_e();L_e()});function N_e(e){return e.replace(dvt,fvt)}function fvt(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){let o=r.charCodeAt(1),i=o===120||o===88;return YF(r.slice(i?2:1),i?16:10)}return oA(r)||e}var dvt,U_e=M(()=>{WF();RX();dvt=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});function nZ(e,t,r){return typeof t!="string"&&(r=t,t=void 0),mvt(r)(tZ(eZ(r).document().write(rZ()(e,t,!0))))}function mvt(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(le),autolinkProtocol:D,autolinkEmail:D,atxHeading:i(ye),blockQuote:i($),characterEscape:D,characterReference:D,codeFenced:i(Z),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:i(Z,a),codeText:i(de,a),codeTextData:D,data:D,codeFlowValue:D,definition:i(Q),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:i(ae),hardBreakEscape:i(we),hardBreakTrailing:i(we),htmlFlow:i(re,a),htmlFlowData:D,htmlText:i(re,a),htmlTextData:D,image:i(ee),label:a,link:i(le),listItem:i(ke),listItemValue:f,listOrdered:i(pe,d),listUnordered:i(pe),paragraph:i(Ve),reference:z,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:i(ye),strong:i(Xe),thematicBreak:i(_e)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:K,autolinkProtocol:ne,blockQuote:l(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:X,characterReference:Y,codeFenced:l(g),codeFencedFence:h,codeFencedFenceInfo:m,codeFencedFenceMeta:p,codeFlowValue:E,codeIndented:l(y),codeText:l(O),codeTextData:E,data:E,definition:l(),definitionDestinationString:C,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(R),htmlFlowData:E,htmlText:l(B),htmlTextData:E,image:l(q),label:j,labelText:W,lineEnding:I,link:l(F),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ie,resourceDestinationString:L,resourceTitleString:V,resource:U,setextHeading:l(T),setextHeadingLineSequence:A,setextHeadingText:w,strong:l(),thematicBreak:l()}};q_e(t,(e||{}).mdastExtensions||[]);let r={};return n;function n(Ie){let Re={type:"root",children:[]},ze={stack:[Re],tokenStack:[],config:t,enter:s,exit:c,buffer:a,resume:u,data:r},N=[],J=-1;for(;++J<Ie.length;)if(Ie[J][1].type==="listOrdered"||Ie[J][1].type==="listUnordered")if(Ie[J][0]==="enter")N.push(J);else{let Ae=N.pop();J=o(Ie,Ae,J)}for(J=-1;++J<Ie.length;){let Ae=t[Ie[J][0]];z_e.call(Ae,Ie[J][1].type)&&Ae[Ie[J][1].type].call(Object.assign({sliceSerialize:Ie[J][2].sliceSerialize},ze),Ie[J][1])}if(ze.tokenStack.length>0){let Ae=ze.tokenStack[ze.tokenStack.length-1];(Ae[1]||V_e).call(ze,void 0,Ae[0])}for(Re.position={start:Dx(Ie.length>0?Ie[0][1].start:{line:1,column:1,offset:0}),end:Dx(Ie.length>0?Ie[Ie.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<t.transforms.length;)Re=t.transforms[J](Re)||Re;return Re}function o(Ie,Re,ze){let N=Re-1,J=-1,Ae=!1,qe,Be,Qe,at;for(;++N<=ze;){let ft=Ie[N];switch(ft[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ft[0]==="enter"?J++:J--,at=void 0;break}case"lineEndingBlank":{ft[0]==="enter"&&(qe&&!at&&!J&&!Qe&&(Qe=N),at=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:at=void 0}if(!J&&ft[0]==="enter"&&ft[1].type==="listItemPrefix"||J===-1&&ft[0]==="exit"&&(ft[1].type==="listUnordered"||ft[1].type==="listOrdered")){if(qe){let mt=N;for(Be=void 0;mt--;){let dt=Ie[mt];if(dt[1].type==="lineEnding"||dt[1].type==="lineEndingBlank"){if(dt[0]==="exit")continue;Be&&(Ie[Be][1].type="lineEndingBlank",Ae=!0),dt[1].type="lineEnding",Be=mt}else if(!(dt[1].type==="linePrefix"||dt[1].type==="blockQuotePrefix"||dt[1].type==="blockQuotePrefixWhitespace"||dt[1].type==="blockQuoteMarker"||dt[1].type==="listItemIndent"))break}Qe&&(!Be||Qe<Be)&&(qe._spread=!0),qe.end=Object.assign({},Be?Ie[Be][1].start:ft[1].end),Ie.splice(Be||N,0,["exit",qe,ft[2]]),N++,ze++}if(ft[1].type==="listItemPrefix"){let mt={type:"listItem",_spread:!1,start:Object.assign({},ft[1].start),end:void 0};qe=mt,Ie.splice(N,0,["enter",mt,ft[2]]),N++,ze++,Qe=void 0,at=!0}}}return Ie[Re][1]._spread=Ae,ze}function i(Ie,Re){return ze;function ze(N){s.call(this,Ie(N),N),Re&&Re.call(this,N)}}function a(){this.stack.push({type:"fragment",children:[]})}function s(Ie,Re,ze){this.stack[this.stack.length-1].children.push(Ie),this.stack.push(Ie),this.tokenStack.push([Re,ze||void 0]),Ie.position={start:Dx(Re.start),end:void 0}}function l(Ie){return Re;function Re(ze){Ie&&Ie.call(this,ze),c.call(this,ze)}}function c(Ie,Re){let ze=this.stack.pop(),N=this.tokenStack.pop();if(N)N[0].type!==Ie.type&&(Re?Re.call(this,Ie,N[0]):(N[1]||V_e).call(this,Ie,N[0]));else throw new Error("Cannot close `"+Ie.type+"` ("+Px({start:Ie.start,end:Ie.end})+"): it\u2019s not open");ze.position.end=Dx(Ie.end)}function u(){return Y2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(Ie){if(this.data.expectingFirstListItemValue){let Re=this.stack[this.stack.length-2];Re.start=Number.parseInt(this.sliceSerialize(Ie),10),this.data.expectingFirstListItemValue=void 0}}function m(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.lang=Ie}function p(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=Ie}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.value=Ie.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.value=Ie.replace(/(\r?\n|\r)$/g,"")}function b(Ie){let Re=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Re,ze.identifier=hd(this.sliceSerialize(Ie)).toLowerCase()}function x(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.title=Ie}function C(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.url=Ie}function S(Ie){let Re=this.stack[this.stack.length-1];if(!Re.depth){let ze=this.sliceSerialize(Ie).length;Re.depth=ze}}function w(){this.data.setextHeadingSlurpLineEnding=!0}function A(Ie){let Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(Ie).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function D(Ie){let ze=this.stack[this.stack.length-1].children,N=ze[ze.length-1];(!N||N.type!=="text")&&(N=pt(),N.position={start:Dx(Ie.start),end:void 0},ze.push(N)),this.stack.push(N)}function E(Ie){let Re=this.stack.pop();Re.value+=this.sliceSerialize(Ie),Re.position.end=Dx(Ie.end)}function I(Ie){let Re=this.stack[this.stack.length-1];if(this.data.atHardBreak){let ze=Re.children[Re.children.length-1];ze.position.end=Dx(Ie.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Re.type)&&(D.call(this,Ie),E.call(this,Ie))}function k(){this.data.atHardBreak=!0}function R(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.value=Ie}function B(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.value=Ie}function O(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.value=Ie}function F(){let Ie=this.stack[this.stack.length-1];if(this.data.inReference){let Re=this.data.referenceType||"shortcut";Ie.type+="Reference",Ie.referenceType=Re,delete Ie.url,delete Ie.title}else delete Ie.identifier,delete Ie.label;this.data.referenceType=void 0}function q(){let Ie=this.stack[this.stack.length-1];if(this.data.inReference){let Re=this.data.referenceType||"shortcut";Ie.type+="Reference",Ie.referenceType=Re,delete Ie.url,delete Ie.title}else delete Ie.identifier,delete Ie.label;this.data.referenceType=void 0}function W(Ie){let Re=this.sliceSerialize(Ie),ze=this.stack[this.stack.length-2];ze.label=N_e(Re),ze.identifier=hd(Re).toLowerCase()}function j(){let Ie=this.stack[this.stack.length-1],Re=this.resume(),ze=this.stack[this.stack.length-1];if(this.data.inReference=!0,ze.type==="link"){let N=Ie.children;ze.children=N}else ze.alt=Re}function L(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.url=Ie}function V(){let Ie=this.resume(),Re=this.stack[this.stack.length-1];Re.title=Ie}function U(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function ie(Ie){let Re=this.resume(),ze=this.stack[this.stack.length-1];ze.label=Re,ze.identifier=hd(this.sliceSerialize(Ie)).toLowerCase(),this.data.referenceType="full"}function oe(Ie){this.data.characterReferenceType=Ie.type}function X(Ie){let Re=this.sliceSerialize(Ie),ze=this.data.characterReferenceType,N;ze?(N=YF(Re,ze==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):N=oA(Re);let J=this.stack[this.stack.length-1];J.value+=N}function Y(Ie){let Re=this.stack.pop();Re.position.end=Dx(Ie.end)}function ne(Ie){E.call(this,Ie);let Re=this.stack[this.stack.length-1];Re.url=this.sliceSerialize(Ie)}function K(Ie){E.call(this,Ie);let Re=this.stack[this.stack.length-1];Re.url="mailto:"+this.sliceSerialize(Ie)}function $(){return{type:"blockquote",children:[]}}function Z(){return{type:"code",lang:null,meta:null,value:""}}function de(){return{type:"inlineCode",value:""}}function Q(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ae(){return{type:"emphasis",children:[]}}function ye(){return{type:"heading",depth:0,children:[]}}function we(){return{type:"break"}}function re(){return{type:"html",value:""}}function ee(){return{type:"image",title:null,url:"",alt:null}}function le(){return{type:"link",title:null,url:"",children:[]}}function pe(Ie){return{type:"list",ordered:Ie.type==="listOrdered",start:null,spread:Ie._spread,children:[]}}function ke(Ie){return{type:"listItem",spread:Ie._spread,checked:null,children:[]}}function Ve(){return{type:"paragraph",children:[]}}function Xe(){return{type:"strong",children:[]}}function pt(){return{type:"text",value:""}}function _e(){return{type:"thematicBreak"}}}function Dx(e){return{line:e.line,column:e.column,offset:e.offset}}function q_e(e,t){let r=-1;for(;++r<t.length;){let n=t[r];Array.isArray(n)?q_e(e,n):pvt(e,n)}}function pvt(e,t){let r;for(r in t)if(z_e.call(t,r))switch(r){case"canContainEols":{let n=t[r];n&&e[r].push(...n);break}case"transforms":{let n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{let n=t[r];n&&Object.assign(e[r],n);break}}}function V_e(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Px({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Px({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Px({start:t.start,end:t.end})+") is still open")}var z_e,j_e=M(()=>{HF();F_e();RX();U_e();iA();WF();PX();z_e={}.hasOwnProperty});var G_e=M(()=>{j_e()});function c5(e){let t=this;t.parser=r;function r(n){return nZ(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var H_e=M(()=>{G_e()});var W_e=M(()=>{H_e()});function K_e(e,t){let r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}var Y_e=M(()=>{""});function X_e(e,t){let r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
|
|
23
23
|
`}]}var Z_e=M(()=>{""});function $_e(e,t){let r=t.value?t.value+`
|
|
@@ -29,7 +29,7 @@ ${s.join(`
|
|
|
29
29
|
`});++n<e.length;)n&&r.push({type:"text",value:`
|
|
30
30
|
`}),r.push(e[n]);return t&&e.length>0&&r.push({type:"text",value:`
|
|
31
31
|
`}),r}function oCe(e){let t=0,r=e.charCodeAt(t);for(;r===9||r===32;)t++,r=e.charCodeAt(t);return e.slice(t)}var uZ,kvt,aCe=M(()=>{cZ();b5();GF();G2e();uZ={}.hasOwnProperty,kvt={}});function x5(e,t){let r=iCe(e,t),n=r.one(e,void 0),o=Q2e(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return o&&("children"in i,i.children.push({type:"text",value:`
|
|
32
|
-
`},o)),i}var sCe=M(()=>{J2e();aCe()});var lCe=M(()=>{sCe()});function S5(e,t){return e&&"run"in e?async function(r,n){let o=x5(r,{file:n,...t});await e.run(o,n)}:function(r,n){return x5(r,{file:n,...e||t})}}var cCe=M(()=>{lCe()});var uCe=M(()=>{cCe()});function dZ(e){if(e)throw e}var dCe=M(()=>{});var xCe=ve((zFr,bCe)=>{"use strict";var _5=Object.prototype.hasOwnProperty,vCe=Object.prototype.toString,fCe=Object.defineProperty,mCe=Object.getOwnPropertyDescriptor,pCe=function(t){return typeof Array.isArray=="function"?Array.isArray(t):vCe.call(t)==="[object Array]"},hCe=function(t){if(!t||vCe.call(t)!=="[object Object]")return!1;var r=_5.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&_5.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var o;for(o in t);return typeof o>"u"||_5.call(t,o)},gCe=function(t,r){fCe&&r.name==="__proto__"?fCe(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},yCe=function(t,r){if(r==="__proto__")if(_5.call(t,r)){if(mCe)return mCe(t,r).value}else return;return t[r]};bCe.exports=function e(){var t,r,n,o,i,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(r in t)n=yCe(s,r),o=yCe(t,r),s!==o&&(u&&o&&(hCe(o)||(i=pCe(o)))?(i?(i=!1,a=n&&pCe(n)?n:[]):a=n&&hCe(n)?n:{},gCe(s,{name:r,newValue:e(u,a,o)})):typeof o<"u"&&gCe(s,{name:r,newValue:o}));return s}});function Ak(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var SCe=M(()=>{});function fZ(){let e=[],t={run:r,use:n};return t;function r(...o){let i=-1,a=o.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...o);function s(l,...c){let u=e[++i],d=-1;if(l){a(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?_Ce(u,s)(...c):a(null,...c)}}function n(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function _Ce(e,t){let r;return n;function n(...a){let s=e.length>a.length,l;s&&a.push(o);try{l=e.apply(this,a)}catch(c){let u=c;if(s&&r)throw u;return o(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(a,...s){r||(r=!0,t(a,...s))}function i(a){o(null,a)}}var CCe=M(()=>{});var wCe=M(()=>{CCe()});function Lvt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pk(e);let r=0,n=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else n<0&&(i=!0,n=o+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else a<0&&(i=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(n=o):(s=-1,n=a));return r===n?n=a:n<0&&(n=e.length),e.slice(r,n)}function Fvt(e){if(Pk(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Nvt(e){Pk(e);let t=e.length,r=-1,n=0,o=-1,i=0,a;for(;t--;){let s=e.codePointAt(t);if(s===47){if(a){n=t+1;break}continue}r<0&&(a=!0,r=t+1),s===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||r<0||i===0||i===1&&o===r-1&&o===n+1?"":e.slice(o,r)}function Uvt(...e){let t=-1,r;for(;++t<e.length;)Pk(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Vvt(r)}function Vvt(e){Pk(e);let t=e.codePointAt(0)===47,r=zvt(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function zvt(e,t){let r="",n=0,o=-1,i=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(o===a-1||i===1))if(o!==a-1&&i===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),o=a,i=0;continue}}else if(r.length>0){r="",n=0,o=a,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),n=a-o-1;o=a,i=0}else s===46&&i>-1?i++:i=-1}return r}function Pk(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var _g,TCe=M(()=>{_g={basename:Lvt,dirname:Fvt,extname:Nvt,join:Uvt,sep:"/"}});function qvt(){return"/"}var ACe,PCe=M(()=>{ACe={cwd:qvt}});function lA(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var mZ=M(()=>{});function ICe(e){if(typeof e=="string")e=new URL(e);else if(!lA(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jvt(e)}function jvt(e){if(e.hostname!==""){let n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){let n=t.codePointAt(r+2);if(n===70||n===102){let o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}var ECe=M(()=>{mZ();mZ()});function hZ(e,t){if(e&&e.includes(_g.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+_g.sep+"`")}function gZ(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function DCe(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Gvt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var pZ,nC,kCe=M(()=>{IX();TCe();PCe();ECe();pZ=["history","path","basename","stem","extname","dirname"],nC=class{constructor(t){let r;t?lA(t)?r={path:t}:typeof t=="string"||Gvt(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":ACe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<pZ.length;){let i=pZ[n];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let o;for(o in r)pZ.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?_g.basename(this.path):void 0}set basename(t){gZ(t,"basename"),hZ(t,"basename"),this.path=_g.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?_g.dirname(this.path):void 0}set dirname(t){DCe(this.basename,"dirname"),this.path=_g.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?_g.extname(this.path):void 0}set extname(t){if(hZ(t,"extname"),DCe(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=_g.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){lA(t)&&(t=ICe(t)),gZ(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?_g.basename(this.path,this.extname):void 0}set stem(t){gZ(t,"stem"),hZ(t,"stem"),this.path=_g.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){let o=this.message(t,r,n);throw o.fatal=!0,o}info(t,r,n){let o=this.message(t,r,n);return o.fatal=void 0,o}message(t,r,n){let o=new Ll(t,r,n);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var yZ=M(()=>{kCe()});var MCe,BCe=M(()=>{MCe=(function(e){let n=this.constructor.prototype,o=n[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,n),i})});function vZ(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bZ(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xZ(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RCe(e){if(!Ak(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OCe(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function C5(e){return Wvt(e)?e:new nC(e)}function Wvt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Kvt(e){return typeof e=="string"||Yvt(e)}function Yvt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var w5,Hvt,SZ,_Z,LCe=M(()=>{dCe();w5=et(xCe(),1);SCe();wCe();yZ();BCe();Hvt={}.hasOwnProperty,SZ=class e extends MCe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fZ()}copy(){let t=new e,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];t.use(...n)}return t.data((0,w5.default)(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(xZ("data",this.frozen),this.namespace[t]=r,this):Hvt.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xZ("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let o=r.call(t,...n);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let r=C5(t),n=this.parser||this.Parser;return vZ("parse",n),n(String(r),r)}process(t,r){let n=this;return this.freeze(),vZ("process",this.parser||this.Parser),bZ("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(i,a){let s=C5(t),l=n.parse(s);n.run(l,s,function(u,d,f){if(u||!d||!f)return c(u);let m=d,p=n.stringify(m,f);Kvt(p)?f.value=p:f.result=p,c(u,f)});function c(u,d){u||!d?a(u):i?i(d):r(void 0,d)}}}processSync(t){let r=!1,n;return this.freeze(),vZ("processSync",this.parser||this.Parser),bZ("processSync",this.compiler||this.Compiler),this.process(t,o),OCe("processSync","process",r),n;function o(i,a){r=!0,dZ(i),n=a}}run(t,r,n){RCe(t),this.freeze();let o=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?i(void 0,n):new Promise(i);function i(a,s){let l=C5(r);o.run(t,l,c);function c(u,d,f){let m=d||t;u?s(u):a?a(m):n(void 0,m,f)}}}runSync(t,r){let n=!1,o;return this.run(t,r,i),OCe("runSync","run",n),o;function i(a,s){dZ(a),o=s,n=!0}}stringify(t,r){this.freeze();let n=C5(r),o=this.compiler||this.Compiler;return bZ("stringify",o),RCe(t),o(t,n)}use(t,...r){let n=this.attachers,o=this.namespace;if(xZ("use",this.frozen),t!=null)if(typeof t=="function")l(t,r);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){let[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(o.settings=(0,w5.default)(!0,o.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){let d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===c){f=d;break}if(f===-1)n.push([c,...u]);else if(u.length>0){let[m,...p]=u,h=n[f][1];Ak(h)&&Ak(m)&&(m=(0,w5.default)(!0,h,m)),n[f]=[c,m,...p]}}}},_Z=new SZ().freeze()});var FCe=M(()=>{LCe()});function Ik(e){let t=Qvt(e),r=Jvt(e);return ebt(t.runSync(t.parse(r),r),e)}function Qvt(e){let t=e.rehypePlugins||NCe,r=e.remarkPlugins||NCe,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...UCe}:UCe;return _Z().use(c5).use(r).use(S5,n).use(t)}function Jvt(e){let t=e.children||"",r=new nC;return typeof t=="string"?r.value=t:(""+t,void 0),r}function ebt(e,t){let r=t.allowedElements,n=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||zCe;for(let u of $vt)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Xvt+u.id,void 0);return r&&i&&void 0,rC(e,c),DX(e,{Fragment:cA.Fragment,components:o,ignoreInvalidStyle:!0,jsx:cA.jsx,jsxs:cA.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return a?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let m;for(m in yk)if(Object.hasOwn(yk,m)&&Object.hasOwn(u.properties,m)){let p=u.properties[m],h=yk[m];(h===null||h.includes(u.tagName))&&(u.properties[m]=l(String(p||""),m,u))}}if(u.type==="element"){let m=r?!r.includes(u.tagName):i?i.includes(u.tagName):!1;if(!m&&n&&typeof d=="number"&&(m=!n(u,d,f)),m&&f&&typeof d=="number")return s&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function zCe(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||n!==-1&&t>n||Zvt.test(e.slice(0,t))?e:""}var cA,VCe,Xvt,NCe,UCe,Zvt,$vt,qCe=M(()=>{FSe();USe();cA=et(gn(),1),VCe=et(Wr(),1);W_e();uCe();FCe();b5();yZ();Xvt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",NCe=[],UCe={allowDangerousHtml:!0},Zvt=/^(https?|ircs?|mailto|xmpp)$/i,$vt=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}]});var CZ=M(()=>{qCe()});var Io,uA,dA,Ji,T5=M(()=>{Vt();yn();(function(e){function t(){return o=>r(o)}e.factory=t;function r(o){var i;return i=class{static is(s){return!!s&&o===s.type}constructor(s,l){this.data=s,this.id=En.create22(),this.type=o,this.label=l&&l.label||o.name,this.description=l&&l.description}},i.type=o,i}e.create=r;function n(o,i){if(!o.tags)return!1;for(let a of o.tags)if(a===i)return!0;return!1}e.hasTag=n,e.Null={id:En.create22(),type:{name:"Null",typeClass:"Null"},data:void 0,label:"Null"}})(Io||(Io={}));(function(e){function t(n){let o=n;return!!o&&!!o.transform&&!!o.parent&&!!o.status}e.is=t;function r(n,o){let i=typeof o=="string"?o:e.is(o)?o.transform.ref:o.ref;return n.cells.get(i)}e.resolve=r})(uA||(uA={}));dA=class{get cell(){var t;return(t=this.state)===null||t===void 0?void 0:t.cells.get(this.ref)}get obj(){var t,r;return(r=(t=this.state)===null||t===void 0?void 0:t.cells.get(this.ref))===null||r===void 0?void 0:r.obj}get data(){var t;return(t=this.obj)===null||t===void 0?void 0:t.data}update(t,r){if(!this.state)throw new Error("To use update() from StateObjectSelector, 'state' must be defined.");return r||(r=this.state.build()),(r||this.state.build()).to(this).update(t),r}checkValid(){if(!this.state)throw new Error("Unassigned State.");let t=this.cell;if(!t)throw new Error("Not created at all. Did you await/then the corresponding state update?");if(t.status==="ok")return!0;throw t.status==="error"?new Error(t.errorText):t.obj===Io.Null?new Error("The object is Null."):new Error("Unresolved. Did you await/then the corresponding state update?")}get isOk(){let t=this.cell;return t&&t.status==="ok"&&t.obj!==Io.Null}constructor(t,r){this.ref=t,this.state=r}};(function(e){function t(o){var i;if(o)return typeof o=="string"?o:uA.is(o)?o.transform.ref:(i=o.cell)===null||i===void 0?void 0:i.transform.ref}e.resolveRef=t;function r(o,i){if(i)return uA.is(i)?i:typeof i=="string"?o.cells.get(i):i.cell}e.resolve=r;function n(o,i){let a=r(o,i);if(!(!a||!a.obj||a.status!=="ok"))return a}e.resolveAndCheck=n})(Ji||(Ji={}))});function DZ(){return{value:!1}}function qp(e){e&&(e.value=!0)}function UZ(){}function fA(e){return e.size===void 0&&(e.size=e.__iterate(mwe)),e.size}function Rx(e,t){if(typeof t!="number"){var r=t>>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?fA(e)+t:t}function mwe(){return!0}function O5(e,t,r){return(e===0&&!hwe(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function zk(e,t){return pwe(e,t,0)}function L5(e,t){return pwe(e,t,t)}function pwe(e,t,r){return e===void 0?r:hwe(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function hwe(e){return e<0||e===0&&1/e===-1/0}function Xm(e){return!!(e&&e[gwe])}function Ss(e){return!!(e&&e[k5])}function jp(e){return!!(e&&e[M5])}function VZ(e){return Ss(e)||jp(e)}function zZ(e){return!!(e&&e[ywe])}function aC(e){return!!(e&&e[vwe])}function ey(e){return Xm(e)||aC(e)}function J0(e){return!!(e&&e[Ox])}function _s(e,t,r,n){var o=e===SA?t:e===Zm?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function lf(){return{value:void 0,done:!0}}function xwe(e){return Array.isArray(e)?!0:!!N5(e)}function jCe(e){return e&&typeof e.next=="function"}function MZ(e){var t=N5(e);return t&&t.call(e)}function N5(e){var t=e&&(kZ&&e[kZ]||e[bwe]);if(typeof t=="function")return t}function tbt(e){var t=N5(e);return t&&t===e.entries}function rbt(e){var t=N5(e);return t&&t===e.keys}function Swe(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}function jZ(){return GCe||(GCe=new mA([]))}function GZ(e){var t=HZ(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new qZ(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function _we(e){var t=HZ(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function obt(e){var t=HZ(e);if(t)return tbt(e)?t.fromEntrySeq():rbt(e)?t.toSetSeq():t;if(typeof e=="object")return new qZ(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function HZ(e){return Swe(e)?new mA(e):xwe(e)?new nbt(e):void 0}function WZ(e){return!!(e&&e[Cwe])}function wwe(e){return WZ(e)&&J0(e)}function HCe(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function Ym(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(HCe(e)&&HCe(t)&&e.equals(t))}function U5(e){return e>>>1&1073741824|e&3221225471}function Hm(e){if(e==null)return WCe(e);if(typeof e.hashCode=="function")return U5(e.hashCode(e));var t=dbt(e);if(t==null)return WCe(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return abt(t);case"string":return t.length>fbt?sbt(t):BZ(t);case"object":case"function":return cbt(t);case"symbol":return lbt(t);default:if(typeof t.toString=="function")return BZ(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function WCe(e){return e===null?1108378658:1108378659}function abt(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return U5(t)}function sbt(e){var t=AZ[e];return t===void 0&&(t=BZ(e),TZ===mbt&&(TZ=0,AZ={}),TZ++,AZ[e]=t),t}function BZ(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return U5(t)}function lbt(e){var t=XCe[e];return t!==void 0||(t=Twe(),XCe[e]=t),t}function cbt(e){var t;if(RZ&&(t=OZ.get(e),t!==void 0)||(t=e[oC],t!==void 0)||!YCe&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[oC],t!==void 0||(t=ubt(e),t!==void 0)))return t;if(t=Twe(),RZ)OZ.set(e,t);else{if(KCe!==void 0&&KCe(e)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(YCe)Object.defineProperty(e,oC,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[oC]=t;else if(e.nodeType!==void 0)e[oC]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}function ubt(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function dbt(e){return e.valueOf!==ibt&&typeof e.valueOf=="function"?e.valueOf(e):e}function Twe(){var e=++wZ;return wZ&1073741824&&(wZ=0),e}function Ewe(e){var t=ty(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=ZZ,t.__iterateUncached=function(r,n){var o=this;return e.__iterate(function(i,a){return r(a,i,o)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===$m){var o=e.__iterator(r,n);return new ki(function(){var i=o.next();if(!i.done){var a=i.value[0];i.value[0]=i.value[1],i.value[1]=a}return i})}return e.__iterator(r===Zm?SA:Zm,n)},t}function Dwe(e,t,r){var n=ty(e);return n.size=e.size,n.has=function(o){return e.has(o)},n.get=function(o,i){var a=e.get(o,pi);return a===pi?i:t.call(r,a,o,e)},n.__iterateUncached=function(o,i){var a=this;return e.__iterate(function(s,l,c){return o(t.call(r,s,l,c),l,a)!==!1},i)},n.__iteratorUncached=function(o,i){var a=e.__iterator($m,i);return new ki(function(){var s=a.next();if(s.done)return s;var l=s.value,c=l[0];return _s(o,c,t.call(r,l[1],c,e),s)})},n}function KZ(e,t){var r=this,n=ty(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var o=Ewe(e);return o.reverse=function(){return e.flip()},o}),n.get=function(o,i){return e.get(t?o:-1-o,i)},n.has=function(o){return e.has(t?o:-1-o)},n.includes=function(o){return e.includes(o)},n.cacheResult=ZZ,n.__iterate=function(o,i){var a=this,s=0;return i&&fA(e),e.__iterate(function(l,c){return o(l,t?c:i?a.size-++s:s++,a)},!i)},n.__iterator=function(o,i){var a=0;i&&fA(e);var s=e.__iterator($m,!i);return new ki(function(){var l=s.next();if(l.done)return l;var c=l.value;return _s(o,t?c[0]:i?r.size-++a:a++,c[1],l)})},n}function kwe(e,t,r,n){var o=ty(e);return n&&(o.has=function(i){var a=e.get(i,pi);return a!==pi&&!!t.call(r,a,i,e)},o.get=function(i,a){var s=e.get(i,pi);return s!==pi&&t.call(r,s,i,e)?s:a}),o.__iterateUncached=function(i,a){var s=this,l=0;return e.__iterate(function(c,u,d){if(t.call(r,c,u,d))return l++,i(c,n?u:l-1,s)},a),l},o.__iteratorUncached=function(i,a){var s=e.__iterator($m,a),l=0;return new ki(function(){for(;;){var c=s.next();if(c.done)return c;var u=c.value,d=u[0],f=u[1];if(t.call(r,f,d,e))return _s(i,n?d:l++,f,c)}})},o}function pbt(e,t,r){var n=Jm().asMutable();return e.__iterate(function(o,i){n.update(t.call(r,o,i,e),0,function(a){return a+1})}),n.asImmutable()}function hbt(e,t,r){var n=Ss(e),o=(J0(e)?rc():Jm()).asMutable();e.__iterate(function(a,s){o.update(t.call(r,a,s,e),function(l){return l=l||[],l.push(n?[s,a]:a),l})});var i=XZ(e);return o.map(function(a){return qa(e,i(a))}).asImmutable()}function gbt(e,t,r){var n=Ss(e),o=[[],[]];e.__iterate(function(a,s){o[t.call(r,a,s,e)?1:0].push(n?[s,a]:a)});var i=XZ(e);return o.map(function(a){return qa(e,i(a))})}function YZ(e,t,r,n){var o=e.size;if(O5(t,r,o))return e;if(typeof o>"u"&&(t<0||r<0))return YZ(e.toSeq().cacheResult(),t,r,n);var i=zk(t,o),a=L5(r,o),s=a-i,l;s===s&&(l=s<0?0:s);var c=ty(e);return c.size=l===0?l:e.size&&l||void 0,!n&&zZ(e)&&l>=0&&(c.get=function(u,d){return u=Rx(this,u),u>=0&&u<l?e.get(u+i,d):d}),c.__iterateUncached=function(u,d){var f=this;if(l===0)return 0;if(d)return this.cacheResult().__iterate(u,d);var m=0,p=!0,h=0;return e.__iterate(function(g,y){if(!(p&&(p=m++<i)))return h++,u(g,n?y:h-1,f)!==!1&&h!==l}),h},c.__iteratorUncached=function(u,d){if(l!==0&&d)return this.cacheResult().__iterator(u,d);if(l===0)return new ki(lf);var f=e.__iterator(u,d),m=0,p=0;return new ki(function(){for(;m++<i;)f.next();if(++p>l)return lf();var h=f.next();return n||u===Zm||h.done?h:u===SA?_s(u,p-1,void 0,h):_s(u,p-1,h.value[1],h)})},c}function ybt(e,t,r){var n=ty(e);return n.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=0;return e.__iterate(function(l,c,u){return t.call(r,l,c,u)&&++s&&o(l,c,a)}),s},n.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator($m,i),l=!0;return new ki(function(){if(!l)return lf();var c=s.next();if(c.done)return c;var u=c.value,d=u[0],f=u[1];return t.call(r,f,d,a)?o===$m?c:_s(o,d,f,c):(l=!1,lf())})},n}function Mwe(e,t,r,n){var o=ty(e);return o.__iterateUncached=function(i,a){var s=this;if(a)return this.cacheResult().__iterate(i,a);var l=!0,c=0;return e.__iterate(function(u,d,f){if(!(l&&(l=t.call(r,u,d,f))))return c++,i(u,n?d:c-1,s)}),c},o.__iteratorUncached=function(i,a){var s=this;if(a)return this.cacheResult().__iterator(i,a);var l=e.__iterator($m,a),c=!0,u=0;return new ki(function(){var d,f,m;do{if(d=l.next(),d.done)return n||i===Zm?d:i===SA?_s(i,u++,void 0,d):_s(i,u++,d.value[1],d);var p=d.value;f=p[0],m=p[1],c&&(c=t.call(r,m,f,s))}while(c);return i===$m?d:_s(i,f,m,d)})},o}function bbt(e,t){var r=Ss(e),n=[e].concat(t).map(function(i){return Xm(i)?r&&(i=Gp(i)):i=r?GZ(i):_we(Array.isArray(i)?i:[i]),i}).filter(function(i){return i.size!==0});if(n.length===0)return e;if(n.length===1){var o=n[0];if(o===e||r&&Ss(o)||jp(e)&&jp(o))return o}return new vbt(n)}function Bwe(e,t,r){var n=ty(e);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var a=0,s=!1;function l(c,u){c.__iterate(function(d,f){return(!t||u<t)&&Xm(d)?l(d,u+1):(a++,o(d,r?f:a-1,n)===!1&&(s=!0)),!s},i)}return l(e,0),a},n.__iteratorUncached=function(o,i){if(i)return this.cacheResult().__iterator(o,i);var a=e.__iterator(o,i),s=[],l=0;return new ki(function(){for(;a;){var c=a.next();if(c.done!==!1){a=s.pop();continue}var u=c.value;if(o===$m&&(u=u[1]),(!t||s.length<t)&&Xm(u))s.push(a),a=u.__iterator(o,i);else return r?c:_s(o,l++,u,c)}return lf()})},n}function xbt(e,t,r){var n=XZ(e);return e.toSeq().map(function(o,i){return n(t.call(r,o,i,e))}).flatten(!0)}function Sbt(e,t){var r=ty(e);return r.size=e.size&&e.size*2-1,r.__iterateUncached=function(n,o){var i=this,a=0;return e.__iterate(function(s){return(!a||n(t,a++,i)!==!1)&&n(s,a++,i)!==!1},o),a},r.__iteratorUncached=function(n,o){var i=e.__iterator(Zm,o),a=0,s;return new ki(function(){return(!s||a%2)&&(s=i.next(),s.done)?s:a%2?_s(n,a++,t):_s(n,a++,s.value,s)})},r}function pA(e,t,r){t||(t=Rwe);var n=Ss(e),o=0,i=e.toSeq().map(function(a,s){return[s,a,o++,r?r(a,s,e):a]}).valueSeq().toArray();return i.sort(function(a,s){return t(a[3],s[3])||a[2]-s[2]}).forEach(n?function(a,s){i[s].length=2}:function(a,s){i[s]=a[1]}),n?Fx(i):jp(e)?Cg(i):CA(i)}function A5(e,t,r){if(t||(t=Rwe),r){var n=e.toSeq().map(function(o,i){return[o,r(o,i,e)]}).reduce(function(o,i){return ZCe(t,o[1],i[1])?i:o});return n&&n[0]}return e.reduce(function(o,i){return ZCe(t,o,i)?i:o})}function ZCe(e,t,r){var n=e(r,t);return n===0&&r!==t&&(r==null||r!==r)||n>0}function P5(e,t,r,n){var o=ty(e),i=new mA(r).map(function(a){return a.size});return o.size=n?i.max():i.min(),o.__iterate=function(a,s){for(var l=this.__iterator(Zm,s),c,u=0;!(c=l.next()).done&&a(c.value,u++,this)!==!1;);return u},o.__iteratorUncached=function(a,s){var l=r.map(function(d){return d=yd(d),MZ(s?d.reverse():d)}),c=0,u=!1;return new ki(function(){var d;return u||(d=l.map(function(f){return f.next()}),u=n?d.every(function(f){return f.done}):d.some(function(f){return f.done})),u?lf():_s(a,c++,t.apply(null,d.map(function(f){return f.value})))})},o}function qa(e,t){return e===t?e:zZ(e)?t:e.constructor(t)}function $Ce(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function XZ(e){return Ss(e)?Gp:jp(e)?iC:xA}function ty(e){return Object.create((Ss(e)?Fx:jp(e)?Cg:CA).prototype)}function ZZ(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Yf.prototype.cacheResult.call(this)}function Rwe(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e<t?-1:0}function $0(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function Bk(e,t){if(!e)throw new Error(t)}function Wm(e){Bk(e!==1/0,"Cannot perform this action with an infinite size.")}function Owe(e){if(Swe(e)&&typeof e!="string")return e;if(J0(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}function Cbt(e){if(!e||typeof e!="object"||_bt.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t,n=Object.getPrototypeOf(t);n!==null;)r=n,n=Object.getPrototypeOf(r);return r===t}function Lx(e){return typeof e=="object"&&(ey(e)||Array.isArray(e)||Cbt(e))}function Ok(e){try{return typeof e=="string"?JSON.stringify(e):String(e)}catch{return JSON.stringify(e)}}function wbt(e,t){return ey(e)?e.has(t):Lx(e)&&_A.call(e,t)}function Lwe(e,t,r){return ey(e)?e.get(t,r):wbt(e,t)?typeof e.get=="function"?e.get(t):e[t]:r}function B5(e){if(Array.isArray(e))return $0(e);var t={};for(var r in e)_A.call(e,r)&&(t[r]=e[r]);return t}function Tbt(e,t){if(!Lx(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(ey(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!_A.call(e,t))return e;var r=B5(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function Abt(e,t,r){if(!Lx(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(ey(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(_A.call(e,t)&&r===e[t])return e;var n=B5(e);return n[t]=r,n}function wA(e,t,r,n){n||(n=r,r=void 0);var o=Fwe(ey(e),e,Owe(t),0,r,n);return o===pi?r:o}function Fwe(e,t,r,n,o,i){var a=t===pi;if(n===r.length){var s=a?o:t,l=i(s);return l===s?t:l}if(!a&&!Lx(t))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Ok)+"]: "+t);var c=r[n],u=a?pi:Lwe(t,c,pi),d=Fwe(u===pi?e:ey(u),u,r,n+1,o,i);return d===u?t:d===pi?Tbt(t,c):Abt(a?e?Q0():{}:t,c,d)}function Pbt(e,t,r){return wA(e,t,pi,function(){return r})}function $Z(e,t){return Pbt(this,e,t)}function Ibt(e,t){return wA(e,t,function(){return pi})}function QZ(e){return Ibt(this,e)}function Nwe(e,t,r,n){return wA(e,[t],r,n)}function JZ(e,t,r){return arguments.length===1?e(this):Nwe(this,e,t,r)}function e$(e,t,r){return wA(this,e,t,r)}function Uwe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return zwe(this,e)}function Vwe(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return zwe(this,t,e)}function zwe(e,t,r){for(var n=[],o=0;o<t.length;o++){var i=Gp(t[o]);i.size!==0&&n.push(i)}return n.length===0?e:e.toSeq().size===0&&!e.__ownerID&&n.length===1?aC(e)?e:e.constructor(n[0]):e.withMutations(function(a){for(var s=r?function(c,u){Nwe(a,u,pi,function(d){return d===pi?c:r(d,c,u)})}:function(c,u){a.set(u,c)},l=0;l<n.length;l++)n[l].forEach(s)})}function t$(e,t,r){return r$(e,t,Ebt(r))}function r$(e,t,r){if(!Lx(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(ey(e))return typeof r=="function"&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),o=e,i=n?iC:Gp,a=n?function(l){o===e&&(o=B5(o)),o.push(l)}:function(l,c){var u=_A.call(o,c),d=u&&r?r(o[c],l,c):l;(!u||d!==o[c])&&(o===e&&(o=B5(o)),o[c]=d)},s=0;s<t.length;s++)i(t[s]).forEach(a);return o}function Ebt(e){function t(r,n,o){return Lx(r)&&Lx(n)&&Dbt(r,n)?r$(r,[n],t):e?e(r,n,o):n}return t}function Dbt(e,t){var r=Yf(e),n=Yf(t);return jp(r)===jp(n)&&Ss(r)===Ss(n)}function qwe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return t$(this,e)}function jwe(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return t$(this,t,e)}function n$(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return wA(this,e,Q0(),function(n){return r$(n,t)})}function o$(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return wA(this,e,Q0(),function(n){return t$(n,t)})}function qk(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function jk(){return this.__ownerID?this:this.__ensureOwner(new UZ)}function Gk(){return this.__ensureOwner()}function i$(){return this.__altered}function PZ(e,t){return _s(e,t[0],t[1])}function QCe(e,t){return{node:e,index:0,__prev:t}}function a$(e,t,r,n){var o=Object.create(ds);return o.size=e,o._root=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Q0(){return JCe||(JCe=a$(0))}function ewe(e,t,r){var n,o;if(e._root){var i=DZ(),a=DZ();if(n=s$(e._root,e.__ownerID,0,void 0,t,r,i,a),!a.value)return e;o=e.size+(i.value?r===pi?-1:1:0)}else{if(r===pi)return e;o=1,n=new Lk(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?a$(o,n):Q0()}function s$(e,t,r,n,o,i,a,s){return e?e.update(t,r,n,o,i,a,s):i===pi?e:(qp(s),qp(a),new yb(t,n,[o,i]))}function twe(e){return e.constructor===yb||e.constructor===gA}function l$(e,t,r,n,o){if(e.keyHash===n)return new gA(t,n,[e.entry,o]);var i=(r===0?e.keyHash:e.keyHash>>>r)&sf,a=(r===0?n:n>>>r)&sf,s,l=i===a?[l$(e,t,r+ja,n,o)]:(s=new yb(t,n,o),i<a?[e,s]:[s,e]);return new hA(t,1<<i|1<<a,l)}function Mbt(e,t,r,n){e||(e=new UZ);for(var o=new yb(e,Hm(r),[r,n]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}function Bbt(e,t,r,n){for(var o=0,i=0,a=new Array(r),s=0,l=1,c=t.length;s<c;s++,l<<=1){var u=t[s];u!==void 0&&s!==n&&(o|=l,a[i++]=u)}return new hA(e,o,a)}function Rbt(e,t,r,n,o){for(var i=0,a=new Array(Km),s=0;r!==0;s++,r>>>=1)a[s]=r&1?t[i++]:void 0;return a[n]=o,new Fk(e,i+1,a)}function Gwe(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function Hwe(e,t,r,n){var o=n?e:$0(e);return o[t]=r,o}function Obt(e,t,r,n){var o=e.length+1;if(n&&t+1===o)return e[t]=r,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=r,a=-1):i[s]=e[s+a];return i}function Lbt(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var o=new Array(n),i=0,a=0;a<n;a++)a===t&&(i=1),o[a]=e[a+i];return o}function Kwe(e){return!!(e&&e[Wwe])}function rwe(e,t){var r=e._origin,n=e._capacity,o=Uk(n),i=e._tail;return a(e._root,e._level,0);function a(c,u,d){return u===0?s(c,d):l(c,u,d)}function s(c,u){var d=u===o?i&&i.array:c&&c.array,f=u>r?0:r-u,m=n-u;return m>Km&&(m=Km),function(){if(f===m)return Rk;var p=t?--m:f++;return d&&d[p]}}function l(c,u,d){var f,m=c&&c.array,p=d>r?0:r-d>>u,h=(n-d>>u)+1;return h>Km&&(h=Km),function(){for(;;){if(f){var g=f();if(g!==Rk)return g;f=null}if(p===h)return Rk;var y=t?--h:p++;f=a(m&&m[y],u-ja,d+(y<<u))}}}}function Nk(e,t,r,n,o,i,a){var s=Object.create(tc);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function D5(){return Nk(0,0,ja)}function Vbt(e,t,r){if(t=Rx(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(a){t<0?Mx(a,t).set(0,r):Mx(a,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,o=e._root,i=DZ();return t>=Uk(e._capacity)?n=LZ(n,e.__ownerID,0,t,r,i):o=LZ(o,e.__ownerID,e._level,t,r,i),i.value?e.__ownerID?(e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e):Nk(e._origin,e._capacity,e._level,o,n):e}function LZ(e,t,r,n,o,i){var a=n>>>r&sf,s=e&&a<e.array.length;if(!s&&o===void 0)return e;var l;if(r>0){var c=e&&e.array[a],u=LZ(c,t,r-ja,n,o,i);return u===c?e:(l=yA(e,t),l.array[a]=u,l)}return s&&e.array[a]===o?e:(i&&qp(i),l=yA(e,t),o===void 0&&a===l.array.length-1?l.array.pop():l.array[a]=o,l)}function yA(e,t){return t&&e&&t===e.ownerID?e:new Bx(e?e.array.slice():[],t)}function Ywe(e,t){if(t>=Uk(e._capacity))return e._tail;if(t<1<<e._level+ja){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&sf],n-=ja;return r}}function Mx(e,t,r){t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new UZ,o=e._origin,i=e._capacity,a=o+t,s=r===void 0?i:r<0?i+r:o+r;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var l=e._level,c=e._root,u=0;a+u<0;)c=new Bx(c&&c.array.length?[void 0,c]:[],n),l+=ja,u+=1<<l;u&&(a+=u,o+=u,s+=u,i+=u);for(var d=Uk(i),f=Uk(s);f>=1<<l+ja;)c=new Bx(c&&c.array.length?[c]:[],n),l+=ja;var m=e._tail,p=f<d?Ywe(e,s-1):f>d?new Bx([],n):m;if(m&&f>d&&a<i&&m.array.length){c=yA(c,n);for(var h=c,g=l;g>ja;g-=ja){var y=d>>>g&sf;h=h.array[y]=yA(h.array[y],n)}h.array[d>>>ja&sf]=m}if(s<i&&(p=p&&p.removeAfter(n,0,s)),a>=f)a-=f,s-=f,l=ja,c=null,p=p&&p.removeBefore(n,0,a);else if(a>o||f<d){for(u=0;c;){var b=a>>>l&sf;if(b!==f>>>l&sf)break;b&&(u+=(1<<l)*b),l-=ja,c=c.array[b]}c&&a>o&&(c=c.removeBefore(n,l,a-u)),c&&f<d&&(c=c.removeAfter(n,l,f-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=l,e._root=c,e._tail=p,e.__hash=void 0,e.__altered=!0,e):Nk(a,s,l,c,p)}function Uk(e){return e<Km?0:e-1>>>ja<<ja}function c$(e,t,r,n){var o=Object.create(rc.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Dk(){return nwe||(nwe=c$(Q0(),D5()))}function owe(e,t,r){var n=e._map,o=e._list,i=n.get(t),a=i!==void 0,s,l;if(r===pi){if(!a)return e;o.size>=Km&&o.size>=n.size*2?(l=o.filter(function(c,u){return c!==void 0&&i!==u}),s=l.toKeyedSeq().map(function(c){return c[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=l.__ownerID=e.__ownerID)):(s=n.remove(t),l=i===o.size-1?o.pop():o.set(i,void 0))}else if(a){if(r===o.get(i)[1])return e;s=n,l=o.set(i,[t,r])}else s=n.set(t,o.size),l=o.set(o.size,[t,r]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=l,e.__hash=void 0,e.__altered=!0,e):c$(s,l)}function FZ(e){return!!(e&&e[Xwe])}function kk(e,t,r,n){var o=Object.create(cf);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function I5(){return iwe||(iwe=kk(0))}function d$(e){return!!(e&&e[Zwe])}function $we(e){return d$(e)&&J0(e)}function Qwe(e,t){if(e===t)return!0;if(!Xm(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Ss(e)!==Ss(t)||jp(e)!==jp(t)||J0(e)!==J0(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!VZ(e);if(J0(e)){var n=e.entries();return t.every(function(l,c){var u=n.next().value;return u&&Ym(u[1],l)&&(r||Ym(u[0],c))})&&n.next().done}var o=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var a=!0,s=t.__iterate(function(l,c){if(r?!e.has(l):o?!Ym(l,e.get(c,pi)):!Ym(e.get(c,pi),l))return a=!1,!1});return a&&e.size===s}function sC(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function R5(e){if(!e||typeof e!="object")return e;if(!Xm(e)){if(!Lx(e))return e;e=Yf(e)}if(Ss(e)){var t={};return e.__iterate(function(n,o){t[o]=R5(n)}),t}var r=[];return e.__iterate(function(n){r.push(R5(n))}),r}function E5(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function Jwe(e,t){var r=Object.create(Uu);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Mk(){return awe||(awe=Jwe(Q0()))}function eTe(e,t,r){for(var n=Owe(t),o=0;o!==n.length;)if(e=Lwe(e,n[o++],pi),e===pi)return r;return e}function tTe(e,t){return eTe(this,e,t)}function qbt(e,t){return eTe(e,t,pi)!==pi}function jbt(e){return qbt(this,e)}function rTe(){Wm(this.size);var e={};return this.__iterate(function(t,r){e[r]=t}),e}function swe(e,t,r,n,o,i){return Wm(e.size),e.__iterate(function(a,s,l){o?(o=!1,r=a):r=t.call(n,r,a,s,l)},i),r}function Gbt(e,t){return t}function Hbt(e,t){return[t,e]}function EZ(e){return function(){return!e.apply(this,arguments)}}function lwe(e){return function(){return-e.apply(this,arguments)}}function cwe(){return $0(arguments)}function uwe(e,t){return e<t?1:e>t?-1:0}function Wbt(e){if(e.size===1/0)return 0;var t=J0(e),r=Ss(e),n=t?1:0;return e.__iterate(r?t?function(o,i){n=31*n+dwe(Hm(o),Hm(i))|0}:function(o,i){n=n+dwe(Hm(o),Hm(i))|0}:t?function(o){n=31*n+Hm(o)|0}:function(o){n=n+Hm(o)|0}),Kbt(e.size,n)}function Kbt(e,t){return t=Ek(t,3432918353),t=Ek(t<<15|t>>>-15,461845907),t=Ek(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Ek(t^t>>>16,2246822507),t=Ek(t^t>>>13,3266489909),t=U5(t^t>>>16),t}function dwe(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}function nTe(e,t){var r=Object.create(lC);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function NZ(){return fwe||(fwe=nTe(Dk()))}function Ybt(e){if(aC(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(ey(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}function f$(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function m$(e){return e.constructor.displayName||e.constructor.name||"Record"}function bA(e){return GZ(e._keys.map(function(t){return[t,e.get(t)]}))}function Xbt(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(r){Bk(this.__ownerID,"Cannot set on an immutable record."),this.set(t,r)}})}catch{}}var Vk,ja,Km,sf,pi,gwe,k5,M5,yd,Gp,iC,xA,ywe,vwe,Ox,SA,Zm,$m,kZ,bwe,F5,ki,_A,Yf,Fx,Cg,CA,mA,qZ,nbt,GCe,Cwe,Ek,ibt,KCe,YCe,RZ,OZ,XCe,wZ,oC,fbt,mbt,TZ,AZ,V5,Awe,Pwe,Iwe,vbt,_bt,Jm,ds,Lk,hA,Fk,gA,yb,kbt,JCe,Fbt,Nbt,Ubt,Wwe,ry,tc,Bx,Rk,rc,nwe,Xwe,u$,cf,iwe,Zwe,z5,Uu,awe,zbt,IZ,vd,Hk,TA,vA,Qm,lC,fwe,Zc,Ja,vb=M(()=>{Vk="delete",ja=5,Km=1<<ja,sf=Km-1,pi={};gwe="@@__IMMUTABLE_ITERABLE__@@";k5="@@__IMMUTABLE_KEYED__@@";M5="@@__IMMUTABLE_INDEXED__@@";yd=function(t){return Xm(t)?t:Yf(t)},Gp=(function(e){function t(r){return Ss(r)?r:Fx(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(yd),iC=(function(e){function t(r){return jp(r)?r:Cg(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(yd),xA=(function(e){function t(r){return Xm(r)&&!VZ(r)?r:CA(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(yd);yd.Keyed=Gp;yd.Indexed=iC;yd.Set=xA;ywe="@@__IMMUTABLE_SEQ__@@";vwe="@@__IMMUTABLE_RECORD__@@";Ox="@@__IMMUTABLE_ORDERED__@@";SA=0,Zm=1,$m=2,kZ=typeof Symbol=="function"&&Symbol.iterator,bwe="@@iterator",F5=kZ||bwe,ki=function(t){this.next=t};ki.prototype.toString=function(){return"[Iterator]"};ki.KEYS=SA;ki.VALUES=Zm;ki.ENTRIES=$m;ki.prototype.inspect=ki.prototype.toSource=function(){return this.toString()};ki.prototype[F5]=function(){return this};_A=Object.prototype.hasOwnProperty;Yf=(function(e){function t(r){return r==null?jZ():ey(r)?r.toSeq():obt(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,o){var i=this._cache;if(i){for(var a=i.length,s=0;s!==a;){var l=i[o?a-++s:s++];if(n(l[1],l[0],this)===!1)break}return s}return this.__iterateUncached(n,o)},t.prototype.__iterator=function(n,o){var i=this._cache;if(i){var a=i.length,s=0;return new ki(function(){if(s===a)return lf();var l=i[o?a-++s:s++];return _s(n,l[0],l[1])})}return this.__iteratorUncached(n,o)},t})(yd),Fx=(function(e){function t(r){return r==null?jZ().toKeyedSeq():Xm(r)?Ss(r)?r.toSeq():r.fromEntrySeq():aC(r)?r.toSeq():GZ(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t})(Yf),Cg=(function(e){function t(r){return r==null?jZ():Xm(r)?Ss(r)?r.entrySeq():r.toIndexedSeq():aC(r)?r.toSeq().entrySeq():_we(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t})(Yf),CA=(function(e){function t(r){return(Xm(r)&&!VZ(r)?r:Cg(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t})(Yf);Yf.isSeq=zZ;Yf.Keyed=Fx;Yf.Set=CA;Yf.Indexed=Cg;Yf.prototype[ywe]=!0;mA=(function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return this.has(n)?this._array[Rx(this,n)]:o},t.prototype.__iterate=function(n,o){for(var i=this._array,a=i.length,s=0;s!==a;){var l=o?a-++s:s++;if(n(i[l],l,this)===!1)break}return s},t.prototype.__iterator=function(n,o){var i=this._array,a=i.length,s=0;return new ki(function(){if(s===a)return lf();var l=o?a-++s:s++;return _s(n,l,i[l])})},t})(Cg),qZ=(function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return o!==void 0&&!this.has(n)?o:this._object[n]},t.prototype.has=function(n){return _A.call(this._object,n)},t.prototype.__iterate=function(n,o){for(var i=this._object,a=this._keys,s=a.length,l=0;l!==s;){var c=a[o?s-++l:l++];if(n(i[c],c,this)===!1)break}return l},t.prototype.__iterator=function(n,o){var i=this._object,a=this._keys,s=a.length,l=0;return new ki(function(){if(l===s)return lf();var c=a[o?s-++l:l++];return _s(n,c,i[c])})},t})(Fx);qZ.prototype[Ox]=!0;nbt=(function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,o){if(o)return this.cacheResult().__iterate(n,o);var i=this._collection,a=MZ(i),s=0;if(jCe(a))for(var l;!(l=a.next()).done&&n(l.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var i=this._collection,a=MZ(i);if(!jCe(a))return new ki(lf);var s=0;return new ki(function(){var l=a.next();return l.done?l:_s(n,s++,l.value)})},t})(Cg);Cwe="@@__IMMUTABLE_MAP__@@";Ek=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,o=r&65535;return n*o+((t>>>16)*o+n*(r>>>16)<<16>>>0)|0};ibt=Object.prototype.valueOf;KCe=Object.isExtensible,YCe=(function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}})();RZ=typeof WeakMap=="function";RZ&&(OZ=new WeakMap);XCe=Object.create(null),wZ=0,oC="__immutablehash__";typeof Symbol=="function"&&(oC=Symbol(oC));fbt=16,mbt=255,TZ=0,AZ={},V5=(function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return this._iter.get(n,o)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,o=KZ(this,!0);return this._useKeys||(o.valueSeq=function(){return n._iter.toSeq().reverse()}),o},t.prototype.map=function(n,o){var i=this,a=Dwe(this,n,o);return this._useKeys||(a.valueSeq=function(){return i._iter.toSeq().map(n,o)}),a},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(a,s){return n(a,s,i)},o)},t.prototype.__iterator=function(n,o){return this._iter.__iterator(n,o)},t})(Fx);V5.prototype[Ox]=!0;Awe=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,o){var i=this,a=0;return o&&fA(this),this._iter.__iterate(function(s){return n(s,o?i.size-++a:a++,i)},o)},t.prototype.__iterator=function(n,o){var i=this,a=this._iter.__iterator(Zm,o),s=0;return o&&fA(this),new ki(function(){var l=a.next();return l.done?l:_s(n,o?i.size-++s:s++,l.value,l)})},t})(Cg),Pwe=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(a){return n(a,a,i)},o)},t.prototype.__iterator=function(n,o){var i=this._iter.__iterator(Zm,o);return new ki(function(){var a=i.next();return a.done?a:_s(n,a.value,a.value,a)})},t})(CA),Iwe=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(a){if(a){$Ce(a);var s=Xm(a);return n(s?a.get(1):a[1],s?a.get(0):a[0],i)}},o)},t.prototype.__iterator=function(n,o){var i=this._iter.__iterator(Zm,o);return new ki(function(){for(;;){var a=i.next();if(a.done)return a;var s=a.value;if(s){$Ce(s);var l=Xm(s);return _s(n,l?s.get(0):s[0],l?s.get(1):s[1],a)}}})},t})(Fx);Awe.prototype.cacheResult=V5.prototype.cacheResult=Pwe.prototype.cacheResult=Iwe.prototype.cacheResult=ZZ;vbt=(function(e){function t(r){this._wrappedIterables=r.flatMap(function(n){return n._wrappedIterables?n._wrappedIterables:[n]}),this.size=this._wrappedIterables.reduce(function(n,o){if(n!==void 0){var i=o.size;if(i!==void 0)return n+i}},0),this[k5]=this._wrappedIterables[0][k5],this[M5]=this._wrappedIterables[0][M5],this[Ox]=this._wrappedIterables[0][Ox]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,o){if(this._wrappedIterables.length!==0){if(o)return this.cacheResult().__iterate(n,o);for(var i=0,a=Ss(this),s=a?$m:Zm,l=this._wrappedIterables[i].__iterator(s,o),c=!0,u=0;c;){for(var d=l.next();d.done;){if(i++,i===this._wrappedIterables.length)return u;l=this._wrappedIterables[i].__iterator(s,o),d=l.next()}var f=a?n(d.value[1],d.value[0],this):n(d.value,u,this);c=f!==!1,u++}return u}},t.prototype.__iteratorUncached=function(n,o){var i=this;if(this._wrappedIterables.length===0)return new ki(lf);if(o)return this.cacheResult().__iterator(n,o);var a=0,s=this._wrappedIterables[a].__iterator(n,o);return new ki(function(){for(var l=s.next();l.done;){if(a++,a===i._wrappedIterables.length)return l;s=i._wrappedIterables[a].__iterator(n,o),l=s.next()}return l})},t})(Yf);_bt=Object.prototype.toString;Jm=(function(e){function t(r){return r==null?Q0():WZ(r)&&!J0(r)?r:Q0().withMutations(function(n){var o=e(r);Wm(o.size),o.forEach(function(i,a){return n.set(a,i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,o){return this._root?this._root.get(0,void 0,n,o):o},t.prototype.set=function(n,o){return ewe(this,n,o)},t.prototype.remove=function(n){return ewe(this,n,pi)},t.prototype.deleteAll=function(n){var o=yd(n);return o.size===0?this:this.withMutations(function(i){o.forEach(function(a){return i.remove(a)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Q0()},t.prototype.sort=function(n){return rc(pA(this,n))},t.prototype.sortBy=function(n,o){return rc(pA(this,o,n))},t.prototype.map=function(n,o){var i=this;return this.withMutations(function(a){a.forEach(function(s,l){a.set(l,n.call(o,s,l,i))})})},t.prototype.__iterator=function(n,o){return new kbt(this,n,o)},t.prototype.__iterate=function(n,o){var i=this,a=0;return this._root&&this._root.iterate(function(s){return a++,n(s[1],s[0],i)},o),a},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?a$(this.size,this._root,n,this.__hash):this.size===0?Q0():(this.__ownerID=n,this.__altered=!1,this)},t})(Gp);Jm.isMap=WZ;ds=Jm.prototype;ds[Cwe]=!0;ds[Vk]=ds.remove;ds.removeAll=ds.deleteAll;ds.setIn=$Z;ds.removeIn=ds.deleteIn=QZ;ds.update=JZ;ds.updateIn=e$;ds.merge=ds.concat=Uwe;ds.mergeWith=Vwe;ds.mergeDeep=qwe;ds.mergeDeepWith=jwe;ds.mergeIn=n$;ds.mergeDeepIn=o$;ds.withMutations=qk;ds.wasAltered=i$;ds.asImmutable=Gk;ds["@@transducer/init"]=ds.asMutable=jk;ds["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};ds["@@transducer/result"]=function(e){return e.asImmutable()};Lk=function(t,r){this.ownerID=t,this.entries=r};Lk.prototype.get=function(t,r,n,o){for(var i=this.entries,a=0,s=i.length;a<s;a++)if(Ym(n,i[a][0]))return i[a][1];return o};Lk.prototype.update=function(t,r,n,o,i,a,s){for(var l=i===pi,c=this.entries,u=0,d=c.length;u<d&&!Ym(o,c[u][0]);u++);var f=u<d;if(f?c[u][1]===i:l)return this;if(qp(s),(l||!f)&&qp(a),!(l&&c.length===1)){if(!f&&!l&&c.length>=Fbt)return Mbt(t,c,o,i);var m=t&&t===this.ownerID,p=m?c:$0(c);return f?l?u===d-1?p.pop():p[u]=p.pop():p[u]=[o,i]:p.push([o,i]),m?(this.entries=p,this):new Lk(t,p)}};hA=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};hA.prototype.get=function(t,r,n,o){r===void 0&&(r=Hm(n));var i=1<<((t===0?r:r>>>t)&sf),a=this.bitmap;return(a&i)===0?o:this.nodes[Gwe(a&i-1)].get(t+ja,r,n,o)};hA.prototype.update=function(t,r,n,o,i,a,s){n===void 0&&(n=Hm(o));var l=(r===0?n:n>>>r)&sf,c=1<<l,u=this.bitmap,d=(u&c)!==0;if(!d&&i===pi)return this;var f=Gwe(u&c-1),m=this.nodes,p=d?m[f]:void 0,h=s$(p,t,r+ja,n,o,i,a,s);if(h===p)return this;if(!d&&h&&m.length>=Nbt)return Rbt(t,m,u,l,h);if(d&&!h&&m.length===2&&twe(m[f^1]))return m[f^1];if(d&&h&&m.length===1&&twe(h))return h;var g=t&&t===this.ownerID,y=d?h?u:u^c:u|c,b=d?h?Hwe(m,f,h,g):Lbt(m,f,g):Obt(m,f,h,g);return g?(this.bitmap=y,this.nodes=b,this):new hA(t,y,b)};Fk=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};Fk.prototype.get=function(t,r,n,o){r===void 0&&(r=Hm(n));var i=(t===0?r:r>>>t)&sf,a=this.nodes[i];return a?a.get(t+ja,r,n,o):o};Fk.prototype.update=function(t,r,n,o,i,a,s){n===void 0&&(n=Hm(o));var l=(r===0?n:n>>>r)&sf,c=i===pi,u=this.nodes,d=u[l];if(c&&!d)return this;var f=s$(d,t,r+ja,n,o,i,a,s);if(f===d)return this;var m=this.count;if(!d)m++;else if(!f&&(m--,m<Ubt))return Bbt(t,u,m,l);var p=t&&t===this.ownerID,h=Hwe(u,l,f,p);return p?(this.count=m,this.nodes=h,this):new Fk(t,m,h)};gA=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entries=n};gA.prototype.get=function(t,r,n,o){for(var i=this.entries,a=0,s=i.length;a<s;a++)if(Ym(n,i[a][0]))return i[a][1];return o};gA.prototype.update=function(t,r,n,o,i,a,s){n===void 0&&(n=Hm(o));var l=i===pi;if(n!==this.keyHash)return l?this:(qp(s),qp(a),l$(this,t,r,n,[o,i]));for(var c=this.entries,u=0,d=c.length;u<d&&!Ym(o,c[u][0]);u++);var f=u<d;if(f?c[u][1]===i:l)return this;if(qp(s),(l||!f)&&qp(a),l&&d===2)return new yb(t,this.keyHash,c[u^1]);var m=t&&t===this.ownerID,p=m?c:$0(c);return f?l?u===d-1?p.pop():p[u]=p.pop():p[u]=[o,i]:p.push([o,i]),m?(this.entries=p,this):new gA(t,this.keyHash,p)};yb=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entry=n};yb.prototype.get=function(t,r,n,o){return Ym(n,this.entry[0])?this.entry[1]:o};yb.prototype.update=function(t,r,n,o,i,a,s){var l=i===pi,c=Ym(o,this.entry[0]);if(c?i===this.entry[1]:l)return this;if(qp(s),l){qp(a);return}return c?t&&t===this.ownerID?(this.entry[1]=i,this):new yb(t,this.keyHash,[o,i]):(qp(a),l$(this,t,r,Hm(o),[o,i]))};Lk.prototype.iterate=gA.prototype.iterate=function(e,t){for(var r=this.entries,n=0,o=r.length-1;n<=o;n++)if(e(r[t?o-n:n])===!1)return!1};hA.prototype.iterate=Fk.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,o=r.length-1;n<=o;n++){var i=r[t?o-n:n];if(i&&i.iterate(e,t)===!1)return!1}};yb.prototype.iterate=function(e,t){return e(this.entry)};kbt=(function(e){function t(r,n,o){this._type=n,this._reverse=o,this._stack=r._root&&QCe(r._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var n=this._type,o=this._stack;o;){var i=o.node,a=o.index++,s=void 0;if(i.entry){if(a===0)return PZ(n,i.entry)}else if(i.entries){if(s=i.entries.length-1,a<=s)return PZ(n,i.entries[this._reverse?s-a:a])}else if(s=i.nodes.length-1,a<=s){var l=i.nodes[this._reverse?s-a:a];if(l){if(l.entry)return PZ(n,l.entry);o=this._stack=QCe(l,o)}continue}o=this._stack=this._stack.__prev}return lf()},t})(ki);Fbt=Km/4,Nbt=Km/2,Ubt=Km/4,Wwe="@@__IMMUTABLE_LIST__@@";ry=(function(e){function t(r){var n=D5();if(r==null)return n;if(Kwe(r))return r;var o=e(r),i=o.size;return i===0?n:(Wm(i),i>0&&i<Km?Nk(0,i,ja,null,new Bx(o.toArray())):n.withMutations(function(a){a.setSize(i),o.forEach(function(s,l){return a.set(l,s)})}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(n,o){if(n=Rx(this,n),n>=0&&n<this.size){n+=this._origin;var i=Ywe(this,n);return i&&i.array[n&sf]}return o},t.prototype.set=function(n,o){return Vbt(this,n,o)},t.prototype.remove=function(n){return this.has(n)?n===0?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,o){return this.splice(n,0,o)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ja,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):D5()},t.prototype.push=function(){var n=arguments,o=this.size;return this.withMutations(function(i){Mx(i,0,o+n.length);for(var a=0;a<n.length;a++)i.set(o+a,n[a])})},t.prototype.pop=function(){return Mx(this,0,-1)},t.prototype.unshift=function(){var n=arguments;return this.withMutations(function(o){Mx(o,-n.length);for(var i=0;i<n.length;i++)o.set(i,n[i])})},t.prototype.shift=function(){return Mx(this,1)},t.prototype.shuffle=function(n){return n===void 0&&(n=Math.random),this.withMutations(function(o){for(var i=o.size,a,s;i;)a=Math.floor(n()*i--),s=o.get(a),o.set(a,o.get(i)),o.set(i,s)})},t.prototype.concat=function(){for(var n=arguments,o=[],i=0;i<arguments.length;i++){var a=n[i],s=e(typeof a!="string"&&xwe(a)?a:[a]);s.size!==0&&o.push(s)}return o.length===0?this:this.size===0&&!this.__ownerID&&o.length===1?this.constructor(o[0]):this.withMutations(function(l){o.forEach(function(c){return c.forEach(function(u){return l.push(u)})})})},t.prototype.setSize=function(n){return Mx(this,0,n)},t.prototype.map=function(n,o){var i=this;return this.withMutations(function(a){for(var s=0;s<i.size;s++)a.set(s,n.call(o,a.get(s),s,i))})},t.prototype.slice=function(n,o){var i=this.size;return O5(n,o,i)?this:Mx(this,zk(n,i),L5(o,i))},t.prototype.__iterator=function(n,o){var i=o?this.size:0,a=rwe(this,o);return new ki(function(){var s=a();return s===Rk?lf():_s(n,o?--i:i++,s)})},t.prototype.__iterate=function(n,o){for(var i=o?this.size:0,a=rwe(this,o),s;(s=a())!==Rk&&n(s,o?--i:i++,this)!==!1;);return i},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?Nk(this._origin,this._capacity,this._level,this._root,this._tail,n,this.__hash):this.size===0?D5():(this.__ownerID=n,this.__altered=!1,this)},t})(iC);ry.isList=Kwe;tc=ry.prototype;tc[Wwe]=!0;tc[Vk]=tc.remove;tc.merge=tc.concat;tc.setIn=$Z;tc.deleteIn=tc.removeIn=QZ;tc.update=JZ;tc.updateIn=e$;tc.mergeIn=n$;tc.mergeDeepIn=o$;tc.withMutations=qk;tc.wasAltered=i$;tc.asImmutable=Gk;tc["@@transducer/init"]=tc.asMutable=jk;tc["@@transducer/step"]=function(e,t){return e.push(t)};tc["@@transducer/result"]=function(e){return e.asImmutable()};Bx=function(t,r){this.array=t,this.ownerID=r};Bx.prototype.removeBefore=function(t,r,n){if((n&(1<<r+ja)-1)===0||this.array.length===0)return this;var o=n>>>r&sf;if(o>=this.array.length)return new Bx([],t);var i=o===0,a;if(r>0){var s=this.array[o];if(a=s&&s.removeBefore(t,r-ja,n),a===s&&i)return this}if(i&&!a)return this;var l=yA(this,t);if(!i)for(var c=0;c<o;c++)l.array[c]=void 0;return a&&(l.array[o]=a),l};Bx.prototype.removeAfter=function(t,r,n){if(n===(r?1<<r+ja:Km)||this.array.length===0)return this;var o=n-1>>>r&sf;if(o>=this.array.length)return this;var i;if(r>0){var a=this.array[o];if(i=a&&a.removeAfter(t,r-ja,n),i===a&&o===this.array.length-1)return this}var s=yA(this,t);return s.array.splice(o+1),i&&(s.array[o]=i),s};Rk={};rc=(function(e){function t(r){return r==null?Dk():wwe(r)?r:Dk().withMutations(function(n){var o=Gp(r);Wm(o.size),o.forEach(function(i,a){return n.set(a,i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(n,o){var i=this._map.get(n);return i!==void 0?this._list.get(i)[1]:o},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Dk()},t.prototype.set=function(n,o){return owe(this,n,o)},t.prototype.remove=function(n){return owe(this,n,pi)},t.prototype.__iterate=function(n,o){var i=this;return this._list.__iterate(function(a){return a&&n(a[1],a[0],i)},o)},t.prototype.__iterator=function(n,o){return this._list.fromEntrySeq().__iterator(n,o)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var o=this._map.__ensureOwner(n),i=this._list.__ensureOwner(n);return n?c$(o,i,n,this.__hash):this.size===0?Dk():(this.__ownerID=n,this.__altered=!1,this._map=o,this._list=i,this)},t})(Jm);rc.isOrderedMap=wwe;rc.prototype[Ox]=!0;rc.prototype[Vk]=rc.prototype.remove;Xwe="@@__IMMUTABLE_STACK__@@";u$=(function(e){function t(r){return r==null?I5():FZ(r)?r:I5().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,o){var i=this._head;for(n=Rx(this,n);i&&n--;)i=i.next;return i?i.value:o},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var o=this.size+arguments.length,i=this._head,a=arguments.length-1;a>=0;a--)i={value:n[a],next:i};return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):kk(o,i)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&FZ(n))return n;Wm(n.size);var o=this.size,i=this._head;return n.__iterate(function(a){o++,i={value:a,next:i}},!0),this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):kk(o,i)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):I5()},t.prototype.slice=function(n,o){if(O5(n,o,this.size))return this;var i=zk(n,this.size),a=L5(o,this.size);if(a!==this.size)return e.prototype.slice.call(this,n,o);for(var s=this.size-i,l=this._head;i--;)l=l.next;return this.__ownerID?(this.size=s,this._head=l,this.__hash=void 0,this.__altered=!0,this):kk(s,l)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?kk(this.size,this._head,n,this.__hash):this.size===0?I5():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,o){var i=this;if(o)return new mA(this.toArray()).__iterate(function(l,c){return n(l,c,i)},o);for(var a=0,s=this._head;s&&n(s.value,a++,this)!==!1;)s=s.next;return a},t.prototype.__iterator=function(n,o){if(o)return new mA(this.toArray()).__iterator(n,o);var i=0,a=this._head;return new ki(function(){if(a){var s=a.value;return a=a.next,_s(n,i++,s)}return lf()})},t})(iC);u$.isStack=FZ;cf=u$.prototype;cf[Xwe]=!0;cf.shift=cf.pop;cf.unshift=cf.push;cf.unshiftAll=cf.pushAll;cf.withMutations=qk;cf.wasAltered=i$;cf.asImmutable=Gk;cf["@@transducer/init"]=cf.asMutable=jk;cf["@@transducer/step"]=function(e,t){return e.unshift(t)};cf["@@transducer/result"]=function(e){return e.asImmutable()};Zwe="@@__IMMUTABLE_SET__@@";z5=(function(e){function t(r){return r==null?Mk():d$(r)&&!J0(r)?r:Mk().withMutations(function(n){var o=e(r);Wm(o.size),o.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Gp(n).keySeq())},t.intersect=function(n){return n=yd(n).toArray(),n.length?Uu.intersect.apply(t(n.pop()),n):Mk()},t.union=function(n){return n=yd(n).toArray(),n.length?Uu.union.apply(t(n.pop()),n):Mk()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return E5(this,this._map.set(n,n))},t.prototype.remove=function(n){return E5(this,this._map.remove(n))},t.prototype.clear=function(){return E5(this,this._map.clear())},t.prototype.map=function(n,o){var i=this,a=!1,s=E5(this,this._map.mapEntries(function(l){var c=l[1],u=n.call(o,c,c,i);return u!==c&&(a=!0),[u,u]},o));return a?s:this},t.prototype.union=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return n=n.filter(function(i){return i.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(i){for(var a=0;a<n.length;a++)typeof n[a]=="string"?i.add(n[a]):e(n[a]).forEach(function(s){return i.add(s)})})},t.prototype.intersect=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(n.length===0)return this;n=n.map(function(a){return e(a)});var i=[];return this.forEach(function(a){n.every(function(s){return s.includes(a)})||i.push(a)}),this.withMutations(function(a){i.forEach(function(s){a.remove(s)})})},t.prototype.subtract=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(n.length===0)return this;n=n.map(function(a){return e(a)});var i=[];return this.forEach(function(a){n.some(function(s){return s.includes(a)})&&i.push(a)}),this.withMutations(function(a){i.forEach(function(s){a.remove(s)})})},t.prototype.sort=function(n){return Qm(pA(this,n))},t.prototype.sortBy=function(n,o){return Qm(pA(this,o,n))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(n,o){var i=this;return this._map.__iterate(function(a){return n(a,a,i)},o)},t.prototype.__iterator=function(n,o){return this._map.__iterator(n,o)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var o=this._map.__ensureOwner(n);return n?this.__make(o,n):this.size===0?this.__empty():(this.__ownerID=n,this._map=o,this)},t})(xA);z5.isSet=d$;Uu=z5.prototype;Uu[Zwe]=!0;Uu[Vk]=Uu.remove;Uu.merge=Uu.concat=Uu.union;Uu.withMutations=qk;Uu.asImmutable=Gk;Uu["@@transducer/init"]=Uu.asMutable=jk;Uu["@@transducer/step"]=function(e,t){return e.add(t)};Uu["@@transducer/result"]=function(e){return e.asImmutable()};Uu.__empty=Mk;Uu.__make=Jwe;zbt=(function(e){function t(r,n,o){if(o===void 0&&(o=1),!(this instanceof t))return new t(r,n,o);if(Bk(o!==0,"Cannot step a Range by 0"),Bk(r!==void 0,"You must define a start value when using Range"),Bk(n!==void 0,"You must define an end value when using Range"),o=Math.abs(o),n<r&&(o=-o),this._start=r,this._end=n,this._step=o,this.size=Math.max(0,Math.ceil((n-r)/o-1)+1),this.size===0){if(IZ)return IZ;IZ=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(n,o){return this.has(n)?this._start+Rx(this,n)*this._step:o},t.prototype.includes=function(n){var o=(n-this._start)/this._step;return o>=0&&o<this.size&&o===Math.floor(o)},t.prototype.slice=function(n,o){return O5(n,o,this.size)?this:(n=zk(n,this.size),o=L5(o,this.size),o<=n?new t(0,0):new t(this.get(n,this._end),this.get(o,this._end),this._step))},t.prototype.indexOf=function(n){var o=n-this._start;if(o%this._step===0){var i=o/this._step;if(i>=0&&i<this.size)return i}return-1},t.prototype.lastIndexOf=function(n){return this.indexOf(n)},t.prototype.__iterate=function(n,o){for(var i=this.size,a=this._step,s=o?this._start+(i-1)*a:this._start,l=0;l!==i&&n(s,o?i-++l:l++,this)!==!1;)s+=o?-a:a;return l},t.prototype.__iterator=function(n,o){var i=this.size,a=this._step,s=o?this._start+(i-1)*a:this._start,l=0;return new ki(function(){if(l===i)return lf();var c=s;return s+=o?-a:a,_s(n,o?i-++l:l++,c)})},t.prototype.equals=function(n){return n instanceof t?this._start===n._start&&this._end===n._end&&this._step===n._step:Qwe(this,n)},t})(Cg);yd.Iterator=ki;sC(yd,{toArray:function(){Wm(this.size);var t=new Array(this.size||0),r=Ss(this),n=0;return this.__iterate(function(o,i){t[n++]=r?[i,o]:o}),t},toIndexedSeq:function(){return new Awe(this)},toJS:function(){return R5(this)},toKeyedSeq:function(){return new V5(this,!0)},toMap:function(){return Jm(this.toKeyedSeq())},toObject:rTe,toOrderedMap:function(){return rc(this.toKeyedSeq())},toOrderedSet:function(){return Qm(Ss(this)?this.valueSeq():this)},toSet:function(){return z5(Ss(this)?this.valueSeq():this)},toSetSeq:function(){return new Pwe(this)},toSeq:function(){return jp(this)?this.toIndexedSeq():Ss(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return u$(Ss(this)?this.valueSeq():this)},toList:function(){return ry(Ss(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,r){return this.size===0?t+r:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+r},concat:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return qa(this,bbt(this,t))},includes:function(t){return this.some(function(r){return Ym(r,t)})},entries:function(){return this.__iterator($m)},every:function(t,r){Wm(this.size);var n=!0;return this.__iterate(function(o,i,a){if(!t.call(r,o,i,a))return n=!1,!1}),n},filter:function(t,r){return qa(this,kwe(this,t,r,!0))},partition:function(t,r){return gbt(this,t,r)},find:function(t,r,n){var o=this.findEntry(t,r);return o?o[1]:n},forEach:function(t,r){return Wm(this.size),this.__iterate(r?t.bind(r):t)},join:function(t){Wm(this.size),t=t!==void 0?""+t:",";var r="",n=!0;return this.__iterate(function(o){n?n=!1:r+=t,r+=o!=null?o.toString():""}),r},keys:function(){return this.__iterator(SA)},map:function(t,r){return qa(this,Dwe(this,t,r))},reduce:function(t,r,n){return swe(this,t,r,n,arguments.length<2,!1)},reduceRight:function(t,r,n){return swe(this,t,r,n,arguments.length<2,!0)},reverse:function(){return qa(this,KZ(this,!0))},slice:function(t,r){return qa(this,YZ(this,t,r,!0))},some:function(t,r){Wm(this.size);var n=!1;return this.__iterate(function(o,i,a){if(t.call(r,o,i,a))return n=!0,!1}),n},sort:function(t){return qa(this,pA(this,t))},values:function(){return this.__iterator(Zm)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,r){return fA(t?this.toSeq().filter(t,r):this)},countBy:function(t,r){return pbt(this,t,r)},equals:function(t){return Qwe(this,t)},entrySeq:function(){var t=this;if(t._cache)return new mA(t._cache);var r=t.toSeq().map(Hbt).toIndexedSeq();return r.fromEntrySeq=function(){return t.toSeq()},r},filterNot:function(t,r){return this.filter(EZ(t),r)},findEntry:function(t,r,n){var o=n;return this.__iterate(function(i,a,s){if(t.call(r,i,a,s))return o=[a,i],!1}),o},findKey:function(t,r){var n=this.findEntry(t,r);return n&&n[0]},findLast:function(t,r,n){return this.toKeyedSeq().reverse().find(t,r,n)},findLastEntry:function(t,r,n){return this.toKeyedSeq().reverse().findEntry(t,r,n)},findLastKey:function(t,r){return this.toKeyedSeq().reverse().findKey(t,r)},first:function(t){return this.find(mwe,null,t)},flatMap:function(t,r){return qa(this,xbt(this,t,r))},flatten:function(t){return qa(this,Bwe(this,t,!0))},fromEntrySeq:function(){return new Iwe(this)},get:function(t,r){return this.find(function(n,o){return Ym(o,t)},void 0,r)},getIn:tTe,groupBy:function(t,r){return hbt(this,t,r)},has:function(t){return this.get(t,pi)!==pi},hasIn:jbt,isSubset:function(t){return t=typeof t.includes=="function"?t:yd(t),this.every(function(r){return t.includes(r)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:yd(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(r){return Ym(r,t)})},keySeq:function(){return this.toSeq().map(Gbt).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return A5(this,t)},maxBy:function(t,r){return A5(this,r,t)},min:function(t){return A5(this,t?lwe(t):uwe)},minBy:function(t,r){return A5(this,r?lwe(r):uwe,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,r){return qa(this,Mwe(this,t,r,!0))},skipUntil:function(t,r){return this.skipWhile(EZ(t),r)},sortBy:function(t,r){return qa(this,pA(this,r,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,r){return qa(this,ybt(this,t,r))},takeUntil:function(t,r){return this.takeWhile(EZ(t),r)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=Wbt(this))}});vd=yd.prototype;vd[gwe]=!0;vd[F5]=vd.values;vd.toJSON=vd.toArray;vd.__toStringMapper=Ok;vd.inspect=vd.toSource=function(){return this.toString()};vd.chain=vd.flatMap;vd.contains=vd.includes;sC(Gp,{flip:function(){return qa(this,Ewe(this))},mapEntries:function(t,r){var n=this,o=0;return qa(this,this.toSeq().map(function(i,a){return t.call(r,[a,i],o++,n)}).fromEntrySeq())},mapKeys:function(t,r){var n=this;return qa(this,this.toSeq().flip().map(function(o,i){return t.call(r,o,i,n)}).flip())}});Hk=Gp.prototype;Hk[k5]=!0;Hk[F5]=vd.entries;Hk.toJSON=rTe;Hk.__toStringMapper=function(e,t){return Ok(t)+": "+Ok(e)};sC(iC,{toKeyedSeq:function(){return new V5(this,!1)},filter:function(t,r){return qa(this,kwe(this,t,r,!1))},findIndex:function(t,r){var n=this.findEntry(t,r);return n?n[0]:-1},indexOf:function(t){var r=this.keyOf(t);return r===void 0?-1:r},lastIndexOf:function(t){var r=this.lastKeyOf(t);return r===void 0?-1:r},reverse:function(){return qa(this,KZ(this,!1))},slice:function(t,r){return qa(this,YZ(this,t,r,!1))},splice:function(t,r){var n=arguments.length;if(r=Math.max(r||0,0),n===0||n===2&&!r)return this;t=zk(t,t<0?this.count():this.size);var o=this.slice(0,t);return qa(this,n===1?o:o.concat($0(arguments,2),this.slice(t+r)))},findLastIndex:function(t,r){var n=this.findLastEntry(t,r);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return qa(this,Bwe(this,t,!1))},get:function(t,r){return t=Rx(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?r:this.find(function(n,o){return o===t},void 0,r)},has:function(t){return t=Rx(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.indexOf(t)!==-1)},interpose:function(t){return qa(this,Sbt(this,t))},interleave:function(){var t=[this].concat($0(arguments)),r=P5(this.toSeq(),Cg.of,t),n=r.flatten(!0);return r.size&&(n.size=r.size*t.length),qa(this,n)},keySeq:function(){return zbt(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,r){return qa(this,Mwe(this,t,r,!1))},zip:function(){var t=[this].concat($0(arguments));return qa(this,P5(this,cwe,t))},zipAll:function(){var t=[this].concat($0(arguments));return qa(this,P5(this,cwe,t,!0))},zipWith:function(t){var r=$0(arguments);return r[0]=this,qa(this,P5(this,t,r))}});TA=iC.prototype;TA[M5]=!0;TA[Ox]=!0;sC(xA,{get:function(t,r){return this.has(t)?t:r},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});vA=xA.prototype;vA.has=vd.includes;vA.contains=vA.includes;vA.keys=vA.values;sC(Fx,Hk);sC(Cg,TA);sC(CA,vA);Qm=(function(e){function t(r){return r==null?NZ():$we(r)?r:NZ().withMutations(function(n){var o=xA(r);Wm(o.size),o.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Gp(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t})(z5);Qm.isOrderedSet=$we;lC=Qm.prototype;lC[Ox]=!0;lC.zip=TA.zip;lC.zipWith=TA.zipWith;lC.zipAll=TA.zipAll;lC.__empty=NZ;lC.__make=nTe;Zc=function(t,r){var n;Ybt(t);var o=function(s){var l=this;if(s instanceof o)return s;if(!(this instanceof o))return new o(s);if(!n){n=!0;var c=Object.keys(t),u=i._indices={};i._name=r,i._keys=c,i._defaultValues=t;for(var d=0;d<c.length;d++){var f=c[d];u[f]=d,i[f]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+m$(this)+' with property "'+f+'" since that property name is part of the Record API.'):Xbt(i,f)}}return this.__ownerID=void 0,this._values=ry().withMutations(function(m){m.setSize(l._keys.length),Gp(s).forEach(function(p,h){m.set(l._indices[h],p===l._defaultValues[h]?void 0:p)})}),this},i=o.prototype=Object.create(Ja);return i.constructor=o,r&&(o.displayName=r),o};Zc.prototype.toString=function(){for(var t=m$(this)+" { ",r=this._keys,n,o=0,i=r.length;o!==i;o++)n=r[o],t+=(o?", ":"")+n+": "+Ok(this.get(n));return t+" }"};Zc.prototype.equals=function(t){return this===t||aC(t)&&bA(this).equals(bA(t))};Zc.prototype.hashCode=function(){return bA(this).hashCode()};Zc.prototype.has=function(t){return this._indices.hasOwnProperty(t)};Zc.prototype.get=function(t,r){if(!this.has(t))return r;var n=this._indices[t],o=this._values.get(n);return o===void 0?this._defaultValues[t]:o};Zc.prototype.set=function(t,r){if(this.has(t)){var n=this._values.set(this._indices[t],r===this._defaultValues[t]?void 0:r);if(n!==this._values&&!this.__ownerID)return f$(this,n)}return this};Zc.prototype.remove=function(t){return this.set(t)};Zc.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:f$(this,t)};Zc.prototype.wasAltered=function(){return this._values.wasAltered()};Zc.prototype.toSeq=function(){return bA(this)};Zc.prototype.toJS=function(){return R5(this)};Zc.prototype.entries=function(){return this.__iterator($m)};Zc.prototype.__iterator=function(t,r){return bA(this).__iterator(t,r)};Zc.prototype.__iterate=function(t,r){return bA(this).__iterate(t,r)};Zc.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._values.__ensureOwner(t);return t?f$(this,r,t):(this.__ownerID=t,this._values=r,this)};Zc.isRecord=aC;Zc.getDescriptiveName=m$;Ja=Zc.prototype;Ja[vwe]=!0;Ja[Vk]=Ja.remove;Ja.deleteIn=Ja.removeIn=QZ;Ja.getIn=tTe;Ja.hasIn=vd.hasIn;Ja.merge=Uwe;Ja.mergeWith=Vwe;Ja.mergeIn=n$;Ja.mergeDeep=qwe;Ja.mergeDeepWith=jwe;Ja.mergeDeepIn=o$;Ja.setIn=$Z;Ja.update=JZ;Ja.updateIn=e$;Ja.withMutations=qk;Ja.asMutable=jk;Ja.asImmutable=Gk;Ja[F5]=Ja.entries;Ja.toJSON=Ja.toObject=vd.toObject;Ja.inspect=Ja.toSource=function(){return this.toString()}});var nc,p$=M(()=>{Vt();Ue();(function(e){function t(o){let i={create(a){return{action:i,params:a}},id:En.create22(),definition:o,createDefaultParams(a,s){return o.params?_.getDefaultValues(o.params(a,s)):{}}};return i}e.create=t;function r(o){let i=o.definition;return t({from:i.from,display:i.display,params:i.params,isApplicable:o.definition.isApplicable?(a,s,l)=>o.definition.isApplicable(a,l):void 0,run({cell:a,state:s,params:l}){let c=s.build().to(a.transform.ref).apply(o,l);return s.updateTree(c)}})}e.fromTransformer=r;let n;(function(o){function i(a){return s=>t({from:a.from instanceof Array?a.from:a.from?[a.from]:[],display:typeof a.display=="string"?{name:a.display}:a.display?a.display:{name:"Unnamed State Action"},params:typeof a.params=="object"?()=>a.params:a.params?a.params:void 0,isApplicable:a.isApplicable,...typeof s=="function"?{run:s}:s})}o.build=a=>i(a)})(n=e.Builder||(e.Builder={})),e.build=n.build})(nc||(nc={}))});var ct,Wk=M(()=>{bb();Ue();p$();wc();(function(e){function t(h,g,y){return h.definition.params?h.definition.params(g,y):{}}e.getParamDefinition=t;function r(h){return!!h&&typeof h.toAction=="function"&&typeof h.apply=="function"}e.is=r;let n;(function(h){h[h.Unchanged=0]="Unchanged",h[h.Updated=1]="Updated",h[h.Recreate=2]="Recreate",h[h.Null=3]="Null"})(n=e.UpdateResult||(e.UpdateResult={}));let o=new Map,i=new Map;function a(h){for(let g of h.definition.from)i.has(g.type)?i.get(g.type).push(h):i.set(g.type,[h])}function s(){return Array.from(o.values())}e.getAll=s;function l(h){let g=o.get(h);if(!g)throw new Error(`A transformer with signature '${h}' is not registered.`);return g}e.get=l;function c(h){return i.get(h)||[]}e.fromType=c;function u(h,g){let{name:y}=g,b=`${h}.${y}`;o.has(b)&&console.warn(`A transform with id '${y}' is already registered. Please pick a unique identifier for your transforms and/or register them only once. This is to ensure that transforms can be serialized and replayed.`);let x={apply(C,S,w){return Ur.create(C,x,S,w)},toAction(){return nc.fromTransformer(x)},namespace:h,id:b,definition:g,createDefaultParams(C,S){return g.params?_.getDefaultValues(g.params(C,S)):{}}};return o.set(b,x),a(x),x}e.create=u;function d(h){return g=>u(h,g)}e.factory=d;function f(h){return m.build(h)}e.builderFactory=f;let m;(function(h){function g(b,x){return C=>u(b,{name:x.name,from:x.from instanceof Array?x.from:[x.from],to:x.to instanceof Array?x.to:[x.to],display:typeof x.display=="string"?{name:x.display}:x.display?x.display:{name:S0(x.name.replace(/[-]/g," "))},params:typeof x.params=="object"?()=>x.params:x.params?x.params:void 0,isDecorator:x.isDecorator,...C})}function y(b){return x=>g(b,x)}h.build=y})(m=e.Builder||(e.Builder={}));function p(h){return m.build(h)}e.build=p,e.ROOT=u("build-in",{name:"root",from:[],to:[],display:{name:"Root",description:"For internal use."},apply(){throw new Error("should never be applied")},update(){return n.Unchanged}})})(ct||(ct={}))});var Ur,bb=M(()=>{Wk();Vt();tn();(function(e){e.RootRef="-=root=-";function t(b,x){return x?typeof x.isCollapsed<"u"&&b.isCollapsed!==x.isCollapsed||typeof x.isHidden<"u"&&b.isHidden!==x.isHidden||typeof x.isGhost<"u"&&b.isGhost!==x.isGhost||typeof x.isLocked<"u"&&b.isLocked!==x.isLocked:!1}e.isStateChange=t;function r(b,x){if(!x)return!1;let C=!1;for(let S of Object.keys(x)){let w=x[S],A=b[S];!!w!=!!A&&(C=!0,b[S]=w)}return C}e.assignState=r;function n(b,x){if(!x)return!1;let C=!1;for(let S of Object.keys(x)){let w=x[S],A=b[S];!!w!=!!A&&(C=!0,w!==void 0?b[S]=w:delete b[S])}for(let S of Object.keys(b)){let w=x[S],A=b[S];!!w!=!!A&&(C=!0,w!==void 0?b[S]=w:delete b[S])}return C}e.syncState=n;function o(b,x,C,S){let w=S&&S.ref?S.ref:En.create22(),A;return S&&S.tags&&(A=typeof S.tags=="string"?[S.tags]:S.tags,A.length===0?A=void 0:A.sort()),{parent:b,transformer:x,state:S?.state||{},tags:A,ref:w,dependsOn:S&&S.dependsOn,params:C,version:En.create22()}}e.create=o;function i(b,x){return{...b,params:x,version:En.create22()}}e.withParams=i;function a(b,x){return x?{...b,state:{...b.state,...x}}:b}e.withState=a;function s(b,x){let C;return x&&(C=typeof x=="string"?[x]:x,C.length===0?C=void 0:C.sort()),{...b,tags:C,version:En.create22()}}e.withTags=s;function l(b,x){let C;return x&&(C=typeof x=="string"?[x]:x,C.length===0?C=void 0:C.sort()),{...b,dependsOn:C,version:En.create22()}}e.withDependsOn=l;function c(b,x){return{...b,parent:x,version:En.create22()}}e.withParent=c;function u(b){return o(e.RootRef,ct.ROOT,{},{ref:e.RootRef,state:b})}e.createRoot=u;function d(b,x){return b.tags?b.tags.indexOf(x)>=0:!1}e.hasTag=d;function f(b,x){if(!b.tags)return typeof x!="string"&&x.length===0;if(typeof x=="string")return d(b,x);for(let C of x)if(b.tags.indexOf(C)<0)return!1;return!0}e.hasTags=f;let m={};function p(b){var x,C;let S;try{S=ZH((x=b.params)!==null&&x!==void 0?x:m)}catch{let A=b.transformer.definition.customSerialization?b.transformer.definition.customSerialization.toJSON:h;S=ZH(A((C=b.params)!==null&&C!==void 0?C:m))}b.version=S}e.setParamsHashVersion=p;function h(b){return b}function g(b){let x=b.transformer.definition.customSerialization?b.transformer.definition.customSerialization.toJSON:h,C;for(let S of Object.keys(b.state))b.state[S]&&(C||(C={}),C[S]=!0);return{parent:b.parent,transformer:b.transformer.id,params:b.params?x(b.params):void 0,state:C,tags:b.tags,ref:b.ref,dependsOn:b.dependsOn,version:b.version}}e.toJSON=g;function y(b){let x=ct.get(b.transformer),C=x.definition.customSerialization?x.definition.customSerialization.fromJSON:h;return{parent:b.parent,transformer:x,params:b.params?C(b.params):void 0,state:b.state||{},tags:b.tags,ref:b.ref,dependsOn:b.dependsOn,version:b.version}}e.fromJSON=y})(Ur||(Ur={}))});function Zbt(e,t){this.set(t,e.asImmutable())}function $bt(e,t){e.size===0?this.delete(t):this.set(t,e.asImmutable())}function Qbt(e){throw new Error(`Transform '${e}' is already present in the tree.`)}function Jbt(e){throw new Error(`Parent '${e}' must be present in the tree.`)}function Kk(e,t){if(!e.has(t))throw new Error(`Node '${t}' is not present in the tree.`)}var Yk,h$=M(()=>{vb();bb();q5();Aa();Jn();Yk=class{get childMutations(){return this._childMutations?this._childMutations:(this._childMutations=new Map,this._childMutations)}get dependencyMutations(){return this._dependencyMutations?this._dependencyMutations:(this._dependencyMutations=new Map,this._dependencyMutations)}changeNodes(){this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable())}changeChildren(){this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable())}changeDependencies(){this.changedDependencies||(this.changedDependencies=!0,this.dependencies=this.dependencies.asMutable())}get root(){return this.transforms.get(Ur.RootRef)}asTransient(){return this.asImmutable().asTransient()}addChild(t,r){if(this.changeChildren(),this.childMutations.has(t))this.childMutations.get(t).add(r);else{let n=this.children.get(t).asMutable();n.add(r),this.children.set(t,n),this.childMutations.set(t,n)}}removeChild(t,r){if(this.changeChildren(),this.childMutations.has(t))this.childMutations.get(t).remove(r);else{let n=this.children.get(t).asMutable();n.remove(r),this.children.set(t,n),this.childMutations.set(t,n)}}clearRoot(){let t=Ur.RootRef;if(this.children.get(t).size===0)return;this.changeChildren();let r=Qm();this.children.set(t,r),this.childMutations.set(t,r)}mutateDependency(t,r,n){let o=this.dependencyMutations.get(t);if(!o){let i=this.dependencies.get(t);if(!i&&n==="remove")return;this.changeDependencies(),o=i?i.asMutable():Qm().asMutable(),this.dependencyMutations.set(t,o),this.dependencies.set(t,o)}n==="add"?o.add(r):o.remove(r)}changeParent(t,r){Kk(this.transforms,t);let n=this.transforms.get(t);this.removeChild(n.parent,t),this.addChild(r,t),this.changeNodes(),this.transforms.set(t,Ur.withParent(n,r))}add(t){let r=t.ref;this.transforms.has(t.ref)&&this.transforms.get(t.ref).parent!==t.parent&&Qbt(t.ref);let n=this.children.get(t.parent);if(n||Jbt(t.parent),n.has(t.ref)||this.addChild(t.parent,t.ref),this.children.has(t.ref)||(this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable()),this.children.set(t.ref,Qm())),this.changeNodes(),this.transforms.set(r,t),t.dependsOn)for(let o of t.dependsOn)this.mutateDependency(o,r,"add");return this}setParams(t,r){Kk(this.transforms,t);let n=this.transforms.get(t);return F1(n.params,r)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,Ur.withParams(n,r)),!0)}setTags(t,r){Kk(this.transforms,t);let n=this.transforms.get(t),o=Ur.withTags(n,r);return s2(n.tags,o.tags)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,o),!0)}setDependsOn(t,r){Kk(this.transforms,t);let n=this.transforms.get(t),o=Ur.withDependsOn(n,r);return s2(n.dependsOn,o.dependsOn)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,o),!0)}assignState(t,r){Kk(this.transforms,t);let n=this.transforms.get(t);if(this._stateUpdates&&this._stateUpdates.has(t))return Ur.assignState(n.state,r),n;{this._stateUpdates||(this._stateUpdates=new Set),this._stateUpdates.add(n.ref),this.changeNodes();let o=Ur.withState(n,r);return this.transforms.set(t,o),o}}remove(t){let r=this.transforms.get(t);if(!r)return[];let n=zi.subtreePostOrder(this,r);if(t===Ur.RootRef){if(n.pop(),n.length===0)return n;this.clearRoot()}else{if(n.length===0)return n;this.removeChild(r.parent,r.ref)}this.changeNodes(),this.changeChildren();for(let i of n)this.transforms.delete(i.ref),this.children.delete(i.ref),this._childMutations&&this._childMutations.delete(i.ref);let o=[];for(let i of n){if(i.dependsOn)for(let a of i.dependsOn)this.transforms.has(a)&&this.mutateDependency(a,i.ref,"remove");if(this.dependencies.has(i.ref)){let a=this.dependencies.get(i.ref).toArray();this.changeDependencies(),this.dependencies.delete(i.ref),this._dependencyMutations&&this._dependencyMutations.delete(i.ref);for(let s of a)if(this.transforms.has(s))for(let l of this.remove(s))o[o.length]=l}}for(let i of o)n[n.length]=i;return n}asImmutable(){return!this.changedNodes&&!this.changedChildren&&!this._childMutations?this.tree:(this._childMutations&&this._childMutations.forEach(Zbt,this.children),this._dependencyMutations&&this._dependencyMutations.forEach($bt,this.dependencies),zi.create(this.changedNodes?this.transforms.asImmutable():this.transforms,this.changedChildren?this.children.asImmutable():this.children,this.changedDependencies?this.dependencies.asImmutable():this.dependencies))}constructor(t){this.tree=t,this.transforms=this.tree.transforms,this.children=this.tree.children,this.dependencies=this.tree.dependencies,this.changedNodes=!1,this.changedChildren=!1,this.changedDependencies=!1,this._childMutations=void 0,this._dependencyMutations=void 0,this._stateUpdates=void 0}}});var zi,q5=M(()=>{vb();bb();h$();(function(e){class t{get root(){return this.transforms.get(Ur.RootRef)}asTransient(){return new Yk(this)}constructor(w,A,T){this.transforms=w,this.children=A,this.dependencies=T}}function r(S){let w=S||Ur.createRoot();return n(Jm([[w.ref,w]]),Jm([[w.ref,Qm()]]),Jm())}e.createEmpty=r;function n(S,w,A){return new t(S,w,A)}e.create=n;function o(S){i(this,this.tree.transforms.get(S))}function i(S,w){let A=S.tree.children.get(w.ref);A&&A.size&&A.forEach(o,S),S.f(w,S.tree,S.state)}function a(S,w,A,T){let D={tree:S,state:A,f:T};return i(D,w),D.state}e.doPostOrder=a;function s(S){l(this,this.tree.transforms.get(S))}function l(S,w){let A=S.f(w,S.tree,S.state);if(typeof A=="boolean"&&!A)return;let T=S.tree.children.get(w.ref);T&&T.size&&T.forEach(s,S)}function c(S,w,A,T){let D={tree:S,state:A,f:T};return l(D,w),D.state}e.doPreOrder=c;function u(S,w,A){A.push(S)}function d(S,w){return a(S,w,[],u)}e.subtreePostOrder=d;function f(S,w,A){A.push(Ur.toJSON(S))}function m(S){let w=[];return c(S,S.root,w,f),{transforms:w}}e.toJSON=m;function p(S){let w=Jm().asMutable(),A=Jm().asMutable(),T=Jm().asMutable();for(let E of S.transforms){let I=Ur.fromJSON(E);w.set(I.ref,I),A.has(I.ref)||A.set(I.ref,Qm().asMutable()),I.ref!==I.parent&&A.get(I.parent).add(I.ref)}let D=new Set;for(let E of S.transforms){let I=E.ref;if(A.set(I,A.get(I).asImmutable()),!!E.dependsOn)for(let k of E.dependsOn)D.add(k),T.has(k)?T.get(k).add(I):T.set(k,Qm([I]).asMutable())}return D.forEach(E=>{T.set(E,T.get(E).asImmutable())}),n(w.asImmutable(),A.asImmutable(),T.asImmutable())}e.fromJSON=p;function h(S){console.log({tr:S.transforms.keySeq().toArray(),tr1:S.transforms.valueSeq().toArray().map(w=>w.ref),ch:S.children.keySeq().toArray()})}e.dump=h;function g(S,w,A){if(w===A)return!0;let D=S.children.get(w).values();for(;;){let E=D.next();if(E.done)return!1;if(g(S,E.value,A))return!0}}function y(S,w,A){return!S.transforms.has(w)||!S.transforms.has(A)?!1:g(S,w,A)}e.subtreeHasRef=y;function b(S,w){let A=S.children.get(w);if(A.size!==1)return w;let T=S.transforms.get(A.first());return T?.transformer.definition.isDecorator?b(S,T.ref):w}e.getDecoratorRoot=b;function x(S,w){for(let A of w){let T=S.transforms.get(A);T&&Ur.setParamsHashVersion(T)}}e.setParamHashVersion=x;function C(S,w){let A=new Map(w.transforms.map(T=>[T.ref,T]));for(let T of S.transforms){let D=A.get(T.ref);D&&(T.transformer!==D.transformer||T.version!==D.version||(T.params=D.params))}}e.reuseTransformParams=C})(zi||(zi={}))});var j5=M(()=>{q5();h$()});var ir,G5=M(()=>{j5();bb();(function(e){function t(X,Y){return r(X)(Y)}e.select=t;function r(X){let Y=X||c.root,ne;return o(Y)?ne=Y.compile():n(Y)?ne=c.byValue(Y).compile():i(Y)?ne=Y:ne=c.byRef(Y).compile(),ne}e.compile=r;function n(X){return X.transform!==void 0&&X.status!==void 0}function o(X){return X.compile!==void 0}function i(X){return typeof X=="function"}let a={select(X){return t(this,X||this.state)}};function s(X,Y){a[X]=function(...ne){return Y.call(void 0,this,...ne)}}function l(X){return Object.create(a,{compile:{writable:!1,configurable:!1,value:X}})}let c;(function(X){X.root=l(()=>re=>[re.cells.get(re.tree.root.ref)]);function Y(...re){return l(()=>ee=>{let le=[];for(let pe of re){let ke=ee.cells.get(pe);ke&&le.push(ke)}return le})}X.byRef=Y;function ne(...re){return l(()=>ee=>re)}X.byValue=ne;function K(re,ee=Ur.RootRef){return l(()=>le=>{let pe={roots:[],cells:le.cells,type:re.type};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,Q),pe.roots})}X.rootsOfType=K;function $(re,ee=Ur.RootRef){return l(()=>le=>{let pe={ret:[],cells:le.cells,type:re.type};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,ae),pe.ret})}X.ofType=$;function Z(re,ee=Ur.RootRef){return l(()=>le=>{let pe={ret:[],cells:le.cells,t:re};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,ye),pe.ret})}X.ofTransformer=Z;function de(re,ee=Ur.RootRef){return l(()=>le=>{let pe={ret:[],cells:le.cells,t:re};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,we),pe.ret})}X.ofTransformerWithError=de;function Q(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.obj&&pe.obj.type===le.type?(le.roots.push(pe),!1):!0}function ae(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.obj&&pe.obj.type===le.type&&le.ret.push(pe),!0}function ye(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.obj&&pe.transform.transformer===le.t&&le.ret.push(pe),!0}function we(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.status==="error"&&pe.transform.transformer===le.t&&le.ret.push(pe),!0}})(c=e.Generators||(e.Generators={})),s("flatMap",u);function u(X,Y){let ne=r(X);return l(()=>K=>{let $=[];for(let Z of ne(K))for(let de of Y(Z,K))$.push(de);return $})}e.flatMap=u,s("mapObject",d);function d(X,Y){let ne=r(X);return l(()=>K=>{let $=[];for(let Z of ne(K)){let de=Y(Z,K);de&&$.push(de)}return $})}e.mapObject=d,s("unique",f);function f(X){let Y=r(X);return l(()=>ne=>{let K=new Set,$=[];for(let Z of Y(ne))Z&&(K.has(Z.transform.ref)||(K.add(Z.transform.ref),$.push(Z)));return $})}e.unique=f,s("first",m);function m(X){let Y=r(X);return l(()=>ne=>{let K=Y(ne);return K.length?[K[0]]:[]})}e.first=m,s("filter",p);function p(X,Y){return u(X,ne=>Y(ne)?[ne]:[])}e.filter=p,s("withStatus",h);function h(X,Y){return p(X,ne=>ne.status===Y)}e.withStatus=h,s("withTag",g);function g(X,Y){return p(X,ne=>!!ne.transform.tags&&ne.transform.tags.indexOf(Y)>=0)}e.withTag=g,s("subtree",y);function y(X){return u(X,(Y,ne)=>{let K=[];return zi.doPreOrder(ne.tree,ne.tree.transforms.get(Y.transform.ref),K,($,Z,de)=>{de.push($.ref)}),K.map($=>ne.cells.get($))})}e.subtree=y,s("children",b);function b(X){return u(X,(Y,ne)=>{let K=[];return ne.tree.children.get(Y.transform.ref).forEach($=>K.push(ne.cells.get($))),K})}e.children=b,s("ofType",x);function x(X,Y){return p(X,ne=>ne.obj?ne.obj.type===Y.type:!1)}e.ofType=x,s("ancestor",C);function C(X,Y){return f(d(X,(ne,K)=>k(K.tree,K.cells,ne.transform.ref,Y)))}e.ancestor=C,s("ancestorOfType",S);function S(X,Y){return f(d(X,(ne,K)=>O(K.tree,K.cells,ne.transform.ref,Y)))}e.ancestorOfType=S,s("ancestorWithTransformer",w);function w(X,Y){return f(d(X,(ne,K)=>B(K.tree,K.cells,ne.transform.ref,Y)))}e.ancestorWithTransformer=w,s("withTransformer",A);function A(X,Y){return p(X,ne=>ne.transform.transformer===Y)}e.withTransformer=A,s("root",T);function T(X,Y){return f(d(X,(ne,K)=>R(K.tree,K.cells,ne.transform.ref,Y)))}e.root=T,s("rootOfType",D);function D(X,Y){return f(d(X,(ne,K)=>F(K.tree,K.cells,ne.transform.ref,Y)))}e.rootOfType=D,s("parent",E);function E(X){return f(d(X,(Y,ne)=>ne.cells.get(ne.tree.transforms.get(Y.transform.ref).parent)))}e.parent=E;function I(X,Y,ne,K,$){let Z=X.transforms.get(ne),de;for(;;){Z=X.transforms.get(Z.parent);let Q=Y.get(Z.ref);if(Q.obj&&K(Q)&&(de=Q,$)||Z.ref===Ur.RootRef)return de}}function k(X,Y,ne,K){return I(X,Y,ne,K,!0)}e.findAncestor=k;function R(X,Y,ne,K){return I(X,Y,ne,K,!1)}e.findRoot=R;function B(X,Y,ne,K){return k(X,Y,ne,Array.isArray(K)?$=>K.indexOf($.transform.transformer)>=0:$=>$.transform.transformer===K)}e.findAncestorWithTransformer=B;function O(X,Y,ne,K){return k(X,Y,ne,q(K))}e.findAncestorOfType=O;function F(X,Y,ne,K){return R(X,Y,ne,q(K))}e.findRootOfType=F;function q(X){return Array.isArray(X)?Y=>{for(let ne of X)if(ne.type===Y.obj.type)return!0}:Y=>Y.obj.type===X.type}function W(X,Y,ne){return zi.doPreOrder(X,X.transforms.get(Y),{refs:{},tags:ne},j).refs}e.findUniqueTagsInSubtree=W;function j(X,Y,ne){if(X.tags){for(let K of X.tags)if(ne.tags.has(K)){ne.refs[K]=X.ref;break}}return!0}function L(X,Y,ne){return zi.doPreOrder(X,X.transforms.get(Y),{ref:void 0,tag:ne},V).ref}e.findTagInSubtree=L;function V(X,Y,ne){return X.tags&&X.tags.indexOf(ne.tag)>=0?(ne.ref=X.ref,!1):!0}function U(X,Y,ne){return zi.doPreOrder(X,X.transforms.get(Y),{refs:[],tags:ne},z).refs}e.findWithAllTags=U;function z(X,Y,ne){if(X.tags){let K=ne.tags.size,$=0;for(let Z of X.tags)if(ne.tags.has(Z)&&($++,$===K)){ne.refs.push(X);break}}else ne.tags.size===0&&ne.refs.push(X)}function ie(X,Y,ne){if(X.transforms.get(Y).transformer===ne)return X.cells.get(Y);let $=X.tree.children.get(Y);if($.size!==1)return;let Z=$.first();if(Z&&X.transforms.get(Z).transformer.definition.isDecorator)return ie(X,Z,ne)}e.tryFindDecorator=ie;function oe(X,Y){let ne=X.tree.children.get(Y);if(ne.size!==1)return X.cells.get(Y);let K=ne.first();return K&&X.transforms.get(K).transformer.definition.isDecorator?oe(X,K):X.cells.get(Y)}e.getDecorated=oe})(ir||(ir={}))});function bd(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");g$(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function oTe(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}function H5(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function xb(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sb(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function _b(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function cC(e){return this instanceof cC?(this.v=e,this):new cC(e)}function iTe(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(m){return function(p){return Promise.resolve(p).then(m,d)}}function s(m,p){n[m]&&(o[m]=function(h){return new Promise(function(g,y){i.push([m,h,g,y])>1||l(m,h)})},p&&(o[m]=p(o[m])))}function l(m,p){try{c(n[m](p))}catch(h){f(i[0][3],h)}}function c(m){m.value instanceof cC?Promise.resolve(m.value.v).then(u,d):f(i[0][2],m)}function u(m){l("next",m)}function d(m){l("throw",m)}function f(m,p){m(p),i.shift(),i.length&&l(i[0][0],i[0][1])}}function aTe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof xb=="function"?xb(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value)})}}function o(i,a,s,l){Promise.resolve(l).then(function(c){i({value:c,done:s})},a)}}var g$,ep=M(()=>{g$=function(e,t){return g$=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},g$(e,t)}});function qi(e){return typeof e=="function"}var Xf=M(()=>{});function W5(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var y$=M(()=>{});var K5,sTe=M(()=>{y$();K5=W5(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
32
|
+
`},o)),i}var sCe=M(()=>{J2e();aCe()});var lCe=M(()=>{sCe()});function S5(e,t){return e&&"run"in e?async function(r,n){let o=x5(r,{file:n,...t});await e.run(o,n)}:function(r,n){return x5(r,{file:n,...e||t})}}var cCe=M(()=>{lCe()});var uCe=M(()=>{cCe()});function dZ(e){if(e)throw e}var dCe=M(()=>{});var xCe=ve((zFr,bCe)=>{"use strict";var _5=Object.prototype.hasOwnProperty,vCe=Object.prototype.toString,fCe=Object.defineProperty,mCe=Object.getOwnPropertyDescriptor,pCe=function(t){return typeof Array.isArray=="function"?Array.isArray(t):vCe.call(t)==="[object Array]"},hCe=function(t){if(!t||vCe.call(t)!=="[object Object]")return!1;var r=_5.call(t,"constructor"),n=t.constructor&&t.constructor.prototype&&_5.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;var o;for(o in t);return typeof o>"u"||_5.call(t,o)},gCe=function(t,r){fCe&&r.name==="__proto__"?fCe(t,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):t[r.name]=r.newValue},yCe=function(t,r){if(r==="__proto__")if(_5.call(t,r)){if(mCe)return mCe(t,r).value}else return;return t[r]};bCe.exports=function e(){var t,r,n,o,i,a,s=arguments[0],l=1,c=arguments.length,u=!1;for(typeof s=="boolean"&&(u=s,s=arguments[1]||{},l=2),(s==null||typeof s!="object"&&typeof s!="function")&&(s={});l<c;++l)if(t=arguments[l],t!=null)for(r in t)n=yCe(s,r),o=yCe(t,r),s!==o&&(u&&o&&(hCe(o)||(i=pCe(o)))?(i?(i=!1,a=n&&pCe(n)?n:[]):a=n&&hCe(n)?n:{},gCe(s,{name:r,newValue:e(u,a,o)})):typeof o<"u"&&gCe(s,{name:r,newValue:o}));return s}});function Ak(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var SCe=M(()=>{});function fZ(){let e=[],t={run:r,use:n};return t;function r(...o){let i=-1,a=o.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);s(null,...o);function s(l,...c){let u=e[++i],d=-1;if(l){a(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?_Ce(u,s)(...c):a(null,...c)}}function n(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function _Ce(e,t){let r;return n;function n(...a){let s=e.length>a.length,l;s&&a.push(o);try{l=e.apply(this,a)}catch(c){let u=c;if(s&&r)throw u;return o(u)}s||(l&&l.then&&typeof l.then=="function"?l.then(i,o):l instanceof Error?o(l):i(l))}function o(a,...s){r||(r=!0,t(a,...s))}function i(a){o(null,a)}}var CCe=M(()=>{});var wCe=M(()=>{CCe()});function Lvt(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pk(e);let r=0,n=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else n<0&&(i=!0,n=o+1);return n<0?"":e.slice(r,n)}if(t===e)return"";let a=-1,s=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){r=o+1;break}}else a<0&&(i=!0,a=o+1),s>-1&&(e.codePointAt(o)===t.codePointAt(s--)?s<0&&(n=o):(s=-1,n=a));return r===n?n=a:n<0&&(n=e.length),e.slice(r,n)}function Fvt(e){if(Pk(e),e.length===0)return".";let t=-1,r=e.length,n;for(;--r;)if(e.codePointAt(r)===47){if(n){t=r;break}}else n||(n=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Nvt(e){Pk(e);let t=e.length,r=-1,n=0,o=-1,i=0,a;for(;t--;){let s=e.codePointAt(t);if(s===47){if(a){n=t+1;break}continue}r<0&&(a=!0,r=t+1),s===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||r<0||i===0||i===1&&o===r-1&&o===n+1?"":e.slice(o,r)}function Uvt(...e){let t=-1,r;for(;++t<e.length;)Pk(e[t]),e[t]&&(r=r===void 0?e[t]:r+"/"+e[t]);return r===void 0?".":Vvt(r)}function Vvt(e){Pk(e);let t=e.codePointAt(0)===47,r=zvt(e,!t);return r.length===0&&!t&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),t?"/"+r:r}function zvt(e,t){let r="",n=0,o=-1,i=0,a=-1,s,l;for(;++a<=e.length;){if(a<e.length)s=e.codePointAt(a);else{if(s===47)break;s=47}if(s===47){if(!(o===a-1||i===1))if(o!==a-1&&i===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(l=r.lastIndexOf("/"),l!==r.length-1){l<0?(r="",n=0):(r=r.slice(0,l),n=r.length-1-r.lastIndexOf("/")),o=a,i=0;continue}}else if(r.length>0){r="",n=0,o=a,i=0;continue}}t&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),n=a-o-1;o=a,i=0}else s===46&&i>-1?i++:i=-1}return r}function Pk(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}var _g,TCe=M(()=>{_g={basename:Lvt,dirname:Fvt,extname:Nvt,join:Uvt,sep:"/"}});function qvt(){return"/"}var ACe,PCe=M(()=>{ACe={cwd:qvt}});function lA(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var mZ=M(()=>{});function ICe(e){if(typeof e=="string")e=new URL(e);else if(!lA(e)){let t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){let t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jvt(e)}function jvt(e){if(e.hostname!==""){let n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}let t=e.pathname,r=-1;for(;++r<t.length;)if(t.codePointAt(r)===37&&t.codePointAt(r+1)===50){let n=t.codePointAt(r+2);if(n===70||n===102){let o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}var ECe=M(()=>{mZ();mZ()});function hZ(e,t){if(e&&e.includes(_g.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+_g.sep+"`")}function gZ(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function DCe(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Gvt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var pZ,nC,kCe=M(()=>{IX();TCe();PCe();ECe();pZ=["history","path","basename","stem","extname","dirname"],nC=class{constructor(t){let r;t?lA(t)?r={path:t}:typeof t=="string"||Gvt(t)?r={value:t}:r=t:r={},this.cwd="cwd"in r?"":ACe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<pZ.length;){let i=pZ[n];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let o;for(o in r)pZ.includes(o)||(this[o]=r[o])}get basename(){return typeof this.path=="string"?_g.basename(this.path):void 0}set basename(t){gZ(t,"basename"),hZ(t,"basename"),this.path=_g.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?_g.dirname(this.path):void 0}set dirname(t){DCe(this.basename,"dirname"),this.path=_g.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?_g.extname(this.path):void 0}set extname(t){if(hZ(t,"extname"),DCe(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=_g.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){lA(t)&&(t=ICe(t)),gZ(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?_g.basename(this.path,this.extname):void 0}set stem(t){gZ(t,"stem"),hZ(t,"stem"),this.path=_g.join(this.dirname||"",t+(this.extname||""))}fail(t,r,n){let o=this.message(t,r,n);throw o.fatal=!0,o}info(t,r,n){let o=this.message(t,r,n);return o.fatal=void 0,o}message(t,r,n){let o=new Ll(t,r,n);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var yZ=M(()=>{kCe()});var MCe,BCe=M(()=>{MCe=(function(e){let n=this.constructor.prototype,o=n[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,n),i})});function vZ(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function bZ(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xZ(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function RCe(e){if(!Ak(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function OCe(e,t,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function C5(e){return Wvt(e)?e:new nC(e)}function Wvt(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Kvt(e){return typeof e=="string"||Yvt(e)}function Yvt(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var w5,Hvt,SZ,_Z,LCe=M(()=>{dCe();w5=et(xCe(),1);SCe();wCe();yZ();BCe();Hvt={}.hasOwnProperty,SZ=class e extends MCe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=fZ()}copy(){let t=new e,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];t.use(...n)}return t.data((0,w5.default)(!0,{},this.namespace)),t}data(t,r){return typeof t=="string"?arguments.length===2?(xZ("data",this.frozen),this.namespace[t]=r,this):Hvt.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xZ("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let o=r.call(t,...n);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let r=C5(t),n=this.parser||this.Parser;return vZ("parse",n),n(String(r),r)}process(t,r){let n=this;return this.freeze(),vZ("process",this.parser||this.Parser),bZ("process",this.compiler||this.Compiler),r?o(void 0,r):new Promise(o);function o(i,a){let s=C5(t),l=n.parse(s);n.run(l,s,function(u,d,f){if(u||!d||!f)return c(u);let m=d,p=n.stringify(m,f);Kvt(p)?f.value=p:f.result=p,c(u,f)});function c(u,d){u||!d?a(u):i?i(d):r(void 0,d)}}}processSync(t){let r=!1,n;return this.freeze(),vZ("processSync",this.parser||this.Parser),bZ("processSync",this.compiler||this.Compiler),this.process(t,o),OCe("processSync","process",r),n;function o(i,a){r=!0,dZ(i),n=a}}run(t,r,n){RCe(t),this.freeze();let o=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?i(void 0,n):new Promise(i);function i(a,s){let l=C5(r);o.run(t,l,c);function c(u,d,f){let m=d||t;u?s(u):a?a(m):n(void 0,m,f)}}}runSync(t,r){let n=!1,o;return this.run(t,r,i),OCe("runSync","run",n),o;function i(a,s){dZ(a),o=s,n=!0}}stringify(t,r){this.freeze();let n=C5(r),o=this.compiler||this.Compiler;return bZ("stringify",o),RCe(t),o(t,n)}use(t,...r){let n=this.attachers,o=this.namespace;if(xZ("use",this.frozen),t!=null)if(typeof t=="function")l(t,r);else if(typeof t=="object")Array.isArray(t)?s(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){let[u,...d]=c;l(u,d)}else a(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function a(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");s(c.plugins),c.settings&&(o.settings=(0,w5.default)(!0,o.settings,c.settings))}function s(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){let d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<n.length;)if(n[d][0]===c){f=d;break}if(f===-1)n.push([c,...u]);else if(u.length>0){let[m,...p]=u,h=n[f][1];Ak(h)&&Ak(m)&&(m=(0,w5.default)(!0,h,m)),n[f]=[c,m,...p]}}}},_Z=new SZ().freeze()});var FCe=M(()=>{LCe()});function Ik(e){let t=Qvt(e),r=Jvt(e);return ebt(t.runSync(t.parse(r),r),e)}function Qvt(e){let t=e.rehypePlugins||NCe,r=e.remarkPlugins||NCe,n=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...UCe}:UCe;return _Z().use(c5).use(r).use(S5,n).use(t)}function Jvt(e){let t=e.children||"",r=new nC;return typeof t=="string"?r.value=t:(""+t,void 0),r}function ebt(e,t){let r=t.allowedElements,n=t.allowElement,o=t.components,i=t.disallowedElements,a=t.skipHtml,s=t.unwrapDisallowed,l=t.urlTransform||zCe;for(let u of $vt)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+Xvt+u.id,void 0);return r&&i&&void 0,rC(e,c),DX(e,{Fragment:cA.Fragment,components:o,ignoreInvalidStyle:!0,jsx:cA.jsx,jsxs:cA.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return a?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let m;for(m in yk)if(Object.hasOwn(yk,m)&&Object.hasOwn(u.properties,m)){let p=u.properties[m],h=yk[m];(h===null||h.includes(u.tagName))&&(u.properties[m]=l(String(p||""),m,u))}}if(u.type==="element"){let m=r?!r.includes(u.tagName):i?i.includes(u.tagName):!1;if(!m&&n&&typeof d=="number"&&(m=!n(u,d,f)),m&&f&&typeof d=="number")return s&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function zCe(e){let t=e.indexOf(":"),r=e.indexOf("?"),n=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||r!==-1&&t>r||n!==-1&&t>n||Zvt.test(e.slice(0,t))?e:""}var cA,VCe,Xvt,NCe,UCe,Zvt,$vt,qCe=M(()=>{FSe();USe();cA=et(gn(),1),VCe=et(Wr(),1);W_e();uCe();FCe();b5();yZ();Xvt="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",NCe=[],UCe={allowDangerousHtml:!0},Zvt=/^(https?|ircs?|mailto|xmpp)$/i,$vt=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}]});var CZ=M(()=>{qCe()});var Io,uA,dA,Ji,T5=M(()=>{Vt();yn();(function(e){function t(){return o=>r(o)}e.factory=t;function r(o){var i;return i=class{static is(s){return!!s&&o===s.type}constructor(s,l){this.data=s,this.id=En.create22(),this.type=o,this.label=l&&l.label||o.name,this.description=l&&l.description}},i.type=o,i}e.create=r;function n(o,i){if(!o.tags)return!1;for(let a of o.tags)if(a===i)return!0;return!1}e.hasTag=n,e.Null={id:En.create22(),type:{name:"Null",typeClass:"Null"},data:void 0,label:"Null"}})(Io||(Io={}));(function(e){function t(n){let o=n;return!!o&&!!o.transform&&!!o.parent&&!!o.status}e.is=t;function r(n,o){let i=typeof o=="string"?o:e.is(o)?o.transform.ref:o.ref;return n.cells.get(i)}e.resolve=r})(uA||(uA={}));dA=class{get cell(){var t;return(t=this.state)===null||t===void 0?void 0:t.cells.get(this.ref)}get obj(){var t,r;return(r=(t=this.state)===null||t===void 0?void 0:t.cells.get(this.ref))===null||r===void 0?void 0:r.obj}get data(){var t;return(t=this.obj)===null||t===void 0?void 0:t.data}update(t,r){if(!this.state)throw new Error("To use update() from StateObjectSelector, 'state' must be defined.");return r||(r=this.state.build()),(r||this.state.build()).to(this).update(t),r}checkValid(){if(!this.state)throw new Error("Unassigned State.");let t=this.cell;if(!t)throw new Error("Not created at all. Did you await/then the corresponding state update?");if(t.status==="ok")return!0;throw t.status==="error"?new Error(t.errorText):t.obj===Io.Null?new Error("The object is Null."):new Error("Unresolved. Did you await/then the corresponding state update?")}get isOk(){let t=this.cell;return t&&t.status==="ok"&&t.obj!==Io.Null}constructor(t,r){this.ref=t,this.state=r}};(function(e){function t(o){var i;if(o)return typeof o=="string"?o:uA.is(o)?o.transform.ref:(i=o.cell)===null||i===void 0?void 0:i.transform.ref}e.resolveRef=t;function r(o,i){if(i)return uA.is(i)?i:typeof i=="string"?o.cells.get(i):i.cell}e.resolve=r;function n(o,i){let a=r(o,i);if(!(!a||!a.obj||a.status!=="ok"))return a}e.resolveAndCheck=n})(Ji||(Ji={}))});function jp(e){return!!(e&&e[k5])}function Ss(e){return!!(e&&e[M5])}function UZ(e){return Ss(e)||jp(e)}function Xm(e){return!!(e&&e[mwe])}function _s(e,t,r,n){var o=e===SA?t:e===Zm?r:[t,r];return n?n.value=o:n={value:o,done:!1},n}function lf(){return{value:void 0,done:!0}}function hwe(e){return Array.isArray(e)?!0:!!L5(e)}function jCe(e){return!!(e&&typeof e.next=="function")}function kZ(e){var t=L5(e);return t&&t.call(e)}function L5(e){var t=e&&(DZ&&e[DZ]||e[pwe]);if(typeof t=="function")return t}function tbt(e){var t=L5(e);return t&&t===e.entries}function rbt(e){var t=L5(e);return t&&t===e.keys}function MZ(){return{value:!1}}function qp(e){e&&(e.value=!0)}function VZ(){}function fA(e){return e.size===void 0&&(e.size=e.__iterate(gwe)),e.size}function Rx(e,t){if(typeof t!="number"){var r=t>>>0;if(""+r!==t||r===4294967295)return NaN;t=r}return t<0?fA(e)+t:t}function gwe(){return!0}function F5(e,t,r){return(e===0&&!vwe(e)||r!==void 0&&e<=-r)&&(t===void 0||r!==void 0&&t>=r)}function zk(e,t){return ywe(e,t,0)}function N5(e,t){return ywe(e,t,t)}function ywe(e,t,r){return e===void 0?r:vwe(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function vwe(e){return e<0||e===0&&1/e===-1/0}function aC(e){return!!(e&&e[bwe])}function ey(e){return Xm(e)||aC(e)}function J0(e){return!!(e&&e[Ox])}function zZ(e){return!!(e&&e[xwe])}function Swe(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}function jZ(){return GCe||(GCe=new mA([]))}function GZ(e){var t=HZ(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new qZ(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function _we(e){var t=HZ(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function obt(e){var t=HZ(e);if(t)return tbt(e)?t.fromEntrySeq():rbt(e)?t.toSetSeq():t;if(typeof e=="object")return new qZ(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function HZ(e){return Swe(e)?new mA(e):hwe(e)?new nbt(e):void 0}function qk(){return this.__ensureOwner()}function jk(){return this.__ownerID?this:this.__ensureOwner(new VZ)}function U5(e){return e>>>1&1073741824|e&3221225471}function Hm(e){if(e==null)return HCe(e);if(typeof e.hashCode=="function")return U5(e.hashCode(e));var t=dbt(e);if(t==null)return HCe(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return abt(t);case"string":return t.length>fbt?sbt(t):BZ(t);case"object":case"function":return cbt(t);case"symbol":return lbt(t);default:if(typeof t.toString=="function")return BZ(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function HCe(e){return e===null?1108378658:1108378659}function abt(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return U5(t)}function sbt(e){var t=AZ[e];return t===void 0&&(t=BZ(e),TZ===mbt&&(TZ=0,AZ={}),TZ++,AZ[e]=t),t}function BZ(e){for(var t=0,r=0;r<e.length;r++)t=31*t+e.charCodeAt(r)|0;return U5(t)}function lbt(e){var t=YCe[e];return t!==void 0||(t=Cwe(),YCe[e]=t),t}function cbt(e){var t;if(RZ&&(t=OZ.get(e),t!==void 0)||(t=e[oC],t!==void 0)||!KCe&&(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[oC],t!==void 0||(t=ubt(e),t!==void 0)))return t;if(t=Cwe(),RZ)OZ.set(e,t);else{if(WCe!==void 0&&WCe(e)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(KCe)Object.defineProperty(e,oC,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(e.propertyIsEnumerable!==void 0&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[oC]=t;else if(e.nodeType!==void 0)e[oC]=t;else throw new Error("Unable to set a non-enumerable property on object.")}return t}function ubt(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function dbt(e){return e.valueOf!==ibt&&typeof e.valueOf=="function"?e.valueOf(e):e}function Cwe(){var e=++wZ;return wZ&1073741824&&(wZ=0),e}function Pwe(e){var t=ty(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var r=e.reverse.apply(this);return r.flip=function(){return e.reverse()},r},t.has=function(r){return e.includes(r)},t.includes=function(r){return e.has(r)},t.cacheResult=XZ,t.__iterateUncached=function(r,n){var o=this;return e.__iterate(function(i,a){return r(a,i,o)!==!1},n)},t.__iteratorUncached=function(r,n){if(r===$m){var o=e.__iterator(r,n);return new ki(function(){var i=o.next();if(!i.done){var a=i.value[0];i.value[0]=i.value[1],i.value[1]=a}return i})}return e.__iterator(r===Zm?SA:Zm,n)},t}function Iwe(e,t,r){var n=ty(e);return n.size=e.size,n.has=function(o){return e.has(o)},n.get=function(o,i){var a=e.get(o,pi);return a===pi?i:t.call(r,a,o,e)},n.__iterateUncached=function(o,i){var a=this;return e.__iterate(function(s,l,c){return o(t.call(r,s,l,c),l,a)!==!1},i)},n.__iteratorUncached=function(o,i){var a=e.__iterator($m,i);return new ki(function(){var s=a.next();if(s.done)return s;var l=s.value,c=l[0];return _s(o,c,t.call(r,l[1],c,e),s)})},n}function WZ(e,t){var r=this,n=ty(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var o=Pwe(e);return o.reverse=function(){return e.flip()},o}),n.get=function(o,i){return e.get(t?o:-1-o,i)},n.has=function(o){return e.has(t?o:-1-o)},n.includes=function(o){return e.includes(o)},n.cacheResult=XZ,n.__iterate=function(o,i){var a=this,s=0;return i&&fA(e),e.__iterate(function(l,c){return o(l,t?c:i?a.size-++s:s++,a)},!i)},n.__iterator=function(o,i){var a=0;i&&fA(e);var s=e.__iterator($m,!i);return new ki(function(){var l=s.next();if(l.done)return l;var c=l.value;return _s(o,t?c[0]:i?r.size-++a:a++,c[1],l)})},n}function Ewe(e,t,r,n){var o=ty(e);return n&&(o.has=function(i){var a=e.get(i,pi);return a!==pi&&!!t.call(r,a,i,e)},o.get=function(i,a){var s=e.get(i,pi);return s!==pi&&t.call(r,s,i,e)?s:a}),o.__iterateUncached=function(i,a){var s=this,l=0;return e.__iterate(function(c,u,d){if(t.call(r,c,u,d))return l++,i(c,n?u:l-1,s)},a),l},o.__iteratorUncached=function(i,a){var s=e.__iterator($m,a),l=0;return new ki(function(){for(;;){var c=s.next();if(c.done)return c;var u=c.value,d=u[0],f=u[1];if(t.call(r,f,d,e))return _s(i,n?d:l++,f,c)}})},o}function pbt(e,t,r){var n=Jm().asMutable();return e.__iterate(function(o,i){n.update(t.call(r,o,i,e),0,function(a){return a+1})}),n.asImmutable()}function hbt(e,t,r){var n=Ss(e),o=(J0(e)?rc():Jm()).asMutable();e.__iterate(function(a,s){o.update(t.call(r,a,s,e),function(l){return l=l||[],l.push(n?[s,a]:a),l})});var i=YZ(e);return o.map(function(a){return qa(e,i(a))}).asImmutable()}function gbt(e,t,r){var n=Ss(e),o=[[],[]];e.__iterate(function(a,s){o[t.call(r,a,s,e)?1:0].push(n?[s,a]:a)});var i=YZ(e);return o.map(function(a){return qa(e,i(a))})}function KZ(e,t,r,n){var o=e.size;if(F5(t,r,o))return e;if(typeof o>"u"&&(t<0||r<0))return KZ(e.toSeq().cacheResult(),t,r,n);var i=zk(t,o),a=N5(r,o),s=a-i,l;s===s&&(l=s<0?0:s);var c=ty(e);return c.size=l===0?l:e.size&&l||void 0,!n&&zZ(e)&&l>=0&&(c.get=function(u,d){return u=Rx(this,u),u>=0&&u<l?e.get(u+i,d):d}),c.__iterateUncached=function(u,d){var f=this;if(l===0)return 0;if(d)return this.cacheResult().__iterate(u,d);var m=0,p=!0,h=0;return e.__iterate(function(g,y){if(!(p&&(p=m++<i)))return h++,u(g,n?y:h-1,f)!==!1&&h!==l}),h},c.__iteratorUncached=function(u,d){if(l!==0&&d)return this.cacheResult().__iterator(u,d);if(l===0)return new ki(lf);var f=e.__iterator(u,d),m=0,p=0;return new ki(function(){for(;m++<i;)f.next();if(++p>l)return lf();var h=f.next();return n||u===Zm||h.done?h:u===SA?_s(u,p-1,void 0,h):_s(u,p-1,h.value[1],h)})},c}function ybt(e,t,r){var n=ty(e);return n.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var s=0;return e.__iterate(function(l,c,u){return t.call(r,l,c,u)&&++s&&o(l,c,a)}),s},n.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var s=e.__iterator($m,i),l=!0;return new ki(function(){if(!l)return lf();var c=s.next();if(c.done)return c;var u=c.value,d=u[0],f=u[1];return t.call(r,f,d,a)?o===$m?c:_s(o,d,f,c):(l=!1,lf())})},n}function Dwe(e,t,r,n){var o=ty(e);return o.__iterateUncached=function(i,a){var s=this;if(a)return this.cacheResult().__iterate(i,a);var l=!0,c=0;return e.__iterate(function(u,d,f){if(!(l&&(l=t.call(r,u,d,f))))return c++,i(u,n?d:c-1,s)}),c},o.__iteratorUncached=function(i,a){var s=this;if(a)return this.cacheResult().__iterator(i,a);var l=e.__iterator($m,a),c=!0,u=0;return new ki(function(){var d,f,m;do{if(d=l.next(),d.done)return n||i===Zm?d:i===SA?_s(i,u++,void 0,d):_s(i,u++,d.value[1],d);var p=d.value;f=p[0],m=p[1],c&&(c=t.call(r,m,f,s))}while(c);return i===$m?d:_s(i,f,m,d)})},o}function bbt(e,t){var r=Ss(e),n=[e].concat(t).map(function(i){return Xm(i)?r&&(i=Gp(i)):i=r?GZ(i):_we(Array.isArray(i)?i:[i]),i}).filter(function(i){return i.size!==0});if(n.length===0)return e;if(n.length===1){var o=n[0];if(o===e||r&&Ss(o)||jp(e)&&jp(o))return o}return new vbt(n)}function kwe(e,t,r){var n=ty(e);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var a=0,s=!1;function l(c,u){c.__iterate(function(d,f){return(!t||u<t)&&Xm(d)?l(d,u+1):(a++,o(d,r?f:a-1,n)===!1&&(s=!0)),!s},i)}return l(e,0),a},n.__iteratorUncached=function(o,i){if(i)return this.cacheResult().__iterator(o,i);var a=e.__iterator(o,i),s=[],l=0;return new ki(function(){for(;a;){var c=a.next();if(c.done!==!1){a=s.pop();continue}var u=c.value;if(o===$m&&(u=u[1]),(!t||s.length<t)&&Xm(u))s.push(a),a=u.__iterator(o,i);else return r?c:_s(o,l++,u,c)}return lf()})},n}function xbt(e,t,r){var n=YZ(e);return e.toSeq().map(function(o,i){return n(t.call(r,o,i,e))}).flatten(!0)}function Sbt(e,t){var r=ty(e);return r.size=e.size&&e.size*2-1,r.__iterateUncached=function(n,o){var i=this,a=0;return e.__iterate(function(s){return(!a||n(t,a++,i)!==!1)&&n(s,a++,i)!==!1},o),a},r.__iteratorUncached=function(n,o){var i=e.__iterator(Zm,o),a=0,s;return new ki(function(){return(!s||a%2)&&(s=i.next(),s.done)?s:a%2?_s(n,a++,t):_s(n,a++,s.value,s)})},r}function pA(e,t,r){t||(t=Mwe);var n=Ss(e),o=0,i=e.toSeq().map(function(a,s){return[s,a,o++,r?r(a,s,e):a]}).valueSeq().toArray();return i.sort(function(a,s){return t(a[3],s[3])||a[2]-s[2]}).forEach(n?function(a,s){i[s].length=2}:function(a,s){i[s]=a[1]}),n?Fx(i):jp(e)?Cg(i):CA(i)}function A5(e,t,r){if(t||(t=Mwe),r){var n=e.toSeq().map(function(o,i){return[o,r(o,i,e)]}).reduce(function(o,i){return XCe(t,o[1],i[1])?i:o});return n&&n[0]}return e.reduce(function(o,i){return XCe(t,o,i)?i:o})}function XCe(e,t,r){var n=e(r,t);return n===0&&r!==t&&(r==null||r!==r)||n>0}function P5(e,t,r,n){var o=ty(e),i=new mA(r).map(function(a){return a.size});return o.size=n?i.max():i.min(),o.__iterate=function(a,s){for(var l=this.__iterator(Zm,s),c,u=0;!(c=l.next()).done&&a(c.value,u++,this)!==!1;);return u},o.__iteratorUncached=function(a,s){var l=r.map(function(d){return d=yd(d),kZ(s?d.reverse():d)}),c=0,u=!1;return new ki(function(){var d;return u||(d=l.map(function(f){return f.next()}),u=n?d.every(function(f){return f.done}):d.some(function(f){return f.done})),u?lf():_s(a,c++,t.apply(null,d.map(function(f){return f.value})))})},o}function qa(e,t){return e===t?e:zZ(e)?t:e.constructor(t)}function ZCe(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function YZ(e){return Ss(e)?Gp:jp(e)?iC:xA}function ty(e){return Object.create((Ss(e)?Fx:jp(e)?Cg:CA).prototype)}function XZ(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Yf.prototype.cacheResult.call(this)}function Mwe(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e<t?-1:0}function $Ce(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function Ym(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!($Ce(e)&&$Ce(t)&&e.equals(t))}function Bwe(e,t,r,n){return wA(e,[t],r,n)}function Rwe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return Lwe(this,e)}function Owe(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return Lwe(this,t,e)}function Lwe(e,t,r){for(var n=[],o=0;o<t.length;o++){var i=Gp(t[o]);i.size!==0&&n.push(i)}return n.length===0?e:e.toSeq().size===0&&!e.__ownerID&&n.length===1?aC(e)?e:e.constructor(n[0]):e.withMutations(function(a){for(var s=r?function(c,u){Bwe(a,u,pi,function(d){return d===pi?c:r(d,c,u)})}:function(c,u){a.set(u,c)},l=0;l<n.length;l++)n[l].forEach(s)})}function Cbt(e){if(!e||typeof e!="object"||_bt.call(e)!=="[object Object]")return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t,n=Object.getPrototypeOf(t);n!==null;)r=n,n=Object.getPrototypeOf(r);return r===t}function Lx(e){return typeof e=="object"&&(ey(e)||Array.isArray(e)||Cbt(e))}function $0(e,t){t=t||0;for(var r=Math.max(0,e.length-t),n=new Array(r),o=0;o<r;o++)n[o]=e[o+t];return n}function B5(e){if(Array.isArray(e))return $0(e);var t={};for(var r in e)_A.call(e,r)&&(t[r]=e[r]);return t}function ZZ(e,t,r){return $Z(e,t,wbt(r))}function $Z(e,t,r){if(!Lx(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(ey(e))return typeof r=="function"&&e.mergeWith?e.mergeWith.apply(e,[r].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var n=Array.isArray(e),o=e,i=n?iC:Gp,a=n?function(l){o===e&&(o=B5(o)),o.push(l)}:function(l,c){var u=_A.call(o,c),d=u&&r?r(o[c],l,c):l;(!u||d!==o[c])&&(o===e&&(o=B5(o)),o[c]=d)},s=0;s<t.length;s++)i(t[s]).forEach(a);return o}function wbt(e){function t(r,n,o){return Lx(r)&&Lx(n)&&Tbt(r,n)?$Z(r,[n],t):e?e(r,n,o):n}return t}function Tbt(e,t){var r=Yf(e),n=Yf(t);return jp(r)===jp(n)&&Ss(r)===Ss(n)}function Fwe(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return ZZ(this,e)}function Nwe(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return ZZ(this,t,e)}function QZ(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return wA(this,e,Q0(),function(n){return ZZ(n,t)})}function JZ(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];return wA(this,e,Q0(),function(n){return $Z(n,t)})}function Abt(e,t,r){return wA(e,t,pi,function(){return r})}function e$(e,t){return Abt(this,e,t)}function t$(e,t,r){return arguments.length===1?e(this):Bwe(this,e,t,r)}function r$(e,t,r){return wA(this,e,t,r)}function n$(){return this.__altered}function Gk(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function o$(e){return!!(e&&e[Uwe])}function Bk(e,t){if(!e)throw new Error(t)}function Wm(e){Bk(e!==1/0,"Cannot perform this action with an infinite size.")}function PZ(e,t){return _s(e,t[0],t[1])}function QCe(e,t){return{node:e,index:0,__prev:t}}function i$(e,t,r,n){var o=Object.create(ds);return o.size=e,o._root=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Q0(){return JCe||(JCe=i$(0))}function ewe(e,t,r){var n,o;if(e._root){var i=MZ(),a=MZ();if(n=a$(e._root,e.__ownerID,0,void 0,t,r,i,a),!a.value)return e;o=e.size+(i.value?r===pi?-1:1:0)}else{if(r===pi)return e;o=1,n=new Ok(e.__ownerID,[[t,r]])}return e.__ownerID?(e.size=o,e._root=n,e.__hash=void 0,e.__altered=!0,e):n?i$(o,n):Q0()}function a$(e,t,r,n,o,i,a,s){return e?e.update(t,r,n,o,i,a,s):i===pi?e:(qp(s),qp(a),new yb(t,n,[o,i]))}function twe(e){return e.constructor===yb||e.constructor===gA}function s$(e,t,r,n,o){if(e.keyHash===n)return new gA(t,n,[e.entry,o]);var i=(r===0?e.keyHash:e.keyHash>>>r)&sf,a=(r===0?n:n>>>r)&sf,s,l=i===a?[s$(e,t,r+ja,n,o)]:(s=new yb(t,n,o),i<a?[e,s]:[s,e]);return new hA(t,1<<i|1<<a,l)}function Ibt(e,t,r,n){e||(e=new VZ);for(var o=new yb(e,Hm(r),[r,n]),i=0;i<t.length;i++){var a=t[i];o=o.update(e,0,void 0,a[0],a[1])}return o}function Ebt(e,t,r,n){for(var o=0,i=0,a=new Array(r),s=0,l=1,c=t.length;s<c;s++,l<<=1){var u=t[s];u!==void 0&&s!==n&&(o|=l,a[i++]=u)}return new hA(e,o,a)}function Dbt(e,t,r,n,o){for(var i=0,a=new Array(Km),s=0;r!==0;s++,r>>>=1)a[s]=r&1?t[i++]:void 0;return a[n]=o,new Lk(e,i+1,a)}function Vwe(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function zwe(e,t,r,n){var o=n?e:$0(e);return o[t]=r,o}function kbt(e,t,r,n){var o=e.length+1;if(n&&t+1===o)return e[t]=r,e;for(var i=new Array(o),a=0,s=0;s<o;s++)s===t?(i[s]=r,a=-1):i[s]=e[s+a];return i}function Mbt(e,t,r){var n=e.length-1;if(r&&t===n)return e.pop(),e;for(var o=new Array(n),i=0,a=0;a<n;a++)a===t&&(i=1),o[a]=e[a+i];return o}function qwe(e){if(Swe(e)&&typeof e!="string")return e;if(J0(e))return e.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+e)}function Fk(e){try{return typeof e=="string"?JSON.stringify(e):String(e)}catch{return JSON.stringify(e)}}function Lbt(e,t){return ey(e)?e.has(t):Lx(e)&&_A.call(e,t)}function jwe(e,t,r){return ey(e)?e.get(t,r):Lbt(e,t)?typeof e.get=="function"?e.get(t):e[t]:r}function Fbt(e,t){if(!Lx(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(ey(e)){if(!e.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+e);return e.remove(t)}if(!_A.call(e,t))return e;var r=B5(e);return Array.isArray(r)?r.splice(t,1):delete r[t],r}function Nbt(e,t,r){if(!Lx(e))throw new TypeError("Cannot update non-data-structure value: "+e);if(ey(e)){if(!e.set)throw new TypeError("Cannot update immutable value without .set() method: "+e);return e.set(t,r)}if(_A.call(e,t)&&r===e[t])return e;var n=B5(e);return n[t]=r,n}function wA(e,t,r,n){n||(n=r,r=void 0);var o=Gwe(ey(e),e,qwe(t),0,r,n);return o===pi?r:o}function Gwe(e,t,r,n,o,i){var a=t===pi;if(n===r.length){var s=a?o:t,l=i(s);return l===s?t:l}if(!a&&!Lx(t))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Fk)+"]: "+t);var c=r[n],u=a?pi:jwe(t,c,pi),d=Gwe(u===pi?e:ey(u),u,r,n+1,o,i);return d===u?t:d===pi?Fbt(t,c):Nbt(a?e?Q0():{}:t,c,d)}function Ubt(e,t){return wA(e,t,function(){return pi})}function l$(e){return Ubt(this,e)}function Wwe(e){return!!(e&&e[Hwe])}function rwe(e,t){var r=e._origin,n=e._capacity,o=Uk(n),i=e._tail;return a(e._root,e._level,0);function a(c,u,d){return u===0?s(c,d):l(c,u,d)}function s(c,u){var d=u===o?i&&i.array:c&&c.array,f=u>r?0:r-u,m=n-u;return m>Km&&(m=Km),function(){if(f===m)return Rk;var p=t?--m:f++;return d&&d[p]}}function l(c,u,d){var f,m=c&&c.array,p=d>r?0:r-d>>u,h=(n-d>>u)+1;return h>Km&&(h=Km),function(){for(;;){if(f){var g=f();if(g!==Rk)return g;f=null}if(p===h)return Rk;var y=t?--h:p++;f=a(m&&m[y],u-ja,d+(y<<u))}}}}function Nk(e,t,r,n,o,i,a){var s=Object.create(tc);return s.size=t-e,s._origin=e,s._capacity=t,s._level=r,s._root=n,s._tail=o,s.__ownerID=i,s.__hash=a,s.__altered=!1,s}function D5(){return Nk(0,0,ja)}function Vbt(e,t,r){if(t=Rx(e,t),t!==t)return e;if(t>=e.size||t<0)return e.withMutations(function(a){t<0?Mx(a,t).set(0,r):Mx(a,0,t+1).set(t,r)});t+=e._origin;var n=e._tail,o=e._root,i=MZ();return t>=Uk(e._capacity)?n=LZ(n,e.__ownerID,0,t,r,i):o=LZ(o,e.__ownerID,e._level,t,r,i),i.value?e.__ownerID?(e._root=o,e._tail=n,e.__hash=void 0,e.__altered=!0,e):Nk(e._origin,e._capacity,e._level,o,n):e}function LZ(e,t,r,n,o,i){var a=n>>>r&sf,s=e&&a<e.array.length;if(!s&&o===void 0)return e;var l;if(r>0){var c=e&&e.array[a],u=LZ(c,t,r-ja,n,o,i);return u===c?e:(l=yA(e,t),l.array[a]=u,l)}return s&&e.array[a]===o?e:(i&&qp(i),l=yA(e,t),o===void 0&&a===l.array.length-1?l.array.pop():l.array[a]=o,l)}function yA(e,t){return t&&e&&t===e.ownerID?e:new Bx(e?e.array.slice():[],t)}function Kwe(e,t){if(t>=Uk(e._capacity))return e._tail;if(t<1<<e._level+ja){for(var r=e._root,n=e._level;r&&n>0;)r=r.array[t>>>n&sf],n-=ja;return r}}function Mx(e,t,r){t!==void 0&&(t|=0),r!==void 0&&(r|=0);var n=e.__ownerID||new VZ,o=e._origin,i=e._capacity,a=o+t,s=r===void 0?i:r<0?i+r:o+r;if(a===o&&s===i)return e;if(a>=s)return e.clear();for(var l=e._level,c=e._root,u=0;a+u<0;)c=new Bx(c&&c.array.length?[void 0,c]:[],n),l+=ja,u+=1<<l;u&&(a+=u,o+=u,s+=u,i+=u);for(var d=Uk(i),f=Uk(s);f>=1<<l+ja;)c=new Bx(c&&c.array.length?[c]:[],n),l+=ja;var m=e._tail,p=f<d?Kwe(e,s-1):f>d?new Bx([],n):m;if(m&&f>d&&a<i&&m.array.length){c=yA(c,n);for(var h=c,g=l;g>ja;g-=ja){var y=d>>>g&sf;h=h.array[y]=yA(h.array[y],n)}h.array[d>>>ja&sf]=m}if(s<i&&(p=p&&p.removeAfter(n,0,s)),a>=f)a-=f,s-=f,l=ja,c=null,p=p&&p.removeBefore(n,0,a);else if(a>o||f<d){for(u=0;c;){var b=a>>>l&sf;if(b!==f>>>l&sf)break;b&&(u+=(1<<l)*b),l-=ja,c=c.array[b]}c&&a>o&&(c=c.removeBefore(n,l,a-u)),c&&f<d&&(c=c.removeAfter(n,l,f-u)),u&&(a-=u,s-=u)}return e.__ownerID?(e.size=s-a,e._origin=a,e._capacity=s,e._level=l,e._root=c,e._tail=p,e.__hash=void 0,e.__altered=!0,e):Nk(a,s,l,c,p)}function Uk(e){return e<Km?0:e-1>>>ja<<ja}function Ywe(e){return o$(e)&&J0(e)}function c$(e,t,r,n){var o=Object.create(rc.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function Dk(){return nwe||(nwe=c$(Q0(),D5()))}function owe(e,t,r){var n=e._map,o=e._list,i=n.get(t),a=i!==void 0,s,l;if(r===pi){if(!a)return e;o.size>=Km&&o.size>=n.size*2?(l=o.filter(function(c,u){return c!==void 0&&i!==u}),s=l.toKeyedSeq().map(function(c){return c[0]}).flip().toMap(),e.__ownerID&&(s.__ownerID=l.__ownerID=e.__ownerID)):(s=n.remove(t),l=i===o.size-1?o.pop():o.set(i,void 0))}else if(a){if(r===o.get(i)[1])return e;s=n,l=o.set(i,[t,r])}else s=n.set(t,o.size),l=o.set(o.size,[t,r]);return e.__ownerID?(e.size=s.size,e._map=s,e._list=l,e.__hash=void 0,e.__altered=!0,e):c$(s,l)}function FZ(e){return!!(e&&e[Xwe])}function kk(e,t,r,n){var o=Object.create(cf);return o.size=e,o._head=t,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function I5(){return iwe||(iwe=kk(0))}function awe(e,t,r,n,o,i){return Wm(e.size),e.__iterate(function(a,s,l){o?(o=!1,r=a):r=t.call(n,r,a,s,l)},i),r}function zbt(e,t){return t}function qbt(e,t){return[t,e]}function IZ(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return!e.apply(this,t)}}function swe(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return-e.apply(this,t)}}function lwe(e,t){return e<t?1:e>t?-1:0}function Zwe(e,t){if(e===t)return!0;if(!Xm(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Ss(e)!==Ss(t)||jp(e)!==jp(t)||J0(e)!==J0(t))return!1;if(e.size===0&&t.size===0)return!0;var r=!UZ(e);if(J0(e)){var n=e.entries();return t.every(function(l,c){var u=n.next().value;return u&&Ym(u[1],l)&&(r||Ym(u[0],c))})&&n.next().done}var o=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{o=!0;var i=e;e=t,t=i}var a=!0,s=t.__iterate(function(l,c){if(r?!e.has(l):o?!Ym(l,e.get(c,pi)):!Ym(e.get(c,pi),l))return a=!1,!1});return a&&e.size===s}function d$(e){return!!(e&&e[$we])}function E5(e,t){return e.__ownerID?(e.size=t.size,e._map=t,e):t===e._map?e:t.size===0?e.__empty():e.__make(t)}function Qwe(e,t){var r=Object.create(Uu);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function Mk(){return cwe||(cwe=Qwe(Q0()))}function Jwe(e,t,r){for(var n=qwe(t),o=0;o!==n.length;)if(e=jwe(e,n[o++],pi),e===pi)return r;return e}function eTe(e,t){return Jwe(this,e,t)}function Gbt(e,t){return Jwe(e,t,pi)!==pi}function Hbt(e){return Gbt(this,e)}function tTe(){Wm(this.size);var e={};return this.__iterate(function(t,r){e[r]=t}),e}function R5(e){if(!e||typeof e!="object")return e;if(!Xm(e)){if(!Lx(e))return e;e=Yf(e)}if(Ss(e)){var t={};return e.__iterate(function(n,o){t[o]=R5(n)}),t}var r=[];return e.__iterate(function(n){r.push(R5(n))}),r}function Wbt(e){if(e.size===1/0)return 0;var t=J0(e),r=Ss(e),n=t?1:0;return e.__iterate(r?t?function(o,i){n=31*n+uwe(Hm(o),Hm(i))|0}:function(o,i){n=n+uwe(Hm(o),Hm(i))|0}:t?function(o){n=31*n+Hm(o)|0}:function(o){n=n+Hm(o)|0}),Kbt(e.size,n)}function Kbt(e,t){return t=Ek(t,3432918353),t=Ek(t<<15|t>>>-15,461845907),t=Ek(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Ek(t^t>>>16,2246822507),t=Ek(t^t>>>13,3266489909),t=U5(t^t>>>16),t}function uwe(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}function sC(e,t){var r=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(r),e}function dwe(){return $0(arguments)}function rTe(e){return d$(e)&&J0(e)}function nTe(e,t){var r=Object.create(lC);return r.size=e?e.size:0,r._map=e,r.__ownerID=t,r}function NZ(){return fwe||(fwe=nTe(Dk()))}function Ybt(e){if(aC(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(ey(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}function f$(e,t,r){var n=Object.create(Object.getPrototypeOf(e));return n._values=t,n.__ownerID=r,n}function m$(e){return e.constructor.displayName||e.constructor.name||"Record"}function bA(e){return GZ(e._keys.map(function(t){return[t,e.get(t)]}))}function Xbt(e,t){try{Object.defineProperty(e,t,{get:function(){return this.get(t)},set:function(r){Bk(this.__ownerID,"Cannot set on an immutable record."),this.set(t,r)}})}catch{}}var k5,M5,mwe,yd,Gp,iC,xA,SA,Zm,$m,DZ,pwe,O5,ki,Vk,ja,Km,sf,pi,bwe,Ox,xwe,_A,Yf,Fx,Cg,CA,mA,qZ,nbt,GCe,Ek,ibt,WCe,KCe,RZ,OZ,YCe,wZ,oC,fbt,mbt,TZ,AZ,V5,wwe,Twe,Awe,vbt,_bt,Uwe,Jm,ds,Ok,hA,Lk,gA,yb,Pbt,JCe,Bbt,Rbt,Obt,Hwe,ry,tc,Bx,Rk,rc,nwe,Xwe,u$,cf,iwe,jbt,EZ,$we,z5,Uu,cwe,vd,Hk,TA,vA,Qm,lC,fwe,Zc,Ja,vb=M(()=>{k5="@@__IMMUTABLE_INDEXED__@@";M5="@@__IMMUTABLE_KEYED__@@";mwe="@@__IMMUTABLE_ITERABLE__@@";yd=function(t){return Xm(t)?t:Yf(t)},Gp=(function(e){function t(r){return Ss(r)?r:Fx(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(yd),iC=(function(e){function t(r){return jp(r)?r:Cg(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(yd),xA=(function(e){function t(r){return Xm(r)&&!UZ(r)?r:CA(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(yd);yd.Keyed=Gp;yd.Indexed=iC;yd.Set=xA;SA=0,Zm=1,$m=2,DZ=typeof Symbol=="function"&&Symbol.iterator,pwe="@@iterator",O5=DZ||pwe,ki=function(t){this.next=t};ki.prototype.toString=function(){return"[Iterator]"};ki.KEYS=SA;ki.VALUES=Zm;ki.ENTRIES=$m;ki.prototype.inspect=ki.prototype.toSource=function(){return this.toString()};ki.prototype[O5]=function(){return this};Vk="delete",ja=5,Km=1<<ja,sf=Km-1,pi={};bwe="@@__IMMUTABLE_RECORD__@@";Ox="@@__IMMUTABLE_ORDERED__@@";xwe="@@__IMMUTABLE_SEQ__@@";_A=Object.prototype.hasOwnProperty;Yf=(function(e){function t(r){return r==null?jZ():ey(r)?r.toSeq():obt(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(n,o){var i=this._cache;if(i){for(var a=i.length,s=0;s!==a;){var l=i[o?a-++s:s++];if(n(l[1],l[0],this)===!1)break}return s}return this.__iterateUncached(n,o)},t.prototype.__iterator=function(n,o){var i=this._cache;if(i){var a=i.length,s=0;return new ki(function(){if(s===a)return lf();var l=i[o?a-++s:s++];return _s(n,l[0],l[1])})}return this.__iteratorUncached(n,o)},t})(yd),Fx=(function(e){function t(r){return r==null?jZ().toKeyedSeq():Xm(r)?Ss(r)?r.toSeq():r.fromEntrySeq():aC(r)?r.toSeq():GZ(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t})(Yf),Cg=(function(e){function t(r){return r==null?jZ():Xm(r)?Ss(r)?r.entrySeq():r.toIndexedSeq():aC(r)?r.toSeq().entrySeq():_we(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t})(Yf),CA=(function(e){function t(r){return(Xm(r)&&!UZ(r)?r:Cg(r)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t})(Yf);Yf.isSeq=zZ;Yf.Keyed=Fx;Yf.Set=CA;Yf.Indexed=Cg;Yf.prototype[xwe]=!0;mA=(function(e){function t(r){this._array=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return this.has(n)?this._array[Rx(this,n)]:o},t.prototype.__iterate=function(n,o){for(var i=this._array,a=i.length,s=0;s!==a;){var l=o?a-++s:s++;if(n(i[l],l,this)===!1)break}return s},t.prototype.__iterator=function(n,o){var i=this._array,a=i.length,s=0;return new ki(function(){if(s===a)return lf();var l=o?a-++s:s++;return _s(n,l,i[l])})},t})(Cg),qZ=(function(e){function t(r){var n=Object.keys(r).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r):[]);this._object=r,this._keys=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return o!==void 0&&!this.has(n)?o:this._object[n]},t.prototype.has=function(n){return _A.call(this._object,n)},t.prototype.__iterate=function(n,o){for(var i=this._object,a=this._keys,s=a.length,l=0;l!==s;){var c=a[o?s-++l:l++];if(n(i[c],c,this)===!1)break}return l},t.prototype.__iterator=function(n,o){var i=this._object,a=this._keys,s=a.length,l=0;return new ki(function(){if(l===s)return lf();var c=a[o?s-++l:l++];return _s(n,c,i[c])})},t})(Fx);qZ.prototype[Ox]=!0;nbt=(function(e){function t(r){this._collection=r,this.size=r.length||r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,o){if(o)return this.cacheResult().__iterate(n,o);var i=this._collection,a=kZ(i),s=0;if(jCe(a))for(var l;!(l=a.next()).done&&n(l.value,s++,this)!==!1;);return s},t.prototype.__iteratorUncached=function(n,o){if(o)return this.cacheResult().__iterator(n,o);var i=this._collection,a=kZ(i);if(!jCe(a))return new ki(lf);var s=0;return new ki(function(){var l=a.next();return l.done?l:_s(n,s++,l.value)})},t})(Cg);Ek=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,r){t|=0,r|=0;var n=t&65535,o=r&65535;return n*o+((t>>>16)*o+n*(r>>>16)<<16>>>0)|0};ibt=Object.prototype.valueOf;WCe=Object.isExtensible,KCe=(function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}})();RZ=typeof WeakMap=="function";RZ&&(OZ=new WeakMap);YCe=Object.create(null),wZ=0,oC="__immutablehash__";typeof Symbol=="function"&&(oC=Symbol(oC));fbt=16,mbt=255,TZ=0,AZ={},V5=(function(e){function t(r,n){this._iter=r,this._useKeys=n,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(n,o){return this._iter.get(n,o)},t.prototype.has=function(n){return this._iter.has(n)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var n=this,o=WZ(this,!0);return this._useKeys||(o.valueSeq=function(){return n._iter.toSeq().reverse()}),o},t.prototype.map=function(n,o){var i=this,a=Iwe(this,n,o);return this._useKeys||(a.valueSeq=function(){return i._iter.toSeq().map(n,o)}),a},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(a,s){return n(a,s,i)},o)},t.prototype.__iterator=function(n,o){return this._iter.__iterator(n,o)},t})(Fx);V5.prototype[Ox]=!0;wwe=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,o){var i=this,a=0;return o&&fA(this),this._iter.__iterate(function(s){return n(s,o?i.size-++a:a++,i)},o)},t.prototype.__iterator=function(n,o){var i=this,a=this._iter.__iterator(Zm,o),s=0;return o&&fA(this),new ki(function(){var l=a.next();return l.done?l:_s(n,o?i.size-++s:s++,l.value,l)})},t})(Cg),Twe=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(n){return this._iter.includes(n)},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(a){return n(a,a,i)},o)},t.prototype.__iterator=function(n,o){var i=this._iter.__iterator(Zm,o);return new ki(function(){var a=i.next();return a.done?a:_s(n,a.value,a.value,a)})},t})(CA),Awe=(function(e){function t(r){this._iter=r,this.size=r.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(n,o){var i=this;return this._iter.__iterate(function(a){if(a){ZCe(a);var s=Xm(a);return n(s?a.get(1):a[1],s?a.get(0):a[0],i)}},o)},t.prototype.__iterator=function(n,o){var i=this._iter.__iterator(Zm,o);return new ki(function(){for(;;){var a=i.next();if(a.done)return a;var s=a.value;if(s){ZCe(s);var l=Xm(s);return _s(n,l?s.get(0):s[0],l?s.get(1):s[1],a)}}})},t})(Fx);wwe.prototype.cacheResult=V5.prototype.cacheResult=Twe.prototype.cacheResult=Awe.prototype.cacheResult=XZ;vbt=(function(e){function t(r){this._wrappedIterables=r.flatMap(function(n){return n._wrappedIterables?n._wrappedIterables:[n]}),this.size=this._wrappedIterables.reduce(function(n,o){if(n!==void 0){var i=o.size;if(i!==void 0)return n+i}},0),this[M5]=this._wrappedIterables[0][M5],this[k5]=this._wrappedIterables[0][k5],this[Ox]=this._wrappedIterables[0][Ox]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(n,o){if(this._wrappedIterables.length!==0){if(o)return this.cacheResult().__iterate(n,o);for(var i=0,a=Ss(this),s=a?$m:Zm,l=this._wrappedIterables[i].__iterator(s,o),c=!0,u=0;c;){for(var d=l.next();d.done;){if(i++,i===this._wrappedIterables.length)return u;l=this._wrappedIterables[i].__iterator(s,o),d=l.next()}var f=a?n(d.value[1],d.value[0],this):n(d.value,u,this);c=f!==!1,u++}return u}},t.prototype.__iteratorUncached=function(n,o){var i=this;if(this._wrappedIterables.length===0)return new ki(lf);if(o)return this.cacheResult().__iterator(n,o);var a=0,s=this._wrappedIterables[a].__iterator(n,o);return new ki(function(){for(var l=s.next();l.done;){if(a++,a===i._wrappedIterables.length)return l;s=i._wrappedIterables[a].__iterator(n,o),l=s.next()}return l})},t})(Yf);_bt=Object.prototype.toString;Uwe="@@__IMMUTABLE_MAP__@@";Jm=(function(e){function t(r){return r==null?Q0():o$(r)&&!J0(r)?r:Q0().withMutations(function(n){var o=e(r);Wm(o.size),o.forEach(function(i,a){return n.set(a,i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(n,o){return this._root?this._root.get(0,void 0,n,o):o},t.prototype.set=function(n,o){return ewe(this,n,o)},t.prototype.remove=function(n){return ewe(this,n,pi)},t.prototype.deleteAll=function(n){var o=yd(n);return o.size===0?this:this.withMutations(function(i){o.forEach(function(a){return i.remove(a)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Q0()},t.prototype.sort=function(n){return rc(pA(this,n))},t.prototype.sortBy=function(n,o){return rc(pA(this,o,n))},t.prototype.map=function(n,o){var i=this;return this.withMutations(function(a){a.forEach(function(s,l){a.set(l,n.call(o,s,l,i))})})},t.prototype.__iterator=function(n,o){return new Pbt(this,n,o)},t.prototype.__iterate=function(n,o){var i=this,a=0;return this._root&&this._root.iterate(function(s){return a++,n(s[1],s[0],i)},o),a},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?i$(this.size,this._root,n,this.__hash):this.size===0?Q0():(this.__ownerID=n,this.__altered=!1,this)},t})(Gp);Jm.isMap=o$;ds=Jm.prototype;ds[Uwe]=!0;ds[Vk]=ds.remove;ds.removeAll=ds.deleteAll;ds.setIn=e$;ds.removeIn=ds.deleteIn=l$;ds.update=t$;ds.updateIn=r$;ds.merge=ds.concat=Rwe;ds.mergeWith=Owe;ds.mergeDeep=Fwe;ds.mergeDeepWith=Nwe;ds.mergeIn=JZ;ds.mergeDeepIn=QZ;ds.withMutations=Gk;ds.wasAltered=n$;ds.asImmutable=qk;ds["@@transducer/init"]=ds.asMutable=jk;ds["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};ds["@@transducer/result"]=function(e){return e.asImmutable()};Ok=function(t,r){this.ownerID=t,this.entries=r};Ok.prototype.get=function(t,r,n,o){for(var i=this.entries,a=0,s=i.length;a<s;a++)if(Ym(n,i[a][0]))return i[a][1];return o};Ok.prototype.update=function(t,r,n,o,i,a,s){for(var l=i===pi,c=this.entries,u=0,d=c.length;u<d&&!Ym(o,c[u][0]);u++);var f=u<d;if(f?c[u][1]===i:l)return this;if(qp(s),(l||!f)&&qp(a),!(l&&c.length===1)){if(!f&&!l&&c.length>=Bbt)return Ibt(t,c,o,i);var m=t&&t===this.ownerID,p=m?c:$0(c);return f?l?u===d-1?p.pop():p[u]=p.pop():p[u]=[o,i]:p.push([o,i]),m?(this.entries=p,this):new Ok(t,p)}};hA=function(t,r,n){this.ownerID=t,this.bitmap=r,this.nodes=n};hA.prototype.get=function(t,r,n,o){r===void 0&&(r=Hm(n));var i=1<<((t===0?r:r>>>t)&sf),a=this.bitmap;return(a&i)===0?o:this.nodes[Vwe(a&i-1)].get(t+ja,r,n,o)};hA.prototype.update=function(t,r,n,o,i,a,s){n===void 0&&(n=Hm(o));var l=(r===0?n:n>>>r)&sf,c=1<<l,u=this.bitmap,d=(u&c)!==0;if(!d&&i===pi)return this;var f=Vwe(u&c-1),m=this.nodes,p=d?m[f]:void 0,h=a$(p,t,r+ja,n,o,i,a,s);if(h===p)return this;if(!d&&h&&m.length>=Rbt)return Dbt(t,m,u,l,h);if(d&&!h&&m.length===2&&twe(m[f^1]))return m[f^1];if(d&&h&&m.length===1&&twe(h))return h;var g=t&&t===this.ownerID,y=d?h?u:u^c:u|c,b=d?h?zwe(m,f,h,g):Mbt(m,f,g):kbt(m,f,h,g);return g?(this.bitmap=y,this.nodes=b,this):new hA(t,y,b)};Lk=function(t,r,n){this.ownerID=t,this.count=r,this.nodes=n};Lk.prototype.get=function(t,r,n,o){r===void 0&&(r=Hm(n));var i=(t===0?r:r>>>t)&sf,a=this.nodes[i];return a?a.get(t+ja,r,n,o):o};Lk.prototype.update=function(t,r,n,o,i,a,s){n===void 0&&(n=Hm(o));var l=(r===0?n:n>>>r)&sf,c=i===pi,u=this.nodes,d=u[l];if(c&&!d)return this;var f=a$(d,t,r+ja,n,o,i,a,s);if(f===d)return this;var m=this.count;if(!d)m++;else if(!f&&(m--,m<Obt))return Ebt(t,u,m,l);var p=t&&t===this.ownerID,h=zwe(u,l,f,p);return p?(this.count=m,this.nodes=h,this):new Lk(t,m,h)};gA=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entries=n};gA.prototype.get=function(t,r,n,o){for(var i=this.entries,a=0,s=i.length;a<s;a++)if(Ym(n,i[a][0]))return i[a][1];return o};gA.prototype.update=function(t,r,n,o,i,a,s){n===void 0&&(n=Hm(o));var l=i===pi;if(n!==this.keyHash)return l?this:(qp(s),qp(a),s$(this,t,r,n,[o,i]));for(var c=this.entries,u=0,d=c.length;u<d&&!Ym(o,c[u][0]);u++);var f=u<d;if(f?c[u][1]===i:l)return this;if(qp(s),(l||!f)&&qp(a),l&&d===2)return new yb(t,this.keyHash,c[u^1]);var m=t&&t===this.ownerID,p=m?c:$0(c);return f?l?u===d-1?p.pop():p[u]=p.pop():p[u]=[o,i]:p.push([o,i]),m?(this.entries=p,this):new gA(t,this.keyHash,p)};yb=function(t,r,n){this.ownerID=t,this.keyHash=r,this.entry=n};yb.prototype.get=function(t,r,n,o){return Ym(n,this.entry[0])?this.entry[1]:o};yb.prototype.update=function(t,r,n,o,i,a,s){var l=i===pi,c=Ym(o,this.entry[0]);if(c?i===this.entry[1]:l)return this;if(qp(s),l){qp(a);return}return c?t&&t===this.ownerID?(this.entry[1]=i,this):new yb(t,this.keyHash,[o,i]):(qp(a),s$(this,t,r,Hm(o),[o,i]))};Ok.prototype.iterate=gA.prototype.iterate=function(e,t){for(var r=this.entries,n=0,o=r.length-1;n<=o;n++)if(e(r[t?o-n:n])===!1)return!1};hA.prototype.iterate=Lk.prototype.iterate=function(e,t){for(var r=this.nodes,n=0,o=r.length-1;n<=o;n++){var i=r[t?o-n:n];if(i&&i.iterate(e,t)===!1)return!1}};yb.prototype.iterate=function(e,t){return e(this.entry)};Pbt=(function(e){function t(r,n,o){this._type=n,this._reverse=o,this._stack=r._root&&QCe(r._root)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.next=function(){for(var n=this._type,o=this._stack;o;){var i=o.node,a=o.index++,s=void 0;if(i.entry){if(a===0)return PZ(n,i.entry)}else if(i.entries){if(s=i.entries.length-1,a<=s)return PZ(n,i.entries[this._reverse?s-a:a])}else if(s=i.nodes.length-1,a<=s){var l=i.nodes[this._reverse?s-a:a];if(l){if(l.entry)return PZ(n,l.entry);o=this._stack=QCe(l,o)}continue}o=this._stack=this._stack.__prev}return lf()},t})(ki);Bbt=Km/4,Rbt=Km/2,Obt=Km/4;Hwe="@@__IMMUTABLE_LIST__@@";ry=(function(e){function t(r){var n=D5();if(r==null)return n;if(Wwe(r))return r;var o=e(r),i=o.size;return i===0?n:(Wm(i),i>0&&i<Km?Nk(0,i,ja,null,new Bx(o.toArray())):n.withMutations(function(a){a.setSize(i),o.forEach(function(s,l){return a.set(l,s)})}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(n,o){if(n=Rx(this,n),n>=0&&n<this.size){n+=this._origin;var i=Kwe(this,n);return i&&i.array[n&sf]}return o},t.prototype.set=function(n,o){return Vbt(this,n,o)},t.prototype.remove=function(n){return this.has(n)?n===0?this.shift():n===this.size-1?this.pop():this.splice(n,1):this},t.prototype.insert=function(n,o){return this.splice(n,0,o)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=ja,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):D5()},t.prototype.push=function(){var n=arguments,o=this.size;return this.withMutations(function(i){Mx(i,0,o+n.length);for(var a=0;a<n.length;a++)i.set(o+a,n[a])})},t.prototype.pop=function(){return Mx(this,0,-1)},t.prototype.unshift=function(){var n=arguments;return this.withMutations(function(o){Mx(o,-n.length);for(var i=0;i<n.length;i++)o.set(i,n[i])})},t.prototype.shift=function(){return Mx(this,1)},t.prototype.shuffle=function(n){return n===void 0&&(n=Math.random),this.withMutations(function(o){for(var i=o.size,a,s;i;)a=Math.floor(n()*i--),s=o.get(a),o.set(a,o.get(i)),o.set(i,s)})},t.prototype.concat=function(){for(var n=arguments,o=[],i=0;i<arguments.length;i++){var a=n[i],s=e(typeof a!="string"&&hwe(a)?a:[a]);s.size!==0&&o.push(s)}return o.length===0?this:this.size===0&&!this.__ownerID&&o.length===1?this.constructor(o[0]):this.withMutations(function(l){o.forEach(function(c){return c.forEach(function(u){return l.push(u)})})})},t.prototype.setSize=function(n){return Mx(this,0,n)},t.prototype.map=function(n,o){var i=this;return this.withMutations(function(a){for(var s=0;s<i.size;s++)a.set(s,n.call(o,a.get(s),s,i))})},t.prototype.slice=function(n,o){var i=this.size;return F5(n,o,i)?this:Mx(this,zk(n,i),N5(o,i))},t.prototype.__iterator=function(n,o){var i=o?this.size:0,a=rwe(this,o);return new ki(function(){var s=a();return s===Rk?lf():_s(n,o?--i:i++,s)})},t.prototype.__iterate=function(n,o){for(var i=o?this.size:0,a=rwe(this,o),s;(s=a())!==Rk&&n(s,o?--i:i++,this)!==!1;);return i},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?Nk(this._origin,this._capacity,this._level,this._root,this._tail,n,this.__hash):this.size===0?D5():(this.__ownerID=n,this.__altered=!1,this)},t})(iC);ry.isList=Wwe;tc=ry.prototype;tc[Hwe]=!0;tc[Vk]=tc.remove;tc.merge=tc.concat;tc.setIn=e$;tc.deleteIn=tc.removeIn=l$;tc.update=t$;tc.updateIn=r$;tc.mergeIn=JZ;tc.mergeDeepIn=QZ;tc.withMutations=Gk;tc.wasAltered=n$;tc.asImmutable=qk;tc["@@transducer/init"]=tc.asMutable=jk;tc["@@transducer/step"]=function(e,t){return e.push(t)};tc["@@transducer/result"]=function(e){return e.asImmutable()};Bx=function(t,r){this.array=t,this.ownerID=r};Bx.prototype.removeBefore=function(t,r,n){if((n&(1<<r+ja)-1)===0||this.array.length===0)return this;var o=n>>>r&sf;if(o>=this.array.length)return new Bx([],t);var i=o===0,a;if(r>0){var s=this.array[o];if(a=s&&s.removeBefore(t,r-ja,n),a===s&&i)return this}if(i&&!a)return this;var l=yA(this,t);if(!i)for(var c=0;c<o;c++)l.array[c]=void 0;return a&&(l.array[o]=a),l};Bx.prototype.removeAfter=function(t,r,n){if(n===(r?1<<r+ja:Km)||this.array.length===0)return this;var o=n-1>>>r&sf;if(o>=this.array.length)return this;var i;if(r>0){var a=this.array[o];if(i=a&&a.removeAfter(t,r-ja,n),i===a&&o===this.array.length-1)return this}var s=yA(this,t);return s.array.splice(o+1),i&&(s.array[o]=i),s};Rk={};rc=(function(e){function t(r){return r==null?Dk():Ywe(r)?r:Dk().withMutations(function(n){var o=Gp(r);Wm(o.size),o.forEach(function(i,a){return n.set(a,i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(n,o){var i=this._map.get(n);return i!==void 0?this._list.get(i)[1]:o},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):Dk()},t.prototype.set=function(n,o){return owe(this,n,o)},t.prototype.remove=function(n){return owe(this,n,pi)},t.prototype.__iterate=function(n,o){var i=this;return this._list.__iterate(function(a){return a&&n(a[1],a[0],i)},o)},t.prototype.__iterator=function(n,o){return this._list.fromEntrySeq().__iterator(n,o)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var o=this._map.__ensureOwner(n),i=this._list.__ensureOwner(n);return n?c$(o,i,n,this.__hash):this.size===0?Dk():(this.__ownerID=n,this.__altered=!1,this._map=o,this._list=i,this)},t})(Jm);rc.isOrderedMap=Ywe;rc.prototype[Ox]=!0;rc.prototype[Vk]=rc.prototype.remove;Xwe="@@__IMMUTABLE_STACK__@@";u$=(function(e){function t(r){return r==null?I5():FZ(r)?r:I5().pushAll(r)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(n,o){var i=this._head;for(n=Rx(this,n);i&&n--;)i=i.next;return i?i.value:o},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var n=arguments;if(arguments.length===0)return this;for(var o=this.size+arguments.length,i=this._head,a=arguments.length-1;a>=0;a--)i={value:n[a],next:i};return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):kk(o,i)},t.prototype.pushAll=function(n){if(n=e(n),n.size===0)return this;if(this.size===0&&FZ(n))return n;Wm(n.size);var o=this.size,i=this._head;return n.__iterate(function(a){o++,i={value:a,next:i}},!0),this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):kk(o,i)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):I5()},t.prototype.slice=function(n,o){if(F5(n,o,this.size))return this;var i=zk(n,this.size),a=N5(o,this.size);if(a!==this.size)return e.prototype.slice.call(this,n,o);for(var s=this.size-i,l=this._head;i--;)l=l.next;return this.__ownerID?(this.size=s,this._head=l,this.__hash=void 0,this.__altered=!0,this):kk(s,l)},t.prototype.__ensureOwner=function(n){return n===this.__ownerID?this:n?kk(this.size,this._head,n,this.__hash):this.size===0?I5():(this.__ownerID=n,this.__altered=!1,this)},t.prototype.__iterate=function(n,o){var i=this;if(o)return new mA(this.toArray()).__iterate(function(l,c){return n(l,c,i)},o);for(var a=0,s=this._head;s&&n(s.value,a++,this)!==!1;)s=s.next;return a},t.prototype.__iterator=function(n,o){if(o)return new mA(this.toArray()).__iterator(n,o);var i=0,a=this._head;return new ki(function(){if(a){var s=a.value;return a=a.next,_s(n,i++,s)}return lf()})},t})(iC);u$.isStack=FZ;cf=u$.prototype;cf[Xwe]=!0;cf.shift=cf.pop;cf.unshift=cf.push;cf.unshiftAll=cf.pushAll;cf.withMutations=Gk;cf.wasAltered=n$;cf.asImmutable=qk;cf["@@transducer/init"]=cf.asMutable=jk;cf["@@transducer/step"]=function(e,t){return e.unshift(t)};cf["@@transducer/result"]=function(e){return e.asImmutable()};jbt=(function(e){function t(r,n,o){if(o===void 0&&(o=1),!(this instanceof t))return new t(r,n,o);if(Bk(o!==0,"Cannot step a Range by 0"),Bk(r!==void 0,"You must define a start value when using Range"),Bk(n!==void 0,"You must define an end value when using Range"),o=Math.abs(o),n<r&&(o=-o),this._start=r,this._end=n,this._step=o,this.size=Math.max(0,Math.ceil((n-r)/o-1)+1),this.size===0){if(EZ)return EZ;EZ=this}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},t.prototype.get=function(n,o){return this.has(n)?this._start+Rx(this,n)*this._step:o},t.prototype.includes=function(n){var o=(n-this._start)/this._step;return o>=0&&o<this.size&&o===Math.floor(o)},t.prototype.slice=function(n,o){return F5(n,o,this.size)?this:(n=zk(n,this.size),o=N5(o,this.size),o<=n?new t(0,0):new t(this.get(n,this._end),this.get(o,this._end),this._step))},t.prototype.indexOf=function(n){var o=n-this._start;if(o%this._step===0){var i=o/this._step;if(i>=0&&i<this.size)return i}return-1},t.prototype.lastIndexOf=function(n){return this.indexOf(n)},t.prototype.__iterate=function(n,o){for(var i=this.size,a=this._step,s=o?this._start+(i-1)*a:this._start,l=0;l!==i&&n(s,o?i-++l:l++,this)!==!1;)s+=o?-a:a;return l},t.prototype.__iterator=function(n,o){var i=this.size,a=this._step,s=o?this._start+(i-1)*a:this._start,l=0;return new ki(function(){if(l===i)return lf();var c=s;return s+=o?-a:a,_s(n,o?i-++l:l++,c)})},t.prototype.equals=function(n){return n instanceof t?this._start===n._start&&this._end===n._end&&this._step===n._step:Zwe(this,n)},t})(Cg),$we="@@__IMMUTABLE_SET__@@";z5=(function(e){function t(r){return r==null?Mk():d$(r)&&!J0(r)?r:Mk().withMutations(function(n){var o=e(r);Wm(o.size),o.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Gp(n).keySeq())},t.intersect=function(n){return n=yd(n).toArray(),n.length?Uu.intersect.apply(t(n.pop()),n):Mk()},t.union=function(n){return n=yd(n).toArray(),n.length?Uu.union.apply(t(n.pop()),n):Mk()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(n){return this._map.has(n)},t.prototype.add=function(n){return E5(this,this._map.set(n,n))},t.prototype.remove=function(n){return E5(this,this._map.remove(n))},t.prototype.clear=function(){return E5(this,this._map.clear())},t.prototype.map=function(n,o){var i=this,a=!1,s=E5(this,this._map.mapEntries(function(l){var c=l[1],u=n.call(o,c,c,i);return u!==c&&(a=!0),[u,u]},o));return a?s:this},t.prototype.union=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];return n=n.filter(function(i){return i.size!==0}),n.length===0?this:this.size===0&&!this.__ownerID&&n.length===1?this.constructor(n[0]):this.withMutations(function(i){for(var a=0;a<n.length;a++)typeof n[a]=="string"?i.add(n[a]):e(n[a]).forEach(function(s){return i.add(s)})})},t.prototype.intersect=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(n.length===0)return this;n=n.map(function(a){return e(a)});var i=[];return this.forEach(function(a){n.every(function(s){return s.includes(a)})||i.push(a)}),this.withMutations(function(a){i.forEach(function(s){a.remove(s)})})},t.prototype.subtract=function(){for(var n=[],o=arguments.length;o--;)n[o]=arguments[o];if(n.length===0)return this;n=n.map(function(a){return e(a)});var i=[];return this.forEach(function(a){n.some(function(s){return s.includes(a)})&&i.push(a)}),this.withMutations(function(a){i.forEach(function(s){a.remove(s)})})},t.prototype.sort=function(n){return Qm(pA(this,n))},t.prototype.sortBy=function(n,o){return Qm(pA(this,o,n))},t.prototype.wasAltered=function(){return this._map.wasAltered()},t.prototype.__iterate=function(n,o){var i=this;return this._map.__iterate(function(a){return n(a,a,i)},o)},t.prototype.__iterator=function(n,o){return this._map.__iterator(n,o)},t.prototype.__ensureOwner=function(n){if(n===this.__ownerID)return this;var o=this._map.__ensureOwner(n);return n?this.__make(o,n):this.size===0?this.__empty():(this.__ownerID=n,this._map=o,this)},t})(xA);z5.isSet=d$;Uu=z5.prototype;Uu[$we]=!0;Uu[Vk]=Uu.remove;Uu.merge=Uu.concat=Uu.union;Uu.withMutations=Gk;Uu.asImmutable=qk;Uu["@@transducer/init"]=Uu.asMutable=jk;Uu["@@transducer/step"]=function(e,t){return e.add(t)};Uu["@@transducer/result"]=function(e){return e.asImmutable()};Uu.__empty=Mk;Uu.__make=Qwe;yd.Iterator=ki;sC(yd,{toArray:function(){Wm(this.size);var t=new Array(this.size||0),r=Ss(this),n=0;return this.__iterate(function(o,i){t[n++]=r?[i,o]:o}),t},toIndexedSeq:function(){return new wwe(this)},toJS:function(){return R5(this)},toKeyedSeq:function(){return new V5(this,!0)},toMap:function(){return Jm(this.toKeyedSeq())},toObject:tTe,toOrderedMap:function(){return rc(this.toKeyedSeq())},toOrderedSet:function(){return Qm(Ss(this)?this.valueSeq():this)},toSet:function(){return z5(Ss(this)?this.valueSeq():this)},toSetSeq:function(){return new Twe(this)},toSeq:function(){return jp(this)?this.toIndexedSeq():Ss(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return u$(Ss(this)?this.valueSeq():this)},toList:function(){return ry(Ss(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,r){return this.size===0?t+r:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+r},concat:function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return qa(this,bbt(this,t))},includes:function(t){return this.some(function(r){return Ym(r,t)})},entries:function(){return this.__iterator($m)},every:function(t,r){Wm(this.size);var n=!0;return this.__iterate(function(o,i,a){if(!t.call(r,o,i,a))return n=!1,!1}),n},filter:function(t,r){return qa(this,Ewe(this,t,r,!0))},partition:function(t,r){return gbt(this,t,r)},find:function(t,r,n){var o=this.findEntry(t,r);return o?o[1]:n},forEach:function(t,r){return Wm(this.size),this.__iterate(r?t.bind(r):t)},join:function(t){Wm(this.size),t=t!==void 0?""+t:",";var r="",n=!0;return this.__iterate(function(o){n?n=!1:r+=t,r+=o!=null?o.toString():""}),r},keys:function(){return this.__iterator(SA)},map:function(t,r){return qa(this,Iwe(this,t,r))},reduce:function(t,r,n){return awe(this,t,r,n,arguments.length<2,!1)},reduceRight:function(t,r,n){return awe(this,t,r,n,arguments.length<2,!0)},reverse:function(){return qa(this,WZ(this,!0))},slice:function(t,r){return qa(this,KZ(this,t,r,!0))},some:function(t,r){Wm(this.size);var n=!1;return this.__iterate(function(o,i,a){if(t.call(r,o,i,a))return n=!0,!1}),n},sort:function(t){return qa(this,pA(this,t))},values:function(){return this.__iterator(Zm)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(t,r){return fA(t?this.toSeq().filter(t,r):this)},countBy:function(t,r){return pbt(this,t,r)},equals:function(t){return Zwe(this,t)},entrySeq:function(){var t=this;if(t._cache)return new mA(t._cache);var r=t.toSeq().map(qbt).toIndexedSeq();return r.fromEntrySeq=function(){return t.toSeq()},r},filterNot:function(t,r){return this.filter(IZ(t),r)},findEntry:function(t,r,n){var o=n;return this.__iterate(function(i,a,s){if(t.call(r,i,a,s))return o=[a,i],!1}),o},findKey:function(t,r){var n=this.findEntry(t,r);return n&&n[0]},findLast:function(t,r,n){return this.toKeyedSeq().reverse().find(t,r,n)},findLastEntry:function(t,r,n){return this.toKeyedSeq().reverse().findEntry(t,r,n)},findLastKey:function(t,r){return this.toKeyedSeq().reverse().findKey(t,r)},first:function(t){return this.find(gwe,null,t)},flatMap:function(t,r){return qa(this,xbt(this,t,r))},flatten:function(t){return qa(this,kwe(this,t,!0))},fromEntrySeq:function(){return new Awe(this)},get:function(t,r){return this.find(function(n,o){return Ym(o,t)},void 0,r)},getIn:eTe,groupBy:function(t,r){return hbt(this,t,r)},has:function(t){return this.get(t,pi)!==pi},hasIn:Hbt,isSubset:function(t){return t=typeof t.includes=="function"?t:yd(t),this.every(function(r){return t.includes(r)})},isSuperset:function(t){return t=typeof t.isSubset=="function"?t:yd(t),t.isSubset(this)},keyOf:function(t){return this.findKey(function(r){return Ym(r,t)})},keySeq:function(){return this.toSeq().map(zbt).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return A5(this,t)},maxBy:function(t,r){return A5(this,r,t)},min:function(t){return A5(this,t?swe(t):lwe)},minBy:function(t,r){return A5(this,r?swe(r):lwe,t)},rest:function(){return this.slice(1)},skip:function(t){return t===0?this:this.slice(Math.max(0,t))},skipLast:function(t){return t===0?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,r){return qa(this,Dwe(this,t,r,!0))},skipUntil:function(t,r){return this.skipWhile(IZ(t),r)},sortBy:function(t,r){return qa(this,pA(this,r,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,r){return qa(this,ybt(this,t,r))},takeUntil:function(t,r){return this.takeWhile(IZ(t),r)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=Wbt(this))}});vd=yd.prototype;vd[mwe]=!0;vd[O5]=vd.values;vd.toJSON=vd.toArray;vd.__toStringMapper=Fk;vd.inspect=vd.toSource=function(){return this.toString()};vd.chain=vd.flatMap;vd.contains=vd.includes;sC(Gp,{flip:function(){return qa(this,Pwe(this))},mapEntries:function(t,r){var n=this,o=0;return qa(this,this.toSeq().map(function(i,a){return t.call(r,[a,i],o++,n)}).fromEntrySeq())},mapKeys:function(t,r){var n=this;return qa(this,this.toSeq().flip().map(function(o,i){return t.call(r,o,i,n)}).flip())}});Hk=Gp.prototype;Hk[M5]=!0;Hk[O5]=vd.entries;Hk.toJSON=tTe;Hk.__toStringMapper=function(e,t){return Fk(t)+": "+Fk(e)};sC(iC,{toKeyedSeq:function(){return new V5(this,!1)},filter:function(t,r){return qa(this,Ewe(this,t,r,!1))},findIndex:function(t,r){var n=this.findEntry(t,r);return n?n[0]:-1},indexOf:function(t){var r=this.keyOf(t);return r===void 0?-1:r},lastIndexOf:function(t){var r=this.lastKeyOf(t);return r===void 0?-1:r},reverse:function(){return qa(this,WZ(this,!1))},slice:function(t,r){return qa(this,KZ(this,t,r,!1))},splice:function(t,r){var n=arguments.length;if(r=Math.max(r||0,0),n===0||n===2&&!r)return this;t=zk(t,t<0?this.count():this.size);var o=this.slice(0,t);return qa(this,n===1?o:o.concat($0(arguments,2),this.slice(t+r)))},findLastIndex:function(t,r){var n=this.findLastEntry(t,r);return n?n[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return qa(this,kwe(this,t,!1))},get:function(t,r){return t=Rx(this,t),t<0||this.size===1/0||this.size!==void 0&&t>this.size?r:this.find(function(n,o){return o===t},void 0,r)},has:function(t){return t=Rx(this,t),t>=0&&(this.size!==void 0?this.size===1/0||t<this.size:this.indexOf(t)!==-1)},interpose:function(t){return qa(this,Sbt(this,t))},interleave:function(){var t=[this].concat($0(arguments)),r=P5(this.toSeq(),Cg.of,t),n=r.flatten(!0);return r.size&&(n.size=r.size*t.length),qa(this,n)},keySeq:function(){return jbt(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,r){return qa(this,Dwe(this,t,r,!1))},zip:function(){var t=[this].concat($0(arguments));return qa(this,P5(this,dwe,t))},zipAll:function(){var t=[this].concat($0(arguments));return qa(this,P5(this,dwe,t,!0))},zipWith:function(t){var r=$0(arguments);return r[0]=this,qa(this,P5(this,t,r))}});TA=iC.prototype;TA[k5]=!0;TA[Ox]=!0;sC(xA,{get:function(t,r){return this.has(t)?t:r},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});vA=xA.prototype;vA.has=vd.includes;vA.contains=vA.includes;vA.keys=vA.values;sC(Fx,Hk);sC(Cg,TA);sC(CA,vA);Qm=(function(e){function t(r){return r==null?NZ():rTe(r)?r:NZ().withMutations(function(n){var o=xA(r);Wm(o.size),o.forEach(function(i){return n.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(n){return this(Gp(n).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t})(z5);Qm.isOrderedSet=rTe;lC=Qm.prototype;lC[Ox]=!0;lC.zip=TA.zip;lC.zipWith=TA.zipWith;lC.zipAll=TA.zipAll;lC.__empty=NZ;lC.__make=nTe;Zc=function(t,r){var n;Ybt(t);var o=function(s){var l=this;if(s instanceof o)return s;if(!(this instanceof o))return new o(s);if(!n){n=!0;var c=Object.keys(t),u=i._indices={};i._name=r,i._keys=c,i._defaultValues=t;for(var d=0;d<c.length;d++){var f=c[d];u[f]=d,i[f]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+m$(this)+' with property "'+f+'" since that property name is part of the Record API.'):Xbt(i,f)}}return this.__ownerID=void 0,this._values=ry().withMutations(function(m){m.setSize(l._keys.length),Gp(s).forEach(function(p,h){m.set(l._indices[h],p===l._defaultValues[h]?void 0:p)})}),this},i=o.prototype=Object.create(Ja);return i.constructor=o,r&&(o.displayName=r),o};Zc.prototype.toString=function(){for(var t=m$(this)+" { ",r=this._keys,n,o=0,i=r.length;o!==i;o++)n=r[o],t+=(o?", ":"")+n+": "+Fk(this.get(n));return t+" }"};Zc.prototype.equals=function(t){return this===t||aC(t)&&bA(this).equals(bA(t))};Zc.prototype.hashCode=function(){return bA(this).hashCode()};Zc.prototype.has=function(t){return this._indices.hasOwnProperty(t)};Zc.prototype.get=function(t,r){if(!this.has(t))return r;var n=this._indices[t],o=this._values.get(n);return o===void 0?this._defaultValues[t]:o};Zc.prototype.set=function(t,r){if(this.has(t)){var n=this._values.set(this._indices[t],r===this._defaultValues[t]?void 0:r);if(n!==this._values&&!this.__ownerID)return f$(this,n)}return this};Zc.prototype.remove=function(t){return this.set(t)};Zc.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:f$(this,t)};Zc.prototype.wasAltered=function(){return this._values.wasAltered()};Zc.prototype.toSeq=function(){return bA(this)};Zc.prototype.toJS=function(){return R5(this)};Zc.prototype.entries=function(){return this.__iterator($m)};Zc.prototype.__iterator=function(t,r){return bA(this).__iterator(t,r)};Zc.prototype.__iterate=function(t,r){return bA(this).__iterate(t,r)};Zc.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var r=this._values.__ensureOwner(t);return t?f$(this,r,t):(this.__ownerID=t,this._values=r,this)};Zc.isRecord=aC;Zc.getDescriptiveName=m$;Ja=Zc.prototype;Ja[bwe]=!0;Ja[Vk]=Ja.remove;Ja.deleteIn=Ja.removeIn=l$;Ja.getIn=eTe;Ja.hasIn=vd.hasIn;Ja.merge=Rwe;Ja.mergeWith=Owe;Ja.mergeIn=JZ;Ja.mergeDeep=Fwe;Ja.mergeDeepWith=Nwe;Ja.mergeDeepIn=QZ;Ja.setIn=e$;Ja.update=t$;Ja.updateIn=r$;Ja.withMutations=Gk;Ja.asMutable=jk;Ja.asImmutable=qk;Ja[O5]=Ja.entries;Ja.toJSON=Ja.toObject=vd.toObject;Ja.inspect=Ja.toSource=function(){return this.toString()}});var nc,p$=M(()=>{Vt();Ue();(function(e){function t(o){let i={create(a){return{action:i,params:a}},id:En.create22(),definition:o,createDefaultParams(a,s){return o.params?_.getDefaultValues(o.params(a,s)):{}}};return i}e.create=t;function r(o){let i=o.definition;return t({from:i.from,display:i.display,params:i.params,isApplicable:o.definition.isApplicable?(a,s,l)=>o.definition.isApplicable(a,l):void 0,run({cell:a,state:s,params:l}){let c=s.build().to(a.transform.ref).apply(o,l);return s.updateTree(c)}})}e.fromTransformer=r;let n;(function(o){function i(a){return s=>t({from:a.from instanceof Array?a.from:a.from?[a.from]:[],display:typeof a.display=="string"?{name:a.display}:a.display?a.display:{name:"Unnamed State Action"},params:typeof a.params=="object"?()=>a.params:a.params?a.params:void 0,isApplicable:a.isApplicable,...typeof s=="function"?{run:s}:s})}o.build=a=>i(a)})(n=e.Builder||(e.Builder={})),e.build=n.build})(nc||(nc={}))});var ct,Wk=M(()=>{bb();Ue();p$();wc();(function(e){function t(h,g,y){return h.definition.params?h.definition.params(g,y):{}}e.getParamDefinition=t;function r(h){return!!h&&typeof h.toAction=="function"&&typeof h.apply=="function"}e.is=r;let n;(function(h){h[h.Unchanged=0]="Unchanged",h[h.Updated=1]="Updated",h[h.Recreate=2]="Recreate",h[h.Null=3]="Null"})(n=e.UpdateResult||(e.UpdateResult={}));let o=new Map,i=new Map;function a(h){for(let g of h.definition.from)i.has(g.type)?i.get(g.type).push(h):i.set(g.type,[h])}function s(){return Array.from(o.values())}e.getAll=s;function l(h){let g=o.get(h);if(!g)throw new Error(`A transformer with signature '${h}' is not registered.`);return g}e.get=l;function c(h){return i.get(h)||[]}e.fromType=c;function u(h,g){let{name:y}=g,b=`${h}.${y}`;o.has(b)&&console.warn(`A transform with id '${y}' is already registered. Please pick a unique identifier for your transforms and/or register them only once. This is to ensure that transforms can be serialized and replayed.`);let x={apply(C,S,w){return Ur.create(C,x,S,w)},toAction(){return nc.fromTransformer(x)},namespace:h,id:b,definition:g,createDefaultParams(C,S){return g.params?_.getDefaultValues(g.params(C,S)):{}}};return o.set(b,x),a(x),x}e.create=u;function d(h){return g=>u(h,g)}e.factory=d;function f(h){return m.build(h)}e.builderFactory=f;let m;(function(h){function g(b,x){return C=>u(b,{name:x.name,from:x.from instanceof Array?x.from:[x.from],to:x.to instanceof Array?x.to:[x.to],display:typeof x.display=="string"?{name:x.display}:x.display?x.display:{name:S0(x.name.replace(/[-]/g," "))},params:typeof x.params=="object"?()=>x.params:x.params?x.params:void 0,isDecorator:x.isDecorator,...C})}function y(b){return x=>g(b,x)}h.build=y})(m=e.Builder||(e.Builder={}));function p(h){return m.build(h)}e.build=p,e.ROOT=u("build-in",{name:"root",from:[],to:[],display:{name:"Root",description:"For internal use."},apply(){throw new Error("should never be applied")},update(){return n.Unchanged}})})(ct||(ct={}))});var Ur,bb=M(()=>{Wk();Vt();tn();(function(e){e.RootRef="-=root=-";function t(b,x){return x?typeof x.isCollapsed<"u"&&b.isCollapsed!==x.isCollapsed||typeof x.isHidden<"u"&&b.isHidden!==x.isHidden||typeof x.isGhost<"u"&&b.isGhost!==x.isGhost||typeof x.isLocked<"u"&&b.isLocked!==x.isLocked:!1}e.isStateChange=t;function r(b,x){if(!x)return!1;let C=!1;for(let S of Object.keys(x)){let w=x[S],A=b[S];!!w!=!!A&&(C=!0,b[S]=w)}return C}e.assignState=r;function n(b,x){if(!x)return!1;let C=!1;for(let S of Object.keys(x)){let w=x[S],A=b[S];!!w!=!!A&&(C=!0,w!==void 0?b[S]=w:delete b[S])}for(let S of Object.keys(b)){let w=x[S],A=b[S];!!w!=!!A&&(C=!0,w!==void 0?b[S]=w:delete b[S])}return C}e.syncState=n;function o(b,x,C,S){let w=S&&S.ref?S.ref:En.create22(),A;return S&&S.tags&&(A=typeof S.tags=="string"?[S.tags]:S.tags,A.length===0?A=void 0:A.sort()),{parent:b,transformer:x,state:S?.state||{},tags:A,ref:w,dependsOn:S&&S.dependsOn,params:C,version:En.create22()}}e.create=o;function i(b,x){return{...b,params:x,version:En.create22()}}e.withParams=i;function a(b,x){return x?{...b,state:{...b.state,...x}}:b}e.withState=a;function s(b,x){let C;return x&&(C=typeof x=="string"?[x]:x,C.length===0?C=void 0:C.sort()),{...b,tags:C,version:En.create22()}}e.withTags=s;function l(b,x){let C;return x&&(C=typeof x=="string"?[x]:x,C.length===0?C=void 0:C.sort()),{...b,dependsOn:C,version:En.create22()}}e.withDependsOn=l;function c(b,x){return{...b,parent:x,version:En.create22()}}e.withParent=c;function u(b){return o(e.RootRef,ct.ROOT,{},{ref:e.RootRef,state:b})}e.createRoot=u;function d(b,x){return b.tags?b.tags.indexOf(x)>=0:!1}e.hasTag=d;function f(b,x){if(!b.tags)return typeof x!="string"&&x.length===0;if(typeof x=="string")return d(b,x);for(let C of x)if(b.tags.indexOf(C)<0)return!1;return!0}e.hasTags=f;let m={};function p(b){var x,C;let S;try{S=ZH((x=b.params)!==null&&x!==void 0?x:m)}catch{let A=b.transformer.definition.customSerialization?b.transformer.definition.customSerialization.toJSON:h;S=ZH(A((C=b.params)!==null&&C!==void 0?C:m))}b.version=S}e.setParamsHashVersion=p;function h(b){return b}function g(b){let x=b.transformer.definition.customSerialization?b.transformer.definition.customSerialization.toJSON:h,C;for(let S of Object.keys(b.state))b.state[S]&&(C||(C={}),C[S]=!0);return{parent:b.parent,transformer:b.transformer.id,params:b.params?x(b.params):void 0,state:C,tags:b.tags,ref:b.ref,dependsOn:b.dependsOn,version:b.version}}e.toJSON=g;function y(b){let x=ct.get(b.transformer),C=x.definition.customSerialization?x.definition.customSerialization.fromJSON:h;return{parent:b.parent,transformer:x,params:b.params?C(b.params):void 0,state:b.state||{},tags:b.tags,ref:b.ref,dependsOn:b.dependsOn,version:b.version}}e.fromJSON=y})(Ur||(Ur={}))});function Zbt(e,t){this.set(t,e.asImmutable())}function $bt(e,t){e.size===0?this.delete(t):this.set(t,e.asImmutable())}function Qbt(e){throw new Error(`Transform '${e}' is already present in the tree.`)}function Jbt(e){throw new Error(`Parent '${e}' must be present in the tree.`)}function Kk(e,t){if(!e.has(t))throw new Error(`Node '${t}' is not present in the tree.`)}var Yk,h$=M(()=>{vb();bb();q5();Aa();Jn();Yk=class{get childMutations(){return this._childMutations?this._childMutations:(this._childMutations=new Map,this._childMutations)}get dependencyMutations(){return this._dependencyMutations?this._dependencyMutations:(this._dependencyMutations=new Map,this._dependencyMutations)}changeNodes(){this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable())}changeChildren(){this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable())}changeDependencies(){this.changedDependencies||(this.changedDependencies=!0,this.dependencies=this.dependencies.asMutable())}get root(){return this.transforms.get(Ur.RootRef)}asTransient(){return this.asImmutable().asTransient()}addChild(t,r){if(this.changeChildren(),this.childMutations.has(t))this.childMutations.get(t).add(r);else{let n=this.children.get(t).asMutable();n.add(r),this.children.set(t,n),this.childMutations.set(t,n)}}removeChild(t,r){if(this.changeChildren(),this.childMutations.has(t))this.childMutations.get(t).remove(r);else{let n=this.children.get(t).asMutable();n.remove(r),this.children.set(t,n),this.childMutations.set(t,n)}}clearRoot(){let t=Ur.RootRef;if(this.children.get(t).size===0)return;this.changeChildren();let r=Qm();this.children.set(t,r),this.childMutations.set(t,r)}mutateDependency(t,r,n){let o=this.dependencyMutations.get(t);if(!o){let i=this.dependencies.get(t);if(!i&&n==="remove")return;this.changeDependencies(),o=i?i.asMutable():Qm().asMutable(),this.dependencyMutations.set(t,o),this.dependencies.set(t,o)}n==="add"?o.add(r):o.remove(r)}changeParent(t,r){Kk(this.transforms,t);let n=this.transforms.get(t);this.removeChild(n.parent,t),this.addChild(r,t),this.changeNodes(),this.transforms.set(t,Ur.withParent(n,r))}add(t){let r=t.ref;this.transforms.has(t.ref)&&this.transforms.get(t.ref).parent!==t.parent&&Qbt(t.ref);let n=this.children.get(t.parent);if(n||Jbt(t.parent),n.has(t.ref)||this.addChild(t.parent,t.ref),this.children.has(t.ref)||(this.changedChildren||(this.changedChildren=!0,this.children=this.children.asMutable()),this.children.set(t.ref,Qm())),this.changeNodes(),this.transforms.set(r,t),t.dependsOn)for(let o of t.dependsOn)this.mutateDependency(o,r,"add");return this}setParams(t,r){Kk(this.transforms,t);let n=this.transforms.get(t);return F1(n.params,r)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,Ur.withParams(n,r)),!0)}setTags(t,r){Kk(this.transforms,t);let n=this.transforms.get(t),o=Ur.withTags(n,r);return s2(n.tags,o.tags)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,o),!0)}setDependsOn(t,r){Kk(this.transforms,t);let n=this.transforms.get(t),o=Ur.withDependsOn(n,r);return s2(n.dependsOn,o.dependsOn)?!1:(this.changedNodes||(this.changedNodes=!0,this.transforms=this.transforms.asMutable()),this.transforms.set(n.ref,o),!0)}assignState(t,r){Kk(this.transforms,t);let n=this.transforms.get(t);if(this._stateUpdates&&this._stateUpdates.has(t))return Ur.assignState(n.state,r),n;{this._stateUpdates||(this._stateUpdates=new Set),this._stateUpdates.add(n.ref),this.changeNodes();let o=Ur.withState(n,r);return this.transforms.set(t,o),o}}remove(t){let r=this.transforms.get(t);if(!r)return[];let n=zi.subtreePostOrder(this,r);if(t===Ur.RootRef){if(n.pop(),n.length===0)return n;this.clearRoot()}else{if(n.length===0)return n;this.removeChild(r.parent,r.ref)}this.changeNodes(),this.changeChildren();for(let i of n)this.transforms.delete(i.ref),this.children.delete(i.ref),this._childMutations&&this._childMutations.delete(i.ref);let o=[];for(let i of n){if(i.dependsOn)for(let a of i.dependsOn)this.transforms.has(a)&&this.mutateDependency(a,i.ref,"remove");if(this.dependencies.has(i.ref)){let a=this.dependencies.get(i.ref).toArray();this.changeDependencies(),this.dependencies.delete(i.ref),this._dependencyMutations&&this._dependencyMutations.delete(i.ref);for(let s of a)if(this.transforms.has(s))for(let l of this.remove(s))o[o.length]=l}}for(let i of o)n[n.length]=i;return n}asImmutable(){return!this.changedNodes&&!this.changedChildren&&!this._childMutations?this.tree:(this._childMutations&&this._childMutations.forEach(Zbt,this.children),this._dependencyMutations&&this._dependencyMutations.forEach($bt,this.dependencies),zi.create(this.changedNodes?this.transforms.asImmutable():this.transforms,this.changedChildren?this.children.asImmutable():this.children,this.changedDependencies?this.dependencies.asImmutable():this.dependencies))}constructor(t){this.tree=t,this.transforms=this.tree.transforms,this.children=this.tree.children,this.dependencies=this.tree.dependencies,this.changedNodes=!1,this.changedChildren=!1,this.changedDependencies=!1,this._childMutations=void 0,this._dependencyMutations=void 0,this._stateUpdates=void 0}}});var zi,q5=M(()=>{vb();bb();h$();(function(e){class t{get root(){return this.transforms.get(Ur.RootRef)}asTransient(){return new Yk(this)}constructor(w,A,T){this.transforms=w,this.children=A,this.dependencies=T}}function r(S){let w=S||Ur.createRoot();return n(Jm([[w.ref,w]]),Jm([[w.ref,Qm()]]),Jm())}e.createEmpty=r;function n(S,w,A){return new t(S,w,A)}e.create=n;function o(S){i(this,this.tree.transforms.get(S))}function i(S,w){let A=S.tree.children.get(w.ref);A&&A.size&&A.forEach(o,S),S.f(w,S.tree,S.state)}function a(S,w,A,T){let D={tree:S,state:A,f:T};return i(D,w),D.state}e.doPostOrder=a;function s(S){l(this,this.tree.transforms.get(S))}function l(S,w){let A=S.f(w,S.tree,S.state);if(typeof A=="boolean"&&!A)return;let T=S.tree.children.get(w.ref);T&&T.size&&T.forEach(s,S)}function c(S,w,A,T){let D={tree:S,state:A,f:T};return l(D,w),D.state}e.doPreOrder=c;function u(S,w,A){A.push(S)}function d(S,w){return a(S,w,[],u)}e.subtreePostOrder=d;function f(S,w,A){A.push(Ur.toJSON(S))}function m(S){let w=[];return c(S,S.root,w,f),{transforms:w}}e.toJSON=m;function p(S){let w=Jm().asMutable(),A=Jm().asMutable(),T=Jm().asMutable();for(let E of S.transforms){let I=Ur.fromJSON(E);w.set(I.ref,I),A.has(I.ref)||A.set(I.ref,Qm().asMutable()),I.ref!==I.parent&&A.get(I.parent).add(I.ref)}let D=new Set;for(let E of S.transforms){let I=E.ref;if(A.set(I,A.get(I).asImmutable()),!!E.dependsOn)for(let k of E.dependsOn)D.add(k),T.has(k)?T.get(k).add(I):T.set(k,Qm([I]).asMutable())}return D.forEach(E=>{T.set(E,T.get(E).asImmutable())}),n(w.asImmutable(),A.asImmutable(),T.asImmutable())}e.fromJSON=p;function h(S){console.log({tr:S.transforms.keySeq().toArray(),tr1:S.transforms.valueSeq().toArray().map(w=>w.ref),ch:S.children.keySeq().toArray()})}e.dump=h;function g(S,w,A){if(w===A)return!0;let D=S.children.get(w).values();for(;;){let E=D.next();if(E.done)return!1;if(g(S,E.value,A))return!0}}function y(S,w,A){return!S.transforms.has(w)||!S.transforms.has(A)?!1:g(S,w,A)}e.subtreeHasRef=y;function b(S,w){let A=S.children.get(w);if(A.size!==1)return w;let T=S.transforms.get(A.first());return T?.transformer.definition.isDecorator?b(S,T.ref):w}e.getDecoratorRoot=b;function x(S,w){for(let A of w){let T=S.transforms.get(A);T&&Ur.setParamsHashVersion(T)}}e.setParamHashVersion=x;function C(S,w){let A=new Map(w.transforms.map(T=>[T.ref,T]));for(let T of S.transforms){let D=A.get(T.ref);D&&(T.transformer!==D.transformer||T.version!==D.version||(T.params=D.params))}}e.reuseTransformParams=C})(zi||(zi={}))});var j5=M(()=>{q5();h$()});var ir,G5=M(()=>{j5();bb();(function(e){function t(X,Y){return r(X)(Y)}e.select=t;function r(X){let Y=X||c.root,ne;return o(Y)?ne=Y.compile():n(Y)?ne=c.byValue(Y).compile():i(Y)?ne=Y:ne=c.byRef(Y).compile(),ne}e.compile=r;function n(X){return X.transform!==void 0&&X.status!==void 0}function o(X){return X.compile!==void 0}function i(X){return typeof X=="function"}let a={select(X){return t(this,X||this.state)}};function s(X,Y){a[X]=function(...ne){return Y.call(void 0,this,...ne)}}function l(X){return Object.create(a,{compile:{writable:!1,configurable:!1,value:X}})}let c;(function(X){X.root=l(()=>re=>[re.cells.get(re.tree.root.ref)]);function Y(...re){return l(()=>ee=>{let le=[];for(let pe of re){let ke=ee.cells.get(pe);ke&&le.push(ke)}return le})}X.byRef=Y;function ne(...re){return l(()=>ee=>re)}X.byValue=ne;function K(re,ee=Ur.RootRef){return l(()=>le=>{let pe={roots:[],cells:le.cells,type:re.type};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,Q),pe.roots})}X.rootsOfType=K;function $(re,ee=Ur.RootRef){return l(()=>le=>{let pe={ret:[],cells:le.cells,type:re.type};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,ae),pe.ret})}X.ofType=$;function Z(re,ee=Ur.RootRef){return l(()=>le=>{let pe={ret:[],cells:le.cells,t:re};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,ye),pe.ret})}X.ofTransformer=Z;function de(re,ee=Ur.RootRef){return l(()=>le=>{let pe={ret:[],cells:le.cells,t:re};return zi.doPreOrder(le.tree,le.tree.transforms.get(ee),pe,we),pe.ret})}X.ofTransformerWithError=de;function Q(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.obj&&pe.obj.type===le.type?(le.roots.push(pe),!1):!0}function ae(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.obj&&pe.obj.type===le.type&&le.ret.push(pe),!0}function ye(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.obj&&pe.transform.transformer===le.t&&le.ret.push(pe),!0}function we(re,ee,le){let pe=le.cells.get(re.ref);return pe&&pe.status==="error"&&pe.transform.transformer===le.t&&le.ret.push(pe),!0}})(c=e.Generators||(e.Generators={})),s("flatMap",u);function u(X,Y){let ne=r(X);return l(()=>K=>{let $=[];for(let Z of ne(K))for(let de of Y(Z,K))$.push(de);return $})}e.flatMap=u,s("mapObject",d);function d(X,Y){let ne=r(X);return l(()=>K=>{let $=[];for(let Z of ne(K)){let de=Y(Z,K);de&&$.push(de)}return $})}e.mapObject=d,s("unique",f);function f(X){let Y=r(X);return l(()=>ne=>{let K=new Set,$=[];for(let Z of Y(ne))Z&&(K.has(Z.transform.ref)||(K.add(Z.transform.ref),$.push(Z)));return $})}e.unique=f,s("first",m);function m(X){let Y=r(X);return l(()=>ne=>{let K=Y(ne);return K.length?[K[0]]:[]})}e.first=m,s("filter",p);function p(X,Y){return u(X,ne=>Y(ne)?[ne]:[])}e.filter=p,s("withStatus",h);function h(X,Y){return p(X,ne=>ne.status===Y)}e.withStatus=h,s("withTag",g);function g(X,Y){return p(X,ne=>!!ne.transform.tags&&ne.transform.tags.indexOf(Y)>=0)}e.withTag=g,s("subtree",y);function y(X){return u(X,(Y,ne)=>{let K=[];return zi.doPreOrder(ne.tree,ne.tree.transforms.get(Y.transform.ref),K,($,Z,de)=>{de.push($.ref)}),K.map($=>ne.cells.get($))})}e.subtree=y,s("children",b);function b(X){return u(X,(Y,ne)=>{let K=[];return ne.tree.children.get(Y.transform.ref).forEach($=>K.push(ne.cells.get($))),K})}e.children=b,s("ofType",x);function x(X,Y){return p(X,ne=>ne.obj?ne.obj.type===Y.type:!1)}e.ofType=x,s("ancestor",C);function C(X,Y){return f(d(X,(ne,K)=>k(K.tree,K.cells,ne.transform.ref,Y)))}e.ancestor=C,s("ancestorOfType",S);function S(X,Y){return f(d(X,(ne,K)=>O(K.tree,K.cells,ne.transform.ref,Y)))}e.ancestorOfType=S,s("ancestorWithTransformer",w);function w(X,Y){return f(d(X,(ne,K)=>B(K.tree,K.cells,ne.transform.ref,Y)))}e.ancestorWithTransformer=w,s("withTransformer",A);function A(X,Y){return p(X,ne=>ne.transform.transformer===Y)}e.withTransformer=A,s("root",T);function T(X,Y){return f(d(X,(ne,K)=>R(K.tree,K.cells,ne.transform.ref,Y)))}e.root=T,s("rootOfType",D);function D(X,Y){return f(d(X,(ne,K)=>F(K.tree,K.cells,ne.transform.ref,Y)))}e.rootOfType=D,s("parent",E);function E(X){return f(d(X,(Y,ne)=>ne.cells.get(ne.tree.transforms.get(Y.transform.ref).parent)))}e.parent=E;function I(X,Y,ne,K,$){let Z=X.transforms.get(ne),de;for(;;){Z=X.transforms.get(Z.parent);let Q=Y.get(Z.ref);if(Q.obj&&K(Q)&&(de=Q,$)||Z.ref===Ur.RootRef)return de}}function k(X,Y,ne,K){return I(X,Y,ne,K,!0)}e.findAncestor=k;function R(X,Y,ne,K){return I(X,Y,ne,K,!1)}e.findRoot=R;function B(X,Y,ne,K){return k(X,Y,ne,Array.isArray(K)?$=>K.indexOf($.transform.transformer)>=0:$=>$.transform.transformer===K)}e.findAncestorWithTransformer=B;function O(X,Y,ne,K){return k(X,Y,ne,q(K))}e.findAncestorOfType=O;function F(X,Y,ne,K){return R(X,Y,ne,q(K))}e.findRootOfType=F;function q(X){return Array.isArray(X)?Y=>{for(let ne of X)if(ne.type===Y.obj.type)return!0}:Y=>Y.obj.type===X.type}function W(X,Y,ne){return zi.doPreOrder(X,X.transforms.get(Y),{refs:{},tags:ne},j).refs}e.findUniqueTagsInSubtree=W;function j(X,Y,ne){if(X.tags){for(let K of X.tags)if(ne.tags.has(K)){ne.refs[K]=X.ref;break}}return!0}function L(X,Y,ne){return zi.doPreOrder(X,X.transforms.get(Y),{ref:void 0,tag:ne},V).ref}e.findTagInSubtree=L;function V(X,Y,ne){return X.tags&&X.tags.indexOf(ne.tag)>=0?(ne.ref=X.ref,!1):!0}function U(X,Y,ne){return zi.doPreOrder(X,X.transforms.get(Y),{refs:[],tags:ne},z).refs}e.findWithAllTags=U;function z(X,Y,ne){if(X.tags){let K=ne.tags.size,$=0;for(let Z of X.tags)if(ne.tags.has(Z)&&($++,$===K)){ne.refs.push(X);break}}else ne.tags.size===0&&ne.refs.push(X)}function ie(X,Y,ne){if(X.transforms.get(Y).transformer===ne)return X.cells.get(Y);let $=X.tree.children.get(Y);if($.size!==1)return;let Z=$.first();if(Z&&X.transforms.get(Z).transformer.definition.isDecorator)return ie(X,Z,ne)}e.tryFindDecorator=ie;function oe(X,Y){let ne=X.tree.children.get(Y);if(ne.size!==1)return X.cells.get(Y);let K=ne.first();return K&&X.transforms.get(K).transformer.definition.isDecorator?oe(X,K):X.cells.get(Y)}e.getDecorated=oe})(ir||(ir={}))});function bd(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");g$(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function oTe(e,t,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(u){try{c(n.next(u))}catch(d){a(d)}}function l(u){try{c(n.throw(u))}catch(d){a(d)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((n=n.apply(e,t||[])).next())})}function H5(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,o,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(u){c=[6,u],o=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function xb(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Sb(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function _b(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n<o;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function cC(e){return this instanceof cC?(this.v=e,this):new cC(e)}function iTe(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(m){return function(p){return Promise.resolve(p).then(m,d)}}function s(m,p){n[m]&&(o[m]=function(h){return new Promise(function(g,y){i.push([m,h,g,y])>1||l(m,h)})},p&&(o[m]=p(o[m])))}function l(m,p){try{c(n[m](p))}catch(h){f(i[0][3],h)}}function c(m){m.value instanceof cC?Promise.resolve(m.value.v).then(u,d):f(i[0][2],m)}function u(m){l("next",m)}function d(m){l("throw",m)}function f(m,p){m(p),i.shift(),i.length&&l(i[0][0],i[0][1])}}function aTe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof xb=="function"?xb(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,l){a=e[i](a),o(s,l,a.done,a.value)})}}function o(i,a,s,l){Promise.resolve(l).then(function(c){i({value:c,done:s})},a)}}var g$,ep=M(()=>{g$=function(e,t){return g$=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},g$(e,t)}});function qi(e){return typeof e=="function"}var Xf=M(()=>{});function W5(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var y$=M(()=>{});var K5,sTe=M(()=>{y$();K5=W5(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
33
33
|
`+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
|
|
34
34
|
`):"",this.name="UnsubscriptionError",this.errors=r}})});function uC(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Y5=M(()=>{});function X5(e){return e instanceof Nx||e&&"closed"in e&&qi(e.remove)&&qi(e.add)&&qi(e.unsubscribe)}function lTe(e){qi(e)?e():e.unsubscribe()}var Nx,v$,Xk=M(()=>{ep();Xf();sTe();Y5();Nx=(function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=xb(a),l=s.next();!l.done;l=s.next()){var c=l.value;c.remove(this)}}catch(h){t={error:h}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(qi(u))try{u()}catch(h){i=h instanceof K5?h.errors:[h]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var f=xb(d),m=f.next();!m.done;m=f.next()){var p=m.value;try{lTe(p)}catch(h){i=i??[],h instanceof K5?i=_b(_b([],Sb(i)),Sb(h.errors)):i.push(h)}}}catch(h){n={error:h}}finally{try{m&&!m.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}}if(i)throw new K5(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)lTe(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&uC(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&uC(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e})(),v$=Nx.EMPTY});var wg,Zk=M(()=>{wg={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}});var AA,b$=M(()=>{ep();AA={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=AA.delegate;return o?.setTimeout?o.setTimeout.apply(o,_b([e,t],Sb(r))):setTimeout.apply(void 0,_b([e,t],Sb(r)))},clearTimeout:function(e){var t=AA.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0}});function Z5(e){AA.setTimeout(function(){var t=wg.onUnhandledError;if(t)t(e);else throw e})}var x$=M(()=>{Zk();b$()});function S$(){}var cTe=M(()=>{});function dTe(e){return _$("E",void 0,e)}function fTe(e){return _$("N",e,void 0)}function _$(e,t,r){return{kind:e,value:t,error:r}}var uTe,mTe=M(()=>{uTe=(function(){return _$("C",void 0,void 0)})()});function PA(e){if(wg.useDeprecatedSynchronousErrorHandling){var t=!dC;if(t&&(dC={errorThrown:!1,error:null}),e(),t){var r=dC,n=r.errorThrown,o=r.error;if(dC=null,n)throw o}}else e()}function pTe(e){wg.useDeprecatedSynchronousErrorHandling&&dC&&(dC.errorThrown=!0,dC.error=e)}var dC,$5=M(()=>{Zk();dC=null});function C$(e,t){return e1t.call(e,t)}function Q5(e){wg.useDeprecatedSynchronousErrorHandling?pTe(e):Z5(e)}function r1t(e){throw e}function w$(e,t){var r=wg.onStoppedNotification;r&&AA.setTimeout(function(){return r(e,t)})}var $k,e1t,t1t,J5,n1t,T$=M(()=>{ep();Xf();Xk();Zk();x$();cTe();mTe();b$();$5();$k=(function(e){bd(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,X5(r)&&r.add(n)):n.destination=n1t,n}return t.create=function(r,n,o){return new J5(r,n,o)},t.prototype.next=function(r){this.isStopped?w$(fTe(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?w$(dTe(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?w$(uTe,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t})(Nx),e1t=Function.prototype.bind;t1t=(function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Q5(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Q5(n)}else Q5(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Q5(r)}},e})(),J5=(function(e){bd(t,e);function t(r,n,o){var i=e.call(this)||this,a;if(qi(r)||!r)a={next:r??void 0,error:n??void 0,complete:o??void 0};else{var s;i&&wg.useDeprecatedNextContext?(s=Object.create(r),s.unsubscribe=function(){return i.unsubscribe()},a={next:r.next&&C$(r.next,s),error:r.error&&C$(r.error,s),complete:r.complete&&C$(r.complete,s)}):a=r}return i.destination=new t1t(a),i}return t})($k);n1t={closed:!0,next:S$,error:r1t,complete:S$}});var IA,eN=M(()=>{IA=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})()});function EA(e){return e}var tN=M(()=>{});function hTe(e){return e.length===0?EA:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var gTe=M(()=>{tN()});function yTe(e){var t;return(t=e??wg.Promise)!==null&&t!==void 0?t:Promise}function o1t(e){return e&&qi(e.next)&&qi(e.error)&&qi(e.complete)}function i1t(e){return e&&e instanceof $k||o1t(e)&&X5(e)}var oc,Ux=M(()=>{T$();Xk();eN();gTe();Zk();Xf();$5();oc=(function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,i=i1t(t)?t:new J5(t,r,n);return PA(function(){var a=o,s=a.operator,l=a.source;i.add(s?s.call(i,l):l?o._subscribe(i):o._trySubscribe(i))}),i},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=yTe(r),new r(function(o,i){var a=new J5({next:function(s){try{t(s)}catch(l){i(l),a.unsubscribe()}},error:i,complete:o});n.subscribe(a)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[IA]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return hTe(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=yTe(t),new t(function(n,o){var i;r.subscribe(function(a){return i=a},function(a){return o(a)},function(){return n(i)})})},e.create=function(t){return new e(t)},e})()});function a1t(e){return qi(e?.lift)}function $c(e){return function(t){if(a1t(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}var ny=M(()=>{Xf()});function Qc(e,t,r,n,o){return new s1t(e,t,r,n,o)}var s1t,Cb=M(()=>{ep();T$();s1t=(function(e){bd(t,e);function t(r,n,o,i,a,s){var l=e.call(this,r)||this;return l.onFinalize=a,l.shouldUnsubscribe=s,l._next=n?function(c){try{n(c)}catch(u){r.error(u)}}:e.prototype._next,l._error=i?function(c){try{i(c)}catch(u){r.error(u)}finally{this.unsubscribe()}}:e.prototype._error,l._complete=o?function(){try{o()}catch(c){r.error(c)}finally{this.unsubscribe()}}:e.prototype._complete,l}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t})($k)});var vTe,bTe=M(()=>{y$();vTe=W5(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})});var Vn,xTe,A$=M(()=>{ep();Ux();Xk();bTe();Y5();$5();Vn=(function(e){bd(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new xTe(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new vTe},t.prototype.next=function(r){var n=this;PA(function(){var o,i;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var a=xb(n.currentObservers),s=a.next();!s.done;s=a.next()){var l=s.value;l.next(r)}}catch(c){o={error:c}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;PA(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;PA(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?v$:(this.currentObservers=null,s.push(r),new Nx(function(){n.currentObservers=null,uC(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new oc;return r.source=this,r},t.create=function(r,n){return new xTe(r,n)},t})(oc),xTe=(function(e){bd(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:v$},t})(Vn)});var ml,STe=M(()=>{ep();A$();ml=(function(e){bd(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,o=r.thrownError,i=r._value;if(n)throw o;return this._throwIfClosed(),i},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t})(Vn)});var P$,_Te=M(()=>{P$={now:function(){return(P$.delegate||Date).now()},delegate:void 0}});var CTe,wTe=M(()=>{ep();Xk();CTe=(function(e){bd(t,e);function t(r,n){return e.call(this)||this}return t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t})(Nx)});var Qk,TTe=M(()=>{ep();Qk={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=Qk.delegate;return o?.setInterval?o.setInterval.apply(o,_b([e,t],Sb(r))):setInterval.apply(void 0,_b([e,t],Sb(r)))},clearInterval:function(e){var t=Qk.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0}});var ATe,PTe=M(()=>{ep();wTe();TTe();Y5();ATe=(function(e){bd(t,e);function t(r,n){var o=e.call(this,r,n)||this;return o.scheduler=r,o.work=n,o.pending=!1,o}return t.prototype.schedule=function(r,n){var o;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,a=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(a,i,n)),this.pending=!0,this.delay=n,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(a,this.id,n),this},t.prototype.requestAsyncId=function(r,n,o){return o===void 0&&(o=0),Qk.setInterval(r.flush.bind(r,this),o)},t.prototype.recycleAsyncId=function(r,n,o){if(o===void 0&&(o=0),o!=null&&this.delay===o&&this.pending===!1)return n;n!=null&&Qk.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var o=this._execute(r,n);if(o)return o;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var o=!1,i;try{this.work(r)}catch(a){o=!0,i=a||new Error("Scheduled action threw falsy error")}if(o)return this.unsubscribe(),i},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,o=r.scheduler,i=o.actions;this.work=this.state=this.scheduler=null,this.pending=!1,uC(i,this),n!=null&&(this.id=this.recycleAsyncId(o,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t})(CTe)});var I$,ITe=M(()=>{_Te();I$=(function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=P$.now,e})()});var ETe,DTe=M(()=>{ep();ITe();ETe=(function(e){bd(t,e);function t(r,n){n===void 0&&(n=I$.now);var o=e.call(this,r,n)||this;return o.actions=[],o._active=!1,o}return t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var o;this._active=!0;do if(o=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,o){for(;r=n.shift();)r.unsubscribe();throw o}},t})(I$)});var Jk,kTe,rN=M(()=>{PTe();DTe();Jk=new ETe(ATe),kTe=Jk});var nN,E$=M(()=>{Ux();nN=new oc(function(e){return e.complete()})});function oN(e){return e&&qi(e.schedule)}var D$=M(()=>{Xf()});function MTe(e){return e[e.length-1]}function BTe(e){return oN(MTe(e))?e.pop():void 0}function RTe(e,t){return typeof MTe(e)=="number"?e.pop():t}var OTe=M(()=>{D$()});var iN,k$=M(()=>{iN=(function(e){return e&&typeof e.length=="number"&&typeof e!="function"})});function aN(e){return qi(e?.then)}var M$=M(()=>{Xf()});function sN(e){return qi(e[IA])}var B$=M(()=>{eN();Xf()});function lN(e){return Symbol.asyncIterator&&qi(e?.[Symbol.asyncIterator])}var R$=M(()=>{Xf()});function cN(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var O$=M(()=>{});function l1t(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var uN,L$=M(()=>{uN=l1t()});function dN(e){return qi(e?.[uN])}var F$=M(()=>{L$();Xf()});function fN(e){return iTe(this,arguments,function(){var r,n,o,i;return H5(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,cC(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,cC(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,cC(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function mN(e){return qi(e?.getReader)}var pN=M(()=>{ep();Xf()});function Zf(e){if(e instanceof oc)return e;if(e!=null){if(sN(e))return c1t(e);if(iN(e))return u1t(e);if(aN(e))return d1t(e);if(lN(e))return LTe(e);if(dN(e))return f1t(e);if(mN(e))return m1t(e)}throw cN(e)}function c1t(e){return new oc(function(t){var r=e[IA]();if(qi(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function u1t(e){return new oc(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function d1t(e){return new oc(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Z5)})}function f1t(e){return new oc(function(t){var r,n;try{for(var o=xb(e),i=o.next();!i.done;i=o.next()){var a=i.value;if(t.next(a),t.closed)return}}catch(s){r={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function LTe(e){return new oc(function(t){p1t(e,t).catch(function(r){return t.error(r)})})}function m1t(e){return LTe(fN(e))}function p1t(e,t){var r,n,o,i;return oTe(this,void 0,void 0,function(){var a,s;return H5(this,function(l){switch(l.label){case 0:l.trys.push([0,5,6,11]),r=aTe(e),l.label=1;case 1:return[4,r.next()];case 2:if(n=l.sent(),!!n.done)return[3,4];if(a=n.value,t.next(a),t.closed)return[2];l.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return s=l.sent(),o={error:s},[3,11];case 6:return l.trys.push([6,,9,10]),n&&!n.done&&(i=r.return)?[4,i.call(r)]:[3,8];case 7:l.sent(),l.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}var Vx=M(()=>{ep();k$();M$();Ux();B$();R$();O$();F$();pN();Xf();x$();eN()});function Hp(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var i=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(i),!o)return i}var eM=M(()=>{});function hN(e,t){return t===void 0&&(t=0),$c(function(r,n){r.subscribe(Qc(n,function(o){return Hp(n,e,function(){return n.next(o)},t)},function(){return Hp(n,e,function(){return n.complete()},t)},function(o){return Hp(n,e,function(){return n.error(o)},t)}))})}var N$=M(()=>{eM();ny();Cb()});function gN(e,t){return t===void 0&&(t=0),$c(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}var U$=M(()=>{ny()});function FTe(e,t){return Zf(e).pipe(gN(t),hN(t))}var NTe=M(()=>{Vx();N$();U$()});function UTe(e,t){return Zf(e).pipe(gN(t),hN(t))}var VTe=M(()=>{Vx();N$();U$()});function zTe(e,t){return new oc(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}var qTe=M(()=>{Ux()});function jTe(e,t){return new oc(function(r){var n;return Hp(r,t,function(){n=e[uN](),Hp(r,t,function(){var o,i,a;try{o=n.next(),i=o.value,a=o.done}catch(s){r.error(s);return}a?r.complete():r.next(i)},0,!0)}),function(){return qi(n?.return)&&n.return()}})}var GTe=M(()=>{Ux();L$();Xf();eM()});function yN(e,t){if(!e)throw new Error("Iterable cannot be null");return new oc(function(r){Hp(r,t,function(){var n=e[Symbol.asyncIterator]();Hp(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}var V$=M(()=>{Ux();eM()});function HTe(e,t){return yN(fN(e),t)}var WTe=M(()=>{V$();pN()});function KTe(e,t){if(e!=null){if(sN(e))return FTe(e,t);if(iN(e))return zTe(e,t);if(aN(e))return UTe(e,t);if(lN(e))return yN(e,t);if(dN(e))return jTe(e,t);if(mN(e))return HTe(e,t)}throw cN(e)}var YTe=M(()=>{NTe();VTe();qTe();GTe();V$();B$();M$();k$();F$();R$();O$();pN();WTe()});function XTe(e,t){return t?KTe(e,t):Zf(e)}var ZTe=M(()=>{YTe();Vx()});function $Te(e){return e instanceof Date&&!isNaN(e)}var QTe=M(()=>{});function tM(e,t){return $c(function(r,n){var o=0;r.subscribe(Qc(n,function(i){n.next(e.call(t,i,o++))}))})}var z$=M(()=>{ny();Cb()});function JTe(e,t,r,n,o,i,a,s){var l=[],c=0,u=0,d=!1,f=function(){d&&!l.length&&!c&&t.complete()},m=function(h){return c<n?p(h):l.push(h)},p=function(h){i&&t.next(h),c++;var g=!1;Zf(r(h,u++)).subscribe(Qc(t,function(y){o?.(y),i?m(y):t.next(y)},function(){g=!0},void 0,function(){if(g)try{c--;for(var y=function(){var b=l.shift();a?Hp(t,a,function(){return p(b)}):p(b)};l.length&&c<n;)y();f()}catch(b){t.error(b)}}))};return e.subscribe(Qc(t,m,function(){d=!0,f()})),function(){s?.()}}var eAe=M(()=>{Vx();eM();Cb()});function q$(e,t,r){return r===void 0&&(r=1/0),qi(t)?q$(function(n,o){return tM(function(i,a){return t(n,i,o,a)})(Zf(e(n,o)))},r):(typeof t=="number"&&(r=t),$c(function(n,o){return JTe(n,o,e,r)}))}var tAe=M(()=>{z$();Vx();ny();eAe();Xf()});function rAe(e){return e===void 0&&(e=1/0),q$(EA,e)}var nAe=M(()=>{tAe();tN()});function oAe(e,t,r){e===void 0&&(e=0),r===void 0&&(r=kTe);var n=-1;return t!=null&&(oN(t)?r=t:n=t),new oc(function(o){var i=$Te(e)?+e-r.now():e;i<0&&(i=0);var a=0;return r.schedule(function(){o.closed||(o.next(a++),0<=n?this.schedule(void 0,n):o.complete())},i)})}var iAe=M(()=>{Ux();rN();D$();QTe()});function xd(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=BTe(e),n=RTe(e,1/0),o=e;return o.length?o.length===1?Zf(o[0]):rAe(n)(XTe(o,r)):nN}var aAe=M(()=>{nAe();Vx();E$();OTe();ZTe()});function oy(e,t){return $c(function(r,n){var o=0;r.subscribe(Qc(n,function(i){return e.call(t,i,o++)&&n.next(i)}))})}var vN=M(()=>{ny();Cb()});var sAe=M(()=>{});function zx(e,t){return t===void 0&&(t=Jk),$c(function(r,n){var o=null,i=null,a=null,s=function(){if(o){o.unsubscribe(),o=null;var c=i;i=null,n.next(c)}};function l(){var c=a+e,u=t.now();if(u<c){o=this.schedule(void 0,c-u),n.add(o);return}s()}r.subscribe(Qc(n,function(c){i=c,a=t.now(),o||(o=t.schedule(l,e),n.add(o))},function(){s(),n.complete()},void 0,function(){i=o=null}))})}var j$=M(()=>{rN();ny();Cb()});function G$(e){return e<=0?function(){return nN}:$c(function(t,r){var n=0;t.subscribe(Qc(r,function(o){++n<=e&&(r.next(o),e<=n&&r.complete())}))})}var lAe=M(()=>{E$();ny();Cb()});function H$(e,t){return t===void 0&&(t=EA),e=e??h1t,$c(function(r,n){var o,i=!0;r.subscribe(Qc(n,function(a){var s=t(a);(i||!e(o,s))&&(i=!1,o=s,n.next(a))}))})}function h1t(e,t){return e===t}var cAe=M(()=>{tN();ny();Cb()});function rM(e){return oy(function(t,r){return e<=r})}var uAe=M(()=>{vN()});function dAe(e,t){return $c(function(r,n){var o=t??{},i=o.leading,a=i===void 0?!0:i,s=o.trailing,l=s===void 0?!1:s,c=!1,u=null,d=null,f=!1,m=function(){d?.unsubscribe(),d=null,l&&(g(),f&&n.complete())},p=function(){d=null,f&&n.complete()},h=function(y){return d=Zf(e(y)).subscribe(Qc(n,m,p))},g=function(){if(c){c=!1;var y=u;u=null,n.next(y),!f&&h(y)}};r.subscribe(Qc(n,function(y){c=!0,u=y,!(d&&!d.closed)&&(a?g():h(y))},function(){f=!0,!(l&&c&&d&&!d.closed)&&n.complete()}))})}var fAe=M(()=>{ny();Cb();Vx()});function Sd(e,t,r){t===void 0&&(t=Jk);var n=oAe(e,t);return dAe(function(){return n},r)}var W$=M(()=>{rN();fAe();iAe()});var es=M(()=>{A$();STe();aAe();sAe();j$();cAe();vN();z$();uAe();W$()});var _d,K$,qx=M(()=>{es();(function(e){function t(){let r=new K$,n=(()=>r.create());return n.dispose=()=>r.dispose(),n.behavior=o=>r.behavior(o),n}e.create=t})(_d||(_d={}));K$=class{constructor(){this._eventList=[],this._disposed=!1}create(){let t=new Vn;return this._eventList.push(t),t}behavior(t){let r=new ml(t);return this._eventList.push(r),r}dispose(){if(!this._disposed){for(let t of this._eventList)t.complete();this._disposed=!0}}}});var TAe=ve($f=>{"use strict";var ts={Remove:"remove",Replace:"replace",Add:"add"},yAe=Symbol.for("__MUTATIVE_PROXY_DRAFT__"),vAe=Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),xN=Symbol.iterator,Qf={mutable:"mutable",immutable:"immutable"},rQ={};function oM(e,t){return e instanceof Map?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function mAe(e,t){if(t in e){let r=Reflect.getPrototypeOf(e);for(;r;){let n=Reflect.getOwnPropertyDescriptor(r,t);if(n)return n;r=Reflect.getPrototypeOf(r)}}}function nQ(e){return Object.getPrototypeOf(e)===Set.prototype}function oQ(e){return Object.getPrototypeOf(e)===Map.prototype}function tp(e){var t;return(t=e.copy)!==null&&t!==void 0?t:e.original}function ay(e){return!!Jo(e)}function Jo(e){return typeof e!="object"?null:e?.[yAe]}function iQ(e){var t;let r=Jo(e);return r?(t=r.copy)!==null&&t!==void 0?t:r.original:e}function Wp(e,t){if(!e||typeof e!="object")return!1;let r;return Object.getPrototypeOf(e)===Object.prototype||Array.isArray(e)||e instanceof Map||e instanceof Set||!!t?.mark&&((r=t.mark(e,Qf))===Qf.immutable||typeof r=="function")}function bAe(e,t=[]){if(Object.hasOwnProperty.call(e,"key")){let r=e.parent.copy,n=Jo(sy(r,e.key));if(n!==null&&n?.original!==e.original)return null;let o=e.parent.type===3,i=o?Array.from(e.parent.setMap.keys()).indexOf(e.key):e.key;if(!(o&&r.size>i||oM(r,i)))return null;t.push(i)}if(e.parent)return bAe(e.parent,t);t.reverse();try{(function(r,n){for(let o=0;o<n.length-1;o+=1){let i=n[o];if(typeof(r=sy(Tb(r)===3?Array.from(r):r,i))!="object")throw new Error(`Cannot resolve patch at '${n.join("/")}'.`)}})(e.copy,t)}catch{return null}return t}function Tb(e){return Array.isArray(e)?1:e instanceof Map?2:e instanceof Set?3:0}function sy(e,t){return Tb(e)===2?e.get(t):e[t]}function aM(e,t,r){Tb(e)===2?e.set(t,r):e[t]=r}function Y$(e,t){let r=Jo(e);return(r?tp(r):e)[t]}function wb(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function X$(e){if(e)for(;e.finalities.revoke.length>0;)e.finalities.revoke.pop()()}function fC(e,t){return t?e:[""].concat(e).map((r=>{let n=`${r}`;return n.indexOf("/")===-1&&n.indexOf("~")===-1?n:n.replace(/~/g,"~0").replace(/\//g,"~1")})).join("/")}var g1t=Object.prototype.propertyIsEnumerable;function xAe(e,t){let r;if(Array.isArray(e))return Array.prototype.concat.call(e);if(e instanceof Set)return nQ(e)?Set.prototype.difference?Set.prototype.difference.call(e,new Set):new Set(e.values()):new(Object.getPrototypeOf(e)).constructor(e.values());if(e instanceof Map)return oQ(e)?new Map(e):new(Object.getPrototypeOf(e)).constructor(e);if(t?.mark&&(r=t.mark(e,Qf),r!==void 0)&&r!==Qf.mutable){if(r===Qf.immutable)return(function(n){let o=Object.create(Object.getPrototypeOf(n));return Reflect.ownKeys(n).forEach((i=>{let a=Reflect.getOwnPropertyDescriptor(n,i);a.enumerable&&a.configurable&&a.writable?o[i]=n[i]:(a.writable||(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(a={configurable:!0,writable:!0,enumerable:a.enumerable,value:n[i]}),Reflect.defineProperty(o,i,a))})),o})(e);if(typeof r=="function")return r();throw new Error(`Unsupported mark result: ${r}`)}if(typeof e=="object"&&Object.getPrototypeOf(e)===Object.prototype){let n={};return Object.keys(e).forEach((o=>{n[o]=e[o]})),Object.getOwnPropertySymbols(e).forEach((o=>{g1t.call(e,o)&&(n[o]=e[o])})),n}throw new Error("Please check mark() to ensure that it is a stable marker draftable function.")}function uf(e){e.copy||(e.copy=xAe(e.original,e.options))}function kA(e){if(!Wp(e))return iQ(e);if(Array.isArray(e))return e.map(kA);if(e instanceof Map){let r=Array.from(e.entries()).map((([n,o])=>[n,kA(o)]));return oQ(e)?new Map(r):new(Object.getPrototypeOf(e)).constructor(r)}if(e instanceof Set){let r=Array.from(e).map(kA);return nQ(e)?new Set(r):new(Object.getPrototypeOf(e)).constructor(r)}let t=Object.create(Object.getPrototypeOf(e));for(let r in e)t[r]=kA(e[r]);return t}function bN(e){return ay(e)?kA(e):e}function iy(e){var t;e.assignedMap=(t=e.assignedMap)!==null&&t!==void 0?t:new Map,e.operated||(e.operated=!0,e.parent&&iy(e.parent))}function pAe(){throw new Error("Cannot modify frozen object")}function nM(e){return e&&typeof e=="object"&&!Object.isFrozen(e)}function DA(e,t,r,n,o){if(!(Object.isFrozen(e)||ay(e)))switch(Tb(e)){case 2:for(let[i,a]of e)nM(i)&&DA(i),nM(a)&&DA(a);e.set=e.clear=e.delete=pAe;break;case 3:for(let i of e)nM(i)&&DA(i);e.add=e.clear=e.delete=pAe;break;case 1:Object.freeze(e);for(let i of e)nM(i)&&DA(i);break;default:Object.freeze(e),Object.keys(e).forEach((i=>{let a=e[i];nM(a)&&DA(a)}))}}function aQ(e,t){let r=Tb(e);if(r===0)Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)}));else if(r===1){let n=0;for(let o of e)t(n,o,e),n+=1}else e.forEach(((n,o)=>t(o,n,e)))}function SAe(e,t,r){if(ay(e)||!Wp(e,r)||t.has(e)||Object.isFrozen(e))return;let n=e instanceof Set,o=n?new Map:void 0;if(t.add(e),aQ(e,((i,a)=>{var s;if(ay(a)){let l=Jo(a);uf(l);let c=!((s=l.assignedMap)===null||s===void 0)&&s.size||l.operated?l.copy:l.original;aM(n?o:e,i,c)}else SAe(a,t,r)})),o){let i=e,a=Array.from(i);i.clear(),a.forEach((s=>{i.add(o.has(s)?o.get(s):s)}))}}function y1t(e,t){let r=e.type===3?e.setMap:e.copy;e.finalities.revoke.length>1&&e.assignedMap.get(t)&&r&&SAe(sy(r,t),e.finalities.handledSet,e.options)}function Z$(e){e.type===3&&e.copy&&(e.copy.clear(),e.setMap.forEach((t=>{e.copy.add(iQ(t))})))}function $$(e,t,r,n){if(e.operated&&e.assignedMap&&e.assignedMap.size>0&&!e.finalized){if(r&&n){let o=bAe(e);o&&t(e,o,r,n)}e.finalized=!0}}function sQ(e,t,r,n){let o=Jo(r);o&&(o.callbacks||(o.callbacks=[]),o.callbacks.push(((i,a)=>{let s=e.type===3?e.setMap:e.copy;if(wb(sy(s,t),r)){let l=o.original;o.copy&&(l=o.copy),Z$(e),$$(e,n,i,a),aM(s,t,l)}})),e.options.enableAutoFreeze&&o.finalities!==e.finalities&&(e.options.enableAutoFreeze=!1)),Wp(r,e.options)&&e.finalities.draft.push((()=>{wb(sy(e.type===3?e.setMap:e.copy,t),r)&&y1t(e,t)}))}function iM(e,t,r,n){let{pathAsArray:o=!0}=e.options.enablePatches;switch(e.type){case 0:case 2:return(function({original:i,copy:a,assignedMap:s},l,c,u,d){s.forEach(((f,m)=>{let p=sy(i,m),h=bN(sy(a,m)),g=f?oM(i,m)?ts.Replace:ts.Add:ts.Remove;if(wb(p,h)&&g===ts.Replace)return;let y=fC(l.concat(m),d);c.push(g===ts.Remove?{op:g,path:y}:{op:g,path:y,value:h}),u.push(g===ts.Add?{op:ts.Remove,path:y}:g===ts.Remove?{op:ts.Add,path:y,value:p}:{op:ts.Replace,path:y,value:p})}))})(e,t,r,n,o);case 1:return(function(i,a,s,l,c){let{original:u,assignedMap:d,options:f}=i,m=i.copy;m.length<u.length&&([u,m]=[m,u],[s,l]=[l,s]);for(let p=0;p<u.length;p+=1)if(d.get(p.toString())&&m[p]!==u[p]){let h=fC(a.concat([p]),c);s.push({op:ts.Replace,path:h,value:bN(m[p])}),l.push({op:ts.Replace,path:h,value:bN(u[p])})}for(let p=u.length;p<m.length;p+=1){let h=fC(a.concat([p]),c);s.push({op:ts.Add,path:h,value:bN(m[p])})}if(u.length<m.length){let{arrayLengthAssignment:p=!0}=f.enablePatches;if(p){let h=fC(a.concat(["length"]),c);l.push({op:ts.Replace,path:h,value:u.length})}else for(let h=m.length;u.length<h;h-=1){let g=fC(a.concat([h-1]),c);l.push({op:ts.Remove,path:g})}}})(e,t,r,n,o);case 3:return(function({original:i,copy:a},s,l,c,u){let d=0;i.forEach((f=>{if(!a.has(f)){let m=fC(s.concat([d]),u);l.push({op:ts.Remove,path:m,value:f}),c.unshift({op:ts.Add,path:m,value:f})}d+=1})),d=0,a.forEach((f=>{if(!i.has(f)){let m=fC(s.concat([d]),u);l.push({op:ts.Add,path:m,value:f}),c.unshift({op:ts.Remove,path:m,value:f})}d+=1}))})(e,t,r,n,o)}}var Q$=!1,SN=(e,t,r=!1)=>{if(typeof e=="object"&&e!==null&&(!Wp(e,t)||r)&&!Q$)throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.")},J$={get size(){return tp(Jo(this)).size},has(e){return tp(Jo(this)).has(e)},set(e,t){let r=Jo(this),n=tp(r);return n.has(e)&&wb(n.get(e),t)||(uf(r),iy(r),r.assignedMap.set(e,!0),r.copy.set(e,t),sQ(r,e,t,iM)),this},delete(e){if(!this.has(e))return!1;let t=Jo(this);return uf(t),iy(t),t.original.has(e)?t.assignedMap.set(e,!1):t.assignedMap.delete(e),t.copy.delete(e),!0},clear(){let e=Jo(this);if(this.size){uf(e),iy(e),e.assignedMap=new Map;for(let[t]of e.original)e.assignedMap.set(t,!1);e.copy.clear()}},forEach(e,t){tp(Jo(this)).forEach(((r,n)=>{e.call(t,this.get(n),n,this)}))},get(e){var t,r;let n=Jo(this),o=tp(n).get(e),i=((r=(t=n.options).mark)===null||r===void 0?void 0:r.call(t,o,Qf))===Qf.mutable;if(n.options.strict&&SN(o,n.options,i),i||n.finalized||!Wp(o,n.options)||o!==n.original.get(e))return o;let a=rQ.createDraft({original:o,parentDraft:n,key:e,finalities:n.finalities,options:n.options});return uf(n),n.copy.set(e,a),a},keys(){return tp(Jo(this)).keys()},values(){let e=this.keys();return{[xN]:()=>this.values(),next:()=>{let t=e.next();return t.done?t:{done:!1,value:this.get(t.value)}}}},entries(){let e=this.keys();return{[xN]:()=>this.entries(),next:()=>{let t=e.next();if(t.done)return t;let r=this.get(t.value);return{done:!1,value:[t.value,r]}}}},[xN](){return this.entries()}},v1t=Reflect.ownKeys(J$),hAe=(e,t,{isValuesIterator:r})=>()=>{var n,o;let i=t.next();if(i.done)return i;let a=i.value,s=e.setMap.get(a),l=Jo(s),c=((o=(n=e.options).mark)===null||o===void 0?void 0:o.call(n,s,Qf))===Qf.mutable;if(e.options.strict&&SN(a,e.options,c),c||l||!Wp(a,e.options)||e.finalized||!e.original.has(a))l&&(s=l.proxy);else{let u=rQ.createDraft({original:a,parentDraft:e,key:a,finalities:e.finalities,options:e.options});e.setMap.set(a,u),s=u}return{done:!1,value:r?s:[s,s]}},_N={get size(){return Jo(this).setMap.size},has(e){let t=Jo(this);if(t.setMap.has(e))return!0;uf(t);let r=Jo(e);return!(!r||!t.setMap.has(r.original))},add(e){let t=Jo(this);return this.has(e)||(uf(t),iy(t),t.assignedMap.set(e,!0),t.setMap.set(e,e),sQ(t,e,e,iM)),this},delete(e){if(!this.has(e))return!1;let t=Jo(this);uf(t),iy(t);let r=Jo(e);return r&&t.setMap.has(r.original)?(t.assignedMap.set(r.original,!1),t.setMap.delete(r.original)):(!r&&t.setMap.has(e)?t.assignedMap.set(e,!1):t.assignedMap.delete(e),t.setMap.delete(e))},clear(){if(!this.size)return;let e=Jo(this);uf(e),iy(e);for(let t of e.original)e.assignedMap.set(t,!1);e.setMap.clear()},values(){let e=Jo(this);uf(e);let t=e.setMap.keys();return{[Symbol.iterator]:()=>this.values(),next:hAe(e,t,{isValuesIterator:!0})}},entries(){let e=Jo(this);uf(e);let t=e.setMap.keys();return{[Symbol.iterator]:()=>this.entries(),next:hAe(e,t,{isValuesIterator:!1})}},keys(){return this.values()},[xN](){return this.values()},forEach(e,t){let r=this.values(),n=r.next();for(;!n.done;)e.call(t,n.value,n.value,this),n=r.next()}};Set.prototype.difference&&Object.assign(_N,{intersection(e){return Set.prototype.intersection.call(new Set(this.values()),e)},union(e){return Set.prototype.union.call(new Set(this.values()),e)},difference(e){return Set.prototype.difference.call(new Set(this.values()),e)},symmetricDifference(e){return Set.prototype.symmetricDifference.call(new Set(this.values()),e)},isSubsetOf(e){return Set.prototype.isSubsetOf.call(new Set(this.values()),e)},isSupersetOf(e){return Set.prototype.isSupersetOf.call(new Set(this.values()),e)},isDisjointFrom(e){return Set.prototype.isDisjointFrom.call(new Set(this.values()),e)}});var b1t=Reflect.ownKeys(_N),_Ae={get(e,t,r){var n,o;let i=(n=e.copy)===null||n===void 0?void 0:n[t];if(i&&e.finalities.draftsCache.has(i))return i;if(t===yAe)return e;let a;if(e.options.mark){let c=t==="size"&&(e.original instanceof Map||e.original instanceof Set)?Reflect.get(e.original,t):Reflect.get(e.original,t,r);if(a=e.options.mark(c,Qf),a===Qf.mutable)return e.options.strict&&SN(c,e.options,!0),c}let s=tp(e);if(s instanceof Map&&v1t.includes(t))return t==="size"?Object.getOwnPropertyDescriptor(J$,"size").get.call(e.proxy):J$[t].bind(e.proxy);if(s instanceof Set&&b1t.includes(t))return t==="size"?Object.getOwnPropertyDescriptor(_N,"size").get.call(e.proxy):_N[t].bind(e.proxy);if(!oM(s,t)){let c=mAe(s,t);return c?"value"in c?c.value:(o=c.get)===null||o===void 0?void 0:o.call(e.proxy):void 0}let l=s[t];if(e.options.strict&&SN(l,e.options),e.finalized||!Wp(l,e.options))return l;if(l===Y$(e.original,t)){if(uf(e),e.copy[t]=lQ({original:e.original[t],parentDraft:e,key:e.type===1?Number(t):t,finalities:e.finalities,options:e.options}),typeof a=="function"){let c=Jo(e.copy[t]);return uf(c),iy(c),c.copy}return e.copy[t]}return ay(l)&&e.finalities.draftsCache.add(l),l},set(e,t,r){var n;if(e.type===3||e.type===2)throw new Error("Map/Set draft does not support any property assignment.");let o;if(e.type===1&&t!=="length"&&(!(Number.isInteger(o=Number(t))&&o>=0)||t!==0&&o!==0&&String(o)!==String(t)))throw new Error("Only supports setting array indices and the 'length' property.");let i=mAe(tp(e),t);if(i?.set)return i.set.call(e.proxy,r),!0;let a=Y$(tp(e),t),s=Jo(a);return s&&wb(s.original,r)?(e.copy[t]=r,e.assignedMap=(n=e.assignedMap)!==null&&n!==void 0?n:new Map,e.assignedMap.set(t,!1),!0):(wb(r,a)&&(r!==void 0||oM(e.original,t))||(uf(e),iy(e),oM(e.original,t)&&wb(r,e.original[t])?e.assignedMap.delete(t):e.assignedMap.set(t,!0),e.copy[t]=r,sQ(e,t,r,iM)),!0)},has:(e,t)=>t in tp(e),ownKeys:e=>Reflect.ownKeys(tp(e)),getOwnPropertyDescriptor(e,t){let r=tp(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},getPrototypeOf:e=>Reflect.getPrototypeOf(e.original),setPrototypeOf(){throw new Error("Cannot call 'setPrototypeOf()' on drafts")},defineProperty(){throw new Error("Cannot call 'defineProperty()' on drafts")},deleteProperty(e,t){var r;return e.type===1?_Ae.set.call(this,e,t,void 0,e.proxy):(Y$(e.original,t)!==void 0||t in e.original?(uf(e),iy(e),e.assignedMap.set(t,!1)):(e.assignedMap=(r=e.assignedMap)!==null&&r!==void 0?r:new Map,e.assignedMap.delete(t)),e.copy&&delete e.copy[t],!0)}};function lQ(e){let{original:t,parentDraft:r,key:n,finalities:o,options:i}=e,a=Tb(t),s={type:a,finalized:!1,parent:r,original:t,copy:null,proxy:null,finalities:o,options:i,setMap:a===3?new Map(t.entries()):void 0};(n||"key"in e)&&(s.key=n);let{proxy:l,revoke:c}=Proxy.revocable(a===1?Object.assign([],s):s,_Ae);if(o.revoke.push(c),s.proxy=l,r){let u=r;u.finalities.draft.push(((d,f)=>{var m;let p=Jo(l),h=u.type===3?u.setMap:u.copy,g=sy(h,n),y=Jo(g);if(y){let b=y.original;y.operated&&(b=iQ(g)),Z$(y),$$(y,iM,d,f),aM(h,n,b)}(m=p.callbacks)===null||m===void 0||m.forEach((b=>{b(d,f)}))}))}else{let u=Jo(l);u.finalities.draft.push(((d,f)=>{Z$(u),$$(u,iM,d,f)}))}return l}function x1t(e,t,r,n,o){var i;let a=Jo(e),s=(i=a?.original)!==null&&i!==void 0?i:e,l=!!t.length;if(a?.operated)for(;a.finalities.draft.length>0;)a.finalities.draft.pop()(r,n);let c=l?t[0]:a?a.operated?a.copy:a.original:e;return a&&X$(a),o&&DA(c,0,a==null||a.options.updatedValues),[c,r&&l?[{op:ts.Replace,path:[],value:t[0]}]:r,n&&l?[{op:ts.Replace,path:[],value:s}]:n]}function eQ(e){let{rootDraft:t,value:r,useRawReturn:n=!1,isRoot:o=!0}=e;aQ(r,((i,a,s)=>{let l=Jo(a);if(l&&t&&l.finalities===t.finalities){e.isContainDraft=!0;let c=l.original;if(s instanceof Set){let u=Array.from(s);s.clear(),u.forEach((d=>s.add(i===d?c:d)))}else aM(s,i,c)}else typeof a=="object"&&a!==null&&(e.value=a,e.isRoot=!1,eQ(e))}))}function CAe(e){var t;let r=Jo(e);if(!Wp(e,r?.options))return e;let n=Tb(e);if(r&&!r.operated)return r.original;let o;function i(){o=n===2?oQ(e)?new Map(e):new(Object.getPrototypeOf(e)).constructor(e):n===3?Array.from(r.setMap.values()):xAe(e,r?.options)}if(r){r.finalized=!0;try{i()}finally{r.finalized=!1}}else o=e;if(aQ(o,((a,s)=>{if(r&&wb(sy(r.original,a),s))return;let l=CAe(s);l!==s&&(o===e&&i(),aM(o,a,l))})),n===3){let a=(t=r?.original)!==null&&t!==void 0?t:o;return nQ(a)?new Set(o):new(Object.getPrototypeOf(a)).constructor(o)}return o}function tQ(e){if(!ay(e))throw new Error(`current() is only used for Draft, parameter: ${e}`);return CAe(e)}rQ.createDraft=lQ;var wAe=e=>function t(r,n,o){var i,a,s;if(typeof r=="function"&&typeof n!="function")return function(C,...S){return t(C,(w=>r.call(this,w,...S)),n)};let l=r,c=n,u=o;typeof n!="function"&&(u=n),u=Object.assign(Object.assign({},e),u);let d=ay(l)?tQ(l):l,f=Array.isArray(u.mark)?(C,S)=>{for(let w of u.mark){let A=w(C,S);if(A)return A}}:u.mark,m=(i=u.enablePatches)!==null&&i!==void 0&&i,p=(a=u.strict)!==null&&a!==void 0&&a,h={enableAutoFreeze:(s=u.enableAutoFreeze)!==null&&s!==void 0&&s,mark:f,strict:p,enablePatches:m};if(!Wp(d,h)&&typeof d=="object"&&d!==null)throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");let[g,y]=(function(C,S){var w;let A={draft:[],revoke:[],handledSet:new WeakSet,draftsCache:new WeakSet},T,D;S.enablePatches&&(T=[],D=[]);let E=((w=S.mark)===null||w===void 0?void 0:w.call(S,C,Qf))!==Qf.mutable&&Wp(C,S)?lQ({original:C,parentDraft:null,finalities:A,options:S}):C;return[E,(I=[])=>{let[k,R,B]=x1t(E,I,T,D,S.enableAutoFreeze);return S.enablePatches?[k,R,B]:k}]})(d,h);if(typeof n!="function"){if(!Wp(d,h))throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");return[g,y]}let b;try{b=c(g)}catch(C){throw X$(Jo(g)),C}let x=C=>{let S=Jo(g);if(!ay(C)){if(C!==void 0&&!wb(C,g)&&S?.operated)throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");let A=C?.[vAe];if(A){let T=A[0];return h.strict&&typeof C=="object"&&C!==null&&eQ({rootDraft:S,value:C,useRawReturn:!0}),y([T])}if(C!==void 0)return typeof C=="object"&&C!==null&&eQ({rootDraft:S,value:C}),y([C])}if(C===g||C===void 0)return y([]);let w=Jo(C);if(h===w.options){if(w.operated)throw new Error("Cannot return a modified child draft.");return y([tQ(C)])}return y([C])};return b instanceof Promise?b.then(x,(C=>{throw X$(Jo(g)),C})):x(b)},gAe=wAe(),S1t=Object.prototype.constructor.toString();$f.apply=function(e,t,r){let n;for(n=t.length-1;n>=0;n-=1){let{value:i,op:a,path:s}=t[n];if(!s.length&&a===ts.Replace||s===""&&a===ts.Add){e=i;break}}n>-1&&(t=t.slice(n+1));let o=i=>{t.forEach((a=>{let{path:s,op:l}=a,c=(function(p){return Array.isArray(p)?p:p.split("/").map((h=>h.replace(/~1/g,"/").replace(/~0/g,"~"))).slice(1)})(s),u=i;for(let p=0;p<c.length-1;p+=1){let h=Tb(u),g=c[p];if(typeof g!="string"&&typeof g!="number"&&(g=String(g)),(h===0||h===1)&&(g==="__proto__"||g==="constructor")||typeof u=="function"&&g==="prototype")throw new Error("Patching reserved attributes like __proto__ and constructor is not allowed.");if(u=sy(h===3?Array.from(u):u,g),typeof u!="object")throw new Error(`Cannot apply patch at '${c.join("/")}'.`)}let d=Tb(u),f=kA(a.value),m=c[c.length-1];switch(l){case ts.Replace:switch(d){case 2:return u.set(m,f);case 3:throw new Error("Cannot apply replace patch to set.");default:return u[m]=f}case ts.Add:switch(d){case 1:return m==="-"?u.push(f):u.splice(m,0,f);case 2:return u.set(m,f);case 3:return u.add(f);default:return u[m]=f}case ts.Remove:switch(d){case 1:return u.splice(m,1);case 2:return u.delete(m);case 3:return u.delete(a.value);default:return delete u[m]}default:throw new Error(`Unsupported patch operation: ${l}.`)}}))};if(!r?.mutable){if(ay(e)){if(r!==void 0)throw new Error("Cannot apply patches with options to a draft.");return o(e),e}return gAe(e,o,Object.assign(Object.assign({},r),{enablePatches:!1}))}o(e)},$f.castDraft=function(e){return e},$f.castImmutable=function(e){return e},$f.castMutable=function(e){return e},$f.create=gAe,$f.current=tQ,$f.isDraft=ay,$f.isDraftable=Wp,$f.makeCreator=wAe,$f.markSimpleObject=e=>{if((t=>{if(!t||typeof t!="object")return!1;let r=Object.getPrototypeOf(t);if(r===null)return!0;let n=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return n===Object||typeof n=="function"&&Function.toString.call(n)===S1t})(e))return Qf.immutable},$f.original=function(e){let t=Jo(e);if(!t)throw new Error(`original() is only used for a draft, parameter: ${e}`);return t.original},$f.rawReturn=function(e){if(arguments.length===0)throw new Error("rawReturn() must be called with a value.");if(arguments.length>1)throw new Error("rawReturn() must be called with one argument.");return{[vAe]:[e]}},$f.unsafe=function(e){let t;Q$=!0;try{t=e()}finally{Q$=!1}return t}});var PAe=ve((hzr,AAe)=>{"use strict";AAe.exports=TAe()});function Vu(e,t){return typeof e=="object"&&!("prototype"in e)?(0,cQ.create)({...e},t):(0,cQ.create)(e,t)}var cQ,Ab=M(()=>{cQ=et(PAe())});function CN(...e){let t,r=[];for(let n of e)if(n)if(t||(t=new Set),typeof n=="string"){if(t.has(n))continue;t.add(n),r.push(n)}else for(let o of n)t.has(o)||(t.add(o),r.push(o));return r}var jx,uQ=M(()=>{q5();T5();bb();Ab();(function(e){function t(s){let l=new Set;for(let c of s.actions)switch(c.kind){case"add":l.add(c.transform.ref);break;case"update":l.add(c.ref);break;case"delete":l.add(c.ref);break;case"insert":{l.add(c.ref),l.add(c.transform.ref);let u=s.tree.children.get(c.ref).toArray();for(let d of u)l.add(d);break}}return Array.from(l)}function r(s,l){if(!s.state||s.state.tree===s.editInfo.sourceTree){let d=s.tree.asImmutable();return l?.useHashVersion&&zi.setParamHashVersion(d,t(s)),d}let c=s.state.tree.asTransient();for(let d of s.actions)switch(d.kind){case"add":c.add(d.transform);break;case"update":c.setParams(d.ref,d.params);break;case"delete":c.remove(d.ref);break;case"insert":{let f=c.children.get(d.ref).toArray();c.add(d.transform);for(let m of f)c.changeParent(m,d.transform.ref);break}}s.editInfo.sourceTree=s.tree;let u=c.asImmutable();return l?.useHashVersion&&zi.setParamHashVersion(u,t(s)),u}function n(s){return!!s&&typeof s.getTree=="function"}e.is=n;function o(s){return!!s&&typeof s.getTree=="function"&&typeof s.ref=="string"}e.isTo=o;class i{get editInfo(){return this.state.editInfo}get currentTree(){return this.state.tree}to(l){let c=typeof l=="string"?l:uA.is(l)?l.transform.ref:l.ref;return new a(this.state,c,this)}toRoot(){return new a(this.state,this.state.tree.root.ref,this)}delete(l){let c=Ji.resolveRef(l);return!c||!this.state.tree.transforms.has(c)?this:(this.editInfo.count++,this.state.tree.remove(c),this.state.actions.push({kind:"delete",ref:c}),this)}getTree(l){return r(this.state,l)}commit(l){if(!this.state.state)throw new Error("Cannot commit template tree");return this.state.state.runTask(this.state.state.updateTree(this,l))}constructor(l,c){this.state={state:c,tree:l.asTransient(),actions:[],editInfo:{applied:!1,sourceTree:l,count:0,lastUpdate:void 0}}}}e.Root=i;class a{get editInfo(){return this.state.editInfo}get selector(){return new dA(this.ref,this.state.state)}getApplyRoot(){return zi.getDecoratorRoot(this.state.tree,this.ref)}apply(l,c,u){if(l.definition.isDecorator)return this.insert(l,c,u);let d=this.getApplyRoot(),f=l.apply(d,c,u);return this.state.tree.add(f),this.editInfo.count++,this.editInfo.lastUpdate=f.ref,this.state.actions.push({kind:"add",transform:f}),new a(this.state,f.ref,this.root)}applyOrUpdate(l,c,u,d){if(this.state.tree.transforms.has(l)){let f=this.to(l);return u&&f.update(u),f}else return this.apply(c,u,{...d,ref:l})}applyOrUpdateTagged(l,c,u,d){if(c.definition.isDecorator)throw new Error("Can't use applyOrUpdateTagged on decorator transformers.");let f=this.getApplyRoot(),m=this.state.tree.children.get(f).values();for(;;){let h=m.next();if(h.done)break;let g=this.state.tree.transforms.get(h.value);if(g&&Ur.hasTags(g,l)){let y=this.to(h.value);return y.updateTagged(u,CN(g.tags,l,d&&d.tags)),y}}let p=c.apply(f,u,{...d,tags:CN(l,d&&d.tags)});return this.state.tree.add(p),this.editInfo.count++,this.editInfo.lastUpdate=p.ref,this.state.actions.push({kind:"add",transform:p}),new a(this.state,p.ref,this.root)}group(l,c,u){return this.apply(l,c,u)}insert(l,c,u){let d=this.state.tree.children.get(this.ref).toArray(),f=l.apply(this.ref,c,u);this.state.tree.add(f);for(let m of d)this.state.tree.changeParent(m,f.ref);return this.editInfo.count++,this.editInfo.lastUpdate=f.ref,this.state.actions.push({kind:"insert",ref:this.ref,transform:f}),new a(this.state,f.ref,this.root)}updateTagged(l,c){(this.state.tree.setParams(this.ref,l)||this.state.tree.setTags(this.ref,c))&&(this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.push({kind:"update",ref:this.ref,params:l}))}update(l,c){let u;if(c){let d=this.state.tree.transforms.get(this.ref);u=Vu(d.params,c)}else u=typeof l=="function"?Vu(this.state.tree.transforms.get(this.ref).params,l):l;return this.state.tree.setParams(this.ref,u)&&(this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.push({kind:"update",ref:this.ref,params:u})),this.root}updateState(l){let c=this.state.tree.transforms.get(this.ref);Ur.isStateChange(c.state,l)&&(this.state.tree.assignState(this.ref,l),this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.find(u=>u.kind==="update"&&u.ref===this.ref)||this.state.actions.push({kind:"update",ref:this.ref,params:c.params}))}tag(l){let c=this.state.tree.transforms.get(this.ref);return this.updateTagged(c.params,CN(c.tags,l)),this}dependsOn(l){let c=this.state.tree.transforms.get(this.ref);this.state.tree.setDependsOn(this.ref,CN(c.dependsOn,l))&&(this.editInfo.count++,this.editInfo.lastUpdate=this.ref,this.state.actions.push({kind:"update",ref:this.ref,params:c.params}))}to(l){return this.root.to(l)}toRoot(){return this.root.toRoot()}delete(l){return this.root.delete(l)}getTree(l){return r(this.state,l)}commit(l){if(!this.state.state)throw new Error("Cannot commit template tree");return this.state.state.runTask(this.state.state.updateTree(this,l))}constructor(l,c,u){if(this.state=l,this.root=u,this.ref=c,!this.state.tree.transforms.has(c))throw new Error(`Could not find node '${c}'.`)}}e.To=a})(jx||(jx={}))});var wN,IAe=M(()=>{Wk();Vt();Jn();qx();wN=class{constructor(){this.ev=_d.create(),this.actions=new Map,this.fromTypeIndex=new Map,this.events={added:this.ev(),removed:this.ev()}}add(t){let r=ct.is(t)?t.toAction():t;if(this.actions.has(r.id))return this;this.actions.set(r.id,r);for(let n of r.definition.from)this.fromTypeIndex.has(n.type)?this.fromTypeIndex.get(n.type).push(r):this.fromTypeIndex.set(n.type,[r]);return this.events.added.next(void 0),this}remove(t){let r=ct.is(t)?t.toAction().id:En.is(t)?t:t.id,n=this.actions.get(r);if(!n)return this;this.actions.delete(r);for(let o of n.definition.from){let i=this.fromTypeIndex.get(o.type);i&&(Ip(i,n),i.length===0&&this.fromTypeIndex.delete(o.type))}return this.events.removed.next(void 0),this}fromCell(t,r){let n=t.obj;if(!n)return[];let o=this.fromTypeIndex.get(n.type);if(!o)return[];let i=!1;for(let s of o)if(s.definition.isApplicable){i=!0;break}if(!i)return o;let a=[];for(let s of o)s.definition.isApplicable?s.definition.isApplicable(n,t.transform,r)&&a.push(s):a.push(s);return a}dispose(){this.ev.dispose()}}});var Kp,dQ=M(()=>{(function(e){function t(i){return{type:"message",timestamp:new Date,message:i}}e.message=t;function r(i){return{type:"error",timestamp:new Date,message:i}}e.error=r;function n(i){return{type:"warning",timestamp:new Date,message:i}}e.warning=n;function o(i){return{type:"info",timestamp:new Date,message:i}}e.info=o})(Kp||(Kp={}))});var Gx,TN=M(()=>{bb();(function(e){class t{get current(){return this._current}set current(i){this._current=i}getAncestorOfType(i){if(!this._current)return;let a=this._current;for(;;){if(a=this.cells.get(a.transform.parent),!a.obj)return;if(a.obj.type===i.type)return a.obj;if(a.transform.ref===Ur.RootRef)return}}getRootOfType(i){if(!this._current)return;let a=this._current,s;for(;;){if(!a.obj)return;if(a.obj.type===i.type&&(s=a),a.transform.ref===Ur.RootRef)return s?s.obj:void 0;a=this.cells.get(a.transform.parent)}}constructor(i){this.cells=i,this._current=void 0}}e.Impl=t;function r(o,i){let a=o.cells,s=a.get(i),l=[s];for(;s?.transform.transformer.definition.isDecorator;)s=a.get(s.transform.parent),l.push(s);return l}e.getDecoratorChain=r;function n(o,i,a){let s,l=o.cells.get(a);if(l)for(;;){if(!l.obj)return;if(l.obj.type===i.type&&(s=l),l.transform.ref===Ur.RootRef)return s?s.obj:void 0;l=o.cells.get(l.transform.parent)}}e.getRootOfType=n})(Gx||(Gx={}))});var AN,EAe=M(()=>{Jn();es();AN=class{constructor(){this.queue=[],this.signal=new Vn}get length(){return this.queue.length}enqueue(t){return this.queue.push(t),this.queue.length===1?!0:this.waitFor(t)}handled(t){tg(this.queue,t),this.queue.length>0&&this.signal.next({v:this.queue[0],stillPresent:!0})}remove(t){let r=tg(this.queue,t);return r&&this.signal.next({v:t,stillPresent:!1}),r}waitFor(t){return new Promise(r=>{let n=this.signal.subscribe(({v:o,stillPresent:i})=>{o===t&&(n.unsubscribe(),r(i))})})}}});async function C1t(e){let t=!!(e.editInfo&&e.editInfo.count===1&&e.editInfo.lastUpdate&&e.editInfo.sourceTree===e.oldTree),r,n=[],o;if(t)r=[],o=[e.editInfo.lastUpdate];else{r=P1t(e);let s=e.parent.current,l=!1;for(let c of r)if(c===s){l=!0;break}if(l){let c=DAe(e.oldTree,s,r,e.cells);e.parent.setCurrent(c)}for(let c=r.length-1;c>=0;c--){let u=e.cells.get(r[c]);u&&PN(u.transform,u.obj,u?.transform.params,u.cache,e.parent.globalContext)}for(let c of r){let u=e.cells.get(c);u&&(u.parent=void 0,M1t(u));let d=u&&u.obj;e.cells.delete(c),n.push(d)}o=w1t(e.cells,e.tree)}let i=O1t(e,o);for(let s of i.added)e.parent.events.cell.created.next({state:e.parent,ref:s.transform.ref,cell:s});for(let s=0;s<r.length;s++){let l=r[s],c=e.oldTree.transforms.get(l).parent;e.parent.events.object.removed.next({state:e.parent,ref:l,obj:n[s]}),e.parent.events.cell.removed.next({state:e.parent,ref:l,parent:c})}if(n.length&&(n=[]),i.dependent)for(let s of i.dependent)o.push(s.transform.ref);k1t(e,o);for(let s of o)await BAe(e,s);e.editInfo||E1t(e);let a=e.newCurrent;for(let s of e.results)s.action==="created"?(e.parent.events.object.created.next({state:e.parent,ref:s.ref,obj:s.obj}),e.newCurrent||!e.tree.transforms.get(s.ref).state.isGhost&&s.obj!==Io.Null&&(a=s.ref)):s.action==="updated"?e.parent.events.object.updated.next({state:e.parent,ref:s.ref,action:"in-place",obj:s.obj,oldData:s.oldData}):s.action==="replaced"&&e.parent.events.object.updated.next({state:e.parent,ref:s.ref,action:"recreate",obj:s.obj,oldObj:s.oldObj});if(a)e.options.doNotUpdateCurrent||e.parent.setCurrent(a);else{let s=e.parent.current,l=e.cells.get(s);l&&(l.obj===Io.Null||l.status==="error"&&l.errorText===L1t)&&(a=DAe(e.oldTree,s,[],e.cells),e.parent.setCurrent(a))}return r.length>0||o.length>0||e.changed}function w1t(e,t){let r={roots:[],cells:e};return zi.doPreOrder(t,t.root,r,T1t),r.roots}function T1t(e,t,r){let n=r.cells.get(e.ref);return!n||n.transform.version!==e.version?(r.roots.push(e.ref),!1):!(n.status==="error"||n&&n.obj===Io.Null)}function A1t(e,t,r){!r.newTree.transforms.has(e.ref)&&r.cells.has(e.ref)&&r.deletes.push(e.ref)}function P1t(e){let t={newTree:e.tree,cells:e.cells,deletes:[]};return zi.doPostOrder(e.oldTree,e.oldTree.root,t,A1t),t.deletes}function I1t(e,t,r){let n=r.cells.get(e.ref);!n||!Ur.syncState(n.state,e.state)||r.parent.events.cell.stateUpdated.next({state:r.parent,ref:e.ref,cell:n})}function E1t(e){zi.doPreOrder(e.tree,e.tree.root,e,I1t)}function IN(e,t,r,n){let o=e.cells.get(t),i=o.status!==r;o.status=r,o.errorText=n,i&&e.parent.events.cell.stateUpdated.next({state:e.parent,ref:t,cell:o})}function D1t(e,t,r){r.cells.get(e.ref).transform=e,IN(r,e.ref,"pending")}function k1t(e,t){for(let r of t)zi.doPreOrder(e.tree,e.tree.transforms.get(r),e,D1t)}function M1t(e){for(let t of e.dependencies.dependsOn)Ip(t.dependencies.dependentBy,e)}function B1t(e,t,{ctx:r,added:n,visited:o}){if(o.add(e.ref),r.cells.has(e.ref))return;let i={parent:r.parent,transform:e,sourceRef:void 0,status:"pending",state:{...e.state},errorText:void 0,params:void 0,dependencies:{dependentBy:[],dependsOn:[]},cache:void 0};r.cells.set(e.ref,i),n.push(i)}function R1t(e,t){if(e.transform.dependsOn)for(let r of e.transform.dependsOn){if(!t.tree.transforms.get(r))throw new Error("Cannot depend on a non-existent transform.");let o=t.cells.get(r);Li(e.dependencies.dependsOn,o),Li(o.dependencies.dependentBy,e)}}function O1t(e,t){let r={ctx:e,visited:new Set,added:[]};for(let o of t)zi.doPreOrder(e.tree,e.tree.transforms.get(o),r,B1t);for(let o of r.added)R1t(o,e);let n;return r.visited.forEach(o=>{let i=e.cells.get(o);for(let a of i.dependencies.dependentBy)r.visited.has(a.transform.ref)||(n||(n=$n.create()),$n.add(n,a.transform.ref,a))}),{added:r.added,dependent:n?n.array:void 0}}function DAe(e,t,r,n){let o=new Set(r);return MAe(e,t,o,n)}function MAe(e,t,r,n){if(t===Ur.RootRef)return t;let o=e.transforms.get(t),i=e.children.get(o.parent).values(),a,s=!1;for(;;){let l=i.next();if(l.done)break;if(r.has(l.value))continue;let c=n.get(l.value);if(!c||c.status==="error"||c.obj===Io.Null)continue;let u=e.transforms.get(l.value);if(!u.state.isGhost){if(l.value===t){s=!0,r.has(t)||(a=t);continue}if(s)return u.ref;a=u.ref}}return a||MAe(e,o.parent,r,n)}function mQ(e,t,r,n){n||(e.hadError=!0,e.parent.errorFree=!1);let o=e.cells.get(t);if(r){e.wasAborted=e.wasAborted||Me.isAbort(r);let a=""+r;IN(e,t,"error",a),n||e.parent.events.log.next({type:"error",timestamp:new Date,message:a})}else o.params=void 0;if(o.obj){let a=o.obj;o.obj=void 0,o.cache=void 0,e.parent.events.object.removed.next({state:e.parent,ref:t,obj:a})}let i=e.tree.children.get(t).values();for(;;){let a=i.next();if(a.done)return;mQ(e,a.value,void 0,n)}}async function BAe(e,t){IN(e,t,"processing");let r=!1;try{let o=Kn(),i=await N1t(e,t),a=Kn()-o;i.action!=="none"&&(e.changed=!0),IN(e,t,"ok"),e.results.push(i),i.action==="created"?(r=i.obj===Io.Null,!r&&!e.options.doNotLogTiming&&e.parent.events.log.next(Kp.info(`Created ${i.obj.label} in ${$w(a)}.`))):i.action==="updated"?(r=i.obj===Io.Null,!r&&!e.options.doNotLogTiming&&e.parent.events.log.next(Kp.info(`Updated ${i.obj.label} in ${$w(a)}.`))):i.action==="replaced"&&(r=i.obj===Io.Null,!r&&!e.options.doNotLogTiming&&e.parent.events.log.next(Kp.info(`Updated ${i.obj.label} in ${$w(a)}.`)))}catch(o){e.changed=!0,e.hadError||(e.newCurrent=t),mQ(e,t,o,!1),console.error(o);return}let n=e.tree.children.get(t).values();for(;;){let o=n.next();if(o.done)return;r?mQ(e,o.value,void 0,!0):await BAe(e,o.value)}}function F1t(e,t,r,n){let o=t.transformer.definition.params,i=o?o(r,e.parent.globalContext):{};if(t.version!==t._normalized_param_version)t.params=_.normalizeParams(i,t.params,"all"),t._normalized_param_version=t.version;else{let a=_.getDefaultValues(i);t.params=t.params?tme(t.params,a):a}return _.resolveRefs(i,t.params,e.getCellData),{definition:i,values:t.params}}async function N1t(e,t){var r;let{oldTree:n,tree:o}=e,i=e.cells.get(t),a=i.transform;if(i.transform.ref===Ur.RootRef)return{action:"none"};let s=e.cells.get(i.transform.parent);if(s?.obj===Io.Null)if(i.sourceRef=s.transform.ref,n.transforms.has(t)&&i.params){let f=i.params.values,m=i.cache;return PN(a,i.obj,f,m,e.parent.globalContext),i.params=void 0,i.obj=Io.Null,{ref:t,action:"updated",obj:i.obj}}else return i.params=void 0,{ref:t,action:"created",obj:Io.Null};let c=a.transformer.definition.from.length===0?s:ir.findAncestorOfType(o,e.cells,t,a.transformer.definition.from);if(!c)throw new Error(`No suitable parent found for '${t}'`);e.spine.current=i;let u=c.obj;i.sourceRef=c.transform.ref;let d=F1t(e,a,u,i);if(!n.transforms.has(t)||!i.params){i.params=d;let f=await kAe(e,i,a.transformer,u,d.values);return fQ(f,a),i.obj=f,{ref:t,action:"created",obj:f}}else{let f=i.params.values,m=i.cache,p=(r=i.obj)===null||r===void 0?void 0:r.data,h=d.values;switch(i.params=d,i.obj&&i.obj!==Io.Null?await U1t(e,i,a.transformer,u,i.obj,f,h):ct.UpdateResult.Recreate){case ct.UpdateResult.Recreate:{let y=i.obj;PN(a,y,f,m,e.parent.globalContext);let b=await kAe(e,i,a.transformer,u,h);return fQ(b,a),i.obj=b,{ref:t,action:"replaced",oldObj:y,obj:b}}case ct.UpdateResult.Updated:return fQ(i.obj,a),{ref:t,action:"updated",oldData:p,obj:i.obj};case ct.UpdateResult.Null:return PN(a,i.obj,f,m,e.parent.globalContext),i.obj=Io.Null,{ref:t,action:"updated",obj:i.obj};default:return{action:"none"}}}}function PN(e,t,r,n,o){var i,a;(a=(i=e.transformer.definition).dispose)===null||a===void 0||a.call(i,{b:t!==Io.Null?t:void 0,params:r,cache:n},o)}function fQ(e,t){!e||e===Io.Null||(e.tags=t.tags)}function pQ(e,t){return typeof e.runInContext=="function"?e.runInContext(t):e}function RAe(e){if(e.dependencies.dependsOn.length===0)return;let t=Object.create(null);for(let r of e.dependencies.dependsOn){if(!r.obj)throw new Error("Unresolved dependency.");t[r.transform.ref]=r.obj}return t}function kAe(e,t,r,n,o){return t.cache||(t.cache=Object.create(null)),pQ(r.definition.apply({a:n,params:o,cache:t.cache,spine:e.spine,dependencies:RAe(t)},e.parent.globalContext),e.taskCtx)}async function U1t(e,t,r,n,o,i,a){return r.definition.update?(t.cache||(t.cache=Object.create(null)),pQ(r.definition.update({a:n,oldParams:i,b:o,newParams:a,cache:t.cache,spine:e.spine,dependencies:RAe(t)},e.parent.globalContext),e.taskCtx)):ct.UpdateResult.Recreate}var Jf,_1t,L1t,OAe=M(()=>{T5();j5();bb();Wk();hr();G5();qx();uQ();IAe();dQ();ed();Ue();TN();EAe();Jn();ku();Aa();Jf=class{get tree(){return this._tree}get transforms(){return this._tree.transforms}get current(){return this.behaviors.currentObject.value.ref}get root(){return this.cells.get(this._tree.root.ref)}build(){return new jx.Root(this.tree,this)}addHistory(t,r){this.historyCapacity!==0&&(this.history.unshift([t,r||"Update"]),this.history.length>this.historyCapacity&&this.history.pop(),this.events.historyUpdated.next({state:this}))}clearHistory(){this.history.length!==0&&(this.history=[],this.events.historyUpdated.next({state:this}))}get latestUndoLabel(){return this.history.length>0?this.history[0][1]:void 0}get canUndo(){return this.history.length>0}undo(){return Me.create("Undo",async t=>{let r=this.history.shift();if(r){this.events.historyUpdated.next({state:this}),this.undoingHistory=!0;try{await this.updateTree(r[0],{canUndo:!1}).runInContext(t)}finally{this.undoingHistory=!1}}})}getSnapshot(){return{tree:zi.toJSON(this._tree)}}setSnapshot(t){let r=zi.fromJSON(t.tree);return this.updateTree(r)}setCurrent(t){this.behaviors.currentObject.next({state:this,ref:t})}updateCellState(t,r){let n=this.cells.get(t);if(!n)return;let o=typeof r=="function"?r(n.state):r;Ur.assignState(n.state,o)&&(n.transform=this._tree.assignState(n.transform.ref,o),this.events.cell.stateUpdated.next({state:this,ref:t,cell:n}))}dispose(){this.ev.dispose(),this.actions.dispose()}select(t){return ir.select(t,this)}selectQ(t){return typeof t=="string"?ir.select(t,this):ir.select(t(ir.Generators),this)}applyAction(t,r,n=Ur.RootRef){return Me.create("Apply Action",o=>{let i=this.cells.get(n);if(!i)throw new Error(`'${n}' does not exist.`);if(i.status!=="ok")throw new Error(`Action cannot be applied to a cell with status '${i.status}'`);return pQ(t.definition.run({ref:n,cell:i,a:i.obj,params:r,state:this},this.globalContext),o)})}transaction(t,r){return Me.create("State Transaction",async n=>{let o=this.inTransaction,i=this._tree.asImmutable(),a=!1;try{o||this.behaviors.isUpdating.next(!0),this.inTransaction=!0,this.inTransactionError=!1,await t(n),this.inTransactionError&&(a=!0,await this.updateTree(i).runInContext(n))}catch(s){if(a||(a=!0,await this.updateTree(i).runInContext(n),this.events.log.next(Kp.error("Error during state transaction, reverting"))),o)throw this.inTransactionError=!0,s;if(r?.rethrowErrors)throw s;console.error(s)}finally{o||(this.inTransaction=!1,this.events.changed.next({state:this,inTransaction:!1}),this.behaviors.isUpdating.next(!1),a||(r?.canUndo?this.addHistory(i,typeof r.canUndo=="string"?r.canUndo:void 0):this.clearHistory()))}})}get inUpdate(){return this._inUpdate}updateTree(t,r){let n={tree:t,options:r};return Me.create("Update Tree",async o=>{if(!await this.updateQueue.enqueue(n))return;this._inUpdate=!0;let a=r?.canUndo?this._tree.asImmutable():void 0,s=!1;this.inTransaction||this.behaviors.isUpdating.next(!0);try{if(jx.is(t)){if(t.editInfo.applied)throw new Error("This builder has already been applied. Create a new builder for further state updates");t.editInfo.applied=!0}this.reverted=!1;let l=r&&(r.revertIfAborted||r.revertOnError)?await this._revertibleTreeUpdate(o,n,r):await this._updateTree(o,n);return s=this.reverted,l.ctx.hadError&&(this.inTransactionError=!0),l.cell?new dA(l.cell.transform.ref,this):void 0}finally{this._inUpdate=!1,this.updateQueue.handled(n),this.inTransaction||(this.behaviors.isUpdating.next(!1),r?.canUndo?s||this.addHistory(a,typeof r.canUndo=="string"?r.canUndo:void 0):this.undoingHistory||this.clearHistory())}},()=>{this.updateQueue.remove(n)})}async _revertibleTreeUpdate(t,r,n){let o=this.tree,i=await this._updateTree(t,r);return(i.ctx.hadError||i.ctx.wasAborted)&&n.revertOnError||i.ctx.wasAborted&&n.revertIfAborted?(this.reverted=!0,await this._updateTree(t,{tree:o,options:r.options})):i}async _updateTree(t,r){let n=!1,o=this.updateTreeAndCreateCtx(r.tree,t,r.options);try{if(n=await C1t(o),jx.isTo(r.tree)){let i=this.select(r.tree.ref)[0];return{ctx:o,cell:i}}return{ctx:o}}finally{this.spine.current=void 0,n&&this.events.changed.next({state:this,inTransaction:this.inTransaction})}}updateTreeAndCreateCtx(t,r,n){let o=(jx.is(t)?t.getTree():t).asTransient(),i=this._tree;this._tree=o;let a=this.cells,s={parent:this,editInfo:jx.is(t)?t.editInfo:void 0,errorFree:this.errorFree,taskCtx:r,oldTree:i,tree:o,cells:this.cells,spine:this.spine,results:[],options:{..._1t,...n},changed:!1,hadError:!1,wasAborted:!1,newCurrent:void 0,getCellData:l=>{var c;return(c=a.get(l).obj)===null||c===void 0?void 0:c.data}};return this.errorFree=!0,s}constructor(t,r){this.errorFree=!0,this.ev=_d.create(),this.globalContext=void 0,this.events={cell:{stateUpdated:this.ev(),created:this.ev(),removed:this.ev()},object:{updated:this.ev(),created:this.ev(),removed:this.ev()},log:this.ev(),changed:this.ev(),historyUpdated:this.ev()},this.behaviors={currentObject:this.ev.behavior({state:this,ref:Ur.RootRef}),isUpdating:this.ev.behavior(!1)},this.actions=new wN,this.cells=new Map,this.spine=new Gx.Impl(this.cells),this.tryGetCellData=i=>{var a,s;let l=(s=(a=this.cells.get(i))===null||a===void 0?void 0:a.obj)===null||s===void 0?void 0:s.data;if(l===void 0)throw new Error(`Cell '${i}' data undefined.`);return l},this.historyCapacity=5,this.history=[],this.undoingHistory=!1,this.inTransaction=!1,this.inTransactionError=!1,this._inUpdate=!1,this.reverted=!1,this.updateQueue=new AN,this._tree=zi.createEmpty(Ur.createRoot(r&&r.rootState)).asTransient();let o=this._tree.root;this.runTask=r.runTask,r?.historyCapacity!==void 0&&(this.historyCapacity=r.historyCapacity),this.cells.set(o.ref,{parent:this,transform:o,sourceRef:void 0,obj:t,status:"ok",state:{...o.state},errorText:void 0,params:{definition:{},values:{}},dependencies:{dependentBy:[],dependsOn:[]},cache:{}}),this.globalContext=r&&r.globalContext}};(function(e){function t(n,o){return new e(n,o)}e.create=t;let r;(function(n){function o(i,a){return!!a&&i.ref===a.transform.ref&&i.state===a.parent}n.isCell=o})(r=e.ObjectEvent||(e.ObjectEvent={}))})(Jf||(Jf={}));_1t={doNotLogTiming:!1,doNotUpdateCurrent:!0,revertIfAborted:!1,revertOnError:!1,canUndo:!1};L1t="Parent is null"});var yn=M(()=>{T5();j5();OAe();uQ();G5();Wk();bb();p$()});function EN(e,t,r){return{kind:"data-location",tag:e,data:t,element:r}}var zu,Pb=M(()=>{zu={kind:"null-location"}});function Tn(e,t,r,n,o=!1,i=()=>!1,a){if(e%r!==0)throw new Error("incompatible groupCount and stride");let s={location:zu,location2:zu,index:0,groupIndex:0,instanceIndex:0,isSecondary:!1},l=s.groupIndex<e,c=!1,u=0,d=0,f=!1,m=!!a;return{get hasNext(){return l},get isNextNewInstance(){return c},groupCount:e,instanceCount:t,count:e*t,stride:r,nonInstanceable:o,hasLocation2:m,move(){return l&&(s.groupIndex=u,s.instanceIndex=d,s.index=d*e+u,s.location=n(u,f?-1:d),m&&(s.location2=a(u,f?-1:d)),s.isSecondary=i(u,f?-1:d),u+=r,u===e?(++d,c=!0,d<t&&(u=0)):c=!1,l=u<e),s},reset(){s.location=zu,s.location2=zu,s.index=0,s.groupIndex=0,s.instanceIndex=0,s.isSecondary=!1,l=s.groupIndex<e,c=!1,u=0,d=0,f=!1},skipInstance(){l&&s.instanceIndex===d&&(++d,u=0,l=d<t)},voidInstances(){f=!0}}}function Ul(e,t){return{kind:"position-location",position:e?v.clone(e):v(),normal:t?v.clone(t):v()}}function MA(e){return!!e&&e.kind==="position-location"}var ly,Ci=M(()=>{Ge();Pb();ly={get hasNext(){return!1},get isNextNewInstance(){return!1},groupCount:0,instanceCount:0,count:0,stride:0,nonInstanceable:!1,hasLocation2:!1,move(){return{location:zu,location2:zu,index:0,groupIndex:0,instanceIndex:0,isSecondary:!1}},reset(){},skipInstance(){},voidInstances(){}}});function LAe(){return{cellSize:0,cellCount:0,cellOffsets:new Uint32Array,cellSpheres:new Float32Array,cellTransform:new Float32Array,cellInstance:new Float32Array,batchSize:0,batchCount:0,batchOffsets:new Uint32Array,batchSpheres:new Float32Array,batchCell:new Uint32Array}}function FAe(e,t,r){let n=z1t(e,t),o=q1t(n,r),i=new Uint32Array(n.cellOffsets.length),a=new Float32Array(n.cellSpheres.length),s=new Float32Array(n.cellInstance.length),l=0;for(let u=0,d=o.batchCell.length;u<d;++u){let f=o.batchCell[u],m=n.cellOffsets[f],h=n.cellOffsets[f+1]-m;i[u+1]=i[u]+h;for(let g=0;g<4;++g)a[u*4+g]=n.cellSpheres[f*4+g];for(let g=0;g<h;++g){let y=m+g,b=n.cellInstance[y];for(let x=0;x<16;++x)n.cellTransform[l*16+x]=e.transform[b*16+x];s[l]=b,l+=1}}return{cellSize:n.cellSize,cellCount:n.cellCount,cellOffsets:i,cellSpheres:a,cellTransform:n.cellTransform,cellInstance:s,batchSize:o.batchSize,batchCount:o.batchCount,batchOffsets:o.batchOffsets,batchSpheres:o.batchSpheres,batchCell:ls(o.batchCell)}}function z1t(e,t){let{instanceCount:r,instance:n,transform:o,invariantBoundingSphere:i}=e,a=new Float32Array(r),s=new Float32Array(r),l=new Float32Array(r),c=Se.ofBounds(0,r),u=Ct.setEmpty(Ct()),{center:d,radius:f}=i,m=v.create(f,f,f),p=v();for(let R=0;R<r;++R)hQ(p,d,o,0,0,R*16),a[R]=p[0],s[R]=p[1],l[R]=p[2],DN(u,p);Ct.expand(u,u,m);let h={x:a,y:s,z:l,indices:c},g={box:u,sphere:be.fromBox3D(be(),u)},y=Kd(h,g,v.create(t,t,t)),{array:b,offset:x,count:C}=y.buckets,S=x.length,w=new Uint32Array(S+1),A=new Float32Array(S*4),T=new Float32Array(r*16),D=new Float32Array(r),E=Ct(),I=be(),k=0;for(let R=0;R<S;++R){let B=x[R],O=C[R];w[R]=B;let F=k;for(let q=B,W=B+O;q<W;++q){let j=b[q];D[k]=n[j];for(let L=0;L<16;++L)T[k*16+L]=o[j*16+L];k+=1}if(O===1)hQ(A,d,T,R*4,0,F*16),A[R*4+3]=f;else{Ct.setEmpty(E);let q=F*16;for(let W=0;W<O;++W)hQ(p,d,T,0,0,W*16+q),DN(E,p);Ct.expand(E,E,m),be.fromBox3D(I,E),be.toArray(I,A,R*4)}}return w[S]=x[S-1]+C[S-1],{cellSize:t,cellCount:S,cellOffsets:w,cellSpheres:A,cellTransform:T,cellInstance:D}}function q1t(e,t){let{cellCount:r,cellSpheres:n}=e,o=new Float32Array(r),i=new Float32Array(r),a=new Float32Array(r),s=Se.ofBounds(0,r),l=Ct.setEmpty(Ct()),c=v(),u=0;for(let D=0;D<r;++D){let E=D*4;V1t(c,n,E),o[D]=c[0],i[D]=c[1],a[D]=c[2],DN(l,c),u=Math.max(u,n[E+3])}let d=v.create(u,u,u);Ct.expand(l,l,d);let f={x:o,y:i,z:a,indices:s},m={box:l,sphere:be.fromBox3D(be(),l)},p=Kd(f,m,v.create(t,t,t)),{array:h,offset:g,count:y}=p.buckets,b=g.length,x=new Uint32Array(b+1),C=new Float32Array(b*4),S=new Uint32Array(r),w=Ct(),A=be(),T=0;for(let D=0;D<b;++D){let E=g[D],I=y[D];x[D]=E;for(let k=E,R=E+I;k<R;++k)S[T]=h[k],T+=1;if(I===1){let k=h[E];C[D*4]=n[k*4],C[D*4+1]=n[k*4+1],C[D*4+2]=n[k*4+2],C[D*4+3]=n[k*4+3]}else{Ct.setEmpty(w),u=0;for(let k=E,R=E+I;k<R;++k){let B=h[k];c[0]=n[B*4],c[1]=n[B*4+1],c[2]=n[B*4+2],DN(w,c),u=Math.max(u,n[B*4+3])}v.set(d,u,u,u),Ct.expand(w,w,d),be.fromBox3D(A,w),be.toArray(A,C,D*4)}}return x[b]=g[b-1]+y[b-1],{batchSize:t,batchCount:b,batchOffsets:x,batchSpheres:C,batchCell:S}}var hQ,V1t,DN,NAe=M(()=>{oD();Jn();X1();$i();FW();sg();hQ=v.transformMat4Offset,V1t=v.fromArray,DN=Ct.add});function G1t(e,t){for(let r=0;r<t;r++)if(Yt.fromMat4(UAe,H.fromArray(j1t,e,r*16)),Yt.determinant(UAe)<0)return!0;return!1}function mC(e,t,r,n,o,i){let a=G1t(e,t);if(i){P.update(i.matrix,i.matrix.ref.value);let s=i.transform.ref.value.length>=t*16?i.transform.ref.value:new Float32Array(t*16);s.set(e),P.update(i.transform,s),P.updateIfChanged(i.uInstanceCount,t),P.updateIfChanged(i.instanceCount,t);let l=i.aTransform.ref.value.length>=t*16?i.aTransform.ref.value:new Float32Array(t*16);P.update(i.aTransform,l);let c=i.extraTransform.ref.value.length>=t*16?i.extraTransform.ref.value:new Float32Array(t*16);P.update(i.extraTransform,BA(c,t));let u=i.aInstance.ref.value.length>=t?i.aInstance.ref.value:new Float32Array(t);P.update(i.aInstance,ls(u,t)),P.update(i.hasReflection,a)}else i={aTransform:P.create(new Float32Array(t*16)),matrix:P.create(H.identity()),transform:P.create(new Float32Array(e)),extraTransform:P.create(BA(new Float32Array(t*16),t)),uInstanceCount:P.create(t),instanceCount:P.create(t),aInstance:P.create(ls(new Float32Array(t))),hasReflection:P.create(a),instanceGrid:P.create(LAe())};return yQ(i,r,n,o),i}function kN(e){return mC(new Float32Array(gQ),1,void 0,0,0,e)}function BA(e,t){for(let r=0;r<t;r++)e.set(gQ,r*16);return e}function yQ(e,t,r,n){let o=e.aTransform.ref.value,i=e.aInstance.ref.value,a=e.instanceCount.ref.value,s=e.matrix.ref.value,l=e.transform.ref.value,c=e.extraTransform.ref.value;for(let u=0;u<a;u++){let d=u*16;H.mulOffset(o,c,l,d,d,d),H.mulOffset(o,s,o,d,0,d),i[u]=u}if(t&&a>0){let u=FAe({instanceCount:a,instance:i,transform:o,invariantBoundingSphere:t},r,n);P.update(e.instanceGrid,u),P.update(e.aInstance,u.cellInstance),P.update(e.aTransform,u.cellTransform)}else P.update(e.aInstance,i),P.update(e.aTransform,o)}var UAe,j1t,gQ,Hx=M(()=>{Vt();Ge();Jn();NAe();UAe=Yt(),j1t=H();gQ=new Float32Array(16);H.toArray(H.identity(),gQ,0)});var mr,C8r,ya=M(()=>{Zl();mr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflower:6591981,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,laserlemon:16777044,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrod:16448210,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,maroon2:8323072,maroon3:11546720,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,purple2:8323199,purple3:10494192,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},C8r=(function(){let e=new Map;return Object.keys(mr).forEach(t=>{e.set(mr[t],t)}),e})()});var Ar,zo=M(()=>{Ar={Atom:"Atom Property",Chain:"Chain Property",Residue:"Residue Property",Symmetry:"Symmetry",Validation:"Validation",Misc:"Miscellaneous"}});function W1t(e){return Ib}function Tg(e,t){let r=Ya(t.value,VAe);return r=De.saturate(r,t.saturation),r=De.lighten(r,t.lightness),{factory:Tg,granularity:"uniform",color:()=>r,props:t,description:H1t,legend:id([["uniform",r]])}}var VAe,H1t,Ib,zAe,RA=M(()=>{Jr();Ue();D0();Vt();zo();VAe=De(13421772),H1t="Gives everything the same, uniform color.",Ib={value:_.Color(VAe),saturation:_.Numeric(0,{min:-6,max:6,step:.1}),lightness:_.Numeric(0,{min:-6,max:6,step:.1})};zAe={name:"uniform",label:"Uniform",category:Ar.Misc,factory:Tg,getParams:W1t,defaultValues:_.getDefaultValues(Ib),isApplicable:e=>!0}});function Y1t(e){return qAe}function MN(e,t){let r=t.value;return{factory:MN,granularity:"uniform",size:()=>r,props:t,description:K1t}}var K1t,qAe,jAe,vQ=M(()=>{Ue();K1t="Gives everything the same, uniform size.",qAe={value:_.Numeric(1,{min:0,max:20,step:.1})};jAe={name:"uniform",label:"Uniform",category:"",factory:MN,getParams:Y1t,defaultValues:_.getDefaultValues(qAe),isApplicable:e=>!0}});function Gs(e){return{...Gs.Zero,...e}}var Wx=M(()=>{Ue();(function(e){e.Zero={metalness:0,roughness:0,bumpiness:0};function t(o,i,a){return i[a]=o.metalness*255,i[a+1]=o.roughness*255,i[a+2]=o.bumpiness*255,i}e.toArray=t;function r({metalness:o,roughness:i,bumpiness:a}){return`M ${o.toFixed(2)} | R ${i.toFixed(2)} | B ${a.toFixed(2)}`}e.toString=r;function n(o){return _.Group({metalness:_.Numeric(0,{min:0,max:1,step:.01}),roughness:_.Numeric(1,{min:0,max:1,step:.01}),bumpiness:_.Numeric(0,{min:0,max:1,step:.01})},{...o,presets:[[{metalness:0,roughness:1,bumpiness:0},"Matte"],[{metalness:0,roughness:.2,bumpiness:0},"Plastic"],[{metalness:0,roughness:.6,bumpiness:0},"Glossy"],[{metalness:1,roughness:.6,bumpiness:0},"Metallic"]]})}e.getParam=n})(Gs||(Gs={}))});function Ag(){}var BN=M(()=>{Ge();la();Ue();wc();(function(e){e.Type={none:0,plane:1,sphere:2,cube:3,cylinder:4,infiniteCone:5},e.Params={variant:_.Select("pixel",_.arrayToOptions(["instance","pixel"])),objects:_.ObjectList({type:_.Select("plane",_.objectToOptions(e.Type,u=>Ml(u))),invert:_.Boolean(!1),position:_.Vec3(v()),rotation:_.Group({axis:_.Vec3(v.create(1,0,0)),angle:_.Numeric(0,{min:-180,max:180,step:1},{description:"Angle in Degrees"})},{isExpanded:!0}),scale:_.Vec3(v.create(1,1,1)),transform:_.Mat4(H.identity())},u=>Ml(u.type))};function t(u){return{count:0,type:new Array(u).fill(1),invert:new Array(u).fill(!1),position:new Array(u*3).fill(0),rotation:new Array(u*4).fill(0),scale:new Array(u*3).fill(1),transform:new Array(u*16).fill(0)}}let r=Kr(),n=Kr(),o=v(),i=v(),a=H(),s=H();function l(u,d){let f=u.objects.length,{type:m,invert:p,position:h,rotation:g,scale:y,transform:b}=d?.objects||t(f);for(let x=0;x<f;++x){let C=u.objects[x];m[x]=e.Type[C.type],p[x]=C.invert,v.toArray(C.position,h,x*3),Kr.toArray(Kr.setAxisAngle(r,C.rotation.axis,zr(C.rotation.angle)),g,x*4),v.toArray(C.scale,y,x*3),H.toArray(C.transform,b,x*16)}return{variant:u.variant,objects:{count:f,type:m,invert:p,position:h,rotation:g,scale:y,transform:b}}}e.getClip=l;function c(u,d){if(u.variant!==d.variant||u.objects.count!==d.objects.count)return!1;let f=u.objects,m=d.objects;for(let p=0,h=f.count;p<h;++p)if(f.invert[p]!==m.invert[p]||f.type[p]!==m.type[p]||(v.fromArray(o,f.position,p*3),v.fromArray(i,m.position,p*3),!v.equals(o,i))||(v.fromArray(o,f.scale,p*3),v.fromArray(i,m.scale,p*3),!v.equals(o,i))||(Kr.fromArray(r,f.rotation,p*4),Kr.fromArray(n,m.rotation,p*4),!Kr.equals(r,n))||(H.fromArray(a,f.transform,p*16),H.fromArray(s,m.transform,p*16),!H.areEqual(a,s,1e-6)))return!1;return!0}e.areEqual=c})(Ag||(Ag={}))});function em(e){return!!e.smoothColors}function qu(e,t,r){if((e.name==="on"||e.name==="auto"&&t)&&r&&r<3){let n=3;return e.name==="on"?(r*=e.params.resolutionFactor,n=e.params.sampleStride):(r*=2-QO(0,1.1,r),r=Math.max(.5,r),r>1.2&&(n=2)),{resolution:r,stride:n}}}var X1t,Z1t,sM,RN,$e,Gn=M(()=>{Vt();Ci();Ue();Hx();ya();Pb();RA();vQ();sa();Wx();BN();$i();i2();X1t={custom:{},auto:{},highest:{},higher:{},high:{},medium:{},low:{},lower:{},lowest:{}},Z1t=Object.keys(X1t),sM=_.arrayToOptions(Z1t),RN={smoothColors:_.MappedStatic("auto",{auto:_.Group({}),on:_.Group({resolutionFactor:_.Numeric(2,{min:.5,max:6,step:.1}),sampleStride:_.Numeric(3,{min:1,max:12,step:1})}),off:_.Group({})})};(function(e){e.MaterialCategory={category:"Material"},e.ShadingCategory={category:"Shading"},e.CullingLodCategory={category:"Culling & LOD"},e.CustomQualityParamInfo={category:"Custom Quality",hideIf:a=>typeof a.quality<"u"&&a.quality!=="custom"},e.Params={alpha:_.Numeric(1,{min:0,max:1,step:.01},{label:"Opacity",isEssential:!0,description:"How opaque/transparent the representation is rendered."}),quality:_.Select("auto",sM,{isEssential:!0,description:"Visual/rendering quality of the representation."}),material:Gs.getParam(),clip:_.Group(Ag.Params),emissive:_.Numeric(0,{min:0,max:1,step:.01}),density:_.Numeric(.2,{min:0,max:1,step:.01},{description:"Density value to estimate object thickness."}),instanceGranularity:_.Boolean(!1,{description:"Use instance granularity for marker, transparency, clipping, overpaint, substance data to save memory."}),lod:_.Vec3(v(),void 0,{...e.CullingLodCategory,description:"Level of detail.",fieldLabels:{x:"Min Distance",y:"Max Distance",z:"Overlap (Shader)"}}),cellSize:_.Numeric(200,{min:0,max:5e3,step:100},{...e.CullingLodCategory,description:"Instance grid cell size."}),batchSize:_.Numeric(2e3,{min:0,max:5e4,step:500},{...e.CullingLodCategory,description:"Instance grid batch size."})};function t(a=mr.grey,s=1,l){l||(l=kN());let c=Tn(1,l.instanceCount.ref.value,1,()=>zu,!1,()=>!1),u={color:Tg({},{value:a,lightness:0,saturation:0}),size:MN({},{value:s})};return{transform:l,locationIterator:c,theme:u}}e.createSimple=t;function r(a,s){let l=Ag.getClip(a.clip);return{alpha:P.create(a.alpha),uAlpha:P.create(a.alpha),uVertexCount:P.create(s.vertexCount),uGroupCount:P.create(s.groupCount),drawCount:P.create(s.drawCount),uMetalness:P.create(a.material.metalness),uRoughness:P.create(a.material.roughness),uBumpiness:P.create(a.material.bumpiness),uEmissive:P.create(a.emissive),uDensity:P.create(a.density),dClipObjectCount:P.create(l.objects.count),dClipVariant:P.create(l.variant),uClipObjectType:P.create(l.objects.type),uClipObjectInvert:P.create(l.objects.invert),uClipObjectPosition:P.create(l.objects.position),uClipObjectRotation:P.create(l.objects.rotation),uClipObjectScale:P.create(l.objects.scale),uClipObjectTransform:P.create(l.objects.transform),instanceGranularity:P.create(a.instanceGranularity),uLod:P.create($t.create(a.lod[0],a.lod[1],a.lod[2],0))}}e.createValues=r;function n(a,s){P.updateIfChanged(a.alpha,s.alpha),P.updateIfChanged(a.uMetalness,s.material.metalness),P.updateIfChanged(a.uRoughness,s.material.roughness),P.updateIfChanged(a.uBumpiness,s.material.bumpiness),P.updateIfChanged(a.uEmissive,s.emissive),P.updateIfChanged(a.uDensity,s.density);let l=Ag.getClip(s.clip);P.updateIfChanged(a.dClipObjectCount,l.objects.count),P.updateIfChanged(a.dClipVariant,l.variant),P.update(a.uClipObjectType,l.objects.type),P.update(a.uClipObjectInvert,l.objects.invert),P.update(a.uClipObjectPosition,l.objects.position),P.update(a.uClipObjectRotation,l.objects.rotation),P.update(a.uClipObjectScale,l.objects.scale),P.update(a.uClipObjectTransform,l.objects.transform),P.updateIfChanged(a.instanceGranularity,s.instanceGranularity),P.update(a.uLod,$t.set(a.uLod.ref.value,s.lod[0],s.lod[1],s.lod[2],0))}e.updateValues=n;function o(a={}){let s=a.alpha===void 0?!0:a.alpha===1;return{disposed:!1,visible:!0,alphaFactor:1,pickable:!0,colorOnly:!1,opaque:s,writeDepth:s}}e.createRenderableState=o;function i(a,s){a.opaque=s.alpha*a.alphaFactor>=1,a.writeDepth=a.opaque}e.updateRenderableState=i})($e||($e={}))});var df,lM=M(()=>{Vt();(function(e){function t(s){let l=new DataView(s.buffer);return Object.assign(s.subarray(0),{readInt8:c=>l.getInt8(c),readUInt8:c=>l.getUint8(c),writeInt8:(c,u)=>l.setInt8(u,c),writeUInt8:(c,u)=>l.setUint8(u,c),readInt16LE:c=>l.getInt16(c,!0),readInt32LE:c=>l.getInt32(c,!0),readUInt16LE:c=>l.getUint16(c,!0),readUInt32LE:c=>l.getUint32(c,!0),readFloatLE:c=>l.getFloat32(c,!0),readDoubleLE:c=>l.getFloat64(c,!0),writeInt16LE:(c,u)=>l.setInt16(u,c,!0),writeInt32LE:(c,u)=>l.setInt32(u,c,!0),writeUInt16LE:(c,u)=>l.setUint16(u,c,!0),writeUInt32LE:(c,u)=>l.setUint32(u,c,!0),writeFloatLE:(c,u)=>l.setFloat32(u,c,!0),writeDoubleLE:(c,u)=>l.setFloat64(u,c,!0),readInt16BE:c=>l.getInt16(c,!1),readInt32BE:c=>l.getInt32(c,!1),readUInt16BE:c=>l.getUint16(c,!1),readUInt32BE:c=>l.getUint32(c,!1),readFloatBE:c=>l.getFloat32(c,!1),readDoubleBE:c=>l.getFloat64(c,!1),writeInt16BE:(c,u)=>l.setInt16(u,c,!1),writeInt32BE:(c,u)=>l.setInt32(u,c,!1),writeUInt16BE:(c,u)=>l.setUint16(u,c,!1),writeUInt32BE:(c,u)=>l.setUint32(u,c,!1),writeFloatBE:(c,u)=>l.setFloat32(u,c,!1),writeDoubleBE:(c,u)=>l.setFloat64(u,c,!1),copy:(c,u,d,f)=>(u=Ya(u,0),d=Ya(d,0),f=Ya(f,s.length),c.set(s.subarray(d,f),u),f-d)})}e.fromUint8Array=t;function r(s){return t(new Uint8Array(s))}e.fromArrayBuffer=r;function n(s){return s}e.fromBuffer=n,e.IsNativeEndianLittle=new Uint16Array(new Uint8Array([18,52]).buffer)[0]===13330;function o(s,l,c,u,d){for(let f=0,m=c;f<m;f+=u)for(let p=0;p<u;p++)l[d+f+u-p-1]=s[d+f+p]}e.flipByteOrder=o;function i(s,l=0,c){let u=new Int16Array(s,l,c);for(let d=0,f=u.length;d<f;++d){let m=u[d];u[d]=(m&255)<<8|m>>8&255}}e.flipByteOrderInPlace2=i;function a(s,l,c,u,d){e.IsNativeEndianLittle||!c||u<=1||o(s,l,c,u,d)}e.ensureLittleEndian=a})(df||(df={}))});var OA,bQ=M(()=>{Vt();lM();(function(e){function t(r,n){return{name:n,readBuffer:(o,i,a,s)=>{let l,c;if(typeof i=="number"){a=Ya(a,i);let u=o,d=Math.min(r.length,u+a);l=d-u,c=df.fromUint8Array(new Uint8Array(r.buffer,u,d-u))}else{a=Ya(a,i.length);let u=o,d=Math.min(r.length,u+a);i.set(r.subarray(u,d),s),l=d-u,c=i}return a!==l&&console.warn(`byteCount ${a} and bytesRead ${l} differ`),Promise.resolve({bytesRead:l,buffer:c})},writeBuffer:(o,i,a)=>(a=Ya(a,i.length),console.error(".writeBuffer not implemented for FileHandle.fromBuffer"),Promise.resolve(0)),writeBufferSync:(o,i,a)=>(a=Ya(a,i.length),console.error(".writeSync not implemented for FileHandle.fromBuffer"),0),close:zc}}e.fromBuffer=t})(OA||(OA={}))});function xQ(e){return e===Mc.Float32?4:e===Mc.Int16||e===Mc.Uint16?2:1}function $1t(e,t,r=0,n){return e===Mc.Float32?new Float32Array(t,r,n):e===Mc.Int16?new Int16Array(t,r,n):e===Mc.Uint16?new Uint16Array(t,r,n):new Int8Array(t,r,n)}function GAe(e,t){let r=xQ(t),n=new ArrayBuffer(r*e),o=df.fromArrayBuffer(n),i=df.IsNativeEndianLittle?n:new ArrayBuffer(r*e);return{type:t,elementByteSize:r,readBuffer:o,valuesBuffer:new Uint8Array(i),values:$1t(t,i)}}async function HAe(e,t,r,n,o,i){return await t.readBuffer(r,e.readBuffer,n,o),e.elementByteSize>1&&(i!==void 0&&i!==df.IsNativeEndianLittle||!df.IsNativeEndianLittle)&&df.flipByteOrder(e.readBuffer,e.valuesBuffer,n,e.elementByteSize,o),e.values}var Mc,SQ=M(()=>{lM();(function(e){e.Float32="float32",e.Int8="int8",e.Int16="int16",e.Uint16="uint16"})(Mc||(Mc={}))});async function Q1t(e){let{buffer:r}=await e.readBuffer(0,1024),n=String.fromCharCode(r.readUInt8(208),r.readUInt8(209),r.readUInt8(210),r.readUInt8(211));if(n!=="MAP ")throw new Error('ccp4 format error, missing "MAP " string');let o=[r.readUInt8(212),r.readUInt8(213)],i=!1;o[0]===68&&o[1]===65?i=!0:o[0]===17&&o[1]===17?i=!1:r.readInt32LE(12)<=16&&(i=!0);let a=i?c=>r.readInt32LE(c*4):c=>r.readInt32BE(c*4),s=i?c=>r.readFloatLE(c*4):c=>r.readFloatBE(c*4);return{header:{NC:a(0),NR:a(1),NS:a(2),MODE:a(3),NCSTART:a(4),NRSTART:a(5),NSSTART:a(6),NX:a(7),NY:a(8),NZ:a(9),xLength:s(10),yLength:s(11),zLength:s(12),alpha:s(13),beta:s(14),gamma:s(15),MAPC:a(16),MAPR:a(17),MAPS:a(18),AMIN:s(19),AMAX:s(20),AMEAN:s(21),ISPG:a(22),NSYMBT:a(23),LSKFLG:a(24),SKWMAT:[],SKWTRN:[],userFlag1:a(39),userFlag2:a(40),originX:s(49),originY:s(50),originZ:s(51),MAP:n,MACHST:o,ARMS:s(54)},littleEndian:i}}async function J1t(e,t,r,n,o,i){if(KAe(e)){let a=3*o;await r.readBuffer(n,t.readBuffer,o,a);let s=new Int8Array(t.valuesBuffer.buffer,a),l=(e.AMAX-e.AMIN)/255,c=.5*(e.AMIN+e.AMAX+l);for(let u=0,d=o;u<d;++u)t.values[u]=l*s[u]+c}else await HAe(t,r,n,o,0,i)}function WAe(e){switch(e){case 0:return Mc.Int8;case 1:return Mc.Int16;case 2:return Mc.Float32;case 3:throw new Error("mode 3 unsupported, complex 16-bit integers");case 4:throw new Error("mode 4 unsupported, complex 32-bit reals");case 6:Mc.Uint16;case 16:throw new Error("mode 16 unsupported, unsigned char * 3 (for rgb data, non-standard)")}throw new Error(`unknown mode '${e}'`)}function KAe(e){return e.userFlag1===-128&&e.userFlag2===127}function _Q(e){return KAe(e)?Mc.Float32:WAe(e.MODE)}function ext(e){return 256*4+e.NSYMBT}async function txt(e,t,r){await r.update({message:"Parsing CCP4/MRC/MAP file..."});let{header:n,littleEndian:o}=await Q1t(e),i=ext(n),a=WAe(n.MODE),s=_Q(n),l=n.NC*n.NR*n.NS,c=xQ(a),u=l*c,d=GAe(l,s);return J1t(n,d,e,i,u,o),{header:n,values:d.values,name:e.name}}function rxt(e,t){return Me.create("Parse CCP4/MRC/MAP",async r=>{try{return hn.success(await txt(e,t,r))}catch(n){return hn.error(n)}})}function YAe(e,t){return rxt(OA.fromBuffer(df.fromUint8Array(e),t),e.length)}var CQ=M(()=>{hr();qs();bQ();lM();SQ()});function oxt(e){return{xStart:parseInt(e.substr(10,5)),yStart:parseInt(e.substr(15,5)),zStart:parseInt(e.substr(20,5)),xExtent:parseInt(e.substr(32,5)),yExtent:parseInt(e.substr(38,5)),zExtent:parseInt(e.substr(42,5)),xRate:parseInt(e.substr(52,5)),yRate:parseInt(e.substr(58,5)),zRate:parseInt(e.substr(62,5)),xlen:parseFloat(e.substr(73,10)),ylen:parseFloat(e.substr(83,10)),zlen:parseFloat(e.substr(93,10)),alpha:parseFloat(e.substr(103,10)),beta:parseFloat(e.substr(113,10)),gamma:parseFloat(e.substr(123,10)),divisor:parseFloat(e.substr(138,12)),summand:parseInt(e.substr(155,8)),sigma:parseFloat(e.substr(170,12))}}function ixt(e,t){let r=t?o=>e.readInt16LE(o*2):o=>e.readInt16BE(o*2),n=1/r(17);return{xStart:r(0),yStart:r(1),zStart:r(2),xExtent:r(3),yExtent:r(4),zExtent:r(5),xRate:r(6),yRate:r(7),zRate:r(8),xlen:r(9)*n,ylen:r(10)*n,zlen:r(11)*n,alpha:r(12)*n,beta:r(13)*n,gamma:r(14)*n,divisor:r(15)/100,summand:r(16),sigma:void 0}}function XAe(e){let{xExtent:t,yExtent:r,zExtent:n}=e,o=Math.ceil(t/8),i=Math.ceil(r/8),a=Math.ceil(n/8);return{xBlocks:o,yBlocks:i,zBlocks:a}}async function axt(e){let{buffer:t}=await e.readBuffer(0,wQ),r=String.fromCharCode.apply(null,t),n=r.startsWith(":-)"),o=n||t.readInt16LE(36)===100;return{header:n?oxt(r):ixt(t,o),littleEndian:o}}async function sxt(e,t,r,n){n||df.flipByteOrderInPlace2(t.buffer);let{divisor:o,summand:i,xExtent:a,yExtent:s,zExtent:l}=e,{xBlocks:c,yBlocks:u,zBlocks:d}=XAe(e),f=0;for(let m=0;m<d;++m)for(let p=0;p<u;++p)for(let h=0;h<c;++h)for(let g=0;g<8;++g){let y=8*m+g;for(let b=0;b<8;++b){let x=8*p+b;for(let C=0;C<8;++C){let S=8*h+C;if(S<a&&x<s&&y<l){let w=(S*s+x)*l+y;r[w]=(t[f]-i)/o,++f}else{f+=8-C;break}}}}}function lxt(e){let{xExtent:t,yExtent:r,zExtent:n}=e,{xBlocks:o,yBlocks:i,zBlocks:a}=XAe(e),s=t*r*n,l=o*8*i*8*a*8,u=l*1;return{count:l,byteCount:u,valueCount:s}}async function cxt(e,t,r){await r.update({message:"Parsing DSN6/BRIX file..."});let{header:n,littleEndian:o}=await axt(e),{buffer:i}=await e.readBuffer(wQ,t-wQ),{valueCount:a}=lxt(n),s=new Float32Array(a);return await sxt(n,i,s,o),{header:n,values:s,name:e.name}}function uxt(e,t){return Me.create("Parse DSN6/BRIX",async r=>{try{return hn.success(await cxt(e,t,r))}catch(n){return hn.error(n)}})}function ZAe(e,t){return uxt(OA.fromBuffer(df.fromUint8Array(e),t),e.length)}var wQ,$Ae=M(()=>{hr();qs();bQ();lM();wQ=512});function ON(e){if(!mxt.has(e))throw new Error(`unknown ply type '${e}'`);return e}function QAe(e,t,r){let n=new Map;for(let o=0,i=t.length;o<i;++o)n.set(t[o],e[o]);return{comments:r,elementNames:t,getElement:o=>n.get(o)}}var fxt,mxt,JAe=M(()=>{fxt={char:1,uchar:1,short:2,ushort:2,int:4,uint:4,float:4,double:8,int8:1,uint8:1,int16:2,uint16:2,int32:4,uint32:4,float32:4,float64:8},mxt=new Set(Object.keys(fxt))});function pxt(e,t){let r=It(e);return{data:e,tokenizer:r,runtimeCtx:t,comments:[],elementSpecs:[],elements:[]}}function hxt(e){let t=e.data.indexOf("end_header",e.position);if(t===-1)throw new Error("no 'end_header' record found");e.tokenStart=e.position,e.tokenEnd=t,e.position=t,It.eatLine(e)}function gxt(e){let{tokenizer:t,comments:r,elementSpecs:n}=e;hxt(t);let o=It.getTokenString(t).split(/\r?\n/);if(o[0]!=="ply")throw new Error("data not starting with 'ply'");if(o[1]!=="format ascii 1.0")throw new Error("format not 'ascii 1.0'");let i,a,s;function l(){if(i!==void 0&&a!==void 0&&s!==void 0){let c=!1;for(let u=0,d=s.length;u<d;++u)if(s[u].kind==="list"){c=!0;break}c&&s.length,c?n.push({kind:"list",name:i,count:a,property:s[0]}):n.push({kind:"table",name:i,count:a,properties:s})}}for(let c=2,u=o.length;c<u;++c){let d=o[c],f=d.split(" ");if(d.startsWith("comment"))r.push(d.substr(8));else if(d.startsWith("element"))l(),s=[],i=f[1],a=parseInt(f[2]);else if(d.startsWith("property")){if(s===void 0)throw new Error("properties outside of element");f[1]==="list"?s.push({kind:"list",countType:ON(f[2]),dataType:ON(f[3]),name:f[4]}):s.push({kind:"column",type:ON(f[1]),name:f[2]})}else d.startsWith("end_header")?l():console.warn("unknown header line")}}function yxt(e){let{elementSpecs:t}=e;for(let r=0,n=t.length;r<n;++r){let o=t[r];o.kind==="table"?vxt(e,o):o.kind==="list"&&bxt(e,o)}}function ePe(e){switch(e){case"char":case"uchar":case"int8":case"uint8":case"short":case"ushort":case"int16":case"uint16":case"int":case"uint":case"int32":case"uint32":return G.Schema.int;case"float":case"double":case"float32":case"float64":return G.Schema.float}}function vxt(e,t){let{elements:r,tokenizer:n}=e,{count:o,properties:i}=t,a=i.length,s=[],l=[],c=[],u=new Map;for(let d=0,f=a;d<f;++d){let m=Ze.create(n.data,o*2);c.push(m)}for(let d=0,f=o;d<f;++d)for(let m=0,p=a;m<p;++m)It.skipWhitespace(n),It.markStart(n),It.eatValue(n),Ze.addUnchecked(c[m],n.tokenStart,n.tokenEnd);for(let d=0,f=a;d<f;++d){let{type:m,name:p}=i[d],h=A4(c[d],ePe(m));s.push(p),l.push(m),u.set(p,h)}r.push({kind:"table",rowCount:o,propertyNames:s,propertyTypes:l,getProperty:d=>u.get(d)})}function bxt(e,t){let{elements:r,tokenizer:n}=e,{count:o,property:i}=t,a=Ze.create(n.data,o*2*3),s=new Uint32Array(o+1),l=0;for(let d=0,f=o;d<f;++d){for(It.skipWhitespace(n),It.markStart(n);It.skipWhitespace(n)!==10;)++l,It.markStart(n),It.eatValue(n),Ze.addToken(a,n);s[d+1]=l}let c={entries:[],count:0},u=A4(a,ePe(i.dataType));r.push({kind:"list",rowCount:o,name:i.name,type:i.dataType,value:d=>{let f=s[d]+1,m=u.value(f-1);for(let p=f,h=f+m;p<h;++p)c.entries[p-f]=u.value(p);return c.count=m,c}})}async function xxt(e,t){let r=pxt(e,t);t.update({message:"Parsing...",current:0,max:e.length}),gxt(r),yxt(r);let{elements:n,elementSpecs:o,comments:i}=r,a=o.map(l=>l.name),s=QAe(n,a,i);return hn.success(s)}function tPe(e){return Me.create("Parse PLY",async t=>await xxt(e,t))}var rPe=M(()=>{qs();hr();JAe();ll();Tr();Bm()});function wxt(e,t){return{tokenizer:e,runtimeCtx:t}}async function Txt(e,t){let{tokenizer:r}=e,n=Ze.create(r.data,t*2),o=Ze.create(r.data,t*2),i=Ze.create(r.data,t*2),a=Ze.create(r.data,t*2),s=Ze.create(r.data,t*2),l=Ze.create(r.data,t*2),c=Ze.create(r.data,t*2),u=Ze.create(r.data,t*2),{position:d}=r,f=FN(r).trim();r.position=d;let m=f.split(LN).length===7,p=m?6:8,{length:h}=r,g=0;return await il(e.runtimeCtx,1e5,void 0,y=>{let b=Math.min(t-g,y);for(let x=0;x<b;++x){for(let C=0;C<p;++C)if(nPe(r),TQ(r),oPe(r),m)switch(C){case 0:Ze.addUnchecked(n,r.tokenStart,r.tokenEnd);break;case 1:Ze.addUnchecked(i,r.tokenStart,r.tokenEnd);break;case 2:Ze.addUnchecked(s,r.tokenStart,r.tokenEnd);break;case 3:Ze.addUnchecked(l,r.tokenStart,r.tokenEnd);break;case 4:Ze.addUnchecked(c,r.tokenStart,r.tokenEnd);break;case 5:Ze.addUnchecked(u,r.tokenStart,r.tokenEnd);break}else switch(C){case 0:Ze.addUnchecked(n,r.tokenStart,r.tokenEnd);break;case 1:Ze.addUnchecked(o,r.tokenStart,r.tokenEnd);break;case 2:Ze.addUnchecked(i,r.tokenStart,r.tokenEnd);break;case 3:Ze.addUnchecked(a,r.tokenStart,r.tokenEnd);break;case 4:Ze.addUnchecked(s,r.tokenStart,r.tokenEnd);break;case 5:Ze.addUnchecked(l,r.tokenStart,r.tokenEnd);break;case 6:Ze.addUnchecked(c,r.tokenStart,r.tokenEnd);break;case 7:Ze.addUnchecked(u,r.tokenStart,r.tokenEnd);break}_xt(r),TQ(r)}return g+=b,b},y=>y.update({message:"Parsing...",current:r.position,max:h})),{count:t,atomId:Qt(n)(G.Schema.int),segmentName:m?Qt(i)(G.Schema.str):Qt(o)(G.Schema.str),residueId:Qt(i)(G.Schema.int),residueName:m?Qt(i)(G.Schema.str):Qt(a)(G.Schema.str),atomName:Qt(s)(G.Schema.str),atomType:Qt(l)(G.Schema.str),charge:Qt(c)(G.Schema.float),mass:Qt(u)(G.Schema.float)}}async function Axt(e,t){let{tokenizer:r}=e,n=Ze.create(r.data,t*2),o=Ze.create(r.data,t*2),{length:i}=r,a=0;return await il(e.runtimeCtx,10,void 0,s=>{let l=Math.min(t-a,s);for(let c=0;c<l;++c)for(let u=0;u<2;++u)switch(nPe(r),TQ(r),oPe(r),u){case 0:Ze.addUnchecked(n,r.tokenStart,r.tokenEnd);break;case 1:Ze.addUnchecked(o,r.tokenStart,r.tokenEnd);break}return a+=l,l},s=>s.update({message:"Parsing...",current:r.position,max:i})),{count:t,atomIdA:Qt(n)(G.Schema.int),atomIdB:Qt(o)(G.Schema.int)}}function Pxt(e,t){let r=[];for(let n=0;n<t;++n){let o=FN(e.tokenizer);r.push(o.replace(Cxt,"").trim())}return r}async function Ixt(e,t){let r=It(e),n=wxt(r,t),o,i,a,s=FN(n.tokenizer).trim();for(;r.tokenEnd<r.length;){let c=FN(n.tokenizer).trim();if(c.includes("!NTITLE")){let u=parseInt(c.split(LN)[0]);o=Pxt(n,u)}else if(c.includes("!NATOM")){let u=parseInt(c.split(LN)[0]);i=await Txt(n,u)}else if(c.includes("!NBOND")){let u=parseInt(c.split(LN)[0]);a=await Axt(n,u);break}else c.includes("!NTHETA")||c.includes("!NPHI")||c.includes("!NIMPHI")||c.includes("!NDON")||c.includes("!NACC")||c.includes("!NNB")||c.includes("!NGRP NST2")||c.includes("!MOLNT")||c.includes("!NUMLP NUMLPH")||c.includes("!NCRTERM")}if(o===void 0&&(o=[]),i===void 0)return hn.error("no atoms data");if(a===void 0)return hn.error("no bonds data");let l={id:s,title:o,atoms:i,bonds:a};return hn.success(l)}function iPe(e){return Me.create("Parse PSF",async t=>await Ixt(e,t))}var FN,nPe,oPe,_xt,TQ,LN,Cxt,aPe=M(()=>{hr();ll();qs();Bm();Tr();({readLine:FN,skipWhitespace:nPe,eatValue:oPe,eatLine:_xt,markStart:TQ}=It),LN=/\s+/,Cxt=/(^\*|REMARK)*/});var ue,jt,_o=M(()=>{yn();(function(e){e.Create=Io.factory();function t(f){return!!f&&f.type.typeClass==="Representation3D"}e.isRepresentation3D=t;function r(f){return!!f&&f.type.typeClass==="Behavior"}e.isBehavior=r;function n(f){return e.Create({...f,typeClass:"Representation3D"})}e.CreateRepresentation3D=n;function o(f){return e.Create({...f,typeClass:"Behavior"})}e.CreateBehavior=o;class i extends e.Create({name:"Root",typeClass:"Root"}){}e.Root=i;class a extends e.Create({name:"Group",typeClass:"Group"}){}e.Group=a;let s;(function(f){class m extends e.Create({name:"String Data",typeClass:"Data"}){}f.String=m;class p extends e.Create({name:"Binary Data",typeClass:"Data"}){}f.Binary=p;class h extends e.Create({name:"Data Blob",typeClass:"Data"}){}f.Blob=h})(s=e.Data||(e.Data={}));let l;(function(f){class m extends e.Create({name:"JSON Data",typeClass:"Data"}){}f.Json=m;class p extends e.Create({name:"CIF File",typeClass:"Data"}){}f.Cif=p;class h extends e.Create({name:"Cube File",typeClass:"Data"}){}f.Cube=h;class g extends e.Create({name:"PSF File",typeClass:"Data"}){}f.Psf=g;class y extends e.Create({name:"PRMTOP File",typeClass:"Data"}){}f.Prmtop=y;class b extends e.Create({name:"TOP File",typeClass:"Data"}){}f.Top=b;class x extends e.Create({name:"PLY File",typeClass:"Data"}){}f.Ply=x;class C extends e.Create({name:"CCP4/MRC/MAP File",typeClass:"Data"}){}f.Ccp4=C;class S extends e.Create({name:"DSN6/BRIX File",typeClass:"Data"}){}f.Dsn6=S;class w extends e.Create({name:"DX File",typeClass:"Data"}){}f.Dx=w;class A extends e.Create({name:"Format Blob",typeClass:"Data"}){}f.Blob=A})(l=e.Format||(e.Format={}));let c;(function(f){class m extends e.Create({name:"Coordinates",typeClass:"Object"}){}f.Coordinates=m;class p extends e.Create({name:"Topology",typeClass:"Object"}){}f.Topology=p;class h extends e.Create({name:"Model",typeClass:"Object"}){}f.Model=h;class g extends e.Create({name:"Trajectory",typeClass:"Object"}){}f.Trajectory=g;class y extends e.Create({name:"Structure",typeClass:"Object"}){}f.Structure=y,(function(b){class x extends n({name:"Structure 3D"}){}b.Representation3D=x;class C extends e.Create({name:"Structure 3D State",typeClass:"Object"}){}b.Representation3DState=C;class S extends e.Create({name:"Selections",typeClass:"Object"}){}b.Selections=S})(y=f.Structure||(f.Structure={}))})(c=e.Molecule||(e.Molecule={}));let u;(function(f){class m extends e.Create({name:"Volume",typeClass:"Object"}){}f.Data=m;class p extends e.Create({name:"Lazy Volume",typeClass:"Object"}){}f.Lazy=p;class h extends n({name:"Volume 3D"}){}f.Representation3D=h})(u=e.Volume||(e.Volume={}));let d;(function(f){class m extends e.Create({name:"Shape Provider",typeClass:"Object"}){}f.Provider=m;class p extends n({name:"Shape 3D"}){}f.Representation3D=p})(d=e.Shape||(e.Shape={}))})(ue||(ue={}));(function(e){e.CreateBuiltIn=ct.factory("ms-plugin"),e.BuiltIn=ct.builderFactory("ms-plugin")})(jt||(jt={}))});function Ext(e){let t=It.readLines(e,6),r=(b,x)=>{let C=+t[b].trim().split(/\s+/g)[x];return Number.isNaN(C)?0:C},n=b=>{let x=r(b+2,0),C=sPe;return[Math.abs(x),v.create(r(b+2,1)*C,r(b+2,2)*C,r(b+2,3)*C),x]},o=t[0].trim(),i=t[1].trim(),[a,s,l]=n(0),[c,u]=n(1),[d,f]=n(2),[m,p]=n(3),h=Dxt(e,a,sPe),g=[];if(l>=0){let b=r(2,4);b===0&&(b=1);for(let x=0;x<b;x++)g.push(x)}else{let b=It.readLine(e).trim().split(/\s+/g);for(let x=0,C=+b[0];x<C;x++)g.push(+b[x+1])}return{header:{orbitals:l<0,comment1:o,comment2:i,atomCount:a,origin:s,dim:v.create(c,d,m),basisX:u,basisY:f,basisZ:p,dataSetIds:g},atoms:h}}function Dxt(e,t,r){let n=new Int32Array(t),o=new Float64Array(t),i=new Float32Array(t),a=new Float32Array(t),s=new Float32Array(t);for(let l=0;l<t;l++){let c=It.readLine(e).trim().split(/\s+/g);n[l]=+c[0],o[l]=+c[1],i[l]=+c[2]*r,a[l]=+c[3]*r,s[l]=+c[4]*r}return{count:t,number:G.ofArray({array:n,schema:G.Schema.int}),nuclearCharge:G.ofArray({array:o,schema:G.Schema.float}),x:G.ofArray({array:i,schema:G.Schema.float}),y:G.ofArray({array:a,schema:G.Schema.float}),z:G.ofArray({array:s,schema:G.Schema.float})}}function kxt(e,t,r){let n=r.dim[0]*r.dim[1]*r.dim[2]*r.dataSetIds.length,o=1e4*100,i=new Float64Array(n),a=0;return il(e,o,i,(s,l)=>{let c=Math.min(n,a+s);for(let u=a;u<c;u++)It.skipWhitespace(t),t.tokenStart=t.position,It.eatValue(t),l[u]=Hd(t.data,t.tokenStart,t.tokenEnd);return a=c,c===n?0:o},(s,l,c)=>s.update({current:Math.min(c,n),max:n}))}function lPe(e,t){return Me.create("Parse Cube",async r=>{await r.update("Reading header...");let n=It(e),{header:o,atoms:i}=Ext(n),a=await kxt(r,n,o);return hn.success({header:o,atoms:i,values:a,name:t})})}var sPe,cPe=M(()=>{Ge();ll();Tr();hr();qs();Kv();sPe=.529177210859});function uPe(e){let t={h:v()},r=0,n=0,o=/\s+/g;for(;;){let i=It.readLine(e),a;if(i.startsWith("object 1"))a=i.split(o),t.dim=v.create(parseInt(a[5]),parseInt(a[6]),parseInt(a[7]));else if(i.startsWith("origin"))a=i.split(o),t.min=v.create(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]));else if(i.startsWith("delta"))a=i.split(o),n===0?t.h[0]=parseFloat(a[1]):n===1?t.h[1]=parseFloat(a[2]):n===2&&(t.h[2]=parseFloat(a[3])),n+=1;else if(i.startsWith("object 3")){r+=i.length+1;break}r+=i.length+1}return{header:t,headerByteCount:r}}function Mxt(e,t,r){let n=r.dim[0]*r.dim[1]*r.dim[2],o=1e4*100,i=new Float64Array(n),a=0;return il(e,o,i,(s,l)=>{let c=Math.min(n,a+s);for(let u=a;u<c;u++)It.skipWhitespace(t),t.tokenStart=t.position,It.eatValue(t),l[u]=Hd(t.data,t.tokenStart,t.tokenEnd);return a=c,c===n?0:o},(s,l,c)=>s.update({current:Math.min(c,n),max:n}))}async function Bxt(e,t,r){await e.update("Reading header...");let n=It(t),{header:o}=uPe(n);await e.update("Reading values...");let i=await Mxt(e,n,o);return hn.success({header:o,values:i,name:r})}async function Rxt(e,t,r){await e.update("Reading header...");let n=B0(t,0,1e3),o=It(n),{header:i,headerByteCount:a}=uPe(o);await e.update("Reading values...");let s=i.dim[0]*i.dim[1]*i.dim[2],l=new DataView(t.buffer,t.byteOffset+a),c=new Float64Array(s);for(let u=0;u<s;u++)c[u]=l.getFloat64(u*8,!0);return hn.success({header:i,values:c,name:r})}function dPe(e,t){return Me.create("Parse DX",r=>ex.is(e)?Bxt(r,e,t):Rxt(r,e,t))}var fPe=M(()=>{Ge();hr();_T();tx();Kv();ll();qs()});function Fxt(e,t){return{tokenizer:e,runtimeCtx:t}}function Nxt(e){let{tokenizer:t}=e,r=[];for(;t.tokenEnd<t.length&&t.data.charAt(t.position)!=="%";){let n=cM(t).trim();n&&r.push(n)}return r}function Uxt(e){let{tokenizer:t}=e,r=Object.create(null);mPe.forEach(o=>{r[o]=0});let n=0;for(;t.tokenEnd<t.length&&t.data.charAt(t.position)!=="%";){let o=cM(t),i=Math.min(n+10,32);for(let a=0;n<i;++a,++n)r[mPe[n]]=parseInt(o.substring(a*8,a*8+8).trim())}return r}function Kx(e,t,r,n){let{tokenizer:o}=e,i=Ze.create(o.data,t*2),a=0;for(;o.tokenEnd<o.length&&o.data.charAt(o.position)!=="%";){o.tokenStart=o.position;let s=Math.min(a+r,t);for(let l=0;a<s;++l,++a){let c=o.position;Lxt(o,o.position,o.position+n),Ze.addUnchecked(i,o.tokenStart,o.tokenEnd),o.position=c+n}pPe(o)}return i}async function Vxt(e,t){let r=It(e),n=Fxt(r,t),o=Object.create(null),i=0;for(;r.tokenEnd<r.length;){r.position-i>1e5&&t.shouldUpdate&&(i=r.position,await t.update({current:r.position,max:r.length}));let a=cM(n.tokenizer).trim();if(a.startsWith("%VERSION"))o.version=a.substring(8).trim();else if(a.startsWith("%FLAG")){let s=a.substring(5).trim(),l=cM(n.tokenizer).trim();for(;l.startsWith("%COMMENT");)l=cM(n.tokenizer).trim();if(!l.startsWith("%FORMAT"))throw new Error(`expected %FORMAT got "${l}"`);if(s==="TITLE"||s==="CTITLE")o.title=Nxt(n);else if(s==="POINTERS")o.pointers=Uxt(n);else if(s==="ATOM_NAME"){let c=Kx(n,o.pointers.NATOM,20,4);o.atomName=Qt(c)(G.Schema.str)}else if(s==="CHARGE"){let c=Kx(n,o.pointers.NATOM,5,16);o.charge=Qt(c)(G.Schema.float)}else if(s==="MASS"){let c=Kx(n,o.pointers.NATOM,5,16);o.mass=Qt(c)(G.Schema.float)}else if(s==="RESIDUE_LABEL"){let c=Kx(n,o.pointers.NRES,20,4);o.residueLabel=Qt(c)(G.Schema.str)}else if(s==="RESIDUE_POINTER"){let c=Kx(n,o.pointers.NRES,10,8);o.residuePointer=Qt(c)(G.Schema.int)}else if(s==="BONDS_INC_HYDROGEN"){let c=Kx(n,o.pointers.NBONH*3,10,8);o.bondsIncHydrogen=Qt(c)(G.Schema.int)}else if(s==="BONDS_WITHOUT_HYDROGEN"){let c=Kx(n,o.pointers.NBONA*3,10,8);o.bondsWithoutHydrogen=Qt(c)(G.Schema.int)}else if(s==="RADII"){let c=Kx(n,o.pointers.NATOM,5,16);o.radii=Qt(c)(G.Schema.float)}else for(;r.tokenEnd<r.length&&r.data.charAt(r.position)!=="%";)pPe(r)}}return hn.success(o)}function hPe(e){return Me.create("Parse PRMTOP",async t=>await Vxt(e,t))}var Oxt,mPe,cM,pPe,Lxt,gPe=M(()=>{hr();ll();qs();Bm();Tr();Oxt={NATOM:"",NTYPES:"",NBONH:"",MBONA:"",NTHETH:"",MTHETA:"",NPHIH:"",MPHIA:"",NHPARM:"",NPARM:"",NNB:"",NRES:"",NBONA:"",NTHETA:"",NPHIA:"",NUMBND:"",NUMANG:"",NPTRA:"",NATYP:"",NPHB:"",IFPERT:"",NBPER:"",NGPER:"",NDPER:"",MBPER:"",MGPER:"",MDPER:"",IFBOX:"",NMXRS:"",IFCAP:"",NUMEXTRA:"",NCOPY:""},mPe=Object.keys(Oxt),{readLine:cM,markLine:pPe,trim:Lxt}=It});function Hxt(e,t){return{tokenizer:e,runtimeCtx:t}}function Yxt(e){let{tokenizer:t}=e,r;for(;t.tokenEnd<t.length;){Xx(t);let n=t.data.charAt(t.position);if(n==="[")break;if(n===";"||n==="*"){Yx(t);continue}if(r!==void 0)throw new Error("more than one molName");r=AQ(t).split(Kxt)[0]}if(r===void 0)throw new Error("missing molName");return r}function Xxt(e){let{tokenizer:t}=e,r=Ze.create(t.data,64),n=Ze.create(t.data,64),o=Ze.create(t.data,64),i=Ze.create(t.data,64),a=Ze.create(t.data,64),s=Ze.create(t.data,64),l=Ze.create(t.data,64),c=Ze.create(t.data,64);for(;t.tokenEnd<t.length;){Xx(t);let u=t.data.charAt(t.position);if(u==="[")break;if(u===";"||u==="*"){Yx(t);continue}for(let d=0;d<8;++d)switch(Xx(t),NN(t),PQ(t),d){case 0:Ze.add(r,t.tokenStart,t.tokenEnd);break;case 1:Ze.add(n,t.tokenStart,t.tokenEnd);break;case 2:Ze.add(o,t.tokenStart,t.tokenEnd);break;case 3:Ze.add(i,t.tokenStart,t.tokenEnd);break;case 4:Ze.add(a,t.tokenStart,t.tokenEnd);break;case 5:Ze.add(s,t.tokenStart,t.tokenEnd);break;case 6:Ze.add(l,t.tokenStart,t.tokenEnd);break;case 7:Ze.add(c,t.tokenStart,t.tokenEnd);break}Yx(t)}return Or.ofColumns(zxt,{nr:Qt(r)(G.Schema.int),type:Qt(n)(G.Schema.str),resnr:Qt(o)(G.Schema.int),residu:Qt(i)(G.Schema.str),atom:Qt(a)(G.Schema.str),cgnr:Qt(s)(G.Schema.int),charge:Qt(l)(G.Schema.float),mass:Qt(c)(G.Schema.float)})}function Zxt(e){let{tokenizer:t}=e,r=Ze.create(t.data,64),n=Ze.create(t.data,64);for(;t.tokenEnd<t.length;){Xx(t);let o=t.data.charAt(t.position);if(o==="[")break;if(o===";"||o==="*"){Yx(t);continue}for(let i=0;i<2;++i)switch(Xx(t),NN(t),PQ(t),i){case 0:Ze.add(r,t.tokenStart,t.tokenEnd);break;case 1:Ze.add(n,t.tokenStart,t.tokenEnd);break}Yx(t)}return Or.ofColumns(qxt,{ai:Qt(r)(G.Schema.int),aj:Qt(n)(G.Schema.int)})}function $xt(e){let{tokenizer:t}=e,r;for(;t.tokenEnd<t.length;){Xx(t);let n=t.data.charAt(t.position);if(n==="[")break;if(n===";"||n==="*"){Yx(t);continue}if(r!==void 0)throw new Error("more than one system");r=AQ(t).trim()}if(r===void 0)throw new Error("missing system");return r}function Qxt(e){let{tokenizer:t}=e,r=Ze.create(t.data,64),n=Ze.create(t.data,64);for(;t.tokenEnd<t.length&&(Xx(t),!(t.position>=t.length));){let o=t.data.charAt(t.position);if(o==="[")break;if(o===";"||o==="*"){Yx(t);continue}for(let i=0;i<2;++i)switch(Xx(t),NN(t),PQ(t),i){case 0:Ze.add(r,t.tokenStart,t.tokenEnd);break;case 1:Ze.add(n,t.tokenStart,t.tokenEnd);break}Gxt(t),NN(t)}return Or.ofColumns(jxt,{compound:Qt(r)(G.Schema.str),molCount:Qt(n)(G.Schema.int)})}async function Jxt(e,t){let r=It(e),n=Hxt(r,t),o=Object.create(null),i=0;o.compounds={};let a={},s="";function l(){s&&a.atoms&&(o.compounds[s]=a,a={},s="")}for(;r.tokenEnd<r.length;){r.position-i>1e5&&t.shouldUpdate&&(i=r.position,await t.update({current:r.position,max:r.length}));let c=AQ(n.tokenizer).trim();if(!(!c||c[0]==="*"||c[0]===";")){if(c.startsWith("#include"))throw new Error("#include statements not allowed");if(c.startsWith("[")){let u=c.match(Wxt);if(u===null)throw new Error("expected field name");let d=u[1];if(d==="moleculetype")l(),s=Yxt(n);else if(d==="atoms")a.atoms=Xxt(n);else if(d==="bonds")a.bonds=Zxt(n);else if(d==="system")o.system=$xt(n);else if(d==="molecules")l(),o.molecules=Qxt(n);else for(;r.tokenEnd<r.length&&r.data.charAt(r.position)!=="[";)Yx(r)}}}return hn.success(o)}function yPe(e){return Me.create("Parse TOP",async t=>await Jxt(e,t))}var zxt,qxt,jxt,AQ,Yx,Xx,NN,PQ,Gxt,Wxt,Kxt,vPe=M(()=>{hr();ll();qs();Bm();Tr();zxt={nr:G.Schema.Int(),type:G.Schema.Str(),resnr:G.Schema.Int(),residu:G.Schema.Str(),atom:G.Schema.Str(),cgnr:G.Schema.Int(),charge:G.Schema.Float(),mass:G.Schema.Float()},qxt={ai:G.Schema.Int(),aj:G.Schema.Int()},jxt={compound:G.Schema.Str(),molCount:G.Schema.Int()},{readLine:AQ,markLine:Yx,skipWhitespace:Xx,markStart:NN,eatValue:PQ,eatLine:Gxt}=It;Wxt=/\[ (.+) \]/,Kxt=/\s+/});var MQ={};ci(MQ,{DeflateData:()=>eSt,Download:()=>IQ,DownloadBlob:()=>EQ,ImportJson:()=>fSt,ImportString:()=>dSt,LazyVolume:()=>pSt,ParseBlob:()=>tSt,ParseCcp4:()=>lSt,ParseCif:()=>rSt,ParseCube:()=>nSt,ParseDsn6:()=>cSt,ParseDx:()=>uSt,ParseJson:()=>mSt,ParsePly:()=>sSt,ParsePrmtop:()=>iSt,ParsePsf:()=>oSt,ParseTop:()=>aSt,RawData:()=>DQ,ReadFile:()=>kQ});var IQ,EQ,eSt,DQ,kQ,tSt,rSt,nSt,oSt,iSt,aSt,sSt,lSt,cSt,uSt,dSt,fSt,mSt,pSt,BQ=M(()=>{CQ();Um();$Ae();rPe();aPe();yn();hr();OD();Ue();_o();Lm();cPe();fPe();ya();Oo();gPe();vPe();E2();_T();tx();IQ=jt.BuiltIn({name:"download",display:{name:"Download",description:"Download string or binary data from the specified URL"},from:[ue.Root],to:[ue.Data.String,ue.Data.Binary],params:{url:_.Url("https://www.ebi.ac.uk/pdbe/static/entry/1cbs_updated.cif",{description:"Resource URL. Must be the same domain or support CORS."}),label:_.Optional(_.Text("")),isBinary:_.Optional(_.Boolean(!1,{description:"If true, download data as binary (string otherwise)"}))}})({apply({params:e,cache:t},r){return Me.create("Download",async n=>{let o=Un.getUrlAsset(r.managers.asset,e.url),i=await r.managers.asset.resolve(o,e.isBinary?"binary":"string").runInContext(n);return t.asset=i,e.isBinary?new ue.Data.Binary(i.data,{label:e.label?e.label:o.url}):new ue.Data.String(i.data,{label:e.label?e.label:o.url})})},dispose({cache:e}){var t;(t=e?.asset)===null||t===void 0||t.dispose()},update({oldParams:e,newParams:t,b:r}){return e.url!==t.url||e.isBinary!==t.isBinary?ct.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||(typeof t.url=="string"?t.url:t.url.url),ct.UpdateResult.Updated):ct.UpdateResult.Unchanged}}),EQ=jt.BuiltIn({name:"download-blob",display:{name:"Download Blob",description:"Download multiple string or binary data from the specified URLs."},from:ue.Root,to:ue.Data.Blob,params:{sources:_.ObjectList({id:_.Text("",{label:"Unique ID"}),url:_.Url("https://www.ebi.ac.uk/pdbe/static/entry/1cbs_updated.cif",{description:"Resource URL. Must be the same domain or support CORS."}),isBinary:_.Optional(_.Boolean(!1,{description:"If true, download data as binary (string otherwise)"})),canFail:_.Optional(_.Boolean(!1,{description:"Indicate whether the download can fail and not be included in the blob as a result."}))},e=>`${e.id}: ${e.url}`),maxConcurrency:_.Optional(_.Numeric(4,{min:1,max:12,step:1},{description:"The maximum number of concurrent downloads."}))}})({apply({params:e,cache:t},r){return Me.create("Download Blob",async n=>{let o=[],i=await X0e(n,r.managers.asset,e.sources,e.maxConcurrency||4),a=[];for(let s=0;s<i.length;s++){let l=i[s],c=e.sources[s];l.kind==="error"?r.log.warn(`Download ${l.id} (${c.url}) failed: ${l.error}`):(a.push(l.result),o.push(c.isBinary?{id:l.id,kind:"binary",data:l.result.data}:{id:l.id,kind:"string",data:l.result.data}))}return t.assets=a,new ue.Data.Blob(o,{label:"Data Blob",description:`${o.length} ${o.length===1?"entry":"entries"}`})})},dispose({cache:e},t){let r=e?.assets;if(r)for(let n of r)n.dispose()}}),eSt=jt.BuiltIn({name:"defalate-data",display:{name:"Deflate",description:"Deflate compressed data"},params:{method:_.Select("gzip",[["gzip","gzip"]]),isString:_.Boolean(!1),stringEncoding:_.Optional(_.Select("utf-8",[["utf-8","UTF8"]])),label:_.Optional(_.Text(""))},from:[ue.Data.Binary],to:[ue.Data.Binary,ue.Data.String]})({apply({a:e,params:t},r){return Me.create("Gzip",async n=>{let o=await CL(n,e.data),i=t.label?t.label:e.label;if(t.isString){let a=X4(o);return new ue.Data.String(a,{label:i})}return new ue.Data.Binary(o,{label:i})})}}),DQ=jt.BuiltIn({name:"raw-data",display:{name:"Raw Data",description:"Raw data supplied by value."},from:[ue.Root],to:[ue.Data.String,ue.Data.Binary],params:{data:_.Value("",{isHidden:!0}),label:_.Optional(_.Text(""))}})({apply({params:e}){return Me.create("Raw Data",async()=>{if(typeof e.data=="string")return new ue.Data.String(e.data,{label:e.label?e.label:"String"});if(Array.isArray(e.data))return new ue.Data.Binary(new Uint8Array(e.data),{label:e.label?e.label:"Binary"});if(e.data instanceof ArrayBuffer)return new ue.Data.Binary(new Uint8Array(e.data),{label:e.label?e.label:"Binary"});if(e.data instanceof Uint8Array)return new ue.Data.Binary(e.data,{label:e.label?e.label:"Binary"});Er(e.data)})},update({oldParams:e,newParams:t,b:r}){return e.data!==t.data?ct.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||r.label,ct.UpdateResult.Updated):ct.UpdateResult.Unchanged},customSerialization:{toJSON(e){if(typeof e.data=="string"||Array.isArray(e.data))return e;if(e.data instanceof ArrayBuffer){let t=new Uint8Array(e.data),r=new Array(t.length);for(let n=0,o=t.length;n<o;n++)r[n]=t[n];return{data:r,label:e.label}}else if(e.data instanceof Uint8Array){let t=new Array(e.data.length);for(let r=0,n=e.data.length;r<n;r++)t[r]=e.data[r];return{data:t,label:e.label}}},fromJSON(e){return e}}}),kQ=jt.BuiltIn({name:"read-file",display:{name:"Read File",description:"Read string or binary data from the specified file"},from:ue.Root,to:[ue.Data.String,ue.Data.Binary],params:{file:_.File(),label:_.Optional(_.Text("")),isBinary:_.Optional(_.Boolean(!1,{description:"If true, open file as as binary (string otherwise)"}))}})({apply({params:e,cache:t},r){return Me.create("Open File",async n=>{if(e.file===null)return r.log.error("No file(s) selected"),Io.Null;let o=await r.managers.asset.resolve(e.file,e.isBinary?"binary":"string").runInContext(n);return t.asset=o,e.isBinary?new ue.Data.Binary(o.data,{label:e.label?e.label:e.file.name}):new ue.Data.String(o.data,{label:e.label?e.label:e.file.name})})},dispose({cache:e}){var t;(t=e?.asset)===null||t===void 0||t.dispose()},update({oldParams:e,newParams:t,b:r}){var n;return e.label!==t.label?(r.label=t.label||((n=e.file)===null||n===void 0?void 0:n.name)||"",ct.UpdateResult.Updated):ct.UpdateResult.Unchanged},isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user loaded files."})}),tSt=jt.BuiltIn({name:"parse-blob",display:{name:"Parse Blob",description:"Parse multiple data enties"},from:ue.Data.Blob,to:ue.Format.Blob,params:{formats:_.ObjectList({id:_.Text("",{label:"Unique ID"}),format:_.Select("cif",[["cif","cif"]])},e=>`${e.id}: ${e.format}`)}})({apply({a:e,params:t},r){return Me.create("Parse Blob",async n=>{let o=new Map;for(let a of t.formats)o.set(a.id,a.format);let i=[];for(let a of e.data){if(!o.has(a.id))continue;let s=await(a.kind==="string"?Qd.parse(a.data):Qd.parseBinary(a.data)).runInContext(n);if(s.isError)throw new Error(`${a.id}: ${s.message}`);i.push({id:a.id,kind:"cif",data:s.result})}return new ue.Format.Blob(i,{label:"Format Blob",description:`${i.length} ${i.length===1?"entry":"entries"}`})})}}),rSt=jt.BuiltIn({name:"parse-cif",display:{name:"Parse CIF",description:"Parse CIF from String or Binary data"},from:[ue.Data.String,ue.Data.Binary],to:ue.Format.Cif})({apply({a:e}){return Me.create("Parse CIF",async t=>{let r=await Qd.parse(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return r.result.blocks.length===0?Io.Null:new ue.Format.Cif(r.result)})}}),nSt=jt.BuiltIn({name:"parse-cube",display:{name:"Parse Cube",description:"Parse Cube from String data"},from:ue.Data.String,to:ue.Format.Cube})({apply({a:e}){return Me.create("Parse Cube",async t=>{let r=await lPe(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Cube(r.result)})}}),oSt=jt.BuiltIn({name:"parse-psf",display:{name:"Parse PSF",description:"Parse PSF from String data"},from:[ue.Data.String],to:ue.Format.Psf})({apply({a:e}){return Me.create("Parse PSF",async t=>{let r=await iPe(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Psf(r.result)})}}),iSt=jt.BuiltIn({name:"parse-prmtop",display:{name:"Parse PRMTOP",description:"Parse PRMTOP from String data"},from:[ue.Data.String],to:ue.Format.Prmtop})({apply({a:e}){return Me.create("Parse PRMTOP",async t=>{let r=await hPe(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Prmtop(r.result)})}}),aSt=jt.BuiltIn({name:"parse-top",display:{name:"Parse TOP",description:"Parse TOP from String data"},from:[ue.Data.String],to:ue.Format.Top})({apply({a:e}){return Me.create("Parse TOP",async t=>{let r=await yPe(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Top(r.result)})}}),sSt=jt.BuiltIn({name:"parse-ply",display:{name:"Parse PLY",description:"Parse PLY from String data"},from:[ue.Data.String],to:ue.Format.Ply})({apply({a:e}){return Me.create("Parse PLY",async t=>{let r=await tPe(e.data).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Ply(r.result,{label:r.result.comments[0]||"PLY Data"})})}}),lSt=jt.BuiltIn({name:"parse-ccp4",display:{name:"Parse CCP4/MRC/MAP",description:"Parse CCP4/MRC/MAP from Binary data"},from:[ue.Data.Binary],to:ue.Format.Ccp4})({apply({a:e}){return Me.create("Parse CCP4/MRC/MAP",async t=>{let r=await YAe(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Ccp4(r.result)})}}),cSt=jt.BuiltIn({name:"parse-dsn6",display:{name:"Parse DSN6/BRIX",description:"Parse CCP4/BRIX from Binary data"},from:[ue.Data.Binary],to:ue.Format.Dsn6})({apply({a:e}){return Me.create("Parse DSN6/BRIX",async t=>{let r=await ZAe(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Dsn6(r.result)})}}),uSt=jt.BuiltIn({name:"parse-dx",display:{name:"Parse DX",description:"Parse DX from Binary/String data"},from:[ue.Data.Binary,ue.Data.String],to:ue.Format.Dx})({apply({a:e}){return Me.create("Parse DX",async t=>{let r=await dPe(e.data,e.label).runInContext(t);if(r.isError)throw new Error(r.message);return new ue.Format.Dx(r.result)})}}),dSt=jt.BuiltIn({name:"import-string",display:{name:"Import String",description:"Import given data as a string"},from:ue.Root,to:ue.Data.String,params:{data:_.Value(""),label:_.Optional(_.Text(""))}})({apply({params:{data:e,label:t}}){return new ue.Data.String(e,{label:t||""})},update({oldParams:e,newParams:t,b:r}){return e.data!==t.data?ct.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||"",ct.UpdateResult.Updated):ct.UpdateResult.Unchanged},isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user imported strings."})}),fSt=jt.BuiltIn({name:"import-json",display:{name:"Import JSON",description:"Import given data as a JSON"},from:ue.Root,to:ue.Format.Json,params:{data:_.Value({}),label:_.Optional(_.Text(""))}})({apply({params:{data:e,label:t}}){return new ue.Format.Json(e,{label:t||""})},update({oldParams:e,newParams:t,b:r}){return e.data!==t.data?ct.UpdateResult.Recreate:e.label!==t.label?(r.label=t.label||"",ct.UpdateResult.Updated):ct.UpdateResult.Unchanged},isSerializable:()=>({isSerializable:!1,reason:"Cannot serialize user imported JSON."})}),mSt=jt.BuiltIn({name:"parse-json",display:{name:"Parse JSON",description:"Parse JSON from String data"},from:[ue.Data.String],to:ue.Format.Json})({apply({a:e}){return Me.create("Parse JSON",async t=>{let r=await new Response(ex.toString(e.data)).json();return new ue.Format.Json(r)})}}),pSt=jt.BuiltIn({name:"lazy-volume",display:{name:"Lazy Volume",description:"A placeholder for lazy loaded volume representation"},from:ue.Root,to:ue.Volume.Lazy,params:{url:_.Url(""),isBinary:_.Boolean(!1),format:_.Text("ccp4"),entryId:_.Value("",{isHidden:!0}),isovalues:_.ObjectList({type:_.Text("relative"),value:_.Numeric(0),color:_.Color(mr.black),alpha:_.Numeric(1,{min:0,max:1,step:.01}),volumeIndex:_.Numeric(0)},e=>`${e.type} ${e.value}`)}})({apply({a:e,params:t}){return Me.create("Lazy Volume",async r=>{let n=Array.isArray(t.entryId)?t.entryId.join(", "):t.entryId;return new ue.Volume.Lazy(t,{label:`${n||t.url}`,description:"Lazy Volume"})})}})});var RQ={};ci(RQ,{CreateGroup:()=>hSt});var hSt,bPe=M(()=>{yn();Vt();Ue();_o();hSt=jt.BuiltIn({name:"create-group",display:{name:"Group"},from:[],to:ue.Group,params:{label:_.Text("Group"),description:_.Optional(_.Text(""))}})({apply({params:e}){return new ue.Group({},e)},update({oldParams:e,newParams:t,b:r}){return T0(e,t)?ct.UpdateResult.Unchanged:(r.label=t.label,r.description=t.description,ct.UpdateResult.Updated)}})});function gSt(e){let t=new DataView(e.buffer),r=Object.create(null),n=[],o=0,i=new Int32Array(e.buffer,0,23),a=i[0]!==t.getInt32(0);if(i[0]!==84){let h=e.byteLength;for(let g=0;g<h;g+=4)t.setFloat32(g,t.getFloat32(g),!0)}if(i[0]!==84)throw new Error("dcd bad format, header block start");if(String.fromCharCode(t.getUint8(4),t.getUint8(5),t.getUint8(6),t.getUint8(7))!=="CORD")throw new Error("dcd bad format, format string");let l=!1,c=!1,u=!1;if(i[22]!==0&&(l=!0,i[12]!==0&&(c=!0),i[13]===1&&(u=!0)),r.NSET=i[2],r.ISTART=i[3],r.NSAVC=i[4],r.NAMNF=i[10],l?r.DELTA=t.getFloat32(44,a):r.DELTA=t.getFloat64(44,a),i[22]!==84)throw new Error("dcd bad format, header block end");o=o+84+8;let d=t.getInt32(o,a),f=o+1;if((d-4)%80!==0)throw new Error("dcd bad format, title block start");if(r.TITLE=nge(e.subarray(f,d)),t.getInt32(f+d+4-1,a)!==d)throw new Error("dcd bad format, title block end");if(o=o+d+8,t.getInt32(o,a)!==4)throw new Error("dcd bad format, natom block start");if(r.NATOM=t.getInt32(o+4,a),t.getInt32(o+8,a)!==4)throw new Error("dcd bad format, natom block end");if(o=o+4+8,r.NAMNF>0)throw new Error("dcd format with fixed atoms unsupported, aborting");let m=r.NATOM,p=m*4;for(let h=0,g=r.NSET;h<g;++h){let y=Object.create(null);y.elementCount=m,c&&(o+=4,y.cell=[t.getFloat64(o,a),t.getFloat64(o+1,a),t.getFloat64(o+16,a),t.getFloat64(o+24,a),t.getFloat64(o+32,a),t.getFloat64(o+40,a)],o+=48,o+=4);for(let b=0;b<3;++b){if(t.getInt32(o,a)!==p)throw new Error(`dcd bad format, coord block start: ${h}, ${b}`);o+=4;let x=new Float32Array(e.buffer,o,m);if(b===0?y.x=x:b===1?y.y=x:y.z=x,o+=p,t.getInt32(o,a)!==p)throw new Error(`dcd bad format, coord block end: ${h}, ${b}`);o+=4}if(u){let b=t.getInt32(o,a);o+=4+b+4}n.push(y)}return{header:r,frames:n}}function xPe(e){return Me.create("Parse DCD",async t=>{try{let r=gSt(e);return hn.success(r)}catch(r){return hn.error(r)}})}var SPe=M(()=>{qs();hr();U4()});function _Pe(e){return function(t,r,n){return ySt(e,t,r,n)}}function ySt(e,t,r,n){let{data:o,indices:i,count:a}=e,{valueType:s}=n,l=s==="str"?c=>{let u=i[2*c]+t,d=i[2*c+1];if(u>=d)return"";let f=u+r;return f>d&&(f=d),ave(o,u,f)}:s==="int"?c=>{let u=i[2*c]+t;return u>i[2*c+1]?0:Wv(o,u,u+r)}:c=>{let u=i[2*c]+t;return u>i[2*c+1]?0:Xfe(o,u,u+r)};return{schema:n,__array:void 0,isDefined:!0,rowCount:a,value:l,valueKind:c=>G.ValueKinds.Present,toArray:c=>ma.createAndFillArray(a,l,c),areValuesEqual:(c,u)=>l(c)===l(u)}}var CPe=M(()=>{Tr();ll();Kv()});function vSt(){return{title:"",timeInPs:0,hasVelocities:!1,precision:{position:0,velocity:0},box:[0,0,0]}}function bSt(e,t){return{tokenizer:e,header:vSt(),numberOfAtoms:0,runtimeCtx:t}}function xSt(e){let{tokenizer:t,header:r}=e,n=It.readLine(t);n.trim().length===0&&(n=It.readLine(t));let o=n.lastIndexOf("t=");o>=0?(r.timeInPs=parseFloat(n.substring(o+2)),r.title=n.substring(0,o).trim(),r.title&&r.title[r.title.length-1]===","&&(r.title=r.title.substring(0,r.title.length-1))):r.title=n}function SSt(e){let{tokenizer:t}=e;It.markLine(t);let r=It.getTokenString(t);e.numberOfAtoms=parseInt(r)}async function _St(e){let{tokenizer:t,numberOfAtoms:r}=e,n=await It.readLinesAsync(t,r,e.runtimeCtx,1e5),i=t.data.substring(n.indices[0],n.indices[1]).substring(20).match(/\.\d+/g),a=i.length===6;e.header.hasVelocities=a,e.header.precision.position=i[0].length-1,e.header.precision.velocity=a?i[3].length-1:0;let s=20,l=e.header.precision.position+5,c=s+3*l,u=e.header.precision.velocity+4,d=_Pe(n),f=G.Undefined(e.numberOfAtoms,G.Schema.float);return{count:e.numberOfAtoms,residueNumber:d(0,5,G.Schema.int),residueName:d(5,5,G.Schema.str),atomName:d(10,5,G.Schema.str),atomNumber:d(15,5,G.Schema.int),x:d(s,l,G.Schema.float),y:d(s+l,l,G.Schema.float),z:d(s+2*l,l,G.Schema.float),vx:a?d(c,u,G.Schema.float):f,vy:a?d(c+u,u,G.Schema.float):f,vz:a?d(c+2*u,u,G.Schema.float):f}}function CSt(e){let{tokenizer:t}=e,r=It.readLine(t).trim().split(/\s+/g);e.header.box=[+r[0],+r[1],+r[2]]}async function wSt(e,t){let r=It(e);await t.update({message:"Parsing...",current:0,max:e.length});let n=[];for(;r.position<e.length;){let i=bSt(r,t);xSt(i),SSt(i);let a=await _St(i);CSt(i),n.push({header:i.header,atoms:a})}let o={structures:n};return hn.success(o)}function wPe(e){return Me.create("Parse GRO",async t=>await wSt(e,t))}var TPe=M(()=>{Tr();ll();CPe();qs();hr()});function APe(e,t,r=!1){return Me.create("Parse PDB",async n=>hn.success({lines:await It.readAllLinesAsync(e,n),id:t,isPdbqt:r}))}var PPe=M(()=>{hr();qs();ll()});function TSt(e,t){for(let r=0,n=t*3;r<n;r+=3){let o=e[r],i=e[r+1],a=e[r+2],s=1/Math.sqrt(o*o+i*i+a*a);e[r]=o*s,e[r+1]=i*s,e[r+2]=a*s}return e}function ff(e,t,r,n){for(let o=0,i=n*3;o<i;o+=3)v.fromArray(tm,t,r+o),v.transformMat4(tm,tm,e),v.toArray(tm,t,r+o)}function kPe(e,t,r,n){for(let o=0,i=n*3;o<i;o+=3)v.fromArray(tm,t,r+o),v.transformMat3(tm,tm,e),v.toArray(tm,t,r+o)}function MPe(e,t){for(let r=0,n=e.length;r<n;r+=3)v.fromArray(tm,e,r),v.normalize(tm,tm),v.scale(tm,tm,t),v.toArray(tm,e,r)}function UN(e,t,r,n,o){for(let i=0,a=o*3;i<a;i+=3){let s=t[i]*3,l=t[i+1]*3,c=t[i+2]*3;v.fromArray(IPe,e,s),v.fromArray(OQ,e,l),v.fromArray(EPe,e,c),v.sub(Yp,EPe,OQ),v.sub(DPe,IPe,OQ),v.cross(Yp,Yp,DPe),r[s]+=Yp[0],r[s+1]+=Yp[1],r[s+2]+=Yp[2],r[l]+=Yp[0],r[l+1]+=Yp[1],r[l+2]+=Yp[2],r[c]+=Yp[0],r[c+1]+=Yp[1],r[c+2]+=Yp[2]}return TSt(r,n)}function Xp(e,t,r=1){let n=Ac(e),o=new Int32Array(n+2),i=new Int32Array(t),a=new Int32Array(t);for(let c=0,u=t*r;c<u;c+=r)++a[e[c]];let s=0;for(let c=0;c<t;c++)o[c]=s,s+=a[c];o[t]=s;let l=new Int32Array(s);for(let c=0,u=t*r;c<u;c+=r){let d=e[c],f=o[d]+i[d];l[f]=c,++i[d]}return{indices:l,offsets:o}}var tm,IPe,OQ,EPe,Yp,DPe,cy=M(()=>{Ge();Jn();tm=v();IPe=v(),OQ=v(),EPe=v(),Yp=v(),DPe=v()});function ASt(e,t){e=Math.max(e,2);let r=Math.sqrt(e),n=Math.ceil(r);n=n+(t-n%t)%t;let o=n>0?Math.ceil(e/n):0;return{width:n,height:o,length:n*o*t}}function Wo(e,t,r,n){let{length:o,width:i,height:a}=ASt(e,t);return n=n&&n.length>=o?n:new r(o),{array:n,width:i,height:a}}function BPe(e){return e>1e5?PSt:ISt}function rm(e,t,r){let n=r*3,o=BPe(t);o.reset();for(let a=0,s=t*3;a<s;a+=n)LQ(Zp,e,a),o.includePosition(Zp);o.finishedIncludeStep();for(let a=0,s=t*3;a<s;a+=n)LQ(Zp,e,a),o.radiusPosition(Zp);let i=o.getSphere();if(t<=14){let a=[];for(let s=0,l=t*3;s<l;s+=n)a.push(LQ(v(),e,s));be.setExtrema(i,a)}return i}function va(e,t,r,n){if(r===1){H.fromArray(FQ,t,n);let l=be.clone(e);return H.isIdentity(FQ)?l:be.transform(l,l,FQ)}let o=BPe(r);o.reset();let{center:i,radius:a,extrema:s}=e;if(s&&r<=14){for(let l=0,c=r;l<c;++l)for(let u of s)VN(Zp,u,t,0,0,l*16+n),o.includePosition(Zp);o.finishedIncludeStep();for(let l=0,c=r;l<c;++l)for(let u of s)VN(Zp,u,t,0,0,l*16+n),o.radiusPosition(Zp)}else{for(let l=0,c=r;l<c;++l)VN(Zp,i,t,0,0,l*16+n),o.includePositionRadius(Zp,a);o.finishedIncludeStep();for(let l=0,c=r;l<c;++l)VN(Zp,i,t,0,0,l*16+n),o.radiusPositionRadius(Zp,a)}return o.getSphere()}var LQ,VN,Zp,PSt,ISt,FQ,pl=M(()=>{or();Ge();Bp();Jn();LQ=v.fromArray,VN=v.transformMat4Offset;Zp=v(),PSt=new Va("14"),ISt=new Va("98");FQ=H()});function NQ(e,t){if(t===0)return 0;let r=new Uint32Array(e.buffer,0,e.buffer.byteLength>>2),n=t-4>>2,o=4*n,i=0;if(n<0)for(let a=0;a<t;++a)i+=e[a]&&1;else{for(let a=0;a<n;++a){let s=r[a];i+=ju[s&65535]+ju[s>>16]}for(let a=o;a<t;++a)i+=e[a]&&1}return i/t}function qo(e,t,r){let n=Wo(Math.max(1,e),1,Uint8Array,r&&r.tMarker.ref.value.array),o=NQ(n.array,e),i=o===0?0:-1;return r?(P.updateIfChanged(r.uMarker,0),P.update(r.tMarker,n),P.update(r.uMarkerTexDim,Ce.create(n.width,n.height)),P.updateIfChanged(r.markerAverage,o),P.updateIfChanged(r.markerStatus,i),P.updateIfChanged(r.dMarkerType,t),r):{uMarker:P.create(0),tMarker:P.create(n),uMarkerTexDim:P.create(Ce.create(n.width,n.height)),markerAverage:P.create(o),markerStatus:P.create(i),dMarkerType:P.create(t)}}var ju,t9r,mf=M(()=>{rd();Ge();pl();ju=new Uint8Array(772);ju[1]=1;ju[2]=1;ju[3]=1;ju[256]=1;ju[512]=1;ju[768]=1;ju[257]=2;ju[513]=2;ju[769]=2;ju[258]=2;ju[514]=2;ju[770]=2;ju[259]=2;ju[515]=2;ju[771]=2;t9r={array:new Uint8Array(1),width:1,height:1}});function ESt(e,t){switch(t){case e.FRAMEBUFFER_COMPLETE:return"complete";case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:return"incomplete attachment";case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:return"incomplete missing attachment";case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:return"incomplete dimensions";case e.FRAMEBUFFER_UNSUPPORTED:return"unsupported"}if(Xt(e))switch(t){case e.FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:return"incomplete multisample";case e.RENDERBUFFER_SAMPLES:return"renderbuffer samples"}return"unknown error"}function LA(e,t){let r=e.checkFramebufferStatus(e.FRAMEBUFFER);if(r!==e.FRAMEBUFFER_COMPLETE){let n=ESt(e,r);throw new Error(`Framebuffer status: ${n}${t?` (${t})`:""}`)}}function RPe(e){let t=e.createFramebuffer();if(t===null)throw new Error("Could not create WebGL framebuffer");return t}function LPe(e){let t=RPe(e),r=!1;return{id:OPe(),bind:()=>e.bindFramebuffer(e.FRAMEBUFFER,t),reset:()=>{t=RPe(e)},destroy:()=>{r||(e.deleteFramebuffer(t),r=!0)}}}function FPe(){return{id:OPe(),bind:()=>{},reset:()=>{},destroy:()=>{}}}var OPe,zN=M(()=>{td();ic();OPe=Zi()});function UQ(e){let t=VPe(e);if(t===null)throw new Error('Could not find support for "instanced_arrays"');let r=qPe(e);if(r===null)throw new Error('Could not find support for "element_index_uint"');let n=zPe(e);if(n===null)throw new Error('Could not find support for "standard_derivatives"');let o=GPe(e);lr&&o===null&&console.log('Could not find support for "texture_float"');let i=HPe(e);lr&&i===null&&console.log('Could not find support for "texture_float_linear"');let a=WPe(e);lr&&a===null&&console.log('Could not find support for "texture_half_float"');let s=KPe(e);lr&&s===null&&console.log('Could not find support for "texture_half_float_linear"');let l=tIe(e);lr&&l===null&&console.log('Could not find support for "depth_texture"');let c=YPe(e);lr&&c===null&&console.log('Could not find support for "blend_minmax"');let u=jPe(e);lr&&u===null&&console.log('Could not find support for "vertex_array_object"');let d=XPe(e);lr&&d===null&&console.log('Could not find support for "frag_depth"');let f=ZPe(e);lr&&f===null&&console.log('Could not find support for "color_buffer_float"');let m=$Pe(e);lr&&m===null&&console.log('Could not find support for "color_buffer_half_float"');let p=QPe(e);lr&&p===null&&console.log('Could not find support for "draw_buffers"');let h=JPe(e);lr&&h===null&&console.log('Could not find support for "draw_buffers_indexed"');let g=eIe(e);lr&&g===null&&console.log('Could not find support for "shader_texture_lod"');let y=rIe(e);lr&&y===null&&console.log('Could not find support for "sRGB"');let b=nIe(e);lr&&b===null&&console.log('Could not find support for "disjoint_timer_query"');let x=oIe(e);lr&&x===null&&console.log('Could not find support for "multi_draw"');let C=iIe(e);lr&&C===null&&console.log('Could not find support for "draw_instanced_base_vertex_base_instance"');let S=aIe(e);lr&&S===null&&console.log('Could not find support for "multi_draw_instanced_base_vertex_base_instance"');let w=sIe(e);lr&&w===null&&console.log('Could not find support for "parallel_shader_compile"');let A=lIe(e);lr&&A===null&&console.log('Could not find support for "fbo_render_mipmap"');let T=cIe(e);lr&&T===null&&console.log('Could not find support for "provoking_vertex"');let D=uIe(e);lr&&D===null&&console.log('Could not find support for "clip_cull_distance"');let E=dIe(e);lr&&E===null&&console.log('Could not find support for "conservative_depth"');let I=fIe(e);lr&&I===null&&console.log('Could not find support for "stencil_texturing"');let k=mIe(e);lr&&k===null&&console.log('Could not find support for "clip_control"');let R=pIe(e);lr&&R===null&&console.log('Could not find support for "render_snorm"');let B=hIe(e);lr&&B===null&&console.log('Could not find support for "render_shared_exponent"');let O=gIe(e);lr&&O===null&&console.log('Could not find support for "texture_norm16"');let F=yIe(e);lr&&F===null&&console.log('Could not find support for "depth_clamp"');let q=vIe(e);lr&&q===null&&console.log('Could not find support for "multiview2"');let W=bIe(e);return{instancedArrays:t,standardDerivatives:n,elementIndexUint:r,textureFloat:o,textureFloatLinear:i,textureHalfFloat:a,textureHalfFloatLinear:s,depthTexture:l,blendMinMax:c,vertexArrayObject:u,fragDepth:d,colorBufferFloat:f,colorBufferHalfFloat:m,drawBuffers:p,drawBuffersIndexed:h,shaderTextureLod:g,sRGB:y,disjointTimerQuery:b,multiDraw:x,drawInstancedBaseVertexBaseInstance:C,multiDrawInstancedBaseVertexBaseInstance:S,parallelShaderCompile:w,fboRenderMipmap:A,provokingVertex:T,clipCullDistance:D,conservativeDepth:E,stencilTexturing:I,clipControl:k,renderSnorm:R,renderSharedExponent:B,textureNorm16:O,depthClamp:F,multiview2:q,noNonInstancedActiveAttribs:W}}function NPe(e,t){let r=UQ(e);pa(t,(n,o)=>{o==="noNonInstancedActiveAttribs"?t.noNonInstancedActiveAttribs=r.noNonInstancedActiveAttribs:n!==null&&(r[o]===null?t[o]=null:Object.assign(n,r[o]))})}var UPe=M(()=>{ic();Fn();Aa()});function xIe(e,t){let r={},n=e.getParameter(e.FRONT_FACE),o=e.getParameter(e.CULL_FACE_MODE),i=e.getParameter(e.DEPTH_WRITEMASK),a=e.getParameter(e.DEPTH_CLEAR_VALUE),s=e.getParameter(e.DEPTH_FUNC),l=e.getParameter(e.COLOR_WRITEMASK),c=e.getParameter(e.COLOR_CLEAR_VALUE),u=e.getParameter(e.BLEND_SRC_RGB),d=e.getParameter(e.BLEND_DST_RGB),f=e.getParameter(e.BLEND_SRC_ALPHA),m=e.getParameter(e.BLEND_DST_ALPHA),p=e.getParameter(e.BLEND_COLOR),h=e.getParameter(e.BLEND_EQUATION_RGB),g=e.getParameter(e.BLEND_EQUATION_ALPHA),y=e.getParameter(e.STENCIL_FUNC),b=e.getParameter(e.STENCIL_VALUE_MASK),x=e.getParameter(e.STENCIL_REF),C=e.getParameter(e.STENCIL_BACK_FUNC),S=e.getParameter(e.STENCIL_BACK_VALUE_MASK),w=e.getParameter(e.STENCIL_BACK_REF),A=e.getParameter(e.STENCIL_WRITEMASK),T=e.getParameter(e.STENCIL_BACK_WRITEMASK),D=e.getParameter(e.STENCIL_FAIL),E=e.getParameter(e.STENCIL_PASS_DEPTH_PASS),I=e.getParameter(e.STENCIL_PASS_DEPTH_FAIL),k=e.getParameter(e.STENCIL_BACK_FAIL),R=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_PASS),B=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_FAIL),O=e.getParameter(e.MAX_VERTEX_ATTRIBS),F=[],q=e.getParameter(e.VIEWPORT),W=e.getParameter(e.SCISSOR_BOX),j=t.clipControl?e.getParameter(t.clipControl.CLIP_ORIGIN):-1,L=t.clipControl?e.getParameter(t.clipControl.CLIP_DEPTH_MODE):-1,V=()=>{for(let U=0;U<O;++U)F[U]=0};return V(),{currentProgramId:-1,currentMaterialId:-1,currentRenderItemId:-1,enable:U=>{r[U]!==!0&&(e.enable(U),r[U]=!0)},disable:U=>{r[U]!==!1&&(e.disable(U),r[U]=!1)},frontFace:U=>{U!==n&&(e.frontFace(U),n=U)},cullFace:U=>{U!==o&&(e.cullFace(U),o=U)},depthMask:U=>{U!==i&&(e.depthMask(U),i=U)},clearDepth:U=>{U!==a&&(e.clearDepth(U),a=U)},depthFunc:U=>{U!==s&&(e.depthFunc(U),s=U)},colorMask:(U,z,ie,oe)=>{(U!==l[0]||z!==l[1]||ie!==l[2]||oe!==l[3])&&(e.colorMask(U,z,ie,oe),l[0]=U,l[1]=z,l[2]=ie,l[3]=oe)},clearColor:(U,z,ie,oe)=>{(U!==c[0]||z!==c[1]||ie!==c[2]||oe!==c[3])&&(e.clearColor(U,z,ie,oe),c[0]=U,c[1]=z,c[2]=ie,c[3]=oe)},blendFunc:(U,z)=>{(U!==u||z!==d||U!==f||z!==m)&&(e.blendFunc(U,z),u=U,d=z,f=U,m=z)},blendFuncSeparate:(U,z,ie,oe)=>{(U!==u||z!==d||ie!==f||oe!==m)&&(e.blendFuncSeparate(U,z,ie,oe),u=U,d=z,f=ie,m=oe)},blendEquation:U=>{(U!==h||U!==g)&&(e.blendEquation(U),h=U,g=U)},blendEquationSeparate:(U,z)=>{(U!==h||z!==g)&&(e.blendEquationSeparate(U,z),h=U,g=z)},blendColor:(U,z,ie,oe)=>{(U!==p[0]||z!==p[1]||ie!==p[2]||oe!==p[3])&&(e.blendColor(U,z,ie,oe),p[0]=U,p[1]=z,p[2]=ie,p[3]=oe)},stencilFunc:(U,z,ie)=>{(U!==y||z!==x||ie!==b||U!==C||z!==w||ie!==S)&&(e.stencilFunc(U,z,ie),y=U,x=z,b=ie,C=U,w=z,S=ie)},stencilFuncSeparate:(U,z,ie,oe)=>{U===e.FRONT?(z!==y||ie!==x||oe!==b)&&(e.stencilFuncSeparate(U,z,ie,oe),y=z,x=ie,b=oe):U===e.BACK?(z!==C||ie!==w||oe!==S)&&(e.stencilFuncSeparate(U,z,ie,oe),C=z,w=ie,S=oe):U===e.FRONT_AND_BACK&&(z!==y||ie!==x||oe!==b||z!==C||ie!==w||oe!==S)&&(e.stencilFuncSeparate(U,z,ie,oe),y=z,x=ie,b=oe,C=z,w=ie,S=oe)},stencilMask:U=>{(U!==A||U!==T)&&(e.stencilMask(U),A=U,T=U)},stencilMaskSeparate:(U,z)=>{U===e.FRONT?z!==A&&(e.stencilMaskSeparate(U,z),A=z):U===e.BACK?z!==T&&(e.stencilMaskSeparate(U,z),T=z):U===e.FRONT_AND_BACK&&(z!==A||z!==T)&&(e.stencilMaskSeparate(U,z),A=z,T=z)},stencilOp:(U,z,ie)=>{(U!==D||z!==I||ie!==E||U!==k||z!==B||ie!==R)&&(e.stencilOp(U,z,ie),D=U,I=z,E=ie,k=U,B=z,R=ie)},stencilOpSeparate:(U,z,ie,oe)=>{U===e.FRONT?(z!==D||ie!==I||oe!==E)&&(e.stencilOpSeparate(U,z,ie,oe),D=z,I=ie,E=oe):U===e.BACK?(z!==k||ie!==B||oe!==R)&&(e.stencilOpSeparate(U,z,ie,oe),k=z,B=ie,R=oe):U===e.FRONT_AND_BACK&&(z!==D||ie!==I||oe!==E||z!==k||ie!==B||oe!==R)&&(e.stencilOpSeparate(U,z,ie,oe),D=z,I=ie,E=oe,k=z,B=ie,R=oe)},enableVertexAttrib:U=>{e.enableVertexAttribArray(U),F[U]=1},clearVertexAttribsState:V,disableUnusedVertexAttribs:()=>{for(let U=0;U<O;++U)F[U]===0&&e.disableVertexAttribArray(U)},viewport:(U,z,ie,oe)=>{(U!==q[0]||z!==q[1]||ie!==q[2]||oe!==q[3])&&(e.viewport(U,z,ie,oe),q[0]=U,q[1]=z,q[2]=ie,q[3]=oe)},scissor:(U,z,ie,oe)=>{(U!==W[0]||z!==W[1]||ie!==W[2]||oe!==W[3])&&(e.scissor(U,z,ie,oe),W[0]=U,W[1]=z,W[2]=ie,W[3]=oe)},clipControl:t.clipControl?(U,z)=>{(U!==j||z!==L)&&(t.clipControl.clipControl(U,z),j=U,L=z)}:void 0,reset:()=>{r={},n=e.getParameter(e.FRONT_FACE),o=e.getParameter(e.CULL_FACE_MODE),i=e.getParameter(e.DEPTH_WRITEMASK),a=e.getParameter(e.DEPTH_CLEAR_VALUE),s=e.getParameter(e.DEPTH_FUNC),l=e.getParameter(e.COLOR_WRITEMASK),c=e.getParameter(e.COLOR_CLEAR_VALUE),u=e.getParameter(e.BLEND_SRC_RGB),d=e.getParameter(e.BLEND_DST_RGB),f=e.getParameter(e.BLEND_SRC_ALPHA),m=e.getParameter(e.BLEND_DST_ALPHA),p=e.getParameter(e.BLEND_COLOR),h=e.getParameter(e.BLEND_EQUATION_RGB),g=e.getParameter(e.BLEND_EQUATION_ALPHA),y=e.getParameter(e.STENCIL_FUNC),b=e.getParameter(e.STENCIL_VALUE_MASK),x=e.getParameter(e.STENCIL_REF),C=e.getParameter(e.STENCIL_BACK_FUNC),S=e.getParameter(e.STENCIL_BACK_VALUE_MASK),w=e.getParameter(e.STENCIL_BACK_REF),A=e.getParameter(e.STENCIL_WRITEMASK),T=e.getParameter(e.STENCIL_BACK_WRITEMASK),D=e.getParameter(e.STENCIL_FAIL),E=e.getParameter(e.STENCIL_PASS_DEPTH_PASS),I=e.getParameter(e.STENCIL_PASS_DEPTH_FAIL),k=e.getParameter(e.STENCIL_BACK_FAIL),R=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_PASS),B=e.getParameter(e.STENCIL_BACK_PASS_DEPTH_FAIL),O=e.getParameter(e.MAX_VERTEX_ATTRIBS),F.length=0;for(let U=0;U<O;++U)F[U]=0;q=e.getParameter(e.VIEWPORT),W=e.getParameter(e.SCISSOR_BOX),j=t.clipControl?e.getParameter(t.clipControl.CLIP_ORIGIN):-1,L=t.clipControl?e.getParameter(t.clipControl.CLIP_DEPTH_MODE):-1}}}var SIe=M(()=>{});var _Ie,CIe=M(()=>{_Ie=`
|
|
35
35
|
float preFogAlpha = gl_FragColor.a;
|
|
@@ -10528,7 +10528,7 @@ def Mesh "mesh${this.meshes.length}"
|
|
|
10528
10528
|
}
|
|
10529
10529
|
metersPerUnit = 1
|
|
10530
10530
|
)
|
|
10531
|
-
`,...this.materials,...this.meshes].join(""),o=new Uint8Array(n.length);return A1(o,n),{usdz:await BD(t,{"model.usda":o},!0)}}async getBlob(t){let{usdz:r}=await this.getData(t);return new Blob([r],{type:"model/vnd.usdz+zip"})}constructor(t,r){super(),this.fileExtension="usdz",this.meshes=[],this.materials=[],this.materialMap=new Map;let n=H();H.fromUniformScaling(n,Math.min(1/(r*2),1)),H.translate(n,n,v.create(-(t.min[0]+t.max[0])/2,-t.min[1],-(t.min[2]+t.max[2])/2)),this.centerTransform=n}}});var vde,aH,$ot=M(()=>{or();Cf();hr();_o();yn();Ue();Nf();Hot();Kot();Yot();Zot();vde={format:_.Select("glb",[["glb","glTF 2.0 Binary (.glb)"],["stl","Stl (.stl)"],["obj","Wavefront (.obj)"],["usdz","Universal Scene Description (.usdz)"]])},aH=class extends dp{getFilename(){let t=this.plugin.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Model)).map(o=>o.obj.data),r=new Set;return t.forEach(o=>r.add(o.entryId.toUpperCase())),`${So.toArray(r).join("-")||"molstar-model"}`}exportGeometry(){let t=Me.create("Export Geometry",async r=>{var n,o,i;try{let a=(n=this.plugin.canvas3d)===null||n===void 0?void 0:n.getRenderObjects(),s=this.getFilename(),l=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.boundingSphereVisible,c=Ct.fromSphere3D(Ct(),l),u;switch(this.behaviors.params.value.format){case"glb":u=new tH(c);break;case"obj":u=new rH(s,c);break;case"stl":u=new oH(c);break;case"usdz":u=new iH(c,l.radius);break;default:throw new Error("Unsupported format.")}for(let f=0,m=a.length;f<m;++f)await r.update({message:`Exporting object ${f}/${m}`}),await u.add(a[f],(i=this.plugin.canvas3d)===null||i===void 0?void 0:i.webgl,r);return{blob:await u.getBlob(r),filename:s+"."+u.fileExtension}}catch(a){throw this.plugin.log.error("Error during geometry export"),a}});return this.plugin.runTask(t,{useOverlay:!0})}constructor(t){super(),this.plugin=t,this.behaviors={params:this.ev.behavior(_.getDefaultValues(vde))}}}});var K_,sH,Qot=M(()=>{K_=et(gn());es();Vi();Ea();ha();Fd();FV();$ot();sH=class extends Fu{constructor(){super(...arguments),this.save=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry();fI(t.blob,t.filename)}catch(t){console.error(t)}finally{this.setState({busy:!1})}},this.viewInAR=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry(),r=document.createElement("a");r.rel="ar",r.href=URL.createObjectURL(t.blob),r.appendChild(document.createElement("img")),setTimeout(()=>URL.revokeObjectURL(r.href),4e4),setTimeout(()=>r.dispatchEvent(new MouseEvent("click")))}catch(t){console.error(t)}finally{this.setState({busy:!1})}}}get controls(){return this._controls||(this._controls=new aH(this.plugin))}defaultState(){return{header:"Export Geometry",isCollapsed:!0,brand:{accent:"cyan",svg:vxe}}}renderControls(){var t,r,n,o;this.isARSupported===void 0&&(this.isARSupported=!!(!((r=(t=document.createElement("a").relList)===null||t===void 0?void 0:t.supports)===null||r===void 0)&&r.call(t,"ar")));let i=this.controls;return(0,K_.jsxs)(K_.Fragment,{children:[(0,K_.jsx)(xo,{params:vde,values:i.behaviors.params.value,onChangeValues:a=>i.behaviors.params.next(a),isDisabled:this.state.busy}),(0,K_.jsx)(Cr,{icon:z2,onClick:this.save,style:{marginTop:1},disabled:this.state.busy||!(!((n=this.plugin.canvas3d)===null||n===void 0)&&n.reprCount.value),children:"Save"}),this.isARSupported&&i.behaviors.params.value.format==="usdz"&&(0,K_.jsx)(Cr,{icon:yxe,onClick:this.viewInAR,style:{marginTop:1},disabled:this.state.busy||!(!((o=this.plugin.canvas3d)===null||o===void 0)&&o.reprCount.value),children:"View in AR"})]})}componentDidMount(){if(!this.plugin.canvas3d)return;let t=xd(this.controls.behaviors.params,this.plugin.canvas3d.reprCount);this.subscribe(t,()=>{this.state.isCollapsed||this.forceUpdate()})}componentWillUnmount(){var t;super.componentWillUnmount(),(t=this._controls)===null||t===void 0||t.dispose(),this._controls=void 0}}});var bde,Jot=M(()=>{_f();Qot();bde=cn.create({name:"extension-geo-export",category:"misc",display:{name:"Geometry Export"},ctor:class extends cn.Handler{register(){this.ctx.customStructureControls.set("geo-export",sH)}update(){return!1}unregister(){this.ctx.customStructureControls.delete("geo-export")}},params:()=>({})})});function xde({showControls:e}){let t=(0,qw.useRef)(null),[r,n]=(0,qw.useState)(),[o,i]=(0,qw.useState)();return(0,qw.useEffect)(()=>{let a;return(async()=>{try{if(!t.current)return;let s=document.createElement("div");t.current.append(s);let l=yR();a=await Jq({target:s,render:ej,spec:{...yR(),behaviors:[...l.behaviors,qr.Behavior(bde)],layout:{initial:{controlsDisplay:"reactive",showControls:e}}}}),await a.initialized,n(a)}catch(s){console.error(s),i(s)}})(),()=>{a?.unmount()}},[e]),{parentRef:t,error:o,plugin:r}}var qw,s_o,eit=M(()=>{"use strict";qw=et(Wr());Jot();Wse();Yse();Zse();Kse();s_o={"geo-export":qr.Behavior(bde)}});var rit={};ci(rit,{default:()=>kur});var Fv,RO,Sde,tit,Eur,Dur,kur,nit=M(()=>{"use strict";Fv=et(Wr()),RO=et(xx()),Sde=et(_p());Uot();zot();eit();tit=document.createElement("style");tit.append(Vot);document.head.append(tit);Eur=(0,Sde.observer)(function({model:e}){let{showControls:t}=e,{plugin:r,parentRef:n,error:o}=xde({showControls:t});return(0,Fv.useEffect)(()=>{e.setMolstarPluginContext(r)},[r,e]),o?Fv.default.createElement(RO.ErrorMessage,{error:o}):Fv.default.createElement(Dur,{model:e,parentRef:n})}),Dur=(0,Sde.observer)(function({model:e,parentRef:t}){let{width:r,height:n,error:o}=e;return Fv.default.createElement("div",{style:{background:"#ccc"}},o?Fv.default.createElement(RO.ErrorMessage,{error:o}):null,Fv.default.createElement(Not,{model:e}),Fv.default.createElement("div",{ref:t,style:{position:"relative",width:r,height:n}}),Fv.default.createElement(RO.ResizeHandle,{style:{height:4,background:"grey"},onDrag:i=>e.setHeight(e.height+i)}))}),kur=Eur});var dit={};ci(dit,{default:()=>lH});var lit,cH,cit,uit,lH,fit=M(()=>{"use strict";lit=et(JL()),cH=et(Du()),cit=et(eF()),uit=et(tF()),lH=class extends lit.BaseFeatureDataAdapter{static capabilities=["getFeatures","getRefNames"];feats;async loadDataP(){let{features:t}=JSON.parse(await(0,cit.openLocation)(this.getConf("location")).readFile("utf8")),r=this.getConf("scoreField");return t.map(({begin:n,end:o,...i},a)=>({...i,uniqueId:`feat-${a}`,start:+n,end:+o+1,score:r==="population_frequency"?i.populationFrequencies?.[0]?.frequency:r==="variant_impact_score"?i.predictions?.[0]?.score:void 0,description:i.descriptions?.map(s=>s.value).join(","),name:[i.mutatedType?`${i.wildType}->${i.mutatedType}`:`${i.wildType}->del`]}))}async loadData(t={}){return this.feats??=this.loadDataP().catch(r=>{throw this.feats=void 0,r}),this.feats}async getRefNames(t={}){return[]}getFeatures(t,r={}){return(0,uit.ObservableCreate)(async n=>{let{start:o,end:i,refName:a}=t,s=await this.loadData();for(let l of s)(0,cH.doesIntersect2)(l.start,l.end,o,i)&&n.next(new cH.SimpleFeature({...l,refName:a}));n.complete()})}freeResources(){}}});var Rur={};ci(Rur,{default:()=>uH});var pit=et(Ide());var Ede="0.0.8";var Xbe=et(Wr());var jT=et(Wr()),Kbe=et(_p());var Fbe=et(Wr()),Nbe=et(Du()),Ube=et(_p());var Lde=et(Wr()),Fde=et(Du()),Nde=et(_p());var Rde=et(Y_()),Ode=(0,Rde.makeStyles)()({highlight:{height:"100%",background:"rgba(255,255,0,0.2)",border:"1px solid rgba(50,50,0,0.2)",position:"absolute",zIndex:99,textAlign:"center",pointerEvents:"none",overflow:"hidden"},thinborder:{border:"1px solid black"}});var _it=(0,Nde.observer)(function({assemblyName:t,start:r,end:n,refName:o,model:i}){let{cx:a,classes:s}=Ode(),{assemblyManager:l}=(0,Fde.getSession)(i),{offsetPx:c}=i,d=l.get(t)?.getCanonicalRefName(o)??o,f=i.bpToPx({refName:d,coord:r}),m=i.bpToPx({refName:d,coord:n});if(f&&m){let p=Math.max(Math.abs(m.offsetPx-f.offsetPx),3),h=Math.min(f.offsetPx,m.offsetPx)-c;return Lde.default.createElement("div",{className:a(s.highlight,p<=3?s.thinborder:void 0),style:{left:h,width:p}})}else return null}),jw=_it;Vm();var Lbe=Object.fromEntries([{name:"alanine",abbreviation:"Ala",singleLetterCode:"A"},{name:"arginine",abbreviation:"Arg",singleLetterCode:"R"},{name:"asparagine",abbreviation:"Asn",singleLetterCode:"N"},{name:"aspartic acid",abbreviation:"Asp",singleLetterCode:"D"},{name:"cysteine",abbreviation:"Cys",singleLetterCode:"C"},{name:"glutamic acid",abbreviation:"Glu",singleLetterCode:"E"},{name:"glutamine",abbreviation:"Gln",singleLetterCode:"Q"},{name:"glycine",abbreviation:"Gly",singleLetterCode:"G"},{name:"histidine",abbreviation:"His",singleLetterCode:"H"},{name:"isoleucine",abbreviation:"Ile",singleLetterCode:"I"},{name:"leucine",abbreviation:"Leu",singleLetterCode:"L"},{name:"lysine",abbreviation:"Lys",singleLetterCode:"K"},{name:"methionine",abbreviation:"Met",singleLetterCode:"M"},{name:"phenylalanine",abbreviation:"Phe",singleLetterCode:"F"},{name:"proline",abbreviation:"Pro",singleLetterCode:"P"},{name:"serine",abbreviation:"Ser",singleLetterCode:"S"},{name:"threonine",abbreviation:"Thr",singleLetterCode:"T"},{name:"tryptophan",abbreviation:"Trp",singleLetterCode:"W"},{name:"tyrosine",abbreviation:"Tyr",singleLetterCode:"Y"},{name:"valine",abbreviation:"Val",singleLetterCode:"V"}].map(e=>[e.abbreviation.toUpperCase(),e]));function YL(e){return!!e&&typeof e=="object"&&"hoverFeature"in e&&"hoverPosition"in e}function XL({structure:e,selectedResidue:t}){return Vo.getStructureSelection(r=>r.struct.generator.atomGroups({"residue-test":r.core.rel.eq([r.struct.atomProperty.macromolecular.label_seq_id(),t]),"group-by":r.struct.atomProperty.macromolecular.residueKey()}),e)}function CY({chain:e,code:t,structureSeqPos:r}){return[r===void 0?"":`Position: ${r}`,t?`Letter: ${t} (${Lbe[t]?.singleLetterCode})`:"",e?`Chain: ${e}`:""].filter(n=>!!n).join(", ")}function wY(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[r,+t]).filter(t=>t[0]!==void 0))}var Mpt=(0,Ube.observer)(function({model:e}){let t=(0,Nbe.getSession)(e),{views:r,hovered:n}=t;if(YL(n)&&r.some(o=>o.type==="ProteinView")){let{assemblyNames:o}=e,{coord:i,refName:a}=n.hoverPosition;return Fbe.default.createElement(jw,{model:e,start:i-1,end:i,refName:a,assemblyName:o[0]})}return null}),Vbe=Mpt;var ZL=et(Wr()),zbe=et(Du()),qbe=et(_p());var Bpt=(0,qbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,zbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?ZL.default.createElement(ZL.default.Fragment,null,o?.structures.map(s=>s.clickGenomeHighlights.map((l,c)=>ZL.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),jbe=Bpt;var $L=et(Wr()),Gbe=et(Du()),Hbe=et(_p());var Rpt=(0,Hbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,Gbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?$L.default.createElement($L.default.Fragment,null,o?.structures.map(s=>s.hoverGenomeHighlights.map((l,c)=>$L.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),Wbe=Rpt;var Opt=(0,Kbe.observer)(function({model:t}){return jT.default.createElement(jT.default.Fragment,null,jT.default.createElement(jbe,{model:t}),jT.default.createElement(Wbe,{model:t}),jT.default.createElement(Vbe,{model:t}))}),Ybe=Opt;function TY(e){e.addToExtensionPoint("LinearGenomeView-TracksContainerComponent",(t=[],{model:r})=>[...t,Xbe.default.createElement(Ybe,{key:"highlight_protein_viewer_protein3d",model:r})])}var l1e=et(QL());var Qbe=et(ZD());var Lpt=(0,Qbe.ConfigurationSchema)("AlphaFoldConfidenceAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),Jbe=Lpt;function AY(e){e.addAdapterType(()=>new l1e.default({name:"AlphaFoldConfidenceAdapter",displayName:"AlphaFoldConfidence adapter",configSchema:Jbe,getAdapterClass:()=>Promise.resolve().then(()=>(s1e(),a1e)).then(t=>t.default)}))}var g1e=et(QL());var c1e=et(ZD());var Fpt=(0,c1e.ConfigurationSchema)("AlphaMissensePathogenicityAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),u1e=Fpt;function PY(e){e.addAdapterType(()=>new g1e.default({name:"AlphaMissensePathogenicityAdapter",displayName:"AlphaMissensePathogenicity adapter",configSchema:u1e,getAdapterClass:()=>Promise.resolve().then(()=>(h1e(),p1e)).then(t=>t.default)}))}var ij=et(Du());GT();var b1e=et(gn(),1),x1e=(0,yg.createSvgIcon)((0,b1e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var xm=et(Wr()),VYe=et(xx()),vR=et(Jl());var Ol=et(Wr()),_F=et(xx()),CF=et(Du()),wF=et(Jl()),axe=et(_p()),sxe=et(Y_());var Ou=et(Wr()),F2=et(Jl());var Sx=et(Wr()),w1e=et(Du()),WT=et(Jl()),T1e=et(Y_());function HT(e){let t=e.get("subfeatures")??[];return t.some(r=>r.get("type")==="CDS"||r.get("type")==="exon")?[e]:t}function C1e(e){return e?.replace(/\.[^./]+$/,"")}function $D(e){return e.get("name")??e.get("id")}function iF(e){return e===void 0?"":e.id()}function ef(e){return e===void 0?"":[e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}function H0(e){return e===void 0?"":[e.get("gene_name")??e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}var Npt=(0,T1e.makeStyles)()({textAreaFont:{fontFamily:"Courier New",whiteSpace:"pre"},margin:{marginLeft:20}});function QD({structureName:e,structureSequence:t,isoformSequences:r}){let{classes:n}=Npt(),[o,i]=(0,Sx.useState)(!1),a=Object.fromEntries(Object.entries(r).map(([u,d])=>[u,{...d,seq:d.seq.replaceAll("*","")}])),s=Object.entries(a).find(([u,d])=>t===d.seq),l=`${e||""} (structure residues)`,c=(0,w1e.max)([l.length,...Object.entries(a).map(([u,d])=>ef(d.feature).length)]);return Sx.default.createElement(Sx.default.Fragment,null,Sx.default.createElement(WT.FormControlLabel,{className:n.margin,control:Sx.default.createElement(WT.Checkbox,{onChange:u=>{i(u.target.checked)},checked:o}),label:"Show in FASTA format?"}),Sx.default.createElement(WT.TextField,{variant:"outlined",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,value:o?[`>${l}
|
|
10531
|
+
`,...this.materials,...this.meshes].join(""),o=new Uint8Array(n.length);return A1(o,n),{usdz:await BD(t,{"model.usda":o},!0)}}async getBlob(t){let{usdz:r}=await this.getData(t);return new Blob([r],{type:"model/vnd.usdz+zip"})}constructor(t,r){super(),this.fileExtension="usdz",this.meshes=[],this.materials=[],this.materialMap=new Map;let n=H();H.fromUniformScaling(n,Math.min(1/(r*2),1)),H.translate(n,n,v.create(-(t.min[0]+t.max[0])/2,-t.min[1],-(t.min[2]+t.max[2])/2)),this.centerTransform=n}}});var vde,aH,$ot=M(()=>{or();Cf();hr();_o();yn();Ue();Nf();Hot();Kot();Yot();Zot();vde={format:_.Select("glb",[["glb","glTF 2.0 Binary (.glb)"],["stl","Stl (.stl)"],["obj","Wavefront (.obj)"],["usdz","Universal Scene Description (.usdz)"]])},aH=class extends dp{getFilename(){let t=this.plugin.state.data.select(ir.Generators.rootsOfType(ue.Molecule.Model)).map(o=>o.obj.data),r=new Set;return t.forEach(o=>r.add(o.entryId.toUpperCase())),`${So.toArray(r).join("-")||"molstar-model"}`}exportGeometry(){let t=Me.create("Export Geometry",async r=>{var n,o,i;try{let a=(n=this.plugin.canvas3d)===null||n===void 0?void 0:n.getRenderObjects(),s=this.getFilename(),l=(o=this.plugin.canvas3d)===null||o===void 0?void 0:o.boundingSphereVisible,c=Ct.fromSphere3D(Ct(),l),u;switch(this.behaviors.params.value.format){case"glb":u=new tH(c);break;case"obj":u=new rH(s,c);break;case"stl":u=new oH(c);break;case"usdz":u=new iH(c,l.radius);break;default:throw new Error("Unsupported format.")}for(let f=0,m=a.length;f<m;++f)await r.update({message:`Exporting object ${f}/${m}`}),await u.add(a[f],(i=this.plugin.canvas3d)===null||i===void 0?void 0:i.webgl,r);return{blob:await u.getBlob(r),filename:s+"."+u.fileExtension}}catch(a){throw this.plugin.log.error("Error during geometry export"),a}});return this.plugin.runTask(t,{useOverlay:!0})}constructor(t){super(),this.plugin=t,this.behaviors={params:this.ev.behavior(_.getDefaultValues(vde))}}}});var K_,sH,Qot=M(()=>{K_=et(gn());es();Vi();Ea();ha();Fd();FV();$ot();sH=class extends Fu{constructor(){super(...arguments),this.save=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry();fI(t.blob,t.filename)}catch(t){console.error(t)}finally{this.setState({busy:!1})}},this.viewInAR=async()=>{try{this.setState({busy:!0});let t=await this.controls.exportGeometry(),r=document.createElement("a");r.rel="ar",r.href=URL.createObjectURL(t.blob),r.appendChild(document.createElement("img")),setTimeout(()=>URL.revokeObjectURL(r.href),4e4),setTimeout(()=>r.dispatchEvent(new MouseEvent("click")))}catch(t){console.error(t)}finally{this.setState({busy:!1})}}}get controls(){return this._controls||(this._controls=new aH(this.plugin))}defaultState(){return{header:"Export Geometry",isCollapsed:!0,brand:{accent:"cyan",svg:vxe}}}renderControls(){var t,r,n,o;this.isARSupported===void 0&&(this.isARSupported=!!(!((r=(t=document.createElement("a").relList)===null||t===void 0?void 0:t.supports)===null||r===void 0)&&r.call(t,"ar")));let i=this.controls;return(0,K_.jsxs)(K_.Fragment,{children:[(0,K_.jsx)(xo,{params:vde,values:i.behaviors.params.value,onChangeValues:a=>i.behaviors.params.next(a),isDisabled:this.state.busy}),(0,K_.jsx)(Cr,{icon:z2,onClick:this.save,style:{marginTop:1},disabled:this.state.busy||!(!((n=this.plugin.canvas3d)===null||n===void 0)&&n.reprCount.value),children:"Save"}),this.isARSupported&&i.behaviors.params.value.format==="usdz"&&(0,K_.jsx)(Cr,{icon:yxe,onClick:this.viewInAR,style:{marginTop:1},disabled:this.state.busy||!(!((o=this.plugin.canvas3d)===null||o===void 0)&&o.reprCount.value),children:"View in AR"})]})}componentDidMount(){if(!this.plugin.canvas3d)return;let t=xd(this.controls.behaviors.params,this.plugin.canvas3d.reprCount);this.subscribe(t,()=>{this.state.isCollapsed||this.forceUpdate()})}componentWillUnmount(){var t;super.componentWillUnmount(),(t=this._controls)===null||t===void 0||t.dispose(),this._controls=void 0}}});var bde,Jot=M(()=>{_f();Qot();bde=cn.create({name:"extension-geo-export",category:"misc",display:{name:"Geometry Export"},ctor:class extends cn.Handler{register(){this.ctx.customStructureControls.set("geo-export",sH)}update(){return!1}unregister(){this.ctx.customStructureControls.delete("geo-export")}},params:()=>({})})});function xde({showControls:e}){let t=(0,qw.useRef)(null),[r,n]=(0,qw.useState)(),[o,i]=(0,qw.useState)();return(0,qw.useEffect)(()=>{let a;return(async()=>{try{if(!t.current)return;let s=document.createElement("div");t.current.append(s);let l=yR();a=await Jq({target:s,render:ej,spec:{...yR(),behaviors:[...l.behaviors,qr.Behavior(bde)],layout:{initial:{controlsDisplay:"reactive",showControls:e}}}}),await a.initialized,n(a)}catch(s){console.error(s),i(s)}})(),()=>{a?.unmount()}},[e]),{parentRef:t,error:o,plugin:r}}var qw,s_o,eit=M(()=>{"use strict";qw=et(Wr());Jot();Wse();Yse();Zse();Kse();s_o={"geo-export":qr.Behavior(bde)}});var rit={};ci(rit,{default:()=>kur});var Fv,RO,Sde,tit,Eur,Dur,kur,nit=M(()=>{"use strict";Fv=et(Wr()),RO=et(xx()),Sde=et(_p());Uot();zot();eit();tit=document.createElement("style");tit.append(Vot);document.head.append(tit);Eur=(0,Sde.observer)(function({model:e}){let{showControls:t}=e,{plugin:r,parentRef:n,error:o}=xde({showControls:t});return(0,Fv.useEffect)(()=>{e.setMolstarPluginContext(r)},[r,e]),o?Fv.default.createElement(RO.ErrorMessage,{error:o}):Fv.default.createElement(Dur,{model:e,parentRef:n})}),Dur=(0,Sde.observer)(function({model:e,parentRef:t}){let{width:r,height:n,error:o}=e;return Fv.default.createElement("div",{style:{background:"#ccc"}},o?Fv.default.createElement(RO.ErrorMessage,{error:o}):null,Fv.default.createElement(Not,{model:e}),Fv.default.createElement("div",{ref:t,style:{position:"relative",width:r,height:n}}),Fv.default.createElement(RO.ResizeHandle,{style:{height:4,background:"grey"},onDrag:i=>e.setHeight(e.height+i)}))}),kur=Eur});var dit={};ci(dit,{default:()=>lH});var lit,cH,cit,uit,lH,fit=M(()=>{"use strict";lit=et(JL()),cH=et(Du()),cit=et(eF()),uit=et(tF()),lH=class extends lit.BaseFeatureDataAdapter{static capabilities=["getFeatures","getRefNames"];feats;async loadDataP(){let{features:t}=JSON.parse(await(0,cit.openLocation)(this.getConf("location")).readFile("utf8")),r=this.getConf("scoreField");return t.map(({begin:n,end:o,...i},a)=>({...i,uniqueId:`feat-${a}`,start:+n,end:+o+1,score:r==="population_frequency"?i.populationFrequencies?.[0]?.frequency:r==="variant_impact_score"?i.predictions?.[0]?.score:void 0,description:i.descriptions?.map(s=>s.value).join(","),name:[i.mutatedType?`${i.wildType}->${i.mutatedType}`:`${i.wildType}->del`]}))}async loadData(t={}){return this.feats??=this.loadDataP().catch(r=>{throw this.feats=void 0,r}),this.feats}async getRefNames(t={}){return[]}getFeatures(t,r={}){return(0,uit.ObservableCreate)(async n=>{let{start:o,end:i,refName:a}=t,s=await this.loadData();for(let l of s)(0,cH.doesIntersect2)(l.start,l.end,o,i)&&n.next(new cH.SimpleFeature({...l,refName:a}));n.complete()})}freeResources(){}}});var Rur={};ci(Rur,{default:()=>uH});var pit=et(Ide());var Ede="0.0.9";var Xbe=et(Wr());var jT=et(Wr()),Kbe=et(_p());var Fbe=et(Wr()),Nbe=et(Du()),Ube=et(_p());var Lde=et(Wr()),Fde=et(Du()),Nde=et(_p());var Rde=et(Y_()),Ode=(0,Rde.makeStyles)()({highlight:{height:"100%",background:"rgba(255,255,0,0.2)",border:"1px solid rgba(50,50,0,0.2)",position:"absolute",zIndex:99,textAlign:"center",pointerEvents:"none",overflow:"hidden"},thinborder:{border:"1px solid black"}});var _it=(0,Nde.observer)(function({assemblyName:t,start:r,end:n,refName:o,model:i}){let{cx:a,classes:s}=Ode(),{assemblyManager:l}=(0,Fde.getSession)(i),{offsetPx:c}=i,d=l.get(t)?.getCanonicalRefName(o)??o,f=i.bpToPx({refName:d,coord:r}),m=i.bpToPx({refName:d,coord:n});if(f&&m){let p=Math.max(Math.abs(m.offsetPx-f.offsetPx),3),h=Math.min(f.offsetPx,m.offsetPx)-c;return Lde.default.createElement("div",{className:a(s.highlight,p<=3?s.thinborder:void 0),style:{left:h,width:p}})}else return null}),jw=_it;Vm();var Lbe=Object.fromEntries([{name:"alanine",abbreviation:"Ala",singleLetterCode:"A"},{name:"arginine",abbreviation:"Arg",singleLetterCode:"R"},{name:"asparagine",abbreviation:"Asn",singleLetterCode:"N"},{name:"aspartic acid",abbreviation:"Asp",singleLetterCode:"D"},{name:"cysteine",abbreviation:"Cys",singleLetterCode:"C"},{name:"glutamic acid",abbreviation:"Glu",singleLetterCode:"E"},{name:"glutamine",abbreviation:"Gln",singleLetterCode:"Q"},{name:"glycine",abbreviation:"Gly",singleLetterCode:"G"},{name:"histidine",abbreviation:"His",singleLetterCode:"H"},{name:"isoleucine",abbreviation:"Ile",singleLetterCode:"I"},{name:"leucine",abbreviation:"Leu",singleLetterCode:"L"},{name:"lysine",abbreviation:"Lys",singleLetterCode:"K"},{name:"methionine",abbreviation:"Met",singleLetterCode:"M"},{name:"phenylalanine",abbreviation:"Phe",singleLetterCode:"F"},{name:"proline",abbreviation:"Pro",singleLetterCode:"P"},{name:"serine",abbreviation:"Ser",singleLetterCode:"S"},{name:"threonine",abbreviation:"Thr",singleLetterCode:"T"},{name:"tryptophan",abbreviation:"Trp",singleLetterCode:"W"},{name:"tyrosine",abbreviation:"Tyr",singleLetterCode:"Y"},{name:"valine",abbreviation:"Val",singleLetterCode:"V"}].map(e=>[e.abbreviation.toUpperCase(),e]));function YL(e){return!!e&&typeof e=="object"&&"hoverFeature"in e&&"hoverPosition"in e}function XL({structure:e,selectedResidue:t}){return Vo.getStructureSelection(r=>r.struct.generator.atomGroups({"residue-test":r.core.rel.eq([r.struct.atomProperty.macromolecular.label_seq_id(),t]),"group-by":r.struct.atomProperty.macromolecular.residueKey()}),e)}function CY({chain:e,code:t,structureSeqPos:r}){return[r===void 0?"":`Position: ${r+1}`,t?`Letter: ${t} (${Lbe[t]?.singleLetterCode})`:"",e?`Chain: ${e}`:""].filter(n=>!!n).join(", ")}function wY(e){return Object.fromEntries(Object.entries(e).map(([t,r])=>[r,+t]).filter(t=>t[0]!==void 0))}var Mpt=(0,Ube.observer)(function({model:e}){let t=(0,Nbe.getSession)(e),{views:r,hovered:n}=t;if(YL(n)&&r.some(o=>o.type==="ProteinView")){let{assemblyNames:o}=e,{coord:i,refName:a}=n.hoverPosition;return Fbe.default.createElement(jw,{model:e,start:i-1,end:i,refName:a,assemblyName:o[0]})}return null}),Vbe=Mpt;var ZL=et(Wr()),zbe=et(Du()),qbe=et(_p());var Bpt=(0,qbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,zbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?ZL.default.createElement(ZL.default.Fragment,null,o?.structures.map(s=>s.clickGenomeHighlights.map((l,c)=>ZL.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),jbe=Bpt;var $L=et(Wr()),Gbe=et(Du()),Hbe=et(_p());var Rpt=(0,Hbe.observer)(function({model:e}){let{assemblyManager:t,views:r}=(0,Gbe.getSession)(e),{assemblyNames:n}=e,o=r.find(s=>s.type==="ProteinView"),i=n[0];return t.get(i)?$L.default.createElement($L.default.Fragment,null,o?.structures.map(s=>s.hoverGenomeHighlights.map((l,c)=>$L.default.createElement(jw,{key:`${JSON.stringify(l)}-${c}`,start:l.start,end:l.end,refName:l.refName,assemblyName:i,model:e})))):null}),Wbe=Rpt;var Opt=(0,Kbe.observer)(function({model:t}){return jT.default.createElement(jT.default.Fragment,null,jT.default.createElement(jbe,{model:t}),jT.default.createElement(Wbe,{model:t}),jT.default.createElement(Vbe,{model:t}))}),Ybe=Opt;function TY(e){e.addToExtensionPoint("LinearGenomeView-TracksContainerComponent",(t=[],{model:r})=>[...t,Xbe.default.createElement(Ybe,{key:"highlight_protein_viewer_protein3d",model:r})])}var l1e=et(QL());var Qbe=et(ZD());var Lpt=(0,Qbe.ConfigurationSchema)("AlphaFoldConfidenceAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),Jbe=Lpt;function AY(e){e.addAdapterType(()=>new l1e.default({name:"AlphaFoldConfidenceAdapter",displayName:"AlphaFoldConfidence adapter",configSchema:Jbe,getAdapterClass:()=>Promise.resolve().then(()=>(s1e(),a1e)).then(t=>t.default)}))}var g1e=et(QL());var c1e=et(ZD());var Fpt=(0,c1e.ConfigurationSchema)("AlphaMissensePathogenicityAdapter",{location:{type:"fileLocation",defaultValue:{uri:"/path/to/my.bed.gz",locationType:"UriLocation"}}},{explicitlyTyped:!0}),u1e=Fpt;function PY(e){e.addAdapterType(()=>new g1e.default({name:"AlphaMissensePathogenicityAdapter",displayName:"AlphaMissensePathogenicity adapter",configSchema:u1e,getAdapterClass:()=>Promise.resolve().then(()=>(h1e(),p1e)).then(t=>t.default)}))}var ij=et(Du());GT();var b1e=et(gn(),1),x1e=(0,yg.createSvgIcon)((0,b1e.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var xm=et(Wr()),VYe=et(xx()),vR=et(Jl());var Ol=et(Wr()),_F=et(xx()),CF=et(Du()),wF=et(Jl()),axe=et(_p()),sxe=et(Y_());var Ou=et(Wr()),F2=et(Jl());var Sx=et(Wr()),w1e=et(Du()),WT=et(Jl()),T1e=et(Y_());function HT(e){let t=e.get("subfeatures")??[];return t.some(r=>r.get("type")==="CDS"||r.get("type")==="exon")?[e]:t}function C1e(e){return e?.replace(/\.[^./]+$/,"")}function $D(e){return e.get("name")??e.get("id")}function iF(e){return e===void 0?"":e.id()}function ef(e){return e===void 0?"":[e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}function H0(e){return e===void 0?"":[e.get("gene_name")??e.get("name")??e.get("id")].filter(t=>!!t).join(" ")}var Npt=(0,T1e.makeStyles)()({textAreaFont:{fontFamily:"Courier New",whiteSpace:"pre"},margin:{marginLeft:20}});function QD({structureName:e,structureSequence:t,isoformSequences:r}){let{classes:n}=Npt(),[o,i]=(0,Sx.useState)(!1),a=Object.fromEntries(Object.entries(r).map(([u,d])=>[u,{...d,seq:d.seq.replaceAll("*","")}])),s=Object.entries(a).find(([u,d])=>t===d.seq),l=`${e||""} (structure residues)`,c=(0,w1e.max)([l.length,...Object.entries(a).map(([u,d])=>ef(d.feature).length)]);return Sx.default.createElement(Sx.default.Fragment,null,Sx.default.createElement(WT.FormControlLabel,{className:n.margin,control:Sx.default.createElement(WT.Checkbox,{onChange:u=>{i(u.target.checked)},checked:o}),label:"Show in FASTA format?"}),Sx.default.createElement(WT.TextField,{variant:"outlined",multiline:!0,minRows:5,maxRows:10,fullWidth:!0,value:o?[`>${l}
|
|
10532
10532
|
${t}`,...Object.values(a).map(({feature:u,seq:d})=>`>${ef(u)}
|
|
10533
10533
|
${d}`)].join(`
|
|
10534
10534
|
`):[`${l.padEnd(c)}${s?"*":" "} ${t}`,s?`${ef(s[1].feature).padEnd(c)}* ${s[1].seq}`:void 0,...Object.entries(a).map(([u,d])=>`${ef(d.feature).padEnd(c)} ${d.seq}`).filter(([u])=>u!==s?.[0])].filter(u=>!!u).join(`
|