pdbe-molstar
Version:
Molstar implementation for PDBe
25 lines (23 loc) • 6.11 MB
JavaScript
/**
* pdbe-molstar
* @version 3.12.0
* @link https://github.com/PDBeurope/pdbe-molstar
* @license Apache 2.0
*/
/**
* Copyright 2019-2023 Mandar Deshpande <mandar@ebi.ac.uk>, Adam Midlik <midlik@ebi.ac.uk>
* European Bioinformatics Institute (EBI, http://www.ebi.ac.uk/)
* European Molecular Biology Laboratory (EMBL, http://www.embl.de/)
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*! For license information please see pdbe-molstar-plugin.js.LICENSE.txt */
(()=>{var __webpack_modules__={20(e,t,n){"use strict";var r=n(92861).Buffer,i=n(47108),A=n(28399),o=n(56698),a=n(35359),s=n(74847),c=n(62951);function l(e){A.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){A.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function g(e){return new l(e)}function d(e){return new u(e)}Object.keys(c).forEach(function(e){c[e].id=r.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),o(l,A.Writable),l.prototype._write=function(e,t,n){this._hash.update(e),n()},l.prototype.update=function(e,t){return this._hash.update("string"==typeof e?r.from(e,t):e),this},l.prototype.sign=function(e,t){this.end();var n=this._hash.digest(),r=a(n,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},o(u,A.Writable),u.prototype._write=function(e,t,n){this._hash.update(e),n()},u.prototype.update=function(e,t){return this._hash.update("string"==typeof e?r.from(e,t):e),this},u.prototype.verify=function(e,t,n){var i="string"==typeof t?r.from(t,n):t;this.end();var A=this._hash.digest();return s(i,A,e,this._signType,this._tag)},e.exports={Sign:g,Verify:d,createSign:g,createVerify:d}},160(e,t,n){"use strict";n.d(t,{Km:()=>s,Xl:()=>a});var r=n(21087),i=n(22422),A=n(33101);const o=new Uint8Array(772);function a(e,t){if(0===t)return 0;const n=new Uint32Array(e.buffer,0,e.buffer.byteLength>>2),r=t-4>>2,i=4*r;let A=0;if(r<0)for(let n=0;n<t;++n)A+=e[n]&&1;else{for(let e=0;e<r;++e){const t=n[e];A+=o[65535&t]+o[t>>16]}for(let n=i;n<t;++n)A+=e[n]&&1}return A/t}function s(e,t,n){const o=(0,A.xg)(Math.max(1,e),1,Uint8Array,n&&n.tMarker.ref.value.array),s=a(o.array,e),c=0===s?0:-1;return n?(r.IQ.updateIfChanged(n.uMarker,0),r.IQ.update(n.tMarker,o),r.IQ.update(n.uMarkerTexDim,i.Vec2.create(o.width,o.height)),r.IQ.updateIfChanged(n.markerAverage,s),r.IQ.updateIfChanged(n.markerStatus,c),r.IQ.updateIfChanged(n.dMarkerType,t),n):{uMarker:r.IQ.create(0),tMarker:r.IQ.create(o),uMarkerTexDim:r.IQ.create(i.Vec2.create(o.width,o.height)),markerAverage:r.IQ.create(s),markerStatus:r.IQ.create(c),dMarkerType:r.IQ.create(t)}}o[1]=1,o[2]=1,o[3]=1,o[256]=1,o[512]=1,o[768]=1,o[257]=2,o[513]=2,o[769]=2,o[258]=2,o[514]=2,o[770]=2,o[259]=2,o[515]=2,o[771]=2,new Uint8Array(1)},251(e,t){t.read=function(e,t,n,r,i){var A,o,a=8*i-r-1,s=(1<<a)-1,c=s>>1,l=-7,u=n?i-1:0,g=n?-1:1,d=e[t+u];for(u+=g,A=d&(1<<-l)-1,d>>=-l,l+=a;l>0;A=256*A+e[t+u],u+=g,l-=8);for(o=A&(1<<-l)-1,A>>=-l,l+=r;l>0;o=256*o+e[t+u],u+=g,l-=8);if(0===A)A=1-c;else{if(A===s)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),A-=c}return(d?-1:1)*o*Math.pow(2,A-r)},t.write=function(e,t,n,r,i,A){var o,a,s,c=8*A-i-1,l=(1<<c)-1,u=l>>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:A-1,h=r?1:-1,B=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-o))<1&&(o--,s*=2),(t+=o+u>=1?g/s:g*Math.pow(2,1-u))*s>=2&&(o++,s/=2),o+u>=l?(a=0,o=l):o+u>=1?(a=(t*s-1)*Math.pow(2,i),o+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[n+d]=255&a,d+=h,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[n+d]=255&o,d+=h,o/=256,c-=8);e[n+d-h]|=128*B}},312(e,t,n){"use strict";n.d(t,{K:()=>r});var r,i=n(51142),A=n(9422);!function(e){function t(e){const t={create:e=>({action:t,params:e}),id:i.UUID.create22(),definition:e,createDefaultParams:(t,n)=>e.params?A.ParamDefinition.getDefaultValues(e.params(t,n)):{}};return t}let n;e.create=t,e.fromTransformer=function(e){const n=e.definition;return t({from:n.from,display:n.display,params:n.params,isApplicable:e.definition.isApplicable?(t,n,r)=>e.definition.isApplicable(t,r):void 0,run({cell:t,state:n,params:r}){const i=n.build().to(t.transform.ref).apply(e,r);return n.updateTree(i)}})},function(e){e.build=e=>function(e){return n=>t({from:e.from instanceof Array?e.from:e.from?[e.from]:[],display:"string"==typeof e.display?{name:e.display}:e.display?e.display:{name:"Unnamed State Action"},params:"object"==typeof e.params?()=>e.params:e.params?e.params:void 0,isApplicable:e.isApplicable,..."function"==typeof n?{run:n}:n})}(e)}(n=e.Builder||(e.Builder={})),e.build=n.build}(r||(r={}))},330(e,t,n){"use strict";n.d(t,{i:()=>i});var r=n(9422);function i(e){return{...i.Zero,...e}}!function(e){e.Zero={metalness:0,roughness:0,bumpiness:0},e.toArray=function(e,t,n){return t[n]=255*e.metalness,t[n+1]=255*e.roughness,t[n+2]=255*e.bumpiness,t},e.toArrayNormalized=function(e,t,n){return t[n]=e.metalness,t[n+1]=e.roughness,t[n+2]=e.bumpiness,t},e.areEqual=function(e,t){return e.metalness===t.metalness&&e.roughness===t.roughness&&e.bumpiness===t.bumpiness},e.toString=function({metalness:e,roughness:t,bumpiness:n}){return`M ${e.toFixed(2)} | R ${t.toFixed(2)} | B ${n.toFixed(2)}`},e.getParam=function(e){return r.ParamDefinition.Group({metalness:r.ParamDefinition.Numeric(0,{min:0,max:1,step:.01}),roughness:r.ParamDefinition.Numeric(1,{min:0,max:1,step:.01}),bumpiness:r.ParamDefinition.Numeric(0,{min:0,max:1,step:.01})},{...e,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"]]})}}(i||(i={}))},342(e,t,n){"use strict";n.r(t),n.d(t,{clearStructureTransparency:()=>l,setStructureTransparency:()=>c});var r=n(28243),i=n(18842),A=n(66139),o=n(51139),a=n(75216);const s="transparency-controls";async function c(e,t,n,A,c){await u(e,t,async(e,t,l)=>{if(c&&c.length>0&&!c.includes(t.params.values.type.name))return;const u=t.obj.data.sourceData,d=await A(u.root);if(o.Loci.isEmpty(d)||(0,o.isEmptyLoci)(d))return;const h={bundle:r.StructureElement.Bundle.fromLoci(d),value:n};if(l){const t=g([...l.params.values.layers,h],u);e.to(l).update(a.Transparency.toBundle(t))}else{const n=g([h],u);e.to(t.transform.ref).apply(i.StateTransforms.Representation.TransparencyStructureRepresentation3DFromBundle,a.Transparency.toBundle(n),{tags:s})}})}async function l(e,t,n){await u(e,t,async(e,t,r)=>{n&&n.length>0&&!n.includes(t.params.values.type.name)||r&&e.delete(r.transform.ref)})}async function u(e,t,n){const r=e.state.data,o=r.build();for(const e of t)for(const t of e.representations){const e=r.select(A.StateSelection.Generators.ofTransformer(i.StateTransforms.Representation.TransparencyStructureRepresentation3DFromBundle,t.cell.transform.ref).withTag(s));await n(o,t.cell,e[0])}return o.commit({doNotUpdateCurrent:!0})}function g(e,t){const n=a.Transparency.ofBundle(e,t.root),r=a.Transparency.merge(n);return a.Transparency.filter(r,t)}},459(e,t,n){"use strict";n.r(t),n.d(t,{BoxifyVolumeStreaming:()=>b,CreateVolumeStreamingBehavior:()=>S,CreateVolumeStreamingInfo:()=>w,InitVolumeStreaming:()=>v,VolumeStreamingVisual:()=>F});var r,i=n(5447),A=n(22422),o=n(28243),a=n(40728),s=n(46124),c=n(12720),l=n(57193),u=n(47323),g=n(66139),d=n(65514),h=n(84465),B=n(51142),f=n(9422),p=n(44090),m=n(31517),I=n(31511);class Q extends(c.PluginStateObject.Create({name:"Volume Streaming",typeClass:"Object"})){}!function(e){let t;!function(e){e.Float32="float32",e.Int8="int8"}(t=e.ValueType||(e.ValueType={}))}(r||(r={}));var E=n(2469);function C(e,t,n){return{dataId:t,source:"em"===e?{name:"em",params:{isoValue:s.f.IsoValue.absolute(n||0)}}:{name:"x-ray",params:{}}}}async function y(e,t,n,r,i){const A=[];for(const o of e){const e=o.toLowerCase();if("em"===t){let o;e.startsWith("emd")?o=[e]:(await i.update("Getting EMDB info..."),o=await(0,E.t9)(r,i,e));for(const e of o){let o;try{o=await(0,E.lL)(n,r,i,e)}catch(t){console.info(`Could not get map info for ${e}: ${t}`);continue}A.push(C(t,e,o||0))}}else A.push(C(t,e,0))}return A}const v=g.StateAction.build({display:{name:"Volume Streaming"},from:c.PluginStateObject.Molecule.Structure,params(e,t){const n=(0,E.AR)(e&&e.data),r=(0,E.rO)(n,e&&e.data);return{method:f.ParamDefinition.Select(n,[["em","EM"],["x-ray","X-Ray"]]),entries:f.ParamDefinition.ObjectList({id:f.ParamDefinition.Text(r[0]||"")},({id:e})=>e,{defaultValue:r.map(e=>({id:e}))}),defaultView:f.ParamDefinition.Select("em"===n?"auto":"selection-box",I.h.ViewTypeOptions),options:f.ParamDefinition.Group({serverUrl:f.ParamDefinition.Text(t.config.get(m.PluginConfig.VolumeStreaming.DefaultServer)||"https://ds.litemol.org"),behaviorRef:f.ParamDefinition.Text("",{isHidden:!0}),emContourProvider:f.ParamDefinition.Select("emdb",[["emdb","EMDB"],["pdbe","PDBe"]],{isHidden:!0}),channelParams:f.ParamDefinition.Value({},{isHidden:!0})})}},isApplicable:(e,t,n)=>{const r=n.config.get(m.PluginConfig.VolumeStreaming.CanStream);return r?r(e.data,n):1===e.data.models.length&&o.Model.probablyHasDensityMap(e.data.models[0])}})(({ref:e,state:t,params:n},r)=>d.Task.create("Volume Streaming",async i=>{const A=await y(n.entries.map(e=>e.id),n.method,n.options.emContourProvider,r,i),o=t.build().to(e).applyOrUpdateTagged(I.h.RootTag,w,{serverUrl:n.options.serverUrl,entries:A});await o.commit();const a=o.selector;if(!a.isOk)return;const s=t.tree.children.get(a.ref);(null==s?void 0:s.size)>0&&await r.managers.structure.hierarchy.remove(null==s?void 0:s.toArray());const c=a.cell.obj,l=t.build().to(o.ref).apply(S,f.ParamDefinition.getDefaultValues(I.h.createParams({data:c.data,defaultView:n.defaultView,channelParams:n.options.channelParams})),{ref:n.options.behaviorRef?n.options.behaviorRef:void 0});"em"===n.method?l.apply(F,{channel:"em"},{state:{isGhost:!0},tags:"em"}):(l.apply(F,{channel:"2fo-fc"},{state:{isGhost:!0},tags:"2fo-fc"}),l.apply(F,{channel:"fo-fc(+ve)"},{state:{isGhost:!0},tags:"fo-fc(+ve)"}),l.apply(F,{channel:"fo-fc(-ve)"},{state:{isGhost:!0},tags:"fo-fc(-ve)"})),await t.updateTree(l).runInContext(i)})),b=g.StateAction.build({display:{name:"Boxify Volume Streaming",description:"Make the current box permanent."},from:I.h,isApplicable:e=>"selection-box"===e.data.params.entry.params.view.name})(({a:e,ref:t,state:n},r)=>{const o=e.data.params;if("selection-box"!==o.entry.params.view.name)return;const a=i.DJ.create(A.Vec3.clone(o.entry.params.view.params.bottomLeft),A.Vec3.clone(o.entry.params.view.params.topRight)),s=o.entry.params.view.params.radius;i.DJ.expand(a,a,A.Vec3.create(s,s,s));const c={...o,entry:{name:o.entry.name,params:{...o.entry.params,view:{name:"box",params:{bottomLeft:a.min,topRight:a.max}}}}};return n.updateTree(n.build().to(t).update(c))}),D={dataId:f.ParamDefinition.Text(""),source:f.ParamDefinition.MappedStatic("x-ray",{em:f.ParamDefinition.Group({isoValue:s.f.createIsoValueParam(s.f.IsoValue.relative(1))}),"x-ray":f.ParamDefinition.Group({})})},w=c.PluginStateTransform.BuiltIn({name:"create-volume-streaming-info",display:{name:"Volume Streaming Info"},from:c.PluginStateObject.Molecule.Structure,to:Q,params:(e,t)=>({serverUrl:f.ParamDefinition.Text(t.config.get(m.PluginConfig.VolumeStreaming.DefaultServer)||"https://ds.litemol.org"),autoEntries:f.ParamDefinition.Boolean(!1,{description:'Create "entries" list automatically based on the input structure'}),entries:f.ParamDefinition.ObjectList(D,({dataId:e})=>e,{defaultValue:[{dataId:"",source:{name:"x-ray",params:{}}}],hideIf:e=>e.autoEntries}),defaultView:f.ParamDefinition.Select("em"===(0,E.AR)(null==e?void 0:e.data)?"auto":"selection-box",I.h.ViewTypeOptions,{isHidden:!0}),defaultChannelParams:f.ParamDefinition.Value({},{isHidden:!0})})})({apply:({a:e,params:t},n)=>d.Task.create("",async r=>{let i;if(t.autoEntries){await r.update("Creating entry list...");const t=(0,E.AR)(null==e?void 0:e.data),A=(0,E.rO)(t,null==e?void 0:e.data);i=await y(A,t,"emdb",n,r)}else i=t.entries;const A=[];for(const e of i){const i=e.dataId,o="em"===e.source.name?e.source.params.isoValue:s.f.IsoValue.relative(1);await r.update("Getting server header...");const a=await n.fetch({url:(0,p.r)(t.serverUrl,`${e.source.name}/${i.toLocaleLowerCase()}`),type:"json"}).runInContext(r);A.push({dataId:i,kind:e.source.name,header:a,emDefaultContourLevel:o})}const o={serverUrl:t.serverUrl,entries:A,structure:e.data,defaultView:t.defaultView,defaultChannelParams:t.defaultChannelParams};return new Q(o,{label:"Volume Server",description:`${A.map(e=>e.dataId).join(", ")}`})}),update:({a:e,b:t,oldParams:n,newParams:r})=>e.data===t.data.structure&&(0,B.deepEqual)(n,r)?g.StateTransformer.UpdateResult.Unchanged:g.StateTransformer.UpdateResult.Recreate}),S=c.PluginStateTransform.BuiltIn({name:"create-volume-streaming-behavior",display:{name:"Volume Streaming Behavior"},from:Q,to:I.h,params:e=>I.h.createParams({data:null==e?void 0:e.data,defaultView:null==e?void 0:e.data.defaultView,channelParams:null==e?void 0:e.data.defaultChannelParams})})({canAutoUpdate:({oldParams:e,newParams:t})=>e.entry.params.view===t.entry.params.view||"selection-box"===t.entry.params.view.name||"camera-target"===t.entry.params.view.name||"off"===t.entry.params.view.name,apply:({a:e,params:t},n)=>d.Task.create("Volume streaming",async r=>{const i=new I.h.Behavior(n,e.data);return await i.update(t),new I.h(i,{label:"Volume Streaming",description:i.getDescription()})}),update:({a:e,b:t,oldParams:n,newParams:r})=>d.Task.create("Update Volume Streaming",async e=>{if(n.entry.name!==r.entry.name&&"em"in r.entry.params.channels){const{emDefaultContourLevel:e}=t.data.infoMap.get(r.entry.name);e&&(r.entry.params.channels.em.isoValue=e)}const i=await t.data.update(r)?g.StateTransformer.UpdateResult.Updated:g.StateTransformer.UpdateResult.Unchanged;return t.description=t.data.getDescription(),i})}),F=c.PluginStateTransform.BuiltIn({name:"create-volume-streaming-visual",display:{name:"Volume Streaming Visual"},from:I.h,to:c.PluginStateObject.Volume.Representation3D,params:{channel:f.ParamDefinition.Select("em",I.h.ChannelTypeOptions,{isHidden:!0})}})({apply:({a:e,params:t,spine:n},r)=>d.Task.create("Volume Representation",async i=>{var A,o;const s=e.data.channels[t.channel];if(!s)return g.StateObject.Null;const l=x(e.data,t.channel),d=u.H.BuiltIn.isosurface,B=l.type.params||{},f=d.factory({webgl:null===(A=r.canvas3d)||void 0===A?void 0:A.webgl,...r.representation.volume.themes},d.getParams);f.setTheme(h.S.create(r.representation.volume.themes,{volume:s.data},l));const p=null===(o=n.getAncestorOfType(c.PluginStateObject.Molecule.Structure))||void 0===o?void 0:o.data,m=0===(null==p?void 0:p.models.length)?void 0:a.T.get(null==p?void 0:p.models[0]);return await f.createOrUpdate(B,s.data).runInContext(i),m&&f.setState({transform:m}),new c.PluginStateObject.Volume.Representation3D({repr:f,sourceData:s.data},{label:`${Math.round(100*s.isoValue.relativeValue)/100} σ [${t.channel}]`})}),update:({a:e,b:t,newParams:n,spine:r},i)=>d.Task.create("Volume Representation",async r=>{const A=e.data.channels[n.channel];if(!A)return g.StateTransformer.UpdateResult.Unchanged;const o=t.data.repr.state.visible,a=x(e.data,n.channel),s={...t.data.repr.props,...a.type.params};return t.data.repr.setTheme(h.S.create(i.representation.volume.themes,{volume:A.data},a)),await t.data.repr.createOrUpdate(s,A.data).runInContext(r),t.data.repr.setState({visible:o}),t.data.sourceData=A.data,g.StateTransformer.UpdateResult.Updated})});function x(e,t){const n=e.channels[t];return l.VolumeRepresentation3DHelpers.getDefaultParamsStatic(e.plugin,"isosurface",{isoValue:n.isoValue,alpha:n.opacity,visuals:n.wireframe?["wireframe"]:["solid"]},"uniform",{value:n.color})}},487(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StateGalleryExtensionFunctions=t.StateGallery=t.StateGalleryCustomState=t.StateGalleryExtensionName=void 0;const r=n(10186),i=n(51142),A=n(9422),o=n(79364),a=n(58640),s=n(94334),c=n(12039);t.StateGalleryExtensionName="pdbe-state-gallery",t.StateGalleryCustomState=a.ExtensionCustomState.getter(t.StateGalleryExtensionName),t.StateGallery=r.PluginBehavior.create({name:t.StateGalleryExtensionName,category:"misc",display:{name:"3D State Gallery",description:"Browse pre-computed 3D states for a PDB entry"},ctor:class extends r.PluginBehavior.Handler{register(){(0,t.StateGalleryCustomState)(this.ctx).requestedImage=new o.BehaviorSubject(void 0),(0,t.StateGalleryCustomState)(this.ctx).manager=new o.BehaviorSubject(void 0),(0,t.StateGalleryCustomState)(this.ctx).status=new o.BehaviorSubject("ready"),this.toggleStructureControls(this.params.showControls),this.toggleTitleBox(this.params.showTitleBox)}update(e){return!(0,i.shallowEqual)(e,this.params)&&(this.toggleStructureControls(e.showControls),this.toggleTitleBox(e.showTitleBox),this.params=e,!0)}unregister(){this.toggleStructureControls(!1),this.toggleTitleBox(!1),a.ExtensionCustomState.clear(this.ctx,t.StateGalleryExtensionName)}toggleStructureControls(e){a.PluginCustomControls.toggle(this.ctx,"structure-tools",t.StateGalleryExtensionName,c.StateGalleryControls,e)}toggleTitleBox(e){a.PluginCustomControls.toggle(this.ctx,"viewport-top-center",t.StateGalleryExtensionName,c.StateGalleryTitleBox,e)}},params:()=>({showControls:A.ParamDefinition.Boolean(!0,{description:'Show "3D State Gallery" section in Structure Tools controls'}),showTitleBox:A.ParamDefinition.Boolean(!0,{description:"Show a box in viewport with state title and arrows to move between states"})})}),t.StateGalleryExtensionFunctions={StateGalleryManager:s.StateGalleryManager,StateGalleryCustomState:t.StateGalleryCustomState,UI:{StateGalleryControls:c.StateGalleryControls}}},530(e,t,n){var r={ECB:n(52632),CBC:n(92884),CFB:n(46383),CFB8:n(86975),CFB1:n(55264),OFB:n(46843),CTR:n(63053),GCM:n(63053)},i=n(3219);for(var A in i)i[A].module=r[i[A].mode];e.exports=i},761(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.switchMapTo=void 0;var r=n(90680),i=n(10281);t.switchMapTo=function(e,t){return i.isFunction(t)?r.switchMap(function(){return e},t):r.switchMap(function(){return e})}},784(e,t,n){"use strict";n.d(t,{r:()=>d});var r=n(81324).Column.Schema;const i=r.str,A=r.int,o=r.float,a=r.coord,s=r.Aliased,c=r.Matrix,l=r.Vector,u=r.lstr,g=r.List,d={atom_site:{auth_asym_id:i,auth_atom_id:i,auth_comp_id:i,auth_seq_id:A,B_iso_or_equiv:o,Cartn_x:a,Cartn_y:a,Cartn_z:a,group_PDB:s(i),id:A,label_alt_id:i,label_asym_id:i,label_atom_id:i,label_comp_id:i,label_entity_id:i,label_seq_id:A,occupancy:o,type_symbol:i,pdbx_PDB_ins_code:i,pdbx_PDB_model_num:A,pdbx_formal_charge:A,pdbx_label_index:A,pdbx_sifts_xref_db_name:i,pdbx_sifts_xref_db_acc:i,pdbx_sifts_xref_db_num:i,pdbx_sifts_xref_db_res:i,ihm_model_id:A},atom_site_anisotrop:{id:A,type_symbol:i,U:c(3,3),U_esd:c(3,3),pdbx_auth_seq_id:A,pdbx_auth_asym_id:i,pdbx_auth_atom_id:i,pdbx_auth_comp_id:i,pdbx_label_seq_id:A,pdbx_label_alt_id:i,pdbx_label_asym_id:i,pdbx_label_atom_id:i,pdbx_label_comp_id:i,pdbx_PDB_ins_code:i},atom_sites:{entry_id:i,fract_transf_matrix:c(3,3),fract_transf_vector:l(3)},audit_author:{name:i,pdbx_ordinal:A,identifier_ORCID:i},audit_conform:{dict_location:i,dict_name:i,dict_version:i},cell:{angle_alpha:o,angle_beta:o,angle_gamma:o,entry_id:i,length_a:o,length_b:o,length_c:o,Z_PDB:A,pdbx_unique_axis:i},chem_comp:{formula:i,formula_weight:o,id:i,mon_nstd_flag:s(u),name:i,type:s(u),pdbx_synonyms:g(";",e=>e)},chem_comp_bond:{atom_id_1:i,atom_id_2:i,comp_id:i,value_order:s(u),pdbx_ordinal:A,pdbx_stereo_config:s(u),pdbx_aromatic_flag:s(u)},citation:{book_publisher:i,country:i,id:i,journal_abbrev:i,journal_id_ASTM:i,journal_id_CSD:i,journal_id_ISSN:i,journal_volume:i,page_first:i,page_last:i,title:i,year:A,pdbx_database_id_DOI:i,pdbx_database_id_PubMed:A},citation_author:{citation_id:i,name:i,ordinal:A},database_2:{database_id:s(u),database_code:i},entity:{details:i,formula_weight:o,id:i,src_method:s(u),type:s(u),pdbx_description:g(",",e=>e),pdbx_number_of_molecules:A,pdbx_parent_entity_id:i,pdbx_mutation:i,pdbx_fragment:i,pdbx_ec:g(",",e=>e)},entity_poly:{entity_id:i,nstd_linkage:s(u),nstd_monomer:s(u),type:s(i),pdbx_strand_id:g(",",e=>e),pdbx_seq_one_letter_code:i,pdbx_seq_one_letter_code_can:i,pdbx_target_identifier:i},entity_poly_seq:{entity_id:i,hetero:s(u),mon_id:i,num:A},entry:{id:i},exptl:{entry_id:i,method:s(i)},software:{classification:i,date:i,description:i,name:i,type:s(u),version:i,pdbx_ordinal:A},struct:{entry_id:i,title:i,pdbx_structure_determination_methodology:s(i),pdbx_descriptor:i},struct_asym:{details:i,entity_id:i,id:i,pdbx_modified:i,pdbx_blank_PDB_chainid_flag:s(i)},struct_conf:{beg_label_asym_id:i,beg_label_comp_id:i,beg_label_seq_id:A,beg_auth_asym_id:i,beg_auth_comp_id:i,beg_auth_seq_id:A,conf_type_id:s(u),details:i,end_label_asym_id:i,end_label_comp_id:i,end_label_seq_id:A,end_auth_asym_id:i,end_auth_comp_id:i,end_auth_seq_id:A,id:i,pdbx_beg_PDB_ins_code:i,pdbx_end_PDB_ins_code:i,pdbx_PDB_helix_class:i,pdbx_PDB_helix_length:A,pdbx_PDB_helix_id:i},struct_conn:{conn_type_id:s(u),details:i,id:i,ptnr1_label_asym_id:i,ptnr1_label_atom_id:i,ptnr1_label_comp_id:i,ptnr1_label_seq_id:A,ptnr1_auth_asym_id:i,ptnr1_auth_comp_id:i,ptnr1_auth_seq_id:A,ptnr1_symmetry:i,ptnr2_label_asym_id:i,ptnr2_label_atom_id:i,ptnr2_label_comp_id:i,ptnr2_label_seq_id:A,ptnr2_auth_asym_id:i,ptnr2_auth_comp_id:i,ptnr2_auth_seq_id:A,ptnr2_symmetry:i,pdbx_ptnr1_PDB_ins_code:i,pdbx_ptnr1_label_alt_id:i,pdbx_ptnr1_standard_comp_id:i,pdbx_ptnr2_PDB_ins_code:i,pdbx_ptnr2_label_alt_id:i,pdbx_ptnr3_PDB_ins_code:i,pdbx_ptnr3_label_alt_id:i,pdbx_ptnr3_label_asym_id:i,pdbx_ptnr3_label_atom_id:i,pdbx_ptnr3_label_comp_id:i,pdbx_ptnr3_label_seq_id:A,pdbx_PDB_id:i,pdbx_dist_value:o,pdbx_value_order:s(u)},struct_conn_type:{criteria:i,id:s(u),reference:i},struct_keywords:{entry_id:i,text:g(",",e=>e),pdbx_keywords:i},struct_mon_prot_cis:{label_alt_id:i,label_asym_id:i,label_comp_id:i,label_seq_id:A,auth_asym_id:i,auth_comp_id:i,auth_seq_id:A,pdbx_auth_asym_id_2:i,pdbx_auth_comp_id_2:i,pdbx_auth_seq_id_2:A,pdbx_label_asym_id_2:i,pdbx_label_comp_id_2:i,pdbx_label_seq_id_2:A,pdbx_PDB_ins_code:i,pdbx_PDB_ins_code_2:i,pdbx_PDB_model_num:A,pdbx_omega_angle:i,pdbx_id:i,pdbx_auth_ins_code:i,pdbx_auth_ins_code_2:i},struct_ncs_oper:{code:s(i),details:i,id:A,matrix:c(3,3),vector:l(3)},struct_sheet_range:{beg_label_asym_id:i,beg_label_comp_id:i,beg_label_seq_id:A,end_label_asym_id:i,end_label_comp_id:i,end_label_seq_id:A,beg_auth_asym_id:i,beg_auth_comp_id:i,beg_auth_seq_id:A,end_auth_asym_id:i,end_auth_comp_id:i,end_auth_seq_id:A,id:i,sheet_id:i,pdbx_beg_PDB_ins_code:i,pdbx_end_PDB_ins_code:i},struct_site:{details:i,id:i,pdbx_num_residues:A,pdbx_evidence_code:i,pdbx_auth_asym_id:i,pdbx_auth_comp_id:i,pdbx_auth_seq_id:A,pdbx_auth_ins_code:i},struct_site_gen:{details:i,id:i,label_alt_id:i,label_asym_id:i,label_atom_id:i,label_comp_id:i,label_seq_id:A,auth_asym_id:i,auth_atom_id:i,auth_comp_id:i,auth_seq_id:A,site_id:i,symmetry:i,pdbx_auth_ins_code:i,pdbx_num_res:A},struct_site_keywords:{site_id:i,text:i},symmetry:{entry_id:i,cell_setting:s(u),Int_Tables_number:A,space_group_name_Hall:i,"space_group_name_H-M":i},pdbx_database_status:{status_code:s(i),status_code_sf:s(i),status_code_mr:s(i),entry_id:i,recvd_initial_deposition_date:i,SG_entry:s(u),deposit_site:s(i),process_site:s(i),status_code_cs:s(i),methods_development_category:s(i),pdb_format_compatible:s(u)},pdbx_nonpoly_scheme:{asym_id:i,entity_id:i,mon_id:i,pdb_strand_id:i,ndb_seq_num:i,pdb_seq_num:i,auth_seq_num:i,pdb_mon_id:i,auth_mon_id:i,pdb_ins_code:i},pdbx_database_related:{db_name:s(i),details:i,db_id:i,content_type:s(i)},pdbx_entity_nonpoly:{entity_id:i,comp_id:i,name:i},pdbx_chem_comp_synonyms:{name:i,comp_id:i,provenance:s(i)},pdbx_chem_comp_identifier:{comp_id:i,identifier:i,type:s(i),program:i,program_version:i},pdbx_unobs_or_zero_occ_residues:{id:A,polymer_flag:s(u),occupancy_flag:s(A),PDB_model_num:A,auth_asym_id:i,auth_comp_id:i,auth_seq_id:A,PDB_ins_code:i,label_asym_id:i,label_comp_id:i,label_seq_id:A},pdbx_struct_mod_residue:{id:A,auth_asym_id:i,auth_comp_id:i,auth_seq_id:A,PDB_ins_code:i,label_asym_id:i,label_comp_id:i,label_seq_id:A,parent_comp_id:i,details:i},pdbx_struct_oper_list:{id:i,type:s(i),name:i,symmetry_operation:i,matrix:c(3,3),vector:l(3)},pdbx_struct_assembly:{method_details:i,oligomeric_details:i,oligomeric_count:A,details:i,id:i},pdbx_struct_assembly_gen:{asym_id_list:g(",",e=>e),assembly_id:i,oper_expression:i},pdbx_reference_entity_list:{prd_id:i,ref_entity_id:i,type:s(u),details:i,component_id:A},pdbx_reference_entity_link:{link_id:A,prd_id:i,details:i,ref_entity_id_1:i,ref_entity_id_2:i,entity_seq_num_1:A,entity_seq_num_2:A,comp_id_1:i,comp_id_2:i,atom_id_1:i,atom_id_2:i,value_order:s(u),component_1:A,component_2:A,link_class:s(i)},pdbx_reference_entity_poly_link:{link_id:A,prd_id:i,ref_entity_id:i,component_id:A,entity_seq_num_1:A,entity_seq_num_2:A,comp_id_1:i,comp_id_2:i,atom_id_1:i,atom_id_2:i,value_order:s(u)},pdbx_molecule:{prd_id:i,instance_id:A,asym_id:i},pdbx_molecule_features:{prd_id:i,class:s(u),type:s(u),name:i,details:i},entity_src_nat:{entity_id:i,pdbx_organism_scientific:i,pdbx_plasmid_name:i,pdbx_src_id:A,pdbx_beg_seq_num:A,pdbx_end_seq_num:A},entity_src_gen:{entity_id:i,pdbx_gene_src_gene:g(",",e=>e),pdbx_gene_src_scientific_name:i,plasmid_name:i,pdbx_src_id:A,pdbx_beg_seq_num:A,pdbx_end_seq_num:A},pdbx_entity_src_syn:{organism_scientific:i,entity_id:i,pdbx_src_id:A,pdbx_beg_seq_num:A,pdbx_end_seq_num:A},pdbx_entity_branch_descriptor:{entity_id:i,descriptor:i,type:s(u),program:i,program_version:i,ordinal:A},pdbx_entity_instance_feature:{details:i,feature_type:s(i),auth_asym_id:i,asym_id:i,auth_seq_num:i,seq_num:A,comp_id:i,auth_comp_id:i,ordinal:A},pdbx_entity_branch_list:{entity_id:i,hetero:s(u),comp_id:i,num:A},pdbx_entity_branch_link:{link_id:A,details:i,entity_id:i,entity_branch_list_num_1:A,entity_branch_list_num_2:A,comp_id_1:i,comp_id_2:i,atom_id_1:i,leaving_atom_id_1:i,atom_stereo_config_1:s(u),atom_id_2:i,leaving_atom_id_2:i,atom_stereo_config_2:s(u),value_order:s(u)},pdbx_entity_branch:{entity_id:i,type:s(i)},pdbx_branch_scheme:{entity_id:i,hetero:s(u),asym_id:i,mon_id:i,num:A,pdb_asym_id:i,pdb_seq_num:i,pdb_mon_id:i,auth_asym_id:i,auth_seq_num:i,auth_mon_id:i},pdbx_chem_comp_related:{comp_id:i,related_comp_id:i,relationship_type:s(i),details:i},ihm_starting_model_details:{starting_model_id:i,entity_id:i,entity_description:i,asym_id:i,entity_poly_segment_id:A,starting_model_source:s(i),starting_model_auth_asym_id:i,starting_model_sequence_offset:A,dataset_list_id:A},ihm_starting_comparative_models:{id:A,starting_model_id:i,starting_model_auth_asym_id:i,starting_model_seq_id_begin:A,starting_model_seq_id_end:A,template_auth_asym_id:i,template_seq_id_begin:A,template_seq_id_end:A,template_sequence_identity:o,template_sequence_identity_denominator:s(A),template_dataset_list_id:A,alignment_file_id:A},ihm_starting_model_seq_dif:{id:A,entity_id:i,asym_id:i,seq_id:A,comp_id:i,starting_model_id:i,db_asym_id:i,db_seq_id:A,db_comp_id:i,details:i},ihm_model_representation:{id:A,name:i,details:i},ihm_model_representation_details:{id:A,representation_id:A,entity_poly_segment_id:A,entity_id:i,entity_description:i,entity_asym_id:i,model_object_primitive:s(i),starting_model_id:i,model_mode:s(i),model_granularity:s(i),model_object_count:A},ihm_struct_assembly_details:{id:A,assembly_id:A,parent_assembly_id:A,entity_description:i,entity_id:i,asym_id:i,entity_poly_segment_id:A},ihm_struct_assembly:{id:A,name:i,description:i},ihm_modeling_protocol:{id:A,num_steps:A,protocol_name:i},ihm_modeling_protocol_details:{id:A,protocol_id:A,step_id:A,struct_assembly_id:A,dataset_group_id:A,struct_assembly_description:i,step_name:i,step_method:i,num_models_begin:A,num_models_end:A,multi_scale_flag:s(u),multi_state_flag:s(u),ordered_flag:s(u),script_file_id:A,software_id:A},ihm_multi_state_modeling:{state_id:A,state_group_id:A,population_fraction:o,population_fraction_sd:o,state_type:i,state_name:i,experiment_type:s(i),details:i},ihm_modeling_post_process:{id:A,protocol_id:A,analysis_id:A,step_id:A,type:s(i),feature:s(i),num_models_begin:A,num_models_end:A},ihm_ensemble_info:{ensemble_id:A,ensemble_name:i,post_process_id:A,model_group_id:A,ensemble_clustering_method:s(i),ensemble_clustering_feature:s(i),num_ensemble_models:A,num_ensemble_models_deposited:A,ensemble_precision_value:o,ensemble_file_id:A},ihm_model_list:{model_id:A,model_name:i,assembly_id:A,protocol_id:A,representation_id:A},ihm_model_group:{id:A,name:i,details:i},ihm_model_group_link:{model_id:A,group_id:A},ihm_model_representative:{id:A,model_group_id:A,model_id:A,selection_criteria:s(i)},ihm_dataset_list:{id:A,data_type:s(i),database_hosted:s(u)},ihm_dataset_group:{id:A,name:i,application:s(i),details:i},ihm_dataset_group_link:{dataset_list_id:A,group_id:A},ihm_related_datasets:{dataset_list_id_derived:A,dataset_list_id_primary:A},ihm_dataset_related_db_reference:{id:A,dataset_list_id:A,db_name:s(i),accession_code:i,version:i,details:i},ihm_external_reference_info:{reference_id:A,reference_provider:i,reference_type:s(i),reference:i,refers_to:s(i),associated_url:i},ihm_external_files:{id:A,reference_id:A,file_path:i,content_type:s(i),file_size_bytes:o,details:i},ihm_dataset_external_reference:{id:A,dataset_list_id:A,file_id:A},ihm_localization_density_files:{id:A,file_id:A,ensemble_id:A,entity_id:i,entity_poly_segment_id:A,asym_id:i},ihm_predicted_contact_restraint:{id:A,group_id:A,entity_id_1:i,entity_id_2:i,asym_id_1:i,asym_id_2:i,comp_id_1:i,comp_id_2:i,seq_id_1:A,seq_id_2:A,rep_atom_1:s(i),rep_atom_2:s(i),distance_lower_limit:o,distance_upper_limit:o,probability:o,restraint_type:s(i),model_granularity:s(i),dataset_list_id:A,software_id:A},ihm_cross_link_list:{id:A,group_id:A,entity_description_1:i,entity_description_2:i,entity_id_1:i,entity_id_2:i,comp_id_1:i,comp_id_2:i,seq_id_1:A,seq_id_2:A,linker_type:s(i),dataset_list_id:A},ihm_cross_link_restraint:{id:A,group_id:A,entity_id_1:i,entity_id_2:i,asym_id_1:i,asym_id_2:i,comp_id_1:i,comp_id_2:i,seq_id_1:A,seq_id_2:A,atom_id_1:i,atom_id_2:i,restraint_type:s(i),conditional_crosslink_flag:s(i),model_granularity:s(i),distance_threshold:o,psi:o,sigma_1:o,sigma_2:o},ihm_cross_link_result_parameters:{id:A,restraint_id:A,model_id:A,psi:o,sigma_1:o,sigma_2:o},ihm_2dem_class_average_restraint:{id:A,dataset_list_id:A,number_raw_micrographs:A,pixel_size_width:o,pixel_size_height:o,image_resolution:o,image_segment_flag:s(u),number_of_projections:A,struct_assembly_id:A,details:i},ihm_2dem_class_average_fitting:{id:A,restraint_id:A,model_id:A,cross_correlation_coefficient:o,rot_matrix:c(3,3),tr_vector:l(3)},ihm_3dem_restraint:{id:A,dataset_list_id:A,model_id:A,struct_assembly_id:A,fitting_method:i,number_of_gaussians:A,cross_correlation_coefficient:o},ihm_sas_restraint:{id:A,dataset_list_id:A,model_id:A,struct_assembly_id:A,profile_segment_flag:s(u),fitting_atom_type:i,fitting_method:i,fitting_state:s(i),radius_of_gyration:o,chi_value:o,details:i},ihm_starting_model_coord:{ordinal_id:A,starting_model_id:i,group_PDB:s(i),id:A,type_symbol:i,entity_id:i,atom_id:i,comp_id:i,seq_id:A,asym_id:i,Cartn_x:o,Cartn_y:o,Cartn_z:o,B_iso_or_equiv:o},ihm_sphere_obj_site:{id:A,entity_id:i,seq_id_begin:A,seq_id_end:A,asym_id:i,Cartn_x:o,Cartn_y:o,Cartn_z:o,object_radius:o,rmsf:o,model_id:A},ihm_gaussian_obj_site:{id:A,entity_id:i,seq_id_begin:A,seq_id_end:A,asym_id:i,mean_Cartn_x:o,mean_Cartn_y:o,mean_Cartn_z:o,weight:o,covariance_matrix:c(3,3),model_id:A},ihm_gaussian_obj_ensemble:{id:A,entity_id:i,seq_id_begin:A,seq_id_end:A,asym_id:i,mean_Cartn_x:o,mean_Cartn_y:o,mean_Cartn_z:o,weight:o,covariance_matrix:c(3,3),ensemble_id:A},ihm_feature_list:{feature_id:A,feature_type:s(i),entity_type:s(i)},ihm_poly_residue_feature:{ordinal_id:A,feature_id:A,entity_id:i,asym_id:i,comp_id_begin:i,comp_id_end:i,seq_id_begin:A,seq_id_end:A},ihm_derived_distance_restraint:{id:A,group_id:A,feature_id_1:A,feature_id_2:A,group_conditionality:s(i),random_exclusion_fraction:o,distance_upper_limit:o,restraint_type:s(i),dataset_list_id:A},ma_model_list:{ordinal_id:A,model_id:A,model_group_id:A,model_name:i,model_group_name:i,model_type:s(i),data_id:A},ma_target_entity:{entity_id:i,data_id:A,origin:s(i)},ma_target_entity_instance:{asym_id:i,entity_id:i,details:i},ma_target_ref_db_details:{target_entity_id:i,db_name:s(i),db_code:i,db_accession:i,seq_db_isoform:i,seq_db_align_begin:i,seq_db_align_end:i,ncbi_taxonomy_id:i,organism_scientific:i},ma_data:{id:A,content_type:s(i),content_type_other_details:i,name:i},ma_software_group:{ordinal_id:A,group_id:A,software_id:A},ma_qa_metric:{id:A,name:i,type:s(i),mode:s(i),software_group_id:A},ma_qa_metric_global:{ordinal_id:A,model_id:A,metric_id:A,metric_value:o},ma_qa_metric_local:{ordinal_id:A,model_id:A,label_asym_id:i,label_seq_id:A,label_comp_id:i,metric_id:A,metric_value:o},ma_qa_metric_local_pairwise:{ordinal_id:A,model_id:A,label_asym_id_1:i,label_seq_id_1:A,label_comp_id_1:i,label_asym_id_2:i,label_seq_id_2:A,label_comp_id_2:i,metric_id:A,metric_value:o}}},894(e,t,n){"use strict";var r=t;r.base=n(36677),r.short=n(39188),r.mont=n(30370),r.edwards=n(31298)},1071(e,t,n){"use strict";n.d(t,{OT:()=>s,mQ:()=>c});var r=n(53990),i=n(69926),A=n(65533),o=n(62769),a=n(81324);function s(e){const t=function(e){const t=new Set,n=[];for(const o of e.structures){const e=r.iZ.Location.create(o);for(const a of o.units){const o=a.conformation.operator;if(!o.suffix||a.kind!==i.N.Kind.Atomic)continue;e.unit=a;const{elements:s}=a,c=A.Segmentation.transientSegments(a.model.atomicHierarchy.chainAtomSegments,s);for(;c.hasNext;){const i=c.move();e.element=s[i.start];const A=r.ZP.chain.label_asym_id(e),a=`${A}${o.suffix}`;if(t.has(a))continue;t.add(a);const l=r.ZP.chain.label_asym_id(e);n.push({label_asym_id:A,auth_asym_id:l,operator:o})}}}return n}(e);if(0!==t.length)return[d,t,{ignoreFilter:!0}]}const c={molstar_atom_site_operator_mapping:{label_asym_id:a.Column.Schema.Str(),auth_asym_id:a.Column.Schema.Str(),operator_name:a.Column.Schema.Str(),suffix:a.Column.Schema.Str(),assembly_id:a.Column.Schema.Str(),assembly_operator_id:a.Column.Schema.Int(),symmetry_operator_index:a.Column.Schema.Int(),symmetry_hkl:a.Column.Schema.Vector(3),ncs_id:a.Column.Schema.Int()}},l=(e,t)=>void 0===t[e].operator.assembly?a.Column.ValueKinds.NotPresent:a.Column.ValueKinds.Present,u=(e,t)=>-1===t[e].operator.spgrOp?a.Column.ValueKinds.NotPresent:a.Column.ValueKinds.Present,g=o.c.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 n;return(null===(n=t[e].operator.assembly)||void 0===n?void 0:n.id)||""},{valueKind:l}).int("assembly_operator_id",(e,t)=>{var n;return(null===(n=t[e].operator.assembly)||void 0===n?void 0:n.operId)||0},{valueKind:l}).int("symmetry_operator_index",(e,t)=>t[e].operator.spgrOp,{valueKind:u}).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:u}).int("ncs_id",(e,t)=>t[e].operator.ncsId,{valueKind:u}).getFields(),d={name:"molstar_atom_site_operator_mapping",instance:e=>({fields:g,source:[{data:e,rowCount:e.length}]})}},1241(e,t,n){var r=n(25799),i=n(36171),A=n(3219);t.createCipher=t.Cipher=r.createCipher,t.createCipheriv=t.Cipheriv=r.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(A)}},1342(e,t,n){"use strict";n.d(t,{Q:()=>I});var r=n(46719),i=n(65533),A=n(22422),o=n(13636),a=n(65791),s=n(69926),c=n(27206),l=n(78012),u=n(75847),g=n(64059),d=n(51195),h=n(4543),B=n(14139),f=n(92420),p=n(64096);const m=h.U.diff;function I(e,t){return{kind:"element-loci",structure:e,elements:t}}!function(e){function t(e){for(const t of e.elements)if(i.OrderedSet.size(t.indices)>0)return!1;return!0}function n(e){let t=0;for(const{indices:n}of e.elements)t+="number"==typeof n?m(n):n.length;return t}function h(n){return t(n)?n:e(n.structure,[{unit:n.elements[0].unit,indices:i.OrderedSet.ofSingleton(i.OrderedSet.start(n.elements[0].indices))}])}function I(e){return e.length>3&&i.SortedArray.isRange(e)?i.Interval.ofRange(e[0],e[e.length-1]):i.SortedArray.ofSortedArray(e)}function Q(t,n){const r=[],A=new Set;for(const e of t.elements)if(C(e))r[r.length]=e;else if(e.unit.kind===s.N.Kind.Atomic){const t=e.unit.elements,o=e.unit.model.atomicHierarchy,{label_alt_id:a}=e.unit.model.atomicHierarchy.atoms,{index:s,offsets:c}=o.residueAtomSegments,l=[],u=e.indices,g=i.OrderedSet.size(u);let d=0;for(;d<g;){A.clear();const e=t[i.OrderedSet.getAt(u,d)],r=s[e];for(A.add(a.value(e)),d++;d<g;){const e=t[i.OrderedSet.getAt(u,d)];if(s[e]!==r)break;A.add(a.value(e)),d++}const o=A.has("");for(let e=c[r],s=c[r+1];e<s;e++){const r=i.OrderedSet.indexOf(t,e);if(r>=0){const t=a.value(e);n&&!o&&t&&!A.has(t)||(l[l.length]=r)}}}r[r.length]={unit:e.unit,indices:I(l)}}else r[r.length]=e;return e(t.structure,r)}function E(e){switch(e.kind){case s.N.Kind.Atomic:return e.model.atomicHierarchy.chainAtomSegments;case s.N.Kind.Spheres:return e.model.coarseHierarchy.spheres.chainElementSegments;case s.N.Kind.Gaussians:return e.model.coarseHierarchy.gaussians.chainElementSegments}}function C(e){return e.unit.elements.length===i.OrderedSet.size(e.indices)}function y(e,t,n){const{index:r}=E(e),A=e.elements;let o=0;for(let e=0,n=A.length;e<n;e++){const n=r[A[e]];t.has(n)&&o++}if(o===e.elements.length)return void(n[n.length]={unit:e,indices:i.Interval.ofBounds(0,o)});const a=new Int32Array(o);o=0;for(let e=0,n=A.length;e<n;e++){const n=r[A[e]];t.has(n)&&(a[o++]=e)}a.length>0&&(n[n.length]={unit:e,indices:I(a)})}function v(e,t,n,r,A){const{index:o}=E(e.elements[0].unit),a=new Set;for(let r=t;r<n;r++){const t=e.elements[r],n=t.indices,A=t.unit.elements;for(let e=0,t=i.OrderedSet.size(n);e<t;e++)a.add(o[A[i.OrderedSet.getAt(n,e)]])}if(r){const t=e.elements[0].unit;for(const n of e.structure.units)s.N.areSameChainOperatorGroup(n,t)&&y(n,a,A)}else for(let r=t;r<n;r++)y(e.elements[r].unit,a,A)}function b(t){const n=[];for(let e=0,r=t.elements.length;e<r;e++){const i=t.elements[e];if(s.N.Traits.is(i.unit.traits,s.N.Trait.Partitioned)){const A=e;for(;e<r&&s.N.areSameChainOperatorGroup(t.elements[e].unit,i.unit);)e++;const o=e;e--,v(t,A,o,!0,n)}else C(i)?n[n.length]=i:v(t,e,e+1,!1,n)}return e(t.structure,n)}function D(e){return`${e.unit.model.id}|${g.Z.entity.id(e)}`}function w(e,t){const n=[];for(let r=0,A=i.OrderedSet.size(t);r<A;++r)n.push(e[i.OrderedSet.getAt(t,r)]);return i.SortedArray.ofSortedArray(n)}function S(e,t){return i.SortedArray.isRange(e)&&i.SortedArray.areEqual(e,t)?i.Interval.ofLength(e.length):I(i.SortedArray.indicesOf(e,t))}e.is=function(e){return!!e&&"element-loci"===e.kind},e.areEqual=function(e,t){if(e.structure!==t.structure)return!1;if(e.elements.length!==t.elements.length)return!1;for(let n=0,r=e.elements.length;n<r;++n){const r=e.elements[n],A=t.elements[n];if(r.unit.id!==A.unit.id)return!1;if(!i.OrderedSet.areEqual(r.indices,A.indices))return!1}return!0},e.isEmpty=t,e.isWholeStructure=function(e){return n(e)===e.structure.elementCount},e.size=n,e.all=function(t){return e(t,t.units.map(e=>({unit:e,indices:i.OrderedSet.ofBounds(0,e.elements.length)})))},e.none=function(t){return e(t,[])},e.fromExpression=function(e,t,n){let r;r="function"==typeof t?t(o.MolScriptBuilder):t;const i=(0,B.wE)(r)(null!=n?n:new f.cY(e));return f.cv.toLociWithSourceUnits(i)},e.fromQuery=function(e,t,n){const r=t(null!=n?n:new f.cY(e));return f.cv.toLociWithSourceUnits(r)},e.fromSchema=function(e,t,n){return p.S.toLoci(e,t,n)},e.getFirstLocation=function(e,n){if(t(e))return;const r=e.elements[0].unit,A=r.elements[i.OrderedSet.getAt(e.elements[0].indices,0)];return n?(n.structure=e.structure,n.unit=e.elements[0].unit,n.element=A,n):l.a.create(e.structure,r,A)},e.firstElement=h,e.firstResidue=function(e){return t(e)?e:Q(h(e))},e.firstChain=function(e){return t(e)?e:b(h(e))},e.toStructure=function(e){const t=[];for(const n of e.elements){const{unit:e,indices:r}=n,A=new Int32Array(i.OrderedSet.size(r));i.OrderedSet.forEach(r,(t,n)=>A[n]=e.elements[t]),t.push(e.getChild(i.SortedArray.ofSortedArray(A)))}return a.o.create(t,{parent:e.structure.parent})},e.forEachLocation=function(t,n,r){if(e.isEmpty(t))return;const A=r||l.a.create(t.structure);A.structure=t.structure;for(const e of t.elements){const{unit:t,indices:r}=e;A.unit=t;const{elements:o}=e.unit;for(let e=0,t=i.OrderedSet.size(r);e<t;e++)A.element=o[i.OrderedSet.getAt(r,e)],n(A)}},e.remap=function(t,n){if(n===t.structure)return t;const r=[];return t.elements.forEach(e=>{if(!n.unitMap.has(e.unit.id))return;const t=n.unitMap.get(e.unit.id),A=i.OrderedSet.indexedIntersect(e.indices,e.unit.elements,t.elements);i.OrderedSet.size(A)>0&&r.push({unit:t,indices:A})}),e(n,r)},e.union=function t(n,r){if(n.elements.length>r.elements.length)return t(r,n);if(e.isEmpty(n))return r;const A=new Map;for(const e of n.elements)A.set(e.unit.id,e.indices);const o=[];for(const e of r.elements)A.has(e.unit.id)?(o[o.length]={unit:e.unit,indices:i.OrderedSet.union(A.get(e.unit.id),e.indices)},A.delete(e.unit.id)):o[o.length]=e;return A.forEach((e,t)=>{o[o.length]={unit:n.structure.unitMap.get(t),indices:e}}),e(n.structure,o)},e.subtract=function(t,n){const r=new Map;for(const e of n.elements)r.set(e.unit.id,e.indices);const A=[];for(const e of t.elements)if(r.has(e.unit.id)){const t=i.OrderedSet.subtract(e.indices,r.get(e.unit.id));if(0===i.OrderedSet.size(t))continue;A[A.length]={unit:e.unit,indices:t}}else A[A.length]=e;return e(t.structure,A)},e.intersect=function(t,n){const r=new Map;for(const e of t.elements)r.set(e.unit.id,e.indices);const A=[];for(const e of n.elements){if(!r.has(e.unit.id))continue;const t=i.OrderedSet.intersect(r.get(e.unit.id),e.indices);0!==i.OrderedSet.size(t)&&(A[A.length]={unit:e.unit,indices:t})}return e(t.structure,A)},e.areIntersecting=function t(n,r){if(n.elements.length>r.elements.length)return t(r,n);if(e.isEmpty(n))return e.isEmpty(r);const A=new Map;for(const e of n.elements)A.set(e.unit.id,e.indices);for(const e of r.elements)if(A.has(e.unit.id)&&i.OrderedSet.areIntersecting(A.get(e.unit.id),e.indices))return!0;return!1},e.isSubset=function(t,n){if(e.isEmpty(t))return e.isEmpty(n);const r=new Map;for(const e of t.elements)r.set(e.unit.id,e.indices);let A=!1;for(const e of n.elements){if(!r.has(e.unit.id))return!1;if(!i.OrderedSet.isSubset(r.get(e.unit.id),e.indices))return!1;A=!0}return A},e.extendToWholeResidues=Q,e.extendToWholeChains=b,e.extendToWholeEntities=function(t){const n=[],r=l.a.create(t.structure),A=new Set,{units:o}=t.structure;for(let e=0,n=t.elements.length;e<n;e++){const n=t.elements[e];r.unit=n.unit,r.element=n.unit.elements[0],A.add(D(r))}for(let e=0,t=o.length;e<t;++e){const t=o[e];if(r.unit=t,r.element=t.elements[0],A.has(D(r))){const e=i.OrderedSet.ofBounds(0,t.elements.length);n[n.length]={unit:t,indices:e}}}return e(t.structure,n)},e.extendToWholeModels=function(t){const n=[],r=new Set,{units:A}=t.structure;for(let e=0,n=t.elements.length;e<n;e++){const n=t.elements[e];r.add(n.unit.model.id)}for(let e=0,t=A.length;e<t;++e){const t=A[e];if(r.has(t.model.id)){const e=i.OrderedSet.ofBounds(0,t.elements.length);n[n.length]={unit:t,indices:e}}}return e(t.structure,n)},e.extendToAllInstances=function(t){const n=[],r=new Map;for(let e=0,n=t.elements.length;e<n;e++){const n=t.elements[e],{model:A}=n.unit,o=w(n.unit.elements,n.indices);r.has(A)?r.set(A,i.SortedArray.union(o,r.get(A))):r.set(A,o)}for(let e=0,A=t.structure.units.length;e<A;++e){const A=t.structure.units[e],o=r.get(A.model);if(!o)continue;const a=S(A.elements,o);i.OrderedSet.size(a)&&(n[n.length]={unit:A,indices:a})}return e(t.structure,n)},e.extendToWholeOperators=function(t){const n=[],r=new Set,{units:A}=t.structure;for(let e=0,n=t.elements.length;e<n;e++){const n=t.elements[e];r.add(n.unit.conformation.operator.name)}for(let e=0,t=A.length;e<t;++e){const t=A[e];if(r.has(t.conformation.operator.name)){const e=i.OrderedSet.ofBounds(0,t.elements.length);n[n.length]={unit:t,indices:e}}}return e(t.structure,n)};const F=new d.Z("98"),x=(0,A.Vec3)();e.getBoundary=function(e,t,n){F.reset();for(const n of e.elements){const{indices:e}=n,{elements:r,conformation:o}=n.unit;for(let n=0,a=i.OrderedSet.size(e);n<a;n++){const a=r[i.OrderedSet.getAt(e,n)];o.position(a,x),t&&A.Vec3.transformMat4(x,x,t),F.includePositionRadius(x,o.r(a))}}F.finishedIncludeStep();for(const n of e.elements){const{indices:e}=n,{elements:r,conformation:o}=n.unit;for(let n=0,a=i.OrderedSet.size(e);n<a;n++){const a=r[i.OrderedSet.getAt(e,n)];o.position(a,x),t&&A.Vec3.transformMat4(x,x,t),F.radiusPositionRadius(x,o.r(a))}}return n?(n.box&&F.getBox(n.box),n.sphere&&F.getSphere(n.sphere),n):{box:F.getBox(),sphere:F.getSphere()}};const M=(0,A.Vec3)();function N(e,t,n=0){let r=n;for(const n of e.elements){const{indices:e}=n,{elements:o,conformation:a}=n.unit,s=i.OrderedSet.size(e);for(let n=0;n<s;n++){const s=o[i.OrderedSet.getAt(e,n)];a.position(s,M),A.Vec3.toArray(M,t,r+3*n)}r+=3*s}return t}function U(e,t){return s.N.isAtomic(e)?e.model.atomicHierarchy.atomSourceIndex.value(t):t}function R(e,t,n,r,i){(0,c.eh)(t);const A=[],o=[];let a=0;const s=t.length;for(;a<s;){const e=a;for(a++;a<s&&t[a-1]+1===t[a];)a++;const n=a;if(n-e>12)A[A.length]=t[e],A[A.length]=t[n-1];else for(let r=e;r<n;r++)o[o.length]=t[r]}return n?{atom:{set:o,ranges:A},chain:{opName:[e]},entity:{modelLabel:r,modelIndex:i}}:{atom:{set:o,ranges:A},chain:{opName:[e]}}}e.toPositionsArray=N,e.getPrincipalAxes=function(e){const t=n(e),r=N(e,new Float32Array(3*t));return u.c.ofPositions(r)},e.getPrincipalAxesMany=function(e){let t=0;e.forEach(e=>{t+=n(e)});const r=new Float32Array(3*t);let i=0;return e.forEach(e=>{N(e,r,i),i+=3*n(e)}),u.c.ofPositions(r)},e.toExpression=function(t){if(e.isEmpty(t))return o.MolScriptBuilder.struct.generator.empty();const n=t.structure.models,A=new Map;for(const e of t.elements){const{indices:t}=e,{elements:n}=e.unit,o=e.unit.conformation.operator.name;let a;A.has(o)?a=A.get(o).xs:(a=r.th.create(),A.set(o,{modelLabel:e.unit.model.label,modelIndex:e.unit.model.modelNum,xs:a}));for(let A=0,o=i.OrderedSet.size(t);A<o;A++){const o=U(e.unit,n[i.OrderedSet.getAt(t,A)]);r.th.add(a,o,o)}}const a=[],s=A.keys();for(;;){const e=s.next();if(e.done)break;const t=A.get(e.value);a.push(R(e.value,t.xs.array,n.length>1,t.modelLabel,t.modelIndex))}const l=new Map;for(let e=0,t=a.length;e<t;++e){const t=a[e],n=`${(0,c.vb)((0,c.TI)(t.atom.ranges),(0,c.TI)(t.atom.set))}|${t.entity?t.entity.modelLabel+t.entity.modelIndex:""}`;l.has(n)?l.get(n).chain.opName.push(...t.chain.opName):l.set(n,t)}const u=[];return l.forEach(e=>{const{ranges:t,set:n}=e.atom,{opName:r}=e.chain,i=o.MolScriptBuilder.struct.atomProperty.core.operatorName(),A=o.MolScriptBuilder.struct.atomProperty.core.sourceIndex(),a=[];n.length>0&&(a[a.length]=o.MolScriptBuilder.core.set.has([o.MolScriptBuilder.core.type.set(n),A]));for(let e=0,n=t.length/2;e<n;e++)a[a.length]=o.MolScriptBuilder.core.rel.inRange([A,t[2*e],t[2*e+1]]);if(e.entity){const{modelLabel:t,modelIndex:n}=e.entity;u.push(o.MolScriptBuilder.struct.generator.atomGroups({"atom-test":a.length>1?o.MolScriptBuilder.core.logic.or(a):a[0],"chain-test":r.length>1?o.MolScriptBuilder.core.set.has([o.MolScriptBuilder.core.type.set(r),i]):o.MolScriptBuilder.core.rel.eq([i,r[0]]),"entity-test":o.MolScriptBuilder.core.logic.and([o.MolScriptBuilder.core.rel.eq([o.MolScriptBuilder.struct.atomProperty.core.modelLabel(),t]),o.MolScriptBuilder.core.rel.eq([o.MolScriptBuilder.struct.atomProperty.core.modelIndex(),n])])}))}else u.push(o.MolScriptBuilder.struct.generator.atomGroups({"atom-test":a.length>1?o.MolScriptBuilder.core.logic.or(a):a[0],"chain-test":r.length>1?o.MolScriptBuilder.core.set.has([o.MolScriptBuilder.core.type.set(r),i]):o.MolScriptBuilder.core.rel.eq([i,r[0]])}))}),o.MolScriptBuilder.struct.modifier.union([1===u.length?u[0]:o.MolScriptBuilder.struct.combinator.merge(u.map(e=>o.MolScriptBuilder.struct.modifier.union([e])))])}}(I||(I={}))},1366(e,t,n){"use strict";n.r(t),n.d(t,{CompiledQueryFn:()=>r.OF,DefaultQueryRuntimeTable:()=>r.oY,QueryCompiledSymbol:()=>r.Ij,QueryCompilerCtx:()=>r.ZD,QueryRuntimeArguments:()=>r.TO,QueryRuntimeTable:()=>r.RB,QuerySymbolRuntime:()=>r.Bg,compile:()=>r.wE});var r=n(14139),i=n(3627),A=n(28243),o=n(52500),a=n(24303),s=n(78850),c=n(15819),l=n(7822),u=n(58685),g=n(59374);const d=r.Bg.Const,h=r.Bg.Dynamic,B=[d(i.AN.core.type.bool,function(e,t){return!!t[0](e)}),d(i.AN.core.type.num,function(e,t){return+t[0](e)}),d(i.AN.core.type.str,function(e,t){return""+t[0](e)}),d(i.AN.core.type.list,function(e,t){return r.TO.forEachEval(t,e,(e,t,n)=>n[t]=e,[])}),d(i.AN.core.type.set,function(e,t){return r.TO.forEachEval(t,e,function(e,t,n){return n.add(e)},new Set)}),d(i.AN.core.type.regex,function(e,t){return new RegExp(t[0](e),t[1]&&t[1](e)||"")}),d(i.AN.core.type.bitflags,function(e,t){return+t[0](e)}),d(i.AN.core.type.compositeKey,function(e,t){return r.TO.forEachEval(t,e,(e,t,n)=>n[t]=""+e,[]).join("-")}),d(i.AN.core.logic.not,(e,t)=>!t[0](e)),d(i.AN.core.logic.and,(e,t)=>{if("number"==typeof t.len