@qaecy/cue-ui 0.0.22 → 0.0.24

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/540.js ADDED
@@ -0,0 +1 @@
1
+ (self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[540],{1294(at){function Fe(ne){return Promise.resolve().then(()=>{var ae=new Error("Cannot find module '"+ne+"'");throw ae.code="MODULE_NOT_FOUND",ae})}Fe.keys=()=>[],Fe.resolve=Fe,Fe.id=1294,at.exports=Fe},8380(at){function Fe(ne){return Promise.resolve().then(()=>{var ae=new Error("Cannot find module '"+ne+"'");throw ae.code="MODULE_NOT_FOUND",ae})}Fe.keys=()=>[],Fe.resolve=Fe,Fe.id=8380,at.exports=Fe},7814(at,Fe,ne){"use strict";ne.d(Fe,{cY:()=>de,FA:()=>pr,g:()=>Ct,u:()=>Q,Uj:()=>L,Fy:()=>Pe,tD:()=>En,bD:()=>jo,T9:()=>z,yU:()=>N,XA:()=>re,mS:()=>F,Ku:()=>Yi,ZQ:()=>ye,sr:()=>gt,zJ:()=>pe,c1:()=>ct,zW:()=>dt,jZ:()=>Ke,lV:()=>Tt,nr:()=>mt,Ov:()=>At,gE:()=>se,Am:()=>Kt,P1:()=>he,eX:()=>Mt});var ae=ne(467);const E=function(Ee){const we=[];let Re=0;for(let vt=0;vt<Ee.length;vt++){let Me=Ee.charCodeAt(vt);Me<128?we[Re++]=Me:Me<2048?(we[Re++]=Me>>6|192,we[Re++]=63&Me|128):55296==(64512&Me)&&vt+1<Ee.length&&56320==(64512&Ee.charCodeAt(vt+1))?(Me=65536+((1023&Me)<<10)+(1023&Ee.charCodeAt(++vt)),we[Re++]=Me>>18|240,we[Re++]=Me>>12&63|128,we[Re++]=Me>>6&63|128,we[Re++]=63&Me|128):(we[Re++]=Me>>12|224,we[Re++]=Me>>6&63|128,we[Re++]=63&Me|128)}return we},A={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(Ee,we){if(!Array.isArray(Ee))throw Error("encodeByteArray takes an array as a parameter");this.init_();const Re=we?this.byteToCharMapWebSafe_:this.byteToCharMap_,vt=[];for(let Me=0;Me<Ee.length;Me+=3){const jt=Ee[Me],wr=Me+1<Ee.length,Mr=wr?Ee[Me+1]:0,sn=Me+2<Ee.length,Sn=sn?Ee[Me+2]:0;let Zt=(15&Mr)<<2|Sn>>6,Kn=63&Sn;sn||(Kn=64,wr||(Zt=64)),vt.push(Re[jt>>2],Re[(3&jt)<<4|Mr>>4],Re[Zt],Re[Kn])}return vt.join("")},encodeString(Ee,we){return this.HAS_NATIVE_SUPPORT&&!we?btoa(Ee):this.encodeByteArray(E(Ee),we)},decodeString(Ee,we){return this.HAS_NATIVE_SUPPORT&&!we?atob(Ee):function(Ee){const we=[];let Re=0,vt=0;for(;Re<Ee.length;){const Me=Ee[Re++];if(Me<128)we[vt++]=String.fromCharCode(Me);else if(Me>191&&Me<224){const jt=Ee[Re++];we[vt++]=String.fromCharCode((31&Me)<<6|63&jt)}else if(Me>239&&Me<365){const sn=((7&Me)<<18|(63&Ee[Re++])<<12|(63&Ee[Re++])<<6|63&Ee[Re++])-65536;we[vt++]=String.fromCharCode(55296+(sn>>10)),we[vt++]=String.fromCharCode(56320+(1023&sn))}else{const jt=Ee[Re++],wr=Ee[Re++];we[vt++]=String.fromCharCode((15&Me)<<12|(63&jt)<<6|63&wr)}}return we.join("")}(this.decodeStringToByteArray(Ee,we))},decodeStringToByteArray(Ee,we){this.init_();const Re=we?this.charToByteMapWebSafe_:this.charToByteMap_,vt=[];for(let Me=0;Me<Ee.length;){const jt=Re[Ee.charAt(Me++)],Mr=Me<Ee.length?Re[Ee.charAt(Me)]:0;++Me;const Sn=Me<Ee.length?Re[Ee.charAt(Me)]:64;++Me;const ir=Me<Ee.length?Re[Ee.charAt(Me)]:64;if(++Me,null==jt||null==Mr||null==Sn||null==ir)throw new B;vt.push(jt<<2|Mr>>4),64!==Sn&&(vt.push(Mr<<4&240|Sn>>2),64!==ir&&vt.push(Sn<<6&192|ir))}return vt},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let Ee=0;Ee<this.ENCODED_VALS.length;Ee++)this.byteToCharMap_[Ee]=this.ENCODED_VALS.charAt(Ee),this.charToByteMap_[this.byteToCharMap_[Ee]]=Ee,this.byteToCharMapWebSafe_[Ee]=this.ENCODED_VALS_WEBSAFE.charAt(Ee),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[Ee]]=Ee,Ee>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(Ee)]=Ee,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(Ee)]=Ee)}}};class B extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const L=function(Ee){return function(Ee){const we=E(Ee);return A.encodeByteArray(we,!0)}(Ee).replace(/\./g,"")},Q=function(Ee){try{return A.decodeString(Ee,!0)}catch(we){console.error("base64Decode failed: ",we)}return null};function F(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}const ee=()=>{try{return F().__FIREBASE_DEFAULTS__||(()=>{if(typeof process>"u"||typeof process.env>"u")return;const Ee=process.env.__FIREBASE_DEFAULTS__;return Ee?JSON.parse(Ee):void 0})()||(()=>{if(typeof document>"u")return;let Ee;try{Ee=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const we=Ee&&Q(Ee[1]);return we&&JSON.parse(we)})()}catch(Ee){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${Ee}`)}},N=Ee=>{const we=(Ee=>ee()?.emulatorHosts?.[Ee])(Ee);if(!we)return;const Re=we.lastIndexOf(":");if(Re<=0||Re+1===we.length)throw new Error(`Invalid host ${we} with no separate hostname and port!`);const vt=parseInt(we.substring(Re+1),10);return"["===we[0]?[we.substring(1,Re-1),vt]:[we.substring(0,Re),vt]},z=()=>ee()?.config,re=Ee=>ee()?.[`_${Ee}`];class de{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((we,Re)=>{this.resolve=we,this.reject=Re})}wrapCallback(we){return(Re,vt)=>{Re?this.reject(Re):this.resolve(vt),"function"==typeof we&&(this.promise.catch(()=>{}),1===we.length?we(Re):we(Re,vt))}}}function pe(Ee){try{return(Ee.startsWith("http://")||Ee.startsWith("https://")?new URL(Ee).hostname:Ee).endsWith(".cloudworkstations.dev")}catch{return!1}}function se(Ee){return fe.apply(this,arguments)}function fe(){return(fe=(0,ae.A)(function*(Ee){return(yield fetch(Ee,{credentials:"include"})).ok})).apply(this,arguments)}function Pe(Ee,we){if(Ee.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const vt=we||"demo-project",Me=Ee.iat||0,jt=Ee.sub||Ee.user_id;if(!jt)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const wr={iss:`https://securetoken.google.com/${vt}`,aud:vt,iat:Me,exp:Me+3600,auth_time:Me,sub:jt,user_id:jt,firebase:{sign_in_provider:"custom",identities:{}},...Ee};return[L(JSON.stringify({alg:"none",type:"JWT"})),L(JSON.stringify(wr)),""].join(".")}const xe={};let Ie=!1;function he(Ee,we){if(typeof window>"u"||typeof document>"u"||!pe(window.location.host)||xe[Ee]===we||xe[Ee]||Ie)return;function Re(Zt){return`__firebase__banner__${Zt}`}xe[Ee]=we;const vt="__firebase__banner",jt=function Ne(){const Ee={prod:[],emulator:[]};for(const we of Object.keys(xe))xe[we]?Ee.emulator.push(we):Ee.prod.push(we);return Ee}().prod.length>0;function ir(){const Zt=function tt(Ee){let we=document.getElementById(Ee),Re=!1;return we||(we=document.createElement("div"),we.setAttribute("id",Ee),Re=!0),{created:Re,element:we}}(vt),Kn=Re("text"),Ft=document.getElementById(Kn)||document.createElement("span"),pa=Re("learnmore"),kt=document.getElementById(pa)||document.createElement("a"),Oa=Re("preprendIcon"),St=document.getElementById(Oa)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(Zt.created){const We=Zt.element;(function Mr(Zt){Zt.style.display="flex",Zt.style.background="#7faaf0",Zt.style.position="fixed",Zt.style.bottom="5px",Zt.style.left="5px",Zt.style.padding=".5em",Zt.style.borderRadius="5px",Zt.style.alignItems="center"})(We),function ht(Zt,Kn){Zt.setAttribute("id",Kn),Zt.innerText="Learn more",Zt.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",Zt.setAttribute("target","__blank"),Zt.style.paddingLeft="5px",Zt.style.textDecoration="underline"}(kt,pa);const wt=function Sn(){const Zt=document.createElement("span");return Zt.style.cursor="pointer",Zt.style.marginLeft="16px",Zt.style.fontSize="24px",Zt.innerHTML=" &times;",Zt.onclick=()=>{Ie=!0,function wr(){const Zt=document.getElementById(vt);Zt&&Zt.remove()}()},Zt}();(function sn(Zt,Kn){Zt.setAttribute("width","24"),Zt.setAttribute("id",Kn),Zt.setAttribute("height","24"),Zt.setAttribute("viewBox","0 0 24 24"),Zt.setAttribute("fill","none"),Zt.style.marginLeft="-6px"})(St,Oa),We.append(St,Ft,kt,wt),document.body.appendChild(We)}jt?(Ft.innerText="Preview backend disconnected.",St.innerHTML='<g clip-path="url(#clip0_6013_33858)">\n<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>\n</g>\n<defs>\n<clipPath id="clip0_6013_33858">\n<rect width="24" height="24" fill="white"/>\n</clipPath>\n</defs>'):(St.innerHTML='<g clip-path="url(#clip0_6083_34804)">\n<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>\n</g>\n<defs>\n<clipPath id="clip0_6083_34804">\n<rect width="24" height="24" fill="white"/>\n</clipPath>\n</defs>',Ft.innerText="Preview backend running in this workspace."),Ft.setAttribute("id",Kn)}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",ir):ir()}function ye(){return typeof navigator<"u"&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function Ke(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(ye())}function Ve(){const Ee=ee()?.forceEnvironment;if("node"===Ee)return!0;if("browser"===Ee)return!1;try{return"[object process]"===Object.prototype.toString.call(global.process)}catch{return!1}}function ct(){return typeof navigator<"u"&&"Cloudflare-Workers"===navigator.userAgent}function gt(){const Ee="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof Ee&&void 0!==Ee.id}function Tt(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function mt(){return!Ve()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function At(){return!Ve()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function dt(){try{return"object"==typeof indexedDB}catch{return!1}}function Mt(){return new Promise((Ee,we)=>{try{let Re=!0;const vt="validate-browser-context-for-indexeddb-analytics-module",Me=self.indexedDB.open(vt);Me.onsuccess=()=>{Me.result.close(),Re||self.indexedDB.deleteDatabase(vt),Ee(!0)},Me.onupgradeneeded=()=>{Re=!1},Me.onerror=()=>{we(Me.error?.message||"")}}catch(Re){we(Re)}})}class Ct extends Error{constructor(we,Re,vt){super(Re),this.code=we,this.customData=vt,this.name="FirebaseError",Object.setPrototypeOf(this,Ct.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,pr.prototype.create)}}class pr{constructor(we,Re,vt){this.service=we,this.serviceName=Re,this.errors=vt}create(we,...Re){const vt=Re[0]||{},Me=`${this.service}/${we}`,jt=this.errors[we],wr=jt?function Lr(Ee,we){return Ee.replace(an,(Re,vt)=>{const Me=we[vt];return null!=Me?String(Me):`<${vt}?>`})}(jt,vt):"Error";return new Ct(Me,`${this.serviceName}: ${wr} (${Me}).`,vt)}}const an=/\{\$([^}]+)}/g;function jo(Ee,we){if(Ee===we)return!0;const Re=Object.keys(Ee),vt=Object.keys(we);for(const Me of Re){if(!vt.includes(Me))return!1;const jt=Ee[Me],wr=we[Me];if(ci(jt)&&ci(wr)){if(!jo(jt,wr))return!1}else if(jt!==wr)return!1}for(const Me of vt)if(!Re.includes(Me))return!1;return!0}function ci(Ee){return null!==Ee&&"object"==typeof Ee}function Kt(Ee){const we=[];for(const[Re,vt]of Object.entries(Ee))Array.isArray(vt)?vt.forEach(Me=>{we.push(encodeURIComponent(Re)+"="+encodeURIComponent(Me))}):we.push(encodeURIComponent(Re)+"="+encodeURIComponent(vt));return we.length?"&"+we.join("&"):""}function En(Ee,we){const Re=new Nn(Ee,we);return Re.subscribe.bind(Re)}class Nn{constructor(we,Re){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=Re,this.task.then(()=>{we(this)}).catch(vt=>{this.error(vt)})}next(we){this.forEachObserver(Re=>{Re.next(we)})}error(we){this.forEachObserver(Re=>{Re.error(we)}),this.close(we)}complete(){this.forEachObserver(we=>{we.complete()}),this.close()}subscribe(we,Re,vt){let Me;if(void 0===we&&void 0===Re&&void 0===vt)throw new Error("Missing Observer.");Me=function Xn(Ee,we){if("object"!=typeof Ee||null===Ee)return!1;for(const Re of we)if(Re in Ee&&"function"==typeof Ee[Re])return!0;return!1}(we,["next","error","complete"])?we:{next:we,error:Re,complete:vt},void 0===Me.next&&(Me.next=da),void 0===Me.error&&(Me.error=da),void 0===Me.complete&&(Me.complete=da);const jt=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?Me.error(this.finalError):Me.complete()}catch{}}),this.observers.push(Me),jt}unsubscribeOne(we){void 0===this.observers||void 0===this.observers[we]||(delete this.observers[we],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(we){if(!this.finalized)for(let Re=0;Re<this.observers.length;Re++)this.sendOne(Re,we)}sendOne(we,Re){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[we])try{Re(this.observers[we])}catch(vt){typeof console<"u"&&console.error&&console.error(vt)}})}close(we){this.finalized||(this.finalized=!0,void 0!==we&&(this.finalError=we),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function da(){}function Yi(Ee){return Ee&&Ee._delegate?Ee._delegate:Ee}},4556(at){at.exports=function(){"use strict";var ae=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function D(F,te){var k=F[0],ie=F[1],ee=F[2],I=F[3];ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&ee|~ie&I)+te[0]-680876936|0)<<7|k>>>25)+ie|0)&ie|~k&ee)+te[1]-389564586|0)<<12|I>>>20)+k|0)&k|~I&ie)+te[2]+606105819|0)<<17|ee>>>15)+I|0)&I|~ee&k)+te[3]-1044525330|0)<<22|ie>>>10)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&ee|~ie&I)+te[4]-176418897|0)<<7|k>>>25)+ie|0)&ie|~k&ee)+te[5]+1200080426|0)<<12|I>>>20)+k|0)&k|~I&ie)+te[6]-1473231341|0)<<17|ee>>>15)+I|0)&I|~ee&k)+te[7]-45705983|0)<<22|ie>>>10)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&ee|~ie&I)+te[8]+1770035416|0)<<7|k>>>25)+ie|0)&ie|~k&ee)+te[9]-1958414417|0)<<12|I>>>20)+k|0)&k|~I&ie)+te[10]-42063|0)<<17|ee>>>15)+I|0)&I|~ee&k)+te[11]-1990404162|0)<<22|ie>>>10)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&ee|~ie&I)+te[12]+1804603682|0)<<7|k>>>25)+ie|0)&ie|~k&ee)+te[13]-40341101|0)<<12|I>>>20)+k|0)&k|~I&ie)+te[14]-1502002290|0)<<17|ee>>>15)+I|0)&I|~ee&k)+te[15]+1236535329|0)<<22|ie>>>10)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&I|ee&~I)+te[1]-165796510|0)<<5|k>>>27)+ie|0)&ee|ie&~ee)+te[6]-1069501632|0)<<9|I>>>23)+k|0)&ie|k&~ie)+te[11]+643717713|0)<<14|ee>>>18)+I|0)&k|I&~k)+te[0]-373897302|0)<<20|ie>>>12)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&I|ee&~I)+te[5]-701558691|0)<<5|k>>>27)+ie|0)&ee|ie&~ee)+te[10]+38016083|0)<<9|I>>>23)+k|0)&ie|k&~ie)+te[15]-660478335|0)<<14|ee>>>18)+I|0)&k|I&~k)+te[4]-405537848|0)<<20|ie>>>12)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&I|ee&~I)+te[9]+568446438|0)<<5|k>>>27)+ie|0)&ee|ie&~ee)+te[14]-1019803690|0)<<9|I>>>23)+k|0)&ie|k&~ie)+te[3]-187363961|0)<<14|ee>>>18)+I|0)&k|I&~k)+te[8]+1163531501|0)<<20|ie>>>12)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie&I|ee&~I)+te[13]-1444681467|0)<<5|k>>>27)+ie|0)&ee|ie&~ee)+te[2]-51403784|0)<<9|I>>>23)+k|0)&ie|k&~ie)+te[7]+1735328473|0)<<14|ee>>>18)+I|0)&k|I&~k)+te[12]-1926607734|0)<<20|ie>>>12)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie^ee^I)+te[5]-378558|0)<<4|k>>>28)+ie|0)^ie^ee)+te[8]-2022574463|0)<<11|I>>>21)+k|0)^k^ie)+te[11]+1839030562|0)<<16|ee>>>16)+I|0)^I^k)+te[14]-35309556|0)<<23|ie>>>9)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie^ee^I)+te[1]-1530992060|0)<<4|k>>>28)+ie|0)^ie^ee)+te[4]+1272893353|0)<<11|I>>>21)+k|0)^k^ie)+te[7]-155497632|0)<<16|ee>>>16)+I|0)^I^k)+te[10]-1094730640|0)<<23|ie>>>9)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie^ee^I)+te[13]+681279174|0)<<4|k>>>28)+ie|0)^ie^ee)+te[0]-358537222|0)<<11|I>>>21)+k|0)^k^ie)+te[3]-722521979|0)<<16|ee>>>16)+I|0)^I^k)+te[6]+76029189|0)<<23|ie>>>9)+ee|0,ie=((ie+=((ee=((ee+=((I=((I+=((k=((k+=(ie^ee^I)+te[9]-640364487|0)<<4|k>>>28)+ie|0)^ie^ee)+te[12]-421815835|0)<<11|I>>>21)+k|0)^k^ie)+te[15]+530742520|0)<<16|ee>>>16)+I|0)^I^k)+te[2]-995338651|0)<<23|ie>>>9)+ee|0,ie=((ie+=((I=((I+=(ie^((k=((k+=(ee^(ie|~I))+te[0]-198630844|0)<<6|k>>>26)+ie|0)|~ee))+te[7]+1126891415|0)<<10|I>>>22)+k|0)^((ee=((ee+=(k^(I|~ie))+te[14]-1416354905|0)<<15|ee>>>17)+I|0)|~k))+te[5]-57434055|0)<<21|ie>>>11)+ee|0,ie=((ie+=((I=((I+=(ie^((k=((k+=(ee^(ie|~I))+te[12]+1700485571|0)<<6|k>>>26)+ie|0)|~ee))+te[3]-1894986606|0)<<10|I>>>22)+k|0)^((ee=((ee+=(k^(I|~ie))+te[10]-1051523|0)<<15|ee>>>17)+I|0)|~k))+te[1]-2054922799|0)<<21|ie>>>11)+ee|0,ie=((ie+=((I=((I+=(ie^((k=((k+=(ee^(ie|~I))+te[8]+1873313359|0)<<6|k>>>26)+ie|0)|~ee))+te[15]-30611744|0)<<10|I>>>22)+k|0)^((ee=((ee+=(k^(I|~ie))+te[6]-1560198380|0)<<15|ee>>>17)+I|0)|~k))+te[13]+1309151649|0)<<21|ie>>>11)+ee|0,ie=((ie+=((I=((I+=(ie^((k=((k+=(ee^(ie|~I))+te[4]-145523070|0)<<6|k>>>26)+ie|0)|~ee))+te[11]-1120210379|0)<<10|I>>>22)+k|0)^((ee=((ee+=(k^(I|~ie))+te[2]+718787259|0)<<15|ee>>>17)+I|0)|~k))+te[9]-343485551|0)<<21|ie>>>11)+ee|0,F[0]=k+F[0]|0,F[1]=ie+F[1]|0,F[2]=ee+F[2]|0,F[3]=I+F[3]|0}function _(F){var k,te=[];for(k=0;k<64;k+=4)te[k>>2]=F.charCodeAt(k)+(F.charCodeAt(k+1)<<8)+(F.charCodeAt(k+2)<<16)+(F.charCodeAt(k+3)<<24);return te}function R(F){var k,te=[];for(k=0;k<64;k+=4)te[k>>2]=F[k]+(F[k+1]<<8)+(F[k+2]<<16)+(F[k+3]<<24);return te}function E(F){var ie,ee,I,N,z,re,te=F.length,k=[1732584193,-271733879,-1732584194,271733878];for(ie=64;ie<=te;ie+=64)D(k,_(F.substring(ie-64,ie)));for(ee=(F=F.substring(ie-64)).length,I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ie=0;ie<ee;ie+=1)I[ie>>2]|=F.charCodeAt(ie)<<(ie%4<<3);if(I[ie>>2]|=128<<(ie%4<<3),ie>55)for(D(k,I),ie=0;ie<16;ie+=1)I[ie]=0;return N=(N=8*te).toString(16).match(/(.*?)(.{0,8})$/),z=parseInt(N[2],16),re=parseInt(N[1],16)||0,I[14]=z,I[15]=re,D(k,I),k}function A(F){var k,te="";for(k=0;k<4;k+=1)te+=ae[F>>8*k+4&15]+ae[F>>8*k&15];return te}function B(F){var te;for(te=0;te<F.length;te+=1)F[te]=A(F[te]);return F.join("")}function x(F){return/[\u0080-\uFFFF]/.test(F)&&(F=unescape(encodeURIComponent(F))),F}function H(F){var ie,te=[],k=F.length;for(ie=0;ie<k-1;ie+=2)te.push(parseInt(F.substr(ie,2),16));return String.fromCharCode.apply(String,te)}function oe(){this.reset()}return B(E("hello")),typeof ArrayBuffer<"u"&&!ArrayBuffer.prototype.slice&&function(){function F(te,k){return(te=0|te||0)<0?Math.max(te+k,0):Math.min(te,k)}ArrayBuffer.prototype.slice=function(te,k){var N,z,re,de,ie=this.byteLength,ee=F(te,ie),I=ie;return void 0!==k&&(I=F(k,ie)),ee>I?new ArrayBuffer(0):(N=I-ee,z=new ArrayBuffer(N),re=new Uint8Array(z),de=new Uint8Array(this,ee,N),re.set(de),z)}}(),oe.prototype.append=function(F){return this.appendBinary(x(F)),this},oe.prototype.appendBinary=function(F){this._buff+=F,this._length+=F.length;var k,te=this._buff.length;for(k=64;k<=te;k+=64)D(this._hash,_(this._buff.substring(k-64,k)));return this._buff=this._buff.substring(k-64),this},oe.prototype.end=function(F){var ie,I,te=this._buff,k=te.length,ee=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(ie=0;ie<k;ie+=1)ee[ie>>2]|=te.charCodeAt(ie)<<(ie%4<<3);return this._finish(ee,k),I=B(this._hash),F&&(I=H(I)),this.reset(),I},oe.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},oe.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},oe.prototype.setState=function(F){return this._buff=F.buff,this._length=F.length,this._hash=F.hash,this},oe.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},oe.prototype._finish=function(F,te){var ie,ee,I,k=te;if(F[k>>2]|=128<<(k%4<<3),k>55)for(D(this._hash,F),k=0;k<16;k+=1)F[k]=0;ie=(ie=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),ee=parseInt(ie[2],16),I=parseInt(ie[1],16)||0,F[14]=ee,F[15]=I,D(this._hash,F)},oe.hash=function(F,te){return oe.hashBinary(x(F),te)},oe.hashBinary=function(F,te){var ie=B(E(F));return te?H(ie):ie},(oe.ArrayBuffer=function(){this.reset()}).prototype.append=function(F){var ie,te=function j(F,te,k){var ie=new Uint8Array(F.byteLength+te.byteLength);return ie.set(new Uint8Array(F)),ie.set(new Uint8Array(te),F.byteLength),k?ie:ie.buffer}(this._buff.buffer,F,!0),k=te.length;for(this._length+=F.byteLength,ie=64;ie<=k;ie+=64)D(this._hash,R(te.subarray(ie-64,ie)));return this._buff=ie-64<k?new Uint8Array(te.buffer.slice(ie-64)):new Uint8Array(0),this},oe.ArrayBuffer.prototype.end=function(F){var ee,I,te=this._buff,k=te.length,ie=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(ee=0;ee<k;ee+=1)ie[ee>>2]|=te[ee]<<(ee%4<<3);return this._finish(ie,k),I=B(this._hash),F&&(I=H(I)),this.reset(),I},oe.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},oe.ArrayBuffer.prototype.getState=function(){var F=oe.prototype.getState.call(this);return F.buff=function Q(F){return String.fromCharCode.apply(null,new Uint8Array(F))}(F.buff),F},oe.ArrayBuffer.prototype.setState=function(F){return F.buff=function L(F,te){var I,k=F.length,ie=new ArrayBuffer(k),ee=new Uint8Array(ie);for(I=0;I<k;I+=1)ee[I]=F.charCodeAt(I);return te?ee:ie}(F.buff,!0),oe.prototype.setState.call(this,F)},oe.ArrayBuffer.prototype.destroy=oe.prototype.destroy,oe.ArrayBuffer.prototype._finish=oe.prototype._finish,oe.ArrayBuffer.hash=function(F,te){var ie=B(function w(F){var ie,ee,I,N,z,re,te=F.length,k=[1732584193,-271733879,-1732584194,271733878];for(ie=64;ie<=te;ie+=64)D(k,R(F.subarray(ie-64,ie)));for(ee=(F=ie-64<te?F.subarray(ie-64):new Uint8Array(0)).length,I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ie=0;ie<ee;ie+=1)I[ie>>2]|=F[ie]<<(ie%4<<3);if(I[ie>>2]|=128<<(ie%4<<3),ie>55)for(D(k,I),ie=0;ie<16;ie+=1)I[ie]=0;return N=(N=8*te).toString(16).match(/(.*?)(.{0,8})$/),z=parseInt(N[2],16),re=parseInt(N[1],16)||0,I[14]=z,I[15]=re,D(k,I),k}(new Uint8Array(F)));return te?H(ie):ie},oe}()},503(at,Fe,ne){var ae=ne(6119);function D(E){var w=0;if(E&&E.length>0){w+=Math.abs(_(E[0]));for(var A=1;A<E.length;A++)w-=Math.abs(_(E[A]))}return w}function _(E){var w,A,x,L,Q,j,H=0,oe=E.length;if(oe>2){for(j=0;j<oe;j++)j===oe-2?(x=oe-2,L=oe-1,Q=0):j===oe-1?(x=oe-1,L=0,Q=1):(x=j,L=j+1,Q=j+2),w=E[x],A=E[L],H+=(R(E[Q][0])-R(w[0]))*Math.sin(R(A[1]));H=H*ae.RADIUS*ae.RADIUS/2}return H}function R(E){return E*Math.PI/180}at.exports.geometry=function $(E){var A,w=0;switch(E.type){case"Polygon":return D(E.coordinates);case"MultiPolygon":for(A=0;A<E.coordinates.length;A++)w+=D(E.coordinates[A]);return w;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(A=0;A<E.geometries.length;A++)w+=$(E.geometries[A]);return w}},at.exports.ring=_},5341(at){at.exports=function ne(ae){if(!ae||!ae.type)return null;var $=Fe[ae.type];return $?"geometry"===$?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:ae}]}:"feature"===$?{type:"FeatureCollection",features:[ae]}:"featurecollection"===$?ae:void 0:null};var Fe={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},540(at,Fe,ne){"use strict";ne.d(Fe,{CueEntityViewer:()=>J8});var ae={};ne.r(ae),ne.d(ae,{LAT_MAX:()=>H9,LAT_MIN:()=>$9,LAT_RENDERED_MAX:()=>GT,LAT_RENDERED_MIN:()=>zT,LNG_MAX:()=>X9,LNG_MIN:()=>W9,activeStates:()=>yi,classes:()=>po,cursors:()=>Dn,events:()=>no,geojsonTypes:()=>lr,interactions:()=>RL,meta:()=>Hi,modes:()=>Br,sources:()=>zo,types:()=>go,updateActions:()=>Yh});var $={};ne.r($),ne.d($,{isActiveFeature:()=>nu,isBackspaceKey:()=>$T,isDeleteKey:()=>HT,isDigit1Key:()=>kL,isDigit2Key:()=>DL,isDigit3Key:()=>NL,isDigitKey:()=>LL,isEnterKey:()=>dm,isEscapeKey:()=>cm,isFeature:()=>jT,isInactiveFeature:()=>qT,isOfMetaType:()=>sm,isShiftDown:()=>um,isShiftMousedown:()=>PL,isTrue:()=>K9,isVertex:()=>Qh,noTarget:()=>lm});var D={};ne.r(D),ne.d(D,{CommonSelectors:()=>$,ModeHandler:()=>YT,StringSet:()=>iu,constrainFeatureMovement:()=>iI,createMidPoint:()=>o2,createSupplementaryPoints:()=>nI,createVertex:()=>Vc,doubleClickZoom:()=>ia,euclideanDistance:()=>WT,featuresAt:()=>Fc,getFeatureAtAndSetCursors:()=>hm,isClick:()=>XT,isEventAtCoordinates:()=>wm,isTap:()=>KT,mapEventToBoundingBox:()=>FL,moveFeatures:()=>oI,sortFeatures:()=>ML,stringSetsAreEqual:()=>m2,theme:()=>GL,toDenseArray:()=>ef});var _=ne(467),R=ne(7705),E=ne(2271),w=ne(5802),B=(ne(600),ne(3659));(0,B.KO)("firebase","12.8.0","app"),ne(6702);const j="http://www.w3.org/1999/02/22-rdf-syntax-ns#",H="http://www.w3.org/2001/XMLSchema#",oe="http://www.w3.org/2000/10/swap/",F={xsd:{decimal:`${H}decimal`,boolean:`${H}boolean`,double:`${H}double`,integer:`${H}integer`,string:`${H}string`},rdf:{type:`${j}type`,nil:`${j}nil`,first:`${j}first`,rest:`${j}rest`,langString:`${j}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${oe}reify#forSome`,forAll:`${oe}reify#forAll`},log:{implies:`${oe}log#implies`,isImpliedBy:`${oe}log#isImpliedBy`}},{rdf:te,xsd:k}=F;let ie,ee=0;const z={namedNode:ye,blankNode:Ke,variable:ge,literal:Ve,defaultGraph:function et(){return ie},quad:ct,triple:ct,fromTerm:gt,fromQuad:Tt};class re{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof re?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class de extends re{get termType(){return"NamedNode"}}class pe extends re{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new de(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return"^"===n?e.substr(t+2):"@"!==n?k.string:te.langString}equals(e){return e instanceof pe?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class se extends re{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class fe extends re{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}ie=new class Pe extends re{constructor(){return super(""),ie||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class tt extends re{constructor(e,t,n,i){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=i||ie}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function ye(r){return new de(r)}function Ke(r){return new se(r||"n3-"+ee++)}function Ve(r,e){if("string"==typeof e)return new pe(`"${r}"@${e.toLowerCase()}`);let t=e?e.value:"";return""===t&&("boolean"==typeof r?t=k.boolean:"number"==typeof r&&(Number.isFinite(r)?t=Number.isInteger(r)?k.integer:k.double:(t=k.double,Number.isNaN(r)||(r=r>0?"INF":"-INF")))),new pe(""===t||t===k.string?`"${r}"`:`"${r}"^^${t}`)}function ge(r){return new fe(r)}function ct(r,e,t,n){return new tt(r,e,t,n)}function gt(r){if(r instanceof re)return r;switch(r.termType){case"NamedNode":return ye(r.value);case"BlankNode":return Ke(r.value);case"Variable":return ge(r.value);case"DefaultGraph":return ie;case"Literal":return Ve(r.value,r.language||r.datatype);case"Quad":return Tt(r);default:throw new Error(`Unexpected termType: ${r.termType}`)}}function Tt(r){if(r instanceof tt)return r;if("Quad"!==r.termType)throw new Error(`Unexpected termType: ${r.termType}`);return ct(gt(r.subject),gt(r.predicate),gt(r.object),gt(r.graph))}z.defaultGraph();var Po,Ti=ne(2040),Kt=ne(7814),$o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Na={};(function(){var r;function n(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}function i(S,P,M){M||(M=0);const q=Array(16);if("string"==typeof P)for(var G=0;G<16;++G)q[G]=P.charCodeAt(M++)|P.charCodeAt(M++)<<8|P.charCodeAt(M++)<<16|P.charCodeAt(M++)<<24;else for(G=0;G<16;++G)q[G]=P[M++]|P[M++]<<8|P[M++]<<16|P[M++]<<24;let U,X=S.g[3];U=(P=S.g[0])+(X^(M=S.g[1])&((G=S.g[2])^X))+q[0]+3614090360&4294967295,U=X+(G^(P=M+(U<<7&4294967295|U>>>25))&(M^G))+q[1]+3905402710&4294967295,X=P+(U<<12&4294967295|U>>>20),U=G+(M^X&(P^M))+q[2]+606105819&4294967295,U=M+(P^(G=X+(U<<17&4294967295|U>>>15))&(X^P))+q[3]+3250441966&4294967295,U=P+(X^(M=G+(U<<22&4294967295|U>>>10))&(G^X))+q[4]+4118548399&4294967295,U=X+(G^(P=M+(U<<7&4294967295|U>>>25))&(M^G))+q[5]+1200080426&4294967295,X=P+(U<<12&4294967295|U>>>20),U=G+(M^X&(P^M))+q[6]+2821735955&4294967295,U=M+(P^(G=X+(U<<17&4294967295|U>>>15))&(X^P))+q[7]+4249261313&4294967295,U=P+(X^(M=G+(U<<22&4294967295|U>>>10))&(G^X))+q[8]+1770035416&4294967295,U=X+(G^(P=M+(U<<7&4294967295|U>>>25))&(M^G))+q[9]+2336552879&4294967295,X=P+(U<<12&4294967295|U>>>20),U=G+(M^X&(P^M))+q[10]+4294925233&4294967295,U=M+(P^(G=X+(U<<17&4294967295|U>>>15))&(X^P))+q[11]+2304563134&4294967295,U=P+(X^(M=G+(U<<22&4294967295|U>>>10))&(G^X))+q[12]+1804603682&4294967295,U=X+(G^(P=M+(U<<7&4294967295|U>>>25))&(M^G))+q[13]+4254626195&4294967295,X=P+(U<<12&4294967295|U>>>20),U=G+(M^X&(P^M))+q[14]+2792965006&4294967295,U=M+(P^(G=X+(U<<17&4294967295|U>>>15))&(X^P))+q[15]+1236535329&4294967295,U=P+(G^X&((M=G+(U<<22&4294967295|U>>>10))^G))+q[1]+4129170786&4294967295,U=X+(M^G&((P=M+(U<<5&4294967295|U>>>27))^M))+q[6]+3225465664&4294967295,X=P+(U<<9&4294967295|U>>>23),U=G+(P^M&(X^P))+q[11]+643717713&4294967295,U=M+(X^P&((G=X+(U<<14&4294967295|U>>>18))^X))+q[0]+3921069994&4294967295,U=P+(G^X&((M=G+(U<<20&4294967295|U>>>12))^G))+q[5]+3593408605&4294967295,U=X+(M^G&((P=M+(U<<5&4294967295|U>>>27))^M))+q[10]+38016083&4294967295,X=P+(U<<9&4294967295|U>>>23),U=G+(P^M&(X^P))+q[15]+3634488961&4294967295,U=M+(X^P&((G=X+(U<<14&4294967295|U>>>18))^X))+q[4]+3889429448&4294967295,U=P+(G^X&((M=G+(U<<20&4294967295|U>>>12))^G))+q[9]+568446438&4294967295,U=X+(M^G&((P=M+(U<<5&4294967295|U>>>27))^M))+q[14]+3275163606&4294967295,X=P+(U<<9&4294967295|U>>>23),U=G+(P^M&(X^P))+q[3]+4107603335&4294967295,U=M+(X^P&((G=X+(U<<14&4294967295|U>>>18))^X))+q[8]+1163531501&4294967295,U=P+(G^X&((M=G+(U<<20&4294967295|U>>>12))^G))+q[13]+2850285829&4294967295,U=X+(M^G&((P=M+(U<<5&4294967295|U>>>27))^M))+q[2]+4243563512&4294967295,X=P+(U<<9&4294967295|U>>>23),U=G+(P^M&(X^P))+q[7]+1735328473&4294967295,U=M+(X^P&((G=X+(U<<14&4294967295|U>>>18))^X))+q[12]+2368359562&4294967295,U=P+((M=G+(U<<20&4294967295|U>>>12))^G^X)+q[5]+4294588738&4294967295,U=X+((P=M+(U<<4&4294967295|U>>>28))^M^G)+q[8]+2272392833&4294967295,X=P+(U<<11&4294967295|U>>>21),U=G+(X^P^M)+q[11]+1839030562&4294967295,U=M+((G=X+(U<<16&4294967295|U>>>16))^X^P)+q[14]+4259657740&4294967295,U=P+((M=G+(U<<23&4294967295|U>>>9))^G^X)+q[1]+2763975236&4294967295,U=X+((P=M+(U<<4&4294967295|U>>>28))^M^G)+q[4]+1272893353&4294967295,X=P+(U<<11&4294967295|U>>>21),U=G+(X^P^M)+q[7]+4139469664&4294967295,U=M+((G=X+(U<<16&4294967295|U>>>16))^X^P)+q[10]+3200236656&4294967295,U=P+((M=G+(U<<23&4294967295|U>>>9))^G^X)+q[13]+681279174&4294967295,U=X+((P=M+(U<<4&4294967295|U>>>28))^M^G)+q[0]+3936430074&4294967295,X=P+(U<<11&4294967295|U>>>21),U=G+(X^P^M)+q[3]+3572445317&4294967295,U=M+((G=X+(U<<16&4294967295|U>>>16))^X^P)+q[6]+76029189&4294967295,U=P+((M=G+(U<<23&4294967295|U>>>9))^G^X)+q[9]+3654602809&4294967295,U=X+((P=M+(U<<4&4294967295|U>>>28))^M^G)+q[12]+3873151461&4294967295,X=P+(U<<11&4294967295|U>>>21),U=G+(X^P^M)+q[15]+530742520&4294967295,U=M+((G=X+(U<<16&4294967295|U>>>16))^X^P)+q[2]+3299628645&4294967295,U=P+(G^((M=G+(U<<23&4294967295|U>>>9))|~X))+q[0]+4096336452&4294967295,U=X+(M^((P=M+(U<<6&4294967295|U>>>26))|~G))+q[7]+1126891415&4294967295,X=P+(U<<10&4294967295|U>>>22),U=G+(P^(X|~M))+q[14]+2878612391&4294967295,U=M+(X^((G=X+(U<<15&4294967295|U>>>17))|~P))+q[5]+4237533241&4294967295,U=P+(G^((M=G+(U<<21&4294967295|U>>>11))|~X))+q[12]+1700485571&4294967295,U=X+(M^((P=M+(U<<6&4294967295|U>>>26))|~G))+q[3]+2399980690&4294967295,X=P+(U<<10&4294967295|U>>>22),U=G+(P^(X|~M))+q[10]+4293915773&4294967295,U=M+(X^((G=X+(U<<15&4294967295|U>>>17))|~P))+q[1]+2240044497&4294967295,U=P+(G^((M=G+(U<<21&4294967295|U>>>11))|~X))+q[8]+1873313359&4294967295,U=X+(M^((P=M+(U<<6&4294967295|U>>>26))|~G))+q[15]+4264355552&4294967295,X=P+(U<<10&4294967295|U>>>22),U=G+(P^(X|~M))+q[6]+2734768916&4294967295,U=M+(X^((G=X+(U<<15&4294967295|U>>>17))|~P))+q[13]+1309151649&4294967295,U=P+(G^((M=G+(U<<21&4294967295|U>>>11))|~X))+q[4]+4149444226&4294967295,U=X+(M^((P=M+(U<<6&4294967295|U>>>26))|~G))+q[11]+3174756917&4294967295,X=P+(U<<10&4294967295|U>>>22),U=G+(P^(X|~M))+q[2]+718787259&4294967295,U=M+(X^((G=X+(U<<15&4294967295|U>>>17))|~P))+q[9]+3951481745&4294967295,S.g[0]=S.g[0]+P&4294967295,S.g[1]=S.g[1]+(G+(U<<21&4294967295|U>>>11))&4294967295,S.g[2]=S.g[2]+G&4294967295,S.g[3]=S.g[3]+X&4294967295}function a(S,P){this.h=P;const M=[];let q=!0;for(let G=S.length-1;G>=0;G--){const X=0|S[G];q&&X==P||(M[G]=X,q=!1)}this.g=M}(function e(S,P){function M(){}M.prototype=P.prototype,S.F=P.prototype,S.prototype=new M,S.prototype.constructor=S,S.D=function(q,G,X){for(var U=Array(arguments.length-2),me=2;me<arguments.length;me++)U[me-2]=arguments[me];return P.prototype[G].apply(q,U)}})(n,function t(){this.blockSize=-1}),n.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},n.prototype.v=function(S,P){void 0===P&&(P=S.length);const M=P-this.blockSize,q=this.C;let G=this.h,X=0;for(;X<P;){if(0==G)for(;X<=M;)i(this,S,X),X+=this.blockSize;if("string"==typeof S){for(;X<P;)if(q[G++]=S.charCodeAt(X++),G==this.blockSize){i(this,q),G=0;break}}else for(;X<P;)if(q[G++]=S[X++],G==this.blockSize){i(this,q),G=0;break}}this.h=G,this.o+=P},n.prototype.A=function(){var S=Array((this.h<56?this.blockSize:2*this.blockSize)-this.h);S[0]=128;for(var P=1;P<S.length-8;++P)S[P]=0;P=8*this.o;for(var M=S.length-8;M<S.length;++M)S[M]=255&P,P/=256;for(this.v(S),S=Array(16),P=0,M=0;M<4;++M)for(let q=0;q<32;q+=8)S[P++]=this.g[M]>>>q&255;return S};var s={};function l(S){return-128<=S&&S<128?function o(S,P){var M=s;return Object.prototype.hasOwnProperty.call(M,S)?M[S]:M[S]=P(S)}(S,function(P){return new a([0|P],P<0?-1:0)}):new a([0|S],S<0?-1:0)}function u(S){if(isNaN(S)||!isFinite(S))return d;if(S<0)return v(u(-S));const P=[];let M=1;for(let q=0;S>=M;q++)P[q]=S/M|0,M*=4294967296;return new a(P,0)}var d=l(0),h=l(1),f=l(16777216);function g(S){if(0!=S.h)return!1;for(let P=0;P<S.g.length;P++)if(0!=S.g[P])return!1;return!0}function y(S){return-1==S.h}function v(S){const P=S.g.length,M=[];for(let q=0;q<P;q++)M[q]=~S.g[q];return new a(M,~S.h).add(h)}function m(S,P){return S.add(v(P))}function b(S,P){for(;(65535&S[P])!=S[P];)S[P+1]+=S[P]>>>16,S[P]&=65535,P++}function T(S,P){this.g=S,this.h=P}function O(S,P){if(g(P))throw Error("division by zero");if(g(S))return new T(d,d);if(y(S))return P=O(v(S),P),new T(v(P.g),v(P.h));if(y(P))return P=O(S,v(P)),new T(v(P.g),P.h);if(S.g.length>30){if(y(S)||y(P))throw Error("slowDivide_ only works with positive integers.");for(var M=h,q=P;q.l(S)<=0;)M=K(M),q=K(q);var G=Z(M,1),X=Z(q,1);for(q=Z(q,2),M=Z(M,2);!g(q);){var U=X.add(q);U.l(S)<=0&&(G=G.add(M),X=U),q=Z(q,1),M=Z(M,1)}return P=m(S,G.j(P)),new T(G,P)}for(G=d;S.l(P)>=0;){for(M=Math.max(1,Math.floor(S.m()/P.m())),q=(q=Math.ceil(Math.log(M)/Math.LN2))<=48?1:Math.pow(2,q-48),U=(X=u(M)).j(P);y(U)||U.l(S)>0;)U=(X=u(M-=q)).j(P);g(X)&&(X=h),G=G.add(X),S=m(S,U)}return new T(G,S)}function K(S){const P=S.g.length+1,M=[];for(let q=0;q<P;q++)M[q]=S.i(q)<<1|S.i(q-1)>>>31;return new a(M,S.h)}function Z(S,P){const M=P>>5;P%=32;const q=S.g.length-M,G=[];for(let X=0;X<q;X++)G[X]=P>0?S.i(X+M)>>>P|S.i(X+M+1)<<32-P:S.i(X+M);return new a(G,S.h)}(r=a.prototype).m=function(){if(y(this))return-v(this).m();let S=0,P=1;for(let M=0;M<this.g.length;M++){const q=this.i(M);S+=(q>=0?q:4294967296+q)*P,P*=4294967296}return S},r.toString=function(S){if((S=S||10)<2||36<S)throw Error("radix out of range: "+S);if(g(this))return"0";if(y(this))return"-"+v(this).toString(S);const P=u(Math.pow(S,6));var M=this;let q="";for(;;){const G=O(M,P).g;let X=(((M=m(M,G.j(P))).g.length>0?M.g[0]:M.h)>>>0).toString(S);if(g(M=G))return X+q;for(;X.length<6;)X="0"+X;q=X+q}},r.i=function(S){return S<0?0:S<this.g.length?this.g[S]:this.h},r.l=function(S){return y(S=m(this,S))?-1:g(S)?0:1},r.abs=function(){return y(this)?v(this):this},r.add=function(S){const P=Math.max(this.g.length,S.g.length),M=[];let q=0;for(let G=0;G<=P;G++){let X=q+(65535&this.i(G))+(65535&S.i(G)),U=(X>>>16)+(this.i(G)>>>16)+(S.i(G)>>>16);q=U>>>16,X&=65535,U&=65535,M[G]=U<<16|X}return new a(M,-2147483648&M[M.length-1]?-1:0)},r.j=function(S){if(g(this)||g(S))return d;if(y(this))return y(S)?v(this).j(v(S)):v(v(this).j(S));if(y(S))return v(this.j(v(S)));if(this.l(f)<0&&S.l(f)<0)return u(this.m()*S.m());const P=this.g.length+S.g.length,M=[];for(var q=0;q<2*P;q++)M[q]=0;for(q=0;q<this.g.length;q++)for(let G=0;G<S.g.length;G++){const X=this.i(q)>>>16,U=65535&this.i(q),me=S.i(G)>>>16,be=65535&S.i(G);M[2*q+2*G]+=U*be,b(M,2*q+2*G),M[2*q+2*G+1]+=X*be,b(M,2*q+2*G+1),M[2*q+2*G+1]+=U*me,b(M,2*q+2*G+1),M[2*q+2*G+2]+=X*me,b(M,2*q+2*G+2)}for(S=0;S<P;S++)M[S]=M[2*S+1]<<16|M[2*S];for(S=P;S<2*P;S++)M[S]=0;return new a(M,0)},r.B=function(S){return O(this,S).h},r.and=function(S){const P=Math.max(this.g.length,S.g.length),M=[];for(let q=0;q<P;q++)M[q]=this.i(q)&S.i(q);return new a(M,this.h&S.h)},r.or=function(S){const P=Math.max(this.g.length,S.g.length),M=[];for(let q=0;q<P;q++)M[q]=this.i(q)|S.i(q);return new a(M,this.h|S.h)},r.xor=function(S){const P=Math.max(this.g.length,S.g.length),M=[];for(let q=0;q<P;q++)M[q]=this.i(q)^S.i(q);return new a(M,this.h^S.h)},n.prototype.digest=n.prototype.A,n.prototype.reset=n.prototype.u,n.prototype.update=n.prototype.v,Na.Md5=n,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.B,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=u,a.fromString=function c(S,P){if(0==S.length)throw Error("number format error: empty string");if((P=P||10)<2||36<P)throw Error("radix out of range: "+P);if("-"==S.charAt(0))return v(c(S.substring(1),P));if(S.indexOf("-")>=0)throw Error('number format error: interior "-" character');const M=u(Math.pow(P,8));let q=d;for(let X=0;X<S.length;X+=8){var G=Math.min(8,S.length-X);const U=parseInt(S.substring(X,X+G),P);G<8?(G=u(Math.pow(P,G)),q=q.j(G).add(u(U))):(q=q.j(M),q=q.add(u(U)))}return q},Po=Na.Integer=a}).apply(typeof $o<"u"?$o:typeof self<"u"?self:typeof window<"u"?window:{});var da,wo,hl,Ln,ha,La,fl,hs,Nn=ne(1919),ds=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Xn={};(function(){var r,e=Object.defineProperty,n=function t(p){p=["object"==typeof globalThis&&globalThis,p,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof ds&&ds];for(var C=0;C<p.length;++C){var W=p[C];if(W&&W.Math==Math)return W}throw Error("Cannot find global object")}(this);function i(p,C){if(C)e:{var W=n;p=p.split(".");for(var ue=0;ue<p.length-1;ue++){var qe=p[ue];if(!(qe in W))break e;W=W[qe]}(C=C(ue=W[p=p[p.length-1]]))!=ue&&null!=C&&e(W,p,{configurable:!0,writable:!0,value:C})}}i("Symbol.dispose",function(p){return p||Symbol("Symbol.dispose")}),i("Array.prototype.values",function(p){return p||function(){return this[Symbol.iterator]()}}),i("Object.entries",function(p){return p||function(C){var ue,W=[];for(ue in C)Object.prototype.hasOwnProperty.call(C,ue)&&W.push([ue,C[ue]]);return W}});var o=o||{},a=this||self;function s(p){var C=typeof p;return"object"==C&&null!=p||"function"==C}function l(p,C,W){return p.call.apply(p.bind,arguments)}function u(p,C,W){return(u=l).apply(null,arguments)}function c(p,C){var W=Array.prototype.slice.call(arguments,1);return function(){var ue=W.slice();return ue.push.apply(ue,arguments),p.apply(this,ue)}}function d(p,C){function W(){}W.prototype=C.prototype,p.Z=C.prototype,p.prototype=new W,p.prototype.constructor=p,p.Ob=function(ue,qe,Je){for(var Vt=Array(arguments.length-2),kr=2;kr<arguments.length;kr++)Vt[kr-2]=arguments[kr];return C.prototype[qe].apply(ue,Vt)}}var h=typeof AsyncContext<"u"&&"function"==typeof AsyncContext.Snapshot?p=>p&&AsyncContext.Snapshot.wrap(p):p=>p;function f(p){const C=p.length;if(C>0){const W=Array(C);for(let ue=0;ue<C;ue++)W[ue]=p[ue];return W}return[]}function g(p,C){for(let ue=1;ue<arguments.length;ue++){const qe=arguments[ue];var W=typeof qe;if("array"==(W="object"!=W?W:qe?Array.isArray(qe)?"array":W:"null")||"object"==W&&"number"==typeof qe.length){const Je=qe.length||0;p.length=(W=p.length||0)+Je;for(let Vt=0;Vt<Je;Vt++)p[W+Vt]=qe[Vt]}else p.push(qe)}}function v(p){a.setTimeout(()=>{throw p},0)}function m(){var p=S;let C=null;return p.g&&(C=p.g,p.g=p.g.next,p.g||(p.h=null),C.next=null),C}var T=new class y{constructor(C,W){this.i=C,this.j=W,this.h=0,this.g=null}get(){let C;return this.h>0?(this.h--,C=this.g,this.g=C.next,C.next=null):C=this.i(),C}}(()=>new O,p=>p.reset());class O{constructor(){this.next=this.g=this.h=null}set(C,W){this.h=C,this.g=W,this.next=null}reset(){this.next=this.g=this.h=null}}let K,Z=!1,S=new class b{constructor(){this.h=this.g=null}add(C,W){const ue=T.get();ue.set(C,W),this.h?this.h.next=ue:this.g=ue,this.h=ue}},P=()=>{const p=Promise.resolve(void 0);K=()=>{p.then(M)}};function M(){for(var p;p=m();){try{p.h.call(p.g)}catch(W){v(W)}var C=T;C.j(p),C.h<100&&(C.h++,p.next=C.g,C.g=p)}Z=!1}function q(){this.u=this.u,this.C=this.C}function G(p,C){this.type=p,this.g=this.target=C,this.defaultPrevented=!1}q.prototype.u=!1,q.prototype.dispose=function(){this.u||(this.u=!0,this.N())},q.prototype[Symbol.dispose]=function(){this.dispose()},q.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},G.prototype.h=function(){this.defaultPrevented=!0};var X=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var p=!1,C=Object.defineProperty({},"passive",{get:function(){p=!0}});try{const W=()=>{};a.addEventListener("test",W,C),a.removeEventListener("test",W,C)}catch{}return p}();function U(p){return/^[\s\xa0]*$/.test(p)}function me(p,C){G.call(this,p?p.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,p&&this.init(p,C)}d(me,G),me.prototype.init=function(p,C){const W=this.type=p.type,ue=p.changedTouches&&p.changedTouches.length?p.changedTouches[0]:null;this.target=p.target||p.srcElement,this.g=C,(C=p.relatedTarget)||("mouseover"==W?C=p.fromElement:"mouseout"==W&&(C=p.toElement)),this.relatedTarget=C,ue?(this.clientX=void 0!==ue.clientX?ue.clientX:ue.pageX,this.clientY=void 0!==ue.clientY?ue.clientY:ue.pageY,this.screenX=ue.screenX||0,this.screenY=ue.screenY||0):(this.clientX=void 0!==p.clientX?p.clientX:p.pageX,this.clientY=void 0!==p.clientY?p.clientY:p.pageY,this.screenX=p.screenX||0,this.screenY=p.screenY||0),this.button=p.button,this.key=p.key||"",this.ctrlKey=p.ctrlKey,this.altKey=p.altKey,this.shiftKey=p.shiftKey,this.metaKey=p.metaKey,this.pointerId=p.pointerId||0,this.pointerType=p.pointerType,this.state=p.state,this.i=p,p.defaultPrevented&&me.Z.h.call(this)},me.prototype.h=function(){me.Z.h.call(this);const p=this.i;p.preventDefault?p.preventDefault():p.returnValue=!1};var be="closure_listenable_"+(1e6*Math.random()|0),Ae=0;function _e(p,C,W,ue,qe){this.listener=p,this.proxy=null,this.src=C,this.type=W,this.capture=!!ue,this.ha=qe,this.key=++Ae,this.da=this.fa=!1}function Se(p){p.da=!0,p.listener=null,p.proxy=null,p.src=null,p.ha=null}function je(p,C,W){for(const ue in p)C.call(W,p[ue],ue,p)}function De(p){const C={};for(const W in p)C[W]=p[W];return C}const ze="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function lt(p,C){let W,ue;for(let qe=1;qe<arguments.length;qe++){for(W in ue=arguments[qe],ue)p[W]=ue[W];for(let Je=0;Je<ze.length;Je++)W=ze[Je],Object.prototype.hasOwnProperty.call(ue,W)&&(p[W]=ue[W])}}function yt(p){this.src=p,this.g={},this.h=0}function ot(p,C){const W=C.type;if(W in p.g){var Je,ue=p.g[W],qe=Array.prototype.indexOf.call(ue,C,void 0);(Je=qe>=0)&&Array.prototype.splice.call(ue,qe,1),Je&&(Se(C),0==p.g[W].length&&(delete p.g[W],p.h--))}}function bt(p,C,W,ue){for(let qe=0;qe<p.length;++qe){const Je=p[qe];if(!Je.da&&Je.listener==C&&Je.capture==!!W&&Je.ha==ue)return qe}return-1}yt.prototype.add=function(p,C,W,ue,qe){const Je=p.toString();(p=this.g[Je])||(p=this.g[Je]=[],this.h++);const Vt=bt(p,C,ue,qe);return Vt>-1?(C=p[Vt],W||(C.fa=!1)):((C=new _e(C,this.src,Je,!!ue,qe)).fa=W,p.push(C)),C};var xt="closure_lm_"+(1e6*Math.random()|0),zt={};function _t(p,C,W,ue,qe){if(ue&&ue.once)return Ye(p,C,W,ue,qe);if(Array.isArray(C)){for(let Je=0;Je<C.length;Je++)_t(p,C[Je],W,ue,qe);return null}return W=ar(W),p&&p[be]?p.J(C,W,s(ue)?!!ue.capture:!!ue,qe):Ue(p,C,W,!1,ue,qe)}function Ue(p,C,W,ue,qe,Je){if(!C)throw Error("Invalid event type");const Vt=s(qe)?!!qe.capture:!!qe;let kr=vr(p);if(kr||(p[xt]=kr=new yt(p)),(W=kr.add(C,W,ue,Vt,Je)).proxy)return W;if(ue=function He(){const C=Ur;return function p(W){return C.call(p.src,p.listener,W)}}(),W.proxy=ue,ue.src=p,ue.listener=W,p.addEventListener)X||(qe=Vt),void 0===qe&&(qe=!1),p.addEventListener(C.toString(),ue,qe);else if(p.attachEvent)p.attachEvent(tr(C.toString()),ue);else{if(!p.addListener||!p.removeListener)throw Error("addEventListener and attachEvent are unavailable.");p.addListener(ue)}return W}function Ye(p,C,W,ue,qe){if(Array.isArray(C)){for(let Je=0;Je<C.length;Je++)Ye(p,C[Je],W,ue,qe);return null}return W=ar(W),p&&p[be]?p.K(C,W,s(ue)?!!ue.capture:!!ue,qe):Ue(p,C,W,!0,ue,qe)}function pt(p,C,W,ue,qe){if(Array.isArray(C))for(var Je=0;Je<C.length;Je++)pt(p,C[Je],W,ue,qe);else ue=s(ue)?!!ue.capture:!!ue,W=ar(W),p&&p[be]?(p=p.i,(Je=String(C).toString())in p.g&&(W=bt(C=p.g[Je],W,ue,qe))>-1&&(Se(C[W]),Array.prototype.splice.call(C,W,1),0==C.length&&(delete p.g[Je],p.h--))):p&&(p=vr(p))&&(C=p.g[C.toString()],p=-1,C&&(p=bt(C,W,ue,qe)),(W=p>-1?C[p]:null)&&Lt(W))}function Lt(p){if("number"!=typeof p&&p&&!p.da){var C=p.src;if(C&&C[be])ot(C.i,p);else{var W=p.type,ue=p.proxy;C.removeEventListener?C.removeEventListener(W,ue,p.capture):C.detachEvent?C.detachEvent(tr(W),ue):C.addListener&&C.removeListener&&C.removeListener(ue),(W=vr(C))?(ot(W,p),0==W.h&&(W.src=null,C[xt]=null)):Se(p)}}}function tr(p){return p in zt?zt[p]:zt[p]="on"+p}function Ur(p,C){if(p.da)p=!0;else{C=new me(C,this);const W=p.listener,ue=p.ha||p.src;p.fa&&Lt(p),p=W.call(ue,C)}return p}function vr(p){return(p=p[xt])instanceof yt?p:null}var cr="__closure_events_fn_"+(1e9*Math.random()>>>0);function ar(p){return"function"==typeof p?p:(p[cr]||(p[cr]=function(C){return p.handleEvent(C)}),p[cr])}function Rt(){q.call(this),this.i=new yt(this),this.M=this,this.G=null}function Gt(p,C){var W,ue=p.G;if(ue)for(W=[];ue;ue=ue.G)W.push(ue);if(p=p.M,ue=C.type||C,"string"==typeof C)C=new G(C,p);else if(C instanceof G)C.target=C.target||p;else{var qe=C;lt(C=new G(ue,p),qe)}let Je,Vt;if(qe=!0,W)for(Vt=W.length-1;Vt>=0;Vt--)Je=C.g=W[Vt],qe=rr(Je,ue,!0,C)&&qe;if(Je=C.g=p,qe=rr(Je,ue,!0,C)&&qe,qe=rr(Je,ue,!1,C)&&qe,W)for(Vt=0;Vt<W.length;Vt++)Je=C.g=W[Vt],qe=rr(Je,ue,!1,C)&&qe}function rr(p,C,W,ue){if(!(C=p.i.g[String(C)]))return!0;C=C.concat();let qe=!0;for(let Je=0;Je<C.length;++Je){const Vt=C[Je];if(Vt&&!Vt.da&&Vt.capture==W){const kr=Vt.listener,ui=Vt.ha||Vt.src;Vt.fa&&ot(p.i,Vt),qe=!1!==kr.call(ui,ue)&&qe}}return qe&&!ue.defaultPrevented}function or(p){p.g=function _r(p,C){if("function"!=typeof p){if(!p||"function"!=typeof p.handleEvent)throw Error("Invalid listener argument");p=u(p.handleEvent,p)}return Number(C)>2147483647?-1:a.setTimeout(p,C||0)}(()=>{p.g=null,p.i&&(p.i=!1,or(p))},p.l);const C=p.h;p.h=null,p.m.apply(null,C)}d(Rt,q),Rt.prototype[be]=!0,Rt.prototype.removeEventListener=function(p,C,W,ue){pt(this,p,C,W,ue)},Rt.prototype.N=function(){if(Rt.Z.N.call(this),this.i){var p=this.i;for(const C in p.g){const W=p.g[C];for(let ue=0;ue<W.length;ue++)Se(W[ue]);delete p.g[C],p.h--}}this.G=null},Rt.prototype.J=function(p,C,W,ue){return this.i.add(String(p),C,!1,W,ue)},Rt.prototype.K=function(p,C,W,ue){return this.i.add(String(p),C,!0,W,ue)};class Ar extends q{constructor(C,W){super(),this.m=C,this.l=W,this.h=null,this.i=!1,this.g=null}j(C){this.h=arguments,this.g?this.i=!0:or(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Rr(p){q.call(this),this.h=p,this.g={}}d(Rr,q);var $r=[];function Hr(p){je(p.g,function(C,W){this.g.hasOwnProperty(W)&&Lt(C)},p),p.g={}}Rr.prototype.N=function(){Rr.Z.N.call(this),Hr(this)},Rr.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Gr=a.JSON.stringify,yr=a.JSON.parse,Xt=class{stringify(p){return a.JSON.stringify(p,void 0)}parse(p){return a.JSON.parse(p,void 0)}};function ut(){}function le(){}var $e={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function rt(){G.call(this,"d")}function nt(){G.call(this,"c")}d(rt,G),d(nt,G);var it={},Ht=null;function Et(){return Ht=Ht||new Rt}function Jt(p){G.call(this,it.Ia,p)}function $t(p){const C=Et();Gt(C,new Jt(C))}function dr(p,C){G.call(this,it.STAT_EVENT,p),this.stat=C}function hr(p){const C=Et();Gt(C,new dr(C,p))}function br(p,C){G.call(this,it.Ja,p),this.size=C}function Yt(p,C){if("function"!=typeof p)throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){p()},C)}function Er(){this.g=!0}function tn(p,C,W,ue){p.info(function(){return"XMLHTTP TEXT ("+C+"): "+function Un(p,C){if(!p.g)return C;if(!C)return null;try{const Je=JSON.parse(C);if(Je)for(p=0;p<Je.length;p++)if(Array.isArray(Je[p])){var W=Je[p];if(!(W.length<2)){var ue=W[1];if(Array.isArray(ue)&&!(ue.length<1)){var qe=ue[0];if("noop"!=qe&&"stop"!=qe&&"close"!=qe)for(let Vt=1;Vt<ue.length;Vt++)ue[Vt]=""}}}return Gr(Je)}catch{return C}}(p,W)+(ue?" "+ue:"")})}it.Ia="serverreachability",d(Jt,G),it.STAT_EVENT="statevent",d(dr,G),it.Ja="timingevent",d(br,G),Er.prototype.ua=function(){this.g=!1},Er.prototype.info=function(){};var ti,Mn={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},zn={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"};function Go(){}function bn(p){return encodeURIComponent(String(p))}function sa(p){var C=1;p=p.split(":");const W=[];for(;C>0&&p.length;)W.push(p.shift()),C--;return p.length&&W.push(p.join(":")),W}function _i(p,C,W,ue){this.j=p,this.i=C,this.l=W,this.S=ue||1,this.V=new Rr(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new ss}function ss(){this.i=null,this.g="",this.h=!1}d(Go,ut),Go.prototype.g=function(){return new XMLHttpRequest},ti=new Go;var su={},la={};function wi(p,C,W){p.M=1,p.A=Am(Xi(C)),p.u=W,p.R=!0,li(p,null)}function li(p,C){p.F=Date.now(),lu(p),p.B=Xi(p.A);var W=p.B,ue=p.S;Array.isArray(ue)||(ue=[String(ue)]),A2(W.i,"t",ue),p.C=0,W=p.j.L,p.h=new ss,p.g=j2(p.j,W?C:null,!p.u),p.P>0&&(p.O=new Ar(u(p.Y,p,p.g),p.P)),C=p.V,W=p.g,ue=p.ba;var qe="readystatechange";Array.isArray(qe)||(qe&&($r[0]=qe.toString()),qe=$r);for(let Je=0;Je<qe.length;Je++){const Vt=_t(W,qe[Je],ue||C.handleEvent,!1,C.h||C);if(!Vt)break;C.g[Vt.key]=Vt}C=p.J?De(p.J):{},p.u?(p.v||(p.v="POST"),C["Content-Type"]="application/x-www-form-urlencoded",p.g.ea(p.B,p.v,p.u,C)):(p.v="GET",p.g.ea(p.B,p.v,null,C)),$t(),function Pr(p,C,W,ue,qe,Je){p.info(function(){if(p.g)if(Je){var Vt="",kr=Je.split("&");for(let fn=0;fn<kr.length;fn++){var ui=kr[fn].split("=");if(ui.length>1){const bi=ui[0];ui=ui[1];const Da=bi.split("_");Vt=Da.length>=2&&"type"==Da[1]?Vt+(bi+"=")+ui+"&":Vt+(bi+"=redacted&")}}}else Vt=null;else Vt=Je;return"XMLHTTP REQ ("+ue+") [attempt "+qe+"]: "+C+"\n"+W+"\n"+Vt})}(p.i,p.v,p.B,p.l,p.S,p.u)}function il(p){return!!p.g&&"GET"==p.v&&2!=p.M&&p.j.Aa}function mo(p,C){var W=p.C,ue=C.indexOf("\n",W);return-1==ue?la:(W=Number(C.substring(W,ue)),isNaN(W)?su:(ue+=1)+W>C.length?la:(C=C.slice(ue,ue+W),p.C=ue+W,C))}function lu(p){p.T=Date.now()+p.H,Em(p,p.H)}function Em(p,C){if(null!=p.D)throw Error("WatchDog timer not null");p.D=Yt(u(p.aa,p),C)}function nf(p){p.D&&(a.clearTimeout(p.D),p.D=null)}function uu(p){0==p.j.I||p.K||U2(p.j,p)}function ls(p){nf(p);var C=p.O;C&&"function"==typeof C.dispose&&C.dispose(),p.O=null,Hr(p.V),p.g&&(C=p.g,p.g=null,C.abort(),C.dispose())}function of(p,C){try{var W=p.j;if(0!=W.I&&(W.g==p||al(W.h,p)))if(!p.L&&al(W.h,p)&&3==W.I){try{var ue=W.Ba.g.parse(C)}catch{ue=null}if(Array.isArray(ue)&&3==ue.length){var qe=ue;if(0==qe[0]){e:if(!W.v){if(W.g){if(!(W.g.F+3e3<p.F))break e;Dm(W),Pm(W)}mI(W),hr(18)}}else W.xa=qe[1],0<W.xa-W.K&&qe[2]<37500&&W.F&&0==W.A&&!W.C&&(W.C=Yt(u(W.Va,W),6e3));zc(W.h)<=1&&W.ta&&(W.ta=void 0)}else hu(W,11)}else if((p.L||W.g==p)&&Dm(W),!U(C))for(qe=W.Ba.g.parse(C),C=0;C<qe.length;C++){let fn=qe[C];const bi=fn[0];if(!(bi<=W.K))if(W.K=bi,fn=fn[1],2==W.I)if("c"==fn[0]){W.M=fn[1],W.ba=fn[2];const Da=fn[3];null!=Da&&(W.ka=Da,W.j.info("VER="+W.ka));const fu=fn[4];null!=fu&&(W.za=fu,W.j.info("SVER="+W.za));const ul=fn[5];null!=ul&&"number"==typeof ul&&ul>0&&(W.O=ue=1.5*ul,W.j.info("backChannelRequestTimeoutMs_="+ue)),ue=W;const cl=p.g;if(cl){const Lm=cl.g?cl.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(Lm){var Je=ue.h;Je.g||-1==Lm.indexOf("spdy")&&-1==Lm.indexOf("quic")&&-1==Lm.indexOf("h2")||(Je.j=Je.l,Je.g=new Set,Je.h&&(Gc(Je,Je.h),Je.h=null))}if(ue.G){const yI=cl.g?cl.g.getResponseHeader("X-HTTP-Session-Id"):null;yI&&(ue.wa=yI,hn(ue.J,ue.G,yI))}}W.I=3,W.l&&W.l.ra(),W.aa&&(W.T=Date.now()-p.F,W.j.info("Handshake RTT: "+W.T+"ms"));var Vt=p;if((ue=W).na=q2(ue,ue.L?ue.ba:null,ue.W),Vt.L){af(ue.h,Vt);var kr=Vt,ui=ue.O;ui&&(kr.H=ui),kr.D&&(nf(kr),lu(kr)),ue.g=Vt}else V2(ue);W.i.length>0&&km(W)}else"stop"!=fn[0]&&"close"!=fn[0]||hu(W,7);else 3==W.I&&("stop"==fn[0]||"close"==fn[0]?"stop"==fn[0]?hu(W,7):gI(W):"noop"!=fn[0]&&W.l&&W.l.qa(fn),W.A=0)}$t()}catch{}}_i.prototype.ba=function(p){p=p.target;const C=this.O;C&&3==ll(p)?C.j():this.Y(p)},_i.prototype.Y=function(p){try{if(p==this.g)e:{const kr=ll(this.g),ui=this.g.ya();if(this.g.ca(),!(kr<3)&&(3!=kr||this.g&&(this.h.h||this.g.la()||N2(this.g)))){this.K||4!=kr||7==ui||$t(),nf(this);var C=this.g.ca();this.X=C;var W=function Wi(p){if(!il(p))return p.g.la();const C=N2(p.g);if(""===C)return"";let W="";const ue=C.length,qe=4==ll(p.g);if(!p.h.i){if(typeof TextDecoder>"u")return ls(p),uu(p),"";p.h.i=new a.TextDecoder}for(let Je=0;Je<ue;Je++)p.h.h=!0,W+=p.h.i.decode(C[Je],{stream:!(qe&&Je==ue-1)});return C.length=0,p.h.g+=W,p.C=0,p.h.g}(this);if(this.o=200==C,function Wn(p,C,W,ue,qe,Je,Vt){p.info(function(){return"XMLHTTP RESP ("+ue+") [ attempt "+qe+"]: "+C+"\n"+W+"\n"+Je+" "+Vt})}(this.i,this.v,this.B,this.l,this.S,kr,C),this.o){if(this.U&&!this.L){t:{if(this.g){var ue,qe=this.g;if((ue=qe.g?qe.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!U(ue)){var Je=ue;break t}}Je=null}if(!(p=Je)){this.o=!1,this.m=3,hr(12),ls(this),uu(this);break e}tn(this.i,this.l,p,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,of(this,p)}if(this.R){let bi;for(p=!0;!this.K&&this.C<W.length;){if(bi=mo(this,W),bi==la){4==kr&&(this.m=4,hr(14),p=!1),tn(this.i,this.l,null,"[Incomplete Response]");break}if(bi==su){this.m=4,hr(15),tn(this.i,this.l,W,"[Invalid Chunk]"),p=!1;break}tn(this.i,this.l,bi,null),of(this,bi)}if(il(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=kr||0!=W.length||this.h.h||(this.m=1,hr(16),p=!1),this.o=this.o&&p,p){if(W.length>0&&!this.W){this.W=!0;var Vt=this.j;Vt.g==this&&Vt.aa&&!Vt.P&&(Vt.j.info("Great, no buffering proxy detected. Bytes received: "+W.length),vI(Vt),Vt.P=!0,hr(11))}}else tn(this.i,this.l,W,"[Invalid Chunked Response]"),ls(this),uu(this)}else tn(this.i,this.l,W,null),of(this,W);4==kr&&ls(this),this.o&&!this.K&&(4==kr?U2(this.j,this):(this.o=!1,lu(this)))}else(function cW(p){const C={};p=(p.g&&ll(p)>=2&&p.g.getAllResponseHeaders()||"").split("\r\n");for(let ue=0;ue<p.length;ue++){if(U(p[ue]))continue;var W=sa(p[ue]);const qe=W[0];if("string"!=typeof(W=W[1]))continue;W=W.trim();const Je=C[qe]||[];C[qe]=Je,Je.push(W)}!function Xe(p,C){for(const W in p)C.call(void 0,p[W],W,p)}(C,function(ue){return ue.join(", ")})})(this.g),400==C&&W.indexOf("Unknown SID")>0?(this.m=3,hr(12)):(this.m=0,hr(13)),ls(this),uu(this)}}}catch{}},_i.prototype.cancel=function(){this.K=!0,ls(this)},_i.prototype.aa=function(){this.D=null;const p=Date.now();p-this.T>=0?(function Ni(p,C){p.info(function(){return"TIMEOUT: "+C})}(this.i,this.B),2!=this.M&&($t(),hr(17)),ls(this),this.m=2,uu(this)):Em(this,this.T-p)};var fI=class{constructor(p,C){this.g=p,this.map=C}};function Tm(p){this.l=p||10,p=a.PerformanceNavigationTiming?(p=a.performance.getEntriesByType("navigation")).length>0&&("hq"==p[0].nextHopProtocol||"h2"==p[0].nextHopProtocol):!!(a.chrome&&a.chrome.loadTimes&&a.chrome.loadTimes()&&a.chrome.loadTimes().wasFetchedViaSpdy),this.j=p?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function ol(p){return!!p.h||!!p.g&&p.g.size>=p.j}function zc(p){return p.h?1:p.g?p.g.size:0}function al(p,C){return p.h?p.h==C:!!p.g&&p.g.has(C)}function Gc(p,C){p.g?p.g.add(C):p.h=C}function af(p,C){p.h&&p.h==C?p.h=null:p.g&&p.g.has(C)&&p.g.delete(C)}function Im(p){if(null!=p.h)return p.i.concat(p.h.G);if(null!=p.g&&0!==p.g.size){let C=p.i;for(const W of p.g.values())C=C.concat(W.G);return C}return f(p.i)}Tm.prototype.cancel=function(){if(this.i=Im(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const p of this.g.values())p.cancel();this.g.clear()}};var vo=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function ua(p){let C;this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1,p instanceof ua?(this.l=p.l,Li(this,p.j),this.o=p.o,this.g=p.g,cu(this,p.u),this.h=p.h,xm(this,S2(p.i)),this.m=p.m):p&&(C=String(p).match(vo))?(this.l=!1,Li(this,C[1]||"",!0),this.o=lf(C[2]||""),this.g=lf(C[3]||"",!0),cu(this,C[4]),this.h=lf(C[5]||"",!0),xm(this,C[6]||"",!0),this.m=lf(C[7]||"")):(this.l=!1,this.i=new cf(null,this.l))}function Xi(p){return new ua(p)}function Li(p,C,W){p.j=W?lf(C,!0):C,p.j&&(p.j=p.j.replace(/:$/,""))}function cu(p,C){if(C){if(C=Number(C),isNaN(C)||C<0)throw Error("Bad port number "+C);p.u=C}else p.u=null}function xm(p,C,W){C instanceof cf?(p.i=C,function iW(p,C){C&&!p.j&&(du(p),p.i=null,p.g.forEach(function(W,ue){const qe=ue.toLowerCase();ue!=qe&&(T2(this,ue),A2(this,qe,W))},p)),p.j=C}(p.i,p.l)):(W||(C=uf(C,rW)),p.i=new cf(C,p.l))}function hn(p,C,W){p.i.set(C,W)}function Am(p){return hn(p,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),p}function lf(p,C){return p?C?decodeURI(p.replace(/%25/g,"%2525")):decodeURIComponent(p):""}function uf(p,C,W){return"string"==typeof p?(p=encodeURI(p).replace(C,Z8),W&&(p=p.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),p):null}function Z8(p){return"%"+((p=p.charCodeAt(0))>>4&15).toString(16)+(15&p).toString(16)}ua.prototype.toString=function(){const p=[];var C=this.j;C&&p.push(uf(C,E2,!0),":");var W=this.g;return(W||"file"==C)&&(p.push("//"),(C=this.o)&&p.push(uf(C,E2,!0),"@"),p.push(bn(W).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(W=this.u)&&p.push(":",String(W))),(W=this.h)&&(this.g&&"/"!=W.charAt(0)&&p.push("/"),p.push(uf(W,"/"==W.charAt(0)?tW:eW,!0))),(W=this.i.toString())&&p.push("?",W),(W=this.m)&&p.push("#",uf(W,nW)),p.join("")},ua.prototype.resolve=function(p){const C=Xi(this);let W=!!p.j;W?Li(C,p.j):W=!!p.o,W?C.o=p.o:W=!!p.g,W?C.g=p.g:W=null!=p.u;var ue=p.h;if(W)cu(C,p.u);else if(W=!!p.h){if("/"!=ue.charAt(0))if(this.g&&!this.h)ue="/"+ue;else{var qe=C.h.lastIndexOf("/");-1!=qe&&(ue=C.h.slice(0,qe+1)+ue)}if(".."==(qe=ue)||"."==qe)ue="";else if(-1!=qe.indexOf("./")||-1!=qe.indexOf("/.")){ue=0==qe.lastIndexOf("/",0),qe=qe.split("/");const Je=[];for(let Vt=0;Vt<qe.length;){const kr=qe[Vt++];"."==kr?ue&&Vt==qe.length&&Je.push(""):".."==kr?((Je.length>1||1==Je.length&&""!=Je[0])&&Je.pop(),ue&&Vt==qe.length&&Je.push("")):(Je.push(kr),ue=!0)}ue=Je.join("/")}else ue=qe}return W?C.h=ue:W=""!==p.i.toString(),W?xm(C,S2(p.i)):W=!!p.m,W&&(C.m=p.m),C};var E2=/[#\/\?@]/g,eW=/[#\?:]/g,tW=/[#\?]/g,rW=/[#\?@]/g,nW=/#/g;function cf(p,C){this.h=this.g=null,this.i=p||null,this.j=!!C}function du(p){p.g||(p.g=new Map,p.h=0,p.i&&function sf(p,C){if(p){p=p.split("&");for(let W=0;W<p.length;W++){const ue=p[W].indexOf("=");let qe,Je=null;ue>=0?(qe=p[W].substring(0,ue),Je=p[W].substring(ue+1)):qe=p[W],C(qe,Je?decodeURIComponent(Je.replace(/\+/g," ")):"")}}}(p.i,function(C,W){p.add(decodeURIComponent(C.replace(/\+/g," ")),W)}))}function T2(p,C){du(p),C=qc(p,C),p.g.has(C)&&(p.i=null,p.h-=p.g.get(C).length,p.g.delete(C))}function I2(p,C){return du(p),C=qc(p,C),p.g.has(C)}function x2(p,C){du(p);let W=[];if("string"==typeof C)I2(p,C)&&(W=W.concat(p.g.get(qc(p,C))));else for(p=Array.from(p.g.values()),C=0;C<p.length;C++)W=W.concat(p[C]);return W}function A2(p,C,W){T2(p,C),W.length>0&&(p.i=null,p.g.set(qc(p,C),f(W)),p.h+=W.length)}function S2(p){const C=new cf;return C.i=p.i,p.g&&(C.g=new Map(p.g),C.h=p.h),C}function qc(p,C){return C=String(C),p.j&&(C=C.toLowerCase()),C}function sl(p,C,W,ue,qe){try{qe&&(qe.onload=null,qe.onerror=null,qe.onabort=null,qe.ontimeout=null),ue(W)}catch{}}function sW(){this.g=new Xt}function Sm(p){this.i=p.Sb||null,this.h=p.ab||!1}function Cm(p,C){Rt.call(this),this.H=p,this.o=C,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}function C2(p){p.j.read().then(p.Ma.bind(p)).catch(p.ga.bind(p))}function df(p){p.readyState=4,p.l=null,p.j=null,p.B=null,hf(p)}function hf(p){p.onreadystatechange&&p.onreadystatechange.call(p)}function R2(p){let C="";return je(p,function(W,ue){C+=ue,C+=":",C+=W,C+="\r\n"}),C}function pI(p,C,W){e:{for(ue in W){var ue=!1;break e}ue=!0}ue||(W=R2(W),"string"==typeof p?null!=W&&bn(W):hn(p,C,W))}function Gn(p){Rt.call(this),this.headers=new Map,this.L=p||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}(r=cf.prototype).add=function(p,C){du(this),this.i=null,p=qc(this,p);let W=this.g.get(p);return W||this.g.set(p,W=[]),W.push(C),this.h+=1,this},r.forEach=function(p,C){du(this),this.g.forEach(function(W,ue){W.forEach(function(qe){p.call(C,qe,ue,this)},this)},this)},r.set=function(p,C){return du(this),this.i=null,I2(this,p=qc(this,p))&&(this.h-=this.g.get(p).length),this.g.set(p,[C]),this.h+=1,this},r.get=function(p,C){return p&&(p=x2(this,p)).length>0?String(p[0]):C},r.toString=function(){if(this.i)return this.i;if(!this.g)return"";const p=[],C=Array.from(this.g.keys());for(let ue=0;ue<C.length;ue++){var W=C[ue];const qe=bn(W);W=x2(this,W);for(let Je=0;Je<W.length;Je++){let Vt=qe;""!==W[Je]&&(Vt+="="+bn(W[Je])),p.push(Vt)}}return this.i=p.join("&")},d(Sm,ut),Sm.prototype.g=function(){return new Cm(this.i,this.h)},d(Cm,Rt),(r=Cm.prototype).open=function(p,C){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.F=p,this.D=C,this.readyState=1,hf(this)},r.send=function(p){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const C={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};p&&(C.body=p),(this.H||a).fetch(new Request(this.D,C)).then(this.Pa.bind(this),this.ga.bind(this))},r.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&4!=this.readyState&&(this.g=!1,df(this)),this.readyState=0},r.Pa=function(p){if(this.g&&(this.l=p,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=p.headers,this.readyState=2,hf(this)),this.g&&(this.readyState=3,hf(this),this.g)))if("arraybuffer"===this.responseType)p.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in p){if(this.j=p.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;C2(this)}else p.text().then(this.Oa.bind(this),this.ga.bind(this))},r.Ma=function(p){if(this.g){if(this.o&&p.value)this.response.push(p.value);else if(!this.o){var C=p.value?p.value:new Uint8Array(0);(C=this.B.decode(C,{stream:!p.done}))&&(this.response=this.responseText+=C)}p.done?df(this):hf(this),3==this.readyState&&C2(this)}},r.Oa=function(p){this.g&&(this.response=this.responseText=p,df(this))},r.Na=function(p){this.g&&(this.response=p,df(this))},r.ga=function(){this.g&&df(this)},r.setRequestHeader=function(p,C){this.A.append(p,C)},r.getResponseHeader=function(p){return this.h&&this.h.get(p.toLowerCase())||""},r.getAllResponseHeaders=function(){if(!this.h)return"";const p=[],C=this.h.entries();for(var W=C.next();!W.done;)p.push((W=W.value)[0]+": "+W[1]),W=C.next();return p.join("\r\n")},Object.defineProperty(Cm.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(p){this.m=p?"include":"same-origin"}}),d(Gn,Rt);var lW=/^https?$/i,uW=["POST","PUT"];function P2(p,C){p.h=!1,p.g&&(p.j=!0,p.g.abort(),p.j=!1),p.l=C,p.o=5,k2(p),Rm(p)}function k2(p){p.A||(p.A=!0,Gt(p,"complete"),Gt(p,"error"))}function D2(p){if(p.h&&typeof o<"u")if(p.v&&4==ll(p))setTimeout(p.Ca.bind(p),0);else if(Gt(p,"readystatechange"),4==ll(p)){p.h=!1;try{const Je=p.ca();e:switch(Je){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var C=!0;break e;default:C=!1}var W;if(!(W=C)){var ue;if(ue=0===Je){let Vt=String(p.D).match(vo)[1]||null;!Vt&&a.self&&a.self.location&&(Vt=a.self.location.protocol.slice(0,-1)),ue=!lW.test(Vt?Vt.toLowerCase():"")}W=ue}if(W)Gt(p,"complete"),Gt(p,"success");else{p.o=6;try{var qe=ll(p)>2?p.g.statusText:""}catch{qe=""}p.l=qe+" ["+p.ca()+"]",k2(p)}}finally{Rm(p)}}}function Rm(p,C){if(p.g){p.m&&(clearTimeout(p.m),p.m=null);const W=p.g;p.g=null,C||Gt(p,"ready");try{W.onreadystatechange=null}catch{}}}function ll(p){return p.g?p.g.readyState:0}function N2(p){try{if(!p.g)return null;if("response"in p.g)return p.g.response;switch(p.F){case"":case"text":return p.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in p.g)return p.g.mozResponseArrayBuffer}return null}catch{return null}}function ff(p,C,W){return W&&W.internalChannelParams&&W.internalChannelParams[p]||C}function L2(p){this.za=0,this.i=[],this.j=new Er,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=ff("failFast",!1,p),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=ff("baseRetryDelayMs",5e3,p),this.Za=ff("retryDelaySeedMs",1e4,p),this.Ta=ff("forwardChannelMaxRetries",2,p),this.va=ff("forwardChannelRequestTimeoutMs",2e4,p),this.ma=p&&p.xmlHttpFactory||void 0,this.Ua=p&&p.Rb||void 0,this.Aa=p&&p.useFetchStreams||!1,this.O=void 0,this.L=p&&p.supportsCrossDomainXhr||!1,this.M="",this.h=new Tm(p&&p.concurrentRequestLimit),this.Ba=new sW,this.S=p&&p.fastHandshake||!1,this.R=p&&p.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=p&&p.Pb||!1,p&&p.ua&&this.j.ua(),p&&p.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&p&&p.detectBufferingProxy||!1,this.ia=void 0,p&&p.longPollingTimeout&&p.longPollingTimeout>0&&(this.ia=p.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}function gI(p){if(O2(p),3==p.I){var C=p.V++,W=Xi(p.J);if(hn(W,"SID",p.M),hn(W,"RID",C),hn(W,"TYPE","terminate"),pf(p,W),(C=new _i(p,p.j,C)).M=2,C.A=Am(Xi(W)),W=!1,a.navigator&&a.navigator.sendBeacon)try{W=a.navigator.sendBeacon(C.A.toString(),"")}catch{}!W&&a.Image&&((new Image).src=C.A,W=!0),W||(C.g=j2(C.j,null),C.g.ea(C.A)),C.F=Date.now(),lu(C)}G2(p)}function Pm(p){p.g&&(vI(p),p.g.cancel(),p.g=null)}function O2(p){Pm(p),p.v&&(a.clearTimeout(p.v),p.v=null),Dm(p),p.h.cancel(),p.m&&("number"==typeof p.m&&a.clearTimeout(p.m),p.m=null)}function km(p){if(!ol(p.h)&&!p.m){p.m=!0;var C=p.Ea;K||P(),Z||(K(),Z=!0),S.add(C,p),p.D=0}}function M2(p,C){var W;W=C?C.l:p.V++;const ue=Xi(p.J);hn(ue,"SID",p.M),hn(ue,"RID",W),hn(ue,"AID",p.K),pf(p,ue),p.u&&p.o&&pI(ue,p.u,p.o),W=new _i(p,p.j,W,p.D+1),null===p.u&&(W.J=p.o),C&&(p.i=C.G.concat(p.i)),C=F2(p,W,1e3),W.H=Math.round(.5*p.va)+Math.round(.5*p.va*Math.random()),Gc(p.h,W),wi(W,ue,C)}function pf(p,C){p.H&&je(p.H,function(W,ue){hn(C,ue,W)}),p.l&&je({},function(W,ue){hn(C,ue,W)})}function F2(p,C,W){W=Math.min(p.i.length,W);const ue=p.l?u(p.l.Ka,p.l,p):null;e:{var qe=p.i;let kr=-1;for(;;){const ui=["count="+W];-1==kr?W>0?(kr=qe[0].g,ui.push("ofs="+kr)):kr=0:ui.push("ofs="+kr);let fn=!0;for(let bi=0;bi<W;bi++){var Je=qe[bi].g;const Da=qe[bi].map;if((Je-=kr)<0)kr=Math.max(0,qe[bi].g-100),fn=!1;else try{Je="req"+Je+"_"||0;try{var Vt=Da instanceof Map?Da:Object.entries(Da);for(const[fu,ul]of Vt){let cl=ul;s(ul)&&(cl=Gr(ul)),ui.push(Je+fu+"="+encodeURIComponent(cl))}}catch(fu){throw ui.push(Je+"type="+encodeURIComponent("_badmap")),fu}}catch{ue&&ue(Da)}}if(fn){Vt=ui.join("&");break e}}Vt=void 0}return p=p.i.splice(0,W),C.G=p,Vt}function V2(p){if(!p.g&&!p.v){p.Y=1;var C=p.Da;K||P(),Z||(K(),Z=!0),S.add(C,p),p.A=0}}function mI(p){return!(p.g||p.v||p.A>=3||(p.Y++,p.v=Yt(u(p.Da,p),z2(p,p.A)),p.A++,0))}function vI(p){null!=p.B&&(a.clearTimeout(p.B),p.B=null)}function B2(p){p.g=new _i(p,p.j,"rpc",p.Y),null===p.u&&(p.g.J=p.o),p.g.P=0;var C=Xi(p.na);hn(C,"RID","rpc"),hn(C,"SID",p.M),hn(C,"AID",p.K),hn(C,"CI",p.F?"0":"1"),!p.F&&p.ia&&hn(C,"TO",p.ia),hn(C,"TYPE","xmlhttp"),pf(p,C),p.u&&p.o&&pI(C,p.u,p.o),p.O&&(p.g.H=p.O);var W=p.g;p=p.ba,W.M=1,W.A=Am(Xi(C)),W.u=null,W.R=!0,li(W,p)}function Dm(p){null!=p.C&&(a.clearTimeout(p.C),p.C=null)}function U2(p,C){var W=null;if(p.g==C){Dm(p),vI(p),p.g=null;var ue=2}else{if(!al(p.h,C))return;W=C.G,af(p.h,C),ue=1}if(0!=p.I)if(C.o)if(1==ue){W=C.u?C.u.length:0,C=Date.now()-C.F;var qe=p.D;Gt(ue=Et(),new br(ue,W)),km(p)}else V2(p);else if(3==(qe=C.m)||0==qe&&C.X>0||!(1==ue&&function dW(p,C){return!(zc(p.h)>=p.h.j-(p.m?1:0)||(p.m?(p.i=C.G.concat(p.i),0):1==p.I||2==p.I||p.D>=(p.Sa?0:p.Ta)||(p.m=Yt(u(p.Ea,p,C),z2(p,p.D)),p.D++,0)))}(p,C)||2==ue&&mI(p)))switch(W&&W.length>0&&(C=p.h,C.i=C.i.concat(W)),qe){case 1:hu(p,5);break;case 4:hu(p,10);break;case 3:hu(p,6);break;default:hu(p,2)}}function z2(p,C){let W=p.Qa+Math.floor(Math.random()*p.Za);return p.isActive()||(W*=2),W*C}function hu(p,C){if(p.j.info("Error code "+C),2==C){var W=u(p.bb,p),ue=p.Ua;const qe=!ue;ue=new ua(ue||"//www.google.com/images/cleardot.gif"),a.location&&"http"==a.location.protocol||Li(ue,"https"),Am(ue),qe?function oW(p,C){const W=new Er;if(a.Image){const ue=new Image;ue.onload=c(sl,W,"TestLoadImage: loaded",!0,C,ue),ue.onerror=c(sl,W,"TestLoadImage: error",!1,C,ue),ue.onabort=c(sl,W,"TestLoadImage: abort",!1,C,ue),ue.ontimeout=c(sl,W,"TestLoadImage: timeout",!1,C,ue),a.setTimeout(function(){ue.ontimeout&&ue.ontimeout()},1e4),ue.src=p}else C(!1)}(ue.toString(),W):function aW(p,C){new Er;const ue=new AbortController,qe=setTimeout(()=>{ue.abort(),sl(0,0,!1,C)},1e4);fetch(p,{signal:ue.signal}).then(Je=>{clearTimeout(qe),sl(0,0,!!Je.ok,C)}).catch(()=>{clearTimeout(qe),sl(0,0,!1,C)})}(ue.toString(),W)}else hr(2);p.I=0,p.l&&p.l.pa(C),G2(p),O2(p)}function G2(p){if(p.I=0,p.ja=[],p.l){const C=Im(p.h);(0!=C.length||0!=p.i.length)&&(g(p.ja,C),g(p.ja,p.i),p.h.i.length=0,f(p.i),p.i.length=0),p.l.oa()}}function q2(p,C,W){var ue=W instanceof ua?Xi(W):new ua(W);if(""!=ue.g)C&&(ue.g=C+"."+ue.g),cu(ue,ue.u);else{var qe=a.location;ue=qe.protocol,C=C?C+"."+qe.hostname:qe.hostname,qe=+qe.port;const Je=new ua(null);ue&&Li(Je,ue),C&&(Je.g=C),qe&&cu(Je,qe),W&&(Je.h=W),ue=Je}return C=p.wa,(W=p.G)&&C&&hn(ue,W,C),hn(ue,"VER",p.ka),pf(p,ue),ue}function j2(p,C,W){if(C&&!p.L)throw Error("Can't create secondary domain capable XhrIo object.");return(C=new Gn(p.Aa&&!p.ma?new Sm({ab:W}):p.ma)).Fa(p.L),C}function $2(){}function Nm(){}function Ro(p,C){Rt.call(this),this.g=new L2(C),this.l=p,this.h=C&&C.messageUrlParams||null,p=C&&C.messageHeaders||null,C&&C.clientProtocolHeaderRequired&&(p?p["X-Client-Protocol"]="webchannel":p={"X-Client-Protocol":"webchannel"}),this.g.o=p,p=C&&C.initMessageHeaders||null,C&&C.messageContentType&&(p?p["X-WebChannel-Content-Type"]=C.messageContentType:p={"X-WebChannel-Content-Type":C.messageContentType}),C&&C.sa&&(p?p["X-WebChannel-Client-Profile"]=C.sa:p={"X-WebChannel-Client-Profile":C.sa}),this.g.U=p,(p=C&&C.Qb)&&!U(p)&&(this.g.u=p),this.A=C&&C.supportsCrossDomainXhr||!1,this.v=C&&C.sendRawJson||!1,(C=C&&C.httpSessionIdParam)&&!U(C)&&(this.g.G=C,null!==(p=this.h)&&C in p&&C in(p=this.h)&&delete p[C]),this.j=new jc(this)}function H2(p){rt.call(this),p.__headers__&&(this.headers=p.__headers__,this.statusCode=p.__status__,delete p.__headers__,delete p.__status__);var C=p.__sm__;if(C){e:{for(const W in C){p=W;break e}p=void 0}(this.i=p)&&(p=this.i,C=null!==C&&p in C?C[p]:void 0),this.data=C}else this.data=p}function W2(){nt.call(this),this.status=1}function jc(p){this.g=p}(r=Gn.prototype).Fa=function(p){this.H=p},r.ea=function(p,C,W,ue){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+p);C=C?C.toUpperCase():"GET",this.D=p,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():ti.g(),this.g.onreadystatechange=h(u(this.Ca,this));try{this.B=!0,this.g.open(C,String(p),!0),this.B=!1}catch(Je){return void P2(this,Je)}if(p=W||"",W=new Map(this.headers),ue)if(Object.getPrototypeOf(ue)===Object.prototype)for(var qe in ue)W.set(qe,ue[qe]);else{if("function"!=typeof ue.keys||"function"!=typeof ue.get)throw Error("Unknown input type for opt_headers: "+String(ue));for(const Je of ue.keys())W.set(Je,ue.get(Je))}ue=Array.from(W.keys()).find(Je=>"content-type"==Je.toLowerCase()),qe=a.FormData&&p instanceof a.FormData,!(Array.prototype.indexOf.call(uW,C,void 0)>=0)||ue||qe||W.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[Je,Vt]of W)this.g.setRequestHeader(Je,Vt);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(p),this.v=!1}catch(Je){P2(this,Je)}},r.abort=function(p){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=p||7,Gt(this,"complete"),Gt(this,"abort"),Rm(this))},r.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Rm(this,!0)),Gn.Z.N.call(this)},r.Ca=function(){this.u||(this.B||this.v||this.j?D2(this):this.Xa())},r.Xa=function(){D2(this)},r.isActive=function(){return!!this.g},r.ca=function(){try{return ll(this)>2?this.g.status:-1}catch{return-1}},r.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},r.La=function(p){if(this.g){var C=this.g.responseText;return p&&0==C.indexOf(p)&&(C=C.substring(p.length)),yr(C)}},r.ya=function(){return this.o},r.Ha=function(){return"string"==typeof this.l?this.l:String(this.l)},(r=L2.prototype).ka=8,r.I=1,r.connect=function(p,C,W,ue){hr(0),this.W=p,this.H=C||{},W&&void 0!==ue&&(this.H.OSID=W,this.H.OAID=ue),this.F=this.X,this.J=q2(this,null,this.W),km(this)},r.Ea=function(p){if(this.m)if(this.m=null,1==this.I){if(!p){this.V=Math.floor(1e5*Math.random()),p=this.V++;const qe=new _i(this,this.j,p);let Je=this.o;if(this.U&&(Je?(Je=De(Je),lt(Je,this.U)):Je=this.U),null!==this.u||this.R||(qe.J=Je,Je=null),this.S)e:{for(var C=0,W=0;W<this.i.length;W++){var ue=this.i[W];if(void 0===(ue="__data__"in ue.map&&"string"==typeof(ue=ue.map.__data__)?ue.length:void 0))break;if((C+=ue)>4096){C=W;break e}if(4096===C||W===this.i.length-1){C=W+1;break e}}C=1e3}else C=1e3;C=F2(this,qe,C),hn(W=Xi(this.J),"RID",p),hn(W,"CVER",22),this.G&&hn(W,"X-HTTP-Session-Id",this.G),pf(this,W),Je&&(this.R?C="headers="+bn(R2(Je))+"&"+C:this.u&&pI(W,this.u,Je)),Gc(this.h,qe),this.Ra&&hn(W,"TYPE","init"),this.S?(hn(W,"$req",C),hn(W,"SID","null"),qe.U=!0,wi(qe,W,null)):wi(qe,W,C),this.I=2}}else 3==this.I&&(p?M2(this,p):0==this.i.length||ol(this.h)||M2(this))},r.Da=function(){if(this.v=null,B2(this),this.aa&&!(this.P||null==this.g||this.T<=0)){var p=4*this.T;this.j.info("BP detection timer enabled: "+p),this.B=Yt(u(this.Wa,this),p)}},r.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,hr(10),Pm(this),B2(this))},r.Va=function(){null!=this.C&&(this.C=null,Pm(this),mI(this),hr(19))},r.bb=function(p){p?(this.j.info("Successfully pinged google.com"),hr(2)):(this.j.info("Failed to ping google.com"),hr(1))},r.isActive=function(){return!!this.l&&this.l.isActive(this)},(r=$2.prototype).ra=function(){},r.qa=function(){},r.pa=function(){},r.oa=function(){},r.isActive=function(){return!0},r.Ka=function(){},Nm.prototype.g=function(p,C){return new Ro(p,C)},d(Ro,Rt),Ro.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Ro.prototype.close=function(){gI(this.g)},Ro.prototype.o=function(p){var C=this.g;if("string"==typeof p){var W={};W.__data__=p,p=W}else this.v&&((W={}).__data__=Gr(p),p=W);C.i.push(new fI(C.Ya++,p)),3==C.I&&km(C)},Ro.prototype.N=function(){this.g.l=null,delete this.j,gI(this.g),delete this.g,Ro.Z.N.call(this)},d(H2,rt),d(W2,nt),d(jc,$2),jc.prototype.ra=function(){Gt(this.g,"a")},jc.prototype.qa=function(p){Gt(this.g,new H2(p))},jc.prototype.pa=function(p){Gt(this.g,new W2)},jc.prototype.oa=function(){Gt(this.g,"b")},Nm.prototype.createWebChannel=Nm.prototype.g,Ro.prototype.send=Ro.prototype.o,Ro.prototype.open=Ro.prototype.m,Ro.prototype.close=Ro.prototype.close,hs=Xn.createWebChannelTransport=function(){return new Nm},fl=Xn.getStatEventTarget=function(){return Et()},La=Xn.Event=it,ha=Xn.Stat={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Mn.NO_ERROR=0,Mn.TIMEOUT=8,Mn.HTTP_ERROR=6,Ln=Xn.ErrorCode=Mn,zn.COMPLETE="complete",hl=Xn.EventType=zn,le.EventType=$e,$e.OPEN="a",$e.CLOSE="b",$e.ERROR="c",$e.MESSAGE="d",Rt.prototype.listen=Rt.prototype.J,wo=Xn.WebChannel=le,Xn.FetchXmlHttpFactory=Sm,Gn.prototype.listenOnce=Gn.prototype.K,Gn.prototype.getLastError=Gn.prototype.Ha,Gn.prototype.getLastErrorCode=Gn.prototype.ya,Gn.prototype.getStatus=Gn.prototype.ca,Gn.prototype.getResponseJson=Gn.prototype.La,Gn.prototype.getResponseText=Gn.prototype.la,Gn.prototype.send=Gn.prototype.ea,Gn.prototype.setWithCredentials=Gn.prototype.Fa,da=Xn.XhrIo=Gn}).apply(typeof ds<"u"?ds:typeof self<"u"?self:typeof window<"u"?window:{});class Me{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Me.UNAUTHENTICATED=new Me(null),Me.GOOGLE_CREDENTIALS=new Me("google-credentials-uid"),Me.FIRST_PARTY=new Me("first-party-uid"),Me.MOCK_USER=new Me("mock-user");let jt="12.8.0";const Mr=new Nn.Vy("@firebase/firestore");function ht(r,...e){if(Mr.logLevel<=Nn.$b.DEBUG){const t=e.map(Kn);Mr.debug(`Firestore (${jt}): ${r}`,...t)}}function ir(r,...e){if(Mr.logLevel<=Nn.$b.ERROR){const t=e.map(Kn);Mr.error(`Firestore (${jt}): ${r}`,...t)}}function Zt(r,...e){if(Mr.logLevel<=Nn.$b.WARN){const t=e.map(Kn);Mr.warn(`Firestore (${jt}): ${r}`,...t)}}function Kn(r){if("string"==typeof r)return r;try{return JSON.stringify(r)}catch{return r}}function Ft(r,e,t){let n="Unexpected state";"string"==typeof e?n=e:t=e,pa(r,n,t)}function pa(r,e,t){let n=`FIRESTORE (${jt}) INTERNAL ASSERTION FAILED: ${e} (ID: ${r.toString(16)})`;if(void 0!==t)try{n+=" CONTEXT: "+JSON.stringify(t)}catch{n+=" CONTEXT: "+t}throw ir(n),new Error(n)}function kt(r,e,t,n){let i="Unexpected state";"string"==typeof t?i=t:n=t,r||pa(e,i,n)}const We={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class wt extends Kt.g{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class ke{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class Be{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Ze{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Me.UNAUTHENTICATED))}shutdown(){}}class ur{constructor(e){this.t=e,this.currentUser=Me.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){var n=this;kt(void 0===this.o,42304);let i=this.i;const o=u=>this.i!==i?(i=this.i,t(u)):Promise.resolve();let a=new ke;this.o=()=>{this.i++,this.currentUser=this.u(),a.resolve(),a=new ke,e.enqueueRetryable(()=>o(this.currentUser))};const s=()=>{const u=a;e.enqueueRetryable((0,_.A)(function*(){yield u.promise,yield o(n.currentUser)}))},l=u=>{ht("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=u,this.o&&(this.auth.addAuthTokenListener(this.o),s())};this.t.onInit(u=>l(u)),setTimeout(()=>{if(!this.auth){const u=this.t.getImmediate({optional:!0});u?l(u):(ht("FirebaseAuthCredentialsProvider","Auth not yet detected"),a.resolve(),a=new ke)}},0),s()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(n=>this.i!==e?(ht("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):n?(kt("string"==typeof n.accessToken,31837,{l:n}),new Be(n.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return kt(null===e||"string"==typeof e,2055,{h:e}),new Me(e)}}class Ir{constructor(e,t,n){this.P=e,this.T=t,this.I=n,this.type="FirstParty",this.user=Me.FIRST_PARTY,this.R=new Map}A(){return this.I?this.I():null}get headers(){this.R.set("X-Goog-AuthUser",this.P);const e=this.A();return e&&this.R.set("Authorization",e),this.T&&this.R.set("X-Goog-Iam-Authorization-Token",this.T),this.R}}class Or{constructor(e,t,n){this.P=e,this.T=t,this.I=n}getToken(){return Promise.resolve(new Ir(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(Me.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class qn{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Yr{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,(0,B.xZ)(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){kt(void 0===this.o,3512);const n=o=>{null!=o.error&&ht("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const a=o.token!==this.m;return this.m=o.token,ht("FirebaseAppCheckTokenProvider",`Received ${a?"new":"existing"} token.`),a?t(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>n(o))};const i=o=>{ht("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(o=>i(o)),setTimeout(()=>{if(!this.appCheck){const o=this.V.getImmediate({optional:!0});o?i(o):ht("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new qn(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(kt("string"==typeof t.token,44558,{tokenResult:t}),this.m=t.token,new qn(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function Ho(r){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(r);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(t);else for(let n=0;n<r;n++)t[n]=Math.floor(256*Math.random());return t}class fs{static newId(){const t=62*Math.floor(4.129032258064516);let n="";for(;n.length<20;){const i=Ho(40);for(let o=0;o<i.length;++o)n.length<20&&i[o]<t&&(n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(i[o]%62))}return n}}function fr(r,e){return r<e?-1:r>e?1:0}function gl(r){const e=r.charCodeAt(0);return e>=55296&&e<=57343}const Wc="__name__";class Do{constructor(e,t,n){void 0===t?t=0:t>e.length&&Ft(637,{offset:t,range:e.length}),void 0===n?n=e.length-t:n>e.length-t&&Ft(1746,{length:n,range:e.length-t}),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===Do.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof Do?e.forEach(n=>{t.push(n)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return this.construct(this.segments,this.offset+(e=void 0===e?1:e),this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let i=0;i<n;i++){const o=Do.compareSegments(e.get(i),t.get(i));if(0!==o)return o}return fr(e.length,t.length)}static compareSegments(e,t){const n=Do.isNumericId(e),i=Do.isNumericId(t);return n&&!i?-1:!n&&i?1:n&&i?Do.extractNumericId(e).compare(Do.extractNumericId(t)):function Hc(r,e){const t=Math.min(r.length,e.length);for(let n=0;n<t;n++){const i=r.charAt(n),o=e.charAt(n);if(i!==o)return gl(i)===gl(o)?fr(i,o):gl(i)?1:-1}return fr(r.length,e.length)}(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Po.fromString(e.substring(4,e.length-2))}}class xr extends Do{construct(e,t,n){return new xr(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new wt(We.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(i=>i.length>0))}return new xr(t)}static emptyPath(){return new xr([])}}const Fm=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class rn extends Do{construct(e,t,n){return new rn(e,t,n)}static isValidIdentifier(e){return Fm.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),rn.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===Wc}static keyField(){return new rn([Wc])}static fromServerFormat(e){const t=[];let n="",i=0;const o=()=>{if(0===n.length)throw new wt(We.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""};let a=!1;for(;i<e.length;){const s=e[i];if("\\"===s){if(i+1===e.length)throw new wt(We.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const l=e[i+1];if("\\"!==l&&"."!==l&&"`"!==l)throw new wt(We.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=l,i+=2}else"`"===s?(a=!a,i++):"."!==s||a?(n+=s,i++):(o(),i++)}if(o(),a)throw new wt(We.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new rn(t)}static emptyPath(){return new rn([])}}class Nt{constructor(e){this.path=e}static fromPath(e){return new Nt(xr.fromString(e))}static fromName(e){return new Nt(xr.fromString(e).popFirst(5))}static empty(){return new Nt(xr.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===xr.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return xr.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Nt(new xr(e.slice()))}}function Fn(r,e){const t={typeString:r};return e&&(t.value=e),t}function vl(r,e){if(!function vu(r){return"object"==typeof r&&null!==r&&(Object.getPrototypeOf(r)===Object.prototype||null===Object.getPrototypeOf(r))}(r))throw new wt(We.INVALID_ARGUMENT,"JSON must be an object");let t;for(const n in e)if(e[n]){const i=e[n].typeString,o="value"in e[n]?{value:e[n].value}:void 0;if(!(n in r)){t=`JSON missing required field: '${n}'`;break}const a=r[n];if(i&&typeof a!==i){t=`JSON field '${n}' must be a ${i}.`;break}if(void 0!==o&&a!==o.value){t=`Expected '${n}' field to equal '${o.value}'`;break}}if(t)throw new wt(We.INVALID_ARGUMENT,t);return!0}const _f=-62135596800;class Xr{static now(){return Xr.fromMillis(Date.now())}static fromDate(e){return Xr.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new Xr(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new wt(We.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new wt(We.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<_f)throw new wt(We.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new wt(We.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?fr(this.nanoseconds,e.nanoseconds):fr(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:Xr._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(vl(e,Xr._jsonSchema))return new Xr(e.seconds,e.nanoseconds)}valueOf(){return String(this.seconds-_f).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}Xr._jsonSchemaVersion="firestore/timestamp/1.0",Xr._jsonSchema={type:Fn("string",Xr._jsonSchemaVersion),seconds:Fn("number"),nanoseconds:Fn("number")};const Qc="mutationQueues",Xo="mutations",Tu="documentMutations",Jc="remoteDocumentGlobal",Iu="targets",xu="targetDocuments",bl="targetGlobal",Zc="collectionParents",Au="clientMetadata",Rf="bundles",Pf="namedQueries";class vn{constructor(e,t){this.comparator=e,this.root=t||xi.EMPTY}insert(e,t){return new vn(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,xi.BLACK,null,null))}remove(e){return new vn(this.comparator,this.root.remove(e,this.comparator).copy(null,null,xi.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const i=this.comparator(e,n.key);if(0===i)return t+n.left.size;i<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Df(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Df(this.root,e,this.comparator,!1)}getReverseIterator(){return new Df(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Df(this.root,e,this.comparator,!0)}}class Df{constructor(e,t,n,i){this.isReverse=i,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=t?n(e.key,t):1,t&&i&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(0===o){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class xi{constructor(e,t,n,i,o){this.key=e,this.value=t,this.color=n??xi.RED,this.left=i??xi.EMPTY,this.right=o??xi.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,i,o){return new xi(e??this.key,t??this.value,n??this.color,i??this.left,o??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let i=this;const o=n(e,i.key);return i=o<0?i.copy(null,null,null,i.left.insert(e,t,n),null):0===o?i.copy(null,t,null,null,null):i.copy(null,null,null,null,i.right.insert(e,t,n)),i.fixUp()}removeMin(){if(this.left.isEmpty())return xi.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,i=this;if(t(e,i.key)<0)i.left.isEmpty()||i.left.isRed()||i.left.left.isRed()||(i=i.moveRedLeft()),i=i.copy(null,null,null,i.left.remove(e,t),null);else{if(i.left.isRed()&&(i=i.rotateRight()),i.right.isEmpty()||i.right.isRed()||i.right.left.isRed()||(i=i.moveRedRight()),0===t(e,i.key)){if(i.right.isEmpty())return xi.EMPTY;n=i.right.min(),i=i.copy(n.key,n.value,null,null,i.right.removeMin())}i=i.copy(null,null,null,null,i.right.remove(e,t))}return i.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,xi.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,xi.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Ft(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Ft(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Ft(27949);return e+(this.isRed()?0:1)}}xi.EMPTY=null,xi.RED=!0,xi.BLACK=!1,xi.EMPTY=new class{constructor(){this.size=0}get key(){throw Ft(57766)}get value(){throw Ft(16141)}get color(){throw Ft(16727)}get left(){throw Ft(29726)}get right(){throw Ft(36894)}copy(e,t,n,i,o){return this}insert(e,t,n){return new xi(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class Zr{constructor(e){this.comparator=e,this.data=new vn(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const i=n.getNext();if(this.comparator(i.key,e[1])>=0)return;t(i.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new FI(this.data.getIterator())}getIteratorFrom(e){return new FI(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(n=>{t=t.add(n)}),t}isEqual(e){if(!(e instanceof Zr)||this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const i=t.getNext().key,o=n.getNext().key;if(0!==this.comparator(i,o))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new Zr(this.comparator);return t.data=e,t}}class FI{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class VI extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Vn{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(i){try{return atob(i)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new VI("Invalid base64 string: "+o):o}}(e);return new Vn(t)}static fromUint8Array(e){const t=function(i){let o="";for(let a=0;a<i.length;++a)o+=String.fromCharCode(i[a]);return o}(e);return new Vn(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return btoa(this.binaryString)}toUint8Array(){return function(t){const n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return fr(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Vn.EMPTY_BYTE_STRING=new Vn("");const bO=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Rn(r){return"number"==typeof r?r:"string"==typeof r?Number(r):0}const nd="(default)";class El{constructor(e,t){this.projectId=e,this.database=t||nd}static empty(){return new El("","")}get isDefaultDatabase(){return this.database===nd}isEqual(e){return e instanceof El&&e.projectId===this.projectId&&e.database===this.database}}class za{constructor(e,t=null,n=[],i=[],o=null,a="F",s=null,l=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=i,this.limit=o,this.limitType=a,this.startAt=s,this.endAt=l,this.Ie=null,this.Ee=null,this.Re=null}}var Qn,zr;new vn(Nt.comparator),new vn(Nt.comparator),new vn(Nt.comparator),new Zr(Nt.comparator),new Zr(fr),(zr=Qn||(Qn={}))[zr.OK=0]="OK",zr[zr.CANCELLED=1]="CANCELLED",zr[zr.UNKNOWN=2]="UNKNOWN",zr[zr.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",zr[zr.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",zr[zr.NOT_FOUND=5]="NOT_FOUND",zr[zr.ALREADY_EXISTS=6]="ALREADY_EXISTS",zr[zr.PERMISSION_DENIED=7]="PERMISSION_DENIED",zr[zr.UNAUTHENTICATED=16]="UNAUTHENTICATED",zr[zr.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",zr[zr.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",zr[zr.ABORTED=10]="ABORTED",zr[zr.OUT_OF_RANGE=11]="OUT_OF_RANGE",zr[zr.UNIMPLEMENTED=12]="UNIMPLEMENTED",zr[zr.INTERNAL=13]="INTERNAL",zr[zr.UNAVAILABLE=14]="UNAVAILABLE",zr[zr.DATA_LOSS=15]="DATA_LOSS",new Po([4294967295,4294967295],0),Error;class Pl{constructor(){}Dt(e,t){this.Ct(e,t),t.vt()}Ct(e,t){if("nullValue"in e)this.Ft(t,5);else if("booleanValue"in e)this.Ft(t,10),t.Mt(e.booleanValue?1:0);else if("integerValue"in e)this.Ft(t,15),t.Mt(Rn(e.integerValue));else if("doubleValue"in e){const n=Rn(e.doubleValue);isNaN(n)?this.Ft(t,13):(this.Ft(t,15),function Va(r){return 0===r&&1/r==-1/0}(n)?t.Mt(0):t.Mt(n))}else if("timestampValue"in e){let n=e.timestampValue;this.Ft(t,20),"string"==typeof n&&(n=function Ba(r){if(kt(!!r,39018),"string"==typeof r){let e=0;const t=bO.exec(r);if(kt(!!t,46558,{timestamp:r}),t[1]){let i=t[1];i=(i+"000000000").substr(0,9),e=Number(i)}const n=new Date(r);return{seconds:Math.floor(n.getTime()/1e3),nanos:e}}return{seconds:Rn(r.seconds),nanos:Rn(r.nanos)}}(n)),t.xt(`${n.seconds||""}`),t.Mt(n.nanos||0)}else if("stringValue"in e)this.Ot(e.stringValue,t),this.Nt(t);else if("bytesValue"in e)this.Ft(t,30),t.Bt(function Ua(r){return"string"==typeof r?Vn.fromBase64String(r):Vn.fromUint8Array(r)}(e.bytesValue)),this.Nt(t);else if("referenceValue"in e)this.Lt(e.referenceValue,t);else if("geoPointValue"in e){const n=e.geoPointValue;this.Ft(t,45),t.Mt(n.latitude||0),t.Mt(n.longitude||0)}else"mapValue"in e?function XI(r){return"__max__"===(((r.mapValue||{}).fields||{}).__type__||{}).stringValue}(e)?this.Ft(t,Number.MAX_SAFE_INTEGER):function Vf(r){return"__vector__"===(r?.mapValue?.fields||{}).__type__?.stringValue}(e)?this.kt(e.mapValue,t):(this.Kt(e.mapValue,t),this.Nt(t)):"arrayValue"in e?(this.qt(e.arrayValue,t),this.Nt(t)):Ft(19022,{Ut:e})}Ot(e,t){this.Ft(t,25),this.$t(e,t)}$t(e,t){t.xt(e)}Kt(e,t){const n=e.fields||{};this.Ft(t,55);for(const i of Object.keys(n))this.Ot(i,t),this.Ct(n[i],t)}kt(e,t){const n=e.fields||{};this.Ft(t,53);const i="value",o=n[i].arrayValue?.values?.length||0;this.Ft(t,15),t.Mt(Rn(o)),this.Ot(i,t),this.Ct(n[i],t)}qt(e,t){const n=e.values||[];this.Ft(t,50);for(const i of n)this.Ct(i,t)}Lt(e,t){this.Ft(t,37),Nt.fromName(e).path.forEach(n=>{this.Ft(t,60),this.$t(n,t)})}Ft(e,t){e.Mt(t)}Nt(e){e.Mt(2)}}Pl.Wt=new Pl,new Uint8Array(0);class Bi{static withCacheSize(e){return new Bi(e,Bi.DEFAULT_COLLECTION_PERCENTILE,Bi.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}}Bi.DEFAULT_COLLECTION_PERCENTILE=10,Bi.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Bi.DEFAULT=new Bi(41943040,Bi.DEFAULT_COLLECTION_PERCENTILE,Bi.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Bi.DISABLED=new Bi(-1,0,0);let up=null;function Bv(){return null===up?up=268435456+Math.round(2147483648*Math.random()):up++,"0x"+up.toString(16)}const Uv="RestConnection",HM={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class WM{get Ko(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.qo=t+"://"+e.host,this.Uo=`projects/${n}/databases/${i}`,this.$o=this.databaseId.database===nd?`project_id=${n}`:`project_id=${n}&database_id=${i}`}Wo(e,t,n,i,o){const a=Bv(),s=this.Qo(e,t.toUriEncodedString());ht(Uv,`Sending RPC '${e}' ${a}:`,s,n);const l={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.$o};this.Go(l,i,o);const{host:u}=new URL(s),c=(0,Kt.zJ)(u);return this.zo(e,s,l,n,c).then(d=>(ht(Uv,`Received RPC '${e}' ${a}: `,d),d),d=>{throw Zt(Uv,`RPC '${e}' ${a} failed with error: `,d,"url: ",s,"request:",n),d})}jo(e,t,n,i,o,a){return this.Wo(e,t,n,i,o)}Go(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+jt,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((i,o)=>e[o]=i),n&&n.headers.forEach((i,o)=>e[o]=i)}Qo(e,t){let i=`${this.qo}/v1/${t}:${HM[e]}`;return this.databaseInfo.apiKey&&(i=`${i}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),i}terminate(){}}class XM{constructor(e){this.Ho=e.Ho,this.Jo=e.Jo}Zo(e){this.Xo=e}Yo(e){this.e_=e}t_(e){this.n_=e}onMessage(e){this.r_=e}close(){this.Jo()}send(e){this.Ho(e)}i_(){this.Xo()}s_(){this.e_()}o_(e){this.n_(e)}__(e){this.r_(e)}}const Ui="WebChannelConnection",Rd=(r,e,t)=>{r.listen(e,n=>{try{t(n)}catch(i){setTimeout(()=>{throw i},0)}})};class $u extends WM{constructor(e){super(e),this.a_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static u_(){if(!$u.c_){const e=fl();Rd(e,La.STAT_EVENT,t=>{t.stat===ha.PROXY?ht(Ui,"STAT_EVENT: detected buffering proxy"):t.stat===ha.NOPROXY&&ht(Ui,"STAT_EVENT: detected no buffering proxy")}),$u.c_=!0}}zo(e,t,n,i,o){const a=Bv();return new Promise((s,l)=>{const u=new da;u.setWithCredentials(!0),u.listenOnce(hl.COMPLETE,()=>{try{switch(u.getLastErrorCode()){case Ln.NO_ERROR:const d=u.getResponseJson();ht(Ui,`XHR for RPC '${e}' ${a} received:`,JSON.stringify(d)),s(d);break;case Ln.TIMEOUT:ht(Ui,`RPC '${e}' ${a} timed out`),l(new wt(We.DEADLINE_EXCEEDED,"Request time out"));break;case Ln.HTTP_ERROR:const h=u.getStatus();if(ht(Ui,`RPC '${e}' ${a} failed with status:`,h,"response text:",u.getResponseText()),h>0){let f=u.getResponseJson();Array.isArray(f)&&(f=f[0]);const g=f?.error;if(g&&g.status&&g.message){const y=function(m){const b=m.toLowerCase().replace(/_/g,"-");return Object.values(We).indexOf(b)>=0?b:We.UNKNOWN}(g.status);l(new wt(y,g.message))}else l(new wt(We.UNKNOWN,"Server responded with status "+u.getStatus()))}else l(new wt(We.UNAVAILABLE,"Connection failed."));break;default:Ft(9055,{l_:e,streamId:a,h_:u.getLastErrorCode(),P_:u.getLastError()})}}finally{ht(Ui,`RPC '${e}' ${a} completed.`)}});const c=JSON.stringify(i);ht(Ui,`RPC '${e}' ${a} sending request:`,i),u.send(t,"POST",c,n,15)})}T_(e,t,n){const i=Bv(),o=[this.qo,"/","google.firestore.v1.Firestore","/",e,"/channel"],a=this.createWebChannelTransport(),s={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;void 0!==l&&(s.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(s.useFetchStreams=!0),this.Go(s.initMessageHeaders,t,n),s.encodeInitMessageHeaders=!0;const u=o.join("");ht(Ui,`Creating RPC '${e}' stream ${i}: ${u}`,s);const c=a.createWebChannel(u,s);this.I_(c);let d=!1,h=!1;const f=new XM({Ho:g=>{h?ht(Ui,`Not sending because RPC '${e}' stream ${i} is closed:`,g):(d||(ht(Ui,`Opening RPC '${e}' stream ${i} transport.`),c.open(),d=!0),ht(Ui,`RPC '${e}' stream ${i} sending:`,g),c.send(g))},Jo:()=>c.close()});return Rd(c,wo.EventType.OPEN,()=>{h||(ht(Ui,`RPC '${e}' stream ${i} transport opened.`),f.i_())}),Rd(c,wo.EventType.CLOSE,()=>{h||(h=!0,ht(Ui,`RPC '${e}' stream ${i} transport closed`),f.o_(),this.E_(c))}),Rd(c,wo.EventType.ERROR,g=>{h||(h=!0,Zt(Ui,`RPC '${e}' stream ${i} transport errored. Name:`,g.name,"Message:",g.message),f.o_(new wt(We.UNAVAILABLE,"The operation could not be completed")))}),Rd(c,wo.EventType.MESSAGE,g=>{if(!h){const y=g.data[0];kt(!!y,16349);const v=y,m=v?.error||v[0]?.error;if(m){ht(Ui,`RPC '${e}' stream ${i} received error:`,m);const b=m.status;let T=function(Z){const S=Qn[Z];if(void 0!==S)return function N1(r){if(void 0===r)return ir("GRPC error has no .code"),We.UNKNOWN;switch(r){case Qn.OK:return We.OK;case Qn.CANCELLED:return We.CANCELLED;case Qn.UNKNOWN:return We.UNKNOWN;case Qn.DEADLINE_EXCEEDED:return We.DEADLINE_EXCEEDED;case Qn.RESOURCE_EXHAUSTED:return We.RESOURCE_EXHAUSTED;case Qn.INTERNAL:return We.INTERNAL;case Qn.UNAVAILABLE:return We.UNAVAILABLE;case Qn.UNAUTHENTICATED:return We.UNAUTHENTICATED;case Qn.INVALID_ARGUMENT:return We.INVALID_ARGUMENT;case Qn.NOT_FOUND:return We.NOT_FOUND;case Qn.ALREADY_EXISTS:return We.ALREADY_EXISTS;case Qn.PERMISSION_DENIED:return We.PERMISSION_DENIED;case Qn.FAILED_PRECONDITION:return We.FAILED_PRECONDITION;case Qn.ABORTED:return We.ABORTED;case Qn.OUT_OF_RANGE:return We.OUT_OF_RANGE;case Qn.UNIMPLEMENTED:return We.UNIMPLEMENTED;case Qn.DATA_LOSS:return We.DATA_LOSS;default:return Ft(39323,{code:r})}}(S)}(b),O=m.message;void 0===T&&(T=We.INTERNAL,O="Unknown error status: "+b+" with message "+m.message),h=!0,f.o_(new wt(T,O)),c.close()}else ht(Ui,`RPC '${e}' stream ${i} received:`,y),f.__(y)}}),$u.u_(),setTimeout(()=>{f.s_()},0),f}terminate(){this.a_.forEach(e=>e.close()),this.a_=[]}I_(e){this.a_.push(e)}E_(e){this.a_=this.a_.filter(t=>t===e)}Go(e,t,n){super.Go(e,t,n),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return hs()}}function cp(){return typeof document<"u"?document:null}$u.c_=!1;class zv{constructor(e,t,n=1e3,i=1.5,o=6e4){this.Ci=e,this.timerId=t,this.R_=n,this.A_=i,this.V_=o,this.d_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.d_=0}g_(){this.d_=this.V_}p_(e){this.cancel();const t=Math.floor(this.d_+this.y_()),n=Math.max(0,Date.now()-this.f_),i=Math.max(0,t-n);i>0&&ht("ExponentialBackoff",`Backing off for ${i} ms (base delay: ${this.d_} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.m_=this.Ci.enqueueAfterDelay(this.timerId,i,()=>(this.f_=Date.now(),e())),this.d_*=this.A_,this.d_<this.R_&&(this.d_=this.R_),this.d_>this.V_&&(this.d_=this.V_)}w_(){null!==this.m_&&(this.m_.skipDelay(),this.m_=null)}cancel(){null!==this.m_&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.d_}}class oy{constructor(e,t,n,i,o){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=i,this.removalCallback=o,this.deferred=new ke,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(a=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,i,o){const a=Date.now()+n,s=new oy(e,t,a,i,o);return s.start(n),s}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new wt(We.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}var dy,dA;(dA=dy||(dy={})).Ma="default",dA.Cache="cache";const Nd=new Map;class NA{constructor(e){if(void 0===e.host){if(void 0!==e.ssl)throw new wt(We.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=e.ssl??!0;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new wt(We.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function vf(r,e,t,n){if(!0===e&&!0===n)throw new wt(We.INVALID_ARGUMENT,`${r} and ${t} cannot be used together.`)})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!(this.experimentalForceLongPolling||void 0!==e.experimentalAutoDetectLongPolling&&!e.experimentalAutoDetectLongPolling),this.experimentalLongPollingOptions=function CA(r){const e={};return void 0!==r.timeoutSeconds&&(e.timeoutSeconds=r.timeoutSeconds),e}(e.experimentalLongPollingOptions??{}),function(n){if(void 0!==n.timeoutSeconds){if(isNaN(n.timeoutSeconds))throw new wt(We.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (must not be NaN)`);if(n.timeoutSeconds<5)throw new wt(We.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (minimum allowed value is 5)`);if(n.timeoutSeconds>30)throw new wt(We.INVALID_ARGUMENT,`invalid long polling timeout: ${n.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&this.experimentalLongPollingOptions.timeoutSeconds===e.experimentalLongPollingOptions.timeoutSeconds&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Ld{constructor(e,t,n,i){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=i,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new NA({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new wt(We.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new wt(We.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new NA(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(n){if(!n)return new Ze;switch(n.type){case"firstParty":return new Or(n.sessionIndex||"0",n.iamToken||null,n.authTokenFactory||null);case"provider":return n.client;default:throw new wt(We.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}_restart(){var e=this;return(0,_.A)(function*(){"notTerminated"===e._terminateTask?yield e._terminate():e._terminateTask="notTerminated"})()}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const n=Nd.get(t);n&&(ht("ComponentProvider","Removing Datastore"),Nd.delete(t),n.terminate())}(this),Promise.resolve()}}class bo{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new bo(this.firestore,e,this._query)}}class jn{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Yo(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new jn(this.firestore,e,this._key)}toJSON(){return{type:jn._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,n){if(vl(t,jn._jsonSchema))return new jn(e,n||null,new Nt(xr.fromString(t.referencePath)))}}jn._jsonSchemaVersion="firestore/documentReference/1.0",jn._jsonSchema={type:Fn("string",jn._jsonSchemaVersion),referencePath:Fn("string")};class Yo extends bo{constructor(e,t,n){super(e,t,function ud(r){return new za(r)}(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new jn(this.firestore,null,new Nt(e))}withConverter(e){return new Yo(this.firestore,e,this._path)}}const LA="AsyncQueue";class OA{constructor(e=Promise.resolve()){this.Yu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new zv(this,"async_queue_retry"),this._c=()=>{const n=cp();n&&ht(LA,"Visibility state changed to "+n.visibilityState),this.M_.w_()},this.ac=e;const t=cp();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const t=cp();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise(()=>{});const t=new ke;return this.cc(()=>this.ec&&this.sc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Yu.push(e),this.lc()))}lc(){var e=this;return(0,_.A)(function*(){if(0!==e.Yu.length){try{yield e.Yu[0](),e.Yu.shift(),e.M_.reset()}catch(t){if(!function nn(r){return"IndexedDbTransactionError"===r.name}(t))throw t;ht(LA,"Operation failed with retryable error: "+t)}e.Yu.length>0&&e.M_.p_(()=>e.lc())}})()}cc(e){const t=this.ac.then(()=>(this.rc=!0,e().catch(n=>{throw this.nc=n,this.rc=!1,ir("INTERNAL UNHANDLED ERROR: ",MA(n)),n}).then(n=>(this.rc=!1,n))));return this.ac=t,t}enqueueAfterDelay(e,t,n){this.uc(),this.oc.indexOf(e)>-1&&(t=0);const i=oy.createAndSchedule(this,e,t,n,o=>this.hc(o));return this.tc.push(i),i}uc(){this.nc&&Ft(47125,{Pc:MA(this.nc)})}verifyOperationInProgress(){}Tc(){var e=this;return(0,_.A)(function*(){let t;do{t=e.ac,yield t}while(t!==e.ac)})()}Ic(e){for(const t of this.tc)if(t.timerId===e)return!0;return!1}Ec(e){return this.Tc().then(()=>{this.tc.sort((t,n)=>t.targetTimeMs-n.targetTimeMs);for(const t of this.tc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Tc()})}Rc(e){this.oc.push(e)}hc(e){const t=this.tc.indexOf(e);this.tc.splice(t,1)}}function MA(r){let e=r.message||"";return r.stack&&(e=r.stack.includes(r.message)?r.stack:r.message+"\n"+r.stack),e}class _a extends Ld{constructor(e,t,n,i){super(e,t,n,i),this.type="firestore",this._queue=new OA,this._persistenceKey=i?.name||"[DEFAULT]"}_terminate(){var e=this;return(0,_.A)(function*(){if(e._firestoreClient){const t=e._firestoreClient.terminate();e._queue=new OA(t),e._firestoreClient=void 0,yield t}})()}}class Eo{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Eo(Vn.fromBase64String(e))}catch(t){throw new wt(We.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new Eo(Vn.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Eo._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(vl(e,Eo._jsonSchema))return Eo.fromBase64String(e.bytes)}}Eo._jsonSchemaVersion="firestore/bytes/1.0",Eo._jsonSchema={type:Fn("string",Eo._jsonSchemaVersion),bytes:Fn("string")};class mp{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new wt(We.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new rn(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class wa{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new wt(We.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new wt(We.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return fr(this._lat,e._lat)||fr(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:wa._jsonSchemaVersion}}static fromJSON(e){if(vl(e,wa._jsonSchema))return new wa(e.latitude,e.longitude)}}wa._jsonSchemaVersion="firestore/geoPoint/1.0",wa._jsonSchema={type:Fn("string",wa._jsonSchemaVersion),latitude:Fn("number"),longitude:Fn("number")};class Lo{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(n,i){if(n.length!==i.length)return!1;for(let o=0;o<n.length;++o)if(n[o]!==i[o])return!1;return!0}(this._values,e._values)}toJSON(){return{type:Lo._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(vl(e,Lo._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(t=>"number"==typeof t))return new Lo(e.vectorValues);throw new wt(We.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}function Md(r,e,t){if((e=(0,Kt.Ku)(e))instanceof mp)return e._internalPath;if("string"==typeof e)return function $A(r,e,t){if(e.search(rV)>=0)throw yp(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,r,!1,void 0,t);try{return new mp(...e.split("."))._internalPath}catch{throw yp(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,r,!1,void 0,t)}}(r,e);throw yp("Field path arguments must be of type string or ",r,!1,void 0,t)}Lo._jsonSchemaVersion="firestore/vectorValue/1.0",Lo._jsonSchema={type:Fn("string",Lo._jsonSchemaVersion),vectorValues:Fn("object")};const rV=new RegExp("[~\\*/\\[\\]]");function yp(r,e,t,n,i){const o=n&&!n.isEmpty(),a=void 0!==i;let s=`Function ${e}() called with invalid data`;t&&(s+=" (via `toFirestore()`)"),s+=". ";let l="";return(o||a)&&(l+=" (found",o&&(l+=` in field ${n}`),a&&(l+=` in document ${i}`),l+=")"),new wt(We.INVALID_ARGUMENT,s+r+l)}const hS="@firebase/firestore";class Bd{constructor(e,t,n,i,o){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=i,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new jn(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new OV(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){return this._document?.data.clone().value.mapValue.fields??void 0}get(e){if(this._document){const t=this._document.data.field(Md("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class OV extends Bd{data(){return super.data()}}class Rs{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class xo extends Bd{constructor(e,t,n,i,o,a){super(e,t,n,i,a),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new Ap(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(Md("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new wt(We.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=xo._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()?(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle="NOT SUPPORTED",t):t}}xo._jsonSchemaVersion="firestore/documentSnapshot/1.0",xo._jsonSchema={type:Fn("string",xo._jsonSchemaVersion),bundleSource:Fn("string","DocumentSnapshot"),bundleName:Fn("string"),bundle:Fn("string")};class Ap extends xo{data(e={}){return super.data(e)}}class Ao{constructor(e,t,n,i){this._firestore=e,this._userDataWriter=t,this._snapshot=i,this.metadata=new Rs(i.hasPendingWrites,i.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new Ap(this._firestore,this._userDataWriter,n.key,n,new Rs(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new wt(We.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(i,o){if(i._snapshot.oldDocs.isEmpty()){let a=0;return i._snapshot.docChanges.map(s=>({type:"added",doc:new Ap(i._firestore,i._userDataWriter,s.doc.key,s.doc,new Rs(i._snapshot.mutatedKeys.has(s.doc.key),i._snapshot.fromCache),i.query.converter),oldIndex:-1,newIndex:a++}))}{let a=i._snapshot.oldDocs;return i._snapshot.docChanges.filter(s=>o||3!==s.type).map(s=>{const l=new Ap(i._firestore,i._userDataWriter,s.doc.key,s.doc,new Rs(i._snapshot.mutatedKeys.has(s.doc.key),i._snapshot.fromCache),i.query.converter);let u=-1,c=-1;return 0!==s.type&&(u=a.indexOf(s.doc.key),a=a.delete(s.doc.key)),1!==s.type&&(a=a.add(s.doc),c=a.indexOf(s.doc.key)),{type:$V(s.type),doc:l,oldIndex:u,newIndex:c}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new wt(We.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=Ao._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=fs.newId();const t=[],n=[],i=[];return this.docs.forEach(o=>{null!==o._document&&(t.push(o._document),n.push(this._userDataWriter.convertObjectMap(o._document.data.value.mapValue.fields,"previous")),i.push(o.ref.path))}),e.bundle="NOT SUPPORTED",e}}function $V(r){switch(r){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Ft(61501,{type:r})}}Ao._jsonSchemaVersion="firestore/querySnapshot/1.0",Ao._jsonSchema={type:Fn("string",Ao._jsonSchemaVersion),bundleSource:Fn("string","QuerySnapshot"),bundleName:Fn("string"),bundle:Fn("string")},function(e,t=!0){(function wr(r){jt=r})(B.MF),(0,B.om)(new Ti.uA("firestore",(n,{instanceIdentifier:i,options:o})=>{const a=n.getProvider("app").getImmediate(),s=new _a(new ur(n.getProvider("auth-internal")),new Yr(a,n.getProvider("app-check-internal")),function TO(r,e){if(!Object.prototype.hasOwnProperty.apply(r.options,["projectId"]))throw new wt(We.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new El(r.options.projectId,e)}(a,i),a);return o={useFetchStreams:t,...o},s._setSettings(o),s},"PUBLIC").setMultipleInstances(!0)),(0,B.KO)(hS,"4.10.0",e),(0,B.KO)(hS,"4.10.0","esm2020")}();const oB=function SS(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}},CS=new Kt.FA("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),Cp=new Nn.Vy("@firebase/auth");function Rp(r,...e){Cp.logLevel<=Nn.$b.ERROR&&Cp.error(`Auth (${B.MF}): ${r}`,...e)}function lo(r,...e){throw v_(r,...e)}function Oo(r,...e){return v_(r,...e)}function m_(r,e,t){const n={...oB(),[e]:t};return new Kt.FA("auth","Firebase",n).create(e,{appName:r.name})}function pi(r){return m_(r,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function v_(r,...e){if("string"!=typeof r){const t=e[0],n=[...e.slice(1)];return n[0]&&(n[0].appName=r.name),r._errorFactory.create(t,...n)}return CS.create(r,...e)}function Pt(r,e,...t){if(!r)throw v_(e,...t)}function ba(r){const e="INTERNAL ASSERTION FAILED: "+r;throw Rp(e),new Error(e)}function ks(r,e){r||ba(e)}function RS(){return typeof self<"u"&&self.location?.protocol||null}class Wd{constructor(e,t){this.shortDelay=e,this.longDelay=t,ks(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,Kt.jZ)()||(0,Kt.lV)()}get(){return function sB(){return!(typeof navigator<"u"&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(function y_(){return"http:"===RS()||"https:"===RS()}()||(0,Kt.sr)()||"connection"in navigator))||navigator.onLine}()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}class PS{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:typeof self<"u"&&"fetch"in self?self.fetch:typeof globalThis<"u"&&globalThis.fetch?globalThis.fetch:typeof fetch<"u"?fetch:void ba("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:typeof self<"u"&&"Headers"in self?self.Headers:typeof globalThis<"u"&&globalThis.Headers?globalThis.Headers:typeof Headers<"u"?Headers:void ba("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:typeof self<"u"&&"Response"in self?self.Response:typeof globalThis<"u"&&globalThis.Response?globalThis.Response:typeof Response<"u"?Response:void ba("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const uB={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},cB=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],dB=new Wd(3e4,6e4);function In(r,e){return r.tenantId&&!e.tenantId?{...e,tenantId:r.tenantId}:e}function xn(r,e,t,n){return w_.apply(this,arguments)}function w_(){return(w_=(0,_.A)(function*(r,e,t,n,i={}){return kS(r,i,(0,_.A)(function*(){let o={},a={};n&&("GET"===e?a=n:o={body:JSON.stringify(n)});const s=(0,Kt.Am)({key:r.config.apiKey,...a}).slice(1),l=yield r._getAdditionalHeaders();l["Content-Type"]="application/json",r.languageCode&&(l["X-Firebase-Locale"]=r.languageCode);const u={method:e,headers:l,...o};return(0,Kt.c1)()||(u.referrerPolicy="no-referrer"),r.emulatorConfig&&(0,Kt.zJ)(r.emulatorConfig.host)&&(u.credentials="include"),PS.fetch()(yield DS(r,r.config.apiHost,t,s),u)}))})).apply(this,arguments)}function kS(r,e,t){return b_.apply(this,arguments)}function b_(){return(b_=(0,_.A)(function*(r,e,t){r._canInitEmulator=!1;const n={...uB,...e};try{const i=new fB(r),o=yield Promise.race([t(),i.promise]);i.clearNetworkTimeout();const a=yield o.json();if("needConfirmation"in a)throw Xd(r,"account-exists-with-different-credential",a);if(o.ok&&!("errorMessage"in a))return a;{const s=o.ok?a.errorMessage:a.error.message,[l,u]=s.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===l)throw Xd(r,"credential-already-in-use",a);if("EMAIL_EXISTS"===l)throw Xd(r,"email-already-in-use",a);if("USER_DISABLED"===l)throw Xd(r,"user-disabled",a);const c=n[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw m_(r,c,u);lo(r,c)}}catch(i){if(i instanceof Kt.g)throw i;lo(r,"network-request-failed",{message:String(i)})}})).apply(this,arguments)}function DS(r,e,t,n){return T_.apply(this,arguments)}function T_(){return(T_=(0,_.A)(function*(r,e,t,n){const i=`${e}${t}?${n}`,o=r,a=o.config.emulator?function __(r,e){ks(r.emulator,"Emulator should always be set here");const{url:t}=r.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}(r.config,i):`${r.config.apiScheme}://${i}`;return cB.includes(t)&&(yield o._persistenceManagerAvailable,"COOKIE"===o._getPersistenceType())?o._getPersistence()._getFinalTarget(a).toString():a})).apply(this,arguments)}class fB{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,n)=>{this.timer=setTimeout(()=>n(Oo(this.auth,"network-request-failed")),dB.get())})}}function Xd(r,e,t){const n={appName:r.name};t.email&&(n.email=t.email),t.phoneNumber&&(n.phoneNumber=t.phoneNumber);const i=Oo(r,e,n);return i.customData._tokenResponse=t,i}function A_(){return(A_=(0,_.A)(function*(r,e){return xn(r,"POST","/v1/accounts:delete",e)})).apply(this,arguments)}function Pp(r,e){return C_.apply(this,arguments)}function C_(){return(C_=(0,_.A)(function*(r,e){return xn(r,"POST","/v1/accounts:lookup",e)})).apply(this,arguments)}function Kd(r){if(r)try{const e=new Date(Number(r));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}function R_(){return(R_=(0,_.A)(function*(r,e=!1){const t=(0,Kt.Ku)(r),n=yield t.getIdToken(e),i=kp(n);Pt(i&&i.exp&&i.auth_time&&i.iat,t.auth,"internal-error");const o="object"==typeof i.firebase?i.firebase:void 0,a=o?.sign_in_provider;return{claims:i,token:n,authTime:Kd(P_(i.auth_time)),issuedAtTime:Kd(P_(i.iat)),expirationTime:Kd(P_(i.exp)),signInProvider:a||null,signInSecondFactor:o?.sign_in_second_factor||null}})).apply(this,arguments)}function P_(r){return 1e3*Number(r)}function kp(r){const[e,t,n]=r.split(".");if(void 0===e||void 0===t||void 0===n)return Rp("JWT malformed, contained fewer than 3 sections"),null;try{const i=(0,Kt.u)(t);return i?JSON.parse(i):(Rp("Failed to decode base64 JWT payload"),null)}catch(i){return Rp("Caught error parsing JWT payload as JSON",i?.toString()),null}}function FS(r){const e=kp(r);return Pt(e,"internal-error"),Pt(typeof e.exp<"u","internal-error"),Pt(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}function Xa(r,e){return k_.apply(this,arguments)}function k_(){return(k_=(0,_.A)(function*(r,e,t=!1){if(t)return e;try{return yield e}catch(n){throw n instanceof Kt.g&&function yB({code:r}){return"auth/user-disabled"===r||"auth/user-token-expired"===r}(n)&&r.auth.currentUser===r&&(yield r.auth.signOut()),n}})).apply(this,arguments)}class _B{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(e){const t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}{this.errorBackoff=3e4;const n=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,n)}}schedule(e=!1){var t=this;if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout((0,_.A)(function*(){yield t.iteration()}),n)}iteration(){var e=this;return(0,_.A)(function*(){try{yield e.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===t?.code&&e.schedule(!0))}e.schedule()})()}}class D_{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Kd(this.lastLoginAt),this.creationTime=Kd(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}function Yd(r){return N_.apply(this,arguments)}function N_(){return(N_=(0,_.A)(function*(r){const e=r.auth,t=yield r.getIdToken(),n=yield Xa(r,Pp(e,{idToken:t}));Pt(n?.users.length,e,"internal-error");const i=n.users[0];r._notifyReloadListener(i);const o=i.providerUserInfo?.length?VS(i.providerUserInfo):[],a=function bB(r,e){return[...r.filter(n=>!e.some(i=>i.providerId===n.providerId)),...e]}(r.providerData,o),u=!!r.isAnonymous&&!(r.email&&i.passwordHash||a?.length),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:a,metadata:new D_(i.createdAt,i.lastLoginAt),isAnonymous:u};Object.assign(r,c)})).apply(this,arguments)}function L_(){return(L_=(0,_.A)(function*(r){const e=(0,Kt.Ku)(r);yield Yd(e),yield e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)})).apply(this,arguments)}function VS(r){return r.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}function O_(){return(O_=(0,_.A)(function*(r,e){const t=yield kS(r,{},(0,_.A)(function*(){const n=(0,Kt.Am)({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:i,apiKey:o}=r.config,a=yield DS(r,i,"/v1/token",`key=${o}`),s=yield r._getAdditionalHeaders();s["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:s,body:n};return r.emulatorConfig&&(0,Kt.zJ)(r.emulatorConfig.host)&&(l.credentials="include"),PS.fetch()(a,l)}));return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}})).apply(this,arguments)}function M_(){return(M_=(0,_.A)(function*(r,e){return xn(r,"POST","/v2/accounts:revokeToken",In(r,e))})).apply(this,arguments)}class ac{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Pt(e.idToken,"internal-error"),Pt(typeof e.idToken<"u","internal-error"),Pt(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):FS(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Pt(0!==e.length,"internal-error");const t=FS(e);this.updateTokensAndExpiration(e,null,t)}getToken(e){var t=this;return(0,_.A)(function*(n,i=!1){return i||!t.accessToken||t.isExpired?(Pt(t.refreshToken,n,"user-token-expired"),t.refreshToken?(yield t.refresh(n,t.refreshToken),t.accessToken):null):t.accessToken}).apply(this,arguments)}clearRefreshToken(){this.refreshToken=null}refresh(e,t){var n=this;return(0,_.A)(function*(){const{accessToken:i,refreshToken:o,expiresIn:a}=yield function EB(r,e){return O_.apply(this,arguments)}(e,t);n.updateTokensAndExpiration(i,o,Number(a))})()}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:i,expirationTime:o}=t,a=new ac;return n&&(Pt("string"==typeof n,"internal-error",{appName:e}),a.refreshToken=n),i&&(Pt("string"==typeof i,"internal-error",{appName:e}),a.accessToken=i),o&&(Pt("number"==typeof o,"internal-error",{appName:e}),a.expirationTime=o),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new ac,this.toJSON())}_performRefresh(){return ba("not implemented")}}function Ds(r,e){Pt("string"==typeof r||typeof r>"u","internal-error",{appName:e})}class Qo{constructor({uid:e,auth:t,stsTokenManager:n,...i}){this.providerId="firebase",this.proactiveRefresh=new _B(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=n,this.accessToken=n.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new D_(i.createdAt||void 0,i.lastLoginAt||void 0)}getIdToken(e){var t=this;return(0,_.A)(function*(){const n=yield Xa(t,t.stsTokenManager.getToken(t.auth,e));return Pt(n,t.auth,"internal-error"),t.accessToken!==n&&(t.accessToken=n,yield t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)),n})()}getIdTokenResult(e){return function vB(r){return R_.apply(this,arguments)}(this,e)}reload(){return function wB(r){return L_.apply(this,arguments)}(this)}_assign(e){this!==e&&(Pt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Qo({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){Pt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(e){var t=this;return(0,_.A)(function*(n,i=!1){let o=!1;n.idToken&&n.idToken!==t.stsTokenManager.accessToken&&(t.stsTokenManager.updateFromServerResponse(n),o=!0),i&&(yield Yd(t)),yield t.auth._persistUserIfCurrent(t),o&&t.auth._notifyListenersIfCurrent(t)}).apply(this,arguments)}delete(){var e=this;return(0,_.A)(function*(){if((0,B.xZ)(e.auth.app))return Promise.reject(pi(e.auth));const t=yield e.getIdToken();return yield Xa(e,function gB(r,e){return A_.apply(this,arguments)}(e.auth,{idToken:t})),e.stsTokenManager.clearRefreshToken(),e.auth.signOut()})()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const n=t.displayName??void 0,i=t.email??void 0,o=t.phoneNumber??void 0,a=t.photoURL??void 0,s=t.tenantId??void 0,l=t._redirectEventId??void 0,u=t.createdAt??void 0,c=t.lastLoginAt??void 0,{uid:d,emailVerified:h,isAnonymous:f,providerData:g,stsTokenManager:y}=t;Pt(d&&y,e,"internal-error");const v=ac.fromJSON(this.name,y);Pt("string"==typeof d,e,"internal-error"),Ds(n,e.name),Ds(i,e.name),Pt("boolean"==typeof h,e,"internal-error"),Pt("boolean"==typeof f,e,"internal-error"),Ds(o,e.name),Ds(a,e.name),Ds(s,e.name),Ds(l,e.name),Ds(u,e.name),Ds(c,e.name);const m=new Qo({uid:d,auth:e,email:i,emailVerified:h,displayName:n,isAnonymous:f,photoURL:a,phoneNumber:o,tenantId:s,stsTokenManager:v,createdAt:u,lastLoginAt:c});return g&&Array.isArray(g)&&(m.providerData=g.map(b=>({...b}))),l&&(m._redirectEventId=l),m}static _fromIdTokenResponse(e,t){return(0,_.A)(function*(n,i,o=!1){const a=new ac;a.updateFromServerResponse(i);const s=new Qo({uid:i.localId,auth:n,stsTokenManager:a,isAnonymous:o});return yield Yd(s),s}).apply(this,arguments)}static _fromGetAccountInfoResponse(e,t,n){return(0,_.A)(function*(){const i=t.users[0];Pt(void 0!==i.localId,"internal-error");const o=void 0!==i.providerUserInfo?VS(i.providerUserInfo):[],a=!(i.email&&i.passwordHash||o?.length),s=new ac;s.updateFromIdToken(n);const l=new Qo({uid:i.localId,auth:e,stsTokenManager:s,isAnonymous:a}),u={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new D_(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash||o?.length)};return Object.assign(l,u),l})()}}const BS=new Map;function Ka(r){ks(r instanceof Function,"Expected a class definition");let e=BS.get(r);return e?(ks(e instanceof r,"Instance stored in cache mismatched with class"),e):(e=new r,BS.set(r,e),e)}const US=(()=>{class r{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return(0,_.A)(function*(){return!0})()}_set(t,n){var i=this;return(0,_.A)(function*(){i.storage[t]=n})()}_get(t){var n=this;return(0,_.A)(function*(){const i=n.storage[t];return void 0===i?null:i})()}_remove(t){var n=this;return(0,_.A)(function*(){delete n.storage[t]})()}_addListener(t,n){}_removeListener(t,n){}}return r.type="NONE",r})();function Dp(r,e,t){return`firebase:${r}:${e}:${t}`}class sc{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:i,name:o}=this.auth;this.fullUserKey=Dp(this.userKey,i.apiKey,o),this.fullPersistenceKey=Dp("persistence",i.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}getCurrentUser(){var e=this;return(0,_.A)(function*(){const t=yield e.persistence._get(e.fullUserKey);if(!t)return null;if("string"==typeof t){const n=yield Pp(e.auth,{idToken:t}).catch(()=>{});return n?Qo._fromGetAccountInfoResponse(e.auth,n,t):null}return Qo._fromJSON(e.auth,t)})()}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(e){var t=this;return(0,_.A)(function*(){if(t.persistence===e)return;const n=yield t.getCurrentUser();return yield t.removeCurrentUser(),t.persistence=e,n?t.setCurrentUser(n):void 0})()}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(e,t){return(0,_.A)(function*(n,i,o="authUser"){if(!i.length)return new sc(Ka(US),n,o);const a=(yield Promise.all(i.map(function(){var d=(0,_.A)(function*(h){if(yield h._isAvailable())return h});return function(h){return d.apply(this,arguments)}}()))).filter(d=>d);let s=a[0]||Ka(US);const l=Dp(o,n.config.apiKey,n.name);let u=null;for(const d of i)try{const h=yield d._get(l);if(h){let f;if("string"==typeof h){const g=yield Pp(n,{idToken:h}).catch(()=>{});if(!g)break;f=yield Qo._fromGetAccountInfoResponse(n,g,h)}else f=Qo._fromJSON(n,h);d!==s&&(u=f),s=d;break}}catch{}const c=a.filter(d=>d._shouldAllowMigration);return s._shouldAllowMigration&&c.length?(s=c[0],u&&(yield s._set(l,u.toJSON())),yield Promise.all(i.map(function(){var d=(0,_.A)(function*(h){if(h!==s)try{yield h._remove(l)}catch{}});return function(h){return d.apply(this,arguments)}}())),new sc(s,n,o)):new sc(s,n,o)}).apply(this,arguments)}}function zS(r){const e=r.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(function $S(r=(0,Kt.ZQ)()){return/iemobile/i.test(r)}(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(function GS(r=(0,Kt.ZQ)()){return/firefox\//i.test(r)}(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(function WS(r=(0,Kt.ZQ)()){return/blackberry/i.test(r)}(e))return"Blackberry";if(function XS(r=(0,Kt.ZQ)()){return/webos/i.test(r)}(e))return"Webos";if(function qS(r=(0,Kt.ZQ)()){const e=r.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}(e))return"Safari";if((e.includes("chrome/")||function jS(r=(0,Kt.ZQ)()){return/crios\//i.test(r)}(e))&&!e.includes("edge/"))return"Chrome";if(function HS(r=(0,Kt.ZQ)()){return/android/i.test(r)}(e))return"Android";{const n=r.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);if(2===n?.length)return n[1]}return"Other"}function KS(r,e=[]){let t;switch(r){case"Browser":t=zS((0,Kt.ZQ)());break;case"Worker":t=`${zS((0,Kt.ZQ)())}-${r}`;break;default:t=r}const n=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${B.MF}/${n}`}class AB{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=o=>new Promise((a,s)=>{try{a(e(o))}catch(l){s(l)}});n.onAbort=t,this.queue.push(n);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(e){var t=this;return(0,_.A)(function*(){if(t.auth.currentUser===e)return;const n=[];try{for(const i of t.queue)yield i(e),i.onAbort&&n.push(i.onAbort)}catch(i){n.reverse();for(const o of n)try{o()}catch{}throw t.auth._errorFactory.create("login-blocked",{originalMessage:i?.message})}})()}}function V_(){return(V_=(0,_.A)(function*(r,e={}){return xn(r,"GET","/v2/passwordPolicy",In(r,e))})).apply(this,arguments)}class RB{constructor(e){const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??6,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),void 0!==t.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),void 0!==t.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),void 0!==t.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),void 0!==t.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),i&&(t.meetsMaxPasswordLength=e.length<=i)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let i=0;i<e.length;i++)n=e.charAt(i),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,t,n,i,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}}class PB{constructor(e,t,n,i){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new YS(this),this.idTokenSubscription=new YS(this),this.beforeStateQueue=new AB(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=CS,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=i.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(e,t){var n=this;return t&&(this._popupRedirectResolver=Ka(t)),this._initializationPromise=this.queue((0,_.A)(function*(){if(!n._deleted&&(n.persistenceManager=yield sc.create(n,e),n._resolvePersistenceManagerAvailable?.(),!n._deleted)){if(n._popupRedirectResolver?._shouldInitProactively)try{yield n._popupRedirectResolver._initialize(n)}catch{}yield n.initializeCurrentUser(t),n.lastNotifiedUid=n.currentUser?.uid||null,!n._deleted&&(n._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){var e=this;return(0,_.A)(function*(){if(e._deleted)return;const t=yield e.assertedPersistence.getCurrentUser();if(e.currentUser||t){if(e.currentUser&&t&&e.currentUser.uid===t.uid)return e._currentUser._assign(t),void(yield e.currentUser.getIdToken());yield e._updateCurrentUser(t,!0)}})()}initializeCurrentUserFromIdToken(e){var t=this;return(0,_.A)(function*(){try{const n=yield Pp(t,{idToken:e}),i=yield Qo._fromGetAccountInfoResponse(t,n,e);yield t.directlySetCurrentUser(i)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),yield t.directlySetCurrentUser(null)}})()}initializeCurrentUser(e){var t=this;return(0,_.A)(function*(){if((0,B.xZ)(t.app)){const a=t.app.settings.authIdToken;return a?new Promise(s=>{setTimeout(()=>t.initializeCurrentUserFromIdToken(a).then(s,s))}):t.directlySetCurrentUser(null)}const n=yield t.assertedPersistence.getCurrentUser();let i=n,o=!1;if(e&&t.config.authDomain){yield t.getOrInitRedirectPersistenceManager();const a=t.redirectUser?._redirectEventId,s=i?._redirectEventId,l=yield t.tryRedirectSignIn(e);(!a||a===s)&&l?.user&&(i=l.user,o=!0)}if(!i)return t.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{yield t.beforeStateQueue.runMiddleware(i)}catch(a){i=n,t._popupRedirectResolver._overrideRedirectResult(t,()=>Promise.reject(a))}return i?t.reloadAndSetCurrentUserOrClear(i):t.directlySetCurrentUser(null)}return Pt(t._popupRedirectResolver,t,"argument-error"),yield t.getOrInitRedirectPersistenceManager(),t.redirectUser&&t.redirectUser._redirectEventId===i._redirectEventId?t.directlySetCurrentUser(i):t.reloadAndSetCurrentUserOrClear(i)})()}tryRedirectSignIn(e){var t=this;return(0,_.A)(function*(){let n=null;try{n=yield t._popupRedirectResolver._completeRedirectFn(t,e,!0)}catch{yield t._setRedirectUser(null)}return n})()}reloadAndSetCurrentUserOrClear(e){var t=this;return(0,_.A)(function*(){try{yield Yd(e)}catch(n){if("auth/network-request-failed"!==n?.code)return t.directlySetCurrentUser(null)}return t.directlySetCurrentUser(e)})()}useDeviceLanguage(){this.languageCode=function lB(){if(typeof navigator>"u")return null;const r=navigator;return r.languages&&r.languages[0]||r.language||null}()}_delete(){var e=this;return(0,_.A)(function*(){e._deleted=!0})()}updateCurrentUser(e){var t=this;return(0,_.A)(function*(){if((0,B.xZ)(t.app))return Promise.reject(pi(t));const n=e?(0,Kt.Ku)(e):null;return n&&Pt(n.auth.config.apiKey===t.config.apiKey,t,"invalid-user-token"),t._updateCurrentUser(n&&n._clone(t))})()}_updateCurrentUser(e){var t=this;return(0,_.A)(function*(n,i=!1){if(!t._deleted)return n&&Pt(t.tenantId===n.tenantId,t,"tenant-id-mismatch"),i||(yield t.beforeStateQueue.runMiddleware(n)),t.queue((0,_.A)(function*(){yield t.directlySetCurrentUser(n),t.notifyAuthListeners()}))}).apply(this,arguments)}signOut(){var e=this;return(0,_.A)(function*(){return(0,B.xZ)(e.app)?Promise.reject(pi(e)):(yield e.beforeStateQueue.runMiddleware(null),(e.redirectPersistenceManager||e._popupRedirectResolver)&&(yield e._setRedirectUser(null)),e._updateCurrentUser(null,!0))})()}setPersistence(e){var t=this;return(0,B.xZ)(this.app)?Promise.reject(pi(this)):this.queue((0,_.A)(function*(){yield t.assertedPersistence.setPersistence(Ka(e))}))}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){var t=this;return(0,_.A)(function*(){t._getPasswordPolicyInternal()||(yield t._updatePasswordPolicy());const n=t._getPasswordPolicyInternal();return n.schemaVersion!==t.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(t._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)})()}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){var e=this;return(0,_.A)(function*(){const t=yield function SB(r){return V_.apply(this,arguments)}(e),n=new RB(t);null===e.tenantId?e._projectPasswordPolicy=n:e._tenantPasswordPolicies[e.tenantId]=n})()}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Kt.FA("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}revokeAccessToken(e){var t=this;return(0,_.A)(function*(){if(t.currentUser){const n=yield t.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};null!=t.tenantId&&(i.tenantId=t.tenantId),yield function TB(r,e){return M_.apply(this,arguments)}(t,i)}})()}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}_setRedirectUser(e,t){var n=this;return(0,_.A)(function*(){const i=yield n.getOrInitRedirectPersistenceManager(t);return null===e?i.removeCurrentUser():i.setCurrentUser(e)})()}getOrInitRedirectPersistenceManager(e){var t=this;return(0,_.A)(function*(){if(!t.redirectPersistenceManager){const n=e&&Ka(e)||t._popupRedirectResolver;Pt(n,t,"argument-error"),t.redirectPersistenceManager=yield sc.create(t,[Ka(n._redirectPersistence)],"redirectUser"),t.redirectUser=yield t.redirectPersistenceManager.getCurrentUser()}return t.redirectPersistenceManager})()}_redirectUserForId(e){var t=this;return(0,_.A)(function*(){return t._isInitialized&&(yield t.queue((0,_.A)(function*(){}))),t._currentUser?._redirectEventId===e?t._currentUser:t.redirectUser?._redirectEventId===e?t.redirectUser:null})()}_persistUserIfCurrent(e){var t=this;return(0,_.A)(function*(){if(e===t.currentUser)return t.queue((0,_.A)(function*(){return t.directlySetCurrentUser(e)}))})()}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,i){if(this._deleted)return()=>{};const o="function"==typeof t?t:t.next.bind(t);let a=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(Pt(s,this,"internal-error"),s.then(()=>{a||o(this.currentUser)}),"function"==typeof t){const l=e.addObserver(t,n,i);return()=>{a=!0,l()}}{const l=e.addObserver(t);return()=>{a=!0,l()}}}directlySetCurrentUser(e){var t=this;return(0,_.A)(function*(){t.currentUser&&t.currentUser!==e&&t._currentUser._stopProactiveRefresh(),e&&t.isProactiveRefreshEnabled&&e._startProactiveRefresh(),t.currentUser=e,e?yield t.assertedPersistence.setCurrentUser(e):yield t.assertedPersistence.removeCurrentUser()})()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Pt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=KS(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){var e=this;return(0,_.A)(function*(){const t={"X-Client-Version":e.clientVersion};e.app.options.appId&&(t["X-Firebase-gmpid"]=e.app.options.appId);const n=yield e.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();n&&(t["X-Firebase-Client"]=n);const i=yield e._getAppCheckToken();return i&&(t["X-Firebase-AppCheck"]=i),t})()}_getAppCheckToken(){var e=this;return(0,_.A)(function*(){if((0,B.xZ)(e.app)&&e.app.settings.appCheckToken)return e.app.settings.appCheckToken;const t=yield e.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return t?.error&&function aB(r,...e){Cp.logLevel<=Nn.$b.WARN&&Cp.warn(`Auth (${B.MF}): ${r}`,...e)}(`Error while retrieving App Check token: ${t.error}`),t?.token})()}}class YS{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,Kt.tD)(t=>this.observer=t)}get next(){return Pt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let Qd={loadJS:()=>(0,_.A)(function*(){throw new Error("Unable to load external scripts")})(),recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};(function QS(r){return`__${r}${Math.floor(1e6*Math.random())}`})("rcb"),new Wd(3e4,6e4),new Wd(2e3,1e4),new Wd(3e4,6e4),new Wd(5e3,15e3),encodeURIComponent("fac");var DC="@firebase/auth";class kU{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}getToken(e){var t=this;return(0,_.A)(function*(){return t.assertAuthConfigured(),yield t.auth._initializationPromise,t.auth.currentUser?{accessToken:yield t.auth.currentUser.getIdToken(e)}:null})()}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(n=>{e(n?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Pt(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}(0,Kt.XA)("authIdTokenMaxAge"),function kB(r){Qd=r}({loadJS:r=>new Promise((e,t)=>{const n=document.createElement("script");n.setAttribute("src",r),n.onload=e,n.onerror=i=>{const o=Oo("internal-error");o.customData=i,t(o)},n.type="text/javascript",n.charset="UTF-8",function MU(){return document.getElementsByTagName("head")?.[0]??document}().appendChild(n)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),function NU(r){(0,B.om)(new Ti.uA("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:a,authDomain:s}=n.options;Pt(a&&!a.includes(":"),"invalid-api-key",{appName:n.name});const l={apiKey:a,authDomain:s,clientPlatform:r,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:KS(r)},u=new PB(n,i,o,l);return function jB(r,e){const t=e?.persistence||[],n=(Array.isArray(t)?t:[t]).map(Ka);e?.errorMap&&r._updateErrorMap(e.errorMap),r._initializeWithPersistence(n,e?.popupRedirectResolver)}(u,t),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),(0,B.om)(new Ti.uA("auth-internal",e=>{const t=function $n(r){return(0,Kt.Ku)(r)}(e.getProvider("auth").getImmediate());return new kU(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),(0,B.KO)(DC,"1.12.0",function DU(r){switch(r){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(r)),(0,B.KO)(DC,"1.12.0","esm2020")}("Browser");const Si=[];for(let r=0;r<256;++r)Si.push((r+256).toString(16).slice(1));const VU=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,GU=function zU(r){if(!function BU(r){return"string"==typeof r&&VU.test(r)}(r))throw TypeError("Invalid UUID");let e;const t=new Uint8Array(16);return t[0]=(e=parseInt(r.slice(0,8),16))>>>24,t[1]=e>>>16&255,t[2]=e>>>8&255,t[3]=255&e,t[4]=(e=parseInt(r.slice(9,13),16))>>>8,t[5]=255&e,t[6]=(e=parseInt(r.slice(14,18),16))>>>8,t[7]=255&e,t[8]=(e=parseInt(r.slice(19,23),16))>>>8,t[9]=255&e,t[10]=(e=parseInt(r.slice(24,36),16))/1099511627776&255,t[11]=e/4294967296&255,t[12]=e>>>24&255,t[13]=e>>>16&255,t[14]=e>>>8&255,t[15]=255&e,t};function WU(r,e,t,n){switch(r){case 0:return e&t^~e&n;case 1:case 3:return e^t^n;case 2:return e&t^e&n^t&n}}function Cb(r,e){return r<<e|r>>>32-e}const KU=function HU(r,e,t){function n(i,o,a,s){var l;if("string"==typeof i&&(i=function qU(r){r=unescape(encodeURIComponent(r));const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t));return e}(i)),"string"==typeof o&&(o=GU(o)),16!==(null===(l=o)||void 0===l?void 0:l.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let u=new Uint8Array(16+i.length);if(u.set(o),u.set(i,o.length),u=t(u),u[6]=15&u[6]|e,u[8]=63&u[8]|128,a){s=s||0;for(let c=0;c<16;++c)a[s+c]=u[c];return a}return function OC(r,e=0){return(Si[r[e+0]]+Si[r[e+1]]+Si[r[e+2]]+Si[r[e+3]]+"-"+Si[r[e+4]]+Si[r[e+5]]+"-"+Si[r[e+6]]+Si[r[e+7]]+"-"+Si[r[e+8]]+Si[r[e+9]]+"-"+Si[r[e+10]]+Si[r[e+11]]+Si[r[e+12]]+Si[r[e+13]]+Si[r[e+14]]+Si[r[e+15]]).toLowerCase()}(u)}try{n.name=r}catch{}return n.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8",n.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8",n}("v5",80,function XU(r){const e=[1518500249,1859775393,2400959708,3395469782],t=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof r){const a=unescape(encodeURIComponent(r));r=[];for(let s=0;s<a.length;++s)r.push(a.charCodeAt(s))}else Array.isArray(r)||(r=Array.prototype.slice.call(r));r.push(128);const i=Math.ceil((r.length/4+2)/16),o=new Array(i);for(let a=0;a<i;++a){const s=new Uint32Array(16);for(let l=0;l<16;++l)s[l]=r[64*a+4*l]<<24|r[64*a+4*l+1]<<16|r[64*a+4*l+2]<<8|r[64*a+4*l+3];o[a]=s}o[i-1][14]=8*(r.length-1)/Math.pow(2,32),o[i-1][14]=Math.floor(o[i-1][14]),o[i-1][15]=8*(r.length-1)&4294967295;for(let a=0;a<i;++a){const s=new Uint32Array(80);for(let f=0;f<16;++f)s[f]=o[a][f];for(let f=16;f<80;++f)s[f]=Cb(s[f-3]^s[f-8]^s[f-14]^s[f-16],1);let l=t[0],u=t[1],c=t[2],d=t[3],h=t[4];for(let f=0;f<80;++f){const g=Math.floor(f/20),y=Cb(l,5)+WU(g,u,c,d)+h+e[g]+s[f]>>>0;h=d,d=c,c=Cb(u,30)>>>0,u=l,l=y}t[0]=t[0]+l>>>0,t[1]=t[1]+u>>>0,t[2]=t[2]+c>>>0,t[3]=t[3]+d>>>0,t[4]=t[4]+h>>>0}return[t[0]>>24&255,t[0]>>16&255,t[0]>>8&255,255&t[0],t[1]>>24&255,t[1]>>16&255,t[1]>>8&255,255&t[1],t[2]>>24&255,t[2]>>16&255,t[2]>>8&255,255&t[2],t[3]>>24&255,t[3]>>16&255,t[3]>>8&255,255&t[3],t[4]>>24&255,t[4]>>16&255,t[4]>>8&255,255&t[4]]});ne(4556);class i4{constructor(e,t,n,i){this.app=e,this.auth=null,this.messaging=null,this.appCheck=null,this.serverAppAppCheckToken=null,(0,B.xZ)(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.auth=t.getImmediate({optional:!0}),this.messaging=n.getImmediate({optional:!0}),this.auth||t.get().then(o=>this.auth=o,()=>{}),this.messaging||n.get().then(o=>this.messaging=o,()=>{}),this.appCheck||i?.get().then(o=>this.appCheck=o,()=>{})}getAuthToken(){var e=this;return(0,_.A)(function*(){if(e.auth)try{return(yield e.auth.getToken())?.accessToken}catch{return}})()}getMessagingToken(){var e=this;return(0,_.A)(function*(){if(e.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return yield e.messaging.getToken()}catch{return}})()}getAppCheckToken(e){var t=this;return(0,_.A)(function*(){if(t.serverAppAppCheckToken)return t.serverAppAppCheckToken;if(t.appCheck){const n=e?yield t.appCheck.getLimitedUseToken():yield t.appCheck.getToken();return n.error?null:n.token}return null})()}getContext(e){var t=this;return(0,_.A)(function*(){return{authToken:yield t.getAuthToken(),messagingToken:yield t.getMessagingToken(),appCheckToken:yield t.getAppCheckToken(e)}})()}}const Pb="us-central1";class s4{constructor(e,t,n,i,o=Pb,a=(...s)=>fetch(...s)){this.app=e,this.fetchImpl=a,this.emulatorOrigin=null,this.contextProvider=new i4(e,t,n,i),this.cancelAllRequests=new Promise(s=>{this.deleteService=()=>Promise.resolve(s())});try{const s=new URL(o);this.customDomain=s.origin+("/"===s.pathname?"":s.pathname),this.region=Pb}catch{this.customDomain=null,this.region=o}}_delete(){return this.deleteService()}_url(e){const t=this.app.options.projectId;return null!==this.emulatorOrigin?`${this.emulatorOrigin}/${t}/${this.region}/${e}`:null!==this.customDomain?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`}}const qC="@firebase/functions";!function y4(r){(0,B.om)(new Ti.uA("functions",(t,{instanceIdentifier:n})=>{const i=t.getProvider("app").getImmediate(),o=t.getProvider("auth-internal"),a=t.getProvider("messaging-internal"),s=t.getProvider("app-check-internal");return new s4(i,o,a,s,n)},"PUBLIC").setMultipleInstances(!0)),(0,B.KO)(qC,"0.13.1",r),(0,B.KO)(qC,"0.13.1","esm2020")}(),Error,parseInt((typeof process<"u"?process.env.QLEVER_LOCKED_MAX_RETRIES:void 0)??"10",10),parseInt((typeof process<"u"?process.env.QLEVER_LOCKED_BASE_DELAY_MS:void 0)??"2000",10);const ZC={\u00e4:"ae",a\u0308:"ae",\u00c4:"AE",\u00f6:"oe",\u00d6:"OE",\u00fc:"ue",u\u0308:"ue",\u00dc:"UE",U\u0308:"UE",\u00df:"ss",\u00e6:"ae",\u00c6:"AE",\u00f8:"oe",\u00d8:"OE",\u00e5:"aa",\u00c5:"AA",\u00e1:"a",\u00c1:"A",\u00f0:"d",\u00d0:"D",\u00e9:"e",\u00c9:"E",\u00ed:"i",\u00cd:"I",\u00f3:"o",\u00d3:"O",\u00fa:"u",\u00da:"U",\u00fd:"y",\u00dd:"Y",\u00fe:"th",\u00de:"Th"};function sh(r,e=!1){return r=function nz(r,e=!1){let t=r;for(const n in ZC)t=t.replace(new RegExp(n,"g"),ZC[n]);return e&&t!==r&&console.info(`${r} -> ${t}`),t}(r,e),KU(r,"daca0510-72b5-48ba-9091-b918ca18136b")}class Gi{_value;_listeners=new Set;constructor(e){this._value=e}get(){return this._value}set(e){this._value=e;for(const t of this._listeners)t()}subscribe(e){return this._listeners.add(e),()=>this._listeners.delete(e)}asReadonly(){return this}}function $b(r,e,t,n){return Hb.apply(this,arguments)}function Hb(){return(Hb=(0,_.A)(function*(r,e,t,n){const i=sh(r);let o;if(n){const s=yield n.get(i);void 0!==s&&(t(s,!0),o=sh(JSON.stringify(s)))}const a=yield e();return t(a,!1),n&&sh(JSON.stringify(a))!==o&&n.set(i,a).catch(s=>console.error("[staleWhileRevalidate] Cache write failed:",s)),a})).apply(this,arguments)}const Xb="https://cue.qaecy.com/r/",_z={address:{category:"address",label:"Address",description:"Official addresses, streets, and addressable access points.",preferredColor:"#1d4ed8"},poi:{category:"poi",label:"Points of interest",description:"Places and amenities relevant to everyday operations and access.",preferredColor:"#059669"},railway:{category:"railway",label:"Railway",description:"Rail infrastructure, stations, and rail-adjacent transport context.",preferredColor:"#dc2626"},natural:{category:"natural",label:"Natural features",description:"Natural and hydrological features such as watercourses, forests, and land cover.",preferredColor:"#0ea5e9"},manmade:{category:"manmade",label:"Built features",description:"Structures and man-made elements not covered by more specific categories.",preferredColor:"#ca8a04"},cadastre:{category:"cadastre",label:"Cadastre",description:"Land parcels, legal boundaries, official surveying, and public-law land restrictions.",preferredColor:"#7c3aed"},building:{category:"building",label:"Buildings",description:"Building footprints and structures from official registry or cadastral data.",preferredColor:"#f97316"},greenspace:{category:"greenspace",label:"Green spaces",description:"Parks, gardens, playgrounds, sports facilities, and other vegetated open areas.",preferredColor:"#16a34a"},paved:{category:"paved",label:"Paved surfaces",description:"Courtyards, sidewalks, parking areas, and other sealed ground surfaces.",preferredColor:"#78716c"},zone:{category:"zone",label:"Planning zones",description:"Land-use zones, local plans, and public-law planning constraints (Nutzungsplanung / Lokalplan).",preferredColor:"#db2777"}};function Ja(r){return _z[r]}const wR={110:"residential",120:"residential",121:"residential",122:"residential",130:"residential",131:"residential",132:"residential",140:"residential",150:"residential",160:"residential",190:"residential",210:"recreational",212:"recreational",220:"recreational",221:"recreational",230:"recreational",290:"residential",310:"agricultural",311:"agricultural",312:"agricultural",320:"agricultural",321:"agricultural",322:"agricultural",330:"agricultural",390:"agricultural",410:"commercial",411:"commercial",420:"commercial",421:"commercial",422:"commercial",430:"commercial",431:"commercial",432:"commercial",440:"commercial",490:"commercial",510:"industrial",511:"industrial",519:"industrial",520:"infrastructure",521:"infrastructure",522:"infrastructure",529:"infrastructure",530:"infrastructure",531:"infrastructure",532:"infrastructure",533:"infrastructure",534:"infrastructure",535:"infrastructure",540:"infrastructure",585:"infrastructure",590:"industrial",610:"public",620:"public",621:"public",622:"public",630:"public",640:"public",650:"recreational",660:"public",670:"public",680:"public",690:"public",910:"other",920:"other",930:"other",940:"other",950:"infrastructure",960:"agricultural",970:"agricultural",990:"other"},bR={1010:"residential",1020:"mixed",1030:"residential",1040:"other",1060:"recreational",1080:"residential",1110:"commercial",1120:"commercial",1130:"commercial",1140:"industrial",1150:"infrastructure",1160:"infrastructure",1210:"public",1220:"public",1230:"public",1240:"recreational",1241:"public",1242:"recreational",1251:"public",1261:"agricultural",1262:"agricultural",1263:"agricultural",1275:"other",1276:"other",1277:"infrastructure",1278:"infrastructure",1281:"infrastructure",1282:"infrastructure",9999:"other"},Az={1110:"residential",1121:"recreational",1122:"residential",1130:"mixed",1140:"mixed",1211:"commercial",1212:"commercial",1213:"mixed",1220:"commercial",1230:"commercial",1231:"commercial",1241:"infrastructure",1242:"recreational",1264:"recreational",1251:"industrial",1252:"industrial",1261:"public",1262:"public",1263:"public",1265:"public",1272:"public",1273:"public",1271:"agricultural",1274:"other",1281:"infrastructure",1282:"infrastructure"},Sz=[[/^geb[\xe4a]ude$/i,"other"],[/wohn|resident|housing|bolig|enfamil|etagebolig|r\xe6kkehus|lejlighed/i,"residential"],[/b\xfcro|office|handel|commercial|butik|forretning|kontor|supermarked|lager|hotel|restaurant/i,"commercial"],[/industri|fabrik|industrial|gewerbe|produktion|fabrik|fremstill/i,"industrial"],[/landwirtschaft|agrar|agricultural|landbrug|skov|dyrk|stald|lade|drivhus/i,"agricultural"],[/schule|school|hospital|gesundheit|sundhed|kirche|church|offentlig|uddannelse|kultur|social|plejehjem/i,"public"],[/freizeit|recreation|sport|sommerhus|ferienhaus|fritid|kolonihave/i,"recreational"],[/infrastruktur|verkehr|transport|energy|energie|forsyning|teknik|teknisk/i,"infrastructure"],[/gemischt|mixed|blandet/i,"mixed"]];function uh(r){for(const[e,t]of Sz)if(e.test(r))return t}function Cz(r,e){if(null==r)return;const t=String(r).trim();return"swiss-gwr"===e?Az[t]??uh(t):"danish-matrikel"===e?wR[t]??uh(t):"zurich-wfs"===e||"swiss-av-wfs"===e?bR[t]??uh(t):bR[t]??wR[t]??uh(t)}function Rz(r,e){if(null!=r)return uh(String(r).trim())}function ER(r){return r.trim().toLowerCase().replace(/[\s_\-]/g,"")}const Pz={inkraft:"in-force",laufendeanderung:"amendment-pending",laufende\u00e4nderung:"amendment-pending",aenderungohnevorvirkung:"amendment-pending",aenderungohnevorwirkung:"amendment-pending",\u00e4nderungohnevorwirkung:"amendment-pending",aenderungmitvorwirkung:"amendment-in-effect",\u00e4nderungmitvorwirkung:"amendment-in-effect",\u00f6ffentlicheauflage:"proposed",offentlicheauflage:"proposed",aufgehoben:"repealed",vedtaget:"in-force",forslag:"proposed",aflyst:"repealed"};const IR={grundnutzungszonenplan:"land-use-plan",nutzungszonenplan:"land-use-plan",zonenplan:"land-use-plan",gestaltungsplan:"design-plan",bebauungsplan:"development-plan",sondernutzungsplan:"special-use-plan",quartiererhaltungszonenplan:"neighbourhood-conservation-plan",l\u00e4rmempfindlichkeitsstufenplan:"noise-sensitivity-plan",laermempfindlichkeitsstufenplan:"noise-sensitivity-plan",gew\u00e4sserschutzzonenplan:"water-protection-plan",gewasserschutzzonenplan:"water-protection-plan",grundwasserschutzzonenplan:"water-protection-plan",gew\u00e4sserschutzplan:"water-protection-plan",naturundlandschaftsschutzzonenplan:"nature-landscape-plan","natur-undlandschaftsschutzzonenplan":"nature-landscape-plan",landschaftsschutzzonenplan:"nature-landscape-plan",freihaltezone:"open-space-zone",kernzone:"land-use-plan",wald:"land-use-plan",gew\u00e4sser:"land-use-plan",gewasser:"land-use-plan",reservezone:"land-use-plan",bahnareal:"land-use-plan",erholungszone:"land-use-plan","strassen(weitere)":"land-use-plan",strassen:"land-use-plan",nichtzoniertfl\u00e4che:"unzoned",nichtzoniertefl\u00e4che:"unzoned",nichtzoniertflache:"unzoned",nichtzonierteflache:"unzoned",nichtzoniertgem\u00e4ssbzo2016:"unzoned",nichtzoniertgemassbzo2016:"unzoned",hochh\u00e4user:"overlay-regulation",hochhauser:"overlay-regulation",areal\u00fcberbauungenzul\u00e4ssig:"overlay-regulation",arealuberbauungenzulassig:"overlay-regulation",erh\u00f6hteausnutzung:"overlay-regulation",erhohteausnutzung:"overlay-regulation",erdgeschossnutzung:"overlay-regulation",freifl\u00e4chenzifferverlegungsgebiet:"overlay-regulation",freiflachenzifferverlegungsgebiet:"overlay-regulation",baumschutz:"overlay-regulation",sonderbauvorschriften:"overlay-regulation",lokalplan:"local-plan",kommuneplanramme:"municipal-plan-framework"},kz=[[/quartiererhalt/i,"neighbourhood-conservation-plan"],[/l\xe4rmempfindlich|laermempfindlich/i,"noise-sensitivity-plan"],[/gew\xe4sserschutz|grundwasserschutz/i,"water-protection-plan"],[/natur.*landschaft|landschaft.*schutz/i,"nature-landscape-plan"],[/gestaltungsplan/i,"design-plan"],[/bebauungsplan/i,"development-plan"],[/sondernutzung/i,"special-use-plan"],[/freihalt/i,"open-space-zone"],[/\xf6ffentliche.*bauten|zone.*\xf6ffentlich/i,"land-use-plan"],[/hochhaus/i,"overlay-regulation"],[/areal\xfcberbauung|arealuberbauung/i,"overlay-regulation"],[/erh\xf6hte.*ausnutzung|ausnutzung/i,"overlay-regulation"],[/erdgeschossnutzung/i,"overlay-regulation"],[/freifl\xe4chenzifferverlegung|freiflachenzifferverlegung/i,"overlay-regulation"],[/erhaltenswert/i,"overlay-regulation"],[/m[\u00e4a]ssig.*st[\u00f6o]rend|st[\u00f6o]rendes.*gewerbe/i,"overlay-regulation"],[/wohnzone/i,"land-use-plan"],[/kernzone|zentrumszone/i,"land-use-plan"],[/erholungszone|erholungs/i,"land-use-plan"],[/stra[s\xdf]en/i,"land-use-plan"],[/landwirtschaft/i,"land-use-plan"],[/\bwald\b/i,"land-use-plan"],[/\bgew[\u00e4a]sser\b/i,"land-use-plan"],[/nicht\s*zoniert/i,"unzoned"],[/baumschutz/i,"overlay-regulation"],[/sonderbauvorschrift/i,"overlay-regulation"],[/kommuneplan/i,"municipal-plan-framework"],[/lokalplan/i,"local-plan"],[/zonenplan|nutzungsplan|nutzungszone/i,"land-use-plan"],[/zone$|areal$/i,"land-use-plan"]];function Yb(r){return"string"==typeof r?r:r.typeName}function Qb(r){return"string"==typeof r?void 0:r.cqlFilter}function Vz(r,e,t){return t?`${r}:${e}[${t}]`:`${r}:${e}`}const Bz=new Set(["building","cadastre","greenspace","paved","zone"]);function Jb(r,e,t,n){const i=t.replace(/^ms:/,""),o=Ja(e),a=Bz.has(e)?"priority":"raw";return{id:Vz(r,t,n),sourceId:r,sourceLayerId:t,category:e,preferredColor:o.preferredColor,tier:a,label:i,description:`Z\xfcrich WFS layer ${i}`,labelKey:`gis.layer.${r}.${i}.label`,descriptionKey:`gis.layer.${r}.${i}.description`}}class Zb{categoryMap;baseUrl;sourceId;outputFormat;constructor(e){this.categoryMap=e.categoryMap,this.baseUrl=e.baseUrl??"https://maps.zh.ch/wfs/OGDZHWFS",this.sourceId=e.sourceId??"zurich-wfs",this.outputFormat=e.outputFormat??"application/json; subtype=geojson"}listFeatureCategoryDescriptors(e){var t=this;return(0,_.A)(function*(){const n=yield t.listAvailableLayers(e);return[...new Map(n.map(i=>[i.category,Ja(i.category)])).values()]})()}listAvailableLayers(e){var t=this;return(0,_.A)(function*(){const n=Object.entries(t.categoryMap);return(yield Promise.allSettled(n.flatMap(([i,o])=>o.map(function(){var a=(0,_.A)(function*(s){const l=Yb(s),u=Qb(s),c=yield t._fetchFeatures(e,l,1,u);return{category:i,typeName:l,cqlFilter:u,hasResults:c.features.length>0}});return function(s){return a.apply(this,arguments)}}())))).filter(i=>"fulfilled"===i.status&&i.value.hasResults).map(i=>Jb(t.sourceId,i.value.category,i.value.typeName,i.value.cqlFilter))})()}getFeaturesForLayer(e,t){var n=this;return(0,_.A)(function*(){const i=n._findLayerById(t);return i?n._fetchAndConvert(e,i.descriptor,i.cqlFilter):[]})()}_fetchAndConvert(e,t,n){var i=this;return(0,_.A)(function*(){const o=yield i._fetchFeatures(e,t.sourceLayerId,void 0,n),a=n?function $z(r){const e=r.match(/^(\w+)\s*=\s*'([^']+)'$/);if(e){const[,n,i]=e;return o=>String(o?.[n]??"")===i}const t=r.match(/^(\w+)\s+IN\s*\(([^)]+)\)$/i);if(t){const[,n,i]=t,o=new Set(i.split(",").map(a=>a.trim().replace(/^'|'$/g,"")));return a=>o.has(String(a?.[n]??""))}return()=>!0}(n):void 0;return(a?o.features.filter(s=>a(s.properties)):o.features).map((s,l)=>i.toGisFeature(s,t,l))})()}listFeatureCategories(e){var t=this;return(0,_.A)(function*(){const n=yield t.listAvailableLayers(e);return[...new Set(n.map(i=>i.category))]})()}getFeaturesOfCategory(e,t){var n=this;return(0,_.A)(function*(){const i=n.categoryMap[t]??[];return(yield Promise.all(i.map(o=>{const a=Yb(o),s=Qb(o),l=Jb(n.sourceId,t,a);return n._fetchAndConvert(e,l,s)}))).flat()})()}_findLayerById(e){const t=Object.entries(this.categoryMap);for(const[n,i]of t)for(const o of i){const a=Yb(o),s=Qb(o),l=Jb(this.sourceId,n,a,s);if(l.id===e)return{descriptor:l,cqlFilter:s}}}_fetchFeatures(e,t,n,i){var o=this;return(0,_.A)(function*(){const[a,s,l,u]=e,d=new URLSearchParams({service:"WFS",version:"2.0.0",request:"GetFeature",typename:t,bbox:`${s},${a},${u},${l},urn:ogc:def:crs:EPSG::4326`,srsName:"EPSG:4326",outputFormat:o.outputFormat});void 0!==n&&d.set("count",String(n)),void 0!==i&&d.set("CQL_FILTER",i),d.set("outputFormat",o.outputFormat);const h=`${o.baseUrl}?${d.toString()}`,f=yield fetch(h);if(!f.ok)throw new Error(`WFS request failed for ${t} (${o.sourceId}): ${f.status} ${f.statusText}`);return f.json()})()}toGisFeature(e,t,n){const[i,o]=function Mz(r){if(!r)return[0,0];const e=r.coordinates;switch(r.type){case"Point":return e;case"MultiPoint":case"LineString":return e[0];case"MultiLineString":case"Polygon":return e[0][0];case"MultiPolygon":return e[0][0][0];default:return[0,0]}}(e.geometry),a=function Fz(r,e){if(!r)return e;for(const t of["plannavn","bezeichnung","name","strassenname","objektname","title","label"])if("string"==typeof r[t]&&r[t])return r[t];return e}(e.properties,`${t.sourceLayerId}[${n}]`),s=e.bbox?[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]:void 0,l=t.tier,u="priority"===l?this._extractNormalisedProperties(e,t):void 0;return{id:e.id??`${t.sourceLayerId}/${n}`,preferredColor:t.preferredColor,sourceId:this.sourceId,sourceFeatureId:e.id??`${t.sourceLayerId}/${n}`,layerId:t.id,name:a,category:t.category,type:t.sourceLayerId.replace(/^ms:/,""),lat:o,lon:i,displayName:a,bbox:s,geometry:e.geometry??void 0,tier:l,properties:u,originalData:e.properties??{}}}_extractNormalisedProperties(e,t){return"building"===t.category?function Uz(r,e){if(!r)return{featureType:"building"};const t=r.grundflaeche??r.gbf??r.gebaeudegrundrissflaeche??r.flaeche??void 0,n=r.vollgeschosse??r.geschossanzahl??r.anzahl_geschosse??void 0,i=r.gebaeudefunktion??r.gfkode??r.art??r.objektart??void 0,o=r.baujahr??r.bauperiode??void 0,a=String(r.egid??r.gwr_egid??r.egris_egid??"").trim()||void 0;return{featureType:"building",areaM2:"number"==typeof t?t:void 0,buildingUse:i?String(i):void 0,buildingUseGeneric:Cz(i,e),floors:"number"==typeof n?n:void 0,yearBuilt:"number"==typeof o?o:void 0,registryId:a}}(e.properties,this.sourceId):"greenspace"===t.category?function Gz(r){if(!r)return{featureType:"greenspace"};const e=r.flaeche??void 0,t=r.art??void 0;return{featureType:"greenspace",areaM2:"number"==typeof e?e:void 0,surfaceType:t?String(t):void 0}}(e.properties):"paved"===t.category?function qz(r){if(!r)return{featureType:"paved"};const e=r.flaeche??void 0,t=r.art??void 0;return{featureType:"paved",areaM2:"number"==typeof e?e:void 0,surfaceType:t?String(t):void 0}}(e.properties):"zone"===t.category?function jz(r){if(!r)return{featureType:"zone"};const e=r.plannavn??r.bezeichnung??r.typ_bezeichnung??r.art??void 0,t=r.planid??r.plannummer??void 0,n=r.artcode??r.typ_code??r.abkuerzung??t??void 0,o=function TR(r){if(r)return Pz[ER(r)]}(r.rechtsstatus??r.status??void 0),s=function xR(r){if(!r)return;const e=ER(r);if(e in IR)return IR[e];for(const[t,n]of kz)if(t.test(r))return n;console.warn(`[cue-gis] Unknown zone plan type \u2014 add "${r}" to classifyZonePlanType: no ZonePlanType mapping found.`)}(r.typ_gde_bezeichnung??void 0),l=r.dagsordenpunkt_url??r.dokument_url??r.link??void 0,u=r.auflagedatum??void 0,c=r.festsetzungsdatum??void 0,d=r.genehmigungsdatum??void 0,h=r.inkraftsetzungsdatum??void 0,f=r.flaeche??r.flaeche_m2??void 0;return{featureType:"zone",zoneType:e?String(e):void 0,zoneCode:n?String(n):void 0,legalStatus:o,planType:s,planId:t?String(t):void 0,planDocumentLink:l?String(l):void 0,publicationDate:u??void 0,fixingDate:c??void 0,approvalDate:d??void 0,effectiveFrom:h??void 0,areaM2:"number"==typeof f?f:void 0}}(e.properties):function zz(r){if(!r)return{featureType:"plot"};const t=r.egris_egrid??r.egrid??void 0,n=r.nummer??void 0,i=r.nbident??void 0,o=n&&i?`${n}, ${i}`:n??void 0,a=r.flaechenmass??r.flaeche??void 0,s=r.art??r.nutzungsart??void 0;return{featureType:"plot",areaM2:"number"==typeof a?a:void 0,plotUse:s?String(s):void 0,plotUseGeneric:Rz(s),plotId:o,registryId:t}}(e.properties)}}new Zb({categoryMap:{address:["ms:ogd-0406_arv_basis_avzh_hausnummer_pos_p","ms:ogd-0571_afv_gv_strat_strassennetz_l"],poi:["ms:ogd-0053_giszhpub_ogd_veloparkieranlagen_p","ms:ogd-0406_arv_basis_avzh_gebaeudeeingang_p"],railway:["ms:ogd-0529_afv_gv_seilbahn_skilift_l","ms:ogd-0529_afv_gv_seilbahn_skilift_p"],natural:["ms:ogd-0045_giszhpub_wb_fliessgewaesser_l","ms:ogd-0045_giszhpub_wb_stehgewaesser_f","ms:ogd-0111_giszhpub_wald_waldareal_f"],manmade:["ms:ogd-0248_giszhpub_en_gebaeude_volumen_ha_f",{typeName:"ms:ogd-0401_arv_basis_avzh_bodenbedeckung_f",cqlFilter:"art IN ('Bahngebiet', 'Strasse_Weg', 'Flugplatz', 'Bruecke')"}],building:[{typeName:"ms:ogd-0401_arv_basis_avzh_bodenbedeckung_f",cqlFilter:"art = 'Geb\xe4ude'"}],greenspace:[{typeName:"ms:ogd-0401_arv_basis_avzh_bodenbedeckung_f",cqlFilter:"art IN ('Gartenanlage', 'Parkanlage', 'Spielplatz', 'Sportanlage', 'Friedhof', 'Gehoelz', 'Feuchtgebiet')"}],paved:[{typeName:"ms:ogd-0401_arv_basis_avzh_bodenbedeckung_f",cqlFilter:"art IN ('befBoden', 'befestigte Fl\xe4che', 'Hof', 'Trottoir', 'Parkplatz')"}],cadastre:["ms:ogd-0404_arv_basis_avzh_liegenschaften_f","ms:ogd-0404_arv_basis_avzh_selbstrecht_f"],zone:["ms:ogd-0156_arv_basis_np_gn_zonenflaeche_f","ms:ogd-0155_arv_basis_np_ul_flaeche_f"]}}),new Zb({sourceId:"swiss-av-wfs",baseUrl:"https://wfs.geodienste.ch/av_0/deu",categoryMap:{cadastre:["ms:RESF","ms:DPRSF"]}}),new Zb({sourceId:"danish-plandata",baseUrl:"https://wfs.plandata.dk/geoserver/pdk/wfs",outputFormat:"application/json",categoryMap:{zone:["pdk:lokalplan_vedtaget","pdk:kommuneplanramme_vedtaget"]}});const Hn={qcy:"https://dev.qaecy.com/ont#","qcy-e":"https://dev.qaecy.com/enum#","qcy-l":"https://dev.qaecy.com/logs#","qcy-f":"https://dev.qaecy.com/functions#",obc:"https://w3id.org/obc#",dicc:"https://w3id.org/digitalconstruction/0.5/Contexts#",dicv:"https://w3id.org/digitalconstruction/0.5/Variables#",dice:"https://w3id.org/digitalconstruction/0.5/Entities#",dicp:"https://w3id.org/digitalconstruction/0.5/Processes#",dica:"https://w3id.org/digitalconstruction/0.5/Agents#",dici:"https://w3id.org/digitalconstruction/0.5/Information#",dicbm:"https://w3id.org/digitalconstruction/0.5/Materials#",dicob:"https://w3id.org/digitalconstruction/0.5/Occupancy#",dicl:"https://w3id.org/digitalconstruction/0.5/Lifecycle#",dices:"https://w3id.org/digitalconstruction/0.5/Energy#",dicu:"https://w3id.org/digitalconstruction/0.5/Units#",diclvl:"https://w3id.org/digitalconstruction/0.5/Levels#",dicstg:"https://w3id.org/digitalconstruction/0.5/Stages#"},Gl={madsrdf:"http://www.loc.gov/mads/rdf/v1#",bflc:"http://id.loc.gov/ontologies/bflc/",foaf:"http://xmlns.com/foaf/0.1/",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",dbo:"http://dbpedia.org/ontology/",rdfs:"http://www.w3.org/2000/01/rdf-schema#",yago:"http://yago-knowledge.org/resource/",dc:"http://purl.org/dc/elements/1.1/",dbp:"http://dbpedia.org/property/",owl:"http://www.w3.org/2002/07/owl#",ex:"http://example.org/",gr:"http://purl.org/goodrelations/v1#",skos:"http://www.w3.org/2004/02/skos/core#",spacerel:"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/",geo:"http://www.opengis.net/ont/geosparql#",xsd:"http://www.w3.org/2001/XMLSchema#",dcat:"http://www.w3.org/ns/dcat#",org:"http://www.w3.org/ns/org#",dct:"http://purl.org/dc/terms/",qb:"http://purl.org/linked-data/cube#",dcterms:"http://purl.org/dc/terms/",prov:"http://www.w3.org/ns/prov#",sioc:"http://rdfs.org/sioc/ns#",xtypes:"http://purl.org/xtypes/",dbpedia:"http://dbpedia.org/resource/",schema:"http://schema.org/",ont:"http://purl.org/net/ns/ontology-annot#",void:"http://rdfs.org/ns/void#",onto:"http://www.ontotext.com/",sio:"http://semanticscience.org/resource/",bf:"http://id.loc.gov/ontologies/bibframe/",search:"http://sindice.com/vocab/search#",obo:"http://purl.obolibrary.org/obo/",sd:"http://www.w3.org/ns/sparql-service-description#",dcterm:"http://purl.org/dc/terms/",frbr:"http://purl.org/vocab/frbr/core#",stat:"http://www.w3.org/ns/posix/stat#",vcard:"http://www.w3.org/2006/vcard/ns#",commerce:"http://search.yahoo.com/searchmonkey/commerce/",bibo:"http://purl.org/ontology/bibo/",rss:"http://purl.org/rss/1.0/",dbr:"http://dbpedia.org/resource/",gldp:"http://www.w3.org/ns/people#",pto:"http://www.productontology.org/id/",geonames:"http://www.geonames.org/ontology#",fb:"http://rdf.freebase.com/ns/",event:"http://purl.org/NET/c4dm/event.owl#",oo:"http://purl.org/openorg/",wd:"http://www.wikidata.org/entity/",dcmit:"http://purl.org/dc/dcmitype/",content:"http://purl.org/rss/1.0/modules/content/",cc:"http://creativecommons.org/ns#",gen:"http://purl.org/gen/0.1#",doap:"http://usefulinc.com/ns/doap#",http:"http://www.w3.org/2011/http#",dbpprop:"http://dbpedia.org/property/",vann:"http://purl.org/vocab/vann/",rr:"http://www.w3.org/ns/r2rml#",swrc:"http://swrc.ontoware.org/ontology#",drugbank:"http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/",md:"http://www.w3.org/ns/md#",sc:"http://purl.org/science/owl/sciencecommons/",nie:"http://www.semanticdesktop.org/ontologies/2007/01/19/nie#",prog:"http://purl.org/prog/",wot:"http://xmlns.com/wot/0.1/",ma:"http://www.w3.org/ns/ma-ont#",akt:"http://www.aktors.org/ontology/portal#",fn:"http://www.w3.org/2005/xpath-functions#",cv:"http://rdfs.org/resume-rdf/",aiiso:"http://purl.org/vocab/aiiso/schema#",tl:"http://purl.org/NET/c4dm/timeline.owl#",swc:"http://data.semanticweb.org/ns/swc/ontology#",ov:"http://open.vocab.org/terms/",as:"https://www.w3.org/ns/activitystreams#",crm:"http://www.cidoc-crm.org/cidoc-crm/",ical:"http://www.w3.org/2002/12/cal/ical#",daia:"http://purl.org/ontology/daia/",vs:"http://www.w3.org/2003/06/sw-vocab-status/ns#",xhtml:"http://www.w3.org/1999/xhtml#",earl:"http://www.w3.org/ns/earl#",rel:"http://purl.org/vocab/relationship/",bio:"http://purl.org/vocab/bio/0.1/",rdfg:"http://www.w3.org/2004/03/trix/rdfg-1/",marcrel:"http://id.loc.gov/vocabulary/relators/",mo:"http://purl.org/ontology/mo/",leaks:"https://cuzin.com/",dv:"http://rdf.data-vocabulary.org/#",cs:"http://purl.org/vocab/changeset/schema#",ad:"http://schemas.talis.com/2005/address/schema#",xhv:"http://www.w3.org/1999/xhtml/vocab#",co:"http://purl.org/ontology/co/core#",dc11:"http://purl.org/dc/elements/1.1/",prop:"http://dbpedia.org/property/",bill:"http://www.rdfabout.com/rdf/schema/usbill/",og:"http://opengraphprotocol.org/schema/",afn:"http://jena.apache.org/ARQ/function#",factbook:"http://wifo5-04.informatik.uni-mannheim.de/factbook/ns#",dbowl:"http://ontology.cybershare.utep.edu/dbowl/relational-to-ontology-mapping-primitive.owl#",air:"http://dig.csail.mit.edu/TAMI/2007/amord/air#",test2:"http://this.invalid/test2#",musim:"http://purl.org/ontology/similarity/",unit:"http://qudt.org/vocab/unit/",log:"http://www.w3.org/2000/10/swap/log#",book:"http://purl.org/NET/book/vocab#",xs:"http://www.w3.org/2001/XMLSchema#",mu:"http://mu.semte.ch/vocabularies/core/",ir:"http://www.ontologydesignpatterns.org/cp/owl/informationrealization.owl#",media:"http://search.yahoo.com/searchmonkey/media/",d2rq:"http://www.wiwiss.fu-berlin.de/suhl/bizer/D2RQ/0.1#",dcq:"http://purl.org/dc/qualifiers/1.0/",xfn:"http://gmpg.org/xfn/11#",biblio:"http://purl.org/net/biblio#",reco:"http://purl.org/reco#",xf:"http://www.w3.org/2002/xforms/",tag:"http://www.holygoat.co.uk/owl/redwood/0.1/tags/",cld:"http://purl.org/cld/terms/",cal:"http://www.w3.org/2002/12/cal/ical#",ome:"http://purl.org/ontomedia/core/expression#",ctag:"http://commontag.org/ns#",botany:"http://purl.org/NET/biol/botany#",dir:"http://schemas.talis.com/2005/dir/schema#",sism:"http://purl.oclc.org/NET/sism/0.1/",admin:"http://webns.net/mvcb/",days:"http://ontologi.es/days#",xmp:"http://ns.adobe.com/xap/1.0/",rif:"http://www.w3.org/2007/rif#",dcam:"http://purl.org/dc/dcam/",tzont:"http://www.w3.org/2006/timezone#",af:"http://purl.org/ontology/af/",osag:"http://www.ordnancesurvey.co.uk/ontology/AdministrativeGeography/v2.0/AdministrativeGeography.rdf#",rev:"http://purl.org/stuff/rev#",qudt:"http://qudt.org/schema/qudt/",sr:"http://www.openrdf.org/config/repository/sail#",time:"http://www.w3.org/2006/time#",pc:"http://purl.org/procurement/public-contracts#",myspace:"http://purl.org/ontology/myspace#",math:"http://www.w3.org/2000/10/swap/math#",cmp:"http://www.ontologydesignpatterns.org/cp/owl/componency.owl#",memo:"http://ontologies.smile.deri.ie/2009/02/27/memo#",ok:"http://okkam.org/terms#",lomvoc:"http://ltsc.ieee.org/rdf/lomv1p0/vocabulary#",giving:"http://ontologi.es/giving#",jdbc:"http://d2rq.org/terms/jdbc/",swanq:"http://purl.org/swan/1.2/qualifiers/",dcn:"http://www.w3.org/2007/uwa/context/deliverycontext.owl#",sdmx:"http://purl.org/linked-data/sdmx#",cfp:"http://sw.deri.org/2005/08/conf/cfp.owl#",swande:"http://purl.org/swan/1.2/discourse-elements/",omn:"http://open-multinet.info/ontology/omn#",owlim:"http://www.ontotext.com/trree/owlim#",cyc:"http://sw.opencyc.org/concept/",gn:"http://www.geonames.org/ontology#",con:"http://www.w3.org/2000/10/swap/pim/contact#",lyou:"http://purl.org/linkingyou/",skosxl:"http://www.w3.org/2008/05/skos-xl#",oa:"http://www.w3.org/ns/oa#",openlinks:"http://www.openlinksw.com/schemas/virtrdf#",cdm:"http://publications.europa.eu/ontology/cdm#",sdmxdim:"http://purl.org/linked-data/sdmx/2009/dimension#",adms:"http://www.w3.org/ns/adms#",type:"https://webiomed.ai/blog/obzor-rossiiskikh-sistem-podderzhki-priniatiia-vrachebnykh-reshenii/",om:"http://opendata.caceres.es/def/ontomunicipio#",nif:"http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#",ontology:"http://dbpedia.org/ontology/",db:"http://dbpedia.org/",photoshop:"http://ns.adobe.com/photoshop/1.0/",wfs:"http://schemas.opengis.net/wfs/",lemon:"http://lemon-model.net/lemon#",exif:"http://www.w3.org/2003/12/exif/ns#",gvp:"http://vocab.getty.edu/ontology#",ac:"http://umbel.org/umbel/ac/",isbd:"http://iflastandards.info/ns/isbd/elements/",sdmxa:"http://purl.org/linked-data/sdmx/2009/attribute#",xsi:"http://www.w3.org/2001/XMLSchema-instance#",aat:"http://vocab.getty.edu/aat/",fabio:"http://purl.org/spar/fabio/",sh:"http://www.w3.org/ns/shacl#",cert:"http://www.w3.org/ns/auth/cert#",wdt:"http://www.wikidata.org/prop/direct/",dul:"http://www.ontologydesignpatterns.org/ont/dul/DUL.owl#",prism:"http://prismstandard.org/namespaces/basic/2.0/",swrl:"http://www.w3.org/2003/11/swrl#",test:"https://test4.example.com/",cnt:"http://www.w3.org/2011/content#",eat:"http://www.eat.rl.ac.uk/#",tgn:"http://vocab.getty.edu/tgn/",ulan:"http://vocab.getty.edu/ulan/",edm:"http://www.europeana.eu/schemas/edm/",sf:"http://www.opengis.net/ont/sf#",ore:"http://www.openarchives.org/ore/terms/",swrcfe:"http://www.morelab.deusto.es/ontologies/swrcfe#",gtfs:"http://vocab.gtfs.org/terms#",voaf:"http://purl.org/vocommons/voaf#",uniprot:"http://purl.uniprot.org/uniprot/",core:"http://vivoweb.org/ontology/core#",swrlb:"http://www.w3.org/2003/11/swrlb#",eg:"http://www.example.org/",nfo:"http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#",room:"http://vocab.deri.ie/rooms#",ssn:"http://www.w3.org/ns/ssn/",dbc:"http://dbpedia.org/resource/Category:",go:"http://purl.obolibrary.org/obo/GO_",scovo:"http://purl.org/NET/scovo#",lv:"http://purl.org/lobid/lv#",ceo:"https://linkeddata.cultureelerfgoed.nl/def/ceo#",music:"http://musicontology.com/",dbprop:"http://dbpedia.org/property/",movie:"http://data.linkedmdb.org/resource/movie/",fise:"http://fise.iks-project.eu/ontology/",xml:"http://www.w3.org/XML/1998/namespace/",bif:"http://www.openlinksw.com/schemas/bif#",ldp:"http://www.w3.org/ns/ldp#",sioct:"http://rdfs.org/sioc/types#",wikidata:"http://www.wikidata.org/entity/",siocserv:"http://rdfs.org/sioc/services#",itsrdf:"http://www.w3.org/2005/11/its/rdf#",lexinfo:"http://www.lexinfo.net/ontology/3.0/lexinfo#",ro:"http://purl.org/wf4ever/ro#",geoes:"http://geo.linkeddata.es/ontology/",ping:"https://namso-gen.com/",am:"http://vocab.deri.ie/am#",gndo:"http://d-nb.info/standards/elementset/gnd#",coref:"http://www.rkbexplorer.com/ontologies/coref#",pat:"http://purl.org/hpi/patchr#",ptr:"http://www.w3.org/2009/pointers#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/",nmo:"http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#",mods:"http://www.loc.gov/mods/v3#",loc:"http://purl.org/ontomedia/core/space#",dblp:"http://dblp.uni-trier.de/rdf/schema-2015-01-26#",nao:"http://www.semanticdesktop.org/ontologies/2007/08/15/nao#",acc:"http://purl.org/NET/acc#",nsogi:"http://prefix.cc/nsogi:",gnd:"http://d-nb.info/gnd/",pmlj:"http://inference-web.org/2.0/pml-justification.owl#",dce:"http://purl.org/dc/elements/1.1/",chebi:"http://purl.obolibrary.org/obo/CHEBI_",wp:"http://vocabularies.wikipathways.org/",product:"http://purl.org/commerce/product#",whois:"http://www.kanzaki.com/ns/whois#",bd:"http://www.bigdata.com/rdf#",imm:"http://schemas.microsoft.com/imm/",sparql:"http://www.w3.org/ns/sparql#",gold:"http://purl.org/linguistics/gold/",doc:"http://www.w3.org/2000/10/swap/pim/doc#",leak:"http://maco.com/",up:"http://purl.uniprot.org/core/",cerif:"http://spi-fm.uca.es/neologism/cerif#",rec:"http://purl.org/ontology/rec/core#",gd:"http://rdf.data-vocabulary.org/#",sdo:"https://schema.org/",list:"http://www.w3.org/2000/10/swap/list#",georss:"http://www.georss.org/georss/",sec:"https://w3id.org/security#",java:"http://www.w3.org/2007/uwa/context/java.owl#",meta:"https://krr.triply.cc/krr/sameas-meta/def/",rsa:"http://www.w3.org/ns/auth/rsa#",space:"http://purl.org/net/schemas/space/",ti:"http://www.ontologydesignpatterns.org/cp/owl/timeinterval.owl#",example:"http://www.example.org/rdf#",opm:"https://w3id.org/opm#",xlink:"https://es.scribd.com/doc/79794476/05-Ejercicios-Resueltos-Caja-Negra-y-Recapitulacion/",lgd:"http://linkedgeodata.org/triplify/",cube:"https://cube.link/",akts:"http://www.aktors.org/ontology/support#",geosparql:"http://www.opengis.net/ont/geosparql#",ms:"http://purl.org/obo/owl/MS#",wiki:"http://en.wikipedia.org/wiki/",penn:"http://purl.org/olia/penn.owl#",iot:"http://iotschema.org/",bp:"http://www.biopax.org/release/biopax-level3.owl#",mf:"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#",acl:"http://www.w3.org/ns/auth/acl#",geof:"http://www.opengis.net/def/function/geosparql/",hg:"http://rdf.histograph.io/",pext:"http://www.ontotext.com/proton/protonext#",video:"http://purl.org/ontology/video#",rdfsharp:"https://rdfsharp.codeplex.com/",cro:"http://rhizomik.net/ontologies/copyrightonto.owl#",cito:"http://purl.org/spar/cito/",sim:"http://www.w3id.org/simulation/ontology/",vivo:"http://vivoweb.org/ontology/core#",st:"http://ns.inria.fr/sparql-template/",httph:"http://www.w3.org/2007/ont/httph#",kb:"http://deductions.sf.net/ontology/knowledge_base.owl#",api:"http://purl.org/linked-data/api/vocab#",dbpediaowl:"http://dbpedia.org/owl/",sp:"http://spinrdf.org/sp#",nt:"http://ns.inria.fr/nicetag/2010/09/09/voc#",wn:"http://xmlns.com/wordnet/1.6/",nco:"http://www.semanticdesktop.org/ontologies/2007/03/22/nco#",acm:"http://www.rkbexplorer.com/ontologies/acm#",xl:"http://langegger.at/xlwrap/vocab#",pim:"http://www.w3.org/ns/pim/space#",exterms:"http://www.example.org/terms/",web:"http://www.w3.org/2007/uwa/context/web.owl#",wgs:"http://www.w3.org/2003/01/geo/wgs84_pos#",dcatapit:"http://dati.gov.it/onto/dcatapit#",atom:"http://www.w3.org/2005/Atom/",olia:"http://purl.org/olia/olia.owl#",bag:"https://bag2.basisregistraties.overheid.nl/bag/def/",cgov:"http://reference.data.gov.uk/def/central-government/",overheid:"http://standaarden.overheid.nl/owms/",sider:"http://www4.wiwiss.fu-berlin.de/sider/resource/sider/",po:"http://purl.org/ontology/po/",lode:"http://linkedevents.org/ontology/",postcode:"http://data.ordnancesurvey.co.uk/id/postcodeunit/",ocd:"http://dati.camera.it/ocd/",sirext:"http://t.me/sirextt/247:",urn:"http://fliqz.com/",pgterms:"http://www.gutenberg.org/2009/pgterms/",dbnary:"http://kaiko.getalp.org/dbnary#",abc:"http://www.metadata.net/harmony/ABCSchemaV5Commented.rdf#",dbkwik:"http://dbkwik.webdatacommons.org/",cidoc:"http://www.cidoc-crm.org/cidoc-crm/",dco:"http://info.deepcarbon.net/schema#",seas:"https://w3id.org/seas/",pav:"http://purl.org/pav/",wdrs:"http://www.w3.org/2007/05/powder-s#",formats:"http://www.w3.org/ns/formats/",service:"http://purl.org/ontology/service#",ean:"http://openean.kaufkauf.net/id/",eu:"http://eulersharp.sourceforge.net/2003/03swap/log-rules#",zoology:"http://purl.org/NET/biol/zoology#",cpa:"http://www.ontologydesignpatterns.org/schemas/cpannotationschema.owl#",ass:"http://uptheasset.org/ontology#",purl:"http://www.purl.org/",lime:"http://www.w3.org/ns/lemon/lime#",admingeo:"http://data.ordnancesurvey.co.uk/ontology/admingeo/",wn20schema:"http://www.w3.org/2006/03/wn/wn20/schema/",smf:"http://topbraid.org/sparqlmotionfunctions#",ecs:"http://rdf.ecs.soton.ac.uk/ontology/ecs#",prv:"http://purl.org/net/provenance/ns#",gsp:"http://www.opengis.net/ont/geosparql#",daml:"http://www.daml.org/2001/03/daml+oil#",dcm:"http://purl.org/dc/dcmitype/",rdfdf:"http://www.openlinksw.com/virtrdf-data-formats#",pr:"http://purl.org/ontology/prv/core#",ontolex:"http://www.w3.org/ns/lemon/ontolex#",role:"https://w3id.org/role/",resource:"http://dbpedia.org/resource/",swid:"http://semanticweb.org/id/",edam:"http://edamontology.org/",ya:"http://blogs.yandex.ru/schema/foaf/",irw:"http://www.ontologydesignpatterns.org/ont/web/irw.owl#",name:"http://example.org/name#",greg:"http://kasei.us/about/foaf.xrdf#",hydra:"http://www.w3.org/ns/hydra/core#",spin:"http://spinrdf.org/spin#",ignf:"http://data.ign.fr/def/ignf#",scot:"http://rdfs.org/scot/ns#",ndl:"http://schemas.ogf.org/nml/2013/05/base#",wo:"http://purl.org/ontology/wo/",xkos:"http://rdf-vocabulary.ddialliance.org/xkos#",omt:"http://purl.org/ontomedia/ext/common/trait#",pmt:"http://tipsy.googlecode.com/svn/trunk/vocab/pmt#",user:"http://schemas.talis.com/2005/user/schema#",umbelrc:"http://umbel.org/umbel/rc/",wikipedia:"https://en.wikipedia.org/wiki/",myspo:"http://purl.org/ontology/myspace#",agg:"http://purl.org/twc/health/vocab/aggregate/",organism:"http://eulersharp.sourceforge.net/2003/03swap/organism#",site:"http://ns.ontowiki.net/SysOnt/Site/",res:"http://dbpedia.org/resource/",sdl:"http://purl.org/vocab/riro/sdl#",euvoc:"http://publications.europa.eu/ontology/euvoc#",bmo:"http://collection.britishmuseum.org/id/ontology/",faldo:"http://biohackathon.org/resource/faldo#",blt:"http://www.bl.uk/schemas/bibliographic/blterms#",sesame:"http://www.openrdf.org/schema/sesame#",resist:"http://www.rkbexplorer.com/ontologies/resist#",iao:"http://purl.obolibrary.org/obo/IAO_",inno:"http://purl.org/innovation/ns#",premis:"http://www.loc.gov/premis/rdf/v3/",bing:"http://bing.com/schema/media/",label:"http://purl.org/net/vocab/2004/03/label#",prj:"http://purl.org/stuff/project/",npg:"http://ns.nature.com/terms/",fresnel:"http://www.w3.org/2004/09/fresnel#",omb:"http://purl.org/ontomedia/ext/common/being#",rov:"http://www.w3.org/ns/regorg#",saref:"https://saref.etsi.org/core/",biol:"http://purl.org/NET/biol/ns#",iso:"http://purl.org/iso25964/skos-thes#",bibframe:"http://id.loc.gov/ontologies/bibframe/",won:"https://w3id.org/won/core#",link:"http://www.w3.org/2007/ont/link#",audio:"http://purl.org/media/audio#",tmo:"http://www.semanticdesktop.org/ontologies/2008/05/20/tmo#",sit:"http://www.ontologydesignpatterns.org/cp/owl/situation.owl#",fed:"http://www.openrdf.org/config/sail/federation#",swp:"http://www.w3.org/2004/03/trix/swp-2/",biocore:"http://bio2rdf.org/core#",mm:"http://linkedmultimedia.org/sparql-mm/ns/2.0.0/function#",umbel:"http://umbel.org/umbel#",phil:"http://philosurfical.open.ac.uk/ontology/philosurfical.owl#",uco:"http://purl.org/uco/ns#",wgs84:"http://www.w3.org/2003/01/geo/wgs84_pos#",food:"http://purl.org/foodontology#",cordis:"http://cordis.europa.eu/projects/",rdau:"http://rdaregistry.info/Elements/u/",gist:"http://ontologies.semanticarts.com/gist#",ero:"http://purl.obolibrary.org/obo/",wv:"http://vocab.org/waiver/terms/",ref:"http://purl.org/vocab/relationship/",sml:"https://w3id.org/sml/def#",oad:"http://lod.xdams.org/reload/oad/",spl:"http://spinrdf.org/spl#",lx:"http://purl.org/NET/lx#",es:"http://eulersharp.sourceforge.net/2003/03swap/log-rules#",conv:"http://purl.org/twc/vocab/conversion/",ps:"https://w3id.org/payswarm#",acco:"http://purl.org/acco/ns#",code:"http://telegraphis.net/ontology/measurement/code#",sco:"http://purl.org/ontology/sco#",rnews:"http://iptc.org/std/rNews/2011-10-07#",ub:"http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#",protege:"http://protege.stanford.edu/system#",lgdo:"http://linkedgeodata.org/ontology/",oc:"http://opencoinage.org/rdf/",doac:"http://ramonantonio.net/doac/0.1/#",taxo:"http://purl.org/rss/1.0/modules/taxonomy/",rail:"http://ontologi.es/rail/vocab#",ludo:"http://ns.inria.fr/ludo/v1#",cpm:"http://catalogus-professorum.org/cpm/2/",opensearch:"http://a9.com/-/spec/opensearch/1.1/",so:"http://schema.org/",efo:"http://www.ebi.ac.uk/efo/",linkedmdb:"http://data.linkedmdb.org/",airport:"http://www.daml.org/2001/10/html/airport-ont#",bio2rdf:"http://bio2rdf.org/",spc:"http://purl.org/ontomedia/core/space#",meteo:"http://purl.org/ns/meteo#",bne:"http://datos.bne.es/resource/",awol:"http://bblfish.net/work/atom-owl/2006-06-06/#",dctype:"http://purl.org/dc/dcmitype/",omp:"http://purl.org/ontomedia/ext/common/profession#",granatum:"http://chem.deri.ie/granatum/",dwc:"http://rs.tdwg.org/dwc/terms/",lom:"http://ltsc.ieee.org/rdf/lomv1p0/lom#",disco:"http://rdf-vocabulary.ddialliance.org/discovery#",act:"http://www.w3.org/2007/rif-builtin-action#",taxon:"http://purl.org/biodiversity/taxon/",net:"http://www.w3.org/2007/uwa/context/network.owl#",gpt:"http://purl.org/vocab/riro/gpt#",mit:"http://purl.org/ontology/mo/mit#",isothes:"http://purl.org/iso25964/skos-thes#",lu:"http://www.ontologydesignpatterns.org/ont/framenet/abox/lu/",ao:"http://purl.org/ontology/ao/core#",sport:"http://purl.org/ontology/sport/",hp:"http://purl.org/voc/hp/",gso:"http://www.w3.org/2006/gen/ont#",xhe:"http://buzzword.org.uk/rdf/xhtml-elements#",frir:"http://purl.org/twc/ontology/frir.owl#",powder:"http://www.w3.org/2007/05/powder#",omm:"http://purl.org/ontomedia/core/media#",bibtex:"http://purl.org/net/nknouf/ns/bibtex#",wordnet:"http://wordnet-rdf.princeton.edu/ontology#",fec:"http://www.rdfabout.com/rdf/schema/usfec/",asn:"http://purl.org/ASN/schema/core/",tdb:"http://jena.hpl.hp.com/2008/tdb#",atomix:"http://buzzword.org.uk/rdf/atomix#",pbo:"http://purl.org/ontology/pbo/core#",orges:"http://datos.gob.es/def/sector-publico/organizacion#",rep:"http://www.openrdf.org/config/repository#",obj:"http://www.openrdf.org/rdf/2009/object#",library:"http://purl.org/library/",compass:"http://purl.org/net/compass#",lfm:"http://purl.org/ontology/last-fm/",crypto:"http://www.w3.org/2000/10/swap/crypto#",rdrel:"http://rdvocab.info/RDARelationshipsWEMI/",doclist:"http://www.junkwork.net/xml/DocumentList#",rei:"http://www.w3.org/2004/06/rei#",os:"http://www.w3.org/2000/10/swap/os#",vra:"http://purl.org/vra/",cheminf:"http://www.semanticweb.org/ontologies/cheminf.owl#",fbgeo:"http://rdf.freebase.com/ns/location/geocode/",mime:"https://www.iana.org/assignments/media-types/",muto:"http://purl.org/muto/core#",lang:"http://ontologi.es/lang/core#",pom:"http://maven.apache.org/POM/4.0.0#",txn:"http://lod.taxonconcept.org/ontology/txn.owl#",oauth:"http://demiblog.org/vocab/oauth#",affy:"http://www.affymetrix.com/community/publications/affymetrix/tmsplice#",ire:"http://www.ontologydesignpatterns.org/cpont/ire.owl#",ngeo:"http://geovocab.org/geometry#",ddc:"http://purl.org/NET/decimalised#",money:"http://purl.org/net/rdf-money/",conversion:"http://purl.org/twc/vocab/conversion/",game:"http://data.totl.net/game/",eco:"http://www.ebusiness-unibw.org/ontologies/eclass/5.1.4/#",custom:"http://www.openrdf.org/config/sail/custom#",vocab:"http://rdf.ontology2.com/vocab#",swh:"http://plugin.org.uk/swh-plugins/",soft:"http://www.w3.org/2007/uwa/context/software.owl#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",xen:"http://buzzword.org.uk/rdf/xen#",hard:"http://www.w3.org/2007/uwa/context/hardware.owl#",lfn:"http://www.dotnetrdf.org/leviathan#",nrl:"http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#",politico:"http://www.rdfabout.com/rdf/schema/politico/",dailymed:"http://www4.wiwiss.fu-berlin.de/dailymed/resource/dailymed/",vsr:"http://purl.org/twc/vocab/vsr#",string:"http://www.w3.org/2000/10/swap/string#",bib:"http://zeitkunst.org/bibtex/0.1/bibtex.owl#",bfo:"http://purl.obolibrary.org/obo/",sede:"http://eventography.org/sede/0.1/",omc:"http://purl.org/ontomedia/ext/common/bestiary#",climb:"http://climb.dataincubator.org/vocabs/climb/",usgov:"http://www.rdfabout.com/rdf/schema/usgovt/",ct:"http://data.linkedct.org/resource/linkedct/",interval:"http://reference.data.gov.uk/def/intervals/",bbc:"http://www.bbc.co.uk/ontologies/news/",soc:"http://purl.org/net/hdlipcores/ontology/soc#",locn:"http://www.w3.org/ns/locn#",stanford:"http://purl.org/olia/stanford.owl#",cycann:"http://sw.cyc.com/CycAnnotations_v1#",aos:"http://rdf.muninn-project.org/ontologies/appearances#",apivc:"http://purl.org/linked-data/api/vocab#",aifb:"http://www.aifb.kit.edu/id/",person:"http://www.w3.org/ns/person#",ui:"http://www.w3.org/ns/ui#",scv:"http://purl.org/NET/scovo#",rdac:"http://rdaregistry.info/Elements/c/",deo:"http://purl.org/spar/deo/",isq:"http://purl.org/ontology/is/quality/",coo:"http://purl.org/coo/ns#",bsb:"http://opacplus.bsb-muenchen.de/title/",coin:"http://purl.org/court/def/2009/coin#",eli:"http://data.europa.eu/eli/ontology#",sv:"http://schemas.talis.com/2005/service/schema#",biopax:"http://www.biopax.org/release/biopax-level3.owl#",xro:"http://purl.org/xro/ns#",dnr:"http://www.dotnetrdf.org/configuration#",pro:"http://purl.org/hpi/patchr#",sosa:"http://www.w3.org/ns/sosa/",vso:"http://purl.org/vso/ns#",mysql:"http://web-semantics.org/ns/mysql/",courseware:"http://courseware.rkbexplorer.com/ontologies/courseware#",lvont:"http://lexvo.org/ontology#",is:"http://purl.org/ontology/is/core#",xds:"http://www.w3.org/2001/XMLSchema#",zem:"http://s.zemanta.com/ns#",rs:"http://rightsstatements.org/vocab/",arch:"http://purl.org/archival/vocab/arch#",cex:"http://purl.org/weso/ontology/computex#",com:"http://purl.org/commerce#",arg:"http://rdfs.org/sioc/argument#",push:"http://www.w3.org/2007/uwa/context/push.owl#",ic:"http://imi.go.jp/ns/core/rdf#",chord:"http://purl.org/ontology/chord/",pdo:"http://ontologies.smile.deri.ie/pdo#",yoda:"http://purl.org/NET/yoda#",dt:"http://w3id.org/dt#",isi:"http://purl.org/ontology/is/inst/",gob:"http://purl.org/ontology/last-fm/",gml:"http://www.opengis.net/ont/gml#",worldbank:"http://worldbank.270a.info/dataset/",states:"http://www.w3.org/2005/07/aaa#",prot:"http://www.proteinontology.info/po.owl#",moat:"http://moat-project.org/ns#",uri:"http://purl.org/NET/uri#",dbpp:"http://dbpedia.org/property/",dso:"http://purl.org/ontology/dso#",muo:"http://purl.oclc.org/NET/muo/muo#",ttl:"http://www.w3.org/2008/turtle#",cpv:"http://purl.org/weso/cpv/",city:"http://datos.localidata.com/def/City#",pmlr:"http://inference-web.org/2.0/pml-relation.owl#",dady:"http://purl.org/NET/dady#",ist:"http://purl.org/ontology/is/types/",conserv:"http://conserv.deri.ie/ontology#",pos:"http://www.w3.org/2003/01/geo/wgs84_pos#",wdr:"http://www.w3.org/2007/05/powder#",freebase:"http://rdf.freebase.com/ns/",cogs:"http://vocab.deri.ie/cogs#",swanco:"http://purl.org/swan/1.2/swan-commons/",resex:"http://resex.rkbexplorer.com/ontologies/resex#",fea:"http://vocab.data.gov/def/fea#",odrl:"http://www.w3.org/ns/odrl/2/",lex:"http://purl.org/lex#",article:"http://ogp.me/ns/article#",dcmitype:"http://purl.org/dc/dcmitype/",profiling:"http://ontologi.es/profiling#",payment:"http://reference.data.gov.uk/def/payment#",xforms:"http://www.w3.org/2002/xforms/",nexif:"http://www.semanticdesktop.org/ontologies/2007/05/10/nexif#",viaf:"http://viaf.org/viaf/",tio:"http://purl.org/tio/ns#",nsa:"http://multimedialab.elis.ugent.be/organon/ontologies/ninsuna#",hlisting:"http://sindice.com/hlisting/0.1/",voag:"http://voag.linkedmodel.org/schema/voag#",posh:"http://poshrdf.org/ns/posh/",address:"http://schemas.talis.com/2005/address/schema#",lotico:"http://www.lotico.com/resource/",swivt:"http://semantic-mediawiki.org/swivt/1.0#",opo:"http://online-presence.net/opo/ns#",toby:"http://tobyinkster.co.uk/#",evset:"http://dsnotify.org/vocab/eventset/0.1/",psys:"http://proton.semanticweb.org/protonsys#",rlog:"http://persistence.uni-leipzig.org/nlp2rdf/ontologies/rlog#",cos:"http://www.inria.fr/acacia/corese#",vote:"http://www.rdfabout.com/rdf/schema/vote/",meetup:"http://www.lotico.com/meetup/",rooms:"http://vocab.deri.ie/rooms#",pay:"http://reference.data.gov.uk/def/payment#",puc:"http://purl.org/NET/puc#",anca:"http://users.utcluj.ro/~raluca/rdf_ontologies_ralu/ralu_modified_ontology_pizzas2_0#",lifecycle:"http://purl.org/vocab/lifecycle/schema#",bsbm:"http://www4.wiwiss.fu-berlin.de/bizer/bsbm/v01/vocabulary/",wlp:"http://weblab-project.org/core/model/property/processing/",datafaqs:"http://purl.org/twc/vocab/datafaqs#",sail:"http://www.openrdf.org/config/sail#",teach:"http://linkedscience.org/teach/ns#",common:"http://www.w3.org/2007/uwa/context/common.owl#",sysont:"http://ns.ontowiki.net/SysOnt/",ldap:"http://purl.org/net/ldap/",rda:"http://www.rdaregistry.info/",wi:"http://purl.org/ontology/wi/core#",lingvoj:"http://www.lingvoj.org/ontology#",p3p:"http://www.w3.org/2002/01/p3prdfv1#",tags:"http://www.holygoat.co.uk/owl/redwood/0.1/tags/",lp:"http://launchpad.net/rdf/launchpad#",rdfa:"http://www.w3.org/ns/rdfa#",dcr:"http://www.isocat.org/ns/dcr.rdf#",swanqs:"http://purl.org/swan/1.2/qualifiers/",fab:"http://purl.org/fab/ns#",eclap:"http://www.eclap.eu/schema/eclap/",ddl:"http://purl.org/vocab/riro/ddl#",nuts:"http://dd.eionet.europa.eu/vocabulary/common/nuts/",like:"http://ontologi.es/like#",sem:"http://semanticweb.cs.vu.nl/2009/11/sem/",psych:"http://purl.org/vocab/psychometric-profile/",oboinowl:"http://www.geneontology.org/formats/oboInOwl#",enc:"http://www.w3.org/2001/04/xmlenc#",ann:"http://www.w3.org/2000/10/annotation-ns#",wnschema:"http://www.cogsci.princeton.edu/~wn/schema/",bte:"http://purl.org/twc/vocab/between-the-edges/",wai:"http://purl.org/wai#",pobo:"http://purl.obolibrary.org/obo/",cdt:"https://w3id.org/cdt/",cmo:"http://purl.org/twc/ontologies/cmo.owl#",oslc:"http://open-services.net/ns/core#",kwijibo:"http://kwijibo.talis.com/",play:"http://uriplay.org/spec/ontology/#",br:"http://vocab.deri.ie/br#",algo:"http://securitytoolbox.appspot.com/securityAlgorithms#",eztag:"http://ontologies.ezweb.morfeo-project.org/eztag/ns#",drug:"http://www.agfa.com/w3c/2009/drugTherapy#",care:"http://eulersharp.sourceforge.net/2003/03swap/care#",vitro:"http://vitro.mannlib.cornell.edu/ns/vitro/public#",oboe:"http://ecoinformatics.org/oboe/oboe.1.0/oboe-core.owl#",bridge:"http://purl.org/vocommons/bridge#",irrl:"http://www.ontologydesignpatterns.org/cp/owl/informationobjectsandrepresentationlanguages.owl#",prissma:"http://ns.inria.fr/prissma/v1#",lastfm:"http://purl.org/ontology/last-fm/",sl:"http://www.semanlink.net/2001/00/semanlink-schema#",pol:"http://escience.rpi.edu/ontology/semanteco/2/0/pollution.owl#",mei:"http://www.music-encoding.org/ns/mei/",ogp:"http://ogp.me/ns#",mygrid:"http://www.mygrid.org.uk/ontology#",fo:"http://www.w3.org/1999/XSL/Format#",esd:"http://def.esd.org.uk/",r2rml:"http://www.w3.org/ns/r2rml#",grddl:"http://www.w3.org/2003/g/data-view#",phss:"http://ns.poundhill.com/phss/1.0/",oat:"http://openlinksw.com/schemas/oat/",fls:"http://lukasblaho.sk/football_league_schema#",olo:"http://purl.org/ontology/olo/core#",h5:"http://buzzword.org.uk/rdf/h5#",uni:"http://purl.org/weso/uni/uni.html#",wordmap:"http://purl.org/net/ns/wordmap#",tarot:"http://data.totl.net/tarot/card/",iswc:"http://annotation.semanticweb.org/2004/iswc#",sm:"http://topbraid.org/sparqlmotion#",b2bo:"http://purl.org/b2bo#",hospital:"http://www.agfa.com/w3c/2009/hospital#",swandr:"http://purl.org/swan/1.2/discourse-relationships/",remus:"http://www.semanticweb.org/ontologies/2010/6/Ontology1279614123500.owl#",osn:"http://spatial.ucd.ie/lod/osn/",ezcontext:"http://ontologies.ezweb.morfeo-project.org/ezcontext/ns#",lt:"http://diplomski.nelakolundzija.org/LTontology.rdf#",ne:"http://umbel.org/umbel/ne/",smiley:"http://www.smileyontology.com/ns#",calli:"http://callimachusproject.org/rdf/2009/framework#",places:"http://purl.org/ontology/places#",ibis:"http://purl.org/ibis#",sioca:"http://rdfs.org/sioc/actions#",geom:"http://data.ign.fr/def/geometrie#",hcterms:"http://purl.org/uF/hCard/terms/",human:"http://eulersharp.sourceforge.net/2003/03swap/human#",rulz:"http://purl.org/NET/rulz#",rdagr1:"http://rdvocab.info/Elements/",pimo:"http://www.semanticdesktop.org/ontologies/2007/11/01/pimo#",countries:"http://eulersharp.sourceforge.net/2003/03swap/countries#",recipe:"http://linkedrecipes.org/schema/",oac:"https://w3id.org/oac#",ppo:"http://vocab.deri.ie/ppo#",cdc:"https://w3id.org/cdc#",status:"http://www.w3.org/2003/06/sw-vocab-status/ns#",httpvoc:"http://www.w3.org/2006/http#",data:"http://data.odw.tw/",aapi:"http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#",session:"http://redfoot.net/2005/session#",np:"http://www.nanopub.org/nschema#",omv:"http://omv.ontoware.org/2005/05/ontology#",card:"http://www.ashutosh.com/test/",reve:"http://data.eurecom.fr/ontology/reve#",sql:"http://ns.inria.fr/ast/sql#",icaltzd:"http://www.w3.org/2002/12/cal/icaltzd#",dnb:"http://d-nb.info/gnd/",san:"http://www.irit.fr/recherches/MELODI/ontologies/SAN#",wbc:"http://worldbank.270a.info/classification/",pml:"http://provenanceweb.org/ns/pml#",rdaa:"http://rdaregistry.info/Elements/a/",wfm:"http://purl.org/net/wf-motifs#",osoc:"http://web-semantics.org/ns/opensocial#",webtlab:"http://webtlab.it.uc3m.es/",tr:"http://www.thomsonreuters.com/",ebucore:"http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#",cao:"http://purl.org/makolab/caont/",esdir:"http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/direccion-postal#",xmls:"http://www.w3.org/2001/XMLSchema#",wgspos:"http://www.w3.org/2003/01/geo/wgs84_pos#",okkam:"http://models.okkam.org/ENS-core-vocabulary#",arpfo:"http://vocab.ouls.ox.ac.uk/projectfunding#",dbt:"http://dbpedia.org/resource/Template:",csvw:"http://www.w3.org/ns/csvw#",scsv:"http://purl.org/NET/schema-org-csv#",prf:"http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#",wisski:"http://wiss-ki.eu/",units:"http://eulersharp.sourceforge.net/2003/03swap/units#",wl:"http://www.wsmo.org/ns/wsmo-lite#",geospecies:"http://rdf.geospecies.org/ont/geospecies#",wsc:"http://www.openk.org/wscaim.owl#",opwn:"http://www.ontologyportal.org/WordNet.owl#",elog:"http://eulersharp.sourceforge.net/2003/03swap/log-rules#",ple:"http://pleiades.stoa.org/places/",zbwext:"http://zbw.eu/namespaces/zbw-extensions/",infosys:"http://www.infosys.com/",span:"http://www.ifomis.org/bfo/1.1/span#",derecho:"http://purl.org/derecho#",geofla:"http://data.ign.fr/ontologies/geofla#",mp:"http://jicamaro.info/mp#",agent:"http://eulersharp.sourceforge.net/2003/03swap/agent#",agents:"http://eulersharp.sourceforge.net/2003/03swap/agent#",imreg:"http://www.w3.org/2004/02/image-regions#",pmlt:"http://inference-web.org/2.0/pml-trust.owl#",pccz:"http://purl.org/procurement/public-contracts-czech#",wbp:"http://worldbank.270a.info/property/",agro:"http://purl.obolibrary.org/obo/agro.owl#",cb:"http://cbasewrap.ontologycentral.com/vocab#",gridworks:"http://purl.org/net/opmv/types/gridworks#",geographis:"http://telegraphis.net/ontology/geography/geography#",marl:"http://www.gsi.dit.upm.es/ontologies/marl/ns#",rdo:"http://purl.org/rdo/ns#",dita:"http://purl.org/dita/ns#",pmlp:"http://inference-web.org/2.0/pml-provenance.owl#",ncal:"http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#",qdoslf:"http://foaf.qdos.com/lastfm/schema/",plink:"http://buzzword.org.uk/rdf/personal-link-types#",opus:"http://lsdis.cs.uga.edu/projects/semdis/opus#",osgb:"http://data.ordnancesurvey.co.uk/id/",html:"http://www.w3.org/1999/xhtml/",kontakt:"http://richard.cyganiak.de/",qa:"http://www.mit.jyu.fi/ai/TRUST_Ontologies/QA.owl#",sindice:"http://vocab.sindice.net/",prefix:"http://prefix.cc/",provenir:"http://knoesis.wright.edu/provenir/provenir.owl#",shv:"http://ns.aksw.org/spatialHierarchy/",dis:"http://stanbol.apache.org/ontology/disambiguation/disambiguation#",open:"http://open.vocab.org/terms/",r2r:"http://www4.wiwiss.fu-berlin.de/bizer/r2r/",c4n:"http://vocab.deri.ie/c4n#",dsp:"http://purl.org/metainfo/terms/dsp#",pns:"http://data.press.net/ontology/stuff/",visit:"http://purl.org/net/vocab/2004/07/visit#",timeline:"http://purl.org/NET/c4dm/timeline.owl#",ncbitaxon:"http://purl.obolibrary.org/obo/NCBITaxon_",nid3:"http://www.semanticdesktop.org/ontologies/2007/05/10/nid3#",hxl:"http://hxl.humanitarianresponse.info/ns/#",organiz:"http://eulersharp.sourceforge.net/2003/03swap/organization#",wairole:"http://www.w3.org/2005/01/wai-rdf/GUIRoleTaxonomy#",dgtwc:"http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#",muni:"http://vocab.linkeddata.es/urbanismo-infraestructuras/territorio#",life:"http://life.deri.ie/schema/",swanpav:"http://purl.org/swan/1.2/pav/",dummy:"http://hello.com/",osr:"http://dati.senato.it/osr/",lr:"http://linkedrecipes.org/schema/",ens:"http://models.okkam.org/ENS-core-vocabulary.owl#",gv:"http://rdf.data-vocabulary.org/#",req:"http://purl.org/req/",agetec:"http://www.agetec.org/",frbre:"http://purl.org/vocab/frbr/extended#",prvtypes:"http://purl.org/net/provenance/types#",odp:"http://ontologydesignpatterns.org/",aair:"http://xmlns.notu.be/aair#",hemogram:"http://www.agfa.com/w3c/2009/hemogram#",out:"http://ontologies.hypios.com/out#",pubmed:"http://bio2rdf.org/pubmed_vocabulary:",meb:"http://rdf.myexperiment.org/ontologies/base/",vaem:"http://www.linkedmodel.org/schema/vaem#",xsl:"http://www.w3.org/1999/XSL/Transform#",nex:"http://www.nexml.org/2009/",set:"http://www.w3.org/2000/10/swap/set#",aims:"http://aims.fao.org/aos/common/",ecb:"http://ecb.270a.info/class/1.0/",xhtmlvocab:"http://www.w3.org/1999/xhtml/vocab/",copyright:"http://rhizomik.net/ontologies/copyrightonto.owl#",xt:"http://purl.org/twc/vocab/cross-topix#",un:"http://www.w3.org/2007/ont/unit#",parl:"https://id.parliament.uk/schema/",visko:"http://trust.utep.edu/visko/ontology/visko-operator-v3.owl#",fowl:"http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#",rdapo:"http://rdaregistry.info/Elements/p/object/",eprints:"http://eprints.org/ontology/",trackback:"http://madskills.com/public/xml/rss/module/trackback/",wao:"http://webtlab.it.uc3m.es/2010/10/WebAppsOntology#",pna:"http://data.press.net/ontology/asset/",tripfs:"http://purl.org/tripfs/2010/02#",lark1:"http://users.utcluj.ro/~raluca/ontology/Ontology1279614123500.owl#",carfo:"http://purl.org/carfo#",geodata:"http://sws.geonames.org/",grel:"http://users.ugent.be/~bjdmeest/function/grel.ttl#",spatial:"http://geovocab.org/spatial#",skip:"http://skipforward.net/skipforward/resource/",wapp:"http://ns.rww.io/wapp#",swanci:"http://purl.org/swan/1.2/citations/",ops:"https://w3id.org/ops#",eye:"http://jena.hpl.hp.com/Eyeball#",sdm:"https://w3id.org/okn/o/sdm#",emotion:"http://ns.inria.fr/emoca#",emp:"http://purl.org/ctic/empleo/oferta#",admssw:"http://purl.org/adms/sw/",archdesc:"http://archdesc.info/archEvent#",aneo:"http://akonadi-project.org/ontologies/aneo#",rv:"https://data.elsevier.com/research/schema/rv/",oper:"http://sweet.jpl.nasa.gov/2.0/mathOperation.owl#",fl:"http://eulersharp.sourceforge.net/2003/03swap/fl-rules#",rdam:"http://rdaregistry.info/Elements/m/",kdo:"http://kdo.render-project.eu/kdo#",ospost:"http://data.ordnancesurvey.co.uk/ontology/postcode/",fd:"http://foodable.co/ns/",fno:"https://w3id.org/function/ontology#",pne:"http://data.press.net/ontology/event/",soap:"http://www.w3.org/2003/05/soap-envelope/",gelo:"http://krauthammerlab.med.yale.edu/ontologies/gelo#",doco:"http://purl.org/spar/doco/",evopat:"http://ns.aksw.org/Evolution/",xesam:"http://freedesktop.org/standards/xesam/1.0/core#",dayta:"http://dayta.me/resource#",commons:"http://commons.psi.enakting.org/def/",nsl:"http://purl.org/ontology/storyline/",prolog:"http://eulersharp.sourceforge.net/2003/03swap/prolog#",dtype:"http://www.linkedmodel.org/schema/dtype#",languages:"http://eulersharp.sourceforge.net/2003/03swap/languages#",sdgp:"http://stats.data-gov.ie/property/",metalex:"http://www.metalex.eu/schema/1.0#",hgnc:"http://bio2rdf.org/hgnc:",ipad:"http://www.padinthecity.com/",xfnv:"http://vocab.sindice.com/xfn#",dive:"http://scubadive.networld.to/dive.rdf#",pam:"http://prismstandard.org/namespaces/pam/2.0/",re:"http://www.w3.org/2000/10/swap/reason#",atomowl:"http://bblfish.net/work/atom-owl/2006-06-06/#",ccom:"http://purl.org/ontology/cco/mappings#",sawsdl:"http://www.w3.org/ns/sawsdl#",comm:"http://vocab.resc.info/communication#",bioskos:"http://eulersharp.sourceforge.net/2003/03swap/bioSKOSSchemes#",semtweet:"http://semantictweet.com/",tei:"http://www.tei-c.org/ns/1.0/",rad:"http://www.w3.org/ns/rad#",aigp:"http://swat.cse.lehigh.edu/resources/onto/aigp.owl#",ecpo:"http://purl.org/ontology/ecpo#",tcga:"http://purl.org/tcga/core#",psh:"http://ns.inria.fr/probabilistic-shacl/",gc:"http://www.oegov.org/core/owl/gc#",dgfoaf:"http://west.uni-koblenz.de/ontologies/2010/07/dgfoaf.owl#",sig:"http://purl.org/signature#",tvc:"http://www.essepuntato.it/2012/04/tvc/",oj:"http://ontojob.at/",decl:"http://www.linkedmodel.org/1.0/schema/decl#",func:"http://www.w3.org/2007/rif-builtin-function#",fc:"http://www.freeclass.eu/freeclass_v1#",dssn:"http://purl.org/net/dssn/",orca:"http://geni-orca.renci.org/owl/topology.owl#",oboro:"http://obofoundry.org/ro/ro.owl#",agrelon:"http://d-nb.info/standards/elementset/agrelon#",linkedct:"http://data.linkedct.org/vocab/",frame:"http://www.ontologydesignpatterns.org/ont/framenet/abox/frame/",nndsr:"http://semanticdiet.com/schema/usda/nndsr/",quak:"http://dev.w3.org/cvsweb/2000/quacken/vocab#",opmv:"http://purl.org/net/opmv/ns#",geop:"http://aims.fao.org/aos/geopolitical.owl#",xch:"http://oanda2rdf.appspot.com/xch/",fcm:"http://eulersharp.sourceforge.net/2006/02swap/fcm#",igeo:"http://rdf.insee.fr/def/geo#",swpo:"http://sw-portal.deri.org/ontologies/swportal#",theatre:"http://purl.org/theatre#",sad:"http://vocab.deri.ie/sad#",aersv:"http://aers.data2semantics.org/vocab/",nxp:"http://purl.org/nxp/schema/v1/",transit:"http://vocab.org/transit/terms/",spif:"http://spinrdf.org/spif#",bookmark:"http://www.w3.org/2002/01/bookmark#",tripfs2:"http://purl.org/tripfs/2010/06#",coeus:"http://bioinformatics.ua.pt/coeus/",enhancer:"http://stanbol.apache.org/ontology/enhancer/enhancer#",oboso:"http://purl.org/obo/owl/SO#",gxa:"http://www.ebi.ac.uk/gxa/",xbrli:"http://www.xbrl.org/2003/instance#",rso:"http://www.researchspace.org/ontology/",nyt:"http://data.nytimes.com/",eseduc:"http://www.purl.org/ontologia/eseduc#",td:"https://www.w3.org/2019/wot/td#",ling:"http://purl.org/voc/ling/",tp:"https://triplydb.com/Triply/tp/def/",mte:"http://nl.ijs.si/ME/owl/",iron:"http://purl.org/ontology/iron#",dbpo:"http://dbpedia.org/ontology/",rlno:"http://rdflivenews.aksw.org/ontology/",qu:"http://purl.oclc.org/NET/ssnx/qu/qu#",protons:"http://proton.semanticweb.org/2005/04/protons#",w3p:"http://prov4j.org/w3p/",events:"http://eulersharp.sourceforge.net/2003/03swap/event#",cidoccrm:"http://purl.org/NET/cidoc-crm/core#",dl:"http://ontology.ip.rm.cnr.it/ontologies/DOLCE-Lite#",httpm:"http://www.w3.org/2011/http-methods#",prvr:"http://purl.org/ontology/prv/rules#",json:"https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf#",rich:"http://rdf.data-vocabulary.org/",myprefix:"http://myprefix.org/",telix:"http://purl.org/telix#",c4o:"http://purl.org/spar/c4o/",gazetteer:"http://data.ordnancesurvey.co.uk/ontology/50kGazetteer/",htir:"http://www.w3.org/2011/http#",estrn:"http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/transporte#",sgv:"http://www.w3.org/TR/SVG/",owls:"http://www.daml.org/services/owl-s/1.2/Service.owl#",no:"http://km.aifb.kit.edu/projects/numbers/number#",frapo:"http://purl.org/cerif/frapo/",rpubl:"http://rinfo.lagrummet.se/ns/2008/11/rinfo/publ#",moby:"http://www.mygrid.org.uk/mygrid-moby-service#",ecc:"https://ns.eccenca.com/",oax:"http://www.w3.org/ns/openannotation/extensions/",kw:"http://kwantu.net/kw/",fct:"http://openlinksw.com/services/facets/1.0/",scowt:"http://purl.org/weso/ontologies/scowt#",coun:"http://www.daml.org/2001/09/countries/iso-3166-ont#",mesh:"http://id.nlm.nih.gov/mesh/",tmpl:"http://purl.org/restdesc/http-template#",frad:"http://iflastandards.info/ns/fr/frad/",artstor:"http://simile.mit.edu/2003/10/ontologies/artstor#",wf:"http://www.w3.org/2005/01/wf/flow#",humanbody:"http://eulersharp.sourceforge.net/2003/03swap/humanBody#",wm:"http://ns.inria.fr/webmarks#",arecipe:"http://purl.org/amicroformat/arecipe/",rdaw:"http://rdaregistry.info/Elements/w/",fingal:"http://vocab.deri.ie/fingal#",govtrackus:"http://www.rdfabout.com/rdf/usgov/geo/us/",gbv:"http://purl.org/ontology/gbv/",ext:"http://mu.semte.ch/vocabularies/ext/",jita:"http://aims.fao.org/aos/jita/",lgv:"http://linkedgeodata.org/ontology/",oecd:"http://oecd.270a.info/dataset/",ccard:"http://purl.org/commerce/creditcard#",swanag:"http://purl.org/swan/1.2/agents/",ru:"http://purl.org/imbi/ru-meta.owl#",pf:"http://jena.hpl.hp.com/ARQ/property#",owltime:"http://www.w3.org/TR/owl-time#",clineva:"http://www.agfa.com/w3c/2009/clinicalEvaluation#",ec:"http://eulergui.sourceforge.net/contacts.owl.n3#",goef:"http://purl.org/twc/vocab/goef#",bm:"http://bio2rdf.org/",intervals:"http://reference.data.gov.uk/def/intervals/",flow:"http://www.w3.org/2005/01/wf/flow#",grs:"http://www.georss.org/georss/",vcardx:"http://buzzword.org.uk/rdf/vcardx#",dbpedia2:"http://dbpedia.org/property/",ends:"http://labs.mondeca.com/vocab/endpointStatus#",quantity:"http://qudt.org/schema/quantity#",fe:"http://www.ontologydesignpatterns.org/ont/framenet/abox/fe/",rating:"http://www.tvblob.com/ratings/#",health:"http://purl.org/twc/health/vocab/",genab:"http://eulersharp.sourceforge.net/2003/03swap/genomeAbnormality#",italy:"http://data.kasabi.com/dataset/italy/schema/",dossier:"https://data.omgeving.vlaanderen.be/ns/dossier#",abs:"http://abs.270a.info/dataset/",luc:"http://www.ontotext.com/owlim/lucene#",identity:"http://purl.org/twc/ontologies/identity.owl#",vf:"https://w3id.org/valueflows/ont/vf#",sor:"http://purl.org/net/soron/",lod2:"http://lod2.eu/schema/",osp:"http://data.lirmm.fr/ontologies/osp#",penis:"http://penis.to/#",d2r:"http://sites.wiwiss.fu-berlin.de/suhl/bizer/d2r-server/config.rdf#",wfdesc:"http://purl.org/wf4ever/wfdesc#",kupkb:"http://www.e-lico.eu/data/kupkb/",nytimes:"http://data.nytimes.com/elements/",govwild:"http://govwild.org/0.6/GWOntology.rdf/",osmsemnet:"http://spatial.ucd.ie/2012/08/osmsemnet/",hcard:"http://purl.org/uF/hCard/terms/",frbrcore:"http://purl.org/vocab/frbr/core#",ql:"http://www.w3.org/2004/ql#",ecos:"http://purl.org/ecos#",crtv:"http://open-services.net/ns/crtv#",environ:"http://eulersharp.sourceforge.net/2003/03swap/environment#",p20:"http://zbw.eu/beta/p20/vocab/",cmd:"https://w3id.org/cmd#",s4ac:"http://ns.inria.fr/s4ac/v2#",sro:"http://salt.semanticauthoring.org/ontologies/sro#",npgd:"http://ns.nature.com/datasets/",loticoowl:"http://www.lotico.com/ontology/",shex:"http://www.w3.org/ns/shex#",cold:"http://purl.org/configurationontology#",transmed:"http://www.w3.org/2001/sw/hcls/ns/transmed/",wikibase:"http://wikiba.se/ontology#",daiaserv:"http://purl.org/ontology/daia/Service/",gfo:"http://www.onto-med.de/ontologies/gfo.owl#",cl:"http://advene.org/ns/cinelab/",itsmo:"http://ontology.it/itsmo/v1#",bl:"https://w3id.org/biolink/vocab/",ogorg:"http://opengraph.org/schema/",idemo:"http://rdf.insee.fr/def/demo#",ufmedia:"http://purl.org/microformat/hmedia/",crmdig:"http://www.ics.forth.gr/isl/CRMdig/",genea:"http://www.owl-ontologies.com/generations.owl#",poder:"http://poderopedia.com/vocab/",dpd:"http://www.kanzaki.com/ns/dpd#",nocal:"http://vocab.deri.ie/nocal#",skiresort:"http://www.openlinksw.com/ski_resorts/schema#",provone:"http://purl.org/provone#",lindt:"http://purl.org/NET/lindt#",rkd:"http://data.rkd.nl/def#",npgg:"http://ns.nature.com/graphs/",str:"http://nlp2rdf.lod2.eu/schema/string/",sw:"http://linkedwidgets.org/statisticalwidget/ontology/",hartigprov:"http://purl.org/net/provenance/ns#",va:"http://code-research.eu/ontology/visual-analytics#",bcncon:"http://datos.bcn.cl/ontologies/bcn-congress#",cf:"http://mmisw.org/ont/cf/parameter/",steel:"https://w3id.org/steel/ProcessOntology/",gesis:"http://lod.gesis.org/lodpilot/ALLBUS/vocab.rdf#",wscaim:"http://www.openk.org/wscaim.owl#",sci:"http://data.scientology.org/ns/",protegedc:"http://protege.stanford.edu/plugins/owl/dc/protege-dc.owl#",cdtype:"http://purl.org/cld/cdtype/",diseasome:"http://www4.wiwiss.fu-berlin.de/diseasome/resource/diseasome/",ls:"http://linkedspending.aksw.org/instance/",s2s:"http://escience.rpi.edu/ontology/sesf/s2s/4/0/",cis:"http://purl.org/NET/cloudisus#",healthcare:"http://www.agfa.com/w3c/2009/healthCare#",rankrage:"https://rankrage.de/",stac:"http://securitytoolbox.appspot.com/stac#",kbp:"http://tackbp.org/2013/ontology#",dctypes:"http://purl.org/dc/dcmitype/",atomrdf:"http://atomowl.org/ontologies/atomrdf#",mohammad:"http://manesht.ir/",atlas:"http://rdf.ebi.ac.uk/resource/atlas/",ngeoi:"http://vocab.lenka.no/geo-deling#",openskos:"http://openskos.org/xmlns#",centrifuge:"http://purl.org/twc/vocab/centrifuge#",paia:"http://purl.org/ontology/paia#",ipo:"http://purl.org/ipo/core#",occult:"http://data.totl.net/occult/",ianarel:"https://www.w3.org/ns/iana/link-relations/relation#",saxon:"http://saxon.sf.net/",solid:"http://www.w3.org/ns/solid/terms#",foo:"http://filmontology.org/ontology/1.0/",curr:"https://w3id.org/cc#",osukdt:"http://www.ordnancesurvey.co.uk/ontology/Datatypes.owl#",gs1:"https://gs1.org/voc/",marshall:"http://sites.google.com/site/xgmaitc/",l4a:"http://labels4all.info/ns/",skos08:"http://www.w3.org/2008/05/skos#",vsto:"http://escience.rpi.edu/ontology/vsto/2/0/vsto.owl#",rec54:"http://www.w3.org/2001/02pd/rec54.rdf#",l4lod:"http://ns.inria.fr/l4lod/v2/",lctr:"http://data.linkedct.org/vocab/resource/",mtecore:"http://purl.org/olia/mte/multext-east.owl#",harrisons:"http://harrisons.cc/",opmw:"http://www.opmw.org/ontology/",category:"http://dbpedia.org/resource/Category:",rml:"http://w3id.org/rml/",biordf:"http://purl.org/net/biordfmicroarray/ns#",wfprov:"http://purl.org/wf4ever/wfprov#",gov:"http://gov.genealogy.net/ontology.owl#",clinproc:"http://www.agfa.com/w3c/2009/clinicalProcedure#",pizza:"http://www.co-ode.org/ontologies/pizza/pizza.owl#",prism21:"http://prismstandard.org/namespaces/basic/2.1/",daq:"http://purl.org/eis/vocab/daq#",campsite:"http://www.openlinksw.com/campsites/schema#",aerols:"http://xmlns.com/aerols/0.1/",hasco:"http://hadatac.org/ont/hasco/",laposte:"http://data.lirmm.fr/ontologies/laposte#",mpeg7:"http://rhizomik.net/ontologies/2005/03/Mpeg7-2001.owl#",pronom:"http://reference.data.gov.uk/technical-registry/",dbyago:"http://dbpedia.org/class/yago/",b2rpubchem:"http://bio2rdf.org/ns/ns/ns/pubchem#",lh:"http://vocab.inf.ed.ac.uk/library/holdings#",refe:"http://orion.tw.rpi.edu/~xgmatwc/refe/",malignneo:"http://www.agfa.com/w3c/2009/malignantNeoplasm#",opl:"http://openlinksw.com/schema/attribution#",pkmn:"http://pokedex.dataincubator.org/pkm/",okg:"http://openknowledgegraph.org/ontology/",wno:"http://wordnet-rdf.princeton.edu/ontology#",ldr:"http://purl.oclc.org/NET/ldr/ns#",ifc:"http://ifcowl.openbimstandards.org/IFC2X3_Final#",odcs:"http://opendata.cz/infrastructure/odcleanstore/",camelot:"http://vocab.ox.ac.uk/camelot#",wkd:"http://schema.wolterskluwer.de/",dpl:"http://dbpedialite.org/things/",oslo:"http://purl.org/oslo/ns/localgov#",sam:"http://def.seegrid.csiro.au/isotc211/iso19156/2011/sampling#",verb:"https://w3id.org/verb/",te:"http://www.w3.org/2006/time-entry#",c4dm:"http://purl.org/NET/c4dm/event.owl#",bv:"http://purl.org/vocommons/bv#",pod:"https://project-open-data.cio.gov/v1.1/schema/#",dqv:"http://www.w3.org/ns/dqv#",geovocab:"http://geovocab.org/",crv:"http://purl.org/twc/vocab/datacarver#",germplasm:"http://purl.org/germplasm/terms#",doas:"http://deductions.github.io/doas.owl.ttl#",dannet:"http://www.wordnet.dk/owl/instance/2009/03/instances/",lio:"http://purl.org/net/lio#",ds:"http://purl.org/ctic/dcat#",scms:"http://ns.aksw.org/scms/annotations/",mads:"http://www.loc.gov/mads/rdf/v1#",lc:"http://semweb.mmlab.be/ns/linkedconnections#",cart:"http://purl.org/net/cartCoord#",date:"http://contextus.net/ontology/ontomedia/misc/date#",vgo:"http://purl.org/net/VideoGameOntology#",odo:"http://ocean-data.org/schema/",lso:"http://linkedspending.aksw.org/ontology/",ekaw:"http://data.semanticweb.org/conference/ekaw/2012/complete/",puelia:"http://kwijibo.talis.com/vocabs/puelia#",bcnnorms:"http://datos.bcn.cl/ontologies/bcn-norms#",of:"http://owlrep.eu01.aws.af.cm/fridge#",alchemy:"http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema#",ebu:"http://semantic.eurobau.com/eurobau-utility.owl#",shoah:"http://dati.cdec.it/lod/shoah/",sso:"http://nlp2rdf.lod2.eu/schema/sso/",prvt:"http://purl.org/net/provenance/types#",omnlife:"http://open-multinet.info/ontology/omn-lifecycle#",plo:"http://purl.org/net/po#",mmo:"http://purl.org/momayo/mmo/",tac:"http://ns.bergnet.org/tac/0.1/triple-access-control#",hifm:"http://purl.org/net/hifm/data#",yo:"http://yovisto.com/",pattern:"http://www.essepuntato.it/2008/12/pattern#",dawgt:"http://www.w3.org/2001/sw/DataAccess/tests/test-dawg#",tisc:"http://observedchange.com/tisc/ns#",bdd:"https://api.bloomberg.com/eap/catalogs/bbg/fields/",namespaces:"https://vg.no/",ottr:"http://ns.ottr.xyz/templates#",shw:"http://paul.staroch.name/thesis/SmartHomeWeather.owl#",dvia:"http://data.eurecom.fr/ontology/dvia#",insdc:"http://ddbj.nig.ac.jp/ontologies/sequence#",strdf:"http://strdf.di.uoa.gr/ontology#",esco:"http://data.europa.eu/esco/model#",dcndl:"http://ndl.go.jp/dcndl/terms/",hints2005:"http://purl.org/twc/cabig/model/HINTS2005-1.owl#",rdacarrier:"http://rdvocab.info/termList/RDACarrierType/",opllic:"http://www.openlinksw.com/ontology/licenses#",daisy:"http://www.daisy.org/z3998/2012/vocab/",smg:"http://ns.cerise-project.nl/energy/def/cim-smartgrid#",adr:"http://kg.artsdata.ca/resource/",vin:"http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#",dn:"http://purl.org/datanode/ns/",antenne:"https://data.zendantennes.omgeving.vlaanderen.be/ns/zendantenne#",csm:"http://purl.org/csm/1.0#",sbench:"http://swat.cse.lehigh.edu/onto/univ-bench.owl#",cts2:"http://schema.omg.org/spec/CTS2/1.0/",part:"http://purl.org/vocab/participation/schema#",bn:"http://babelnet.org/rdf/",rssynd:"http://web.resource.org/rss/1.0/modules/syndication/",cpsv:"http://purl.org/vocab/cpsv#",wsl:"http://www.wsmo.org/ns/wsmo-lite#",quantities:"http://eulersharp.sourceforge.net/2003/03swap/quantitiesExtension#",iol:"http://www.ontologydesignpatterns.org/ont/dul/IOLite.owl#",latitude:"https://www.w3.org/2006/vcard/ns#",gastro:"http://www.ebsemantics.net/gastro#",dpc:"http://hospee.org/ontologies/dpc/",chembl:"http://rdf.ebi.ac.uk/terms/chembl#",ssso:"http://purl.org/ontology/ssso#",art:"http://w3id.org/art/terms/1.0/",clinic:"http://example.com/clinic#",wro:"http://purl.org/net/wf4ever/ro#",ptop:"http://www.ontotext.com/proton/protontop#",fos:"http://futurios.org/fos/spec/",rdamt:"http://rdaregistry.info/termList/RDAMediaType/",pso:"http://purl.org/spar/pso/",sioctypes:"http://rdfs.org/sioc/types#",scor:"http://purl.org/eis/vocab/scor#",turismo:"http://idi.fundacionctic.org/cruzar/turismo#",rdae:"http://rdaregistry.info/Elements/e/",semio:"http://www.lingvoj.org/semio#",goog:"http://schema.googleapis.com/",rmo:"http://eatld.et.tu-dresden.de/rmo#",qrl:"http://www.aifb.kit.edu/project/ld-retriever/qrl#",trait:"http://contextus.net/ontology/ontomedia/ext/common/trait#",bihap:"http://bihap.kb.gov.tr/ontology/",stream:"http://dbpedia.org/ontology/Stream/",ccrel:"http://creativecommons.org/ns#",cpant:"http://purl.org/NET/cpan-uri/terms#",decision:"https://decision-ontology.googlecode.com/svn/trunk/decision.owl#",mico:"http://www.mico-project.eu/ns/platform/1.0/schema#",bk:"http://www.provbook.org/ns/#",oan:"http://data.lirmm.fr/ontologies/oan/",property:"http://fr.dbpedia.org/property/",guo:"http://purl.org/hpi/guo#",ep:"http://eprints.org/ontology/",who:"http://www.who.int/vocab/ontology#",webbox:"http://webbox.ecs.soton.ac.uk/ns#",ost:"http://w3id.org/ost/ns#",emtr:"http://purl.org/NET/ssnext/electricmeters#",cosmo:"http://purl.org/ontology/cosmo#",xlime:"http://xlime-project.org/vocab/",obsm:"http://rdf.geospecies.org/methods/observationMethod#",omapi:"http://purl.org/omapi/0.2/#",thors:"http://resource.geosciml.org/ontology/timescale/thors#",opencyc:"http://sw.opencyc.org/concept/",shacl:"http://www.w3.org/ns/shacl#",lldr:"http://purl.oclc.org/NET/lldr/ns#",onc:"http://www.ics.forth.gr/isl/oncm/core#",gf:"http://def.seegrid.csiro.au/isotc211/iso19109/2005/feature#",conf:"http://richard.cyganiak.de/2007/pubby/config.rdf#",fma:"http://sig.uw.edu/fma#",op:"http://environment.data.gov.au/def/op#",vsso:"http://automotive.eurecom.fr/vsso#",zoomaterms:"http://rdf.ebi.ac.uk/vocabulary/zooma/",rdarel2:"http://metadataregistry.org/uri/schema/RDARelationshipsGR2/",kai:"http://kai.uni-kiel.de/",msr:"http://www.telegraphis.net/ontology/measurement/measurement#",sao:"http://salt.semanticauthoring.org/ontologies/sao#",wikterms:"http://wiktionary.dbpedia.org/terms/",bgcat:"http://bg.dbpedia.org/resource/\u041a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f:",rdafnm:"http://rdaregistry.info/termList/FormNoteMus/",ses:"http://lod.taxonconcept.org/ses/",faq:"http://www.openlinksw.com/ontology/faq#",mmd:"http://musicbrainz.org/ns/mmd-1.0#",ljkl:"http://teste.com/",oarj:"http://opendepot.org/reference/linked/1.0/",my:"http://www.mobile.com/model/",cvbase:"http://purl.org/captsolo/resume-rdf/0.2/base#",rdamedia:"http://rdvocab.info/termList/RDAMediaType/",place:"http://purl.org/ontology/places/",tblcard:"http://www.w3.org/People/Berners-Lee/card#",spt:"http://spitfire-project.eu/ontology/ns/",security:"http://securitytoolbox.appspot.com/securityMain#",ecrm:"http://erlangen-crm.org/current/",mged:"http://mged.sourceforge.net/ontologies/MGEDOntology.owl#",moac:"http://observedchange.com/moac/ns#",telmap:"http://purl.org/telmap/",dr:"http://purl.org/swan/2.0/discourse-relationships/",poste:"http://data.lirmm.fr/ontologies/poste#",rdafr:"http://rdaregistry.info/termList/frequency/",eumida:"http://data.kasabi.com/dataset/eumida/terms/",bgn:"http://bibliograph.net/schemas/",w3con:"http://www.w3.org/2000/10/swap/pim/contact#",bcnbio:"http://datos.bcn.cl/ontologies/bcn-biographies#",aers:"http://aers.data2semantics.org/resource/",qud:"http://qudt.org/1.1/schema/qudt#",jpo:"http://rdf.jpostdb.org/ontology/jpost.owl#",icane:"http://www.icane.es/opendata/vocab#",wlo:"http://purl.org/ontology/wo/",mil:"http://rdf.muninn-project.org/ontologies/military#",lodac:"http://lod.ac/ns/lodac#",sdmxd:"http://purl.org/linked-data/sdmx/2009/dimension#",rdasoi:"http://rdaregistry.info/termList/statIdentification/",seq:"http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#",scoro:"http://purl.org/spar/scoro/",dqm:"http://purl.org/dqm-vocabulary/v1/dqm#",nerd:"http://nerd.eurecom.fr/ontology#",gl:"http://schema.geolink.org/",rdarel:"http://rdvocab.info/RDARelationshipsWEMI/",disease:"http://www.agfa.com/w3c/2009/humanDisorder#",qvoc:"http://mlode.nlp2rdf.org/quranvocab#",odrs:"http://schema.theodi.org/odrs#",finlaw:"http://purl.org/finlex/schema/laki/",exo:"https://w3id.org/example#",mv:"http://schema.mobivoc.org/",oss:"http://opendata.caceres.es/def/ontosemanasanta#",kbv:"https://id.kb.se/vocab/",dcs:"http://ontologi.es/doap-changeset#",delta:"http://www.w3.org/2004/delta#",xapi:"https://w3id.org/xapi/ontology#",tw:"http://tw.rpi.edu/schema/",holding:"http://purl.org/ontology/holding#",biro:"http://purl.org/spar/biro/",ctorg:"http://purl.org/ctic/infraestructuras/organizacion#",li:"http://def.seegrid.csiro.au/isotc211/iso19115/2003/lineage#",twaapi:"http://purl.org/twc/vocab/aapi-schema#",accom:"http://purl.org/acco/ns#",oplcert:"http://www.openlinksw.com/schemas/cert#",onyx:"http://www.gsi.dit.upm.es/ontologies/onyx/ns#",eui:"http://institutions.publicdata.eu/#",xcql:"http://docs.oasis-open.org/ns/search-ws/xcql#",lsc:"http://linkedscience.org/lsc/ns#",auto:"http://auto.schema.org/",infor:"http://www.ontologydesignpatterns.org/cp/owl/informationrealization.owl#",dbcat:"http://dbpedia.org/resource/Category:",osspr:"http://data.ordnancesurvey.co.uk/ontology/spatialrelations/",ll:"http://lodlaundromat.org/resource/",rdacontent:"http://rdvocab.info/termList/RDAContentType/",fam:"http://vocab.fusepool.info/fam#",swperson:"http://data.semanticweb.org/person/",esequip:"http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/equipamiento#",od:"http://purl.org/twc/vocab/opendap#",affymetrix:"http://bio2rdf.org/affymetrix_vocabulary:",vsws:"http://verticalsearchworks.com/ontology/synset#",coll:"http://purl.org/co/",cbo:"http://comicmeta.org/cbo/",mrel:"http://id.loc.gov/vocabulary/relators/",mb:"http://dbtune.org/musicbrainz/resource/instrument/",raul:"http://vocab.deri.ie/raul#",onssprel:"http://www.ordnancesurvey.co.uk/ontology/SpatialRelations/v0.2/SpatialRelations.owl#",tsioc:"http://rdfs.org/sioc/types#",wb:"http://data.worldbank.org/",gawd:"http://gawd.atlantides.org/terms/",stats:"http://purl.org/rdfstats/stats#",pnc:"http://data.press.net/ontology/classification/",npgx:"http://ns.nature.com/extensions/",dash:"http://datashapes.org/dash#",osgeom:"http://data.ordnancesurvey.co.uk/ontology/geometry/",emoca:"http://ns.inria.fr/emoca#",ogc:"http://www.opengis.net/def/",fao:"http://fao.270a.info/dataset/",tao:"http://pubannotation.org/ontology/tao.owl#",dogont:"http://elite.polito.it/ontologies/dogont.owl#",drm:"http://vocab.data.gov/def/drm#",app:"http://jmvanel.free.fr/ontology/software_applications.n3#",call:"http://webofcode.org/wfn/call:",lsmap:"http://ontology.cybershare.utep.edu/ELSEWeb/elseweb-data.owl#",pnt:"http://data.press.net/ontology/tag/",mvco:"http://purl.oclc.org/NET/mvco.owl#",geocontext:"http://www.geocontext.org/publ/2013/vocab#",dbpr:"http://dbpedia.org/resource/",esaloj:"http://vocab.linkeddata.es/datosabiertos/def/turismo/alojamiento#",elec:"http://purl.org/ctic/sector-publico/elecciones#",lcy:"http://purl.org/vocab/lifecycle/schema#",water:"http://escience.rpi.edu/ontology/semanteco/2/0/water.owl#",nidm:"http://nidm.nidash.org/",vapour:"http://vapour.sourceforge.net/vocab.rdf#",xrd:"http://docs.oasis-open.org/ns/xri/xrd-1.0#",rdacct:"http://rdaregistry.info/termList/CollTitle/",wn31:"http://wordnet-rdf.princeton.edu/wn31/",llo:"http://lodlaundromat.org/ontology/",bgt:"https://bgt.basisregistraties.overheid.nl/bgt/def/",oml:"http://def.seegrid.csiro.au/ontology/om/om-lite#",stories:"http://purl.org/ontology/stories/",pni:"http://data.press.net/ontology/identifier/",gadm:"http://gadm.geovocab.org/ontology#",pois:"http://purl.oclc.org/POIS/vcblr#",bwb:"http://doc.metalex.eu/bwb/ontology/",dbtont:"http://dbtropes.org/ont/",sg:"http://name.scigraph.com/ontologies/core/",graffle:"http://purl.org/twc/vocab/vsr/graffle#",ox:"http://vocab.ox.ac.uk/projectfunding#",isocat:"http://www.isocat.org/datcat/",seokoeln:"http://rankrage.de/",particip:"http://purl.org/vocab/participation/schema#",allot:"https://w3id.org/akn/ontology/allot#",rdami:"http://rdaregistry.info/termList/modeIssue/",viskov:"http://trust.utep.edu/visko/ontology/visko-view-v3.owl#",dcite:"http://purl.org/spar/datacite/",pvcs:"http://purl.org/twc/vocab/pvcs#",evident:"http://purl.org/net/evident#",doi:"https://doi.org/",saif:"http://wwwiti.cs.uni-magdeburg.de/~srahman/",brick:"https://brickschema.org/schema/Brick#",odapp:"http://vocab.deri.ie/odapp#",snarm:"http://rdf.myexperiment.org/ontologies/snarm/",viso:"http://purl.org/viso/",pingback:"http://purl.org/net/pingback/",s3db:"http://www.s3db.org/core#",deps:"http://ontologi.es/doap-deps#",frb:"http://frb.270a.info/dataset/",mt:"http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#",cbase:"http://ontologycentral.com/2010/05/cb/vocab#",kees:"http://linkeddata.center/kees/v1#",pic:"http://www.ipaw.info/ns/picaso#",ramon:"http://rdfdata.eionet.europa.eu/ramon/ontology/",scip:"http://lod.taxonconcept.org/ontology/sci_people.owl#",ev:"http://www.w3.org/2001/xml-events/",swo:"http://www.ebi.ac.uk/swo/",fincaselaw:"http://purl.org/finlex/schema/oikeus/",biotop:"http://purl.org/biotop/biotop.owl#",oh:"http://semweb.mmlab.be/ns/oh#",ostop:"http://www.ordnancesurvey.co.uk/ontology/Topography/v0.1/Topography.owl#",ncit:"https://ncit.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=",spfood:"http://kmi.open.ac.uk/projects/smartproducts/ontologies/food.owl#",voidp:"http://www.enakting.org/provenance/voidp/",quty:"http://www.telegraphis.net/ontology/measurement/quantity#",c9d:"http://purl.org/twc/vocab/conversion/",viskoo:"http://trust.utep.edu/visko/ontology/visko-operator-v3.owl#",eunis:"http://eunis.eea.europa.eu/rdf/species-schema.rdf#",fcp:"http://www.newmedialab.at/fcp/",dcoid:"http://dx.deepcarbon.net/",d2d:"http://rdfns.org/d2d/",vag:"http://www.essepuntato.it/2013/10/vagueness/",w3po:"http://purl.org/provenance/w3p/w3po#",rdatc:"http://rdaregistry.info/termList/trackConfig/",vvo:"http://purl.org/vvo/ns#",prviv:"http://purl.org/net/provenance/integrity#",rdl:"http://data.posccaesar.org/rdl/",bco:"http://purl.obolibrary.org/obo/bco.owl#",mmf:"http://linkedmultimedia.org/sparql-mm/ns/1.0.0/function#",rvdata:"http://data.rvdata.us/",bner:"http://datos.bne.es/resource/",lexcz:"http://purl.org/lex/cz#",rdagw:"http://rdaregistry.info/termList/grooveWidth/",olad:"http://openlad.org/vocab#",origins:"http://origins.link/",rdagd:"http://rdaregistry.info/termList/gender/",bgdbp:"http://bg.dbpedia.org/property/",geosp:"http://rdf.geospecies.org/ont/geospecies#",driver:"http://deductions.github.io/drivers.owl.ttl#",fcs:"http://clarin.eu/fcs/resource#",im:"http://imgpedia.dcc.uchile.cl/resource/",saws:"http://purl.org/saws/ontology#",tg:"https://triplydb.com/Triply/tg/def/",company:"http://intellimind.io/ns/company#",lden:"http://www.linklion.org/lden/",swpatho:"http://swpatho.ag-nbi.de/context/meta.owl#",cmdm:"http://infra.clarin.eu/cmd/",vdpp:"http://data.lirmm.fr/ontologies/vdpp#",vsw:"http://verticalsearchworks.com/ontology/",lingvo:"http://www.lingvoj.org/ontology#",waarde:"https://lod.milieuinfo.be/ns/waarde#",tis:"http://www.ontologydesignpatterns.org/cp/owl/timeindexedsituation.owl#",gnvc:"http://purl.org/gc/",odpart:"http://www.ontologydesignpatterns.org/cp/owl/participation.owl#",agr:"http://promsns.org/def/agr#",pkm:"http://www.ontotext.com/proton/protonkm#",radion:"http://www.w3.org/ns/radion#",ntag:"http://ns.inria.fr/nicetag/2010/09/09/voc#",gpml:"http://vocabularies.wikipathways.org/gpml#",agrd:"http://agrinepaldata.com/",vartrans:"http://www.w3.org/ns/lemon/vartrans#",rdarole:"http://rdvocab.info/roles/",vext:"http://ldf.fi/void-ext#",lexvo:"http://lexvo.org/ontology#",aws:"http://purl.oclc.org/NET/ssnx/meteo/aws#",agls:"http://www.agls.gov.au/agls/terms/",rdai:"http://rdaregistry.info/Elements/i/",dao:"http://purl.org/dao#",lsweb:"http://ontology.cybershare.utep.edu/ELSEWeb/elseweb-data.owl#",employee:"http://www.employee.com/data#",lw:"http://linkedwidgets.org/ontologies/",npdv:"http://sws.ifi.uio.no/vocab/npd#",dbptmpl:"http://dbpedia.org/resource/Template:",oae:"http://www.ics.forth.gr/isl/oae/core#",gcis:"http://data.globalchange.gov/gcis.owl#",friends:"http://www.openarchives.org/OAI/2.0/friends/",mtlo:"http://www.ics.forth.gr/isl/MarineTLO/v4/marinetlo.owl#",rdabm:"http://rdaregistry.info/termList/RDABaseMaterial/",cwrc:"http://sparql.cwrc.ca/ontology/cwrc#",ontopic:"http://www.ontologydesignpatterns.org/ont/dul/ontopic.owl#",fire:"http://tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-java.html#",situ:"http://www.ontologydesignpatterns.org/cp/owl/situation.owl#",frsad:"http://iflastandards.info/ns/fr/frsad/",activity:"https://www.w3.org/TR/activitystreams-vocabulary/",ordf:"http://purl.org/NET/ordf/",beth:"http://www.google.com/",roevo:"http://purl.org/wf4ever/roevo#",lmm1:"http://www.ontologydesignpatterns.org/ont/lmm/LMM_L1.owl#",vrank:"http://purl.org/voc/vrank#",orth:"http://purl.org/net/orth#",bot:"https://w3id.org/bot#",lmdb:"http://data.linkedmdb.org/",galaksiya:"http://ontoloji.galaksiya.com/vocab/",bioc:"http://deductions.github.io/biological-collections.owl.ttl#",csp:"http://vocab.deri.ie/csp#",gm:"http://def.seegrid.csiro.au/isotc211/iso19107/2003/geometry#",vmm:"http://spi-fm.uca.es/spdef/models/genericTools/vmm/1.0#",wikim:"http://spi-fm.uca.es/spdef/models/genericTools/wikim/1.0#",lpeu:"http://purl.org/linkedpolitics/vocabulary/eu/plenary/",bcngeo:"http://datos.bcn.cl/ontologies/bcn-geographics#",oplprod:"http://www.openlinksw.com/ontology/products#",salad:"https://w3id.org/cwl/salad#",scufl2:"http://ns.taverna.org.uk/2010/scufl2#",opengov:"http://www.w3.org/opengov#",ldvm:"http://linked.opendata.cz/ontology/ldvm/",uis:"http://uis.270a.info/dataset/",wf4ever:"http://purl.org/wf4ever/wf4ever#",ftcontent:"http://www.ft.com/ontology/content/",mammal:"http://lod.taxonconcept.org/ontology/p01/Mammalia/index.owl#",wfn:"http://webofcode.org/wfn/",opmo:"http://openprovenance.org/model/opmo#",being:"http://purl.org/ontomedia/ext/common/being#",bbcprov:"http://www.bbc.co.uk/ontologies/provenance/",ids:"https://w3id.org/idsa/core/",d0:"http://ontologydesignpatterns.org/ont/wikipedia/d0.owl#",mod:"http://www.isibang.ac.in/ns/mod#",pcdt:"http://purl.org/procurement/public-contracts-datatypes#",language:"http://id.loc.gov/vocabulary/iso639-1/",pproc:"http://contsem.unizar.es/def/sector-publico/pproc#",passim:"http://data.lirmm.fr/ontologies/passim#",rlnr:"http://rdflivenews.aksw.org/resource/",tddo:"http://databugger.aksw.org/ns/core#",bnf:"http://www.w3.org/2000/10/swap/grammar/bnf#",frbrer:"http://iflastandards.info/ns/fr/frbr/frbrer/",wn20:"http://www.w3.org/2006/03/wn/wn20/",lsd:"http://linkedwidgets.org/statisticaldata/ontology/",s4envi:"https://w3id.org/def/saref4envi#",crml:"http://semweb.mmlab.be/ns/rml/condition#",lmo:"http://linkedmultimedia.org/sparql-mm/ns/2.0.0/ontology#",ws:"http://www.w3.org/ns/pim/space#",samfl:"http://def.seegrid.csiro.au/ontology/om/sam-lite#",eurostat:"http://wifo5-04.informatik.uni-mannheim.de/eurostat/resource/eurostat/",foam:"https://www.koerperfettwaage-test.de/",ogbd:"http://www.ogbd.fr/2012/ontologie#",cjr:"http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/callejero#",lsqv:"http://lsq.aksw.org/vocab#",graves:"http://rdf.muninn-project.org/ontologies/graves#",static:"http://vocab-ld.org/vocab/static-ld#",fog:"https://w3id.org/fog#",geos:"http://www.telegraphis.net/ontology/geography/geography#",limoo:"http://purl.org/LiMo/0.1/",contsem:"http://contsem.unizar.es/def/sector-publico/contratacion#",pwo:"http://purl.org/spar/pwo/",swpm:"http://spi-fm.uca.es/spdef/models/deployment/swpm/1.0#",edgar:"http://edgarwrap.ontologycentral.com/vocab/edgar#",pco:"http://purl.org/procurement/public-contracts#",sct:"http://snomed.info/id/",roterms:"http://purl.org/wf4ever/roterms#",imf:"http://imf.270a.info/dataset/",dq:"http://def.seegrid.csiro.au/isotc211/iso19115/2003/dataquality#",citof:"http://www.essepuntato.it/2013/03/cito-functions#",phdd:"http://rdf-vocabulary.ddialliance.org/phdd#",bgdbr:"http://bg.dbpedia.org/resource/",asgv:"http://aims.fao.org/aos/agrovoc/",lmm2:"http://www.ontologydesignpatterns.org/ont/lmm/LMM_L2.owl#",step:"http://purl.org/net/step#",locwd:"http://purl.org/locwd/schema#",babelnet:"http://babelnet.org/2.0/",qb4o:"http://purl.org/olap#",lda:"http://purl.org/linked-data/api/vocab#",hico:"http://purl.org/emmedi/hico/",rdact:"http://rdaregistry.info/termList/RDACarrierType/",r4ta:"http://ns.inria.fr/ratio4ta/v1#",trig:"http://www.w3.org/2004/03/trix/rdfg-1/",text:"http://jena.apache.org/text#",form:"http://deductions-software.com/ontologies/forms.owl.ttl#",rdafrbr:"http://rdvocab.info/uri/schema/FRBRentitiesRDA/",omdoc:"http://omdoc.org/ontology/",hto:"http://project-haystack.org/hto#",acrt:"http://privatealpha.com/ontology/certification/1#",olca:"http://www.lingvoj.org/olca#",rut:"http://rdfunit.aksw.org/ns/core#",amalgame:"http://purl.org/vocabularies/amalgame#",rdagrp:"http://rdaregistry.info/termList/groovePitch/",jolux:"http://data.legilux.public.lu/resource/ontology/jolux#",csv:"http://vocab.sindice.net/csv/",merge:"http://jazz.net/ns/lqe/merge/",condition:"http://www.kinjal.com/condition:",mds:"http://doc.metalex.eu/id/",pmd:"https://w3id.org/pmd/co/",lexicon:"http://www.example.org/lexicon#",hlygt:"http://www.holygoat.co.uk/owl/redwood/0.1/tags/",jjd:"http://www.joshuajeeson.com/",osadm:"http://data.ordnancesurvey.co.uk/ontology/admingeo/",rdf123:"http://rdf123.umbc.edu/ns/",gci:"http://ontology.eil.utoronto.ca/GCI/Foundation/GCI-Foundation.owl#",infection:"http://www.agfa.com/w3c/2009/infectiousDisorder#",laabs:"http://dbpedia.org/resource/",location:"http://sw.deri.org/2006/07/location/loc#",gaf:"http://groundedannotationframework.org/",pkgsrc:"http://pkgsrc.co/schema#",dbrc:"http://dbpedia.org/resource/Category:",bis:"http://bis.270a.info/dataset/",locah:"http://data.archiveshub.ac.uk/def/",prof:"http://www.w3.org/ns/dx/prof/",odv:"http://reference.data.gov.uk/def/organogram/",msm:"http://iserve.kmi.open.ac.uk/ns/msm#",lcdr:"http://ns.lucid-project.org/revision/",topo:"http://data.ign.fr/def/topo#",year:"http://www.w3.org/year/",mocanal:"http://www.semanticweb.org/asow/ontologies/2013/9/untitled-ontology-36#",oecc:"http://www.oegov.org/core/owl/cc#",dot:"https://w3id.org/dot#",limo:"http://www.purl.org/limo-ontology/limo#",owlse:"http://www.daml.org/services/owl-s/1.2/generic/Expression.owl#",tm:"http://def.seegrid.csiro.au/isotc211/iso19108/2002/temporal#",escom:"http://vocab.linkeddata.es/datosabiertos/def/comercio/tejidoComercial#",incident:"http://vocab.resc.info/incident#",gt:"https://vocab.eccenca.com/geniustex/",pair:"http://virtual-assembly.org/ontologies/pair#",sto:"https://w3id.org/i40/sto#",llm:"http://lodlaundromat.org/metrics/ontology/",gnm:"http://www.geonames.org/ontology/mappings/",obeu:"http://data.openbudgets.eu/ontology/",reegle:"http://reegle.info/schema#",regorg:"http://www.w3.org/ns/regorg#",aktivesa:"http://sa.aktivespace.org/ontologies/aktivesa#",pmc:"http://identifiers.org/pmc/",airs:"https://raw.githubusercontent.com/airs-linked-data/lov/latest/src/airs_vocabulary.ttl#",odbc:"http://www.openlinksw.com/ontology/odbc#",ceterms:"http://purl.org/ctdl/terms/",crowd:"http://purl.org/crowd/",nxs:"http://www.neclimateus.org/",dio:"https://w3id.org/dio#",rdarm:"http://registry.info/termList/recMedium/",rdafs:"http://rdaregistry.info/termList/fontSize/",sx:"http://shex.io/ns/shex#",zr:"http://explain.z3950.org/dtd/2.0/",rdarr:"http://rdaregistry.info/termList/RDAReductionRatio/",proms:"http://promsns.org/def/proms#",ecgl:"http://schema.geolink.org/",jp1:"http://rdf.muninn-project.org/ontologies/jp1/",uc:"http://ucuenca.edu.ec/ontology#",webservice:"http://www.openlinksw.com/ontology/webservices#",puml:"http://plantuml.com/ontology#",crsw:"http://courseware.rkbexplorer.com/ontologies/courseware#",genre:"http://sparql.cwrc.ca/ontologies/genre#",rdatr:"http://rdaregistry.info/termList/typeRec/",uta:"http://uptheasset.org/ontology#",sru:"http://www.loc.gov/zing/srw/",pv:"http://ns.inria.fr/provoc#",teamwork:"http://topbraid.org/teamwork#",geod:"http://vocab.lenka.no/geo-deling#",demlab:"http://www.demcare.eu/ontologies/demlab.owl#",bevon:"http://rdfs.co/bevon/",muldicat:"http://iflastandards.info/ns/muldicat#",ou:"http://opendata.unex.es/def/ontouniversidad#",olac:"http://www.language-archives.org/OLAC/1.0/",oplcb:"http://www.openlinksw.com/schemas/crunchbase#",ns1:"http://www.w3.org/1999/xhtml/vocab#",ontosec:"http://www.semanticweb.org/ontologies/2008/11/OntologySecurity.owl#",essglobal:"http://purl.org/essglobal/vocab/v1.0/",cpack:"http://cliopatria.swi-prolog.org/schema/cpack#",rdaco:"http://rdaregistry.info/termList/RDAContentType/",cd:"http://citydata.wu.ac.at/ns#",oprovo:"http://openprovenance.org/ontology#",defns:"http://www.openarchives.org/OAI/2.0/",voc:"http://voc.odw.tw/",rdaftn:"http://rdaregistry.info/termList/TacNotation/",mdi:"http://w3id.org/multidimensional-interface/ontology#",glview:"http://schema.geolink.org/dev/view/",omnfed:"http://open-multinet.info/ontology/omn-federation#",basic:"http://def.seegrid.csiro.au/isotc211/iso19103/2005/basic#",clirio:"http://clirio.kaerle.com/clirio.owl#",mml:"http://www.w3.org/1998/Math/MathML/",cmdi:"http://www.clarin.eu/cmd/",oplecrm:"http://www.openlinksw.com/ontology/ecrm#",ha:"http://sensormeasurement.appspot.com/ont/home/homeActivity#",keys:"http://purl.org/NET/c4dm/keys.owl#",lido:"http://www.lido-schema.org/",rdag2:"http://rdvocab.info/ElementsGr2/",eurlex:"http://eur-lex.publicdata.eu/ontology/",crime:"http://purl.org/vocab/reloc/",moo:"http://www.movieontology.org/2009/11/09/movieontology.owl#",soch:"http://kulturarvsdata.se/ksamsok#",maso:"http://securitytoolbox.appspot.com/MASO#",rdafmn:"http://rdaregistry.info/termList/MusNotation/",oplmkt:"http://www.openlinksw.com/ontology/market#",output:"http://volt-name.space/vocab/output#",erce:"http://xxefe.de/",ecglview:"http://schema.geolink.org/view/",roar:"https://w3id.org/roar#",lofv:"http://purl.org/legal_form/vocab#",plg:"http://parliament.uk/ontologies/legislation/",spdx:"http://spdx.org/rdf/terms#",mmt:"http://linkedmultimedia.org/sparql-mm/functions/temporal#",espresup:"http://vocab.linkeddata.es/datosabiertos/def/hacienda/presupuestos#",bsym:"http://bsym.bloomberg.com/sym/",sylld:"http://www.semanticweb.org/syllabus/data/",rdacc:"http://rdaregistry.info/termList/RDAColourContent/",caplibacl:"http://schemas.capita-libraries.co.uk/2015/acl/schema#",ppn:"http://parliament.uk/ontologies/person-name/",kegg:"http://bio2rdf.org/ns/kegg#",vstoi:"http://hadatac.org/ont/vstoi#",vcard2006:"http://www.w3.org/2006/vcard/ns#",gq:"http://genomequest.com/",owsom:"https://onlinesocialmeasures.wordpress.com/",ali:"http://www.niso.org/schemas/ali/1.0/",rdag1:"http://rdvocab.info/Elements/",rdaterm:"http://rdaregistry.info/termList/RDATerms/",gts:"http://resource.geosciml.org/ontology/timescale/gts#",rdasco:"http://rdaregistry.info/termList/soundCont/",fnabox:"http://www.ontologydesignpatterns.org/ont/framenet/abox/",ttp:"http://eample.com/test#",esadm:"http://vocab.linkeddata.es/datosabiertos/def/sector-publico/territorio#",dsn:"http://purl.org/dsnotify/vocab/eventset/",rofch:"http://rdaregistry.info/termList/rofch/",td5:"http://td5.org/#",organ:"http://www.univalle.edu.co/ontologies/Organ#",nlon:"http://lod.nl.go.kr/ontology/",tsn:"http://purl.org/net/tsn#",eem:"http://purl.org/eem#",rofem:"http://rdaregistry.info/termList/rofem/",eccauth:"https://vocab.eccenca.com/auth/",task:"http://deductions.github.io/task-management.owl.ttl#",iana:"http://www.iana.org/assignments/relation/",kml:"http://www.opengis.net/kml/2.2#",door:"http://kannel.open.ac.uk/ontology#",ruto:"http://rdfunit.aksw.org/ns/core#",hr:"http://iserve.kmi.open.ac.uk/ns/hrests#",jpost:"http://rdf.jpostdb.org/ontology/jpost.owl#",logies:"https://data.vlaanderen.be/ns/logies#",ubiq:"http://server.ubiqore.com/ubiq/core#",eccrev:"https://vocab.eccenca.com/revision/",oplweb:"http://www.openlinksw.com/schemas/oplweb#",dcx:"http://dublincore.org/dcx/",rofer:"http://rdaregistry.info/termList/rofer/",navm:"https://w3id.org/navigation_menu#",sakthi:"http://infotech.nitk.ac.in/research-scholars/sakthi-murugan-r/",ssno:"http://www.w3.org/ns/ssn/",rvz:"http://rdfvizler.dyreriket.xyz/vocabulary/core#",lslife:"http://ontology.cybershare.utep.edu/ELSEWeb/elseweb-lifemapper.owl#",diag:"http://www.loc.gov/zing/srw/diagnostic/",oxi:"http://omerxi.com/ontologies/core.owl.ttl#",datex:"http://vocab.datex.org/terms#",pato:"http://purl.obolibrary.org/obo/",lawd:"http://lawd.info/ontology/",newsevents:"http://www.aifb.uni-karlsruhe.de/WBS/uhe/ontologies#",agrovoc:"http://aims.fao.org/aos/agrovoc/",cdao:"http://purl.obolibrary.org/obo/",bb:"http://www.snik.eu/ontology/bb/",sdt:"http://statisticaldata.linkedwidgets.org/terms/",led:"http://led.kmi.open.ac.uk/term/",lmx:"http://www.w3.org/XML/1998/namespace/",mmoon:"http://mmoon.org/mmoon/",munc:"http://ns.inria.fr/munc#",fuseki:"http://jena.apache.org/fuseki#",studiop:"http://purl.org/resource/pilatesstudio/",fntbox:"http://www.ontologydesignpatterns.org/ont/framenet/tbox/",tix:"http://toptix.com/2010/esro/",geojson:"https://purl.org/geojson/vocab#",hva:"http://www.ebusiness-unibw.org/ontologies/hva/ontology#",lheo:"http://www.conjecto.com/ontology/2015/lheo#",fr:"https://w3id.org/fr/def/core#",mexv:"http://mex.aksw.org/mex-algo#",ldl:"https://w3id.org/ldpdl/ns#",ruian:"https://data.cssz.cz/ontology/ruian/",esapar:"http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/aparcamiento#",rdapmt:"http://rdaregistry.info/termList/prodTactile/",csdbp:"http://cs.dbpedia.org/",onisep:"http://rdf.onisep.fr/resource/",efrbroo:"http://erlangen-crm.org/efrbroo/",literal:"http://www.essepuntato.it/2010/06/literalreification/",figigii:"http://www.omg.org/spec/FIGI/GlobalInstrumentIdentifiers/",tb:"https://w3id.org/timebank#",spcm:"http://spi-fm.uca.es/spdef/models/deployment/spcm/1.0#",vidont:"http://vidont.org/",oplres:"http://www.openlinksw.com/ontology/restrictions#",sirene:"https://sireneld.io/vocab/sirene#",rdaemm:"http://rdaregistry.info/termList/emulsionMicro/",fdbp:"http://fr.dbpedia.org/property/",cwl:"https://w3id.org/cwl/cwl#",voidext:"http://rdfs.org/ns/void-ext#",whisky:"http://vocab.org/whisky/terms/",rdag3:"http://rdvocab.info/ElementsGr3/",sgg:"http://www.springernature.com/scigraph/graphs/",planet:"http://dbpedia.org/",lswpm:"http://ontology.cybershare.utep.edu/ELSEWeb/elseweb-lifemapper-parameters.owl#",webac:"http://fedora.info/definitions/v4/webac#",bbccore:"http://www.bbc.co.uk/ontologies/coreconcepts/",orcid:"http://orcid.org/",oils:"http://lemon-model.net/oils#",hello:"https://www.youtube.com/user/SuperTellAFriend/featured/",ago:"http://awesemantic-geo.link/ontology/",pid:"http://permid.org/ontology/organization/",owl2xml:"http://www.w3.org/2006/12/owl2-xml#",traffic:"http://www.sensormeasurement.appspot.com/ont/transport/traffic#",lswmo:"http://ontology.cybershare.utep.edu/ELSEWeb/elseweb-modelling.owl#",dbug:"http://ontologi.es/doap-bugs#",roadmap:"http://mappings.roadmap.org/",umls:"http://bioportal.bioontology.org/ontologies/umls/",gdc:"https://portal.gdc.cancer.gov/cases/",ldt:"https://www.w3.org/ns/ldt#",faostat:"http://reference.eionet.europa.eu/faostat/schema/",open311:"http://ontology.eil.utoronto.ca/open311#",rdfdata:"http://rdf.data-vocabulary.org/rdf.xml#",dicom:"http://purl.org/healthcarevocab/v1#",videogame:"http://purl.org/net/vgo#",vogd:"http://ogd.ifs.tuwien.ac.at/vienna/geo/",bibrm:"http://vocab.ub.uni-leipzig.de/bibrm/",oliasystem:"http://purl.org/olia/system.owl#",physo:"http://merlin.phys.uni.lodz.pl/onto/physo/physo.owl#",radar:"http://www.radar-projekt.org/display/",tui:"http://data.ifs.tuwien.ac.at/study/resource/",apf:"http://jena.apache.org/ARQ/property#",customer:"http://www.valuelabs.com/",yd:"https://yodata.io/",conll:"http://ufal.mff.cuni.cz/conll2009-st/task-description.html#",si:"http://sisteminformasi.com/",mbgd:"http://mbgd.genome.ad.jp/owl/mbgd.owl#",meeting:"http://www.w3.org/2002/07/meeting#",aprov:"http://purl.org/a-proc#",rofrr:"http://rdaregistry.info/termList/rofrr/",pp:"http://peoplesplaces.de/ontology#",escjr:"http://vocab.linkeddata.es/datosabiertos/def/urbanismo-infraestructuras/callejero#",ndnp:"http://chroniclingamerica.loc.gov/terms#",ja:"http://jena.hpl.hp.com/2005/11/Assembler#",jerm:"http://jermontology.org/ontology/JERMOntology#",vocnet:"http://schema.vocnet.org/",iati:"http://purl.org/collections/iati/",bbccms:"http://www.bbc.co.uk/ontologies/cms/",url:"http://schema.org/",mls:"http://www.w3.org/ns/mls#",rdaz:"http://rdaregistry.info/Elements/z/",eccdi:"https://vocab.eccenca.com/di/",cpov:"http://data.europa.eu/m8g/",uom:"http://www.opengis.net/def/uom/OGC/1.0/",rdabf:"http://rdaregistry.info/termList/bookFormat/",bpo:"https://w3id.org/bpo#",memento:"http://mementoweb.org/ns#",doacc:"http://purl.org/net/bel-epa/doacc#",religion:"http://rdf.muninn-project.org/ontologies/religion#",itm:"http://spi-fm.uca.es/spdef/models/genericTools/itm/1.0#",hdo:"http://www.samos.gr/ontologies/helpdeskOnto.owl#",omg:"https://w3id.org/omg#",gg:"http://www.gemeentegeschiedenis.nl/gg-schema#",lemonuby:"http://lemon-model.net/lexica/uby/",afr:"http://purl.allotrope.org/ontologies/result#",glycan:"http://purl.jp/bio/12/glyco/glycan#",fred:"http://www.ontologydesignpatterns.org/ont/fred/domain.owl#",scco:"http://rdf.ebi.ac.uk/terms/surechembl#",nobel:"http://data.nobelprize.org/terms/",ensembl:"http://rdf.ebi.ac.uk/resource/ensembl/",cim:"http://iec.ch/TC57/2013/CIM-schema-cim16#",ln:"https://w3id.org/ln#",sfd:"http://semantic-forms.cc:9112/ldp/",numbers:"http://km.aifb.kit.edu/projects/numbers/",dicera:"http://semweb.mmlab.be/ns/dicera#",wimpo:"http://rdfex.org/withImports?uri=",reg:"http://purl.org/linked-data/registry#",lfov:"https://w3id.org/legal_form#",gns:"http://sws.geonames.org/",esair:"http://vocab.linkeddata.es/datosabiertos/def/medio-ambiente/calidad-aire#",cocoon:"https://w3id.org/cocoon/v1.0#",r3d:"http://www.re3data.org/schema/3-0#",pdf:"http://ns.adobe.com/pdf/1.3/",rpath:"https://w3id.org/lodsight/rdf-path#",ethc:"http://ethoinformatics.org/ethocore/",cbim:"http://www.coinsweb.nl/cbim-2.0.rdf#",amt:"http://academic-meta-tool.xyz/vocab#",dpn:"http://purl.org/dpn#",ofrd:"http://purl.org/opdm/refrigerator#",lgdm:"http://linkedgeodata.org/meta/",its:"http://www.w3.org/2005/11/its/rdf#",gont:"https://gont.ch/",frgeo:"http://rdf.insee.fr/geo/",volt:"http://volt-name.space/ontology/",ioto:"http://www.irit.fr/recherches/MELODI/ontologies/IoT-O#",rdalay:"http://rdaregistry.info/termList/layout/",yaco:"https://www.irit.fr/recherches/MELODI/ontologies/cinema#",lmf:"http://www.lexinfo.net/lmf#",rdaar:"http://rdaregistry.info/termList/AspectRatio/",pep:"https://w3id.org/pep/",dataid:"http://dataid.dbpedia.org/ns/core#",rdacarx:"http://rdaregistry.info/termList/RDACarrierEU/",fp3:"http://vocab.fusepool.info/fp3#",esservicio:"http://vocab.linkeddata.es/datosabiertos/def/sector-publico/servicio#",tx:"http://swtmp.gitlab.io/vocabulary/templates.owl#",datacite:"http://purl.org/spar/datacite/",markus:"http://www.markus.com/",cue:"http://www.clarin.eu/cmdi/cues/display/1.0#",odapps:"http://semweb.mmlab.be/ns/odapps#",llont:"http://www.linklion.org/ontology#",audit:"http://fedora.info/definitions/v4/audit#",biml:"http://schemas.varigence.com/biml.xsd#",seeds:"http://deductions.github.io/seeds.owl.ttl#",pmo:"http://premon.fbk.eu/ontology/core#",amsl:"http://vocab.ub.uni-leipzig.de/amsl/",provinsi:"http://provinsi.com/",ttla:"https://w3id.org/ttla/",mexcore:"http://mex.aksw.org/mex-core#",opa:"https://w3id.org/laas-iot/adream#",imo:"http://imgpedia.dcc.uchile.cl/ontology#",eame:"http://www.semanticweb.org/ontologia_EA#",opllog:"http://www.openlinksw.com/ontology/logging#",ver:"https://w3id.org/version/ontology#",add:"http://www.datatourisme.fr/ontology/core/1.0#",alethio:"http://aleth.io/",rofsm:"http://rdaregistry.info/termList/rofsm/",h2o:"http://def.seegrid.csiro.au/isotc211/iso19150/-2/2012/basic#",tree:"https://w3id.org/tree#",huto:"http://ns.inria.fr/huto/",svcs:"http://rdfs.org/sioc/services#",piero:"http://reactionontology.org/piero/",bdo:"http://purl.bdrc.io/ontology/core/",vir:"http://w3id.org/vir#",um:"http://intelleo.eu/ontologies/user-model/ns/",da:"https://www.wowman.org/index.php?id=1&type=get#",uby:"http://purl.org/olia/ubyCat.owl#",lyon:"http://dbpedia.org/resource/Lyon/",naval:"http://rdf.muninn-project.org/ontologies/naval#",system:"http://www.univalle.edu.co/ontologies/System#",vplan:"http://www.ifs.tuwien.ac.at/~miksa/ontologies/VPlan.owl#",az:"https://w3id.org/people/az/",dk:"http://www.data-knowledge.org/dk/schema/rdf/latest/",cwork:"http://www.bbc.co.uk/ontologies/creativework/",wde:"http://www.wikidata.org/entity/",lovc:"https://w3id.org/lovcube/ns/lovcube#",geovoid:"http://purl.org/geovocamp/ontology/geovoid/",composer:"http://dbpedia.org/ontology/composer/",tadirah:"http://tadirah.dariah.eu/vocab/",travel:"http://www.co-ode.org/roberts/travel.owl#",imind:"http://schema.intellimind.ns/symbology#",afm:"http://purl.allotrope.org/ontologies/material/",eepsa:"https://w3id.org/eepsa#",owms:"http://standaarden.overheid.nl/owms/terms/",bdc:"http://dbpedia.org/resource/Category:",minim:"http://purl.org/minim/minim#",frappe:"http://streamreasoning.org/ontologies/frappe#",rofid:"http://rdaregistry.info/termList/rofid/",rls:"https://w3id.org/lovcube/ns/relovstats#",b3kat:"http://lod.b3kat.de/title/",rdafnv:"http://rdaregistry.info/termList/noteForm/",uneskos:"http://purl.org/voc/uneskos#",sdshare:"http://www.sdshare.org/2012/extension/",vacseen1:"http://www.semanticweb.org/parthasb/ontologies/2014/6/vacseen1/",qms:"http://data.europa.eu/esco/qms#",koly:"http://www.ensias.ma/",l2sp:"http://www.linked2safety-project.eu/properties/",tgm:"http://id.loc.gov/vocabulary/graphicMaterials/",cwlprov:"https://w3id.org/cwl/prov#",rofin:"http://rdaregistry.info/termList/rofin/",rofit:"http://rdaregistry.info/termList/rofit/",eol:"http://purl.org/biodiversity/eol/",ecore:"http://www.eclipse.org/emf/2002/Ecore#",dpv:"http://www.w3.org/ns/dpv#",alice:"http://example.org/",rdapm:"http://rdaregistry.info/termList/RDAproductionMethod/",county:"http://myexample.org/county#",gbol:"http://gbol.life/0.1#",sdmxcode:"http://purl.org/linked-data/sdmx/2009/code#",ims:"http://www.imsglobal.org/xsd/imsmd_v1p2/",ecoll:"http://purl.org/ceu/eco/1.0#",pcit:"http://public-contracts.nexacenter.org/id/propertiesRole/",tarql:"http://tarql.github.io/tarql#",mydb:"http://mydb.org/",id:"http://identifiers.org/",scho:"http://www.scholarlydata.org/ontology/conference-ontology.owl#",duv:"http://www.w3.org/ns/duv#",oplacl:"http://www.openlinksw.com/ontology/acl#",mexalgo:"http://mex.aksw.org/mex-algo#",assoc:"https://w3id.org/associations/vocab#",fun:"http://w3id.org/sparql-generate/fn/",rofrt:"http://rdaregistry.info/termList/rofrt/",meshv:"http://id.nlm.nih.gov/mesh/vocab#",lgt:"http://linkedgadget.com/wiki/Property:",fhir:"http://hl7.org/fhir/",qkdv:"http://qudt.org/vocab/dimensionvector/",rgml:"http://purl.org/puninj/2001/05/rgml-schema#",hasneto:"http://hadatac.org/ont/hasneto#",vehma:"http://deductions.github.io/vehicule-management.owl.ttl#",rdaspc:"http://rdaregistry.info/termList/specPlayback/",conference:"https://w3id.org/scholarlydata/ontology/conference-ontology.owl#",swa:"http://topbraid.org/swa#",uri4uri:"http://uri4uri.net/vocab#",juso:"http://rdfs.co/juso/",bblfish:"http://bblfish.net/people/henry/card#",pmhb:"http://pmhb.org/",cpi:"http://www.ebusiness-unibw.org/ontologies/cpi/ns#",semiot:"http://w3id.org/semiot/ontologies/semiot#",dcosample:"http://info.deepcarbon.net/sample/schema#",mmm:"http://www.mico-project.eu/ns/mmm/2.0/schema#",irsteaont:"http://ontology.irstea.fr/weather/ontology#",yso:"http://www.yso.fi/onto/yso/",brk:"http://brk.basisregistraties.overheid.nl/def/brk#",rdaft:"http://rdaregistry.info/termList/fileType/",smxm:"http://smxm.ga/",mobivoc:"http://schema.mobivoc.org/",rdabs:"http://rdaregistry.info/termList/broadcastStand/",rvl:"http://purl.org/rvl/",ipsv:"http://id.esd.org.uk/list/",dsw:"http://purl.org/dsw/",iiif:"http://iiif.io/api/image/2#",odf:"http://docs.oasis-open.org/ns/office/1.2/meta/odf#",drk:"http://drakon.su/",itcat:"http://th-brandenburg.de/ns/itcat#",pmonb:"http://premon.fbk.eu/ontology/nb#",pmofn:"http://premon.fbk.eu/ontology/fn#",ilap:"http://data.posccaesar.org/ilap/",gvoith:"http://assemblee-virtuelle.github.io/grands-voisins-v2/thesaurus.ttl#",dead:"http://utpl.edu.ec/sbc/data/",adf:"http://purl.allotrope.org/ontologies/datapackage#",emergelm:"http://purl.org/emergel/modules#",mandaat:"http://data.vlaanderen.be/ns/mandaat#",sorg:"http://schema.org/",irstea:"http://ontology.irstea.fr/",dto:"http://www.datatourisme.fr/ontology/core/1.0#",maeco:"http://edg.topbraid.solutions/maeco/",rofrm:"http://rdaregistry.info/termList/rofrm/",dwciri:"http://rs.tdwg.org/dwc/iri/",alg:"http://drakon.su/ADF#",tosh:"http://topbraid.org/tosh#",shui:"https://vocab.eccenca.com/shui/",sdmxm:"http://purl.org/linked-data/sdmx/2009/measure#",neotec:"http://neotec.rc.unesp.br/resource/Neotectonics/",vam:"http://www.metmuseum.org/",lgdt:"http://linkedgeodata.org/triplify/",chear:"http://hadatac.org/ont/chear#",oplli:"http://www.openlinksw.com/schemas/linkedin#",besluit:"http://data.vlaanderen.be/ns/besluit#",srx:"http://www.w3.org/2005/sparql-results#",ondc:"http://www.semanticweb.org/ontologies/2012/1/Ontology1329913965202.owl#",tavprov:"http://ns.taverna.org.uk/2012/tavernaprov/",nkos:"http://w3id.org/nkos#",bds:"http://www.bigdata.com/rdf/search#",gobierno:"http://www.gobierno.es/gobierno/",persee:"http://data.persee.fr/ontology/persee_ontology/",dm2e:"http://onto.dm2e.eu/schemas/dm2e/",ctrl:"https://w3id.org/ibp/CTRLont#",sfn:"http://semweb.datasciencelab.be/ns/sfn#",or:"http://openresearch.org/vocab/",fluidops:"http://www.fluidops.com/",clapit:"http://dati.gov.it/onto/clapit/",nih:"http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#",one:"https://bioportal.bioontology.org/ontologies/ONE/",pfeepsa:"https://w3id.org/pfeepsa#",nature:"http://deductions.github.io/nature_observation.owl.ttl#",pm:"http://premon.fbk.eu/resource/",rofhf:"http://rdaregistry.info/termList/rofhf/",timex:"http://data.wu.ac.at/ns/timex#",summa:"http://purl.org/voc/summa/",wdtn:"http://www.wikidata.org/prop/direct-normalized/",ppr:"http://purl.org/datanode/ppr/ns/",vsearch:"http://vocab.sti2.at/vsearch#",undata:"http://citydata.wu.ac.at/Linked-UNData/data/",oplwebsrv:"http://www.openlinksw.com/ontology/webservices#",dbfo:"http://dbpedia.org/facts/ontology#",ncicp:"http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#",voidex:"http://www.swi-prolog.org/rdf/library/",esproc:"http://vocab.linkeddata.es/datosabiertos/def/sector-publico/procedimientos#",isbdu:"http://iflastandards.info/ns/isbd/unc/elements/",metadata:"http://purl.oreilly.com/ns/meta/",scholl:"http://menemeneml.com/school#",veo:"http://linkeddata.finki.ukim.mk/lod/ontology/veo#",olac11:"http://www.language-archives.org/OLAC/1.1/",mem:"http://mementoweb.org/ns#",pcdm:"http://pcdm.org/models#",rdfp:"https://w3id.org/rdfp/",edac:"http://ontology.cybershare.utep.edu/ELSEWeb/elseweb-edac.owl#",legal:"http://www.w3.org/ns/legal#",sgfn:"http://w3id.org/sparql-generate/fn/",rdax:"http://rdaregistry.info/Elements/x/",cubeont:"http://ontology.cube.global/",input:"http://volt-name.space/vocab/input#",ctxdesc:"http://www.demcare.eu/ontologies/contextdescriptor.owl#",brt:"http://brt.basisregistraties.overheid.nl/def/top10nl#",osd:"http://a9.com/-/spec/opensearch/1.1/",ldn:"https://www.w3.org/TR/ldn/#",iter:"http://w3id.org/sparql-generate/iter/",semsur:"http://purl.org/SemSur/",lsq:"http://lsq.aksw.org/vocab#",oplbenefit:"http://www.openlinksw.com/ontology/benefits#",pmovn:"http://premon.fbk.eu/ontology/vn#",lmu:"https://w3id.org/laas-iot/lmu#",ispra:"http://dati.isprambiente.it/ontology/core#",rdapf:"http://rdaregistry.info/termList/presFormat/",cog:"http://purl.org/ontology/cco/core#",remetca:"http://www.purl.org/net/remetca#",mwapi:"https://www.mediawiki.org/ontology#API/",vocals:"http://w3id.org/rsp/vocals#",ucum:"http://purl.oclc.org/NET/muo/ucum/",pand:"http://bag.basisregistraties.overheid.nl/bag/id/pand/",geoloc:"http://deductions.github.io/geoloc.owl.ttl#",beer:"http://beer.com/",edg:"http://edg.topbraid.solutions/model/",refexo:"http://purl.jp/bio/01/refexo#",it:"http://www.influencetracker.com/ontology#",physics:"http://www.astro.umd.edu/~eshaya/astro-onto/owl/physics.owl#",wdv:"http://www.wikidata.org/value/",km4c:"http://www.disit.org/km4city/schema#",neotecbib:"http://neotec.rc.unesp.br/resource/NeotectonicsBibliography/",spv:"http://completeness.inf.unibz.it/sp-vocab#",edgarcik:"http://edgarwrap.ontologycentral.com/cik/",wail:"http://www.eyrie.org/~zednenem/2002/wail/",aozora:"http://purl.org/net/aozora/",sdmxc:"http://purl.org/linked-data/sdmx/2009/concept#",dcodt:"http://info.deepcarbon.net/datatype/schema#",swrc2:"https://www.cs.vu.nl/~mcaklein/onto/swrc_ext/2005/05#",fnom:"https://w3id.org/function/vocabulary/mapping#",bkb:"https://budayakb.cs.ui.ac.id/ns#",cff:"http://purl.oclc.org/NET/ssnx/cf/cf-feature#",roc:"https://w3id.org/ro/curate#",gdpr:"https://vocab.eccenca.com/gdpr/",rami:"http://iais.fraunhofer.de/vocabs/rami#",elod:"http://linkedeconomy.org/ontology#",nosql:"http://purl.org/db/nosql#",oplstocks:"http://www.openlinksw.com/ontology/stocks#",sgiter:"http://w3id.org/sparql-generate/iter/",bioentity:"http://bioentity.io/vocab/",dsv:"https://w3id.org/dsv#",asawoo:"http://liris.cnrs.fr/asawoo/",mus:"http://data.doremus.org/ontology#",cska:"http://pfclitex.com/",s4syst:"https://saref.etsi.org/saref4syst/",ido:"http://purl.obolibrary.org/obo/ido.owl#",provoc:"http://ns.inria.fr/provoc/",dsfv:"http://sws.ifi.uio.no/vocab/dsf/henriwi/dsf#",docker:"http://www.w3.org/ns/bde/docker/",ldqm:"http://linkeddata.es/resource/ldqm/",lg:"https://purl.org/lg/",isidore:"http://www.rechercheisidore.fr/class/",seo:"http://sda.tech/SEOontology/SEO/",changeset:"http://purl.org/vocab/changeset/schema#",dcap:"http://purl.org/ws-mmi-dc/terms/",eccpubsub:"https://vocab.eccenca.com/pubsub/",aml:"https://w3id.org/i40/aml#",swcomp:"https://github.com/ali1k/ld-reactor/blob/master/vocabulary/index.ttl#",connard:"https://mail.google.com/mail/u/1/#",dcodata:"http://info.deepcarbon.net/data/schema#",wikimedia:"http://upload.wikimedia.org/wikipedia/commons/f/f6/",rdacpc:"http://rdaregistry.info/termList/configPlayback/",rdaill:"http://rdaregistry.info/termList/IllusContent/",globalcube:"http://kalmar32.fzi.de/triples/global-cube.ttl#",devuan:"https://devuan.net.br/",ns2:"http://ogp.me/ns#video:",sdterms:"http://statisticaldata.linkedwidgets.org/terms/",dbms:"http://www.openlinksw.com/ontology/dbms-app-ontology#",edr:"https://w3id.org/laas-iot/edr#",loted:"http://loted.eu/ontology#",nno:"https://w3id.org/nno/ontology#",rm:"http://jazz.net/ns/rm#",ca:"http://complyadvantage.com/",wab:"http://wab.uib.no/cost-a32_philospace/wittgenstein.owl#",xslopm:"http://purl.org/net/opmv/types/xslt#",master1:"http://idl.u-grenoble3.fr/",number:"http://km.aifb.kit.edu/projects/numbers/number#",bld:"http://biglinkeddata.com/",d3s:"http://vocbench.solidaridad.cloud/taxonomies#",psv:"http://www.wikidata.org/prop/statement/value/",wsdl:"http://www.w3.org/ns/wsdl-rdf#",vort:"http://rockets.topbraid.solutions/vort/",iso37120:"http://ontology.eil.utoronto.ca/ISO37120.owl#",bdr:"http://purl.bdrc.io/resource/",bob:"http://good.dad/meaning/bob#",ldq:"http://www.linkeddata.es/ontology/ldq#",ifcowl:"http://www.buildingsmart-tech.org/ifcOWL/IFC4_ADD2#",rdare:"http://rdaregistry.info/termList/RDARegionalEncoding/",aseonto:"http://requirement.ase.ru/requirements_ontology#",meat:"http://example.com/",qbe:"http://citydata.wu.ac.at/qb-equations#",maet:"http://edg.topbraid.solutions/taxonomy/macroeconomics/",dby:"http://dbpedia.org/class/yago/",s4ee:"https://w3id.org/saref4ee#",unspsc:"http://ontoview.org/schema/unspsc/1#",efd:"http://data.foodanddrinkeurope.eu/ontology#",trao:"http://linkeddata.finki.ukim.mk/lod/ontology/tao#",rdagen:"http://rdaregistry.info/termList/RDAGeneration/",pbody:"http://reference.data.gov.uk/def/public-body/",aksw:"http://aksw.org/",otl:"https://w3id.org/opentrafficlights#",ontop:"https://w3id.org/ontop/",wn30:"http://purl.org/vocabularies/princeton/wn30/",spvqa:"https://bmake.th-brandenburg.de/spv#",rofim:"http://rdaregistry.info/termList/rofim/",w3cgeo:"http://www.w3.org/2003/01/geo/wgs84_pos#",eustd:"http://eurostat.linked-statistics.org/data#",rdavf:"http://rdaregistry.info/termList/videoFormat/",noise:"http://vocab.linkeddata.es/datosabiertos/def/medio-ambiente/contaminacion-acustica#",datacron:"http://www.datacron-project.eu/datAcron#",pop:"http://wiki.dbpedia.org/",rofsf:"http://rdaregistry.info/termList/rofsf/",geo7:"https://www.geo7.ch/",marcrole:"http://id.loc.gov/vocabulary/relators/",ksam:"http://kulturarvsdata.se/ksamsok#",geor:"http://www.opengis.net/def/rule/geosparql/",rfd:"http://com.intrinsec//ontology#",rdacdt:"http://rdaregistry.info/termList/RDACartoDT/",foaffff:"http://gogl.com/",imas:"https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#",tissue:"http://www.univalle.edu.co/ontologies/Tissue#",sohukd:"http://sweetontology.net/humanKnowledgeDomain/",halyard:"http://merck.github.io/Halyard/ns#",ul:"http://underlay.mit.edu/ns/",idot:"http://identifiers.org/idot/",sciprov:"http://sweetontology.net/reprSciProvenance/",ncbigene:"http://identifiers.org/ncbigene/",emergel:"http://purl.org/emergel/core#",apb:"http://www.analysispartners.org/businessmodel/",bsh:"https://brickschema.org/schema/1.1.0/BrickShape#",powla:"http://purl.org/powla/powla.owl#",ods:"http://lod.xdams.org/ontologies/ods/",atlasterms:"http://rdf.ebi.ac.uk/terms/atlas/",dnbt:"http://d-nb.info/standards/elementset/dnb#",estatwrap:"http://ontologycentral.com/2009/01/eurostat/ns#",llr:"http://lodlaundromat.org/resource/",phy:"https://w3id.org/skgo/phy#",obws:"http://delicias.dia.fi.upm.es/ontologies/ObjectWithStates.owl#",llalg:"http://www.linklion.org/algorithm/",esagen:"http://vocab.ciudadesabiertas.es/def/sector-publico/agenda-municipal#",rsctx:"http://softeng.polito.it/rsctx#",rico:"https://www.ica.org/standards/RiC/ontology#",goaf:"http://goaf.fr/goaf#",soma:"http://sweetontology.net/matr/",dpla:"http://dp.la/info/developers/map/",pmopb:"http://premon.fbk.eu/ontology/pb#",kmgeo:"http://km.aifb.kit.edu/services/geo/ontology#",crmeh:"http://purl.org/crmeh#",dm:"http://datamusee.givingsense.eu/onto/",fnml:"http://semweb.mmlab.be/ns/fnml#",ermrk:"http://www.essepuntato.it/2008/12/earmark#",eproc:"http://10.0.3.120/download/eproc_FORN_v02.owl#",bci:"https://w3id.org/BCI-ontology#",dgfr:"http://colin.maudry.com/ontologies/dgfr#",valueflows:"https://w3id.org/valueflows/",oop:"http://w3id.org/oop#",manto:"http://com.vortic3.MANTO/",r4r:"http://guava.iis.sinica.edu.tw/r4r/",modsci:"https://w3id.org/skgo/modsci#",rdaad:"http://rdaregistry.info/Elements/a/datatype/",decprov:"http://promsns.org/def/decprov#",scra:"http://purl.org/net/schemarama#",dqc:"http://semwebquality.org/ontologies/dq-constraints#",gvoi:"http://assemblee-virtuelle.github.io/grands-voisins-v2/gv.owl.ttl#",dcatnl:"http://standaarden.overheid.nl/dcatnl/terms/",oplangel:"http://www.openlinksw.com/schemas/angel#",loci:"http://linked.data.gov.au/def/loci#",daap:"http://daap.dsi.universite-paris-saclay.fr/wiki/",literature:"http://purl.org/net/cnyt-literature#",estatgph:"http://estatwrap.ontologycentral.com/id/nama_aux_gph#",ocds:"http://purl.org/onto-ocds/ocds#",fssp:"http://linkeddata.fssprus.ru/resource/",s3n:"http://w3id.org/s3n/",orgesv2:"http://datos.gob.es/sites/default/files/OntologiaDIR3/orges.owl#",oup:"http://purl.org/ontology-use-patterns#",cbb:"https://data.cbb.omgeving.vlaanderen.be/ns/cbb#",theme:"http://voc.odw.tw/theme/",estrf:"http://vocab.linkeddata.es/datosabiertos/def/transporte/trafico#",vss:"http://automotive.eurecom.fr/vsso#",rofet:"http://rdaregistry.info/termList/rofet/",imjv:"https://data.imjv.omgeving.vlaanderen.be/ns/imjv#",voidwh:"http://www.ics.forth.gr/isl/VoIDWarehouse/VoID_Extension_Schema.owl#",occ:"http://w3id.org/occ#",gmo:"http://purl.jp/bio/10/gmo/",ideotalex:"http://www.ideotalex.eu/datos/recurso/",nas:"https://data.nasa.gov/ontologies/atmonto/NAS#",xbrll:"https://w3id.org/vocab/xbrll#",ii:"http://sparql.cwrc.ca/ontologies/ii#",iotlite:"http://purl.oclc.org/NET/UNIS/fiware/iot-lite#",dmp:"http://www.sysresearch.org/rda-common-dmp#",rimmf:"http://rimmf.com/vocab/",ogdl4m:"https://github.com/martynui/OGDL4M/",odw:"http://odw.tw/",tikag:"https://www.tikag.com/",qk:"http://qudt.org/vocab/quantitykind/",somaoc:"http://sweetontology.net/matrOrganicCompound/",tsnchange:"http://purl.org/net/tsnchange#",crminf:"http://www.cidoc-crm.org/cidoc-crm/CRMinf/",prohow:"https://w3id.org/prohow#",hosp:"http://health.data.gov/def/hospital/",gdprov:"https://w3id.org/GDPRov#",lcsh:"http://id.loc.gov/authorities/subjects/",ecowlim:"http://ecowlim.tfri.gov.tw/lode/resource/",pham:"https://w3id.org/skgo/pham#",nrv:"http://ns.inria.fr/nrv#",gdprtext:"https://w3id.org/GDPRtEXT#",geofabric:"http://linked.data.gov.au/def/geofabric#",gnaf:"http://linked.data.gov.au/def/gnaf#",soproptg:"http://sweetontology.net/propTemperatureGradient/",snac:"http://socialarchive.iath.virginia.edu/",linkrel:"https://www.w3.org/ns/iana/link-relations/relation#",smartapi:"http://smart-api.io/ontology/1.0/smartapi#",ccp:"http://cookingbigdata.com/linkeddata/ccpricing#",oplp:"http://www.openlinksw.com/ontology/purchases#",terms:"http://purl.org/dc/terms/",yandex:"http://yandex.ru/",soreaa:"http://sweetontology.net/realmAtmo/",mexperf:"http://mex.aksw.org/mex-perf#",omnlc:"http://open-multinet.info/ontology/omn-lifecycle#",sfl:"http://data.finlex.fi/schema/sfl/",eproc2:"http://10.0.3.120/download/eproc_FORN_v04.owl#",fel:"http://w3id.org/vcb/fel#",isaterms:"http://purl.org/isaterms/",cwlgit:"https://w3id.org/cwl/view/git/",esdbpr:"http://es.dbpedia.org/resource/",loupe:"http://ont-loupe.linkeddata.es/def/core/",bitl:"http://lib.bit.edu.cn/ontology/1.0/",iab:"https://www.iab.com/guidelines/taxonomy/",s4bldg:"https://w3id.org/def/saref4bldg#",shema:"http://schema.org/",isoadr:"http://reference.data.gov.au/def/ont/iso19160-1-address#",m3:"http://sensormeasurement.appspot.com/m3#",earth:"http://linked.earth/ontology#",ordo:"http://www.orpha.net/ORDO/",ontoneo:"http://purl.obolibrary.org/obo/ontoneo/",cwmo:"http://purl.org/cwmo/#",eqp:"https://data.nasa.gov/ontologies/atmonto/equipment#",lesa:"http://hadatac.org/ont/lesa#",gcon:"https://w3id.org/GConsent#",mdont:"http://ont.matchdeck.com/",wild:"http://purl.org/wild/vocab#",ddb:"http://www.deutsche-digitale-bibliothek.de/edm/",stx:"http://purl.org/cyber/stix#",pplan:"http://purl.org/net/p-plan#",jup:"http://w3id.org/charta77/jup/",sopropp:"http://sweetontology.net/propPressure/",pq:"http://www.wikidata.org/prop/qualifier/",m3lite:"http://purl.org/iot/vocab/m3-lite#",osys:"http://purl.org/olia/system.owl#",hctl:"https://www.w3.org/2019/wot/hypermedia#",stencila:"http://schema.stenci.la/",sopropsl:"http://sweetontology.net/propSpaceLocation/",biolink:"https://w3id.org/biolink/vocab/",lblodlg:"http://data.lblod.info/vocabularies/leidinggevenden/",capes:"http://vocab.capes.gov.br/def/vcav#",esgs:"https://w3id.org/edwin/ontology/",sostc:"http://sweetontology.net/stateChemical/",iaph:"http://www.juntadeandalucia.es/datosabiertos/portal/iaph/dataset/dataset/6c199ca2-8d2e-4c12-833c-f28",extech:"https://w3id.org/executionTechnique/ontology/",sostv:"http://sweetontology.net/stateVisibility/",soproptf:"http://sweetontology.net/propTimeFrequency/",frbroo:"http://iflastandards.info/ns/fr/frbr/frbroo/",sophatmowm:"https://sweetontology.net/phenAtmoWindMesoscale/",losp:"http://sparql.sstu.ru:3030/speciality/",medred:"http://w3id.org/medred/medred#",soprocsc:"http://sweetontology.net/procStateChange/",sopropsp:"http://sweetontology.net/propSpeed/",chemsci:"https://w3id.org/skgo/chemsci#",jsonschema:"https://www.w3.org/2019/wot/json-schema#",vehman:"http://deductions.github.io/vehicule-management.owl.ttl#",skoslex:"https://bp4mc2.org/def/skos-lex#",sorepsc:"http://sweetontology.net/reprSciComponent/",sopropsdis:"http://sweetontology.net/propSpaceDistance/",wotsec:"https://www.w3.org/2019/wot/security#",constant:"http://qudt.org/vocab/constant/",epplan:"https://w3id.org/ep-plan#",sorepsf:"http://sweetontology.net/reprSciFunction/",soreacz:"http://sweetontology.net/realmClimateZone/",sophsy:"http://sweetontology.net/phenSystem/",sorepmo:"http://sweetontology.net/reprMathOperation/",sweet:"http://sweetontology.net/",sosttf:"http://sweetontology.net/stateTimeFrequency/",sopropti:"http://sweetontology.net/propTime/",esagm:"http://vocab.ciudadesabiertas.es/def/sector-publico/agenda-municipal#",soprocp:"http://sweetontology.net/procPhysical/",eppl:"https://w3id.org/ep-plan#",sorelm:"http://sweetontology.net/relaMath/",sopropo:"http://sweetontology.net/propOrdinal/",eccf:"http://data.europa.eu/54i/",iospress:"http://ld.iospress.nl/rdf/ontology/",sorept:"http://sweetontology.net/reprTime/",dave:"http://theme-e.adaptcentre.ie/dave#",dentsci:"https://w3id.org/skgo/dentsci#",soproc:"http://sweetontology.net/proc/",soprops:"http://sweetontology.net/propSpace/",sorepsrs:"http://sweetontology.net/reprSpaceReferenceSystem/",sorepsl:"http://sweetontology.net/reprSciLaw/",soreaas:"http://sweetontology.net/realmAstroStar/",somamin:"http://sweetontology.net/matrMineral/",sophatmow:"http://sweetontology.net/phenAtmoWind/",sopropsdir:"http://sweetontology.net/propSpaceDirection/",sorelh:"http://sweetontology.net/relaHuman/",soreaofl:"http://sweetontology.net/realmOceanFloor/",sostth:"http://sweetontology.net/stateThermodynamic/",sorealc:"http://sweetontology.net/realmLandCoastal/",sorepscd:"http://sweetontology.net/reprSpaceCoordinate/",sopropi:"http://sweetontology.net/propIndex/",sohutr:"http://sweetontology.net/humanTechReadiness/",sostrr:"http://sweetontology.net/stateRoleRepresentative/",sohut:"http://sweetontology.net/humanTransportation/",sohur:"http://sweetontology.net/humanResearch/",pineapple:"http://hexananas.com/pineapple#",sophso:"http://sweetontology.net/phenSolid/",sorepmso:"http://sweetontology.net/reprMathSolution/",sophoc:"http://sweetontology.net/phenOceanCoastal/",sorepmg:"http://sweetontology.net/reprMathGraph/",sophfd:"http://sweetontology.net/phenFluidDynamics/",sopropr:"http://sweetontology.net/propRotation/",sorepmfo:"http://sweetontology.net/reprMathFunctionOrthogonal/",soprope:"http://sweetontology.net/propEnergy/",ldc:"https://tac.nist.gov/tracks/SM-KBP/2018/ontologies/SeedlingOntology#",sopropsh:"http://sweetontology.net/propSpaceHeight/",sorepsu:"http://sweetontology.net/reprSciUnits/",dprov:"http://promsns.org/def/do#",sorepdp:"http://sweetontology.net/reprDataProduct/",sorel:"http://sweetontology.net/rela/",sopropfr:"http://sweetontology.net/propFraction/",soreas:"http://sweetontology.net/realmSoil/",pcdmuse:"http://pcdm.org/use#",skosthes:"http://purl.org/iso25964/skos-thes#",asgs:"http://linked.data.gov.au/def/asgs#",foio:"https://w3id.org/seas/FeatureOfInterestOntology/",misp:"http://purl.org/cyber/misp#",somaae:"http://sweetontology.net/matrAerosol/",trek:"https://w3id.org/trek/",sostri:"http://sweetontology.net/stateRoleImpact/",sorear:"http://sweetontology.net/realmRegion/",sorelcl:"http://sweetontology.net/relaClimate/",inchikey:"https://identifiers.org/inchikey:",sophatmopc:"http://sweetontology.net/phenAtmoPrecipitation/",sohues:"http://sweetontology.net/humanEnvirStandards/",somanr:"http://sweetontology.net/matrNaturalResource/",sopropmf:"http://sweetontology.net/propMassFlux/",sorepm:"http://sweetontology.net/reprMath/",sopropcap:"http://sweetontology.net/propCapacity/",sorep:"http://sweetontology.net/repr/",sorelpr:"http://sweetontology.net/relaProvenance/",mccv:"http://purl.jp/bio/10/mccv#",probont:"http://www.probonto.org/ontology#",sopropfu:"http://sweetontology.net/propFunction/",sopropm:"http://sweetontology.net/propMass/",sopropb:"http://sweetontology.net/propBinary/",sostrt:"http://sweetontology.net/stateRoleTrust/",somarock:"http://sweetontology.net/matrRock/",sorepdsr:"http://sweetontology.net/reprDataServiceReduction/",sophel:"http://sweetontology.net/phenElecMag/",phto:"http://rhizomik.net/ontologies/PlantHealthThreats.owl.ttl#",sorelsp:"http://sweetontology.net/relaSpace/",sorelsc:"http://sweetontology.net/relaSci/",somais:"http://sweetontology.net/matrIsotope/",twitter:"http://stocktwits.com/",somaem:"http://sweetontology.net/matrElementalMolecule/",sostso:"http://sweetontology.net/stateSolid/",sopropef:"http://sweetontology.net/propEnergyFlux/",soreps:"http://sweetontology.net/reprSpace/",sost:"http://sweetontology.net/state/",sopropcat:"http://sweetontology.net/propCategorical/",d2s:"https://w3id.org/d2s/",proton:"http://www.ontotext.com/proton/",sosttg:"http://sweetontology.net/stateTimeGeologic/",sorealp:"http://sweetontology.net/realmLandProtected/",sorepsp:"http://sweetontology.net/reprSciProvenance/",somapl:"http://sweetontology.net/matrPlant/",sophatmos:"http://sweetontology.net/phenAtmoSky/",matvoc:"http://stream-ontology.com/matvoc/",sopropdifu:"http://sweetontology.net/propDiffusivity/",edupro:"http://ns.inria.fr/semed/eduprogression#",sorealo:"http://sweetontology.net/realmLandOrographic/",sophcr:"http://sweetontology.net/phenCryo/",sophec:"http://sweetontology.net/phenEcology/",sorepdf:"http://sweetontology.net/reprDataFormat/",sostsy:"http://sweetontology.net/stateSystem/",soph:"http://sweetontology.net/phen/",sorepsme:"http://sweetontology.net/reprSciMethodology/",sorepdsv:"http://sweetontology.net/reprDataServiceValidation/",sopropsm:"http://sweetontology.net/propSpaceMultidimensional/",soreahb:"http://sweetontology.net/realmHydroBody/",biogrid:"http://thebiogrid.org/",soprop:"http://sweetontology.net/prop/",sostb:"http://sweetontology.net/stateBiological/",sosto:"http://sweetontology.net/stateOrdinal/",sorelch:"http://sweetontology.net/relaChemical/",sopropcou:"http://sweetontology.net/propCount/",soreao:"http://sweetontology.net/realmOcean/",sorepmf:"http://sweetontology.net/reprMathFunction/",sorelph:"http://sweetontology.net/relaPhysical/",soreac:"http://sweetontology.net/realmCryo/",sophei:"http://sweetontology.net/phenEnvirImpact/",sophst:"http://sweetontology.net/phenStar/",sorelt:"http://sweetontology.net/relaTime/",sophcy:"http://sweetontology.net/phenCycle/",sorepdsg:"http://sweetontology.net/reprDataServiceGeospatial/",sorepmst:"http://sweetontology.net/reprMathStatistics/",soreabb:"http://sweetontology.net/realmBiolBiome/",somaind:"http://sweetontology.net/matrIndustrial/",sopropdife:"http://sweetontology.net/propDifference/",soreaaw:"http://sweetontology.net/realmAtmoWeather/",somac:"http://sweetontology.net/matrCompound/",somaw:"http://sweetontology.net/matrWater/",ciao:"http://ciao.it/",sohuj:"http://sweetontology.net/humanJurisdiction/",somains:"http://sweetontology.net/matrInstrument/",sophatmofo:"http://sweetontology.net/phenAtmoFog/",sopropq:"http://sweetontology.net/propQuantity/",sorepsd:"http://sweetontology.net/reprSpaceDirection/",atts:"https://data.nasa.gov/ontologies/atmonto/general#",sopropche:"http://sweetontology.net/propChemical/",sorepds:"http://sweetontology.net/reprDataService/",sorepts:"http://sweetontology.net/reprTimeSeason/",ingredient:"http://www.owl-ontologies.com/test.owl/ingredient/",sophft:"http://sweetontology.net/phenFluidTransport/",sophpc:"http://sweetontology.net/phenPlanetClimate/",sophatmoc:"http://sweetontology.net/phenAtmoCloud/",sophcm:"http://sweetontology.net/phenCycleMaterial/",sorepdsa:"http://sweetontology.net/reprDataServiceAnalysis/",sopropcon:"http://sweetontology.net/propConductivity/",osmm:"https://www.openstreetmap.org/meta/",sopropdr:"http://sweetontology.net/propDimensionlessRatio/",somael:"http://sweetontology.net/matrElement/",somarocki:"http://sweetontology.net/matrRockIgneous/",lprov:"http://id.learning-provider.data.ac.uk/terms#",donto:"http://reference.data.gov.au/def/ont/dataset#",sopropcha:"http://sweetontology.net/propCharge/",sophwn:"http://sweetontology.net/phenWaveNoise/",somaf:"http://sweetontology.net/matrFacility/",hdgi:"https://w3id.org/hdgi#",snomedct:"http://purl.bioontology.org/ontology/SNOMEDCT/",beo:"https://w3id.org/beo#",somab:"http://sweetontology.net/matrBiomass/",sophb:"http://sweetontology.net/phenBiol/",country:"http://eulersharp.sourceforge.net/2003/03swap/countries#",bldont:"http://ont.biglinkeddata.com/",sorepdm:"http://sweetontology.net/reprDataModel/",sostrg:"http://sweetontology.net/stateRoleGeographic/",somaeq:"http://sweetontology.net/matrEquipment/",sophod:"http://sweetontology.net/phenOceanDynamics/",somaen:"http://sweetontology.net/matrEnergy/",sohuecons:"http://sweetontology.net/humanEnvirConservation/",soreaabl:"http://sweetontology.net/realmAtmoBoundaryLayer/",sopropst:"http://sweetontology.net/propSpaceThickness/",soreal:"http://sweetontology.net/realmLandform/",gleio:"http://lei.info/gleio/",eupont:"http://elite.polito.it/ontologies/eupont.owl#",sophatmot:"http://sweetontology.net/phenAtmoTransport/",idsc:"https://w3id.org/idsa/code/",soman:"http://sweetontology.net/matrAnimal/",taxref:"http://taxref.mnhn.fr/lod/taxon/",somas:"http://sweetontology.net/matrSediment/",esbici:"http://vocab.ciudadesabiertas.es/def/transporte/bicicleta-publica#",sophatmol:"http://sweetontology.net/phenAtmoLightning/",istex:"https://data.istex.fr/ontology/istex#",sostf:"http://sweetontology.net/stateFluid/",mmms:"http://ldf.fi/schema/mmm/",sophatmofr:"http://sweetontology.net/phenAtmoFront/",sophsyc:"http://sweetontology.net/phenSystemComplexity/",soprocc:"http://sweetontology.net/procChemical/",sostre:"http://sweetontology.net/stateRealm/",sophw:"http://sweetontology.net/phenWave/",schoi:"https://w3id.org/scholarlydata/ontology/indicators-ontology.owl#",sosttc:"http://sweetontology.net/stateTimeCycle/",sostti:"http://sweetontology.net/stateTime/",soprocw:"http://sweetontology.net/procWave/",sophatmops:"http://sweetontology.net/phenAtmoPressure/",sostsb:"http://sweetontology.net/stateSpectralBand/",ocsw:"http://data.diekb.org/def/ocsw#",cci:"http://cookingbigdata.com/linkeddata/ccinstances#",sophr:"http://sweetontology.net/phenReaction/",atd:"https://data.nasa.gov/ontologies/atmonto/data#",dbm:"http://purl.org/net/dbm/ontology#",sostrc:"http://sweetontology.net/stateRoleChemical/",sophm:"http://sweetontology.net/phenMixing/",somaio:"http://sweetontology.net/matrIon/",osmt:"https://wiki.openstreetmap.org/wiki/Key:",sorepsg3:"http://sweetontology.net/reprSpaceGeometry3D/",sostsp:"http://sweetontology.net/stateSpace/",soreaah:"http://sweetontology.net/realmAstroHelio/",soreptd:"http://sweetontology.net/reprTimeDay/",cbs:"http://betalinkeddata.cbs.nl/def/cbs#",lv2:"http://lv2plug.in/ns/lv2core/",ggbn:"http://data.ggbn.org/schemas/ggbn/terms/",sohu:"http://sweetontology.net/human/",sophatmo:"http://sweetontology.net/phenAtmo/",sostrb:"http://sweetontology.net/stateRoleBiological/",sostdp:"http://sweetontology.net/stateDataProcessing/",sopropt:"http://sweetontology.net/propTemperature/",cfrl:"http://linkeddata.finki.ukim.mk/lod/ontology/cfrl#",sophfi:"http://sweetontology.net/phenFluidInstability/",mbkeys:"https://pastebin.com/ThBfphb8#",pnv:"https://w3id.org/pnv#",sophhe:"http://sweetontology.net/phenHelio/",ccomid:"http://www.ontologyrepository.com/CommonCoreOntologies/Mid/",sostp:"http://sweetontology.net/statePhysical/",omop:"http://api.ohdsi.org/WebAPI/vocabulary/concept/",rank:"http://www.ontotext.com/owlim/RDFRank#",sostef:"http://sweetontology.net/stateEnergyFlux/",sophen:"http://sweetontology.net/phenEnergy/",wds:"http://www.wikidata.org/entity/statement/",asio:"http://purl.org/hercules/asio/core#",sostss:"http://sweetontology.net/stateSpaceScale/",omim:"http://purl.bioontology.org/ontology/OMIM/",soreaer:"http://sweetontology.net/realmEarthReference/",soreaofe:"http://sweetontology.net/realmOceanFeature/",somapa:"http://sweetontology.net/matrParticle/",malaka:"http://george.gr/",sohueccont:"http://sweetontology.net/humanEnvirControl/",compub:"https://sireneld.io/vocab/compub#",sostst:"http://sweetontology.net/stateStorm/",she:"http://shacleditor.org/",sostro:"http://sweetontology.net/stateRole/",sophhy:"http://sweetontology.net/phenHydro/",sorepsmo:"http://sweetontology.net/reprSciModel/",sorealv:"http://sweetontology.net/realmLandVolcanic/",sophgt:"http://sweetontology.net/phenGeolTectonic/",ccsla:"http://cookingbigdata.com/linkeddata/ccsla#",oplsoft:"http://www.openlinksw.com/ontology/software#",mobiliteit:"https://data.vlaanderen.be/ns/mobiliteit#",s4city:"https://saref.etsi.org/saref4city/",io:"https://iaco.me/",sorealf:"http://sweetontology.net/realmLandFluvial/",sohuc:"http://sweetontology.net/humanCommerce/",sopho:"http://sweetontology.net/phenOcean/",somamic:"http://sweetontology.net/matrMicrobiota/",sohuea:"http://sweetontology.net/humanEnvirAssessment/",sorealg:"http://sweetontology.net/realmLandGlacial/",soreaab:"http://sweetontology.net/realmAstroBody/",sostsc:"http://sweetontology.net/stateSpaceConfiguration/",sophgs:"http://sweetontology.net/phenGeolSeismicity/",gx:"https://graphite.synaptica.net/extension/",gas:"http://www.bigdata.com/rdf/gas#",soall:"http://sweetontology.net/sweetAll/",sophgg:"http://sweetontology.net/phenGeolGeomorphology/",brot:"https://w3id.org/brot#",sorealt:"http://sweetontology.net/realmLandTectonic/",oco:"https://w3id.org/oc/ontology/",say:"http://example.org/say/",sohua:"http://sweetontology.net/humanAgriculture/",iaco:"https://iaco.me/",dfcb:"http://datafoodconsortium.org/ontologies/DFC_BusinessOntology.owl#",birthdate:"http://schema.org/birthDate/",atm:"https://data.nasa.gov/ontologies/atmonto/ATM#",docam:"https://www.docam.ca/glossaurus/",arp:"http://www.arpenteur.org/ontology/Arpenteur.owl#",dfc:"http://datafoodconsortium.org/ontologies/DFC_FullModel.owl#",sophg:"http://sweetontology.net/phenGeol/",taxrefprop:"http://taxref.mnhn.fr/lod/property/",ei2a:"http://opendata.aragon.es/def/ei2a#",sostsl:"http://sweetontology.net/stateSpectralLine/",sohud:"http://sweetontology.net/humanDecision/",wasa:"http://vocab.sti2.at/wasa/",sophgv:"http://sweetontology.net/phenGeolVolcano/",osmrel:"https://www.openstreetmap.org/relation/",soreala:"http://sweetontology.net/realmLandAeolian/",dd:"http://example.org/dummydata/",waa:"http://purl.oclc.org/NET/WebApiAuthentication#",ci:"https://privatealpha.com/ontology/content-inventory/1#",s4agri:"https://saref.etsi.org/saref4agri/",bs:"https://w3id.org/bs#",fibo:"https://spec.edmcouncil.org/fibo/ontology/master/latest/",fernanda:"http://fernanda.nl/",uimo:"http://vocab.sti2.at/uimo/",persoon:"http://data.vlaanderen.be/ns/persoon#",bperson:"http://data.vlaanderen.be/ns/persoon#",ld:"http://linkeddata.ru/",saref4envi:"https://saref.etsi.org/saref4envi/",trak:"https://trakmetamodel.sourceforge.io/vocab/rdf-schema.rdf#",s4ener:"https://saref.etsi.org/saref4ener/",wotc:"http://purl.org/wot-catalogue#",osmway:"https://www.openstreetmap.org/way/",sorea:"http://sweetontology.net/realm/",sophgf:"http://sweetontology.net/phenGeolFault/",osmnode:"https://www.openstreetmap.org/node/",oplfeat:"http://www.openlinksw.com/ontology/features#",mgv:"http://mangaview.fr/mgv#",ccr:"http://cookingbigdata.com/linkeddata/ccregions#",ogura:"https://sparql.crssnky.xyz/Ogura_Hyakunin_Isshu_LinkedRDF/URIs/Ogura_Hyakunin_Isshu_schema.ttl#",knows:"http://semantic.komc/usu/2020/knows#",ldes:"https://w3id.org/ldes#",movieo:"http://movie.com/ontology/",lexicog:"http://www.w3.org/ns/lemon/lexicog#",toaru:"https://metadata.moe/toaru-sparql/elements/",eppo:"https://gd.eppo.int/taxon/",gco:"http://purl.jp/bio/12/glyco/conjugate#",ebg:"http://data.businessgraph.io/ontology#",mpg123:"https://devuan.net.br/wiki/mpg123/",univ:"http://univ.io/",jur:"http://sweet.jpl.nasa.gov/2.3/humanJurisdiction.owl#",motogp:"http://www.motogp.com/",mr:"http://marineregions.org/ns/ontology#",dbonto:"http://dbepedia.org/ontology/",bao:"http://www.bioassayontology.org/bao#",quran:"http://khalidaloufi.sa/quran#",estraf:"http://vocab.ciudadesabiertas.es/def/transporte/trafico#",srv:"http://www.daml.org/services/owl-s/1.2/Service.owl#",cto:"https://w3id.org/cto#",maroc:"http://fr.dbpedia.org/page/Maroc/",mltd:"https://mltd.pikopikopla.net/mltd-schema#",cts:"http://rdf.cdisc.org/ct/schema#",esconv:"http://vocab.ciudadesabiertas.es/def/sector-publico/convenio#",prismdb:"https://prismdb.takanakahiko.me/prism-schema.ttl#",rl:"http://rl.com/resources/",hola:"https://moodle.insa-lyon.fr/course/view.php?id=",kko:"http://kbpedia.org/kko/rc/",pgxo:"http://pgxo.loria.fr/",melding:"http://lblod.data.gift/vocabularies/automatische-melding/",ble:"http://vocab.rapidthings.eu/ns/ble.ttl#",geodcat:"http://data.europa.eu/930/",ams:"http://data.amadeus.com/",cso:"http://cso.kmi.open.ac.uk/schema/cso/",marcgt:"https://id.loc.gov/vocabulary/marcgt/",accid:"http://pid.accurids.com/",ibeacon:"http://vocab.rapidthings.eu/ns/apple/ibeacon.ttl#",nsg:"https://neuroshapes.org/",rdasource:"http://rdaregistry.info/termList/RDARecordingSources/",i18n:"https://www.w3.org/ns/i18n#",contry:"http://dbpedia.org/resource/Lyon#",gom:"https://w3id.org/gom#",rdapol:"http://rdaregistry.info/termList/RDAPolarity/",la:"https://linked.art/ns/terms/",vlueprint:"https://vlueprint.org/schema/",fx:"http://sparql.xyz/facade-x/ns/",xyz:"http://sparql.xyz/facade-x/data/",mag:"https://makg.org/property/",mdcs:"https://mdcs.monumentenkennis.nl/damageatlas/ontology#",sty:"http://purl.bioontology.org/ontology/STY/",karstlink:"https://ontology.uis-speleo.org/ontology/#",rdaut:"http://rdaregistry.info/termList/RDAUnitOfTime/",tso:"https://w3id.org/tso#",contax:"https://w3id.org/con-tax#",rdat:"http://rdaregistry.info/Elements/t/",dom:"https://html.spec.whatwg.org/#",esautob:"http://vocab.ciudadesabiertas.es/def/transporte/autobus#",oeso:"http://www.opensilex.org/vocabularies/oeso#",w3id:"https://w3id.org/",ssnx:"http://purl.oclc.org/NET/ssnx/ssn#",bop:"https://w3id.org/bop#",vph:"http://purl.org/ozo/vph.owl#",rdaio:"http://rdaregistry.info/Elements/i/object/",hops:"https://rdf.ag/o/hops#",w3geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",rdaep:"http://rdaregistry.info/termList/RDAExtensionPlan/",datagc:"https://data.grottocenter.org/ldp/",esempleo:"http://vocab.ciudadesabiertas.es/def/sector-publico/empleo#",rpg:"http://rpg.data.is4.site/",rofchrda:"http://rdaregistry.info/termList/rofchrda/",srr:"https://w3id.org/srr#",samian:"http://lod.archaeology.link/data/samian/",check:"http://pornhub.com/",rdaao:"http://rdaregistry.info/Elements/a/object/",matrycs:"http://matrycs.com/",kpd:"http://purl.org/kpd/",freq:"http://purl.org/cld/freq/",smithy:"https://awslabs.github.io/smithy/rdf-1.0#",itops:"https://vocab.eccenca.com/itops/",slm:"http://urn.fi/URN:NBN:fi:au:slm:",rdaxd:"http://rdaregistry.info/Elements/x/datatype/",mnx:"https://rdf.metanetx.org/schema/",rdatd:"http://rdaregistry.info/Elements/t/datatype/",mesh2021:"http://id.nlm.nih.gov/mesh/2021/",textgrid:"https://textgridrep.org/",rdamo:"http://rdaregistry.info/Elements/m/object/",rdato:"http://rdaregistry.info/Elements/t/object/",bdg:"http://data.bigdatagrapes.eu/resource/ontology/",rdaed:"http://rdaregistry.info/Elements/e/datatype/",rdaid:"http://rdaregistry.info/Elements/i/datatype/",seasd:"https://w3id.org/seas/",rdatb:"http://rdaregistry.info/termList/RDATypeOfBinding/",bleadapter:"http://vocab.rapidthings.eu/ns/ble/adapter.ttl#",vr:"https://www.w3.org/2018/credentials/v1/",epcis:"https://ns.gs1.org/epcis/",sou:"http://qudt.org/vocab/sou/",memorix:"http://memorix.io/ontology#",lado:"http://archaeology.link/ontology#",rdan:"http://rdaregistry.info/Elements/n/",oghamonto:"http://ontology.ogham.link/",signify:"http://purl.org/signify/ns#",comp:"http://semweb.mmlab.be/ns/rml-compression#",rdand:"http://rdaregistry.info/Elements/n/datatype/",rdamd:"http://rdaregistry.info/Elements/m/datatype/",m8g:"http://data.europa.eu/m8g/",rdaxo:"http://rdaregistry.info/Elements/x/object/",cerealstoo:"http://rdf.ag/o/cerealstoo#",faas:"http://semantic-faas.com/ontology#",rdano:"http://rdaregistry.info/Elements/n/object/",cinema:"http://www.semanticweb.org/julien/morgann/cinema#",idpo:"https://w3id.org/idpo#",kdsf:"https://kerndatensatz-forschung.de/version1/technisches_datenmodell/owl/kdsf.owl#",rdawd:"http://rdaregistry.info/Elements/w/datatype/",rdatask:"http://rdaregistry.info/termList/RDATasks/",bcom:"https://w3id.org/bcom#",spec:"http://www.w3.org/ns/spec#",arena:"https://solid.ti.rw.fau.de/public/ns/arena#",ch:"https://schema.ld.admin.ch/",hpont:"https://w3id.org/hpont#",rdap:"http://rdaregistry.info/Elements/p/",cbv:"https://ns.gs1.org/cbv/",rdamat:"http://rdaregistry.info/termList/RDAMaterial/",ogham:"http://lod.ogham.link/data/",oidc:"http://www.w3.org/ns/solid/oidc#",rdapath:"http://rdaregistry.info/termList/RDARecordingMethods/",rdasca:"http://rdaregistry.info/termList/scale/",eurio:"http://data.europa.eu/s66#",citedcat:"https://w3id.org/citedcat-ap/",mrk:"http://www.mydomain.org/Mrk-ns#",nprl:"http://data.nobelprize.org/resource/laureate/",folio:"http://IBCNServices.github.io/Folio-Ontology/Folio.owl#",rdawo:"http://rdaregistry.info/Elements/w/object/",rdapd:"http://rdaregistry.info/Elements/p/datatype/",biocrm:"http://ldf.fi/schema/bioc/",ofn:"http://www.ontotext.com/sparql/functions/",rofsfrda:"http://rdaregistry.info/termList/rofsfrda/",paf:"https://paf.link/",rofitrda:"http://rdaregistry.info/termList/rofitrda/",bcfowl:"http://lbd.arch.rwth-aachen.de/bcfOWL#",rdaim:"http://rdaregistry.info/termList/RDAInteractivityMode/",luigiusai:"https://www.luigiusai.it/wp#",nanopub:"http://www.nanopub.org/nschema#",roffgrda:"http://rdaregistry.info/termList/roffgrda/",encargado:"http://semRAT.edu/",poke:"https://pokemonkg.org/ontology#",aspect:"http://purl.org/aspect/",react:"https://w3id.org/react#",eep:"https://w3id.org/eep#",uberon:"http://purl.obolibrary.org/obo/UBERON_",cpc:"https://data.epo.org/linked-data/def/cpc/",cpg:"http://modellingdh.github.io/ont/odp/pgc/",bag2:"http://bag.basisregistraties.overheid.nl/def/bag#",rmlt:"http://semweb.mmlab.be/ns/rml-target#",ea:"http://eaontology.protect.linkeddata.es/def/",opltw:"http://www.openlinksw.com/schemas/twitter#",tci:"https://w3id.org/lbs/tci#",cgo:"https://www.tno.nl/agrifood/ontology/common-greenhouse-ontology#",s223:"http://data.ashrae.org/standard223#",aff:"https://w3id.org/affectedBy#",xmlns:"http://xmlns.com/foaf/0.1/",gax:"http://w3id.org/gaia-x/core#",setl:"http://purl.org/twc/vocab/setl/",lsqr:"http://lsq.aksw.org/",mrt:"http://marineregions.org/ns/placetypes#",djo:"http://purl.org/datajourneys/",srtun:"https://www.inf.bi.rub.de/srtun#",ghga:"http://w3id.org/ghga/",bau:"https://terminology.fraunhofer.de/voc/bau#",srmo:"https://w3id.org/srmo#",nsd:"https://w3id.org/nsd#",hqdmontol:"http://www.semanticweb.org/magma-core/ontologies/hqdm#",srt:"http://w3id.org/srt#",ewg:"http://ethoinformatics.org/",generiek:"https://data.vlaanderen.be/ns/generiek#",ontobras:"http://www.semanticweb.org/fefar/ontologies/ontobras#",m4i:"http://w3id.org/nfdi4ing/metadata4ing#",olias:"http://purl.org/olia/system.owl#",wfont:"https://w3id.org/wfont#",rc:"https://w3id.org/rc#",ldpsc:"https://solid.ti.rw.fau.de/public/ns/stream-containers#",interop:"http://www.w3.org/ns/solid/interop#",ppeer:"http://parliament.uk/ontologies/peerage/",esc:"https://solid.ti.rw.fau.de/public/ns/event-sourcing-containers#",walmart:"https://www.amazon.de/",quid:"https://w3id.org/quid/",wdno:"http://www.wikidata.org/prop/novalue/",rdaeo:"http://rdaregistry.info/Elements/e/object/",edu:"https://schema.edu.ee/",stix:"http://purl.org/cyber/stix#",paam:"https://lod.mediathek-tanz-theater.de/schema/paam/",eb:"https://w3id.org/eb#",hqdm:"http://www.semanticweb.org/hqdm#",gufo:"http://purl.org/nemo/gufo#",raum:"https://terminology.fraunhofer.de/voc/raum#",caso:"http://www.w3id.org/def/caso#",lds:"https://solid.ti.rw.fau.de/public/ns/linked-data-structures#",jsonld:"http://www.w3.org/ns/json-ld#",magmardl:"http://www.semanticweb.org/magma-core/rdl#",dsd:"https://w3id.org/dsd#",godaddy:"https://sso.godaddy.com/",asf:"https://www.stm-assoc.org/asf/",lrcommon:"http://landregistry.data.gov.uk/def/common/",kgi:"http://ns.inria.fr/kg/index#",marc:"http://www.loc.gov/MARC21/slim/",ofo:"https://w3id.org/ofo#",hni:"https://collectiedata.hetnieuweinstituut.nl/",feed:"https://www.feedipedia.org/",magmauser:"http://www.semanticweb.org/magma-core/user#",archivo:"https://archivo.dbpedia.org/onto#",rto:"https://w3id.org/rail/topo#",osdu:"https://w3id.org/OSDU#",diso:"https://purls.helmholtz-metadaten.de/diso#",lbdserver:"https://w3id.org/lbdserver#",bdsubj:"https://purl.org/fidbaudigital/subjects#",nomo:"https://nomenclature.info/nom/ontology/",rro:"http://semanticweb.org/patricia/ontologies/rro#",conllu:"https://universaldependencies.org/format.html#",value:"http://gfgfd.vs/",chameo:"https://w3id.org/emmo/domain/characterisation-methodology/chameo#",tern:"http://w3id.org/tern/ontologies/tern/",sds:"https://w3id.org/sds#",respond:"https://w3id.org/respond#",covido:"https://w3id.org/CovidO#",rsx:"http://rdf4j.org/shacl-extensions#",linkml:"https://w3id.org/linkml/",rdb:"http://www.dbs.cs.uni-duesseldorf.de/RDF/relational#",stirdata:"https://w3id.org/stirdata/vocabulary/",robotarm:"https://solid.ti.rw.fau.de/public/ns/robotArm#",nom:"https://nomenclature.info/nom/",nbo:"http://data.bioontology.org/ontologies/NBO/",fpr:"http://www.filmstandards.org/schemas/filmportal_relations#",weki:"https://en.wikipedia.org/wiki/",experts:"http://emmo.info/emmo/application/maeo/experts#",tro:"https://w3id.org/TRO/",oeo:"http://openenergy-platform.org/ontology/oeo/",lbds:"https://w3id.org/lbdserver#",itcrdf:"http://www.w3.org/2005/11/its/rdf#",perscido:"https://perscido.univ-grenoble-alpes.fr/",express:"https://w3id.org/express#",pgo:"http://ii.uwb.edu.pl/pgo#",rsp:"http://www.researchspace.org/resource/",dsi:"https://data.dsi.omgeving.vlaanderen.be/ns/dsi#",chemrof:"https://w3id.org/chemrof/",dmo:"https://w3id.org/dmo#",tempo:"http://purl.org/tempo/",cido:"http://purl.obolibrary.org/obo/cido.owl/",icon:"https://w3id.org/icon/ontology/",rnce:"https://data.cultureelerfgoed.nl/id/rnce#",linkedart:"https://linked.art/ns/terms/",osmo:"https://purl.org/vimmp/osmo#",rism:"http://rism.online/",veelana:"http://onlyfans.com/veelana/",ultragaz:"https://ultragaz24horas.com/",dbd:"http://dbpedia.org/datatype/",roh:"http://w3id.org/roh#",vntourism:"http://www.semanticweb.org/minhn/ontologies/2021/0/vntourism#",rtedurp:"http://purl.org/eduo/rtedurp/",chess:"http://purl.org/NET/rdfchess/ontology/",raad:"https://raadzaam.nl/schema/",dqvno:"https://data.norge.no/vocabulary/dqvno#",ttrpg:"https://w3id.org/TTRpg#",era:"http://data.europa.eu/949/",iddo:"https://w3id.org/iddo#",bp3:"http://www.biopax.org/release/biopax-level3.owl#",vl:"https://version.link/",fso:"https://w3id.org/fso#",consolid:"https://w3id.org/consolid#",gql:"http://www.openlinksw.com/schemas/graphql#",kokot:"http://www.koko.t/",besluitvor:"https://data.vlaanderen.be/ns/besluitvorming#",ammo:"http://ldf.fi/schema/ammo/",rcgs:"https://collection.rcgs.jp/terms/",pubchem:"https://pubchem.ncbi.nlm.nih.gov/",ufo:"http://ufo.com/#",mondo:"http://purl.obolibrary.org/obo/",cvb:"http://rdfs.org/resume-rdf/base.rdfs#",film:"http://semantics.id/ns/example/film/",iottta:"https://w3id.org/iot-tta#",grscicoll:"https://www.gbif.org/grscicoll/collection/",nen2660:"https://w3id.org/nen2660/def#",thub:"http://vocabularis.crai.ub.edu/thub/",dcb:"http://dbpedia.org/resource/Category:",apods:"http://activitypods.org/ns/core#",skosm:"http://www.w3.org/2004/02/skos/mapping#",nalt:"https://lod.nal.usda.gov/nalt/",version:"https://version.link/",koko:"https://seznam.cz/",bmp:"http://w3id.org/bmp#",coy:"https://schema.coypu.org/global#",dcatno:"https://data.norge.no/vocabulary/dcatno#",yanice:"http://yanice-boady.webflow.io/",fdp:"https://w3id.org/fdp/fdp-o#",vcs:"https://data.vlaanderen.be/ns/chemische_stof#",dick:"http://pornhub.com/",vhbieo:"https://w3id.org/vhbieo#",ntp:"https://schema.finto.fi/ntp#",ceox:"https://linkeddata.cultureelerfgoed.nl/def/ceox#",lis:"http://rds.posccaesar.org/ontology/lis14/rdl/",lib:"http://purl.org/library/",goavoc:"http://bio2rdf.org/goa_vocabulary:",crmsci:"http://cidoc-crm.org/crmsci/",hyr:"https://w3id.org/simulation/data/",hmas:"https://purl.org/hmas/",nutscode:"http://data.europa.eu/nuts/code/",dbpg:"http://dbpedia.org/page/",lcnaf:"http://id.loc.gov/authorities/names/",ncbi:"https://www.ncbi.nlm.nih.gov/",to:"http://purl.obolibrary.org/obo/TO_",coda:"http://art.uniroma2.it/coda/contracts/",epo:"http://data.europa.eu/a4g/ontology#",relation:"http://www.iana.org/assignments/relation/",plant:"http://example.org/plant/",peco:"https://w3id.org/peco#",ecfo:"https://w3id.org/ecfo#",acp:"http://www.w3.org/ns/solid/acp#",lol:"https://sbalot.github.io/lol/",tsso:"https://scch.org/technical_standards#",fs:"https://www.compliancequest.com/training-management-software-system-solutions/",ags:"https://id.agschemas.org/",dcatap:"http://data.europa.eu/r5r/",spatialf:"http://jena.apache.org/function/spatial#",coreo:"http://purl.org/coreo#",asb:"https://w3id.org/asbingowl/core#",atcc:"https://www.atcc.org/products/",rb:"https://w3id.org/riverbench/schema/metadata#",cur:"http://qudt.org/2.1/vocab/currency/",aec3po:"https://w3id.org/lbd/aec3po/",doce:"http://purl.org/nemo/doce#",sure:"http://ns.inria.fr/sure#",fdof:"https://w3id.org/fdof/ontology#",threat:"https://cve.mitre.org/",mindat:"https://www.mindat.org/",oav:"http://lod.openaire.eu/vocab/",quest:"https://rb.gy/ntg7l/",risk:"https://www.w3id.org/risk#",docbook:"http://docbook.org/ns/docbook/",databus:"https://dataid.dbpedia.org/databus#",egdo:"http://example.org/",ontouml:"https://w3id.org/ontouml#",coos:"http://id.unece.org/def/coos#",fisa:"https://ifitkau.github.io/fisa/",bacnet:"http://data.ashrae.org/bacnet/2020#",bsdd:"http://bsdd.buildingsmart.org/def#",iop:"https://w3id.org/iadopt/ont/",p2po:"https://purl.org/p2p-o#",ontologia:"http://ub.edu/dades/ontologia/Cinema#Cinemes#",hu:"https://mail.google.com/",oplben:"http://www.openlinksw.com/ontology/benefits#",baf:"https://w3id.org/baf#",pit:"http://data.elsevier.com/vocabulary/ElsevierPubItemTypes/",batmanont:"http://emmo.info/emmo/application/bmo#",ksamsok:"http://kulturarvsdata.se/ksamsok#",uio:"https://www.mitre.org/mparmelee/ontologies/2023/6/UserIntentOntology/",mi:"http://www.marineinfo.org/ns/ontology#",matmine:"http://materialsmine.org/ns/",notify:"http://www.w3.org/ns/solid/notifications#",ocmv:"https://w3id.org/ontouml-models/vocabulary#",wrroc:"https://w3id.org/ro/terms/workflow-run#",sense:"https://w3id.org/sense#",mibc:"http://marineinfo.org/ns/library/bibcodes#",cpsvno:"http://data.norge.no/vocabulary/cpsvno#",imbor:"https://data.crow.nl/imbor/def/",stax:"https://w3id.org/stax/ontology#",emmo:"https://w3id.org/emmo#",rbdoc:"https://w3id.org/riverbench/schema/documentation#",quit:"http://quit.aksw.org/vocab/",dde:"https://www.ddeworld.org/",doam:"http://emmo.info/doam#",keyon:"http://keyelements.ltd/ontologies/keyon/#",sssom:"https://w3id.org/sssom/",ogcf:"http://www.opengis.net/def/function/geosparql/",cercabib:"https://cercabib.ub.edu/",przecieki:"http://onlyfans.com/emiliaszymanska/",skosno:"http://data.norge.no/skosno#",bioschemas:"https://bioschemas.org/",bto:"http://w3id.org/emmo-bto/bto#",mibt:"https://marineinfo.org/ns/library/bibtypes#",maeo:"http://w3id.org/emmo-maeo/maeo#",ind:"https://w3id.org/inesdata#",olis:"http://olis.dev/",semapv:"https://w3id.org/semapv/vocab/",pbac:"https://w3id.org/pbac#",ies4:"http://ies.data.gov.uk/ontology/ies4#",mifesto:"https://w3id.org/mifesto#",exekg:"https://raw.githubusercontent.com/nsai-uio/ExeKGOntology/main/ds_exeKGOntology.ttl#",w3:"http://www.w3.org/",mir:"http://marineinfo.org/ns/person/roles#",cergy:"https://dbpedia.org/page/Cergy/",eurovoc:"http://eurovoc.europa.eu/",plasma:"https://w3id.org/plasma#",guez:"http://guez.fr/",iig:"https://w3id.org/iicongraph/data/",sri:"https://w3id.org/sri#",into:"https://app.korfin.de/ontology/into/",doid:"http://purl.obolibrary.org/obo/DOID_",ies:"http://ies.data.gov.uk/ontology/ies4#",hpo:"http://w3id.org/emmo-hpo/hpo#",miprog:"https://marineinfo.org/ns/progress#",hy:"https://api.hyprdia.com/",pcp:"https://pcp-on-web.de/ontology/0.2/index-en.html#",oio:"http://www.geneontology.org/formats/oboInOwl#",top:"http://w3id.org/topologicpy#",soa:"https://semopenalex.org/ontology/",uiot:"http://www.w3id.org/urban-iot/core#",deonta:"https://deonta.linkedmodel.org/deonta/",ceosp:"https://linkeddata.cultureelerfgoed.nl/def/ceosp/",lpwc:"https://linkedpaperswithcode.com/property/",cp:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties/",ioc:"http://w3id.org/ioc#",htv:"http://www.w3.org/2011/http#",occupation:"http://nikunj.org/ontology/occupatioin#",loinc:"https://loinc.org/",tdm:"http://www.w3.org/ns/tdmrep#",tsdcreq:"https://w3id.org/oseg/ont/tsdc/req#",okh:"https://w3id.org/oseg/ont/okh#",tsdc:"https://w3id.org/oseg/ont/tsdc/core#",pwkso:"http://ns.inria.fr/pwkso/",spa:"https://paul.ti.rw.fau.de/~jo00defe/voc/spa#",chpaf:"https://ch.paf.link/",spo:"https://w3id.org/steel/ProcessOntology/",osh:"https://w3id.org/oseg/ont/osh#",ontohgis:"https://onto.kul.pl/ontohgis/",otrl:"https://w3id.org/oseg/ont/otrl#",aao:"http://purl.obolibrary.org/obo/AAO_",firebim:"http://w3id.org/firebim#",oplmarket:"http://www.openlinksw.com/ontology/market#",cwo:"http://kcoyle.net/cwo/",clyh:"http://purl.obolibrary.org/obo/ZP_",imdb:"http://m.imdb.com/",obi:"http://purl.obolibrary.org/obo/OBI_",envo:"http://purl.obolibrary.org/obo/ZP_",dinto:"http://purl.obolibrary.org/obo/ZP_",lrm:"https://iflastandards.info/ns/lrm/lrmoo/",kbmarc:"https://id.kb.se/marc/",clo:"http://purl.obolibrary.org/obo/ZP_",ado:"http://purl.obolibrary.org/obo/ADO_",rxno:"http://purl.obolibrary.org/obo/ZP_",obom:"https://w3id.org/open-bom/ont/open-bom#",dcid:"https://datacommons.org/browser/",crcr:"https://credit.niso.org/contributor-roles/",sep:"http://purl.obolibrary.org/obo/ZP_",gecko:"http://purl.obolibrary.org/obo/ZP_",reloc:"https://w3id.org/reloc#",sibo:"http://purl.obolibrary.org/obo/ZP_",coswot:"https://w3id.org/coswot/",cacax:"http://cacax.fun/",bcgo:"http://purl.obolibrary.org/obo/ZP_",moont:"https://w3id.org/moont/",ohd:"http://purl.obolibrary.org/obo/ZP_",dpo:"http://purl.obolibrary.org/obo/FBcv_",lpto:"http://w3id.org/lpto#",oplgit:"http://www.openlinksw.com/schemas/github#",htn:"http://purl.obolibrary.org/obo/ZP_",ypc:"http://www.semanticweb.org/sunsr/ontologies/2024/ypc#",txpo:"http://purl.obolibrary.org/obo/ZP_",adw:"https://animaldiversity.org/accounts/",omit:"http://purl.obolibrary.org/obo/OMIT_",mpio:"http://purl.obolibrary.org/obo/ZP_",ckg:"http://example.org/ckg#",sbo:"http://purl.obolibrary.org/obo/SBO_",mfo:"http://purl.obolibrary.org/obo/ZP_",bspo:"http://purl.obolibrary.org/obo/BSPO_",vo:"http://purl.obolibrary.org/obo/VO_",mbl:"https://w3id.org/mbl#",aimaix:"https://w3id.org/aimaix#",oip:"http://www.exemple.org/ontologia/",aix:"https://w3id.org/aix#",trans:"http://purl.obolibrary.org/obo/TRANS_",mop:"http://purl.obolibrary.org/obo/MOP_",oix:"http://www.exemple.org/ontologia/",ogi:"http://purl.obolibrary.org/obo/OGI_",uo:"http://purl.obolibrary.org/obo/UO_",zp:"http://purl.obolibrary.org/obo/ZP_",zo:"https://linkeddata.cultureelerfgoed.nl/def/zo/",libeas:"https://w3id.org/libeas#",fro:"https://foundry.ai.mil/ontology/nas/fro/",ontoavida:"http://purl.obolibrary.org/obo/ONTOAVIDA_",sopharm:"http://purl.obolibrary.org/obo/SOPHARM_",duo:"http://purl.obolibrary.org/obo/DUO_",xlmod:"http://purl.obolibrary.org/obo/XLMOD_",pw:"http://purl.obolibrary.org/obo/PW_",omo:"http://purl.obolibrary.org/obo/OMO_",fovt:"http://purl.obolibrary.org/obo/FOVT_",phipo:"http://purl.obolibrary.org/obo/PHIPO_",gramene:"http://www.gramene.org/db/ontology/search?id=GRO:",spd:"http://purl.obolibrary.org/obo/SPD_",sepio:"http://purl.obolibrary.org/obo/SEPIO_",xco:"http://purl.obolibrary.org/obo/XCO_",meas:"https://graph.interoptx.org/meas/",nmr:"https://www.ebi.ac.uk/ols4/ontologies/nmrcv/terms?short_form=NMR:",imr:"http://www.inoh.org/ontology-viewer/cgi-bin/InohOVAttr.php?type=IMR&id=",fypo:"http://purl.obolibrary.org/obo/FYPO_",msl:"https://w3id.org/msl#",foodon:"http://purl.obolibrary.org/obo/FOODON_",isoprops:"https://w3id.org/isoprops#",zfs:"http://purl.obolibrary.org/obo/ZFS_",psm:"https://paul.ti.rw.fau.de/~jo00defe/ont/psm#",occo:"http://purl.obolibrary.org/obo/OCCO_",pao:"http://purl.obolibrary.org/obo/PAO_",fbcv:"http://purl.obolibrary.org/obo/FBcv_",symp:"http://purl.obolibrary.org/obo/SYMP_",cteno:"http://purl.obolibrary.org/obo/CTENO_",cams:"https://graph.interoptx.org/cams/schema/",ehdaa2:"http://purl.obolibrary.org/obo/EHDAA2_",fiaf:"https://ontology.fiafcore.org/",gallont:"http://purl.obolibrary.org/obo/GALLONT_",mco:"http://purl.obolibrary.org/obo/MCO_",ogsf:"http://purl.obolibrary.org/obo/OGSF_",credit:"https://credit.niso.org/",ypo:"http://purl.obolibrary.org/obo/YPO_",pgdso:"http://purl.obolibrary.org/obo/PGDSO_",loin:"http://w3id.org/loin#",ehda:"http://purl.obolibrary.org/obo/EHDA_",oba:"http://purl.obolibrary.org/obo/OBA_",t4fs:"http://purl.obolibrary.org/obo/T4FS_",eo:"http://purl.obolibrary.org/obo/EO_",zeco:"http://purl.obolibrary.org/obo/ZECO_",opmi:"http://purl.obolibrary.org/obo/OPMI_",ddanat:"http://purl.obolibrary.org/obo/DDANAT_",scdo:"http://purl.obolibrary.org/obo/SCDO_",xpo:"http://purl.obolibrary.org/obo/XPO_",dron:"http://purl.obolibrary.org/obo/DRON_",bila:"http://4dx.embl.de/4DXpress/reg/all/cview/gene.do?geneID=",gaz:"http://purl.obolibrary.org/obo/GAZ_",hancestro:"http://purl.obolibrary.org/obo/HANCESTRO_",geogeo:"http://purl.obolibrary.org/obo/GEO_",poro:"http://purl.obolibrary.org/obo/PORO_",fobi:"http://purl.obolibrary.org/obo/FOBI_",emapa:"http://purl.obolibrary.org/obo/EMAPA_",stato:"http://purl.obolibrary.org/obo/STATO_",ohmi:"http://purl.obolibrary.org/obo/OHMI_",cvdo:"http://purl.obolibrary.org/obo/CVDO_",caro:"http://purl.obolibrary.org/obo/CARO_",psdo:"http://purl.obolibrary.org/obo/PSDO_",obcs:"http://purl.obolibrary.org/obo/OBCS_",zfa:"http://purl.obolibrary.org/obo/ZFA_",fix:"http://purl.obolibrary.org/obo/FIX_",aism:"http://purl.obolibrary.org/obo/AISM_",nomen:"http://purl.obolibrary.org/obo/NOMEN_",edo:"http://semanticweb.org/edo#",cdno:"http://purl.obolibrary.org/obo/CDNO_",ceph:"http://purl.obolibrary.org/obo/CEPH_",micro:"http://purl.obolibrary.org/obo/MICRO_",wbbt:"http://purl.obolibrary.org/obo/WBbt_",colao:"http://purl.obolibrary.org/obo/COLAO_",ecto:"http://purl.obolibrary.org/obo/ECTO_",genepio:"http://purl.obolibrary.org/obo/GENEPIO_",gno:"http://purl.obolibrary.org/obo/GNO_",tahh:"http://purl.obolibrary.org/obo/TAHH_",loggerhead:"http://purl.obolibrary.org/obo/LOGGERHEAD_",iptc4xmpc:"http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/",mirnao:"http://purl.obolibrary.org/obo/MIRNAO_",pdro:"http://purl.obolibrary.org/obo/PDRO_",ncro:"http://purl.obolibrary.org/obo/NCRO_",bootstrep:"http://purl.obolibrary.org/obo/BOOTSTREP_",mao:"http://purl.obolibrary.org/obo/MAO_",mfmo:"http://purl.obolibrary.org/obo/MFMO_",multionto:"http://purl.org/net/multionto/",whyis:"http://vocab.rpi.edu/whyis/",ecocore:"http://purl.obolibrary.org/obo/ECOCORE_",aeo:"http://purl.obolibrary.org/obo/AEO_",ecao:"http://purl.obolibrary.org/obo/ECAO_",fbbi:"http://purl.obolibrary.org/obo/FBbi_",ato:"http://purl.obolibrary.org/obo/ATO_",lipro:"http://purl.obolibrary.org/obo/LIPRO_",tads:"http://purl.obolibrary.org/obo/TADS_",disdriv:"http://purl.obolibrary.org/obo/DISDRIV_",vto:"http://purl.obolibrary.org/obo/VTO_",miapa:"http://purl.obolibrary.org/obo/MIAPA_",cio:"http://purl.obolibrary.org/obo/CIO_",lepao:"http://purl.obolibrary.org/obo/LEPAO_",resid:"https://proteininformationresource.org/cgi-bin/resid?id=",interpro:"http://purl.obolibrary.org/obo/IPR_",ogg:"http://purl.obolibrary.org/obo/OGG_",miro:"http://purl.obolibrary.org/obo/MIRO_",zea:"http://purl.obolibrary.org/obo/ZEA_",mpbv:"http://meta-pfarrerbuch.evangelische-archive.de/vocabulary#",chiro:"http://purl.obolibrary.org/obo/CHIRO_",dgaterms:"https://w3id.org/dgaterms#",emobon:"http://www.embrc.eu/emobon/EmoBonOntology#",duodrl:"https://w3id.org/duodrl#",norse:"https://w3id.org/aksw/norse#",mcro:"https://www.ebi.ac.uk/ols4/ontologies/mcro/classes?obo_id=MCRO:",vario:"http://purl.obolibrary.org/obo/VariO_",aro:"http://purl.obolibrary.org/obo/ARO_",ngbo:"http://purl.obolibrary.org/obo/NGBO_",flopo:"http://purl.obolibrary.org/obo/FLOPO_",hso:"http://purl.obolibrary.org/obo/HSO_",upa:"http://www.grenoble.prabi.fr/obiwarehouse/unipathway/upa?upid=",amphx:"http://purl.obolibrary.org/obo/AMPHX_",fbsp:"http://purl.obolibrary.org/obo/FBSP_",rex:"http://purl.obolibrary.org/obo/REX_"};let l5=(()=>{class r{static _instance;_nsMap;static getInstance(){return this._instance||(this._instance=new r),this._instance}compactIRI(t){let n=this._nsMap;void 0===n&&(n=this._buildNSMap());let i=t;if(t.includes("#"))i=`${t.split("#")[0]}#`;else{const a=t.split("/");a.pop(),i=a.join("/")+"/"}if(void 0===i)return t;const o=n[i];return void 0===o?t:t.replace(i,`${o}:`)}expandIRI(t){const n=t.split(":")[0];return t.replace(`${n}:`,Gl[n]??Hn[n])}_buildNSMap(){const t={};return Object.keys(Gl).forEach(n=>t[Gl[n]]=n),Object.keys(Hn).forEach(n=>t[Hn[n]]=n),this._nsMap=t,t}}return r})();class FR{constructor(e,t,n,i,o){this._api=e,this._projectId=t,this._queryCache=i,this._graphType=o,this._currentLang=n,this._api.setLanguage(n),this._contentCategories=new Gi([]),this._entityCategories=new Gi([]),this._relationships=new Gi([]),this.availableContentCategories=this._contentCategories.asReadonly(),this.availableEntityCategories=this._entityCategories.asReadonly(),this.availableEntityRelationships=this._relationships.asReadonly(),this.ready=this._load(n).catch(a=>console.error("[CueProjectSchema] Initial load failed:",a))}_api;_projectId;_queryCache;_graphType;_cache=new Map;_currentLang;_contentCategories;_entityCategories;_relationships;availableContentCategories;availableEntityCategories;availableEntityRelationships;ready;get language(){return this._api.language}setLanguage(e){this._currentLang!==e&&(this._currentLang=e,this._api.setLanguage(e),this._load(e).catch(t=>console.error("[CueProjectSchema] Language switch failed:",t)))}refresh(){var e=this;return(0,_.A)(function*(){const t=e._api.language;e._cache.delete(t),yield e._load(t)})()}_load(e){var t=this;return(0,_.A)(function*(){const n=t._cache.get(e);if(n)return void t._apply(n);const i=t._buildCategoriesQuery(e,"ContentCategory"),o=t._buildCategoriesQuery(e,"EntityCategory"),a=t._buildRelationshipsQuery(e);yield $b(i+o+a,(0,_.A)(function*(){const[s,l,u]=yield Promise.all([t._runCategoriesQuery(i),t._runCategoriesQuery(o),t._runRelationshipsQuery(a)]);return{contentCategories:s,entityCategories:l,relationships:u}}),s=>{t._cache.set(e,s),t._currentLang===e&&t._apply(s)},t._queryCache)})()}_apply(e){this._contentCategories.set(e.contentCategories),this._entityCategories.set(e.entityCategories),this._relationships.set(e.relationships)}_fetchCategories(e,t){var n=this;return(0,_.A)(function*(){return n._runCategoriesQuery(n._buildCategoriesQuery(e,t))})()}_buildCategoriesQuery(e,t){return`PREFIX qcy: <${Hn.qcy}>\nPREFIX skos: <${Gl.skos}>\nSELECT ?iri ?parent (SAMPLE(?l) AS ?label)\nWHERE {\n ?iri a qcy:${t} .\n OPTIONAL { ?iri skos:prefLabel ?lang_label FILTER(LANG(?lang_label) = "${e}") }\n OPTIONAL { ?iri skos:prefLabel ?no_lang_label }\n BIND(COALESCE(?lang_label, ?no_lang_label) AS ?l)\n OPTIONAL { ?iri skos:broader ?parent }\n}\nGROUP BY ?iri ?parent`}_runCategoriesQuery(e){var t=this;return(0,_.A)(function*(){return(yield t._api.sparql(e,t._projectId,t._graphType)).results.bindings.filter(n=>void 0!==n.iri).map(n=>{const i=n.iri.value;return{iri:i,label:n.label?.value??i.split("#").at(-1)??i,parent:n.parent?.value}})})()}_fetchRelationships(e){var t=this;return(0,_.A)(function*(){return t._runRelationshipsQuery(t._buildRelationshipsQuery(e))})()}_buildRelationshipsQuery(e){return`PREFIX qcy: <${Hn.qcy}>\nPREFIX rdfs: <${Gl.rdfs}>\nSELECT ?iri ?parent (SAMPLE(?l) AS ?label)\nWHERE {\n ?x qcy:relatedEntity ?y ;\n ?iri ?y .\n OPTIONAL { ?iri rdfs:label ?lang_label FILTER(LANG(?lang_label) = "${e}") }\n OPTIONAL { ?iri rdfs:label ?no_lang_label }\n BIND(COALESCE(?lang_label, ?no_lang_label) AS ?l)\n OPTIONAL { ?iri rdfs:subPropertyOf ?parent }\n}\nGROUP BY ?iri ?parent`}_runRelationshipsQuery(e){var t=this;return(0,_.A)(function*(){return(yield t._api.sparql(e,t._projectId,t._graphType)).results.bindings.filter(n=>void 0!==n.iri).map(n=>{const i=n.iri.value;return{iri:i,label:n.label?.value??i.split("#").at(-1)??i,parent:n.parent?.value}})})()}}class t0{constructor(e,t,n=Xb,i,o){this._api=e,this._projectId=t,this._queryCache=i,this._graphType=o,this.baseURL=`${n}${t}/`,this.entityInfoMap=this._entityInfoMapComputed,this.entityGraph=this._entityGraph.asReadonly(),this._entityOSMMap.subscribe(()=>this._checkPendingOSMFetches()),this._fetchEntityGraph().catch(a=>console.error("[CueProjectEntities] Entity graph fetch failed:",a))}_api;_projectId;_queryCache;_graphType;baseURL;_entityDetails=new Gi({});_entityDocuments=new Gi({});_entityRelationships=new Gi({});_entityOSMMap=new Gi({});_osmWKTMap=new Gi({});_fetchingOSMIds=new Set;_entityGraph=new Gi(void 0);_entityInfoMapComputed=function jb(r,e){const t=new Set;let n=e(),i=!1;const o=[],a=()=>{i=!0;for(const s of t)s()};for(const s of r)o.push(s.subscribe(a));return{get:()=>(i&&(n=e(),i=!1),n),subscribe:s=>(t.add(s),()=>t.delete(s)),destroy(){for(const s of o)s();t.clear()}}}([this._entityDetails,this._entityDocuments,this._entityRelationships,this._entityOSMMap,this._osmWKTMap],()=>this._computeEntityInfoMap());entityInfoMap;entityGraph;entityIri(e){return`${this.baseURL}${e}`}reset(){this._entityDetails.set({}),this._entityDocuments.set({}),this._entityRelationships.set({}),this._entityOSMMap.set({}),this._osmWKTMap.set({}),this._entityGraph.set(void 0),this._fetchingOSMIds.clear(),this._fetchEntityGraph().catch(e=>console.error("[CueProjectEntities] Entity graph fetch failed after reset:",e))}requestEntityData(e,t=!1){const n=e.filter(a=>void 0===this._entityDetails.get()[a]);if(0===n.length)return;const i=n.map(a=>`r:${a}`).join(" ");this._api.sparql(`PREFIX qcy: <${Hn.qcy}>\nPREFIX r: <${this.baseURL}>\nSELECT ?id (SAMPLE(?val) AS ?value) (GROUP_CONCAT(DISTINCT STR(?cat); SEPARATOR=";") AS ?categories) ?mentionCount\nWHERE {\n VALUES ?iri { ${i} }\n ?iri qcy:hasEntityCategory ?cat ;\n qcy:value ?val\n BIND(REPLACE(STR(?iri), "^.*/([^/]*)$", "$1") AS ?id)\n ${t?"{SELECT ?iri (COUNT(?mention) AS ?mentionCount)\n WHERE { ?mention qcy:resolvesTo ?iri } GROUP BY ?iri}":""}\n}\nGROUP BY ?id ?mentionCount`,this._projectId,this._graphType).then(a=>{const s=a,l={...this._entityDetails.get()};s.results.bindings.forEach(u=>{u.id&&(l[u.id.value]={value:u.value?.value??"",categories:u.categories?.value?.split(";").filter(Boolean)??[],mentionCount:u.mentionCount?parseInt(u.mentionCount.value,10):void 0})}),this._entityDetails.set(l)}).catch(a=>console.error("[CueProjectEntities] requestEntityData failed:",a))}requestEntityLocations(e){var t=this;return(0,_.A)(function*(){const n=e.filter(u=>void 0===t._entityOSMMap.get()[u]);if(0===n.length)return;const i={...t._entityOSMMap.get()};for(const u of n)i[u]={direct:[],indirect:[]};t._entityOSMMap.set(i);const o=n.map(u=>`r:${u}`).join(" "),a=`PREFIX qcy: <${Hn.qcy}>\nPREFIX r: <${t.baseURL}>\nSELECT ?id ?osm ?direct ?rels ?entityUUID\nWHERE {\n VALUES ?iri { ${o} }\n {\n SELECT ?iri ?osm ?direct\n WHERE {\n ?iri qcy:similarTo ?osm .\n FILTER STRSTARTS(STR(?osm), "https://www.openstreetmap.org/")\n BIND(true AS ?direct)\n }\n }\n UNION\n {\n SELECT ?iri ?osm ?direct ?entityUUID (GROUP_CONCAT(STR(?rel); SEPARATOR=";") AS ?rels)\n WHERE {\n ?iri qcy:relatedEntity ?loc .\n ?iri ?rel ?loc .\n ?loc qcy:similarTo ?osm .\n FILTER STRSTARTS(STR(?osm), "https://www.openstreetmap.org/")\n FILTER(?rel != qcy:relatedEntity)\n BIND(false AS ?direct)\n BIND(REPLACE(STR(?loc), "^.*/([^/]*)$", "$1") AS ?entityUUID)\n } GROUP BY ?iri ?osm ?direct ?entityUUID\n }\n BIND(REPLACE(STR(?iri), "^.*/([^/]*)$", "$1") AS ?id)\n}`,s=yield t._api.sparql(a,t._projectId,t._graphType),l={...t._entityOSMMap.get()};s.results.bindings.forEach(u=>{if(!u.id||!u.osm)return;const c=u.id.value,d=u.osm.value,h="true"===u.direct?.value,f=u.rels?.value?.split(";").filter(Boolean)??[],g=u.entityUUID?.value,y=l[c]??{direct:[],indirect:[]};h?y.direct.push(d):g&&y.indirect.push({osm:d,viaRels:f,entityUUID:g}),l[c]=y}),t._entityOSMMap.set(l)})()}fetchEntityRelationships(e){var t=this;return(0,_.A)(function*(){const n=e.replace(/^.*\/([^/]*)$/,"$1");t._entityRelationships.set({...t._entityRelationships.get(),[n]:{incoming:[],outgoing:[]}});const[i,o]=yield Promise.all([t._fetchOutgoingRelationships(e),t._fetchIncomingRelationships(e)]),a={outgoing:i,incoming:o};return t._entityRelationships.set({...t._entityRelationships.get(),[n]:a}),a})()}fetchEntityDocuments(e){var t=this;return(0,_.A)(function*(){const n=e.replace(/^.*\/([^/]*)$/,"$1");t._entityDocuments.set({...t._entityDocuments.get(),[n]:[]}),void 0===t._entityDetails.get()[n]&&t.requestEntityData([n]);const i=`PREFIX qcy: <${Hn.qcy}>\nSELECT DISTINCT ?id\nWHERE {\n BIND(<${e}> AS ?iri)\n ?doc a qcy:FileContent ;\n qcy:about ?iri .\n BIND(REPLACE(STR(?doc), "^.*/([^/]*)$", "$1") AS ?id)\n}`,o=(yield t._api.sparql(i,t._projectId,t._graphType)).results.bindings.filter(a=>void 0!==a.id).map(a=>a.id.value);return t._entityDocuments.set({...t._entityDocuments.get(),[n]:o}),o})()}contentCategoriesInProject(){var e=this;return(0,_.A)(function*(t=!0){const i=`PREFIX qcy: <${Hn.qcy}>\nPREFIX skos: <${Gl.skos}>\nSELECT ?iri (SAMPLE(?l) AS ?label) ?count\nWHERE {\n ?iri a qcy:EntityCategory .\n OPTIONAL { ?iri skos:prefLabel ?lang_label FILTER(LANG(?lang_label) = "${e._api.language}") }\n OPTIONAL { ?iri skos:prefLabel ?no_lang_label }\n BIND(COALESCE(?lang_label, ?no_lang_label) AS ?l)\n ${t?"{ SELECT (COUNT(?x) AS ?count) ?iri where { ?x a qcy:CanonicalEntity ; qcy:hasEntityCategory ?iri } GROUP BY ?iri }":""}\n}\nGROUP BY ?iri ?count\nORDER BY ${t?"DESC(?count)":"ASC(?label)"}`;return(yield e._api.sparql(i,e._projectId,e._graphType)).results.bindings.filter(o=>void 0!==o.iri).map(o=>{const a=o.count?parseInt(o.count.value,10):0,s=o.label?.value??o.iri.value.split("#").at(-1);return{iri:o.iri.value,label:a>0?`${s} (${a})`:s??""}})}).apply(this,arguments)}buildSummaryGraph(e){var t=this;return(0,_.A)(function*(){const n=`PREFIX qcy: <${Hn.qcy}>\nSELECT\n ?sourceCat\n ?predicate\n ?targetCat\n (COUNT(*) AS ?weight)\nWHERE {\n ?s a qcy:CanonicalEntity ;\n qcy:hasEntityCategory ?sourceCat .\n ?o a qcy:CanonicalEntity ;\n qcy:hasEntityCategory ?targetCat .\n ?s ?predicate ?o .\n FILTER(isIRI(?s) && isIRI(?o))\n FILTER(?predicate != qcy:relatedEntity)\n}\nGROUP BY ?sourceCat ?predicate ?targetCat\nORDER BY DESC(?weight)`,i=yield t._api.sparql(n,t._projectId,t._graphType),o=i.results.bindings.filter(a=>a.sourceCat&&a.predicate&&a.targetCat);if("graph"===e){const a=new Set,s=[];for(const l of o){const u=l.sourceCat.value,c=l.predicate.value,d=l.targetCat.value,h=parseInt(l.weight.value,10);a.add(u),a.add(d),s.push({sourceID:u,predicate:c,targetID:d,weight:h})}return{entities:Array.from(a).map(l=>({iri:l})),relations:s}}if("md"===e){const a=l5.getInstance(),s=o.map(d=>({src:a.compactIRI(d.sourceCat.value),pred:a.compactIRI(d.predicate.value),tgt:a.compactIRI(d.targetCat.value),weight:parseInt(d.weight.value,10)}));if(0===s.length)return"(no results)";const l=Math.max(...s.map(d=>d.src.length)),u=Math.max(...s.map(d=>d.pred.length)),c=Math.max(...s.map(d=>d.tgt.length));return s.map(d=>`${d.src.padEnd(l)} -> ${d.pred.padEnd(u)} -> ${d.tgt.padEnd(c)} (${d.weight})`).join("\n")}return i})()}_computeEntityInfoMap(){const e=this._entityDetails.get(),t=this._entityDocuments.get(),n=this._entityRelationships.get(),i=this._entityOSMMap.get(),o=this._osmWKTMap.get(),a=new Set([...Object.keys(e),...Object.keys(i).filter(l=>{const u=i[l];return u.direct.length>0||u.indirect.length>0})]),s={};for(const l of a){const u=e[l],c=i[l];let d,h;if(c){const f=new Set;d=c.direct.filter(y=>void 0!==o[y]&&!f.has(y)&&!!f.add(y)).map(y=>({osmIRI:y,wkt:o[y]}));const g=new Map;for(const{osm:y,viaRels:v,entityUUID:m}of c.indirect){const b=o[y];if(b)for(const T of v){const O=`${T}:${m}`,K=g.get(O)??{geometries:[],entityUUID:m};K.geometries.some(Z=>Z.osmIRI===y)||(K.geometries.push({osmIRI:y,wkt:b}),g.set(O,K))}}g.size>0&&(h=Array.from(g.entries()).map(([y,{geometries:v,entityUUID:m}])=>({rel:y.split(":")[0],geometries:v,entityUUID:m})))}s[l]={value:u?.value??"",categories:u?.categories??[],mentionCount:u?.mentionCount,documentRefs:t[l],relationshipData:n[l],directMapGeometries:d,indirectMapGeometries:h}}return s}_fetchOutgoingRelationships(e){var t=this;return(0,_.A)(function*(){const n=`PREFIX qcy: <${Hn.qcy}>\nSELECT ?rel ?related (SAMPLE(?val) AS ?nodeValue) (GROUP_CONCAT(STR(?cat); SEPARATOR=";") AS ?categories)\nWHERE {\n BIND(<${e}> AS ?s)\n ?s qcy:relatedEntity ?related ;\n ?rel ?related .\n ?related qcy:hasEntityCategory ?cat ;\n qcy:value ?val\n FILTER(?rel != qcy:relatedEntity)\n}\nGROUP BY ?rel ?related`,i=yield t._api.sparql(n,t._projectId,t._graphType),o=[],a={...t._entityDetails.get()};return i.results.bindings.forEach(s=>{if(!s.rel||!s.related)return;const l=s.categories?.value?.split(";").filter(Boolean)??[];o.push({relIRI:s.rel.value,nodeIRI:s.related.value,nodeValue:s.nodeValue?.value??"",nodeCategories:l});const u=s.related.value.replace(/^.*\/([^/]*)$/,"$1");a[u]={value:s.nodeValue?.value??"",categories:l}}),t._entityDetails.set(a),o})()}_fetchIncomingRelationships(e){var t=this;return(0,_.A)(function*(){const n=`PREFIX qcy: <${Hn.qcy}>\nSELECT ?rel ?relating (SAMPLE(?val) AS ?nodeValue) (GROUP_CONCAT(STR(?cat); SEPARATOR=";") AS ?categories)\nWHERE {\n BIND(<${e}> AS ?s)\n ?relating qcy:relatedEntity ?s ;\n ?rel ?s .\n ?relating qcy:hasEntityCategory ?cat ;\n qcy:value ?val\n FILTER(?rel != qcy:relatedEntity)\n}\nGROUP BY ?rel ?relating`,i=yield t._api.sparql(n,t._projectId,t._graphType),o=[],a={...t._entityDetails.get()};return i.results.bindings.forEach(s=>{if(!s.rel||!s.relating)return;const l=s.categories?.value?.split(";").filter(Boolean)??[];o.push({relIRI:s.rel.value,nodeIRI:s.relating.value,nodeValue:s.nodeValue?.value??"",nodeCategories:l});const u=s.relating.value.replace(/^.*\/([^/]*)$/,"$1");a[u]={value:s.nodeValue?.value??"",categories:l}}),t._entityDetails.set(a),o})()}_fetchEntityGraph(){var e=this;return(0,_.A)(function*(){const t=`PREFIX qcy: <${Hn.qcy}>\nSELECT ?e1Cat ?e2Cat (COUNT(?e1) AS ?e1Count) (COUNT(?e2) AS ?e2Count)\nWHERE {\n ?e1 a qcy:CanonicalEntity ;\n qcy:hasEntityCategory ?e1Cat ;\n qcy:relatedEntity ?e2 .\n ?e2 qcy:hasEntityCategory ?e2Cat\n}\nGROUP BY ?e1Cat ?e2Cat`;yield $b(t,(0,_.A)(function*(){const n=yield e._api.sparql(t,e._projectId,e._graphType),i=[],o=[];return n.results.bindings.forEach(a=>{if(!a.e1Cat||!a.e2Cat)return;const s=a.e1Cat.value,l=a.e2Cat.value,u=a.e1Count&&parseInt(a.e1Count.value,10)||20,c=a.e2Count&&parseInt(a.e2Count.value,10)||20;i.some(d=>d.iri===s)||i.push({iri:s,size:u}),i.some(d=>d.iri===l)||i.push({iri:l,size:c}),o.push({sourceID:s,targetID:l})}),{entities:i,relations:o}}),n=>e._entityGraph.set(n),e._queryCache)})()}_checkPendingOSMFetches(){const e=this._entityOSMMap.get(),t=this._osmWKTMap.get(),n=[];for(const i of Object.values(e)){for(const o of i.direct)!t[o]&&!this._fetchingOSMIds.has(o)&&n.push(o);for(const{osm:o}of i.indirect)!t[o]&&!this._fetchingOSMIds.has(o)&&n.push(o)}if(0!==n.length){for(const i of n)this._fetchingOSMIds.add(i);this._fetchOSMLocations(n).catch(i=>console.error("[CueProjectEntities] OSM WKT fetch failed:",i))}}_fetchOSMLocations(e){var t=this;return(0,_.A)(function*(){const n=e.filter(l=>!l.includes("/relation/"));if(0===n.length)return;const i=n.map(l=>`<${l}>`).join(" "),o=`PREFIX geo: <${Gl.geo}>\nSELECT * WHERE {\n VALUES ?s { ${i} }\n SERVICE <https://qlever.dev/api/osm-planet> {\n ?s geo:hasGeometry/geo:asWKT ?wkt\n }\n}`,a=yield t._api.sparql(o,t._projectId,t._graphType),s={...t._osmWKTMap.get()};a.results.bindings.forEach(l=>{!l.s||!l.wkt||(s[l.s.value]=l.wkt.value,t._fetchingOSMIds.delete(l.s.value))}),t._osmWKTMap.set(s)})()}}class Zp{constructor(e,t,n,i=Xb,o,a){this._api=e,this._projectId=t,this._queryCache=o,this._graphType=a,this.baseURL=`${i}${t}/`,this._currentLang=n??this._api.language,this.documentInfoMap=this._documentInfoMap.asReadonly(),this.projectDocumentsData=this._projectDocumentsData.asReadonly()}_api;_projectId;_queryCache;_graphType;baseURL;_currentLang;_documentInfoMap=new Gi({});_projectDocumentsData=new Gi({duplicateCount:0,documentsBySuffix:{},documentsByContentCategory:{}});documentInfoMap;projectDocumentsData;reset(){this._documentInfoMap.set({}),this._projectDocumentsData.set({duplicateCount:0,documentsBySuffix:{},documentsByContentCategory:{}})}setLanguage(e){this._currentLang!==e&&(this._currentLang=e,this._api.setLanguage(e),this._documentInfoMap.set({}))}fetchOverview(){var e=this;return(0,_.A)(function*(){e._projectDocumentsData.set({duplicateCount:0,documentsBySuffix:{},documentsByContentCategory:{}});const t=e._buildDocumentsBySuffixQuery(),n=e._buildDocumentsByContentCategoryQuery(),i=e._buildDuplicateCountQuery();yield $b(t+n+i,(0,_.A)(function*(){const[o,a,s]=yield Promise.all([e._runDocumentsBySuffixQuery(t),e._runDocumentsByContentCategoryQuery(n),e._runDuplicateCountQuery(i)]);return{duplicateCount:s,documentsBySuffix:o,documentsByContentCategory:a}}),o=>e._projectDocumentsData.set(o),e._queryCache)})()}requestDocumentData(e){const t=e.filter(n=>void 0===this._documentInfoMap.get()[n]);0!==t.length&&this._fetchDocumentInfoBatch(t).catch(n=>console.error("[CueProjectDocuments] requestDocumentData failed:",n))}fetchDocumentData(e){var t=this;return(0,_.A)(function*(){const n=t._documentInfoMap.get(),i=e.filter(a=>void 0===n[a]);i.length>0&&(yield t._fetchDocumentInfoBatch(i));const o=t._documentInfoMap.get();return Object.fromEntries(e.filter(a=>void 0!==o[a]).map(a=>[a,o[a]]))})()}fetchDocumentDataSimple(e){var t=this;return(0,_.A)(function*(){const n=t._documentInfoMap.get(),i=e.filter(a=>void 0===n[a]);i.length>0&&(yield t._fetchSimpleDocumentInfoBatch(i));const o=t._documentInfoMap.get();return Object.fromEntries(e.filter(a=>void 0!==o[a]).map(a=>[a,o[a]]))})()}fetchAlternativeRepresentations(e){var t=this;return(0,_.A)(function*(){const n=`PREFIX qcy: <${Hn.qcy}>\nPREFIX r: <${t.baseURL}>\nSELECT ?altId ?contentIRI ?suffix ?rrp\nWHERE {\n r:${e} qcy:alternativeRepresentation ?contentIRI .\n BIND(REPLACE(STR(?contentIRI), "^.*/([^/]*)$", "$1") AS ?altId)\n ?contentIRI qcy:hasFileLocation ?loc .\n ?loc qcy:suffix ?suffix .\n OPTIONAL { ?loc qcy:remoteRelativePath ?rrp }\n}`,i=yield t._api.sparql(n,t._projectId,t._graphType),o={...t._documentInfoMap.get()},a=[];return i.results.bindings.forEach(s=>{if(!s.altId||!s.contentIRI)return;const l=s.altId.value,u={id:l,contentIRI:s.contentIRI.value,path:"",suffix:s.suffix?.value??"",size:0,tags:[],categories:[],remoteRelativePath:s.rrp?.value};o[l]=u,a.push(u)}),t._documentInfoMap.set(o),a})()}randomFilePath(){var e=this;return(0,_.A)(function*(){const t=`PREFIX qcy: <${Hn.qcy}>\nSELECT ?path\nWHERE {\n ?fl a qcy:FileLocation ;\n qcy:filePath ?path .\n}\nLIMIT 1`;return(yield e._api.sparql(t,e._projectId,e._graphType)).results.bindings[0]?.path?.value??null})()}_fetchDocumentInfoBatch(e){var t=this;return(0,_.A)(function*(){const n=e.map(u=>`r:${u}`).join(" "),i=t._api.language,o=`PREFIX qcy: <${Hn.qcy}>\nPREFIX r: <${t.baseURL}>\nSELECT ?id ?contentIRI ?suffix ?size ?subject ?summary\n (SAMPLE(?fp) AS ?path)\n (GROUP_CONCAT(DISTINCT ?tag; SEPARATOR=";") AS ?tags)\n (GROUP_CONCAT(DISTINCT STR(?cat); SEPARATOR=";") AS ?categories)\nWHERE {\n VALUES ?contentIRI { ${n} }\n ?contentIRI qcy:sizeBytes ?size ;\n qcy:hasFileLocation ?loc .\n ?loc qcy:filePath ?fp ;\n qcy:suffix ?suffix .\n OPTIONAL { ?contentIRI qcy:hasContentCategory ?cat }\n OPTIONAL { ?contentIRI qcy:tag ?tag }\n OPTIONAL { ?loc qcy:remoteProviderId ?pid }\n\n OPTIONAL { ?contentIRI qcy:subject ?lang_subj FILTER(LANG(?lang_subj) = "${i}") }\n OPTIONAL { ?contentIRI qcy:subject ?no_lang_subj }\n BIND(COALESCE(?lang_subj, ?no_lang_subj) AS ?subject)\n\n OPTIONAL { ?contentIRI qcy:textSummary ?lang_summary FILTER(LANG(?lang_summary) = "${i}") }\n OPTIONAL { ?contentIRI qcy:textSummary ?no_lang_summary }\n BIND(COALESCE(?lang_summary, ?no_lang_summary) AS ?summary)\n\n BIND(REPLACE(STR(?contentIRI), "^.*/([^/]*)$", "$1") AS ?id)\n}\nGROUP BY ?id ?contentIRI ?suffix ?size ?subject ?summary`,a=yield t._api.sparql(o,t._projectId),s={...t._documentInfoMap.get()},l={};return a.results.bindings.forEach(u=>{if(!u.id||!u.contentIRI)return;const c=u.id.value,d={id:c,contentIRI:u.contentIRI.value,path:u.path?.value??"",suffix:u.suffix?.value??"",size:u.size?parseInt(u.size.value,10):0,tags:u.tags?.value?.split(";").filter(Boolean)??[],categories:u.categories?.value?.split(";").filter(Boolean)??[],subject:u.subject?.value,summary:u.summary?.value,providerId:u.pid?.value};s[c]=d,l[c]=d}),t._documentInfoMap.set(s),l})()}_fetchSimpleDocumentInfoBatch(e){var t=this;return(0,_.A)(function*(){const n=e.map(l=>`r:${l}`).join(" "),i=`PREFIX qcy: <${Hn.qcy}>\nPREFIX r: <${t.baseURL}>\nSELECT ?id ?contentIRI ?suffix ?size (SAMPLE(?fp) AS ?path)\nWHERE {\n VALUES ?contentIRI { ${n} }\n ?contentIRI qcy:sizeBytes ?size ;\n qcy:hasFileLocation ?loc .\n ?loc qcy:filePath ?fp ;\n qcy:suffix ?suffix .\n BIND(REPLACE(STR(?contentIRI), "^.*/([^/]*)$", "$1") AS ?id)\n}\nGROUP BY ?id ?contentIRI ?suffix ?size`,o=yield t._api.sparql(i,t._projectId,t._graphType),a={...t._documentInfoMap.get()},s={};return o.results.bindings.forEach(l=>{if(!l.id)return;const u=l.id.value,c=a[u],d={id:u,contentIRI:l.contentIRI?.value??c?.contentIRI??u,path:l.path?.value??c?.path??u,suffix:l.suffix?.value??c?.suffix??"",size:l.size?parseInt(l.size.value,10):c?.size??0,tags:c?.tags??[],categories:c?.categories??[],subject:c?.subject,summary:c?.summary,providerId:c?.providerId};a[u]=d,s[u]=d}),t._documentInfoMap.set(a),s})()}_fetchDocumentsBySuffix(){var e=this;return(0,_.A)(function*(){return e._runDocumentsBySuffixQuery(e._buildDocumentsBySuffixQuery())})()}_buildDocumentsBySuffixQuery(){return`PREFIX qcy: <${Hn.qcy}>\nSELECT ?ext (SUM(?size) AS ?totalSize) (COUNT(*) AS ?docCount)\nWHERE {\n {\n SELECT DISTINCT ?fc ?ext ?size\n WHERE {\n ?fc a qcy:FileContent ;\n qcy:sizeBytes ?size ;\n qcy:hasFileLocation/qcy:suffix ?ext .\n FILTER NOT EXISTS { ?x qcy:alternativeRepresentation ?fc }\n }\n }\n}\nGROUP BY ?ext\nORDER BY DESC(?docCount)`}_runDocumentsBySuffixQuery(e){var t=this;return(0,_.A)(function*(){const n=yield t._api.sparql(e,t._projectId,t._graphType),i={};return n.results.bindings.forEach(o=>{o.ext&&(i[o.ext.value]={size:o.totalSize?parseInt(o.totalSize.value,10):0,count:o.docCount?parseInt(o.docCount.value,10):0})}),i})()}_fetchDocumentsByContentCategory(){var e=this;return(0,_.A)(function*(){return e._runDocumentsByContentCategoryQuery(e._buildDocumentsByContentCategoryQuery())})()}_buildDocumentsByContentCategoryQuery(){return`PREFIX qcy: <${Hn.qcy}>\nSELECT ?cat (SUM(?size) AS ?totalSize) (COUNT(*) AS ?docCount)\nWHERE {\n {\n SELECT DISTINCT ?fc ?cat ?size\n WHERE {\n ?fc a qcy:FileContent ;\n qcy:hasContentCategory ?cat ;\n qcy:sizeBytes ?size .\n FILTER NOT EXISTS { ?x qcy:alternativeRepresentation ?fc }\n }\n }\n}\nGROUP BY ?cat\nORDER BY DESC(?docCount)`}_runDocumentsByContentCategoryQuery(e){var t=this;return(0,_.A)(function*(){const n=yield t._api.sparql(e,t._projectId,t._graphType),i={};return n.results.bindings.forEach(o=>{o.cat&&(i[o.cat.value]={size:o.totalSize?parseInt(o.totalSize.value,10):0,count:o.docCount?parseInt(o.docCount.value,10):0})}),i})()}_fetchDuplicateCount(){var e=this;return(0,_.A)(function*(){return e._runDuplicateCountQuery(e._buildDuplicateCountQuery())})()}_buildDuplicateCountQuery(){return`PREFIX qcy: <${Hn.qcy}>\nSELECT (COUNT(*) AS ?count)\nWHERE {\n SELECT ?fc\n WHERE {\n ?fc a qcy:FileContent ;\n qcy:hasFileLocation ?fl .\n FILTER NOT EXISTS { ?x qcy:alternativeRepresentation ?fc }\n }\n GROUP BY ?fc\n HAVING (COUNT(?fl) > 1)\n}`}_runDuplicateCountQuery(e){var t=this;return(0,_.A)(function*(){const n=(yield t._api.sparql(e,t._projectId,t._graphType)).results.bindings[0];return n?.count?parseInt(n.count.value,10):0})()}}const{namedNode:h5}=z;h5("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");const{namedNode:f5}=z;f5("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");const{namedNode:g5}=z;g5("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");const{namedNode:m5}=z;m5("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");var d0=ne(9769),Jo=ne(9352),h0=ne(5187),hh=ne(5381),$R=ne(1024),HR=ne(9421),b5=ne(4177),E5=ne(6117),T5=ne(8547),WR=ne(3319),XR=ne(5971),f0=ne(7573),V=ne(5547);function I5(r,e){if(1&r&&(V.nrm(0,"cue-key-val",4),V.nI1(1,"transloco")),2&r){const t=V.XpG(2);V.Y8G("key",V.bMT(1,2,"components.entityInfo.labelValue"))("val",t.entity().value)}}function x5(r,e){if(1&r&&(V.nrm(0,"cue-key-val-editable",5),V.nI1(1,"transloco"),V.nI1(2,"transloco")),2&r){const t=V.XpG(3);V.Y8G("key",1===t.entityCategories().length?V.bMT(1,4,"components.entityInfo.labelEntityCategory"):V.bMT(2,6,"components.entityInfo.labelEntityCategories"))("val",t.entityCategoriesString())("rdfConfig",t.rdfEditConfig())("editDisabled",!t.entityCategoriesEditable())}}function A5(r,e){if(1&r&&(V.nrm(0,"hr"),V.nVh(1,x5,3,8,"cue-key-val-editable",5)),2&r){const t=V.XpG(2);V.R7$(),V.vxM(t.entityCategories()&&t.entityCategories().length>0?1:-1)}}function S5(r,e){if(1&r&&(V.j41(0,"cue-key-val-list"),V.nVh(1,I5,2,4,"cue-key-val",4),V.nVh(2,A5,2,1),V.k0s()),2&r){const t=V.XpG();V.R7$(),V.vxM(t.entity().value?1:-1),V.R7$(),V.vxM(t.collapsed()?-1:2)}}function C5(r,e){if(1&r&&(V.j41(0,"cue-flexcontainer",3)(1,"cue-menu",6)(2,"cue-button",7,0),V.nrm(4,"cue-button-icon",8),V.k0s(),V.nrm(5,"cue-menu-nested",9),V.k0s()()),2&r){V.XpG();const t=V.r8f(3);V.R7$(5),V.Y8G("items",t)}}let R5=(()=>{class r{entity=R.hFB.required();handlers=R.hFB.required();entityCategoriesEditable=(0,R.hFB)(!1);menuItems=(0,R.hFB)([]);availableEntityCategories=(0,R.hFB)([]);collapsed=(0,R.hFB)(!1);dataChanged=(0,R.CGW)();_entityCategories=(0,E.uu)(()=>this.entity()?.categories||[]);entityCategories=(0,E.EW)(()=>this._entityCategories());entityCategoriesString=(0,E.EW)(()=>this._entityCategories().map(t=>this._iriToString(t)).sort().join(", "));infoChangeEntityCategory=(0,Jo.Xx)("components.entityInfo.infoChangeEntityCategory");rdfEditConfig=(0,E.EW)(()=>{var t=this;const n=this.handlers()?.requestRDFChange;var i;if(void 0!==n)return{message:this.infoChangeEntityCategory(),existingValue:this._entityCategories(),dataType:"multiselect",options:this.availableEntityCategories()?.map(i=>i.iri),optionLabelMap:this.availableEntityCategories()?.reduce((i,o)=>(i[o.iri]=o.label,i),{}),requestSave:(i=(0,_.A)(function*(o){console.log(o);const a={subject:t.entity()?.iri,predicate:`${f0.E.qcy}entityCategory`,objects:t._entityCategories(),newObjects:o.newValue,type:"entityCategory",comment:o.comment};yield n(a),t._entityCategories.set(o.newValue),t.dataChanged.emit({entityCategories:o.newValue})}),function(a){return i.apply(this,arguments)})};console.warn("No RDF change request handler defined")});_iriToString(t){const n=this.availableEntityCategories()?.find(i=>i.iri===t);return n?n.label:t}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-entity-info"]],inputs:{entity:[1,"entity"],handlers:[1,"handlers"],entityCategoriesEditable:[1,"entityCategoriesEditable"],menuItems:[1,"menuItems"],availableEntityCategories:[1,"availableEntityCategories"],collapsed:[1,"collapsed"]},outputs:{dataChanged:"dataChanged"},decls:5,vars:3,consts:[["trigger",""],["direction","row",2,"min-height","50px"],["direction","column",2,"flex","1 1"],["direction","column",2,"width","50px"],["size","l",3,"key","val"],["size","s",3,"key","val","rdfConfig","editDisabled"],["positioning","bottomleft"],["trigger","","variant","tertiary"],["icon","more-vert"],["menu","",3,"items"]],template:function(n,i){if(1&n&&(V.j41(0,"cue-flexcontainer",1)(1,"cue-flexcontainer",2),V.nVh(2,S5,3,2,"cue-key-val-list"),V.k0s(),V.SS7(3),V.nVh(4,C5,6,1,"cue-flexcontainer",3),V.k0s()),2&n){V.R7$(2),V.vxM(i.entity()?2:-1),V.R7$();const o=V.bH3(i.menuItems());V.R7$(),V.vxM(void 0!==o&&o.length>0?4:-1)}},dependencies:[hh.n,$R.p,HR.F,b5.L,E5.W,T5.T,WR.a,XR.$,Jo.Kj],encapsulation:2,changeDetection:0})}return r})();var P5=ne(2960);class KR{hideClassAssignmentTriples=!0;hideDatatypePropertyTriples=!0;collapseIntoClassificationLabels=[];preferredLabelLanguage="en";showClassLabelOnInstance=!0}var YR=ne(2130),D5=ne(8402);class QR{_doc;_omitClassAssignments;_omitDatatypeProperties;_preferredLabelLanguage;_collapseIntoClassificationLabels;_context;_nodes=[];_edges=[];_seenNodes=[];_resourceLabels={};_resourceAltLabels={};_resolvedCollapsePredicates=new Set;_knownPrefixes={schema:"http://schema.org/"};constructor(e,t=!0,n=!0,i="en",o=[]){this._doc=e,this._omitClassAssignments=t,this._omitDatatypeProperties=n,this._preferredLabelLanguage=i,this._collapseIntoClassificationLabels=o}get elementData(){return{nodes:this._nodes,edges:this._edges}}init(){var e=this;return(0,_.A)(function*(){return"http://schema.org/"==e._doc["@context"]&&(e._doc["@context"]="https://schema.org/"),e._context={...e._doc["@context"],...e._knownPrefixes},e._nodes=[],e._edges=[],e._seenNodes=[],e._resourceLabels={},e._resourceAltLabels={},e._resolvedCollapsePredicates=new Set(e._collapseIntoClassificationLabels.map(n=>e._expandIRI(n))),(yield(0,YR.toRDF)(e._doc)).forEach(n=>e._processQuad(n)),e._nodes=e._appendNames(e._nodes),e._edges=e._appendNames(e._edges),{nodes:e._nodes,edges:e._edges}})()}append(e){var t=this;return(0,_.A)(function*(){return(yield(0,YR.toRDF)(e)).forEach(i=>t._processQuad(i)),t._nodes=t._appendNames(t._nodes),t._edges=t._appendNames(t._edges),{nodes:t._nodes,edges:t._edges}})()}_processQuad(e){const t=e.subject.value;let n=e.predicate.value,i=e.object.value;if("http://www.w3.org/2004/02/skos/core#prefLabel"===n||"http://www.w3.org/2000/01/rdf-schema#label"===n||"http://schema.org/name"===n)return void(Object.keys(this._resourceLabels).includes(t)?this._resourceLabels[t].push(e.object):this._resourceLabels[t]=[e.object]);if("http://www.w3.org/2004/02/skos/core#altLabel"===n)return void(Object.keys(this._resourceAltLabels).includes(t)?this._resourceAltLabels[t].push(e.object):this._resourceAltLabels[t]=[e.object]);if(this._appendNamedNode(t),this._resolvedCollapsePredicates.has(n)){const a=this._nodes.find(s=>s.data.id===t);return void(void 0!==a&&(void 0===a.data.boxLabels&&(a.data.boxLabels=[]),a.data.boxLabels.push(this._appendPrefix(i))))}if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===n&&(n="a",this._seenNodes.includes(t))){const a=this._nodes.find(s=>s.data.id===t);void 0!==a&&(void 0===a.data.boxLabels&&(a.data.boxLabels=[]),a.data.boxLabels.push(this._appendPrefix(i)))}const o=e.object.termType;if("Literal"===o){if(i=this._appendLiteralNode(i),this._seenNodes.includes(t)){const a=this._nodes.find(s=>s.data.id===t);if(void 0!==a){void 0===a.data.properties&&(a.data.properties={});const s=this._getIdFromIRI(n);a.data.properties[s]=e.object.value}}}else"BlankNode"===o?this._appendNamedNode(i,"individual"):"NamedNode"===o?this._appendNamedNode(i,"a"===n?"class":"individual"):console.warn("Unknown term type "+o);this._appendEdge(t,n,i,"Literal"===o)}_appendNames(e){return e.map(t=>{const n=t.data.iri,i=(void 0!==t.data.id?this._resourceLabels[t.data.id]:void 0)??(void 0!==n?this._resourceLabels[n]:void 0)??(void 0!==t.data.id?this._resourceAltLabels[t.data.id]:void 0)??(void 0!==n?this._resourceAltLabels[n]:void 0);if(Array.isArray(i))1===i.length?t.data.label=i[0].value:console.log("MORE THAN ONE LABEL NOT YET SUPPORTED");else{if("class"===t.classes){if(null==t.data.iri)return t;t.data.label=this._getIdFromIRI(t.data.iri)}if("edge"===t.classes){if(null==t.data.iri)return t;t.data.label=this._getIdFromIRI(t.data.iri)}}const o=t.data;return void 0!==o.size&&(""!=t.data.label&&(o.size=44),Array.isArray(o.boxLabels)&&(o.boxLabels=o.boxLabels.map(a=>{const s=this._expandIRI(a),l=this._resourceLabels[s]??this._resourceAltLabels[s];return Array.isArray(l)&&l.length>0?l[0].value:a}))),t})}_appendNamedNode(e,t="individual"){if(!this._omitClassAssignments||"class"!==t)if(this._seenNodes.includes(e)){if("class"===t){const n=this._nodes.find(i=>i.data.id===e);null!=n&&(n.classes=t)}}else this._nodes.push({data:{id:e,iri:e,label:"",size:24},classes:t}),this._seenNodes.push(e)}_appendLiteralNode(e){if(this._omitDatatypeProperties)return"";""===e&&(e="-");const t=this._camelize(e);return this._seenNodes.includes(t)||(this._nodes.push({data:{id:t,label:e,size:2*e.length},classes:"literal"}),this._seenNodes.push(t)),t}_appendEdge(e,t,n,i=!1){this._omitClassAssignments&&"a"===t||this._omitDatatypeProperties&&i||this._edges.push({data:{id:(0,D5.A)(),source:e,target:n,label:this._appendPrefix(t),iri:t},classes:"edge"})}_expandIRI(e){if(e.startsWith("http://")||e.startsWith("https://"))return e;const t=e.indexOf(":");if(t>0){const n=e.substring(0,t),i=e.substring(t+1),o=this._context?.[n];if(o)return o+i}return e}_appendPrefix(e){const t=Object.keys(this._context),n=Object.values(this._context);for(const i in n){const o=n[i];if(e.startsWith(o)){e=e.replace(o,`${t[i]}:`);break}}return e}_camelize(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(t,n){return 0===n?t.toLowerCase():t.toUpperCase()}).replace(/\s+/g,"")}_getIdFromIRI(e){return e.includes("#")?e.split("#")[1]:e.split("/").pop()??e}}class N5{_doc;_settings;_elementDataHandler;_elementData;constructor(e,t=new KR){this._doc=e,this._settings=t,this._elementDataHandler=new QR(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels)}set settings(e){this._settings=e,this._elementDataHandler=new QR(this._doc,this._settings.hideClassAssignmentTriples,this._settings.hideDatatypePropertyTriples,this._settings.preferredLabelLanguage,this._settings.collapseIntoClassificationLabels)}init(){var e=this;return(0,_.A)(function*(){return e._elementData=yield e._elementDataHandler.init(),e._elementData})()}appendElementData(e){var t=this;return(0,_.A)(function*(){return t._elementData=yield t._elementDataHandler.append(e),t._elementData})()}compact(){console.log("COMPACT")}expand(){console.log("EXPAND")}}class fh{props={display:!0,displayOnlyOnHover:!0};boxLabels={display:!0,displayOnlyOnHover:!1}}function JR(r,e,t=new fh){function n(){r.nodes().forEach(a=>{const s=a.renderedHeight(),l=document.getElementById(`box-${a.id()}`);if(l){if(t.boxLabels.display){const u=a.data().boxLabels;if(void 0!==u){let c=document.getElementById(`labels-box-${a.id()}`);c?c.style.bottom=s/2-10+"px":(c=document.createElement("div"),c.id=`labels-box-${a.id()}`,c.className="box-label",c.style.bottom=s/2-10+"px",t.boxLabels.displayOnlyOnHover&&(c.style.display="none"),l.appendChild(c),u.forEach((d,h)=>{if(!c)return;const f=document.createElement("div");f.id=`labels-box-${a.id()}-${h}`,f.className="entry",f.innerHTML=d,c.appendChild(f)}))}}if(t.props.display){const u=a.data().properties;if(void 0!==u){let c=document.getElementById(`props-box-${a.id()}`);c?c.style.top=s/2-10+"px":(c=document.createElement("div"),c.id=`props-box-${a.id()}`,c.style.right="0px",c.className="property",c.style.top=s/2-10+"px",t.props.displayOnlyOnHover&&(c.style.display="none"),l.appendChild(c),Object.keys(u).forEach((d,h)=>{if(!c)return;const f=document.createElement("div");f.id=`props-box-${a.id()}-${h}`,f.className="entry",f.innerHTML=`<span class="key">${d}</span><span class="value">${u[d]}</span>`,c.appendChild(f)}))}}}})}!function L5(r,e){function t(){r.nodes().forEach(i=>{const o=i.renderedPosition();let a=document.getElementById(`box-${i.id()}`);a||(a=document.createElement("div"),a.id=`box-${i.id()}`,a.style.position="absolute",e.appendChild(a)),a.style.left=`${o.x}px`,a.style.top=`${o.y}px`})}t(),r.on("position","node",t),r.on("pan zoom",t),r.on("remove","node",function n(i){const o=i.target.id(),a=document.getElementById(`box-${o}`);a&&a.remove()}),window.addEventListener("resize",t)}(r,e),n(),r.on("zoom",()=>{n(),function o(){if(!t.boxLabels.display)return;const s=r.zoom()>=.6;r.nodes().forEach(l=>{const u=document.getElementById(`labels-box-${l.id()}`);u&&(t.boxLabels.displayOnlyOnHover||(u.style.display=s?"flex":"none"))})}()}),r.on("mouseover","node",a=>{const s=a.target;if(t.props.displayOnlyOnHover){const l=document.getElementById(`props-box-${s.id()}`);l&&(l.style.display="flex")}if(t.boxLabels.displayOnlyOnHover){const l=document.getElementById(`labels-box-${s.id()}`);l&&(l.style.display="flex")}}),r.on("mouseout","node",a=>{const s=a.target;if(t.props.displayOnlyOnHover){const l=document.getElementById(`props-box-${s.id()}`);l&&(l.style.display="none")}if(t.boxLabels.displayOnlyOnHover){const l=document.getElementById(`labels-box-${s.id()}`);l&&(l.style.display="none")}})}function Zo(r){return getComputedStyle(document.documentElement).getPropertyValue(r).trim()}const ng={get backgroundColor(){return Zo("--cue-main-background")||"#f5f6f9"},get edgeColor(){return Zo("--cue-primary")||"#2859e1"},edgeFontSize:"5rem",edgeWidth:"1.5rem",get nodeColor(){return Zo("--cue-primary")||"#2859e1"},nodeOpacity:"0.9",font:"Poppins",directed:!0,labelSelector:"label",showNodeLabels:!0,showEdgeLabels:!0,get hoverBorderColor(){return Zo("--cue-primary")||"#2859e1"},get textColor(){return Zo("--cue-primaryContrast")||"#ffffff"}},ZR=(r=ng)=>{const e=Zo("--cue-primary")||"#2859e1",t=Zo("--cue-primaryContrast")||"#ffffff",n=Zo("--cue-accent")||"#e2f552",i=Zo("--cue-accentContrast")||"#121c2b",o=Zo("--cue-neutral")||"#8394b0",a=Zo("--cue-main-foreground")||"#121c2b",s=r.backgroundColor;return[{selector:"node",style:{label:l=>l.data(r.labelSelector)&&r.showNodeLabels?l.data(r.labelSelector):"",shape:"round-rectangle","text-valign":"bottom","text-margin-y":10,"font-family":r.font,"font-size":"6rem",opacity:r.nodeOpacity,color:a,"text-outline-width":0,"text-outline-color":l=>l.data("color")?l.data("color"):e,"background-color":l=>l.data("color")?l.data("color"):e,width:l=>l.data("size")?l.data("size"):"24",height:l=>l.data("size")?l.data("size"):"24","background-image":l=>l.data("imgPath")?l.data("imgPath"):"none","background-fit":"cover","background-width":"100%","background-height":"100%","background-image-opacity":.2}},{selector:"edge",style:{label:"","font-family":r.font,"font-size":r.edgeFontSize,color:e,"target-arrow-color":e,"curve-style":"bezier","target-arrow-shape":r.directed?"triangle":"none","arrow-scale":.8,"line-color":e,"line-opacity":.5,width:l=>l.data("width")?l.data("width"):r.edgeWidth}},{selector:"edge.edge-hover",style:{label:l=>l.data(r.labelSelector)&&r.showEdgeLabels?l.data(r.labelSelector):"","line-opacity":1,width:l=>l.data("width")?l.data("width"):r.edgeWidth,"text-valign":"center","text-rotation":"autorotate","text-background-opacity":1,"text-background-color":s,"text-background-padding":4,"font-size":r.edgeFontSize,"font-weight":"600"}},{selector:".triple",style:{"background-color":s,"border-color":l=>l.data("color")?l.data("color"):e}},{selector:".literal",style:{label:l=>l.data(r.labelSelector)?l.data(r.labelSelector):"","text-valign":"center","font-size":"6rem","border-color":a,"background-color":s,"text-outline-width":0,"border-width":0,"background-opacity":0,color:a}},{selector:".loading",style:{shape:"ellipse","pie-size":"100%","pie-1-background-color":e,"pie-1-background-size":l=>`${l.data("pct")}%`,"pie-2-background-color":n,"pie-2-background-size":l=>100-parseInt(l.data("pct"))+"%",label:l=>void 0!==l.data("pct")&&100!==l.data("pct")?`${parseInt(l.data("pct"))}%`:"","font-size":"5rem","border-width":1,"border-opacity":1,"border-color":t}},{selector:".dropzone",style:{"border-color":e,"border-width":6,"border-opacity":1}},{selector:".collapser",style:{"background-color":o,"text-outline-color":o,"text-outline-width":0,"text-valign":"center",color:t,"border-width":0,"border-opacity":0,opacity:1}},{selector:".collapser-expanded",style:{opacity:.65}},{selector:".class",style:{"background-color":n,"text-outline-color":n,color:i}},{selector:".faded",style:{opacity:.12}},{selector:"node.focused",style:{"outline-color":l=>l.data("color")||e,"outline-width":"2px","outline-offset":"3px","outline-opacity":.5,"outline-style":"solid"}}]};class O5{_requestId;_animationRunning=!1;constructor(e,t=!0,n=1e-4,i=.02){this._build(e,t,n,i)}stop(){void 0!==this._requestId&&(cancelAnimationFrame(this._requestId),this._requestId=void 0,this._animationRunning=!1)}_build(e,t=!0,n=1e-4,i=.02){const o=()=>{this._animationRunning&&(e.nodes().forEach((a,s)=>{const l=a.position(),u=Math.sin(performance.now()*n+s)*i,c=Math.cos(performance.now()*n+s)*i;a.position({x:l.x+u,y:l.y+c})}),this._requestId=requestAnimationFrame(o))};this._animationRunning=!0,this._requestId=requestAnimationFrame(o),t&&e.on("mouseover","node",()=>{this.stop()})}}var M5=ne(6894),F5=ne.n(M5);function p0(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=Array(e);t<e;t++)n[t]=r[t];return n}function Ls(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Os(r,e,t){return e&&function U5(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,tP(n.key),n)}}(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function co(r,e){var t=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=g0(r))||e){t&&(r=t);var n=0,i=function(){};return{s:i,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(l){throw l},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){t=t.call(r)},n:function(){var l=t.next();return a=l.done,l},e:function(l){s=!0,o=l},f:function(){try{a||null==t.return||t.return()}finally{if(s)throw o}}}}function eP(r,e,t){return(e=tP(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Zn(r,e){return function V5(r){if(Array.isArray(r))return r}(r)||function G5(r,e){var t=null==r?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var n,i,o,a,s=[],l=!0,u=!1;try{if(o=(t=t.call(r)).next,0===e){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=o.call(t)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(r,e)||g0(r,e)||function q5(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ig(r){return function B5(r){if(Array.isArray(r))return p0(r)}(r)||function z5(r){if(typeof Symbol<"u"&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||g0(r)||function j5(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function tP(r){var e=function $5(r,e){if("object"!=typeof r||!r)return r;var t=r[Symbol.toPrimitive];if(void 0!==t){var n=t.call(r,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(r,"string");return"symbol"==typeof e?e:e+""}function ii(r){return(ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(r)}function g0(r,e){if(r){if("string"==typeof r)return p0(r,e);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?p0(r,e):void 0}}var y0,hP,_0,fP,w0,pP,b0,gP,E0,mP,T0,vP,I0,yP,A0,_P,S0,wP,C0,bP,R0,TP,P0,IP,k0,xP,D0,AP,oi=typeof window>"u"?null:window,rP=oi?oi.navigator:null,H5=ii(""),nP=ii({}),W5=ii(function(){}),X5=typeof HTMLElement>"u"?"undefined":ii(HTMLElement),ph=function(e){return e&&e.instanceString&&On(e.instanceString)?e.instanceString():null},sr=function(e){return null!=e&&ii(e)==H5},On=function(e){return null!=e&&ii(e)===W5},un=function(e){return!So(e)&&(Array.isArray?Array.isArray(e):null!=e&&e instanceof Array)},qr=function(e){return null!=e&&ii(e)===nP&&!un(e)&&e.constructor===Object},Ut=function(e){return null!=e&&ii(e)===ii(1)&&!isNaN(e)},og=function(e){if("undefined"!==X5)return null!=e&&e instanceof HTMLElement},So=function(e){return gh(e)||iP(e)},gh=function(e){return"collection"===ph(e)&&e._private.single},iP=function(e){return"collection"===ph(e)&&!e._private.single},m0=function(e){return"core"===ph(e)},oP=function(e){return"stylesheet"===ph(e)},Ms=function(e){return null==e||!(""!==e&&!e.match(/^\s+$/))},eG=function(e){return function(e){return null!=e&&ii(e)===nP}(e)&&On(e.then)},cc=function(e,t){t||(t=function(){if(1===arguments.length)return arguments[0];if(0===arguments.length)return"undefined";for(var o=[],a=0;a<arguments.length;a++)o.push(arguments[a]);return o.join("$")});var n=function(){var s,a=arguments,l=t.apply(this,a),u=n.cache;return(s=u[l])||(s=u[l]=e.apply(this,a)),s};return n.cache={},n},v0=cc(function(r){return r.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),ag=cc(function(r){return r.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),aP=cc(function(r,e){return r+e[0].toUpperCase()+e.substring(1)},function(r,e){return r+"$"+e}),sP=function(e){return Ms(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},Fs=function(e,t){return e.slice(-1*t.length)===t},ai="(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))",rG="rgb[a]?\\(("+ai+"[%]?)\\s*,\\s*("+ai+"[%]?)\\s*,\\s*("+ai+"[%]?)(?:\\s*,\\s*("+ai+"))?\\)",nG="rgb[a]?\\((?:"+ai+"[%]?)\\s*,\\s*(?:"+ai+"[%]?)\\s*,\\s*(?:"+ai+"[%]?)(?:\\s*,\\s*(?:"+ai+"))?\\)",iG="hsl[a]?\\(("+ai+")\\s*,\\s*("+ai+"[%])\\s*,\\s*("+ai+"[%])(?:\\s*,\\s*("+ai+"))?\\)",oG="hsl[a]?\\((?:"+ai+")\\s*,\\s*(?:"+ai+"[%])\\s*,\\s*(?:"+ai+"[%])(?:\\s*,\\s*(?:"+ai+"))?\\)",lP=function(e,t){return e<t?-1:e>t?1:0},gr=null!=Object.assign?Object.assign.bind(Object):function(r){for(var e=arguments,t=1;t<e.length;t++){var n=e[t];if(null!=n)for(var i=Object.keys(n),o=0;o<i.length;o++){var a=i[o];r[a]=n[a]}}return r},uP=function(e){return(un(e)?e:null)||function(e){return fG[e.toLowerCase()]}(e)||function(e){if((4===e.length||7===e.length)&&"#"===e[0]){var n,i,o,a=16;return 4===e.length?(n=parseInt(e[1]+e[1],a),i=parseInt(e[2]+e[2],a),o=parseInt(e[3]+e[3],a)):(n=parseInt(e[1]+e[2],a),i=parseInt(e[3]+e[4],a),o=parseInt(e[5]+e[6],a)),[n,i,o]}}(e)||function(e){var t,n=new RegExp("^"+rG+"$").exec(e);if(n){t=[];for(var i=[],o=1;o<=3;o++){var a=n[o];if("%"===a[a.length-1]&&(i[o]=!0),a=parseFloat(a),i[o]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}if((i[1]||i[2]||i[3])&&!(i[1]&&i[2]&&i[3]))return;var u=n[4];if(void 0!==u){if((u=parseFloat(u))<0||u>1)return;t.push(u)}}return t}(e)||function(e){var t,n,i,o,a,s,l,u;function c(g,y,v){return v<0&&(v+=1),v>1&&(v-=1),v<1/6?g+6*(y-g)*v:v<.5?y:v<2/3?g+(y-g)*(2/3-v)*6:g}var d=new RegExp("^"+iG+"$").exec(e);if(d){if((n=parseInt(d[1]))<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,(i=parseFloat(d[2]))<0||i>100||(i/=100,(o=parseFloat(d[3]))<0||o>100)||(o/=100,void 0!==(a=d[4])&&((a=parseFloat(a))<0||a>1)))return;if(0===i)s=l=u=Math.round(255*o);else{var h=o<.5?o*(1+i):o+i-o*i,f=2*o-h;s=Math.round(255*c(f,h,n+1/3)),l=Math.round(255*c(f,h,n)),u=Math.round(255*c(f,h,n-1/3))}t=[s,l,u,a]}return t}(e)},fG={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},cP=function(e){for(var t=e.map,n=e.keys,i=n.length,o=0;o<i;o++){var a=n[o];if(qr(a))throw Error("Tried to set map with object key");o<n.length-1?(null==t[a]&&(t[a]={}),t=t[a]):t[a]=e.value}},dP=function(e){for(var t=e.map,n=e.keys,i=n.length,o=0;o<i;o++){var a=n[o];if(qr(a))throw Error("Tried to get map with object key");if(null==(t=t[a]))return t}return t},sg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mh(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function vh(){return hP?y0:(hP=1,y0=function r(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)})}function lg(){if(pP)return w0;pP=1;var r=function pG(){return fP?_0:(fP=1,_0="object"==typeof sg&&sg&&sg.Object===Object&&sg)}(),e="object"==typeof self&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return w0=t}function x0(){if(yP)return I0;yP=1;var r=lg();return I0=r.Symbol}function EP(){if(bP)return C0;bP=1;var r=x0(),e=function yG(){if(_P)return A0;_P=1;var r=x0(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,i=r?r.toStringTag:void 0;return A0=function o(a){var s=t.call(a,i),l=a[i];try{a[i]=void 0;var u=!0}catch{}var c=n.call(a);return u&&(s?a[i]=l:delete a[i]),c}}(),t=function _G(){if(wP)return S0;wP=1;var e=Object.prototype.toString;return S0=function t(n){return e.call(n)}}(),o=r?r.toStringTag:void 0;return C0=function a(s){return null==s?void 0===s?"[object Undefined]":"[object Null]":o&&o in Object(s)?e(s):t(s)}}function yh(){if(IP)return P0;IP=1;var r=EP(),e=function wG(){return TP?R0:(TP=1,R0=function r(e){return null!=e&&"object"==typeof e})}();return P0=function n(i){return"symbol"==typeof i||e(i)&&"[object Symbol]"==r(i)}}var TG=function EG(){if(AP)return D0;AP=1;var r=vh(),e=function gG(){if(gP)return b0;gP=1;var r=lg();return b0=function(){return r.Date.now()}}(),t=function bG(){if(xP)return k0;xP=1;var r=function vG(){if(vP)return T0;vP=1;var r=function mG(){if(mP)return E0;mP=1;var r=/\s/;return E0=function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}}(),e=/^\s+/;return T0=function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}}(),e=vh(),t=yh(),i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt;return k0=function l(u){if("number"==typeof u)return u;if(t(u))return NaN;if(e(u)){var c="function"==typeof u.valueOf?u.valueOf():u;u=e(c)?c+"":c}if("string"!=typeof u)return 0===u?u:+u;u=r(u);var d=o.test(u);return d||a.test(u)?s(u.slice(2),d?2:8):i.test(u)?NaN:+u}}(),i=Math.max,o=Math.min;return D0=function a(s,l,u){var c,d,h,f,g,y,v=0,m=!1,b=!1,T=!0;if("function"!=typeof s)throw new TypeError("Expected a function");function O(U){var me=c,be=d;return c=d=void 0,v=U,f=s.apply(be,me)}function S(U){var me=U-y;return void 0===y||me>=l||me<0||b&&U-v>=h}function P(){var U=e();if(S(U))return M(U);g=setTimeout(P,function Z(U){var Ae=l-(U-y);return b?o(Ae,h-(U-v)):Ae}(U))}function M(U){return g=void 0,T&&c?O(U):(c=d=void 0,f)}function X(){var U=e(),me=S(U);if(c=arguments,d=this,y=U,me){if(void 0===g)return function K(U){return v=U,g=setTimeout(P,l),m?O(U):f}(y);if(b)return clearTimeout(g),g=setTimeout(P,l),O(y)}return void 0===g&&(g=setTimeout(P,l)),f}return l=t(l)||0,r(u)&&(m=!!u.leading,h=(b="maxWait"in u)?i(t(u.maxWait)||0,l):h,T="trailing"in u?!!u.trailing:T),X.cancel=function q(){void 0!==g&&clearTimeout(g),v=0,c=y=d=g=void 0},X.flush=function G(){return void 0===g?f:M(e())},X},D0}(),_h=mh(TG),N0=oi?oi.performance:null,SP=N0&&N0.now?function(){return N0.now()}:function(){return Date.now()},IG=function(){if(oi){if(oi.requestAnimationFrame)return function(r){oi.requestAnimationFrame(r)};if(oi.mozRequestAnimationFrame)return function(r){oi.mozRequestAnimationFrame(r)};if(oi.webkitRequestAnimationFrame)return function(r){oi.webkitRequestAnimationFrame(r)};if(oi.msRequestAnimationFrame)return function(r){oi.msRequestAnimationFrame(r)}}return function(r){r&&setTimeout(function(){r(SP())},1e3/60)}}(),ug=function(e){return IG(e)},Za=SP,ql=9261,dc=5381,RP=function(e){for(var i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ql;!(i=e.next()).done;)n=65599*n+i.value|0;return n},wh=function(e){return 65599*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ql)+e|0},bh=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dc;return(t<<5)+t+e|0},Vs=function(e){return 2097152*e[0]+e[1]},cg=function(e,t){return[wh(e[0],t[0]),bh(e[1],t[1])]},PP=function(e,t){var n={value:0,done:!1},i=0,o=e.length;return RP({next:function(){return i<o?n.value=e[i++]:n.done=!0,n}},t)},jl=function(e,t){var n={value:0,done:!1},i=0,o=e.length;return RP({next:function(){return i<o?n.value=e.charCodeAt(i++):n.done=!0,n}},t)},kP=function(){return AG(arguments)},AG=function(e){for(var t,n=0;n<e.length;n++){var i=e[n];t=0===n?jl(i):jl(i,t)}return t};var DP=!0,PG=null!=console.warn,kG=null!=console.trace,L0=Number.MAX_SAFE_INTEGER||9007199254740991,NP=function(){return!0},dg=function(){return!1},LP=function(){return 0},O0=function(){},kn=function(e){throw new Error(e)},OP=function(e){if(void 0===e)return DP;DP=!!e},Qr=function(e){OP()&&(PG?console.warn(e):(console.log(e),kG&&console.trace()))},Ea=function(e){return null==e?e:un(e)?e.slice():qr(e)?function(e){return gr({},e)}(e):e},MP=function(e,t){for(t=e="";e++<36;t+=51*e&52?(15^e?8^Math.random()*(20^e?16:4):4).toString(16):"-");return t},LG={},FP=function(){return LG},Ri=function(e){var t=Object.keys(e);return function(n){for(var i={},o=0;o<t.length;o++){var a=t[o],s=n?.[a];i[a]=void 0===s?e[a]:s}return i}},Bs=function(e,t,n){for(var i=e.length-1;i>=0;i--)e[i]===t&&e.splice(i,1)},M0=function(e){e.splice(0,e.length)},ho=function(e,t,n){return n&&(t=aP(n,t)),e[t]},es=function(e,t,n,i){n&&(t=aP(n,t)),e[t]=i},ts=typeof Map<"u"?Map:function(){return Os(function r(){Ls(this,r),this._obj={}},[{key:"set",value:function(t,n){return this._obj[t]=n,this}},{key:"delete",value:function(t){return this._obj[t]=void 0,this}},{key:"clear",value:function(){this._obj={}}},{key:"has",value:function(t){return void 0!==this._obj[t]}},{key:"get",value:function(t){return this._obj[t]}}])}(),VG=function(){return Os(function r(e){if(Ls(this,r),this._obj=Object.create(null),this.size=0,null!=e){var t;t=null!=e.instanceString&&e.instanceString()===this.instanceString()?e.toArray():e;for(var n=0;n<t.length;n++)this.add(t[n])}},[{key:"instanceString",value:function(){return"set"}},{key:"add",value:function(t){var n=this._obj;1!==n[t]&&(n[t]=1,this.size++)}},{key:"delete",value:function(t){var n=this._obj;1===n[t]&&(n[t]=0,this.size--)}},{key:"clear",value:function(){this._obj=Object.create(null)}},{key:"has",value:function(t){return 1===this._obj[t]}},{key:"toArray",value:function(){var t=this;return Object.keys(this._obj).filter(function(n){return t.has(n)})}},{key:"forEach",value:function(t,n){return this.toArray().forEach(t,n)}}])}(),hc="undefined"!==(typeof Set>"u"?"undefined":ii(Set))?Set:VG,hg=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(void 0!==e&&void 0!==t&&m0(e)){var i=t.group;if(null==i&&(i=t.data&&null!=t.data.source&&null!=t.data.target?"edges":"nodes"),"nodes"===i||"edges"===i){this.length=1,this[0]=this;var o=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:i,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:void 0===t.selectable||!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:void 0===t.grabbable||!!t.grabbable,pannable:void 0===t.pannable?"edges"===i:!!t.pannable,active:!1,classes:new hc,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(null==o.position.x&&(o.position.x=0),null==o.position.y&&(o.position.y=0),t.renderedPosition){var a=t.renderedPosition,s=e.pan(),l=e.zoom();o.position={x:(a.x-s.x)/l,y:(a.y-s.y)/l}}var u=[];un(t.classes)?u=t.classes:sr(t.classes)&&(u=t.classes.split(/\s+/));for(var c=0,d=u.length;c<d;c++){var h=u[c];!h||""===h||o.classes.add(h)}this.createEmitter(),(void 0===n||n)&&this.restore();var f=t.style||t.css;f&&(Qr("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(f))}else kn("An element must be of type `nodes` or `edges`; you specified `"+i+"`")}else kn("An element must have a core reference and parameters set")},VP=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(n,i,o){var a;qr(n)&&!So(n)&&(n=(a=n).roots||a.root,i=a.visit,o=a.directed),o=2!==arguments.length||On(i)?o:i,i=On(i)?i:function(){};for(var y,s=this._private.cy,l=n=sr(n)?this.filter(n):n,u=[],c=[],d={},h={},f={},g=0,v=this.byGroup(),m=v.nodes,b=v.edges,T=0;T<l.length;T++){var O=l[T],K=O.id();O.isNode()&&(u.unshift(O),e.bfs&&(f[K]=!0,c.push(O)),h[K]=0)}for(var S,Z=function(){var U=e.bfs?u.shift():u.pop(),me=U.id();if(e.dfs){if(f[me])return 0;f[me]=!0,c.push(U)}var Xe,be=h[me],Ae=d[me],_e=null!=Ae?Ae.source():null,Se=null!=Ae?Ae.target():null,je=null==Ae?void 0:U.same(_e)?Se[0]:_e[0];if(!0===(Xe=i(U,Ae,je,g++,be)))return y=U,1;if(!1===Xe)return 1;for(var De=U.connectedEdges().filter(function(bt){return(!o||bt.source().same(U))&&b.has(bt)}),ze=0;ze<De.length;ze++){var lt=De[ze],yt=lt.connectedNodes().filter(function(bt){return!bt.same(U)&&m.has(bt)}),ot=yt.id();0!==yt.length&&!f[ot]&&(u.push(yt=yt[0]),e.bfs&&(f[ot]=!0,c.push(yt)),d[ot]=lt,h[ot]=h[me]+1)}};0!==u.length&&(0===(S=Z())||1!==S););for(var P=s.collection(),M=0;M<c.length;M++){var q=c[M],G=d[q.id()];null!=G&&P.push(G),P.push(q)}return{path:s.collection(P),found:s.collection(y)}}},Eh={breadthFirstSearch:VP({bfs:!0}),depthFirstSearch:VP({dfs:!0})};Eh.bfs=Eh.breadthFirstSearch,Eh.dfs=Eh.depthFirstSearch;var BP,F0,UP,fg={exports:{}},BG=fg.exports;var B0,Th=mh(function zG(){return UP||(UP=1,F0=function UG(){return BP||(BP=1,r=fg,function(){var t,n,i,o,a,s,l,u,c,d,h,f,g,y,v;i=Math.floor,d=Math.min,n=function(m,b){return m<b?-1:m>b?1:0},c=function(m,b,T,O,K){var Z;if(null==T&&(T=0),null==K&&(K=n),T<0)throw new Error("lo must be non-negative");for(null==O&&(O=m.length);T<O;)K(b,m[Z=i((T+O)/2)])<0?O=Z:T=Z+1;return[].splice.apply(m,[T,T-T].concat(b)),b},s=function(m,b,T){return null==T&&(T=n),m.push(b),y(m,0,m.length-1,T)},a=function(m,b){var T,O;return null==b&&(b=n),T=m.pop(),m.length?(O=m[0],m[0]=T,v(m,0,b)):O=T,O},u=function(m,b,T){var O;return null==T&&(T=n),O=m[0],m[0]=b,v(m,0,T),O},l=function(m,b,T){var O;return null==T&&(T=n),m.length&&T(m[0],b)<0&&(b=(O=[m[0],b])[0],m[0]=O[1],v(m,0,T)),b},o=function(m,b){var O,K,Z,S,P;for(null==b&&(b=n),S=[],O=0,K=(Z=function(){P=[];for(var M=0,q=i(m.length/2);0<=q?M<q:M>q;0<=q?M++:M--)P.push(M);return P}.apply(this).reverse()).length;O<K;O++)S.push(v(m,Z[O],b));return S},g=function(m,b,T){var O;if(null==T&&(T=n),-1!==(O=m.indexOf(b)))return y(m,0,O,T),v(m,O,T)},h=function(m,b,T){var K,Z,S,P;if(null==T&&(T=n),!(K=m.slice(0,b)).length)return K;for(o(K,T),Z=0,S=(P=m.slice(b)).length;Z<S;Z++)l(K,P[Z],T);return K.sort(T).reverse()},f=function(m,b,T){var O,K,Z,S,P,M,q,G,X;if(null==T&&(T=n),10*b<=m.length){if(!(Z=m.slice(0,b).sort(T)).length)return Z;for(K=Z[Z.length-1],S=0,M=(q=m.slice(b)).length;S<M;S++)T(O=q[S],K)<0&&(c(Z,O,0,null,T),Z.pop(),K=Z[Z.length-1]);return Z}for(o(m,T),X=[],P=0,G=d(b,m.length);0<=G?P<G:P>G;0<=G?++P:--P)X.push(a(m,T));return X},y=function(m,b,T,O){var K,Z,S;for(null==O&&(O=n),K=m[T];T>b&&O(K,Z=m[S=T-1>>1])<0;)m[T]=Z,T=S;return m[T]=K},v=function(m,b,T){var O,K,Z,S,P;for(null==T&&(T=n),K=m.length,P=b,Z=m[b],O=2*b+1;O<K;)(S=O+1)<K&&!(T(m[O],m[S])<0)&&(O=S),m[b]=m[O],O=2*(b=O)+1;return m[b]=Z,y(m,P,b,T)},t=function(){function m(b){this.cmp=b??n,this.nodes=[]}return m.push=s,m.pop=a,m.replace=u,m.pushpop=l,m.heapify=o,m.updateItem=g,m.nlargest=h,m.nsmallest=f,m.prototype.push=function(b){return s(this.nodes,b,this.cmp)},m.prototype.pop=function(){return a(this.nodes,this.cmp)},m.prototype.peek=function(){return this.nodes[0]},m.prototype.contains=function(b){return-1!==this.nodes.indexOf(b)},m.prototype.replace=function(b){return u(this.nodes,b,this.cmp)},m.prototype.pushpop=function(b){return l(this.nodes,b,this.cmp)},m.prototype.heapify=function(){return o(this.nodes,this.cmp)},m.prototype.updateItem=function(b){return g(this.nodes,b,this.cmp)},m.prototype.clear=function(){return this.nodes=[]},m.prototype.empty=function(){return 0===this.nodes.length},m.prototype.size=function(){return this.nodes.length},m.prototype.clone=function(){var b;return(b=new m).nodes=this.nodes.slice(0),b},m.prototype.toArray=function(){return this.nodes.slice(0)},m.prototype.insert=m.prototype.push,m.prototype.top=m.prototype.peek,m.prototype.front=m.prototype.peek,m.prototype.has=m.prototype.contains,m.prototype.copy=m.prototype.clone,m}(),r.exports=t}.call(BG)),fg.exports;var r}()),F0}()),qG=Ri({root:null,weight:function(e){return 1},directed:!1}),jG={dijkstra:function(e){if(!qr(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=qG(e),i=n.root,a=n.directed,s=this,l=n.weight,u=sr(i)?this.filter(i)[0]:i[0],c={},d={},h={},f=this.byGroup(),g=f.nodes,y=f.edges;y.unmergeBy(function(be){return be.isLoop()});for(var v=function(Ae){return c[Ae.id()]},m=function(Ae,_e){c[Ae.id()]=_e,b.updateItem(Ae)},b=new Th(function(be,Ae){return v(be)-v(Ae)}),T=0;T<g.length;T++){var O=g[T];c[O.id()]=O.same(u)?0:1/0,b.push(O)}for(var K=function(Ae,_e){for(var Xe,Se=(a?Ae.edgesTo(_e):Ae.edgesWith(_e)).intersect(y),je=1/0,De=0;De<Se.length;De++){var ze=Se[De],lt=l(ze);(lt<je||!Xe)&&(je=lt,Xe=ze)}return{edge:Xe,dist:je}};b.size()>0;){var Z=b.pop(),S=v(Z),P=Z.id();if(h[P]=S,S!==1/0)for(var M=Z.neighborhood().intersect(g),q=0;q<M.length;q++){var G=M[q],X=G.id(),U=K(Z,G),me=S+U.dist;me<v(G)&&(m(G,me),d[X]={node:Z,edge:U.edge})}}return{distanceTo:function(Ae){var _e=sr(Ae)?g.filter(Ae)[0]:Ae[0];return h[_e.id()]},pathTo:function(Ae){var _e=sr(Ae)?g.filter(Ae)[0]:Ae[0],Se=[],je=_e,Xe=je.id();if(_e.length>0)for(Se.unshift(_e);d[Xe];){var De=d[Xe];Se.unshift(De.edge),Se.unshift(De.node),Xe=(je=De.node).id()}return s.spawn(Se)}}}},$G={kruskal:function(e){e=e||function(T){return 1};for(var t=this.byGroup(),n=t.nodes,i=t.edges,o=n.length,a=new Array(o),s=n,l=function(O){for(var K=0;K<a.length;K++)if(a[K].has(O))return K},u=0;u<o;u++)a[u]=this.spawn(n[u]);for(var c=i.sort(function(T,O){return e(T)-e(O)}),d=0;d<c.length;d++){var h=c[d],f=h.source()[0],g=h.target()[0],y=l(f),v=l(g),m=a[y],b=a[v];y!==v&&(s.merge(h),m.merge(b),a.splice(v,1))}return s}},HG=Ri({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),WG={aStar:function(e){var t=this.cy(),n=HG(e),i=n.root,o=n.goal,a=n.heuristic,s=n.directed,l=n.weight;i=t.collection(i)[0],o=t.collection(o)[0];var T,O,u=i.id(),c=o.id(),d={},h={},f={},g=new Th(function(Xe,De){return h[Xe.id()]-h[De.id()]}),y=new hc,v={},m={},b=function(De,ze){g.push(De),y.add(ze)},K=function(){T=g.pop(),O=T.id(),y.delete(O)},Z=function(De){return y.has(De)};b(i,u),d[u]=0,h[u]=a(i);for(var S=0;g.size()>0;){if(K(),S++,O===c){for(var P=[],M=o,q=c,G=m[q];P.unshift(M),null!=G&&P.unshift(G),null!=(M=v[q]);)G=m[q=M.id()];return{found:!0,distance:d[O],path:this.spawn(P),steps:S}}f[O]=!0;for(var X=T._private.edges,U=0;U<X.length;U++){var me=X[U];if(this.hasElementWithId(me.id())&&(!s||me.data("source")===O)){var be=me.source(),Ae=me.target(),_e=be.id()!==O?be:Ae,Se=_e.id();if(this.hasElementWithId(Se)&&!f[Se]){var je=d[O]+l(me);if(!Z(Se)){d[Se]=je,h[Se]=je+a(_e),b(_e,Se),v[Se]=T,m[Se]=me;continue}je<d[Se]&&(d[Se]=je,h[Se]=je+a(_e),v[Se]=T,m[Se]=me)}}}}return{found:!1,distance:void 0,path:void 0,steps:S}}},XG=Ri({weight:function(e){return 1},directed:!1}),KG={floydWarshall:function(e){for(var t=this.cy(),n=XG(e),o=n.directed,a=n.weight,s=this.byGroup(),l=s.nodes,u=s.edges,c=l.length,d=c*c,h=function(lt){return l.indexOf(lt)},f=function(lt){return l[lt]},g=new Array(d),y=0;y<d;y++){var v=y%c;g[y]=(y-v)/c===v?0:1/0}for(var b=new Array(d),T=new Array(d),O=0;O<u.length;O++){var K=u[O],Z=K.source()[0],S=K.target()[0];if(Z!==S){var P=h(Z),M=h(S),q=P*c+M,G=a(K);if(g[q]>G&&(g[q]=G,b[q]=M,T[q]=K),!o){var X=M*c+P;!o&&g[X]>G&&(g[X]=G,b[X]=P,T[X]=K)}}}for(var U=0;U<c;U++)for(var me=0;me<c;me++)for(var be=me*c+U,Ae=0;Ae<c;Ae++){var _e=me*c+Ae,Se=U*c+Ae;g[be]+g[Se]<g[_e]&&(g[_e]=g[be]+g[Se],b[_e]=b[be])}var Xe=function(lt){return h(function(lt){return(sr(lt)?t.filter(lt):lt)[0]}(lt))};return{distance:function(lt,yt){var ot=Xe(lt),bt=Xe(yt);return g[ot*c+bt]},path:function(lt,yt){var ot=Xe(lt),bt=Xe(yt),xt=f(ot);if(ot===bt)return xt.collection();if(null==b[ot*c+bt])return t.collection();var zt=t.collection();for(zt.merge(xt);ot!==bt;)zt.merge(T[ot*c+(ot=b[ot*c+bt])]),zt.merge(f(ot));return zt}}}},YG=Ri({weight:function(e){return 1},directed:!1,root:null}),QG={bellmanFord:function(e){var t=this,n=YG(e),o=n.directed,a=n.root,s=n.weight,l=this,u=this.cy(),c=this.byGroup(),d=c.edges,h=c.nodes,f=h.length,g=new ts,y=!1,v=[];a=u.collection(a)[0],d.unmergeBy(function(vr){return vr.isLoop()});for(var m=d.length,b=function(cr){var ar=g.get(cr.id());return ar||(ar={},g.set(cr.id(),ar)),ar},T=function(cr){return(sr(cr)?u.$(cr):cr)[0]},Z=0;Z<f;Z++){var S=h[Z],P=b(S);P.dist=S.same(a)?0:1/0,P.pred=null,P.edge=null}for(var M=!1,q=function(cr,ar,Rt,Gt,rr,_r){var or=Gt.dist+_r;or<rr.dist&&!Rt.same(Gt.edge)&&(rr.dist=or,rr.pred=cr,rr.edge=Rt,M=!0)},G=1;G<f;G++){M=!1;for(var X=0;X<m;X++){var U=d[X],me=U.source(),be=U.target(),Ae=s(U),_e=b(me),Se=b(be);q(me,0,U,_e,Se,Ae),o||q(be,0,U,Se,_e,Ae)}if(!M)break}if(M)for(var je=[],Xe=0;Xe<m;Xe++){var De=d[Xe],ze=De.source(),lt=De.target(),yt=s(De),ot=b(ze).dist,bt=b(lt).dist;if(ot+yt<bt||!o&&bt+yt<ot){if(y||(Qr("Graph contains a negative weight cycle for Bellman-Ford"),y=!0),!1===e.findNegativeWeightCycles)break;var xt=[];ot+yt<bt&&xt.push(ze),!o&&bt+yt<ot&&xt.push(lt);for(var zt=xt.length,_t=0;_t<zt;_t++){var Ue=xt[_t],He=[Ue];He.push(b(Ue).edge);for(var Ye=b(Ue).pred;-1===He.indexOf(Ye);)He.push(Ye),He.push(b(Ye).edge),Ye=b(Ye).pred;for(var pt=(He=He.slice(He.indexOf(Ye)))[0].id(),Lt=0,tr=2;tr<He.length;tr+=2)He[tr].id()<pt&&(pt=He[tr].id(),Lt=tr);(He=He.slice(Lt).concat(He.slice(0,Lt))).push(He[0]);var Ur=He.map(function(vr){return vr.id()}).join(",");-1===je.indexOf(Ur)&&(v.push(l.spawn(He)),je.push(Ur))}}}return{distanceTo:function(cr){return b(T(cr)).dist},pathTo:function(cr){for(var ar=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,Gt=[],rr=T(cr);;){if(null==rr)return t.spawn();var _r=b(rr),or=_r.edge,Ar=_r.pred;if(Gt.unshift(rr[0]),rr.same(ar)&&Gt.length>0)break;null!=or&&Gt.unshift(or),rr=Ar}return l.spawn(Gt)},hasNegativeWeightCycle:y,negativeWeightCycles:v}}},JG=Math.sqrt(2),ZG=function(e,t,n){0===n.length&&kn("Karger-Stein must be run on a connected (sub)graph");for(var i=n[e],s=t[i[1]],l=t[i[2]],u=n,c=u.length-1;c>=0;c--){var d=u[c],h=d[1],f=d[2];(t[h]===s&&t[f]===l||t[h]===l&&t[f]===s)&&u.splice(c,1)}for(var g=0;g<u.length;g++){var y=u[g];y[1]===l?(u[g]=y.slice(),u[g][1]=s):y[2]===l&&(u[g]=y.slice(),u[g][2]=s)}for(var v=0;v<t.length;v++)t[v]===l&&(t[v]=s);return u},V0=function(e,t,n,i){for(;n>i;){var o=Math.floor(Math.random()*t.length);t=ZG(o,e,t),n--}return t},eq={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,i=t.edges;i.unmergeBy(function(Se){return Se.isLoop()});var o=n.length,a=i.length,s=Math.ceil(Math.pow(Math.log(o)/Math.LN2,2)),l=Math.floor(o/JG);if(!(o<2)){for(var u=[],c=0;c<a;c++){var d=i[c];u.push([c,n.indexOf(d.source()),n.indexOf(d.target())])}for(var h=1/0,f=[],g=new Array(o),y=new Array(o),v=new Array(o),m=function(je,Xe){for(var De=0;De<o;De++)Xe[De]=je[De]},b=0;b<=s;b++){for(var T=0;T<o;T++)y[T]=T;var O=V0(y,u.slice(),o,l),K=O.slice();m(y,v);var Z=V0(y,O,l,2),S=V0(v,K,l,2);Z.length<=S.length&&Z.length<h?(h=Z.length,f=Z,m(y,g)):S.length<=Z.length&&S.length<h&&(h=S.length,f=S,m(v,g))}for(var P=this.spawn(f.map(function(Se){return i[Se[0]]})),M=this.spawn(),q=this.spawn(),G=g[0],X=0;X<g.length;X++){var me=n[X];g[X]===G?M.merge(me):q.merge(me)}var be=function(je){var Xe=e.spawn();return je.forEach(function(De){Xe.merge(De),De.connectedEdges().forEach(function(ze){e.contains(ze)&&!P.contains(ze)&&Xe.merge(ze)})}),Xe},Ae=[be(M),be(q)];return{cut:P,components:Ae,partition1:M,partition2:q}}kn("At least 2 nodes are required for Karger-Stein algorithm")}},pg=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},zP=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},fc=function(e){return{x:e[0],y:e[1]}},gg=function(e,t){return Math.atan2(t,e)-Math.PI/2},U0=Math.log2||function(r){return Math.log(r)/Math.log(2)},z0=function(e){return e>0?1:e<0?-1:0},$l=function(e,t){return Math.sqrt(Hl(e,t))},Hl=function(e,t){var n=t.x-e.x,i=t.y-e.y;return n*n+i*i},sq=function(e){for(var t=e.length,n=0,i=0;i<t;i++)n+=e[i];for(var o=0;o<t;o++)e[o]=e[o]/n;return e},gi=function(e,t,n,i){return(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n},pc=function(e,t,n,i){return{x:gi(e.x,t.x,n.x,i),y:gi(e.y,t.y,n.y,i)}},Ih=function(e,t,n){return Math.max(e,Math.min(n,t))},eo=function(e){if(null==e)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(null!=e.x1&&null!=e.y1){if(null!=e.x2&&null!=e.y2&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(null!=e.w&&null!=e.h&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},dq=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},GP=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},mg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},vg=function(e){var n,i,o,a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0];if(1===t.length)n=i=o=a=t[0];else if(2===t.length)n=o=t[0],a=i=t[1];else if(4===t.length){var s=Zn(t,4);n=s[0],i=s[1],o=s[2],a=s[3]}return e.x1-=a,e.x2+=i,e.y1-=n,e.y2+=o,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},qP=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},G0=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},Us=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},jP=function(e,t){return Us(e,t.x,t.y)},$P=function(e,t){return Us(e,t.x1,t.y1)&&Us(e,t.x2,t.y2)},hq=null!==(B0=Math.hypot)&&void 0!==B0?B0:function(r,e){return Math.sqrt(r*r+e*e)};var HP=function(e,t,n,i,o,a,s){var g,be,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"auto",u="auto"===l?Gs(o,a):l,c=o/2,d=a/2,h=(u=Math.min(u,c,d))!==c,f=u!==d;if(h){var v=i-d-s;if((g=zs(e,t,n,i,n-c+u-s,v,n+c-u+s,v,!1)).length>0)return g}if(f){var T=n+c+s;if((g=zs(e,t,n,i,T,i-d+u-s,T,i+d-u+s,!1)).length>0)return g}if(h){var P=i+d+s;if((g=zs(e,t,n,i,n-c+u-s,P,n+c-u+s,P,!1)).length>0)return g}if(f){var G=n-c-s;if((g=zs(e,t,n,i,G,i-d+u-s,G,i+d-u+s,!1)).length>0)return g}var Ae=n-c+u,_e=i-d+u;if((be=xh(e,t,n,i,Ae,_e,u+s)).length>0&&be[0]<=Ae&&be[1]<=_e)return[be[0],be[1]];var Se=n+c-u,je=i-d+u;if((be=xh(e,t,n,i,Se,je,u+s)).length>0&&be[0]>=Se&&be[1]<=je)return[be[0],be[1]];var Xe=n+c-u,De=i+d-u;if((be=xh(e,t,n,i,Xe,De,u+s)).length>0&&be[0]>=Xe&&be[1]>=De)return[be[0],be[1]];var ze=n-c+u,lt=i+d-u;return(be=xh(e,t,n,i,ze,lt,u+s)).length>0&&be[0]<=ze&&be[1]>=lt?[be[0],be[1]]:[]},gq=function(e,t,n,i,o,a,s){var l=s,u=Math.min(n,o),c=Math.max(n,o),d=Math.min(i,a),h=Math.max(i,a);return u-l<=e&&e<=c+l&&d-l<=t&&t<=h+l},mq=function(e,t,n,i,o,a,s,l,u){var c_x1=Math.min(n,s,o)-u,c_x2=Math.max(n,s,o)+u,c_y1=Math.min(i,l,a)-u,c_y2=Math.max(i,l,a)+u;return!(e<c_x1||e>c_x2||t<c_y1||t>c_y2)},_q=function(e,t,n,i,o,a,s,l){var f=[];!function(e,t,n,i,o){var s,l,u,c,d,h,f,g;0===e&&(e=1e-5),u=-27*(i/=e)+(t/=e)*(9*(n/=e)-t*t*2),s=(l=(3*n-t*t)/9)*l*l+(u/=54)*u,o[1]=0,f=t/3,s>0?(d=(d=u+Math.sqrt(s))<0?-Math.pow(-d,1/3):Math.pow(d,1/3),h=(h=u-Math.sqrt(s))<0?-Math.pow(-h,1/3):Math.pow(h,1/3),o[0]=-f+d+h,o[4]=o[2]=-(f+=(d+h)/2),f=Math.sqrt(3)*(-h+d)/2,o[3]=f,o[5]=-f):(o[5]=o[3]=0,0===s?(g=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3),o[0]=2*g-f,o[4]=o[2]=-(g+f)):(c=(l=-l)*l*l,c=Math.acos(u/Math.sqrt(c)),g=2*Math.sqrt(l),o[0]=-f+g*Math.cos(c/3),o[2]=-f+g*Math.cos((c+2*Math.PI)/3),o[4]=-f+g*Math.cos((c+4*Math.PI)/3)))}(1*n*n-4*n*o+2*n*s+4*o*o-4*o*s+s*s+i*i-4*i*a+2*i*l+4*a*a-4*a*l+l*l,9*n*o-3*n*n-3*n*s-6*o*o+3*o*s+9*i*a-3*i*i-3*i*l-6*a*a+3*a*l,3*n*n-6*n*o+n*s-n*e+2*o*o+2*o*e-s*e+3*i*i-6*i*a+i*l-i*t+2*a*a+2*a*t-l*t,1*n*o-n*n+n*e-o*e+i*a-i*i+i*t-a*t,f);for(var y=[],v=0;v<6;v+=2)Math.abs(f[v+1])<1e-7&&f[v]>=0&&f[v]<=1&&y.push(f[v]);y.push(1),y.push(0);for(var b,T,O,m=-1,K=0;K<y.length;K++)b=Math.pow(1-y[K],2)*n+2*(1-y[K])*y[K]*o+y[K]*y[K]*s,T=Math.pow(1-y[K],2)*i+2*(1-y[K])*y[K]*a+y[K]*y[K]*l,O=Math.pow(b-e,2)+Math.pow(T-t,2),m>=0?O<m&&(m=O):m=O;return m},wq=function(e,t,n,i,o,a){var s=[e-n,t-i],l=[o-n,a-i],u=l[0]*l[0]+l[1]*l[1],c=s[0]*s[0]+s[1]*s[1],d=s[0]*l[0]+s[1]*l[1],h=d*d/u;return d<0?c:h>u?(e-o)*(e-o)+(t-a)*(t-a):c-h},fo=function(e,t,n){for(var i,o,a,s,u=0,c=0;c<n.length/2;c++)if(o=n[2*c+1],c+1<n.length/2?(a=n[2*(c+1)],s=n[2*(c+1)+1]):(a=n[2*(c+1-n.length/2)],s=n[2*(c+1-n.length/2)+1]),(i=n[2*c])!=e||a!=e){if(!(i>=e&&e>=a||i<=e&&e<=a))continue;(e-i)/(a-i)*(s-o)+o>t&&u++}return u%2!=0},rs=function(e,t,n,i,o,a,s,l,u){var d,y,c=new Array(n.length);null!=l[0]?(d=Math.atan(l[1]/l[0]),l[0]<0?d+=Math.PI/2:d=-d-Math.PI/2):d=l;for(var h=Math.cos(-d),f=Math.sin(-d),g=0;g<c.length/2;g++)c[2*g]=a/2*(n[2*g]*h-n[2*g+1]*f),c[2*g+1]=s/2*(n[2*g+1]*h+n[2*g]*f),c[2*g]+=i,c[2*g+1]+=o;if(u>0){var v=_g(c,-u);y=yg(v)}else y=c;return fo(e,t,y)},yg=function(e){for(var s,l,u,c,t=new Array(e.length/2),d=0;d<e.length/4;d++){d<e.length/4-1?(s=e[4*(d+1)],l=e[4*(d+1)+1],u=e[4*(d+1)+2],c=e[4*(d+1)+3]):(s=e[0],l=e[1],u=e[2],c=e[3]);var h=zs(e[4*d],e[4*d+1],e[4*d+2],e[4*d+3],s,l,u,c,!0);t[2*d]=h[0],t[2*d+1]=h[1]}return t},_g=function(e,t){for(var i,o,a,s,n=new Array(2*e.length),l=0;l<e.length/2;l++){l<e.length/2-1?(a=e[2*(l+1)],s=e[2*(l+1)+1]):(a=e[0],s=e[1]);var u=s-(o=e[2*l+1]),c=-(a-(i=e[2*l])),d=Math.sqrt(u*u+c*c),h=u/d,f=c/d;n[4*l]=i+h*t,n[4*l+1]=o+f*t,n[4*l+2]=a+h*t,n[4*l+3]=s+f*t}return n},Wl=function(e,t,n,i,o,a,s){return e-=o,t-=a,(e/=n/2+s)*e+(t/=i/2+s)*t<=1},xh=function(e,t,n,i,o,a,s){var l=[n-e,i-t],u=[e-o,t-a],c=l[0]*l[0]+l[1]*l[1],d=2*(u[0]*l[0]+u[1]*l[1]),f=d*d-4*c*(u[0]*u[0]+u[1]*u[1]-s*s);if(f<0)return[];var g=(-d+Math.sqrt(f))/(2*c),y=(-d-Math.sqrt(f))/(2*c),v=Math.min(g,y),m=Math.max(g,y),b=[];if(v>=0&&v<=1&&b.push(v),m>=0&&m<=1&&b.push(m),0===b.length)return[];var T=b[0]*l[0]+e,O=b[0]*l[1]+t;return b.length>1?b[0]==b[1]?[T,O]:[T,O,b[1]*l[0]+e,b[1]*l[1]+t]:[T,O]},q0=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},zs=function(e,t,n,i,o,a,s,l,u){var c=e-o,d=n-e,h=s-o,f=t-a,g=i-t,y=l-a,v=h*f-y*c,m=d*f-g*c,b=y*d-h*g;if(0!==b){var T=v/b,O=m/b,Z=-.001;return Z<=T&&T<=1.001&&Z<=O&&O<=1.001||u?[e+T*d,t+T*g]:[]}return 0===v||0===m?q0(e,n,s)===s?[s,l]:q0(e,n,o)===o?[o,a]:q0(o,s,n)===n?[n,i]:[]:[]},Tq=function(e,t,n,i,o){var a=[],s=i/2,l=o/2,u=t,c=n;a.push({x:u+s*e[0],y:c+l*e[1]});for(var d=1;d<e.length/2;d++)a.push({x:u+s*e[2*d],y:c+l*e[2*d+1]});return a},Ah=function(e,t,n,i,o,a,s,l){var c,f,u=[],d=new Array(n.length),h=!0;if(null==a&&(h=!1),h){for(var g=0;g<d.length/2;g++)d[2*g]=n[2*g]*a+i,d[2*g+1]=n[2*g+1]*s+o;if(l>0){var y=_g(d,-l);f=yg(y)}else f=d}else f=n;for(var b,T,O=0;O<f.length/2;O++)O<f.length/2-1?(b=f[2*(O+1)],T=f[2*(O+1)+1]):(b=f[0],T=f[1]),0!==(c=zs(e,t,i,o,f[2*O],f[2*O+1],b,T)).length&&u.push(c[0],c[1]);return u},wg=function(e,t,n){var i=[e[0]-t[0],e[1]-t[1]],o=Math.sqrt(i[0]*i[0]+i[1]*i[1]),a=(o-n)/o;return a<0&&(a=1e-5),[t[0]+a*i[0],t[1]+a*i[1]]},to=function(e,t){var n=j0(e,t);return WP(n)},WP=function(e){for(var t,n,i=e.length/2,o=1/0,a=1/0,s=-1/0,l=-1/0,u=0;u<i;u++)t=e[2*u],n=e[2*u+1],o=Math.min(o,t),s=Math.max(s,t),a=Math.min(a,n),l=Math.max(l,n);for(var c=2/(s-o),d=2/(l-a),h=0;h<i;h++)t=e[2*h]=e[2*h]*c,n=e[2*h+1]=e[2*h+1]*d,o=Math.min(o,t),s=Math.max(s,t),a=Math.min(a,n),l=Math.max(l,n);if(a<-1)for(var f=0;f<i;f++)n=e[2*f+1]=e[2*f+1]+(-1-a);return e},j0=function(e,t){var n=1/e*2*Math.PI,i=e%2==0?Math.PI/2+n/2:Math.PI/2;i+=t;for(var a,o=new Array(2*e),s=0;s<e;s++)a=s*n+i,o[2*s]=Math.cos(a),o[2*s+1]=Math.sin(-a);return o},Gs=function(e,t){return Math.min(e/4,t/4,8)},XP=function(e,t){return Math.min(e/10,t/10,8)},H0=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function W0(r,e){function t(d){for(var h=[],f=0;f<d.length;f++){var g=d[f],y=d[(f+1)%d.length],v={x:y.x-g.x,y:y.y-g.y},m={x:-v.y,y:v.x},b=Math.sqrt(m.x*m.x+m.y*m.y);h.push({x:m.x/b,y:m.y/b})}return h}function n(d,h){var v,f=1/0,g=-1/0,y=co(d);try{for(y.s();!(v=y.n()).done;){var m=v.value,b=m.x*h.x+m.y*h.y;f=Math.min(f,b),g=Math.max(g,b)}}catch(T){y.e(T)}finally{y.f()}return{min:f,max:g}}function i(d,h){return!(d.max<h.min||h.max<d.min)}var s,a=co([].concat(ig(t(r)),ig(t(e))));try{for(a.s();!(s=a.n()).done;){var l=s.value;if(!i(n(r,l),n(e,l)))return!1}}catch(d){a.e(d)}finally{a.f()}return!0}var Aq=Ri({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),Sq={pageRank:function(e){for(var t=Aq(e),n=t.dampingFactor,i=t.precision,o=t.iterations,a=t.weight,s=this._private.cy,l=this.byGroup(),u=l.nodes,c=l.edges,d=u.length,f=c.length,g=new Array(d*d),y=new Array(d),v=(1-n)/d,m=0;m<d;m++){for(var b=0;b<d;b++)g[m*d+b]=0;y[m]=0}for(var O=0;O<f;O++){var K=c[O],Z=K.data("source"),S=K.data("target");if(Z!==S){var P=u.indexOfId(Z),M=u.indexOfId(S),q=a(K);g[M*d+P]+=q,y[P]+=q}}for(var X=1/d+v,U=0;U<d;U++)if(0===y[U])for(var me=0;me<d;me++)g[me*d+U]=X;else for(var Ae=0;Ae<d;Ae++){var _e=Ae*d+U;g[_e]=g[_e]/y[U]+v}for(var Xe,Se=new Array(d),je=new Array(d),De=0;De<d;De++)Se[De]=1;for(var ze=0;ze<o;ze++){for(var lt=0;lt<d;lt++)je[lt]=0;for(var yt=0;yt<d;yt++)for(var ot=0;ot<d;ot++)je[yt]+=g[yt*d+ot]*Se[ot];sq(je),Xe=Se,Se=je,je=Xe;for(var xt=0,zt=0;zt<d;zt++){var _t=Xe[zt]-Se[zt];xt+=_t*_t}if(xt<i)break}return{rank:function(Ye){return Ye=s.collection(Ye)[0],Se[u.indexOf(Ye)]}}}},KP=Ri({root:null,weight:function(e){return 1},directed:!1,alpha:0}),gc={degreeCentralityNormalized:function(e){e=KP(e);var t=this.cy(),n=this.nodes(),i=n.length;if(e.directed){for(var c={},d={},h=0,f=0,g=0;g<i;g++){var y=n[g],v=y.id();e.root=y;var m=this.degreeCentrality(e);h<m.indegree&&(h=m.indegree),f<m.outdegree&&(f=m.outdegree),c[v]=m.indegree,d[v]=m.outdegree}return{indegree:function(T){return 0==h?0:(sr(T)&&(T=t.filter(T)),c[T.id()]/h)},outdegree:function(T){return 0===f?0:(sr(T)&&(T=t.filter(T)),d[T.id()]/f)}}}for(var o={},a=0,s=0;s<i;s++){var l=n[s];e.root=l;var u=this.degreeCentrality(e);a<u.degree&&(a=u.degree),o[l.id()]=u.degree}return{degree:function(T){return 0===a?0:(sr(T)&&(T=t.filter(T)),o[T.id()]/a)}}},degreeCentrality:function(e){e=KP(e);var t=this.cy(),n=this,o=e.root,a=e.weight,s=e.directed,l=e.alpha;if(o=t.collection(o)[0],s){for(var f=o.connectedEdges(),g=f.filter(function(Z){return Z.target().same(o)&&n.has(Z)}),y=f.filter(function(Z){return Z.source().same(o)&&n.has(Z)}),v=g.length,m=y.length,b=0,T=0,O=0;O<g.length;O++)b+=a(g[O]);for(var K=0;K<y.length;K++)T+=a(y[K]);return{indegree:Math.pow(v,1-l)*Math.pow(b,l),outdegree:Math.pow(m,1-l)*Math.pow(T,l)}}for(var u=o.connectedEdges().intersection(n),c=u.length,d=0,h=0;h<u.length;h++)d+=a(u[h]);return{degree:Math.pow(c,1-l)*Math.pow(d,l)}}};gc.dc=gc.degreeCentrality,gc.dcn=gc.degreeCentralityNormalised=gc.degreeCentralityNormalized;var YP=Ri({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),mc={closenessCentralityNormalized:function(e){for(var t=YP(e),n=t.harmonic,i=t.weight,o=t.directed,a=this.cy(),s={},l=0,u=this.nodes(),c=this.floydWarshall({weight:i,directed:o}),d=0;d<u.length;d++){for(var h=0,f=u[d],g=0;g<u.length;g++)if(d!==g){var y=c.distance(f,u[g]);h+=n?1/y:y}n||(h=1/h),l<h&&(l=h),s[f.id()]=h}return{closeness:function(m){return 0==l?0:(m=sr(m)?a.filter(m)[0].id():m.id(),s[m]/l)}}},closenessCentrality:function(e){var t=YP(e),n=t.root,i=t.weight,o=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var s=this.dijkstra({root:n,weight:i,directed:o}),l=0,u=this.nodes(),c=0;c<u.length;c++){var d=u[c];if(!d.same(n)){var h=s.distanceTo(d);l+=a?1/h:h}}return a?l:1/l}};mc.cc=mc.closenessCentrality,mc.ccn=mc.closenessCentralityNormalised=mc.closenessCentralityNormalized;var Cq=Ri({weight:null,directed:!1}),X0={betweennessCentrality:function(e){for(var t=Cq(e),n=t.directed,i=t.weight,o=null!=i,a=this.cy(),s=this.nodes(),l={},u={},c=0,d={set:function(T,O){u[T]=O,O>c&&(c=O)},get:function(T){return u[T]}},h=0;h<s.length;h++){var f=s[h],g=f.id();l[g]=n?f.outgoers().nodes():f.openNeighborhood().nodes(),d.set(g,0)}for(var y=function(){for(var T=s[v].id(),O=[],K={},Z={},S={},P=new Th(function(yt,ot){return S[yt]-S[ot]}),M=0;M<s.length;M++){var q=s[M].id();K[q]=[],Z[q]=0,S[q]=1/0}for(Z[T]=1,S[T]=0,P.push(T);!P.empty();){var G=P.pop();if(O.push(G),o)for(var X=0;X<l[G].length;X++){var be,U=l[G][X],me=a.getElementById(G);be=me.edgesTo(U).length>0?me.edgesTo(U)[0]:U.edgesTo(me)[0];var Ae=i(be);U=U.id(),S[U]>S[G]+Ae&&(S[U]=S[G]+Ae,P.nodes.indexOf(U)<0?P.push(U):P.updateItem(U),Z[U]=0,K[U]=[]),S[U]==S[G]+Ae&&(Z[U]=Z[U]+Z[G],K[U].push(G))}else for(var _e=0;_e<l[G].length;_e++){var Se=l[G][_e].id();S[Se]==1/0&&(P.push(Se),S[Se]=S[G]+1),S[Se]==S[G]+1&&(Z[Se]=Z[Se]+Z[G],K[Se].push(G))}}for(var je={},Xe=0;Xe<s.length;Xe++)je[s[Xe].id()]=0;for(;O.length>0;){for(var De=O.pop(),ze=0;ze<K[De].length;ze++){var lt=K[De][ze];je[lt]=je[lt]+Z[lt]/Z[De]*(1+je[De])}De!=s[v].id()&&d.set(De,d.get(De)+je[De])}},v=0;v<s.length;v++)y();var m={betweenness:function(T){var O=a.collection(T).id();return d.get(O)},betweennessNormalized:function(T){if(0==c)return 0;var O=a.collection(T).id();return d.get(O)/c}};return m.betweennessNormalised=m.betweennessNormalized,m}};X0.bc=X0.betweennessCentrality;var Rq=Ri({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(r){return 1}]}),kq=function(e,t){for(var n=0,i=0;i<t.length;i++)n+=t[i](e);return n},QP=function(e,t){for(var n,i=0;i<t;i++){n=0;for(var o=0;o<t;o++)n+=e[o*t+i];for(var a=0;a<t;a++)e[a*t+i]=e[a*t+i]/n}},Nq=function(e,t,n){for(var i=new Array(n*n),o=0;o<n;o++){for(var a=0;a<n;a++)i[o*n+a]=0;for(var s=0;s<n;s++)for(var l=0;l<n;l++)i[o*n+l]+=e[o*n+s]*t[s*n+l]}return i},Lq=function(e,t,n){for(var i=e.slice(0),o=1;o<n;o++)e=Nq(e,i,t);return e},Oq=function(e,t,n){for(var i=new Array(t*t),o=0;o<t*t;o++)i[o]=Math.pow(e[o],n);return QP(i,t),i},Mq=function(e,t,n,i){for(var o=0;o<n;o++)if(Math.round(e[o]*Math.pow(10,i))/Math.pow(10,i)!==Math.round(t[o]*Math.pow(10,i))/Math.pow(10,i))return!1;return!0},Vq=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},JP=function(e){for(var t=this.nodes(),n=this.edges(),i=this.cy(),o=function(e){return Rq(e)}(e),a={},s=0;s<t.length;s++)a[t[s].id()]=s;for(var d,l=t.length,u=l*l,c=new Array(u),h=0;h<u;h++)c[h]=0;for(var f=0;f<n.length;f++){var g=n[f],y=a[g.source().id()],v=a[g.target().id()],m=kq(g,o.attributes);c[y*l+v]+=m,c[v*l+y]+=m}(function(e,t,n){for(var i=0;i<t;i++)e[i*t+i]=n})(c,l,o.multFactor),QP(c,l);for(var b=!0,T=0;b&&T<o.maxIterations;)b=!1,d=Lq(c,l,o.expandFactor),c=Oq(d,l,o.inflateFactor),Mq(c,d,u,4)||(b=!0),T++;var O=function(e,t,n,i){for(var o=[],a=0;a<t;a++){for(var s=[],l=0;l<t;l++)Math.round(1e3*e[a*t+l])/1e3>0&&s.push(n[l]);0!==s.length&&o.push(i.collection(s))}return o}(c,l,t,i);return O=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&Vq(e[t],e[n])&&e.splice(n,1);return e}(O),O},Uq={markovClustering:JP,mcl:JP},zq=function(e){return e},ZP=function(e,t){return Math.abs(t-e)},ek=function(e,t,n){return e+ZP(t,n)},tk=function(e,t,n){return e+Math.pow(n-t,2)},Gq=function(e){return Math.sqrt(e)},qq=function(e,t,n){return Math.max(e,ZP(t,n))},Sh=function(e,t,n,i,o){for(var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:zq,s=i,c=0;c<e;c++)s=o(s,t(c),n(c));return a(s)},vc={euclidean:function(e,t,n){return e>=2?Sh(e,t,n,0,tk,Gq):Sh(e,t,n,0,ek)},squaredEuclidean:function(e,t,n){return Sh(e,t,n,0,tk)},manhattan:function(e,t,n){return Sh(e,t,n,0,ek)},max:function(e,t,n){return Sh(e,t,n,-1/0,qq)}};function bg(r,e,t,n,i,o){var a;return a=On(r)?r:vc[r]||vc.euclidean,0===e&&On(r)?a(i,o):a(e,t,n,i,o)}vc["squared-euclidean"]=vc.squaredEuclidean,vc.squaredeuclidean=vc.squaredEuclidean;var jq=Ri({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),K0=function(e){return jq(e)},Eg=function(e,t,n,i,o){var s="kMedoids"!==o?function(d){return n[d]}:function(d){return i[d](n)};return bg(e,i.length,s,function(h){return i[h](t)},n,t)},Y0=function(e,t,n){for(var i=n.length,o=new Array(i),a=new Array(i),s=new Array(t),l=null,u=0;u<i;u++)o[u]=e.min(n[u]).value,a[u]=e.max(n[u]).value;for(var c=0;c<t;c++){l=[];for(var d=0;d<i;d++)l[d]=Math.random()*(a[d]-o[d])+o[d];s[c]=l}return s},rk=function(e,t,n,i,o){for(var a=1/0,s=0,l=0;l<t.length;l++){var u=Eg(n,e,t[l],i,o);u<a&&(a=u,s=l)}return s},nk=function(e,t,n){for(var i=[],o=null,a=0;a<t.length;a++)n[(o=t[a]).id()]===e&&i.push(o);return i},$q=function(e,t,n){return Math.abs(t-e)<=n},Hq=function(e,t,n){for(var i=0;i<e.length;i++)for(var o=0;o<e[i].length;o++)if(Math.abs(e[i][o]-t[i][o])>n)return!1;return!0},Wq=function(e,t,n){for(var i=0;i<n;i++)if(e===t[i])return!0;return!1},ik=function(e,t){var n=new Array(t);if(e.length<50)for(var i=0;i<t;i++){for(var o=e[Math.floor(Math.random()*e.length)];Wq(o,n,i);)o=e[Math.floor(Math.random()*e.length)];n[i]=o}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},ok=function(e,t,n){for(var i=0,o=0;o<t.length;o++)i+=Eg("manhattan",t[o],e,n,"kMedoids");return i},Yq=function(e,t,n,i,o){for(var a,s,l=0;l<t.length;l++)for(var u=0;u<e.length;u++)i[l][u]=Math.pow(n[l][u],o.m);for(var c=0;c<e.length;c++)for(var d=0;d<o.attributes.length;d++){a=0,s=0;for(var h=0;h<t.length;h++)a+=i[h][c]*o.attributes[d](t[h]),s+=i[h][c];e[c][d]=a/s}},Qq=function(e,t,n,i,o){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var s,l,u,c=2/(o.m-1),d=0;d<n.length;d++)for(var h=0;h<i.length;h++){s=0;for(var f=0;f<n.length;f++)l=Eg(o.distance,i[h],n[d],o.attributes,"cmeans"),u=Eg(o.distance,i[h],n[f],o.attributes,"cmeans"),s+=Math.pow(l/u,c);e[h][d]=1/s}},ak=function(e){var o,a,s,l,u,t=this.cy(),n=this.nodes(),i=K0(e);l=new Array(n.length);for(var c=0;c<n.length;c++)l[c]=new Array(i.k);s=new Array(n.length);for(var d=0;d<n.length;d++)s[d]=new Array(i.k);for(var h=0;h<n.length;h++){for(var f=0,g=0;g<i.k;g++)s[h][g]=Math.random(),f+=s[h][g];for(var y=0;y<i.k;y++)s[h][y]=s[h][y]/f}a=new Array(i.k);for(var v=0;v<i.k;v++)a[v]=new Array(i.attributes.length);u=new Array(n.length);for(var m=0;m<n.length;m++)u[m]=new Array(i.k);for(var b=!0,T=0;b&&T<i.maxIterations;)b=!1,Yq(a,n,s,u,i),Qq(s,l,a,n,i),Hq(s,l,i.sensitivityThreshold)||(b=!0),T++;return o=function(e,t,n,i){for(var o=new Array(n.k),a=0;a<o.length;a++)o[a]=[];for(var s,l,u=0;u<t.length;u++){s=-1/0,l=-1;for(var c=0;c<t[0].length;c++)t[u][c]>s&&(s=t[u][c],l=c);o[l].push(e[u])}for(var d=0;d<o.length;d++)o[d]=i.collection(o[d]);return o}(n,s,i,t),{clusters:o,degreeOfMembership:s}},Zq={kMeans:function(e){var l,t=this.cy(),n=this.nodes(),i=null,o=K0(e),a=new Array(o.k),s={};l=o.testMode?"number"==typeof o.testCentroids?Y0(n,o.k,o.attributes):"object"===ii(o.testCentroids)?o.testCentroids:Y0(n,o.k,o.attributes):Y0(n,o.k,o.attributes);for(var u=!0,c=0;u&&c<o.maxIterations;){for(var d=0;d<n.length;d++)s[(i=n[d]).id()]=rk(i,l,o.distance,o.attributes,"kMeans");u=!1;for(var h=0;h<o.k;h++){var f=nk(h,n,s);if(0!==f.length){for(var g=o.attributes.length,y=l[h],v=new Array(g),m=new Array(g),b=0;b<g;b++){m[b]=0;for(var T=0;T<f.length;T++)m[b]+=o.attributes[b](i=f[T]);v[b]=m[b]/f.length,$q(v[b],y[b],o.sensitivityThreshold)||(u=!0)}l[h]=v,a[h]=t.collection(f)}}c++}return a},kMedoids:function(e){var s,u,t=this.cy(),n=this.nodes(),i=null,o=K0(e),a=new Array(o.k),l={},c=new Array(o.k);o.testMode?"number"==typeof o.testCentroids||(s="object"===ii(o.testCentroids)?o.testCentroids:ik(n,o.k)):s=ik(n,o.k);for(var d=!0,h=0;d&&h<o.maxIterations;){for(var f=0;f<n.length;f++)l[(i=n[f]).id()]=rk(i,s,o.distance,o.attributes,"kMedoids");d=!1;for(var g=0;g<s.length;g++){var y=nk(g,n,l);if(0!==y.length){c[g]=ok(s[g],y,o.attributes);for(var v=0;v<y.length;v++)(u=ok(y[v],y,o.attributes))<c[g]&&(c[g]=u,s[g]=y[v],d=!0);a[g]=t.collection(y)}}h++}return a},fuzzyCMeans:ak,fcm:ak},e6=Ri({distance:"euclidean",linkage:"min",mode:"threshold",threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),t6={single:"min",complete:"max"},sk=function(e,t,n,i,o){for(var l,a=0,s=1/0,u=o.attributes,c=function(M,q){return bg(o.distance,u.length,function(G){return u[G](M)},function(G){return u[G](q)},M,q)},d=0;d<e.length;d++){var h=e[d].key,f=n[h][i[h]];f<s&&(a=h,s=f)}if("threshold"===o.mode&&s>=o.threshold||"dendrogram"===o.mode&&1===e.length)return!1;var v,g=t[a],y=t[i[a]];v="dendrogram"===o.mode?{left:g,right:y,key:g.key}:{value:g.value.concat(y.value),key:g.key},e[g.index]=v,e.splice(y.index,1),t[g.key]=v;for(var m=0;m<e.length;m++){var b=e[m];g.key===b.key?l=1/0:"min"===o.linkage?(l=n[g.key][b.key],n[g.key][b.key]>n[y.key][b.key]&&(l=n[y.key][b.key])):"max"===o.linkage?(l=n[g.key][b.key],n[g.key][b.key]<n[y.key][b.key]&&(l=n[y.key][b.key])):l="mean"===o.linkage?(n[g.key][b.key]*g.size+n[y.key][b.key]*y.size)/(g.size+y.size):"dendrogram"===o.mode?c(b.value,g.value):c(b.value[0],g.value[0]),n[g.key][b.key]=n[b.key][g.key]=l}for(var T=0;T<e.length;T++){var O=e[T].key;if(i[O]===g.key||i[O]===y.key){for(var K=O,Z=0;Z<e.length;Z++){var S=e[Z].key;n[O][S]<n[O][K]&&(K=S)}i[O]=K}e[T].index=T}return g.key=y.key=g.index=y.index=null,!0},yc=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&yc(e.left,t),e.right&&yc(e.right,t)))},Q0=function(e,t){if(!e)return"";if(e.left&&e.right){var n=Q0(e.left,t),i=Q0(e.right,t),o=t.add({group:"nodes",data:{id:n+","+i}});return t.add({group:"edges",data:{source:n,target:o.id()}}),t.add({group:"edges",data:{source:i,target:o.id()}}),o.id()}return e.value?e.value.id():void 0},J0=function(e,t,n){if(!e)return[];var i=[],o=[],a=[];return 0===t?(e.left&&yc(e.left,i),e.right&&yc(e.right,o),a=i.concat(o),[n.collection(a)]):1===t?e.value?[n.collection(e.value)]:(e.left&&yc(e.left,i),e.right&&yc(e.right,o),[n.collection(i),n.collection(o)]):e.value?[n.collection(e.value)]:(e.left&&(i=J0(e.left,t-1,n)),e.right&&(o=J0(e.right,t-1,n)),i.concat(o))},lk=function(e){for(var t=this.cy(),n=this.nodes(),i=function(e){var t=e6(e),n=t6[t.linkage];return null!=n&&(t.linkage=n),t}(e),o=i.attributes,a=function(T,O){return bg(i.distance,o.length,function(K){return o[K](T)},function(K){return o[K](O)},T,O)},s=[],l=[],u=[],c=[],d=0;d<n.length;d++){var h={value:"dendrogram"===i.mode?n[d]:[n[d]],key:d,index:d};s[d]=h,c[d]=h,l[d]=[],u[d]=0}for(var f=0;f<s.length;f++)for(var g=0;g<=f;g++){var y;y="dendrogram"===i.mode?f===g?1/0:a(s[f].value,s[g].value):f===g?1/0:a(s[f].value[0],s[g].value[0]),l[f][g]=y,l[g][f]=y,y<l[f][u[f]]&&(u[f]=g)}for(var v=sk(s,c,l,u,i);v;)v=sk(s,c,l,u,i);var m;return"dendrogram"===i.mode?(m=J0(s[0],i.dendrogramDepth,t),i.addDendrogram&&Q0(s[0],t)):(m=new Array(s.length),s.forEach(function(b,T){b.key=b.index=null,m[T]=t.collection(b.value)})),m},n6={hierarchicalClustering:lk,hca:lk},i6=Ri({distance:"euclidean",preference:"median",damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),a6=function(e,t,n,i){var o=function(s,l){return i[l](s)};return-bg(e,i.length,function(a){return o(t,a)},function(a){return o(n,a)},t,n)},uk=function(e,t,n){for(var i=[],o=0;o<e;o++){for(var a=-1,s=-1/0,l=0;l<n.length;l++){var u=n[l];t[o*e+u]>s&&(a=u,s=t[o*e+u])}a>0&&i.push(a)}for(var c=0;c<n.length;c++)i[n[c]]=n[c];return i},ck=function(e){for(var t=this.cy(),n=this.nodes(),i=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||kn("Damping must range on [0.5, 1). Got: ".concat(t));var i=["median","mean","min","max"];return i.some(function(o){return o===n})||Ut(n)||kn("Preference must be one of [".concat(i.map(function(o){return"'".concat(o,"'")}).join(", "),"] or a number. Got: ").concat(n)),i6(e)}(e),o={},a=0;a<n.length;a++)o[n[a].id()]=a;var s,l,u,c,d,h,M;l=(s=n.length)*s,u=new Array(l);for(var f=0;f<l;f++)u[f]=-1/0;for(var g=0;g<s;g++)for(var y=0;y<s;y++)g!==y&&(u[g*s+y]=a6(i.distance,n[g],n[y],i.attributes));c=function(e,t){var n;return n="median"===t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];arguments.length>3&&void 0!==arguments[3]&&!arguments[3]?(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t)):e=e.slice(t,n);for(var s=0,l=e.length-1;l>=0;l--)a?isFinite(e[l])||(e[l]=-1/0,s++):e.splice(l,1);o&&e.sort(function(h,f){return h-f});var c=e.length,d=Math.floor(c/2);return c%2!=0?e[d+1+s]:(e[d-1+s]+e[d+s])/2}(e):"mean"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=0,o=0,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;a<n;a++){var s=e[a];isFinite(s)&&(i+=s,o++)}return i/o}(e):"min"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=1/0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o<n;o++){var a=e[o];isFinite(a)&&(i=Math.min(a,i))}return i}(e):"max"===t?function(e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=-1/0,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o<n;o++){var a=e[o];isFinite(a)&&(i=Math.max(a,i))}return i}(e):t,n}(u,i.preference);for(var v=0;v<s;v++)u[v*s+v]=c;d=new Array(l);for(var m=0;m<l;m++)d[m]=0;h=new Array(l);for(var b=0;b<l;b++)h[b]=0;for(var T=new Array(s),O=new Array(s),K=new Array(s),Z=0;Z<s;Z++)T[Z]=0,O[Z]=0,K[Z]=0;for(var S=new Array(s*i.minIterations),P=0;P<S.length;P++)S[P]=0;for(M=0;M<i.maxIterations;M++){for(var q=0;q<s;q++){for(var G=-1/0,X=-1/0,U=-1,me=0,be=0;be<s;be++)T[be]=d[q*s+be],(me=h[q*s+be]+u[q*s+be])>=G?(X=G,G=me,U=be):me>X&&(X=me);for(var Ae=0;Ae<s;Ae++)d[q*s+Ae]=(1-i.damping)*(u[q*s+Ae]-G)+i.damping*T[Ae];d[q*s+U]=(1-i.damping)*(u[q*s+U]-X)+i.damping*T[U]}for(var _e=0;_e<s;_e++){for(var Se=0,je=0;je<s;je++)T[je]=h[je*s+_e],O[je]=Math.max(0,d[je*s+_e]),Se+=O[je];Se-=O[_e],O[_e]=d[_e*s+_e],Se+=O[_e];for(var Xe=0;Xe<s;Xe++)h[Xe*s+_e]=(1-i.damping)*Math.min(0,Se-O[Xe])+i.damping*T[Xe];h[_e*s+_e]=(1-i.damping)*(Se-O[_e])+i.damping*T[_e]}for(var De=0,ze=0;ze<s;ze++){var lt=h[ze*s+ze]+d[ze*s+ze]>0?1:0;S[M%i.minIterations*s+ze]=lt,De+=lt}if(De>0&&(M>=i.minIterations-1||M==i.maxIterations-1)){for(var yt=0,ot=0;ot<s;ot++){K[ot]=0;for(var bt=0;bt<i.minIterations;bt++)K[ot]+=S[bt*s+ot];(0===K[ot]||K[ot]===i.minIterations)&&yt++}if(yt===s)break}}for(var xt=function(e,t,n){for(var i=[],o=0;o<e;o++)t[o*e+o]+n[o*e+o]>0&&i.push(o);return i}(s,d,h),zt=function(e,t,n){for(var i=uk(e,t,n),o=0;o<n.length;o++){for(var a=[],s=0;s<i.length;s++)i[s]===n[o]&&a.push(s);for(var l=-1,u=-1/0,c=0;c<a.length;c++){for(var d=0,h=0;h<a.length;h++)d+=t[a[h]*e+a[c]];d>u&&(l=c,u=d)}n[o]=a[l]}return uk(e,t,n)}(s,u,xt),_t={},Ue=0;Ue<xt.length;Ue++)_t[xt[Ue]]=[];for(var He=0;He<n.length;He++){var pt=zt[o[n[He].id()]];null!=pt&&_t[pt].push(n[He])}for(var Lt=new Array(xt.length),tr=0;tr<xt.length;tr++)Lt[tr]=t.collection(_t[xt[tr]]);return Lt},c6={affinityPropagation:ck,ap:ck},d6=Ri({root:void 0,directed:!1}),h6={hierholzer:function(e){if(!qr(e)){var t=arguments;e={root:t[0],directed:t[1]}}var l,u,c,n=d6(e),i=n.root,o=n.directed,a=this,s=!1;i&&(c=sr(i)?this.filter(i)[0].id():i[0].id());var d={},h={};a.forEach(o?function(b){var T=b.id();if(b.isNode()){var O=b.indegree(!0),K=b.outdegree(!0),Z=O-K,S=K-O;1==Z?l?s=!0:l=T:1==S?u?s=!0:u=T:(S>1||Z>1)&&(s=!0),d[T]=[],b.outgoers().forEach(function(P){P.isEdge()&&d[T].push(P.id())})}else h[T]=[void 0,b.target().id()]}:function(b){var T=b.id();b.isNode()?(b.degree(!0)%2&&(l?u?s=!0:u=T:l=T),d[T]=[],b.connectedEdges().forEach(function(K){return d[T].push(K.id())})):h[T]=[b.source().id(),b.target().id()]});var f={found:!1,trail:void 0};if(s)return f;if(u&&l)if(o){if(c&&u!=c)return f;c=u}else{if(c&&u!=c&&l!=c)return f;c||(c=u)}else c||(c=a[0].id());var g=function(T){for(var Z,S,P,O=T,K=[T];d[O].length;)Z=d[O].shift(),S=h[Z][0],O!=(P=h[Z][1])?(d[P]=d[P].filter(function(M){return M!=Z}),O=P):!o&&O!=S&&(d[S]=d[S].filter(function(M){return M!=Z}),O=S),K.unshift(Z),K.unshift(O);return K},y=[],v=[];for(v=g(c);1!=v.length;)0==d[v[0]].length?(y.unshift(a.getElementById(v.shift())),y.unshift(a.getElementById(v.shift()))):v=g(v.shift()).concat(v);for(var m in y.unshift(a.getElementById(v.shift())),d)if(d[m].length)return f;return f.found=!0,f.trail=this.spawn(y,!0),f}},Tg=function(){var e=this,t={},n=0,i=0,o=[],a=[],s={},u=function(h,f,g){h===g&&(i+=1),t[f]={id:n,low:n++,cutVertex:!1};var v,m,b,T,y=e.getElementById(f).connectedEdges().intersection(e);0===y.size()?o.push(e.spawn(e.getElementById(f))):y.forEach(function(O){v=O.source().id(),m=O.target().id(),(b=v===f?m:v)!==g&&(T=O.id(),s[T]||(s[T]=!0,a.push({x:f,y:b,edge:O})),b in t?t[f].low=Math.min(t[f].low,t[b].id):(u(h,b,f),t[f].low=Math.min(t[f].low,t[b].low),t[f].id<=t[b].low&&(t[f].cutVertex=!0,function(h,f){for(var g=a.length-1,y=[],v=e.spawn();a[g].x!=h||a[g].y!=f;)y.push(a.pop().edge),g--;y.push(a.pop().edge),y.forEach(function(m){var b=m.connectedNodes().intersection(e);v.merge(m),b.forEach(function(T){var O=T.id(),K=T.connectedEdges().intersection(e);v.merge(T),v.merge(t[O].cutVertex?K.filter(function(Z){return Z.isLoop()}):K)})}),o.push(v)}(f,b))))})};e.forEach(function(d){if(d.isNode()){var h=d.id();h in t||(i=0,u(h,h),t[h].cutVertex=i>1)}});var c=Object.keys(t).filter(function(d){return t[d].cutVertex}).map(function(d){return e.getElementById(d)});return{cut:e.spawn(c),components:o}},Ig=function(){var e=this,t={},n=0,i=[],o=[],a=e.spawn(e),s=function(u){if(o.push(u),t[u]={index:n,low:n++,explored:!1},e.getElementById(u).connectedEdges().intersection(e).forEach(function(y){var v=y.target().id();v!==u&&(v in t||s(v),t[v].explored||(t[u].low=Math.min(t[u].low,t[v].low)))}),t[u].index===t[u].low){for(var d=e.spawn();;){var h=o.pop();if(d.merge(e.getElementById(h)),t[h].low=t[u].index,t[h].explored=!0,h===u)break}var f=d.edgesWith(d),g=d.merge(f);i.push(g),a=a.difference(g)}};return e.forEach(function(l){if(l.isNode()){var u=l.id();u in t||s(u)}}),{cut:a,components:i}},dk={};[Eh,jG,$G,WG,KG,QG,eq,Sq,gc,mc,X0,Uq,Zq,n6,c6,h6,{hopcroftTarjanBiconnected:Tg,htbc:Tg,htb:Tg,hopcroftTarjanBiconnectedComponents:Tg},{tarjanStronglyConnected:Ig,tsc:Ig,tscc:Ig,tarjanStronglyConnectedComponents:Ig}].forEach(function(r){gr(dk,r)});var ea=function(e){if(!(this instanceof ea))return new ea(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};ea.prototype={fulfill:function(e){return gk(this,1,"fulfillValue",e)},reject:function(e){return gk(this,2,"rejectReason",e)},then:function(e,t){var n=this,i=new ea;return n.onFulfilled.push(yk(e,i,"fulfill")),n.onRejected.push(yk(t,i,"reject")),mk(n),i.proxy}};var gk=function(e,t,n,i){return 0===e.state&&(e.state=t,e[n]=i,mk(e)),e},mk=function(e){1===e.state?vk(e,"onFulfilled",e.fulfillValue):2===e.state&&vk(e,"onRejected",e.rejectReason)},vk=function(e,t,n){if(0!==e[t].length){var i=e[t];e[t]=[];var o=function(){for(var s=0;s<i.length;s++)i[s](n)};"function"==typeof setImmediate?setImmediate(o):setTimeout(o,0)}},yk=function(e,t,n){return function(i){if("function"!=typeof e)t[n].call(t,i);else{var o;try{o=e(i)}catch(a){return void t.reject(a)}_k(t,o)}}},_k=function(e,t){if(e!==t&&e.proxy!==t){var n;if("object"===ii(t)&&null!==t||"function"==typeof t)try{n=t.then}catch(o){return void e.reject(o)}if("function"!=typeof n)e.fulfill(t);else{var i=!1;try{n.call(t,function(o){i||(i=!0,o===t?e.reject(new TypeError("circular thenable chain")):_k(e,o))},function(o){i||(i=!0,e.reject(o))})}catch(o){i||e.reject(o)}}}else e.reject(new TypeError("cannot resolve promise with itself"))};ea.all=function(r){return new ea(function(e,t){for(var n=new Array(r.length),i=0,o=function(l,u){n[l]=u,++i===r.length&&e(n)},a=0;a<r.length;a++)(function(s){var l=r[s];null!=l&&null!=l.then?l.then(function(d){o(s,d)},function(d){t(d)}):o(s,l)})(a)})},ea.resolve=function(r){return new ea(function(e,t){e(r)})},ea.reject=function(r){return new ea(function(e,t){t(r)})};var _c=typeof Promise<"u"?Promise:ea,Z0=function(e,t,n){var i=m0(e),o=!i,a=this._private=gr({duration:1e3},t,n);if(a.target=e,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&On(a.complete)&&a.completes.push(a.complete),o){var s=e.position();a.startPosition=a.startPosition||{x:s.x,y:s.y},a.startStyle=a.startStyle||e.cy().style().getAnimationStartStyle(e,a.style)}if(i){var l=e.pan();a.startPan={x:l.x,y:l.y},a.startZoom=e.zoom()}this.length=1,this[0]=this},Xl=Z0.prototype;gr(Xl,{instanceString:function(){return"animation"},hook:function(){var e=this._private;if(!e.hooked){var n=e.target._private.animation;(e.queue?n.queue:n.current).push(this),So(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return 1===e.progress&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return void 0===e?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return void 0===e?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(u,c){var d=e[u];null!=d&&(e[u]=e[c],e[c]=d)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),e.style)for(var i=0;i<e.style.length;i++){var o=e.style[i],a=o.name,s=e.startStyle[a];e.startStyle[a]=o,e.style[i]=s}return t&&this.play(),this},promise:function(e){var n,t=this._private;return n="frame"===e?t.frames:t.completes,new _c(function(i,o){n.push(function(){i()})})}}),Xl.complete=Xl.completed,Xl.run=Xl.play,Xl.running=Xl.playing;var eE,wk,tE,bk,rE,Ek,nE,Tk,iE,Ik,oE,xk,aE,Ak,sE,Sk,lE,Ck,cE,Rk,dE,Pk,hE,kk,fE,Dk,pE,Nk,gE,Lk,mE,Ok,vE,Mk,yE,Fk,_E,Bk,wE,Uk,bE,zk,EE,Gk,TE,qk,IE,jk,xE,$k,AE,Hk,SE,Wk,CE,Xk,RE,Kk,PE,Yk,kE,Qk,DE,Jk,NE,Zk,LE,eD,OE,tD,ME,rD,FE,iD,VE,aD,BE,sD,UE,uD,zE,dD,qE,hD,jE,fD,g6={animated:function(){return function(){var t=this,i=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return!1;var a=i[0];return a?a._private.animation.current.length>0:void 0}},clearQueue:function(){return function(){var t=this,i=void 0!==t.length?t:[t];if(!(this._private.cy||this).styleEnabled())return this;for(var a=0;a<i.length;a++)i[a]._private.animation.queue=[];return this}},delay:function(){return function(t,n){return(this._private.cy||this).styleEnabled()?this.animate({delay:t,duration:t,complete:n}):this}},delayAnimation:function(){return function(t,n){return(this._private.cy||this).styleEnabled()?this.animation({delay:t,duration:t,complete:n}):this}},animation:function(){return function(t,n){var i=this,o=void 0!==i.length,a=o?i:[i],s=this._private.cy||this,l=!o,u=!l;if(!s.styleEnabled())return this;var c=s.style();if(t=gr({},t,n),0===Object.keys(t).length)return new Z0(a[0],t);switch(void 0===t.duration&&(t.duration=400),t.duration){case"slow":t.duration=600;break;case"fast":t.duration=200}if(u&&(t.style=c.getPropsList(t.style||t.css),t.css=void 0),u&&null!=t.renderedPosition){var h=t.renderedPosition,f=s.pan(),g=s.zoom();t.position=zP(h,g,f)}if(l&&null!=t.panBy){var y=t.panBy,v=s.pan();t.pan={x:v.x+y.x,y:v.y+y.y}}var m=t.center||t.centre;if(l&&null!=m){var b=s.getCenterPan(m.eles,t.zoom);null!=b&&(t.pan=b)}if(l&&null!=t.fit){var T=t.fit,O=s.getFitViewport(T.eles||T.boundingBox,T.padding);null!=O&&(t.pan=O.pan,t.zoom=O.zoom)}if(l&&qr(t.zoom)){var K=s.getZoomedViewport(t.zoom);null!=K?(K.zoomed&&(t.zoom=K.zoom),K.panned&&(t.pan=K.pan)):t.zoom=null}return new Z0(a[0],t)}},animate:function(){return function(t,n){var i=this,a=void 0!==i.length?i:[i];if(!(this._private.cy||this).styleEnabled())return this;n&&(t=gr({},t,n));for(var l=0;l<a.length;l++){var u=a[l],c=u.animated()&&(void 0===t.queue||t.queue);u.animation(t,c?{queue:!0}:void 0).play()}return this}},stop:function(){return function(t,n){var i=this,a=void 0!==i.length?i:[i],s=this._private.cy||this;if(!s.styleEnabled())return this;for(var l=0;l<a.length;l++){for(var c=a[l]._private,d=c.animation.current,h=0;h<d.length;h++)n&&(d[h]._private.duration=0);t&&(c.animation.queue=[]),n||(c.animation.current=[])}return s.notify("draw"),this}}};function xg(){return wk?eE:(wk=1,eE=Array.isArray)}function b6(){if(Ak)return aE;Ak=1;var r=function v6(){if(Ek)return rE;Ek=1;var r=EP(),e=vh();return rE=function a(s){if(!e(s))return!1;var l=r(s);return"[object Function]"==l||"[object GeneratorFunction]"==l||"[object AsyncFunction]"==l||"[object Proxy]"==l}}(),e=function _6(){if(Ik)return iE;Ik=1;var n,r=function y6(){if(Tk)return nE;Tk=1;var r=lg();return nE=r["__core-js_shared__"]}(),e=(n=/[^.]+$/.exec(r&&r.keys&&r.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";return iE=function t(n){return!!e&&e in n},iE}(),t=vh(),n=function w6(){if(xk)return oE;xk=1;var e=Function.prototype.toString;return oE=function t(n){if(null!=n){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}}(),o=/^\[object .+?Constructor\]$/,c=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");return aE=function d(h){return!(!t(h)||e(h))&&(r(h)?c:o).test(n(h))}}function uE(){if(Ck)return lE;Ck=1;var r=b6(),e=function E6(){return Sk?sE:(Sk=1,sE=function r(e,t){return e?.[t]})}();return lE=function t(n,i){var o=e(n,i);return r(o)?o:void 0}}function Ag(){if(Rk)return cE;Rk=1;var e=uE()(Object,"create");return cE=e}function Vk(){return Fk?yE:(Fk=1,yE=function r(e,t){return e===t||e!=e&&t!=t})}function Sg(){if(Bk)return _E;Bk=1;var r=Vk();return _E=function e(t,n){for(var i=t.length;i--;)if(r(t[i][0],n))return i;return-1}}function M6(){if(Hk)return AE;Hk=1;var r=function C6(){if(Ok)return mE;Ok=1;var r=function T6(){if(Pk)return dE;Pk=1;var r=Ag();return dE=function e(){this.__data__=r?r(null):{},this.size=0}}(),e=function I6(){return kk?hE:(kk=1,hE=function r(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t})}(),t=function x6(){if(Dk)return fE;Dk=1;var r=Ag(),n=Object.prototype.hasOwnProperty;return fE=function i(o){var a=this.__data__;if(r){var s=a[o];return"__lodash_hash_undefined__"===s?void 0:s}return n.call(a,o)?a[o]:void 0}}(),n=function A6(){if(Nk)return pE;Nk=1;var r=Ag(),t=Object.prototype.hasOwnProperty;return pE=function n(i){var o=this.__data__;return r?void 0!==o[i]:t.call(o,i)}}(),i=function S6(){if(Lk)return gE;Lk=1;var r=Ag();return gE=function t(n,i){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=r&&void 0===i?"__lodash_hash_undefined__":i,this}}();function o(a){var s=-1,l=null==a?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=r,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=n,o.prototype.set=i,mE=o}(),e=function L6(){if(jk)return IE;jk=1;var r=function R6(){return Mk?vE:(Mk=1,vE=function r(){this.__data__=[],this.size=0})}(),e=function P6(){if(Uk)return wE;Uk=1;var r=Sg(),t=Array.prototype.splice;return wE=function n(i){var o=this.__data__,a=r(o,i);return!(a<0||(a==o.length-1?o.pop():t.call(o,a,1),--this.size,0))}}(),t=function k6(){if(zk)return bE;zk=1;var r=Sg();return bE=function e(t){var n=this.__data__,i=r(n,t);return i<0?void 0:n[i][1]}}(),n=function D6(){if(Gk)return EE;Gk=1;var r=Sg();return EE=function e(t){return r(this.__data__,t)>-1}}(),i=function N6(){if(qk)return TE;qk=1;var r=Sg();return TE=function e(t,n){var i=this.__data__,o=r(i,t);return o<0?(++this.size,i.push([t,n])):i[o][1]=n,this}}();function o(a){var s=-1,l=null==a?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=r,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=n,o.prototype.set=i,IE=o}(),t=function O6(){if($k)return xE;$k=1;var t=uE()(lg(),"Map");return xE=t}();return AE=function n(){this.size=0,this.__data__={hash:new r,map:new(t||e),string:new r}}}function Cg(){if(Xk)return CE;Xk=1;var r=function F6(){return Wk?SE:(Wk=1,SE=function r(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e})}();return CE=function e(t,n){var i=t.__data__;return r(n)?i["string"==typeof n?"string":"hash"]:i.map}}function j6(){if(tD)return OE;tD=1;var r=function q6(){if(eD)return LE;eD=1;var r=function G6(){if(Zk)return NE;Zk=1;var r=M6(),e=function V6(){if(Kk)return RE;Kk=1;var r=Cg();return RE=function e(t){var n=r(this,t).delete(t);return this.size-=n?1:0,n}}(),t=function B6(){if(Yk)return PE;Yk=1;var r=Cg();return PE=function e(t){return r(this,t).get(t)}}(),n=function U6(){if(Qk)return kE;Qk=1;var r=Cg();return kE=function e(t){return r(this,t).has(t)}}(),i=function z6(){if(Jk)return DE;Jk=1;var r=Cg();return DE=function e(t,n){var i=r(this,t),o=i.size;return i.set(t,n),this.size+=i.size==o?0:1,this}}();function o(a){var s=-1,l=null==a?0:a.length;for(this.clear();++s<l;){var u=a[s];this.set(u[0],u[1])}}return o.prototype.clear=r,o.prototype.delete=e,o.prototype.get=t,o.prototype.has=n,o.prototype.set=i,NE=o}();function t(n,i){if("function"!=typeof n||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");var o=function(){var a=arguments,s=i?i.apply(this,a):a[0],l=o.cache;if(l.has(s))return l.get(s);var u=n.apply(this,a);return o.cache=l.set(s,u)||l,u};return o.cache=new(t.Cache||r),o}return t.Cache=r,LE=t}();return OE=function t(n){var i=r(n,function(a){return 500===o.size&&o.clear(),a}),o=i.cache;return i}}function nD(){if(rD)return ME;rD=1;var r=j6(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,t=/\\(\\)?/g,n=r(function(i){var o=[];return 46===i.charCodeAt(0)&&o.push(""),i.replace(e,function(a,s,l,u){o.push(l?u.replace(t,"$1"):s||a)}),o});return ME=n}function oD(){return iD?FE:(iD=1,FE=function r(e,t){for(var n=-1,i=null==e?0:e.length,o=Array(i);++n<i;)o[n]=t(e[n],n,e);return o})}function lD(){if(sD)return BE;sD=1;var r=function $6(){if(aD)return VE;aD=1;var r=x0(),e=oD(),t=xg(),n=yh(),i=r?r.prototype:void 0,o=i?i.toString:void 0;return VE=function a(s){if("string"==typeof s)return s;if(t(s))return e(s,a)+"";if(n(s))return o?o.call(s):"";var l=s+"";return"0"==l&&1/s==-1/0?"-0":l}}();return BE=function e(t){return null==t?"":r(t)}}function cD(){if(uD)return UE;uD=1;var r=xg(),e=function m6(){if(bk)return tE;bk=1;var r=xg(),e=yh(),t=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;return tE=function i(o,a){if(r(o))return!1;var s=typeof o;return!("number"!=s&&"symbol"!=s&&"boolean"!=s&&null!=o&&!e(o))||n.test(o)||!t.test(o)||null!=a&&o in Object(a)}}(),t=nD(),n=lD();return UE=function i(o,a){return r(o)?o:e(o,a)?[o]:t(n(o))}}function GE(){if(dD)return zE;dD=1;var r=yh();return zE=function e(t){if("string"==typeof t||r(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}}var $E,pD,HE,gD,WE,mD,XE,vD,KE,yD,YE,_D,X6=function W6(){if(fD)return jE;fD=1;var r=function H6(){if(hD)return qE;hD=1;var r=cD(),e=GE();return qE=function t(n,i){for(var o=0,a=(i=r(i,n)).length;null!=n&&o<a;)n=n[e(i[o++])];return o&&o==a?n:void 0}}();return jE=function e(t,n,i){var o=null==t?void 0:r(t,n);return void 0===o?i:o}}(),K6=mh(X6);function ej(){if(yD)return KE;yD=1;var r=function J6(){if(mD)return WE;mD=1;var r=function Q6(){if(gD)return HE;gD=1;var r=function Y6(){if(pD)return $E;pD=1;var r=uE(),e=function(){try{var t=r(Object,"defineProperty");return t({},"",{}),t}catch{}}();return $E=e}();return HE=function e(t,n,i){"__proto__"==n&&r?r(t,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[n]=i}}(),e=Vk(),n=Object.prototype.hasOwnProperty;return WE=function i(o,a,s){var l=o[a];(!n.call(o,a)||!e(l,s)||void 0===s&&!(a in o))&&r(o,a,s)}}(),e=cD(),t=function Z6(){if(vD)return XE;vD=1;var e=/^(?:0|[1-9]\d*)$/;return XE=function t(n,i){var o=typeof n;return!!(i=i??9007199254740991)&&("number"==o||"symbol"!=o&&e.test(n))&&n>-1&&n%1==0&&n<i}}(),n=vh(),i=GE();return KE=function o(a,s,l,u){if(!n(a))return a;for(var c=-1,d=(s=e(s,a)).length,h=d-1,f=a;null!=f&&++c<d;){var g=i(s[c]),y=l;if("__proto__"===g||"constructor"===g||"prototype"===g)return a;if(c!=h){var v=f[g];void 0===(y=u?u(v,g,f):void 0)&&(y=n(v)?v:t(s[c+1])?[]:{})}r(f,g,y),f=f[g]}return a}}var QE,wD,JE,bD,nj=mh(function tj(){if(_D)return YE;_D=1;var r=ej();return YE=function e(t,n,i){return null==t?t:r(t,n,i)}}()),aj=function oj(){if(bD)return JE;bD=1;var r=oD(),e=function ij(){return wD?QE:(wD=1,QE=function r(e,t){var n=-1,i=e.length;for(t||(t=Array(i));++n<i;)t[n]=e[n];return t})}(),t=xg(),n=yh(),i=nD(),o=GE(),a=lD();return JE=function s(l){return t(l)?r(l,o):n(l)?[l]:e(i(a(l)))}}(),sj=mh(aj),lj={data:function(e){return e=gr({},{field:"data",bindingEvent:"data",allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:"data",settingTriggersEvent:!1,triggerFnName:"trigger",immutableKeys:{},updateStyle:!1,beforeGet:function(i){},beforeSet:function(i,o){},onSet:function(i){},canSet:function(i){return!0}},e),function(i,o){var a=e,s=this,l=void 0!==s.length,u=l?s:[s],c=l?s[0]:s;if(sr(i)){var f,h=-1!==i.indexOf(".")&&sj(i);if(a.allowGetting&&void 0===o)return c&&(a.beforeGet(c),f=h&&void 0===c._private[a.field][i]?K6(c._private[a.field],h):c._private[a.field][i]),f;if(a.allowSetting&&void 0!==o&&!a.immutableKeys[i]){var y=eP({},i,o);a.beforeSet(s,y);for(var v=0,m=u.length;v<m;v++){var b=u[v];a.canSet(b)&&(h&&void 0===c._private[a.field][i]?nj(b._private[a.field],h,o):b._private[a.field][i]=o)}a.updateStyle&&s.updateStyle(),a.onSet(s),a.settingTriggersEvent&&s[a.triggerFnName](a.settingEvent)}}else if(a.allowSetting&&qr(i)){var O,K,T=i,Z=Object.keys(T);a.beforeSet(s,T);for(var S=0;S<Z.length;S++)if(K=T[O=Z[S]],!a.immutableKeys[O])for(var M=0;M<u.length;M++){var q=u[M];a.canSet(q)&&(q._private[a.field][O]=K)}a.updateStyle&&s.updateStyle(),a.onSet(s),a.settingTriggersEvent&&s[a.triggerFnName](a.settingEvent)}else if(a.allowBinding&&On(i))s.on(a.bindingEvent,i);else if(a.allowGetting&&void 0===i){var X;return c&&(a.beforeGet(c),X=c._private[a.field]),X}return s}},removeData:function(e){return e=gr({},{field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!1,immutableKeys:{}},e),function(i){var o=e,a=this,l=void 0!==a.length?a:[a];if(sr(i)){for(var u=i.split(/\s+/),c=u.length,d=0;d<c;d++){var h=u[d];if(!Ms(h)&&!o.immutableKeys[h])for(var g=0,y=l.length;g<y;g++)l[g]._private[o.field][h]=void 0}o.triggerEvent&&a[o.triggerFnName](o.event)}else if(void 0===i){for(var v=0,m=l.length;v<m;v++)for(var b=l[v]._private[o.field],T=Object.keys(b),O=0;O<T.length;O++){var K=T[O];!o.immutableKeys[K]&&(b[K]=void 0)}o.triggerEvent&&a[o.triggerFnName](o.event)}return a}}},uj={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(n,i){var o=this,a=Array.prototype.slice.call(arguments,0);return new _c(function(s,l){var c=a.concat([function(f){o.off.apply(o,d),s(f)}]),d=c.concat([]);o.on.apply(o,c)})}}},Jr={};[g6,lj,uj].forEach(function(r){gr(Jr,r)});var cj={animate:Jr.animate(),animation:Jr.animation(),animated:Jr.animated(),clearQueue:Jr.clearQueue(),delay:Jr.delay(),delayAnimation:Jr.delayAnimation(),stop:Jr.stop()},Rg={classes:function(e){var t=this;if(void 0===e){var n=[];return t[0]._private.classes.forEach(function(g){return n.push(g)}),n}un(e)||(e=(e||"").match(/\S+/g)||[]);for(var i=[],o=new hc(e),a=0;a<t.length;a++){for(var s=t[a],l=s._private,u=l.classes,c=!1,d=0;d<e.length;d++)if(!u.has(e[d])){c=!0;break}c||(c=u.size!==e.length),c&&(l.classes=o,i.push(s))}return i.length>0&&this.spawn(i).updateStyle().emit("class"),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return null!=t&&t._private.classes.has(e)},toggleClass:function(e,t){un(e)||(e=e.match(/\S+/g)||[]);for(var n=this,i=void 0===t,o=[],a=0,s=n.length;a<s;a++)for(var l=n[a],u=l._private.classes,c=!1,d=0;d<e.length;d++){var h=e[d],f=u.has(h),g=!1;t||i&&!f?(u.add(h),g=!0):(!t||i&&f)&&(u.delete(h),g=!0),!c&&g&&(o.push(l),c=!0)}return o.length>0&&this.spawn(o).updateStyle().emit("class"),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(null==t)t=250;else if(0===t)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};Rg.className=Rg.classNames=Rg.classes;var jr={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:"\"(?:\\\\\"|[^\"])*\"|'(?:\\\\'|[^'])*'",number:ai,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};jr.variable="(?:[\\w-.]|(?:\\\\"+jr.metaChar+"))+",jr.className="(?:[\\w-]|(?:\\\\"+jr.metaChar+"))+",jr.value=jr.string+"|"+jr.number,jr.id=jr.variable,function(){var r,e,t;for(r=jr.comparatorOp.split("|"),t=0;t<r.length;t++)jr.comparatorOp+="|@"+(e=r[t]);for(r=jr.comparatorOp.split("|"),t=0;t<r.length;t++)!((e=r[t]).indexOf("!")>=0)&&"="!==e&&(jr.comparatorOp+="|\\!"+e)}();var ZE=[{selector:":selected",matches:function(e){return e.selected()}},{selector:":unselected",matches:function(e){return!e.selected()}},{selector:":selectable",matches:function(e){return e.selectable()}},{selector:":unselectable",matches:function(e){return!e.selectable()}},{selector:":locked",matches:function(e){return e.locked()}},{selector:":unlocked",matches:function(e){return!e.locked()}},{selector:":visible",matches:function(e){return e.visible()}},{selector:":hidden",matches:function(e){return!e.visible()}},{selector:":transparent",matches:function(e){return e.transparent()}},{selector:":grabbed",matches:function(e){return e.grabbed()}},{selector:":free",matches:function(e){return!e.grabbed()}},{selector:":removed",matches:function(e){return e.removed()}},{selector:":inside",matches:function(e){return!e.removed()}},{selector:":grabbable",matches:function(e){return e.grabbable()}},{selector:":ungrabbable",matches:function(e){return!e.grabbable()}},{selector:":animated",matches:function(e){return e.animated()}},{selector:":unanimated",matches:function(e){return!e.animated()}},{selector:":parent",matches:function(e){return e.isParent()}},{selector:":childless",matches:function(e){return e.isChildless()}},{selector:":child",matches:function(e){return e.isChild()}},{selector:":orphan",matches:function(e){return e.isOrphan()}},{selector:":nonorphan",matches:function(e){return e.isChild()}},{selector:":compound",matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:":loop",matches:function(e){return e.isLoop()}},{selector:":simple",matches:function(e){return e.isSimple()}},{selector:":active",matches:function(e){return e.active()}},{selector:":inactive",matches:function(e){return!e.active()}},{selector:":backgrounding",matches:function(e){return e.backgrounding()}},{selector:":nonbackgrounding",matches:function(e){return!e.backgrounding()}}].sort(function(r,e){return function(e,t){return-1*lP(e,t)}(r.selector,e.selector)}),dj=function(){for(var e,r={},t=0;t<ZE.length;t++)r[(e=ZE[t]).selector]=e.matches;return r}(),fj="("+ZE.map(function(r){return r.selector}).join("|")+")",wc=function(e){return e.replace(new RegExp("\\\\("+jr.metaChar+")","g"),function(t,n){return n})},qs=function(e,t,n){e[e.length-1]=n},eT=[{name:"group",query:!0,regex:"("+jr.group+")",populate:function(e,t,n){var o=Zn(n,1)[0];t.checks.push({type:0,value:"*"===o?o:o+"s"})}},{name:"state",query:!0,regex:fj,populate:function(e,t,n){var i=Zn(n,1);t.checks.push({type:7,value:i[0]})}},{name:"id",query:!0,regex:"\\#("+jr.id+")",populate:function(e,t,n){var i=Zn(n,1);t.checks.push({type:8,value:wc(i[0])})}},{name:"className",query:!0,regex:"\\.("+jr.className+")",populate:function(e,t,n){var i=Zn(n,1);t.checks.push({type:9,value:wc(i[0])})}},{name:"dataExists",query:!0,regex:"\\[\\s*("+jr.variable+")\\s*\\]",populate:function(e,t,n){var i=Zn(n,1);t.checks.push({type:4,field:wc(i[0])})}},{name:"dataCompare",query:!0,regex:"\\[\\s*("+jr.variable+")\\s*("+jr.comparatorOp+")\\s*("+jr.value+")\\s*\\]",populate:function(e,t,n){var i=Zn(n,3),o=i[0],a=i[1],s=i[2];s=null!=new RegExp("^"+jr.string+"$").exec(s)?s.substring(1,s.length-1):parseFloat(s),t.checks.push({type:3,field:wc(o),operator:a,value:s})}},{name:"dataBool",query:!0,regex:"\\[\\s*("+jr.boolOp+")\\s*("+jr.variable+")\\s*\\]",populate:function(e,t,n){var i=Zn(n,2),o=i[0];t.checks.push({type:5,field:wc(i[1]),operator:o})}},{name:"metaCompare",query:!0,regex:"\\[\\[\\s*("+jr.meta+")\\s*("+jr.comparatorOp+")\\s*("+jr.number+")\\s*\\]\\]",populate:function(e,t,n){var i=Zn(n,3),a=i[1],s=i[2];t.checks.push({type:6,field:wc(i[0]),operator:a,value:parseFloat(s)})}},{name:"nextQuery",separator:!0,regex:jr.separator,populate:function(e,t){var n=e.currentSubject,i=e.edgeCount,o=e.compoundCount,a=e[e.length-1];return null!=n&&(a.subject=n,e.currentSubject=null),a.edgeCount=i,a.compoundCount=o,e.edgeCount=0,e.compoundCount=0,e[e.length++]={checks:[]}}},{name:"directedEdge",separator:!0,regex:jr.directedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},o={checks:[]};return n.checks.push({type:11,source:t,target:o}),qs(e,0,n),e.edgeCount++,o}var a={checks:[]},l={checks:[]};return a.checks.push({type:12,source:t,target:l}),qs(e,0,a),e.edgeCount++,l}},{name:"undirectedEdge",separator:!0,regex:jr.undirectedEdge,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},o={checks:[]};return n.checks.push({type:10,nodes:[t,o]}),qs(e,0,n),e.edgeCount++,o}var a={checks:[]},l={checks:[]};return a.checks.push({type:14,node:t,neighbor:l}),qs(e,0,a),l}},{name:"child",separator:!0,regex:jr.child,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},i={checks:[]};return n.checks.push({type:15,parent:e[e.length-1],child:i}),qs(e,0,n),e.compoundCount++,i}if(e.currentSubject===t){var a={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]},d={checks:[]};return a.checks.push({type:19,left:e[e.length-1],right:l,subject:u}),u.checks=t.checks,t.checks=[{type:20}],d.checks.push({type:20}),l.checks.push({type:17,parent:d,child:c}),qs(e,0,a),e.currentSubject=u,e.compoundCount++,c}var h={checks:[]},f={checks:[]},g=[{type:17,parent:h,child:f}];return h.checks=t.checks,t.checks=g,e.compoundCount++,f}},{name:"descendant",separator:!0,regex:jr.descendant,populate:function(e,t){if(null==e.currentSubject){var n={checks:[]},i={checks:[]};return n.checks.push({type:16,ancestor:e[e.length-1],descendant:i}),qs(e,0,n),e.compoundCount++,i}if(e.currentSubject===t){var a={checks:[]},l={checks:[]},u={checks:[]},c={checks:[]},d={checks:[]};return a.checks.push({type:19,left:e[e.length-1],right:l,subject:u}),u.checks=t.checks,t.checks=[{type:20}],d.checks.push({type:20}),l.checks.push({type:18,ancestor:d,descendant:c}),qs(e,0,a),e.currentSubject=u,e.compoundCount++,c}var h={checks:[]},f={checks:[]},g=[{type:18,ancestor:h,descendant:f}];return h.checks=t.checks,t.checks=g,e.compoundCount++,f}},{name:"subject",modifier:!0,regex:jr.subject,populate:function(e,t){if(null!=e.currentSubject&&e.currentSubject!==t)return Qr("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var i=e[e.length-1].checks[0],o=null==i?null:i.type;11===o?i.type=13:10===o&&(i.type=14,i.node=i.nodes[1],i.neighbor=i.nodes[0],i.nodes=null)}}];eT.forEach(function(r){return r.regexObj=new RegExp("^"+r.regex)});var pj=function(e){for(var t,n,i,o=0;o<eT.length;o++){var a=eT[o],s=a.name,l=e.match(a.regexObj);if(null!=l){n=l,t=a,i=s,e=e.substring(l[0].length);break}}return{expr:t,match:n,name:i,remaining:e}},yj={parse:function(e){var t=this,n=t.inputText=e,i=t[0]={checks:[]};for(t.length=1,n=function(e){var t=e.match(/^\s+/);return t&&(e=e.substring(t[0].length)),e}(n);;){var o=pj(n);if(null==o.expr)return Qr("The selector `"+e+"`is invalid"),!1;var a=o.match.slice(1),s=o.expr.populate(t,i,a);if(!1===s)return!1;if(null!=s&&(i=s),(n=o.remaining).match(/^\s*$/))break}var l=t[t.length-1];null!=t.currentSubject&&(l.subject=t.currentSubject),l.edgeCount=t.edgeCount,l.compoundCount=t.compoundCount;for(var u=0;u<t.length;u++){var c=t[u];if(c.compoundCount>0&&c.edgeCount>0)return Qr("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(c.edgeCount>1)return Qr("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;1===c.edgeCount&&Qr("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(null!=this.toStringCache)return this.toStringCache;for(var e=function(c){return c??""},t=function(c){return sr(c)?'"'+c+'"':e(c)},n=function(c){return" "+c+" "},o=function(c,d){return c.checks.reduce(function(h,f,g){return h+(d===c&&0===g?"$":"")+function(c,d){var f=c.value;switch(c.type){case 0:var g=e(f);return g.substring(0,g.length-1);case 3:return"["+c.field+n(e(c.operator))+t(f)+"]";case 5:var b=c.field;return"["+e(c.operator)+b+"]";case 4:return"["+c.field+"]";case 6:return"[["+c.field+n(e(c.operator))+t(f)+"]]";case 7:return f;case 8:return"#"+f;case 9:return"."+f;case 17:case 15:return o(c.parent,d)+n(">")+o(c.child,d);case 18:case 16:return o(c.ancestor,d)+" "+o(c.descendant,d);case 19:var Z=o(c.left,d),S=o(c.subject,d),P=o(c.right,d);return Z+(Z.length>0?" ":"")+S+P;case 20:return""}}(f,d)},"")},a="",s=0;s<this.length;s++){var l=this[s];a+=o(l,l.subject),this.length>1&&s<this.length-1&&(a+=", ")}return this.toStringCache=a,a}},ED=function(e,t,n){var i,l,u,o=sr(e),a=Ut(e),s=sr(n),c=!1,d=!1,h=!1;switch(t.indexOf("!")>=0&&(t=t.replace("!",""),d=!0),t.indexOf("@")>=0&&(t=t.replace("@",""),c=!0),(o||s||c)&&(l=o||a?""+e:"",u=""+n),c&&(e=l=l.toLowerCase(),n=u=u.toLowerCase()),t){case"*=":i=l.indexOf(u)>=0;break;case"$=":i=l.indexOf(u,l.length-u.length)>=0;break;case"^=":i=0===l.indexOf(u);break;case"=":i=e===n;break;case">":h=!0,i=e>n;break;case">=":h=!0,i=e>=n;break;case"<":h=!0,i=e<n;break;case"<=":h=!0,i=e<=n;break;default:i=!1}return d&&(null!=e||!h)&&(i=!i),i},tT=function(e,t){return e.data(t)},Bn=[],An=function(e,t){return e.checks.every(function(n){return Bn[n.type](n,t)})};Bn[0]=function(r,e){var t=r.value;return"*"===t||t===e.group()},Bn[7]=function(r,e){return function(e,t){return dj[e](t)}(r.value,e)},Bn[8]=function(r,e){var t=r.value;return e.id()===t},Bn[9]=function(r,e){return e.hasClass(r.value)},Bn[6]=function(r,e){var n=r.operator,i=r.value;return ED(function(e,t){return e[t]()}(e,r.field),n,i)},Bn[3]=function(r,e){var n=r.operator,i=r.value;return ED(tT(e,r.field),n,i)},Bn[5]=function(r,e){var n=r.operator;return function(e,t){switch(t){case"?":return!!e;case"!":return!e;case"^":return void 0===e}}(tT(e,r.field),n)},Bn[4]=function(r,e){return function(e){return void 0!==e}(tT(e,r.field))},Bn[10]=function(r,e){var t=r.nodes[0],n=r.nodes[1],i=e.source(),o=e.target();return An(t,i)&&An(n,o)||An(n,i)&&An(t,o)},Bn[14]=function(r,e){return An(r.node,e)&&e.neighborhood().some(function(t){return t.isNode()&&An(r.neighbor,t)})},Bn[11]=function(r,e){return An(r.source,e.source())&&An(r.target,e.target())},Bn[12]=function(r,e){return An(r.source,e)&&e.outgoers().some(function(t){return t.isNode()&&An(r.target,t)})},Bn[13]=function(r,e){return An(r.target,e)&&e.incomers().some(function(t){return t.isNode()&&An(r.source,t)})},Bn[15]=function(r,e){return An(r.child,e)&&An(r.parent,e.parent())},Bn[17]=function(r,e){return An(r.parent,e)&&e.children().some(function(t){return An(r.child,t)})},Bn[16]=function(r,e){return An(r.descendant,e)&&e.ancestors().some(function(t){return An(r.ancestor,t)})},Bn[18]=function(r,e){return An(r.ancestor,e)&&e.descendants().some(function(t){return An(r.descendant,t)})},Bn[19]=function(r,e){return An(r.subject,e)&&An(r.left,e)&&An(r.right,e)},Bn[20]=function(){return!0},Bn[1]=function(r,e){return r.value.has(e)},Bn[2]=function(r,e){return(0,r.value)(e)};var Ij={matches:function(e){for(var n=0;n<this.length;n++)if(An(this[n],e))return!0;return!1},filter:function(e){var t=this;if(1===t.length&&1===t[0].checks.length&&8===t[0].checks[0].type)return e.getElementById(t[0].checks[0].value).collection();var n=function(o){for(var a=0;a<t.length;a++)if(An(t[a],o))return!0;return!1};return null==t.text()&&(n=function(){return!0}),e.filter(n)}},js=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,null==e||sr(e)&&e.match(/^\s*$/)||(So(e)?this.addQuery({checks:[{type:1,value:e.collection()}]}):On(e)?this.addQuery({checks:[{type:2,value:e}]}):sr(e)?this.parse(e)||(this.invalid=!0):kn("A selector must be created from a string; found "))},$s=js.prototype;[yj,Ij].forEach(function(r){return gr($s,r)}),$s.text=function(){return this.inputText},$s.size=function(){return this.length},$s.eq=function(r){return this[r]},$s.sameText=function(r){return!this.invalid&&!r.invalid&&this.text()===r.text()},$s.addQuery=function(r){this[this.length++]=r},$s.selector=$s.toString;var Hs={allAre:function(e){var t=new js(e);return this.every(function(n){return t.matches(n)})},is:function(e){var t=new js(e);return this.some(function(n){return t.matches(n)})},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length&&(1===t?this[0]===e[0]:this.every(function(i){return e.hasElementWithId(i.id())}))},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(n){return t.hasElementWithId(n.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(n){return t.hasElementWithId(n.id())})}};Hs.allAreNeighbours=Hs.allAreNeighbors,Hs.has=Hs.contains,Hs.equal=Hs.equals=Hs.same;var Ch,xD,Vo=function(e,t){return function(i,o,a,s){var c,l=i,u=this;if(null==l?c="":So(l)&&1===l.length&&(c=l.id()),1===u.length&&c){var d=u[0]._private,h=d.traversalCache=d.traversalCache||{},f=h[t]=h[t]||[],g=jl(c);return f[g]||(f[g]=e.call(u,i,o,a,s))}return e.call(u,i,o,a,s)}},bc={parent:function(e){var t=[];if(1===this.length){var n=this[0]._private.parent;if(n)return n}for(var i=0;i<this.length;i++){var a=this[i]._private.parent;a&&t.push(a)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var i=0;i<n.length;i++)t.push(n[i]);n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var o=this[n].parents();t=(t=t||o).intersect(o)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(t){return t.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(t){return t.isChild()}).filter(e)},children:Vo(function(r){for(var e=[],t=0;t<this.length;t++)for(var i=this[t]._private.children,o=0;o<i.length;o++)e.push(i[o]);return this.spawn(e,!0).filter(r)},"children"),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&0!==e._private.children.length},isChildless:function(){var e=this[0];if(e)return e.isNode()&&0===e._private.children.length},isChild:function(){var e=this[0];if(e)return e.isNode()&&null!=e._private.parent},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&null==e._private.parent},descendants:function(e){var t=[];return function n(i){for(var o=0;o<i.length;o++){var a=i[o];t.push(a),a.children().nonempty()&&n(a.children())}}(this.children()),this.spawn(t,!0).filter(e)}};function rT(r,e,t,n){for(var i=[],o=new hc,s=r.cy().hasCompoundNodes(),l=0;l<r.length;l++){var u=r[l];t?i.push(u):s&&n(i,o,u)}for(;i.length>0;){var c=i.shift();e(c),o.add(c.id()),s&&n(i,o,c)}return r}function TD(r,e,t){if(t.isParent())for(var n=t._private.children,i=0;i<n.length;i++){var o=n[i];e.has(o.id())||r.push(o)}}function ID(r,e,t){if(t.isChild()){var n=t._private.parent;e.has(n.id())||r.push(n)}}function xj(r,e,t){ID(r,e,t),TD(r,e,t)}bc.forEachDown=function(r){return rT(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],TD)},bc.forEachUp=function(r){return rT(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],ID)},bc.forEachUpAndDown=function(r){return rT(this,r,!(arguments.length>1&&void 0!==arguments[1])||arguments[1],xj)},bc.ancestors=bc.parents,Ch=xD={data:Jr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:Jr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:Jr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Jr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),rscratch:Jr.data({field:"rscratch",allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:Jr.removeData({field:"rscratch",triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},Ch.attr=Ch.data,Ch.removeAttr=Ch.removeData;var Aj=xD,Pg={};function nT(r){return function(e){var t=this;if(void 0===e&&(e=!0),0===t.length);else if(t.isNode()&&!t.removed()){for(var n=0,i=t[0],o=i._private.edges,a=0;a<o.length;a++){var s=o[a];!e&&s.isLoop()||(n+=r(i,s))}return n}}}function Ec(r,e){return function(t){for(var n,i=this.nodes(),o=0;o<i.length;o++){var s=i[o][r](t);void 0!==s&&(void 0===n||e(s,n))&&(n=s)}return n}}gr(Pg,{degree:nT(function(r,e){return e.source().same(e.target())?2:1}),indegree:nT(function(r,e){return e.target().same(r)?1:0}),outdegree:nT(function(r,e){return e.source().same(r)?1:0})}),gr(Pg,{minDegree:Ec("degree",function(r,e){return r<e}),maxDegree:Ec("degree",function(r,e){return r>e}),minIndegree:Ec("indegree",function(r,e){return r<e}),maxIndegree:Ec("indegree",function(r,e){return r>e}),minOutdegree:Ec("outdegree",function(r,e){return r<e}),maxOutdegree:Ec("outdegree",function(r,e){return r>e})}),gr(Pg,{totalDegree:function(e){for(var t=0,n=this.nodes(),i=0;i<n.length;i++)t+=n[i].degree(e);return t}});var ta,AD,SD=function(e,t,n){for(var i=0;i<e.length;i++){var o=e[i];if(!o.locked()){var a=o._private.position,s={x:null!=t.x?t.x-a.x:0,y:null!=t.y?t.y-a.y:0};o.isParent()&&!(0===s.x&&0===s.y)&&o.children().shift(s,n),o.dirtyBoundingBoxCache()}}},CD={field:"position",bindingEvent:"position",allowBinding:!0,allowSetting:!0,settingEvent:"position",settingTriggersEvent:!0,triggerFnName:"emitAndNotify",allowGetting:!0,validKeys:["x","y"],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){SD(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};ta=AD={position:Jr.data(CD),silentPosition:Jr.data(gr({},CD,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){SD(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(qr(e))t?this.silentPosition(e):this.position(e);else if(On(e)){var n=e,i=this.cy();i.startBatch();for(var o=0;o<this.length;o++){var s,a=this[o];(s=n(a,o))&&(t?a.silentPosition(s):a.position(s))}i.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var i;if(qr(e)?(i={x:Ut(e.x)?e.x:0,y:Ut(e.y)?e.y:0},n=t):sr(e)&&Ut(t)&&((i={x:0,y:0})[e]=t),null!=i){var o=this.cy();o.startBatch();for(var a=0;a<this.length;a++){var s=this[a];if(!(o.hasCompoundNodes()&&s.isChild()&&s.ancestors().anySame(this))){var l=s.position(),u={x:l.x+i.x,y:l.y+i.y};n?s.silentPosition(u):s.position(u)}}o.endBatch()}return this},silentShift:function(e,t){return qr(e)?this.shift(e,!0):sr(e)&&Ut(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],i=this.cy(),o=i.zoom(),a=i.pan(),s=qr(e)?e:void 0,l=void 0!==s||void 0!==t&&sr(e);if(n&&n.isNode()){if(!l){var d=n.position();return s=pg(d,o,a),void 0===e?s:s[e]}for(var u=0;u<this.length;u++){var c=this[u];void 0!==t?c.position(e,(t-a[e])/o):void 0!==s&&c.position(zP(s,o,a))}}else if(!l)return;return this},relativePosition:function(e,t){var n=this[0],i=this.cy(),o=qr(e)?e:void 0,a=void 0!==o||void 0!==t&&sr(e),s=i.hasCompoundNodes();if(n&&n.isNode()){if(!a){var g=n.position(),y=s?n.parent():null,v=y&&y.length>0;v&&(y=y[0]);var b=v?y.position():{x:0,y:0};return o={x:g.x-b.x,y:g.y-b.y},void 0===e?o:o[e]}for(var l=0;l<this.length;l++){var u=this[l],c=s?u.parent():null,d=c&&c.length>0;d&&(c=c[0]);var f=d?c.position():{x:0,y:0};void 0!==t?u.position(e,t+f[e]):void 0!==o&&u.position({x:o.x+f.x,y:o.y+f.y})}}else if(!a)return;return this}},ta.modelPosition=ta.point=ta.position,ta.modelPositions=ta.points=ta.positions,ta.renderedPoint=ta.renderedPosition,ta.relativePoint=ta.relativePosition;var Tc,Ws,Sj=AD;Tc=Ws={},Ws.renderedBoundingBox=function(r){var e=this.boundingBox(r),t=this.cy(),n=t.zoom(),i=t.pan(),o=e.x1*n+i.x,a=e.x2*n+i.x,s=e.y1*n+i.y,l=e.y2*n+i.y;return{x1:o,x2:a,y1:s,y2:l,w:a-o,h:l-s}},Ws.dirtyCompoundBoundsCache=function(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();return e.styleEnabled()&&e.hasCompoundNodes()?(this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,r||t.emitAndNotify("bounds")}}),this):this},Ws.updateCompoundBounds=function(){var r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.cy();if(!e.styleEnabled()||!e.hasCompoundNodes())return this;if(!r&&e.batching())return this;function t(a){if(a.isParent()){var s=a._private,l=a.children(),u="include"===a.pstyle("compound-sizing-wrt-labels").value,c={width:{val:a.pstyle("min-width").pfValue,left:a.pstyle("min-width-bias-left"),right:a.pstyle("min-width-bias-right")},height:{val:a.pstyle("min-height").pfValue,top:a.pstyle("min-height-bias-top"),bottom:a.pstyle("min-height-bias-bottom")}},d=l.boundingBox({includeLabels:u,includeOverlays:!1,useCache:!1}),h=s.position;(0===d.w||0===d.h)&&((d={w:a.pstyle("width").pfValue,h:a.pstyle("height").pfValue}).x1=h.x-d.w/2,d.x2=h.x+d.w/2,d.y1=h.y-d.h/2,d.y2=h.y+d.h/2);var y=c.width.left.value;"px"===c.width.left.units&&c.width.val>0&&(y=100*y/c.width.val);var v=c.width.right.value;"px"===c.width.right.units&&c.width.val>0&&(v=100*v/c.width.val);var m=c.height.top.value;"px"===c.height.top.units&&c.height.val>0&&(m=100*m/c.height.val);var b=c.height.bottom.value;"px"===c.height.bottom.units&&c.height.val>0&&(b=100*b/c.height.val);var T=f(c.width.val-d.w,y,v),O=T.biasDiff,K=T.biasComplementDiff,Z=f(c.height.val-d.h,m,b),S=Z.biasDiff,P=Z.biasComplementDiff;s.autoPadding=function g(M,q,G,X){if("%"!==G.units)return"px"===G.units?G.pfValue:0;switch(X){case"width":return M>0?G.pfValue*M:0;case"height":return q>0?G.pfValue*q:0;case"average":return M>0&&q>0?G.pfValue*(M+q)/2:0;case"min":return M>0&&q>0?M>q?G.pfValue*q:G.pfValue*M:0;case"max":return M>0&&q>0?M>q?G.pfValue*M:G.pfValue*q:0;default:return 0}}(d.w,d.h,a.pstyle("padding"),a.pstyle("padding-relative-to").value),s.autoWidth=Math.max(d.w,c.width.val),h.x=(-O+d.x1+d.x2+K)/2,s.autoHeight=Math.max(d.h,c.height.val),h.y=(-S+d.y1+d.y2+P)/2}function f(M,q,G){var X=0,U=0,me=q+G;return M>0&&me>0&&(X=q/me*M,U=G/me*M),{biasDiff:X,biasComplementDiff:U}}}for(var n=0;n<this.length;n++){var i=this[n],o=i._private;(!o.compoundBoundsClean||r)&&(t(i),e.batching()||(o.compoundBoundsClean=!0))}return this};var Bo=function(e){return e===1/0||e===-1/0?0:e},ra=function(e,t,n,i,o){i-t===0||o-n===0||null==t||null==n||null==i||null==o||(e.x1=t<e.x1?t:e.x1,e.x2=i>e.x2?i:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=o>e.y2?o:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},Xs=function(e,t){return null==t?e:ra(e,t.x1,t.y1,t.x2,t.y2)},Rh=function(e,t,n){return ho(e,t,n)},kg=function(e,t,n){if(!t.cy().headless()){var l,u,i=t._private,o=i.rstyle,a=o.arrowWidth/2;if("none"!==t.pstyle(n+"-arrow-shape").value){"source"===n?(l=o.srcX,u=o.srcY):"target"===n?(l=o.tgtX,u=o.tgtY):(l=o.midX,u=o.midY);var c=i.arrowBounds=i.arrowBounds||{},d=c[n]=c[n]||{};d.x1=l-a,d.y1=u-a,d.x2=l+a,d.y2=u+a,d.w=d.x2-d.x1,d.h=d.y2-d.y1,mg(d,1),ra(e,d.x1,d.y1,d.x2,d.y2)}}},iT=function(e,t,n){if(!t.cy().headless()){var i,o=t._private,a=o.rstyle;if(t.pstyle((i=n?n+"-":"")+"label").strValue){var G,X,U,me,l=t.pstyle("text-halign"),u=t.pstyle("text-valign"),c=Rh(a,"labelWidth",n),d=Rh(a,"labelHeight",n),h=Rh(a,"labelX",n),f=Rh(a,"labelY",n),g=t.pstyle(i+"text-margin-x").pfValue,y=t.pstyle(i+"text-margin-y").pfValue,v=t.isEdge(),m=t.pstyle(i+"text-rotation"),b=t.pstyle("text-outline-width").pfValue,O=t.pstyle("text-border-width").pfValue/2,K=t.pstyle("text-background-padding").pfValue,S=d,P=c,M=P/2,q=S/2;if(v)G=h-M,X=h+M,U=f-q,me=f+q;else{switch(l.value){case"left":G=h-P,X=h;break;case"center":G=h-M,X=h+M;break;case"right":G=h,X=h+P}switch(u.value){case"top":U=f-S,me=f;break;case"center":U=f-q,me=f+q;break;case"bottom":U=f,me=f+S}}var be=g-Math.max(b,O)-K-2,Ae=g+Math.max(b,O)+K+2,_e=y-Math.max(b,O)-K-2,Se=y+Math.max(b,O)+K+2;G+=be,X+=Ae,U+=_e,me+=Se;var je=n||"main",Xe=o.labelBounds,De=Xe[je]=Xe[je]||{};De.x1=G,De.y1=U,De.x2=X,De.y2=me,De.w=X-G,De.h=me-U,De.leftPad=be,De.rightPad=Ae,De.topPad=_e,De.botPad=Se;var ze=v&&"autorotate"===m.strValue;if(ze||null!=m.pfValue&&0!==m.pfValue){var yt=ze?Rh(o.rstyle,"labelAngle",n):m.pfValue,ot=Math.cos(yt),bt=Math.sin(yt),xt=(G+X)/2,zt=(U+me)/2;if(!v){switch(l.value){case"left":xt=X;break;case"right":xt=G}switch(u.value){case"top":zt=me;break;case"bottom":zt=U}}var _t=function(vr,cr){return{x:(vr-=xt)*ot-(cr-=zt)*bt+xt,y:vr*bt+cr*ot+zt}},Ue=_t(G,U),He=_t(G,me),Ye=_t(X,U),pt=_t(X,me);G=Math.min(Ue.x,He.x,Ye.x,pt.x),X=Math.max(Ue.x,He.x,Ye.x,pt.x),U=Math.min(Ue.y,He.y,Ye.y,pt.y),me=Math.max(Ue.y,He.y,Ye.y,pt.y)}var Lt=je+"Rot",tr=Xe[Lt]=Xe[Lt]||{};tr.x1=G,tr.y1=U,tr.x2=X,tr.y2=me,tr.w=X-G,tr.h=me-U,ra(e,G,U,X,me),ra(o.labelBounds.all,G,U,X,me)}return e}},RD=function(e,t){if(!t.cy().headless()){var n=t.pstyle("outline-opacity").value,a=t.pstyle("outline-width").value+t.pstyle("outline-offset").value;PD(e,t,n,a,"outside",a/2)}},PD=function(e,t,n,i,o,a){if(!(0===n||i<=0||"inside"===o)){var s=t.cy(),l=t.pstyle("shape").value,u=s.renderer().nodeShapes[l],c=t.position(),d=c.x,h=c.y,f=t.width(),g=t.height();if(u.hasMiterBounds){"center"===o&&(i/=2);var y=u.miterBounds(d,h,f,g,i);Xs(e,y)}else null!=a&&a>0&&vg(e,[a,a,a,a])}},kD=function(e){var t=0,n=function(a){return(a?1:0)<<t++},i=0;return i+=n(e.incudeNodes),i+=n(e.includeEdges),i+=n(e.includeLabels),i+=n(e.includeMainLabels),i+=n(e.includeSourceLabels),i+=n(e.includeTargetLabels),(i+=n(e.includeOverlays))+n(e.includeOutlines)},DD=function(e){var t=function(s){return Math.round(s)};if(e.isEdge()){var n=e.source().position(),i=e.target().position();return PP([t(n.x),t(n.y),t(i.x),t(i.y)])}var o=e.position();return PP([t(o.x),t(o.y)])},ND=function(e,t){var i,n=e._private,o=e.isEdge(),s=(null==t?LD:kD(t))===LD;if(null==n.bbCache?(i=function(e,t){var c,d,h,f,g,y,n=e._private.cy,i=n.styleEnabled(),o=n.headless(),a=eo(),s=e._private,l=e.isNode(),u=e.isEdge(),v=s.rstyle,m=l&&i?e.pstyle("bounds-expansion").pfValue:[0],b=function(Ur){return"none"!==Ur.pstyle("display").value},T=!i||b(e)&&(!u||b(e.source())&&b(e.target()));if(T){var K=0;i&&t.includeOverlays&&0!==e.pstyle("overlay-opacity").value&&(K=e.pstyle("overlay-padding").value);var S=0;i&&t.includeUnderlays&&0!==e.pstyle("underlay-opacity").value&&(S=e.pstyle("underlay-padding").value);var P=Math.max(K,S),q=0;if(i&&(q=e.pstyle("width").pfValue/2),l&&t.includeNodes){var G=e.position();g=G.x,y=G.y;var U=e.outerWidth()/2,be=e.outerHeight()/2;ra(a,c=g-U,h=y-be,d=g+U,f=y+be),i&&RD(a,e),i&&t.includeOutlines&&!o&&RD(a,e),i&&function(e,t){if(!t.cy().headless()){var n=t.pstyle("border-opacity").value,i=t.pstyle("border-width").pfValue,o=t.pstyle("border-position").value;PD(e,t,n,i,o)}}(a,e)}else if(u&&t.includeEdges)if(i&&!o){var Ae=e.pstyle("curve-style").strValue;if(c=Math.min(v.srcX,v.midX,v.tgtX),d=Math.max(v.srcX,v.midX,v.tgtX),h=Math.min(v.srcY,v.midY,v.tgtY),f=Math.max(v.srcY,v.midY,v.tgtY),ra(a,c-=q,h-=q,d+=q,f+=q),"haystack"===Ae){var _e=v.haystackPts;if(_e&&2===_e.length){if((c=_e[0].x)>(d=_e[1].x)){var Se=c;c=d,d=Se}if((h=_e[0].y)>(f=_e[1].y)){var je=h;h=f,f=je}ra(a,c-q,h-q,d+q,f+q)}}else if("bezier"===Ae||"unbundled-bezier"===Ae||Fs(Ae,"segments")||Fs(Ae,"taxi")){var Xe;switch(Ae){case"bezier":case"unbundled-bezier":Xe=v.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":Xe=v.linePts}if(null!=Xe)for(var De=0;De<Xe.length;De++){var ze=Xe[De];ra(a,c=ze.x-q,h=ze.y-q,d=ze.x+q,f=ze.y+q)}}}else{var yt=e.source().position(),bt=e.target().position();if((c=yt.x)>(d=bt.x)){var xt=c;c=d,d=xt}if((h=yt.y)>(f=bt.y)){var zt=h;h=f,f=zt}ra(a,c-=q,h-=q,d+=q,f+=q)}if(i&&t.includeEdges&&u&&(kg(a,e,"mid-source"),kg(a,e,"mid-target"),kg(a,e,"source"),kg(a,e,"target")),i&&"yes"===e.pstyle("ghost").value){var Ue=e.pstyle("ghost-offset-x").pfValue,He=e.pstyle("ghost-offset-y").pfValue;ra(a,a.x1+Ue,a.y1+He,a.x2+Ue,a.y2+He)}var Ye=s.bodyBounds=s.bodyBounds||{};qP(Ye,a),vg(Ye,m),mg(Ye,1),i&&ra(a,(c=a.x1)-P,(h=a.y1)-P,(d=a.x2)+P,(f=a.y2)+P);var pt=s.overlayBounds=s.overlayBounds||{};qP(pt,a),vg(pt,m),mg(pt,1);var Lt=s.labelBounds=s.labelBounds||{};null!=Lt.all?function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0}(Lt.all):Lt.all=eo(),i&&t.includeLabels&&(t.includeMainLabels&&iT(a,e,null),u&&(t.includeSourceLabels&&iT(a,e,"source"),t.includeTargetLabels&&iT(a,e,"target")))}return a.x1=Bo(a.x1),a.y1=Bo(a.y1),a.x2=Bo(a.x2),a.y2=Bo(a.y2),a.w=Bo(a.x2-a.x1),a.h=Bo(a.y2-a.y1),a.w>0&&a.h>0&&T&&(vg(a,m),mg(a,1)),a}(e,Ph),n.bbCache=i,n.bbCachePosKey=DD(e)):i=n.bbCache,!s){var l=e.isNode();i=eo(),(t.includeNodes&&l||t.includeEdges&&!l)&&Xs(i,t.includeOverlays?n.overlayBounds:n.bodyBounds),t.includeLabels&&(t.includeMainLabels&&(!o||t.includeSourceLabels&&t.includeTargetLabels)?Xs(i,n.labelBounds.all):(t.includeMainLabels&&Xs(i,n.labelBounds.mainRot),t.includeSourceLabels&&Xs(i,n.labelBounds.sourceRot),t.includeTargetLabels&&Xs(i,n.labelBounds.targetRot))),i.w=i.x2-i.x1,i.h=i.y2-i.y1}return i},Ph={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},LD=kD(Ph),OD=Ri(Ph);Ws.boundingBox=function(r){var e,t=void 0===r||void 0===r.useCache||!0===r.useCache,n=cc(function(c){var d=c._private;return null==d.bbCache||d.styleDirty||d.bbCachePosKey!==DD(c)},function(c){return c.id()});if(t&&1===this.length&&!n(this[0]))r=void 0===r?Ph:OD(r),e=ND(this[0],r);else{e=eo();var i=OD(r=r||Ph),o=this,s=o.cy().styleEnabled();this.edges().forEach(n),this.nodes().forEach(n),s&&this.recalculateRenderedStyle(t),this.updateCompoundBounds(!t);for(var l=0;l<o.length;l++){var u=o[l];n(u)&&u.dirtyBoundingBoxCache(),Xs(e,ND(u,i))}}return e.x1=Bo(e.x1),e.y1=Bo(e.y1),e.x2=Bo(e.x2),e.y2=Bo(e.y2),e.w=Bo(e.x2-e.x1),e.h=Bo(e.y2-e.y1),e},Ws.dirtyBoundingBoxCache=function(){for(var r=0;r<this.length;r++){var e=this[r]._private;e.bbCache=null,e.bbCachePosKey=null,e.bodyBounds=null,e.overlayBounds=null,e.labelBounds.all=null,e.labelBounds.source=null,e.labelBounds.target=null,e.labelBounds.main=null,e.labelBounds.sourceRot=null,e.labelBounds.targetRot=null,e.labelBounds.mainRot=null,e.arrowBounds.source=null,e.arrowBounds.target=null,e.arrowBounds["mid-source"]=null,e.arrowBounds["mid-target"]=null}return this.emitAndNotify("bounds"),this},Ws.boundingBoxAt=function(r){var e=this.nodes(),t=this.cy(),n=t.hasCompoundNodes(),i=t.collection();if(n&&(i=e.filter(function(u){return u.isParent()}),e=e.not(i)),qr(r)){var o=r;r=function(){return o}}t.startBatch(),e.forEach(function(c,d){return c._private.bbAtOldPos=r(c,d)}).silentPositions(r),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var l=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}}(this.boundingBox({useCache:!1}));return e.silentPositions(function(c){return c._private.bbAtOldPos}),n&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),t.endBatch(),l},Tc.boundingbox=Tc.bb=Tc.boundingBox,Tc.renderedBoundingbox=Tc.renderedBoundingBox;var kh,Dh,Pj=Ws;kh=Dh={};var MD=function(e){e.uppercaseName=sP(e.name),e.autoName="auto"+e.uppercaseName,e.labelName="label"+e.uppercaseName,e.outerName="outer"+e.uppercaseName,e.uppercaseOuterName=sP(e.outerName),kh[e.name]=function(){var n=this[0],i=n._private;if(n){if(i.cy._private.styleEnabled){if(n.isParent())return n.updateCompoundBounds(),i[e.autoName]||0;var s=n.pstyle(e.name);return"label"===s.strValue?(n.recalculateRenderedStyle(),i.rstyle[e.labelName]||0):s.pfValue}return 1}},kh["outer"+e.uppercaseName]=function(){var n=this[0];if(n){if(n._private.cy._private.styleEnabled){var s=n[e.name](),l=n.pstyle("border-position").value;return s+("center"===l?n.pstyle("border-width").pfValue:"outside"===l?2*n.pstyle("border-width").pfValue:0)+2*n.padding()}return 1}},kh["rendered"+e.uppercaseName]=function(){var n=this[0];if(n)return n[e.name]()*this.cy().zoom()},kh["rendered"+e.uppercaseOuterName]=function(){var n=this[0];if(n)return n[e.outerName]()*this.cy().zoom()}};MD({name:"width"}),MD({name:"height"}),Dh.padding=function(){var r=this[0],e=r._private;return r.isParent()?(r.updateCompoundBounds(),void 0!==e.autoPadding?e.autoPadding:r.pstyle("padding").pfValue):r.pstyle("padding").pfValue},Dh.paddedHeight=function(){var r=this[0];return r.height()+2*r.padding()},Dh.paddedWidth=function(){var r=this[0];return r.width()+2*r.padding()};var kj=Dh,FD={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},zj=Object.keys(FD).reduce(function(r,e){var t=FD[e],n=function(e){return"rendered"+e[0].toUpperCase()+e.substr(1)}(e);return r[e]=function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)}(this,t.get)},r[n]=t.mult?function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),i=n.pan(),o=n.zoom();return t(e).map(function(a){return pg(a,o,i)})}}(this,t.get)}:function(){return function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return pg(t(e),n.zoom(),n.pan())}}(this,t.get)},r},{}),Gj=gr({},Sj,Pj,kj,zj),VD=function(e,t){this.recycle(e,t)};function Nh(){return!1}function Dg(){return!0}VD.prototype={instanceString:function(){return"event"},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=Nh,null!=e&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?Dg:Nh):null!=e&&e.type?t=e:this.type=e,null!=t&&(this.originalEvent=t.originalEvent,this.type=null!=t.type?t.type:this.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),null!=this.cy&&null!=this.position&&null==this.renderedPosition){var n=this.position,i=this.cy.zoom(),o=this.cy.pan();this.renderedPosition={x:n.x*i+o.x,y:n.y*i+o.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=Dg;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=Dg;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Dg,this.stopPropagation()},isDefaultPrevented:Nh,isPropagationStopped:Nh,isImmediatePropagationStopped:Nh};var BD=/^([^.]+)(\.(?:[^.]+))?$/,UD={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},zD=Object.keys(UD),jj={};function Ng(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jj,e=arguments.length>1?arguments[1]:void 0,t=0;t<zD.length;t++){var n=zD[t];this[n]=r[n]||UD[n]}this.context=e||this.context,this.listeners=[],this.emitting=0}var Ks=Ng.prototype,GD=function(e,t,n,i,o,a,s){On(i)&&(o=i,i=null),s&&(a=null==a?s:gr({},a,s));for(var l=un(n)?n:n.split(/\s+/),u=0;u<l.length;u++){var c=l[u];if(!Ms(c)){var d=c.match(BD);if(d&&!1===t(e,c,d[1],d[2]?d[2]:null,i,o,a))break}}},qD=function(e,t){return e.addEventFields(e.context,t),new VD(t.type,t)};Ks.on=Ks.addListener=function(r,e,t,n,i){return GD(this,function(o,a,s,l,u,c,d){On(c)&&o.listeners.push({event:a,callback:c,type:s,namespace:l,qualifier:u,conf:d})},r,e,t,n,i),this},Ks.one=function(r,e,t,n){return this.on(r,e,t,n,{one:!0})},Ks.removeListener=Ks.off=function(r,e,t,n){var i=this;0!==this.emitting&&(this.listeners=function(e){return e.slice()}(this.listeners));for(var o=this.listeners,a=function(u){var c=o[u];GD(i,function(d,h,f,g,y,v){if((c.type===f||"*"===r)&&(!g&&".*"!==c.namespace||c.namespace===g)&&(!y||d.qualifierCompare(c.qualifier,y))&&(!v||c.callback===v))return o.splice(u,1),!1},r,e,t,n)},s=o.length-1;s>=0;s--)a(s);return this},Ks.removeAllListeners=function(){return this.removeListener("*")},Ks.emit=Ks.trigger=function(r,e,t){var n=this.listeners,i=n.length;return this.emitting++,un(e)||(e=[e]),function(e,t,n){if(function(e){return"event"===ph(e)}(n))t(e,n);else if(qr(n))t(e,qD(e,n));else for(var i=un(n)?n:n.split(/\s+/),o=0;o<i.length;o++){var a=i[o];if(!Ms(a)){var s=a.match(BD);s&&t(e,qD(e,{type:s[1],namespace:s[2]?s[2]:null,target:e.context}))}}}(this,function(o,a){null!=t&&(i=(n=[{event:a.event,type:a.type,namespace:a.namespace,callback:t}]).length);for(var s=function(){var c=n[l];if(c.type===a.type&&(!c.namespace||c.namespace===a.namespace||".*"===c.namespace)&&o.eventMatches(o.context,c,a)){var d=[a];null!=e&&function(e,t){for(var n=0;n<t.length;n++)e.push(t[n])}(d,e),o.beforeEmit(o.context,c,a),c.conf&&c.conf.one&&(o.listeners=o.listeners.filter(function(g){return g!==c}));var h=o.callbackContext(o.context,c,a),f=c.callback.apply(h,d);o.afterEmit(o.context,c,a),!1===f&&(a.stopPropagation(),a.preventDefault())}},l=0;l<i;l++)s();o.bubble(o.context)&&!a.isPropagationStopped()&&o.parent(o.context).emit(a,e)},r),this.emitting--,this};var Hj={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var i=t.qualifier;return null==i||e!==n.target&&gh(n.target)&&i.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},Lg=function(e){return sr(e)?new js(e):e},jD={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||(n.emitter=new Ng(Hj,t))}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var i=Lg(t),o=0;o<this.length;o++)this[o].emitter().on(e,i,n);return this},removeListener:function(e,t,n){for(var i=Lg(t),o=0;o<this.length;o++)this[o].emitter().removeListener(e,i,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var i=Lg(t),o=0;o<this.length;o++)this[o].emitter().one(e,i,n);return this},once:function(e,t,n){for(var i=Lg(t),o=0;o<this.length;o++)this[o].emitter().on(e,i,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(0!==this.length)return this.cy().notify(e,this),this.emit(e,t),this}};Jr.eventAliasesOn(jD);var $D={nodes:function(e){return this.filter(function(t){return t.isNode()}).filter(e)},edges:function(e){return this.filter(function(t){return t.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var i=this[n];i.isNode()?e.push(i):t.push(i)}return{nodes:e,edges:t}},filter:function(e,t){if(void 0===e)return this;if(sr(e)||So(e))return new js(e).filter(this);if(On(e)){for(var n=this.spawn(),i=this,o=0;o<i.length;o++){var a=i[o];(t?e.apply(t,[a,o,i]):e(a,o,i))&&n.push(a)}return n}return this.spawn()},not:function(e){if(e){sr(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var i=this[n];e.has(i)||t.push(i)}return t}return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(sr(e))return this.filter(e);for(var n=this.spawn(),a=this.length<e.length,s=a?this:e,l=a?e:this,u=0;u<s.length;u++){var c=s[u];l.has(c)&&n.push(c)}return n},xor:function(e){var t=this._private.cy;sr(e)&&(e=t.$(e));var n=this.spawn(),o=e,a=function(l,u){for(var c=0;c<l.length;c++){var d=l[c];u.hasElementWithId(d._private.data.id)||n.push(d)}};return a(this,o),a(o,this),n},diff:function(e){var t=this._private.cy;sr(e)&&(e=t.$(e));var n=this.spawn(),i=this.spawn(),o=this.spawn(),s=e,l=function(c,d,h){for(var f=0;f<c.length;f++){var g=c[f];d.hasElementWithId(g._private.data.id)?o.merge(g):h.push(g)}};return l(this,s,n),l(s,this,i),{left:n,right:i,both:o}},add:function(e){var t=this._private.cy;if(!e)return this;if(sr(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=this.spawnSelf(),o=0;o<e.length;o++){var a=e[o];!this.has(a)&&i.push(a)}return i},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&sr(e)){var i=e;e=n.mutableElements().filter(i)}for(var o=t.map,a=0;a<e.length;a++){var s=e[a],l=s._private.data.id;if(!o.has(l)){var c=this.length++;this[c]=s,o.set(l,{ele:s,index:c})}}return this},unmergeAt:function(e){var n=this[e].id(),o=this._private.map;if(this[e]=void 0,o.delete(n),this.length>1&&e!==this.length-1){var s=this.length-1,l=this[s],u=l._private.data.id;this[s]=void 0,this[e]=l,o.set(u,{ele:l,index:e})}return this.length--,this},unmergeOne:function(e){var o=this._private.map.get((e=e[0])._private.data.id);return o?(this.unmergeAt(o.index),this):this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&sr(e)){var n=e;e=t.mutableElements().filter(n)}for(var i=0;i<e.length;i++)this.unmergeOne(e[i]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--)e(this[t])&&this.unmergeAt(t);return this},map:function(e,t){for(var n=[],i=this,o=0;o<i.length;o++){var a=i[o],s=t?e.apply(t,[a,o,i]):e(a,o,i);n.push(s)}return n},reduce:function(e,t){for(var n=t,i=this,o=0;o<i.length;o++)n=e(n,i[o],o,i);return n},max:function(e,t){for(var i,n=-1/0,o=this,a=0;a<o.length;a++){var s=o[a],l=t?e.apply(t,[s,a,o]):e(s,a,o);l>n&&(n=l,i=s)}return{value:n,ele:i}},min:function(e,t){for(var i,n=1/0,o=this,a=0;a<o.length;a++){var s=o[a],l=t?e.apply(t,[s,a,o]):e(s,a,o);l<n&&(n=l,i=s)}return{value:n,ele:i}}},Wr=$D;Wr.u=Wr["|"]=Wr["+"]=Wr.union=Wr.or=Wr.add,Wr["\\"]=Wr["!"]=Wr["-"]=Wr.difference=Wr.relativeComplement=Wr.subtract=Wr.not,Wr.n=Wr["&"]=Wr["."]=Wr.and=Wr.intersection=Wr.intersect,Wr["^"]=Wr["(+)"]=Wr["(-)"]=Wr.symmetricDifference=Wr.symdiff=Wr.xor,Wr.fnFilter=Wr.filterFn=Wr.stdFilter=Wr.filter,Wr.complement=Wr.abscomp=Wr.absoluteComplement;var e,HD=function(e,t){var i=e.cy().hasCompoundNodes();function o(c){var d=c.pstyle("z-compound-depth");return"auto"===d.value?i?c.zDepth():0:"bottom"===d.value?-1:"top"===d.value?L0:0}var a=o(e)-o(t);if(0!==a)return a;function s(c){return"auto"===c.pstyle("z-index-compare").value&&c.isNode()?1:0}var l=s(e)-s(t);if(0!==l)return l;var u=e.pstyle("z-index").value-t.pstyle("z-index").value;return 0!==u?u:e.poolIndex()-t.poolIndex()},Og={forEach:function(e,t){if(On(e))for(var n=this.length,i=0;i<n;i++){var o=this[i];if(!1===(t?e.apply(t,[o,i,this]):e(o,i,this)))break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],i=this.length;null==t&&(t=i),null==e&&(e=0),e<0&&(e=i+e),t<0&&(t=i+t);for(var o=e;o>=0&&o<t&&o<i;o++)n.push(this[o]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return 0===this.length},nonempty:function(){return!this.empty()},sort:function(e){if(!On(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(HD)},zDepth:function(){var e=this[0];if(e){var t=e._private;if("nodes"===t.group){var i=t.data.parent?e.parents().size():0;return e.isParent()?i:L0-1}var a=t.target,s=t.source.zDepth(),l=a.zDepth();return Math.max(s,l,0)}}};Og.each=Og.forEach,e="undefined",(typeof Symbol>"u"?"undefined":ii(Symbol))!=e&&ii(Symbol.iterator)!=e&&(Og[Symbol.iterator]=function(){var n=this,i={value:void 0,done:!1},o=0,a=this.length;return eP({next:function(){return o<a?i.value=n[o++]:(i.value=void 0,i.done=!0),i}},Symbol.iterator,function(){return this})});var Kj=Ri({nodeDimensionsIncludeLabels:!1}),Mg={layoutDimensions:function(e){var t;if(e=Kj(e),this.takesUpSpace())if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};else t={w:0,h:0};return(0===t.w||0===t.h)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var i=this.nodes().filter(function(K){return!K.isParent()}),o=this.cy(),a=t.eles,s=function(Z){return Z.id()},l=cc(n,s);e.emit({type:"layoutstart",layout:e}),e.animations=[];var c=t.spacingFactor&&1!==t.spacingFactor,h=function(){if(!c)return null;for(var Z=eo(),S=0;S<i.length;S++){var M=l(i[S],S);GP(Z,M.x,M.y)}return Z}(),f=cc(function(K,Z){var S=l(K,Z);return c&&(S=function(Z,S,P){var M_x=S.x1+S.w/2,M_y=S.y1+S.h/2;return{x:M_x+(P.x-M_x)*Z,y:M_y+(P.y-M_y)*Z}}(Math.abs(t.spacingFactor),h,S)),null!=t.transform&&(S=t.transform(K,S)),S},s);if(t.animate){for(var g=0;g<i.length;g++){var y=i[g],v=f(y,g);if(null==t.animateFilter||t.animateFilter(y,g)){var b=y.animation({position:v,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(b)}else y.position(v)}if(t.fit){var T=o.animation({fit:{boundingBox:a.boundingBoxAt(f),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(T)}else if(void 0!==t.zoom&&void 0!==t.pan){var O=o.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(O)}e.animations.forEach(function(K){return K.play()}),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),_c.all(e.animations.map(function(K){return K.promise()})).then(function(){e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e})})}else i.positions(f),t.fit&&o.fit(t.eles,t.padding),null!=t.zoom&&o.zoom(t.zoom),t.pan&&o.pan(t.pan),e.one("layoutready",t.ready),e.emit({type:"layoutready",layout:e}),e.one("layoutstop",t.stop),e.emit({type:"layoutstop",layout:e});return this},layout:function(e){return this.cy().makeLayout(gr({},e,{eles:this}))}};function WD(r,e,t){var o,n=t._private,i=n.styleCache=n.styleCache||[];return null!=(o=i[r])||(o=i[r]=e(t)),o}function Fg(r,e){return r=jl(r),function(n){return WD(r,e,n)}}function Vg(r,e){r=jl(r);var t=function(i){return e.call(i)};return function(){var i=this[0];if(i)return WD(r,t,i)}}Mg.createLayout=Mg.makeLayout=Mg.layout;var Pi={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),i=t.styleEnabled();return n&&i&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var n,e=this.cy(),t=function(o){return o._private.styleCache=null};return e.hasCompoundNodes()?((n=this.spawnSelf().merge(this.descendants()).merge(this.parents())).merge(n.connectedEdges()),n.forEach(t)):this.forEach(function(i){t(i),i.connectedEdges().forEach(t)}),this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var o=this;e=!(!e&&void 0!==e),t.hasCompoundNodes()&&(o=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var a=o;return e?a.emitAndNotify("style"):a.emit("style"),o.forEach(function(s){return s._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this[0],i=n.cy();if(i.styleEnabled()&&n)return n._private.styleDirty&&(n._private.styleDirty=!1,i.style().apply(n)),n._private.style[e]??(t?i.style().getDefaultProperty(e):null)},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return void 0!==n.pfValue?n.pfValue:n.value}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];return n?t.style().getRenderedStyle(n,e):void 0},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var i=!1,o=n.style();if(qr(e))o.applyBypass(this,e,i),this.emitAndNotify("style");else if(sr(e)){if(void 0===t){var s=this[0];return s?o.getStylePropertyValue(s,e):void 0}o.applyBypass(this,e,t,i),this.emitAndNotify("style")}else if(void 0===e){var l=this[0];return l?o.getRawStyle(l):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,i=t.style(),o=this;if(void 0===e)for(var a=0;a<o.length;a++)i.removeAllBypasses(o[a],n);else{e=e.split(/\s+/);for(var l=0;l<o.length;l++)i.removeBypasses(o[l],e,n)}return this.emitAndNotify("style"),this},show:function(){return this.css("display","element"),this},hide:function(){return this.css("display","none"),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var i=n._private,o=n.pstyle("opacity").value;if(!t)return o;var a=i.data.parent?n.parents():null;if(a)for(var s=0;s<a.length;s++)o*=a[s].pstyle("opacity").value;return o}},transparent:function(){if(!this.cy().styleEnabled())return!1;var t=this[0],n=t.cy().hasCompoundNodes();return t?n?0===t.effectiveOpacity():0===t.pstyle("opacity").value:void 0},backgrounding:function(){return!!this.cy().styleEnabled()&&!!this[0]._private.backgrounding}};function oT(r,e){var n=r._private.data.parent?r.parents():null;if(n)for(var i=0;i<n.length;i++)if(!e(n[i]))return!1;return!0}function aT(r){var e=r.ok,t=r.edgeOkViaNode||r.ok,n=r.parentOk||r.ok;return function(){var i=this.cy();if(!i.styleEnabled())return!0;var o=this[0],a=i.hasCompoundNodes();if(o){var s=o._private;if(!e(o))return!1;if(o.isNode())return!a||oT(o,n);var l=s.source,u=s.target;return t(l)&&(!a||oT(l,t))&&(l===u||t(u)&&(!a||oT(u,t)))}}}var Ic=Fg("eleTakesUpSpace",function(r){return"element"===r.pstyle("display").value&&0!==r.width()&&(!r.isNode()||0!==r.height())});Pi.takesUpSpace=Vg("takesUpSpace",aT({ok:Ic}));var Yj=Fg("eleInteractive",function(r){return"yes"===r.pstyle("events").value&&"visible"===r.pstyle("visibility").value&&Ic(r)}),Qj=Fg("parentInteractive",function(r){return"visible"===r.pstyle("visibility").value&&Ic(r)});Pi.interactive=Vg("interactive",aT({ok:Yj,parentOk:Qj,edgeOkViaNode:Ic})),Pi.noninteractive=function(){var r=this[0];if(r)return!r.interactive()};var Jj=Fg("eleVisible",function(r){return"visible"===r.pstyle("visibility").value&&0!==r.pstyle("opacity").pfValue&&Ic(r)});Pi.visible=Vg("visible",aT({ok:Jj,edgeOkViaNode:Ic})),Pi.hidden=function(){var r=this[0];if(r)return!r.visible()},Pi.isBundledBezier=Vg("isBundledBezier",function(){return!!this.cy().styleEnabled()&&!this.removed()&&"bezier"===this.pstyle("curve-style").value&&this.takesUpSpace()}),Pi.bypass=Pi.css=Pi.style,Pi.renderedCss=Pi.renderedStyle,Pi.removeBypass=Pi.removeCss=Pi.removeStyle,Pi.pstyle=Pi.parsedStyle;var Ys={};function XD(r){return function(){var e=arguments,t=[];if(2===e.length)this.on(r.event,e[0],e[1]);else if(1===e.length&&On(e[0]))this.on(r.event,e[0]);else if(0===e.length||1===e.length&&un(e[0])){for(var a=1===e.length?e[0]:null,s=0;s<this.length;s++){var l=this[s],u=!r.ableField||l._private[r.ableField],c=l._private[r.field]!=r.value;if(r.overrideAble){var d=r.overrideAble(l);if(void 0!==d&&(u=d,!d))return this}u&&(l._private[r.field]=r.value,c&&t.push(l))}var h=this.spawn(t);h.updateStyle(),h.emit(r.event),a&&h.emit(a)}return this}}function xc(r){Ys[r.field]=function(){var e=this[0];if(e){if(r.overrideField){var t=r.overrideField(e);if(void 0!==t)return t}return e._private[r.field]}},Ys[r.on]=XD({event:r.on,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!0}),Ys[r.off]=XD({event:r.off,field:r.field,ableField:r.ableField,overrideAble:r.overrideAble,value:!1})}xc({field:"locked",overrideField:function(e){return!!e.cy().autolock()||void 0},on:"lock",off:"unlock"}),xc({field:"grabbable",overrideField:function(e){return!e.cy().autoungrabify()&&!e.pannable()&&void 0},on:"grabify",off:"ungrabify"}),xc({field:"selected",ableField:"selectable",overrideAble:function(e){return!e.cy().autounselectify()&&void 0},on:"select",off:"unselect"}),xc({field:"selectable",overrideField:function(e){return!e.cy().autounselectify()&&void 0},on:"selectify",off:"unselectify"}),Ys.deselect=Ys.unselect,Ys.grabbed=function(){var r=this[0];if(r)return r._private.grabbed},xc({field:"active",on:"activate",off:"unactivate"}),xc({field:"pannable",on:"panify",off:"unpanify"}),Ys.inactive=function(){var r=this[0];if(r)return!r._private.active};var qi={},KD=function(e){return function(n){for(var o=[],a=0;a<this.length;a++){var s=this[a];if(s.isNode()){for(var l=!1,u=s.connectedEdges(),c=0;c<u.length;c++){var d=u[c],h=d.source(),f=d.target();if(e.noIncomingEdges&&f===s&&h!==s||e.noOutgoingEdges&&h===s&&f!==s){l=!0;break}}l||o.push(s)}}return this.spawn(o,!0).filter(n)}},YD=function(e){return function(t){for(var i=[],o=0;o<this.length;o++){var a=this[o];if(a.isNode())for(var s=a.connectedEdges(),l=0;l<s.length;l++){var u=s[l],c=u.source(),d=u.target();e.outgoing&&c===a?(i.push(u),i.push(d)):e.incoming&&d===a&&(i.push(u),i.push(c))}}return this.spawn(i,!0).filter(t)}},QD=function(e){return function(t){for(var n=this,i=[],o={};;){var a=e.outgoing?n.outgoers():n.incomers();if(0===a.length)break;for(var s=!1,l=0;l<a.length;l++){var u=a[l],c=u.id();o[c]||(o[c]=!0,i.push(u),s=!0)}if(!s)break;n=a}return this.spawn(i,!0).filter(t)}};function JD(r){return function(t){for(var n=[],i=0;i<this.length;i++){var a=this[i]._private[r.attr];a&&n.push(a)}return this.spawn(n,!0).filter(t)}}function ZD(r){return function(t){var n=[],i=this._private.cy,o=r||{};sr(t)&&(t=i.$(t));for(var a=0;a<t.length;a++)for(var s=t[a]._private.edges,l=0;l<s.length;l++){var u=s[l],c=u._private.data,d=this.hasElementWithId(c.source)&&t.hasElementWithId(c.target),h=t.hasElementWithId(c.source)&&this.hasElementWithId(c.target);(d||h)&&((o.thisIsSrc||o.thisIsTgt)&&(o.thisIsSrc&&!d||o.thisIsTgt&&!h)||n.push(u))}return this.spawn(n,!0)}}function eN(r){return r=gr({},{codirected:!1},r),function(n){for(var i=[],o=this.edges(),a=r,s=0;s<o.length;s++)for(var u=o[s]._private,c=u.source,d=c._private.data.id,h=u.data.target,f=c._private.edges,g=0;g<f.length;g++){var y=f[g],v=y._private.data,m=v.target,b=v.source,T=m===h&&b===d;(a.codirected&&T||!a.codirected&&(T||d===m&&h===b))&&i.push(y)}return this.spawn(i,!0).filter(n)}}qi.clearTraversalCache=function(){for(var r=0;r<this.length;r++)this[r]._private.traversalCache=null},gr(qi,{roots:KD({noIncomingEdges:!0}),leaves:KD({noOutgoingEdges:!0}),outgoers:Vo(YD({outgoing:!0}),"outgoers"),successors:QD({outgoing:!0}),incomers:Vo(YD({incoming:!0}),"incomers"),predecessors:QD({})}),gr(qi,{neighborhood:Vo(function(r){for(var e=[],t=this.nodes(),n=0;n<t.length;n++)for(var i=t[n],o=i.connectedEdges(),a=0;a<o.length;a++){var s=o[a],l=s.source(),u=s.target(),c=i===l?u:l;c.length>0&&e.push(c[0]),e.push(s[0])}return this.spawn(e,!0).filter(r)},"neighborhood"),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),qi.neighbourhood=qi.neighborhood,qi.closedNeighbourhood=qi.closedNeighborhood,qi.openNeighbourhood=qi.openNeighborhood,gr(qi,{source:Vo(function(e){var n,t=this[0];return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},"source"),target:Vo(function(e){var n,t=this[0];return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},"target"),sources:JD({attr:"source"}),targets:JD({attr:"target"})}),gr(qi,{edgesWith:Vo(ZD(),"edgesWith"),edgesTo:Vo(ZD({thisIsSrc:!0}),"edgesTo")}),gr(qi,{connectedEdges:Vo(function(r){for(var e=[],n=0;n<this.length;n++){var i=this[n];if(i.isNode())for(var o=i._private.edges,a=0;a<o.length;a++)e.push(o[a])}return this.spawn(e,!0).filter(r)},"connectedEdges"),connectedNodes:Vo(function(r){for(var e=[],n=0;n<this.length;n++){var i=this[n];i.isEdge()&&(e.push(i.source()[0]),e.push(i.target()[0]))}return this.spawn(e,!0).filter(r)},"connectedNodes"),parallelEdges:Vo(eN(),"parallelEdges"),codirectedEdges:Vo(eN({codirected:!0}),"codirectedEdges")}),gr(qi,{components:function(e){var t=this,n=t.cy(),i=n.collection(),o=null==e?t.nodes():e.nodes(),a=[];null!=e&&o.empty()&&(o=e.sources());var s=function(c,d){i.merge(c),o.unmerge(c),d.merge(c)};if(o.empty())return t.spawn();var l=function(){var c=n.collection();a.push(c);var d=o[0];s(d,c),t.bfs({directed:!1,roots:d,visit:function(f){return s(f,c)}}),c.forEach(function(h){h.connectedEdges().forEach(function(f){t.has(f)&&c.has(f.source())&&c.has(f.target())&&c.merge(f)})})};do{l()}while(o.length>0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),qi.componentsOf=qi.components;var ki=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(void 0!==e){var o=new ts,a=!1;if(t){if(t.length>0&&qr(t[0])&&!gh(t[0])){a=!0;for(var s=[],l=new hc,u=0,c=t.length;u<c;u++){var d=t[u];null==d.data&&(d.data={});var h=d.data;if(null==h.id)h.id=MP();else if(e.hasElementWithId(h.id)||l.has(h.id))continue;var f=new hg(e,d,!1);s.push(f),l.add(h.id)}t=s}}else t=[];this.length=0;for(var g=0,y=t.length;g<y;g++){var v=t[g][0];if(null!=v){var m=v._private.data.id;(!n||!o.has(m))&&(n&&o.set(m,{index:this.length,ele:v}),this[this.length]=v,this.length++)}}this._private={eles:this,cy:e,get map(){return null==this.lazyMap&&this.rebuildMap(),this.lazyMap},set map(b){this.lazyMap=b},rebuildMap:function(){for(var T=this.lazyMap=new ts,O=this.eles,K=0;K<O.length;K++){var Z=O[K];T.set(Z.id(),{index:K,ele:Z})}}},n&&(this._private.map=o),a&&!i&&this.restore()}else kn("A collection must have a reference to the core")},yn=hg.prototype=ki.prototype=Object.create(Array.prototype);yn.instanceString=function(){return"collection"},yn.spawn=function(r,e){return new ki(this.cy(),r,e)},yn.spawnSelf=function(){return this.spawn(this)},yn.cy=function(){return this._private.cy},yn.renderer=function(){return this._private.cy.renderer()},yn.element=function(){return this[0]},yn.collection=function(){return iP(this)?this:new ki(this._private.cy,[this])},yn.unique=function(){return new ki(this._private.cy,this,!0)},yn.hasElementWithId=function(r){return this._private.map.has(r=""+r)},yn.getElementById=function(r){var e=this._private.cy,t=this._private.map.get(r=""+r);return t?t.ele:new ki(e)},yn.$id=yn.getElementById,yn.poolIndex=function(){return this._private.cy._private.elements._private.map.get(this[0]._private.data.id).index},yn.indexOf=function(r){return this._private.map.get(r[0]._private.data.id).index},yn.indexOfId=function(r){return this._private.map.get(r=""+r).index},yn.json=function(r){var e=this.element(),t=this.cy();if(null==e&&r)return this;if(null!=e){var n=e._private;if(qr(r)){if(t.startBatch(),r.data){e.data(r.data);var i=n.data;if(e.isEdge()){var o=!1,a={},s=r.data.source,l=r.data.target;null!=s&&s!=i.source&&(a.source=""+s,o=!0),null!=l&&l!=i.target&&(a.target=""+l,o=!0),o&&(e=e.move(a))}else{var c=r.data.parent;"parent"in r.data&&(null!=c||null!=i.parent)&&c!=i.parent&&(void 0===c&&(c=null),null!=c&&(c=""+c),e=e.move({parent:c}))}}r.position&&e.position(r.position);var d=function(y,v,m){var b=r[y];null!=b&&b!==n[y]&&(b?e[v]():e[m]())};return d("removed","remove","restore"),d("selected","select","unselect"),d("selectable","selectify","unselectify"),d("locked","lock","unlock"),d("grabbable","grabify","ungrabify"),d("pannable","panify","unpanify"),null!=r.classes&&e.classes(r.classes),t.endBatch(),this}if(void 0===r){var h={data:Ea(n.data),position:Ea(n.position),group:n.group,removed:n.removed,selected:n.selected,selectable:n.selectable,locked:n.locked,grabbable:n.grabbable,pannable:n.pannable,classes:""},f=0;return n.classes.forEach(function(g){return h.classes+=0===f++?g:" "+g}),h}}},yn.jsons=function(){for(var r=[],e=0;e<this.length;e++){var n=this[e].json();r.push(n)}return r},yn.clone=function(){for(var r=this.cy(),e=[],t=0;t<this.length;t++){var i=this[t].json(),o=new hg(r,i,!1);e.push(o)}return new ki(r,e)},yn.copy=yn.clone,yn.restore=function(){for(var s,r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=this,n=t.cy(),i=n._private,o=[],a=[],l=0,u=t.length;l<u;l++){var c=t[l];e&&!c.removed()||(c.isNode()?o.push(c):a.push(c))}s=o.concat(a);var d,h=function(){s.splice(d,1),d--};for(d=0;d<s.length;d++){var f=s[d],g=f._private,y=g.data;if(f.clearTraversalCache(),e||g.removed)if(void 0===y.id)y.id=MP();else if(Ut(y.id))y.id=""+y.id;else{if(Ms(y.id)||!sr(y.id)){kn("Can not create element with invalid string ID `"+y.id+"`"),h();continue}if(n.hasElementWithId(y.id)){kn("Can not create second element with ID `"+y.id+"`"),h();continue}}var v=y.id;if(f.isNode()){var m=g.position;null==m.x&&(m.x=0),null==m.y&&(m.y=0)}if(f.isEdge()){for(var b=f,T=["source","target"],O=T.length,K=!1,Z=0;Z<O;Z++){var S=T[Z],P=y[S];Ut(P)&&(P=y[S]=""+y[S]),null==P||""===P?(kn("Can not create edge `"+v+"` with unspecified "+S),K=!0):n.hasElementWithId(P)||(kn("Can not create edge `"+v+"` with nonexistant "+S+" `"+P+"`"),K=!0)}if(K){h();continue}var M=n.getElementById(y.source),q=n.getElementById(y.target);M.same(q)?M._private.edges.push(b):(M._private.edges.push(b),q._private.edges.push(b)),b._private.source=M,b._private.target=q}g.map=new ts,g.map.set(v,{ele:f,index:0}),g.removed=!1,e&&n.addToPool(f)}for(var G=0;G<o.length;G++){var X=o[G],U=X._private.data;Ut(U.parent)&&(U.parent=""+U.parent);var me=U.parent;if(null!=me||X._private.parent){var Ae=X._private.parent?n.collection().merge(X._private.parent):n.getElementById(me);if(Ae.empty())U.parent=void 0;else if(Ae[0].removed())Qr("Node added with missing parent, reference to parent removed"),U.parent=void 0,X._private.parent=null;else{for(var _e=!1,Se=Ae;!Se.empty();){if(X.same(Se)){_e=!0,U.parent=void 0;break}Se=Se.parent()}_e||(Ae[0]._private.children.push(X),X._private.parent=Ae[0],i.hasCompoundNodes=!0)}}}if(s.length>0){for(var je=s.length===t.length?t:new ki(n,s),Xe=0;Xe<je.length;Xe++){var De=je[Xe];De.isNode()||(De.parallelEdges().clearTraversalCache(),De.source().clearTraversalCache(),De.target().clearTraversalCache())}(i.hasCompoundNodes?n.collection().merge(je).merge(je.connectedNodes()).merge(je.parent()):je).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(r),r?je.emitAndNotify("add"):e&&je.emit("add")}return t},yn.removed=function(){var r=this[0];return r&&r._private.removed},yn.inside=function(){var r=this[0];return r&&!r._private.removed},yn.remove=function(){var r=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=this,n=[],i={},o=t._private.cy;function l(me){var be=i[me.id()];e&&me.removed()||be||(i[me.id()]=!0,me.isNode()?(n.push(me),function a(me){for(var be=me._private.edges,Ae=0;Ae<be.length;Ae++)l(be[Ae])}(me),function s(me){for(var be=me._private.children,Ae=0;Ae<be.length;Ae++)l(be[Ae])}(me)):n.unshift(me))}for(var u=0,c=t.length;u<c;u++)l(t[u]);function h(me,be){Bs(me._private.edges,be),me.clearTraversalCache()}function f(me){me.clearTraversalCache()}var g=[];function y(me,be){be=be[0];var Ae=(me=me[0])._private.children,_e=me.id();Bs(Ae,be),be._private.parent=null,g.ids[_e]||(g.ids[_e]=!0,g.push(me))}g.ids={},t.dirtyCompoundBoundsCache(),e&&o.removeFromPool(n);for(var v=0;v<n.length;v++){var m=n[v];if(m.isEdge()){var b=m.source()[0],T=m.target()[0];h(b,m),h(T,m);for(var O=m.parallelEdges(),K=0;K<O.length;K++){var Z=O[K];f(Z),Z.isBundledBezier()&&Z.dirtyBoundingBoxCache()}}else{var S=m.parent();0!==S.length&&y(S,m)}e&&(m._private.removed=!0)}var P=o._private.elements;o._private.hasCompoundNodes=!1;for(var M=0;M<P.length;M++)if(P[M].isParent()){o._private.hasCompoundNodes=!0;break}var G=new ki(this.cy(),n);G.size()>0&&(r?G.emitAndNotify("remove"):e&&G.emit("remove"));for(var X=0;X<g.length;X++){var U=g[X];(!e||!U.removed())&&U.updateStyle()}return G},yn.move=function(r){var e=this._private.cy,t=this,n=!1,i=!1,o=function(g){return null==g?g:""+g};if(void 0!==r.source||void 0!==r.target){var a=o(r.source),s=o(r.target),l=null!=a&&e.hasElementWithId(a),u=null!=s&&e.hasElementWithId(s);(l||u)&&(e.batch(function(){t.remove(n,i),t.emitAndNotify("moveout");for(var f=0;f<t.length;f++){var g=t[f],y=g._private.data;g.isEdge()&&(l&&(y.source=a),u&&(y.target=s))}t.restore(n,i)}),t.emitAndNotify("move"))}else if(void 0!==r.parent){var c=o(r.parent);if(null===c||e.hasElementWithId(c)){var h=null===c?void 0:c;e.batch(function(){var f=t.remove(n,i);f.emitAndNotify("moveout");for(var g=0;g<t.length;g++){var y=t[g],v=y._private.data;y.isNode()&&(v.parent=h)}f.restore(n,i)}),t.emitAndNotify("move")}}return this},[dk,cj,Rg,Hs,bc,Aj,Pg,Gj,jD,$D,{isNode:function(){return"nodes"===this.group()},isEdge:function(){return"edges"===this.group()},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},Og,Mg,Pi,Ys,qi].forEach(function(r){gr(yn,r)});var e$={add:function(e){var t,n=this;if(So(e)){var i=e;if(i._private.cy===n)t=i.restore();else{for(var o=[],a=0;a<i.length;a++)o.push(i[a].json());t=new ki(n,o)}}else if(un(e))t=new ki(n,e);else if(qr(e)&&(un(e.nodes)||un(e.edges))){for(var u=e,c=[],d=["nodes","edges"],h=0,f=d.length;h<f;h++){var g=d[h],y=u[g];if(un(y))for(var v=0,m=y.length;v<m;v++){var b=gr({group:g},y[v]);c.push(b)}}t=new ki(n,c)}else t=new hg(n,e).collection();return t},remove:function(e){return So(e)||sr(e)&&(e=this.$(e)),e.remove()}};function t$(r,e,t,n){var u=.1,c=typeof Float32Array<"u";if(4!==arguments.length)return!1;for(var d=0;d<4;++d)if("number"!=typeof arguments[d]||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;r=Math.min(r,1),t=Math.min(t,1),r=Math.max(r,0),t=Math.max(t,0);var h=c?new Float32Array(11):new Array(11);function f(q,G){return 1-3*G+3*q}function g(q,G){return 3*G-6*q}function y(q){return 3*q}function v(q,G,X){return((f(G,X)*q+g(G,X))*q+y(G))*q}function m(q,G,X){return 3*f(G,X)*q*q+2*g(G,X)*q+y(G)}var Z=!1;var P=function(G){return Z||function S(){Z=!0,(r!==e||t!==n)&&function T(){for(var q=0;q<11;++q)h[q]=v(q*u,r,t)}()}(),r===e&&t===n?G:0===G?0:1===G?1:v(function K(q){for(var G=0,X=1;10!==X&&h[X]<=q;++X)G+=u;--X;var be=G+(q-h[X])/(h[X+1]-h[X])*u,Ae=m(be,r,t);return Ae>=.001?function b(q,G){for(var X=0;X<4;++X){var U=m(G,r,t);if(0===U)return G;G-=(v(G,r,t)-q)/U}return G}(q,be):0===Ae?be:function O(q,G,X){var U,me,be=0;do{(U=v(me=G+(X-G)/2,r,t)-q)>0?X=me:G=me}while(Math.abs(U)>1e-7&&++be<10);return me}(q,G,G+u)}(G),e,n)};P.getControlPoints=function(){return[{x:r,y:e},{x:t,y:n}]};var M="generateBezier("+[r,e,t,n]+")";return P.toString=function(){return M},P}var r$=function(){function r(n){return-n.tension*n.x-n.friction*n.v}function e(n,i,o){var a={x:n.x+o.dx*i,v:n.v+o.dv*i,tension:n.tension,friction:n.friction};return{dx:a.v,dv:r(a)}}function t(n,i){var o={dx:n.v,dv:r(n)},a=e(n,.5*i,o),s=e(n,.5*i,a),l=e(n,i,s),c=1/6*(o.dv+2*(a.dv+s.dv)+l.dv);return n.x=n.x+1/6*(o.dx+2*(a.dx+s.dx)+l.dx)*i,n.v=n.v+c*i,n}return function n(i,o,a){var h,f,g,s={x:-1,v:0,tension:null,friction:null},l=[0],u=0,c=1e-4;for(i=parseFloat(i)||500,o=parseFloat(o)||20,a=a||null,s.tension=i,s.friction=o,f=(h=null!==a)?(u=n(i,o))/a*.016:.016;g=t(g||s,f),l.push(1+g.x),u+=16,Math.abs(g.x)>c&&Math.abs(g.v)>c;);return h?function(y){return l[y*(l.length-1)|0]}:u}}(),_n=function(e,t,n,i){var o=t$(e,t,n,i);return function(a,s,l){return a+(s-a)*o(l)}},Bg={linear:function(e,t,n){return e+(t-e)*n},ease:_n(.25,.1,.25,1),"ease-in":_n(.42,0,1,1),"ease-out":_n(0,0,.58,1),"ease-in-out":_n(.42,0,.58,1),"ease-in-sine":_n(.47,0,.745,.715),"ease-out-sine":_n(.39,.575,.565,1),"ease-in-out-sine":_n(.445,.05,.55,.95),"ease-in-quad":_n(.55,.085,.68,.53),"ease-out-quad":_n(.25,.46,.45,.94),"ease-in-out-quad":_n(.455,.03,.515,.955),"ease-in-cubic":_n(.55,.055,.675,.19),"ease-out-cubic":_n(.215,.61,.355,1),"ease-in-out-cubic":_n(.645,.045,.355,1),"ease-in-quart":_n(.895,.03,.685,.22),"ease-out-quart":_n(.165,.84,.44,1),"ease-in-out-quart":_n(.77,0,.175,1),"ease-in-quint":_n(.755,.05,.855,.06),"ease-out-quint":_n(.23,1,.32,1),"ease-in-out-quint":_n(.86,0,.07,1),"ease-in-expo":_n(.95,.05,.795,.035),"ease-out-expo":_n(.19,1,.22,1),"ease-in-out-expo":_n(1,0,0,1),"ease-in-circ":_n(.6,.04,.98,.335),"ease-out-circ":_n(.075,.82,.165,1),"ease-in-out-circ":_n(.785,.135,.15,.86),spring:function(e,t,n){if(0===n)return Bg.linear;var i=r$(e,t,n);return function(o,a,s){return o+(a-o)*i(s)}},"cubic-bezier":_n};function tN(r,e,t,n,i){if(1===n||e===t)return t;var o=i(e,t,n);return null==r||((r.roundValue||r.color)&&(o=Math.round(o)),void 0!==r.min&&(o=Math.max(o,r.min)),void 0!==r.max&&(o=Math.min(o,r.max))),o}function rN(r,e){return null!=r.pfValue||null!=r.value?null==r.pfValue||null!=e&&"%"===e.type.units?r.value:r.pfValue:r}function Ac(r,e,t,n,i){var o=null!=i?i.type:null;t<0?t=0:t>1&&(t=1);var a=rN(r,i),s=rN(e,i);if(Ut(a)&&Ut(s))return tN(o,a,s,t,n);if(un(a)&&un(s)){for(var l=[],u=0;u<s.length;u++){var c=a[u],d=s[u];if(null!=c&&null!=d){var h=tN(o,c,d,t,n);l.push(h)}else l.push(d)}return l}}function n$(r,e,t,n){var i=!n,o=r._private,a=e._private,s=a.easing,l=a.startTime,c=(n?r:r.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=Bg.linear;else{var d,f,g;d=sr(s)?c.parse("transition-timing-function",s).value:s,sr(d)?(f=d,g=[]):(f=d[1],g=d.slice(2).map(function(je){return+je})),g.length>0?("spring"===f&&g.push(a.duration),a.easingImpl=Bg[f].apply(null,g)):a.easingImpl=Bg[f]}var v,y=a.easingImpl;if(v=0===a.duration?1:(t-l)/a.duration,a.applying&&(v=a.progress),v<0?v=0:v>1&&(v=1),null==a.delay){var m=a.startPosition,b=a.position;if(b&&i&&!r.locked()){var T={};Lh(m.x,b.x)&&(T.x=Ac(m.x,b.x,v,y)),Lh(m.y,b.y)&&(T.y=Ac(m.y,b.y,v,y)),r.position(T)}var O=a.startPan,K=a.pan,Z=o.pan,S=null!=K&&n;S&&(Lh(O.x,K.x)&&(Z.x=Ac(O.x,K.x,v,y)),Lh(O.y,K.y)&&(Z.y=Ac(O.y,K.y,v,y)),r.emit("pan"));var P=a.startZoom,M=a.zoom,q=null!=M&&n;q&&(Lh(P,M)&&(o.zoom=Ih(o.minZoom,Ac(P,M,v,y),o.maxZoom)),r.emit("zoom")),(S||q)&&r.emit("viewport");var G=a.style;if(G&&G.length>0&&i){for(var X=0;X<G.length;X++){var U=G[X],me=U.name,Ae=a.startStyle[me],Se=Ac(Ae,U,v,y,c.properties[Ae.name]);c.overrideBypass(r,me,Se)}r.emit("style")}}return a.progress=v,v}function Lh(r,e){return!!(null!=r&&null!=e&&(Ut(r)&&Ut(e)||r&&e))}function i$(r,e,t,n){var i=e._private;i.started=!0,i.startTime=t-i.progress*i.duration}function nN(r,e){var t=e._private.aniEles,n=[];function i(c,d){var h=c._private,f=h.animation.current,g=h.animation.queue,y=!1;if(0===f.length){var v=g.shift();v&&f.push(v)}for(var m=function(Z){for(var S=Z.length-1;S>=0;S--)(0,Z[S])();Z.splice(0,Z.length)},b=f.length-1;b>=0;b--){var T=f[b],O=T._private;O.stopped?(f.splice(b,1),O.hooked=!1,O.playing=!1,O.started=!1,m(O.frames)):!O.playing&&!O.applying||(O.playing&&O.applying&&(O.applying=!1),O.started||i$(0,T,r),n$(c,T,r,d),O.applying&&(O.applying=!1),m(O.frames),null!=O.step&&O.step(r),T.completed()&&(f.splice(b,1),O.hooked=!1,O.playing=!1,O.started=!1,m(O.completes)),y=!0)}return!d&&0===f.length&&0===g.length&&n.push(c),y}for(var o=!1,a=0;a<t.length;a++){var l=i(t[a]);o=o||l}var u=i(e,!0);(o||u)&&(t.length>0?e.notify("draw",t):e.notify("draw")),t.unmerge(n),e.emit("step")}var o$={animate:Jr.animate(),animation:Jr.animation(),animated:Jr.animated(),clearQueue:Jr.clearQueue(),delay:Jr.delay(),delayAnimation:Jr.delayAnimation(),stop:Jr.stop(),addToAnimationPool:function(e){this.styleEnabled()&&this._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,e.styleEnabled()){var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(o,a){nN(a,e)},n.beforeRenderPriorities.animations):function t(){e._private.animationsRunning&&ug(function(o){nN(o,e),t()})}()}}},a$={qualifierCompare:function(e,t){return null==e||null==t?null==e&&null==t:e.sameText(t)},eventMatches:function(e,t,n){var i=t.qualifier;return null==i||e!==n.target&&gh(n.target)&&i.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return null!=t.qualifier?n.target:e}},Ug=function(e){return sr(e)?new js(e):e},iN={createEmitter:function(){var e=this._private;return e.emitter||(e.emitter=new Ng(a$,this)),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,Ug(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,Ug(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,Ug(t),n),this},once:function(e,t,n){return this.emitter().one(e,Ug(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};Jr.eventAliasesOn(iN);var sT={png:function(e){return this._private.renderer.png(e=e||{})},jpg:function(e){var t=this._private.renderer;return(e=e||{}).bg=e.bg||"#fff",t.jpg(e)}};sT.jpeg=sT.jpg;var zg={layout:function(e){var t=this;if(null!=e)if(null!=e.name){var o,n=e.name,i=t.extension("layout",n);if(null!=i)return o=sr(e.eles)?t.$(e.eles):null!=e.eles?e.eles:t.$(),new i(gr({},e,{cy:t,eles:o}));kn("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?")}else kn("A `name` must be specified to make a layout");else kn("Layout options must be specified to make a layout")}};zg.createLayout=zg.makeLayout=zg.layout;var s$={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var i=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();null!=t&&i.merge(t)}else if(n.notificationsEnabled){var o=this.renderer();this.destroyed()||!o||o.notify(e,t)}},notifications:function(e){var t=this._private;return void 0===e?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return null==e.batchCount&&(e.batchCount=0),0===e.batchCount&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(0===e.batchCount)return this;if(e.batchCount--,0===e.batchCount){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var i=e.batchNotifications[n];i.empty()?t.notify(n):t.notify(n,i)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),i=0;i<n.length;i++){var o=n[i],a=e[o];t.getElementById(o).data(a)}})}},l$=Ri({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),lT={renderTo:function(e,t,n,i){return this._private.renderer.renderTo(e,t,n,i),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify("draw"),this},resize:function(){return this.invalidateSize(),this.emitAndNotify("resize"),this},initRenderer:function(e){var t=this,n=t.extension("renderer",e.name);if(null!=n){void 0!==e.wheelSensitivity&&Qr("You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.");var i=l$(e);i.cy=t,t._private.renderer=new n(i),this.notify("init")}else kn("Can not initialise: No such renderer `".concat(e.name,"` found. Did you forget to import it and `cytoscape.use()` it?"))},destroyRenderer:function(){var e=this;e.notify("destroy");var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(n){var i=n._private;i.rscratch={},i.rstyle={},i.animation.current=[],i.animation.queue=[]})},onRender:function(e){return this.on("render",e)},offRender:function(e){return this.off("render",e)}};lT.invalidateDimensions=lT.resize;var Gg={collection:function(e,t){return sr(e)?this.$(e):So(e)?e.collection():un(e)?(t||(t={}),new ki(this,e,t.unique,t.removed)):new ki(this)},nodes:function(e){var t=this.$(function(n){return n.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(n){return n.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};Gg.elements=Gg.filter=Gg.$;var mi={apply:function(r){for(var e=this,i=e._private.cy.collection(),o=0;o<r.length;o++){var a=r[o],s=e.getContextMeta(a);if(!s.empty){var l=e.getContextStyle(s),u=e.applyContextStyle(s,l,a);a._private.appliedInitStyle?e.updateTransitions(a,u.diffProps):a._private.appliedInitStyle=!0,e.updateStyleHints(a)&&i.push(a)}}return i},getPropertiesDiff:function(r,e){var t=this,n=t._private.propDiffs=t._private.propDiffs||{},i=r+"-"+e,o=n[i];if(o)return o;for(var a=[],s={},l=0;l<t.length;l++){var u=t[l],d="t"===e[l],h="t"===r[l]!==d,f=u.mappedProperties.length>0;if(h||d&&f){var g=void 0;h&&f||h?g=u.properties:f&&(g=u.mappedProperties);for(var y=0;y<g.length;y++){for(var v=g[y],m=v.name,b=!1,T=l+1;T<t.length&&("t"!==e[T]||!(b=null!=t[T].properties[v.name]));T++);!s[m]&&!b&&(s[m]=!0,a.push(m))}}}return n[i]=a,a},getContextMeta:function(r){for(var n,e=this,t="",i=r._private.styleCxtKey||"",o=0;o<e.length;o++){var a=e[o];t+=a.selector&&a.selector.matches(r)?"t":"f"}return n=e.getPropertiesDiff(i,t),r._private.styleCxtKey=t,{key:t,diffPropNames:n,empty:0===n.length}},getContextStyle:function(r){var e=r.key,n=this._private.contextStyles=this._private.contextStyles||{};if(n[e])return n[e];for(var i={_private:{key:e}},o=0;o<this.length;o++){var a=this[o];if("t"===e[o])for(var l=0;l<a.properties.length;l++){var u=a.properties[l];i[u.name]=u}}return n[e]=i,i},applyContextStyle:function(r,e,t){for(var i=r.diffPropNames,o={},a=this.types,s=0;s<i.length;s++){var l=i[s],u=e[l],c=t.pstyle(l);if(!u){if(!c)continue;u=c.bypass?{name:l,deleteBypassed:!0}:{name:l,delete:!0}}if(c!==u){if(u.mapped===a.fn&&null!=c&&null!=c.mapping&&c.mapping.value===u.value){var d=c.mapping;if((d.fnValue=u.value(t))===d.prevFnValue)continue}var f=o[l]={prev:c};this.applyParsedProperty(t,u),f.next=t.pstyle(l),f.next&&f.next.bypass&&(f.next=f.next.bypassed)}}return{diffProps:o}},updateStyleHints:function(r){var n,e=r._private,t=this,i=t.propertyGroupKeys,o=function(Ye,pt,Lt){return t.getPropertiesHash(Ye,pt,Lt)},a=e.styleKey;if(r.removed())return!1;var s="nodes"===e.group,l=r._private.style;n=Object.keys(l);for(var u=0;u<i.length;u++)e.styleKeys[i[u]]=[ql,dc];for(var d=function(Ye,pt){return e.styleKeys[pt][0]=wh(Ye,e.styleKeys[pt][0])},h=function(Ye,pt){return e.styleKeys[pt][1]=bh(Ye,e.styleKeys[pt][1])},f=function(Ye,pt){d(Ye,pt),h(Ye,pt)},g=function(Ye,pt){for(var Lt=0;Lt<Ye.length;Lt++){var tr=Ye.charCodeAt(Lt);d(tr,pt),h(tr,pt)}},v=function(Ye){return-128<Ye&&Ye<128&&Math.floor(Ye)!==Ye?2e9-(1024*Ye|0):Ye},m=0;m<n.length;m++){var b=n[m],T=l[b];if(null!=T){var O=this.properties[b],K=O.type,Z=O.groupKey,S=void 0;null!=O.hashOverride?S=O.hashOverride(r,T):null!=T.pfValue&&(S=T.pfValue);var P=null==O.enums?T.value:null,M=null!=S,X=T.units;!K.number||!M&&null==P||K.multiple?g(T.strValue,Z):(f(v(M?S:P),Z),!M&&null!=X&&g(X,Z))}}for(var me=[ql,dc],be=0;be<i.length;be++){var _e=e.styleKeys[i[be]];me[0]=wh(_e[0],me[0]),me[1]=bh(_e[1],me[1])}e.styleKey=function(e,t){return 2097152*e+t}(me[0],me[1]);var Se=e.styleKeys;e.labelDimsKey=Vs(Se.labelDimensions);var je=o(r,["label"],Se.labelDimensions);if(e.labelKey=Vs(je),e.labelStyleKey=Vs(cg(Se.commonLabel,je)),!s){var Xe=o(r,["source-label"],Se.labelDimensions);e.sourceLabelKey=Vs(Xe),e.sourceLabelStyleKey=Vs(cg(Se.commonLabel,Xe));var De=o(r,["target-label"],Se.labelDimensions);e.targetLabelKey=Vs(De),e.targetLabelStyleKey=Vs(cg(Se.commonLabel,De))}if(s){var ze=e.styleKeys,zt=ze.pie,_t=ze.stripe,Ue=[ze.nodeBody,ze.nodeBorder,ze.nodeOutline,ze.backgroundImage,ze.compound,zt,_t].filter(function(He){return null!=He}).reduce(cg,[ql,dc]);e.nodeKey=Vs(Ue),e.hasPie=null!=zt&&zt[0]!==ql&&zt[1]!==dc,e.hasStripe=null!=_t&&_t[0]!==ql&&_t[1]!==dc}return a!==e.styleKey},clearStyleHints:function(r){var e=r._private;e.styleCxtKey="",e.styleKeys={},e.styleKey=null,e.labelKey=null,e.labelStyleKey=null,e.sourceLabelKey=null,e.sourceLabelStyleKey=null,e.targetLabelKey=null,e.targetLabelStyleKey=null,e.nodeKey=null,e.hasPie=null,e.hasStripe=null},applyParsedProperty:function(r,e){var o,t=this,n=e,i=r._private.style,a=t.types,s=t.properties[n.name].type,l=n.bypass,u=i[n.name],c=u&&u.bypass,d=r._private,h="mapping",f=function(lt){return null==lt?null:null!=lt.pfValue?lt.pfValue:lt.value},g=function(){var lt=f(u),yt=f(n);t.checkTriggers(r,n.name,lt,yt)};if("curve-style"===e.name&&r.isEdge()&&("bezier"!==e.value&&r.isLoop()||"haystack"===e.value&&(r.source().isParent()||r.target().isParent()))&&(n=e=this.parse(e.name,"bezier",l)),n.delete)return i[n.name]=void 0,g(),!0;if(n.deleteBypassed)return u?!!u.bypass&&(u.bypassed=void 0,g(),!0):(g(),!0);if(n.deleteBypass)return u?!!u.bypass&&(i[n.name]=u.bypassed,g(),!0):(g(),!0);var y=function(){Qr("Do not assign mappings to elements without corresponding data (i.e. ele `"+r.id()+"` has no mapping for property `"+n.name+"` with data field `"+n.field+"`); try a `["+n.field+"]` selector to limit scope to elements with `"+n.field+"` defined")};switch(n.mapped){case a.mapData:for(var v=n.field.split("."),m=d.data,b=0;b<v.length&&m;b++)m=m[v[b]];if(null==m)return y(),!1;var O;if(!Ut(m))return Qr("Do not use continuous mappers without specifying numeric data (i.e. `"+n.field+": "+m+"` for `"+r.id()+"` is non-numeric)"),!1;var K=n.fieldMax-n.fieldMin;if((O=0===K?0:(m-n.fieldMin)/K)<0?O=0:O>1&&(O=1),s.color){var Z=n.valueMin[0],P=n.valueMin[1],M=n.valueMax[1],q=n.valueMin[2],G=n.valueMax[2],X=null==n.valueMin[3]?1:n.valueMin[3],U=null==n.valueMax[3]?1:n.valueMax[3],me=[Math.round(Z+(n.valueMax[0]-Z)*O),Math.round(P+(M-P)*O),Math.round(q+(G-q)*O),Math.round(X+(U-X)*O)];o={bypass:n.bypass,name:n.name,value:me,strValue:"rgb("+me[0]+", "+me[1]+", "+me[2]+")"}}else{if(!s.number)return!1;o=this.parse(n.name,n.valueMin+(n.valueMax-n.valueMin)*O,n.bypass,h)}if(!o)return y(),!1;o.mapping=n,n=o;break;case a.data:for(var Ae=n.field.split("."),_e=d.data,Se=0;Se<Ae.length&&_e;Se++)_e=_e[Ae[Se]];if(null!=_e&&(o=this.parse(n.name,_e,n.bypass,h)),!o)return y(),!1;o.mapping=n,n=o;break;case a.fn:var De=null!=n.fnValue?n.fnValue:(0,n.value)(r);if(n.prevFnValue=De,null==De)return Qr("Custom function mappers may not return null (i.e. `"+n.name+"` for ele `"+r.id()+"` is null)"),!1;if(!(o=this.parse(n.name,De,n.bypass,h)))return Qr("Custom function mappers may not return invalid values for the property type (i.e. `"+n.name+"` for ele `"+r.id()+"` is invalid)"),!1;o.mapping=Ea(n),n=o;break;case void 0:break;default:return!1}return l?(n.bypassed=c?u.bypassed:u,i[n.name]=n):c?u.bypassed=n:i[n.name]=n,g(),!0},cleanElements:function(r,e){for(var t=0;t<r.length;t++){var n=r[t];if(this.clearStyleHints(n),n.dirtyCompoundBoundsCache(),n.dirtyBoundingBoxCache(),e)for(var i=n._private.style,o=Object.keys(i),a=0;a<o.length;a++){var s=o[a],l=i[s];null!=l&&(l.bypass?l.bypassed=null:i[s]=null)}else n._private.style={}}},update:function(){this._private.cy.mutableElements().updateStyle()},updateTransitions:function(r,e){var t=this,n=r._private,i=r.pstyle("transition-property").value,o=r.pstyle("transition-duration").pfValue,a=r.pstyle("transition-delay").pfValue;if(i.length>0&&o>0){for(var s={},l=!1,u=0;u<i.length;u++){var c=i[u],d=r.pstyle(c),h=e[c];if(h){var g=h.prev,y=null!=h.next?h.next:d,v=!1,m=void 0,b=1e-6;g&&(Ut(g.pfValue)&&Ut(y.pfValue)?m=g.pfValue+b*(v=y.pfValue-g.pfValue):Ut(g.value)&&Ut(y.value)?m=g.value+b*(v=y.value-g.value):un(g.value)&&un(y.value)&&(v=g.value[0]!==y.value[0]||g.value[1]!==y.value[1]||g.value[2]!==y.value[2],m=g.strValue),v&&(s[c]=y.strValue,this.applyBypass(r,c,m),l=!0))}}if(!l)return;n.transitioning=!0,new _c(function(T){a>0?r.delayAnimation(a).play().promise().then(T):T()}).then(function(){return r.animation({style:s,duration:o,easing:r.pstyle("transition-timing-function").value,queue:!1}).play().promise()}).then(function(){t.removeBypasses(r,i),r.emitAndNotify("style"),n.transitioning=!1})}else n.transitioning&&(this.removeBypasses(r,i),r.emitAndNotify("style"),n.transitioning=!1)},checkTrigger:function(r,e,t,n,i,o){var a=this.properties[e],s=i(a);r.removed()||null!=s&&s(t,n,r)&&o(a)},checkZOrderTrigger:function(r,e,t,n){var i=this;this.checkTrigger(r,e,t,n,function(o){return o.triggersZOrder},function(){i._private.cy.notify("zorder",r)})},checkBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBounds},function(i){r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache()})},checkConnectedEdgesBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBoundsOfConnectedEdges},function(i){r.connectedEdges().forEach(function(o){o.dirtyBoundingBoxCache()})})},checkParallelEdgesBoundsTrigger:function(r,e,t,n){this.checkTrigger(r,e,t,n,function(i){return i.triggersBoundsOfParallelEdges},function(i){r.parallelEdges().forEach(function(o){o.dirtyBoundingBoxCache()})})},checkTriggers:function(r,e,t,n){r.dirtyStyleCache(),this.checkZOrderTrigger(r,e,t,n),this.checkBoundsTrigger(r,e,t,n),this.checkConnectedEdgesBoundsTrigger(r,e,t,n),this.checkParallelEdgesBoundsTrigger(r,e,t,n)}},Mh={applyBypass:function(r,e,t,n){var o=[];if("*"===e||"**"===e){if(void 0!==t)for(var s=0;s<this.properties.length;s++){var c=this.parse(this.properties[s].name,t,!0);c&&o.push(c)}}else if(sr(e)){var d=this.parse(e,t,!0);d&&o.push(d)}else{if(!qr(e))return!1;var h=e;n=t;for(var f=Object.keys(h),g=0;g<f.length;g++){var y=f[g],v=h[y];if(void 0===v&&(v=h[ag(y)]),void 0!==v){var m=this.parse(y,v,!0);m&&o.push(m)}}}if(0===o.length)return!1;for(var b=!1,T=0;T<r.length;T++){for(var O=r[T],K={},Z=void 0,S=0;S<o.length;S++){var P=o[S];if(n){var M=O.pstyle(P.name);Z=K[P.name]={prev:M}}b=this.applyParsedProperty(O,Ea(P))||b,n&&(Z.next=O.pstyle(P.name))}b&&this.updateStyleHints(O),n&&this.updateTransitions(O,K,!0)}return b},overrideBypass:function(r,e,t){e=v0(e);for(var n=0;n<r.length;n++){var i=r[n],o=i._private.style[e],a=this.properties[e].type,s=a.color,l=a.mutiple,u=o?null!=o.pfValue?o.pfValue:o.value:null;o&&o.bypass?(o.value=t,null!=o.pfValue&&(o.pfValue=t),o.strValue=s?"rgb("+t.join(",")+")":l?t.join(" "):""+t,this.updateStyleHints(i)):this.applyBypass(i,e,t),this.checkTriggers(i,e,u,t)}},removeAllBypasses:function(r,e){return this.removeBypasses(r,this.propertyNames,e)},removeBypasses:function(r,e,t){for(var i=0;i<r.length;i++){for(var o=r[i],a={},s=0;s<e.length;s++){var l=e[s],u=this.properties[l],c=o.pstyle(u.name);if(c&&c.bypass){var h=this.parse(l,"",!0),f=a[u.name]={prev:c};this.applyParsedProperty(o,h),f.next=o.pstyle(u.name)}}this.updateStyleHints(o),t&&this.updateTransitions(o,a,!0)}}},uT={getEmSizeInPixels:function(){var r=this.containerCss("font-size");return null!=r?parseFloat(r):1},containerCss:function(r){var e=this._private.cy,t=e.container(),n=e.window();if(n&&t&&n.getComputedStyle)return n.getComputedStyle(t).getPropertyValue(r)}},Ta={getRenderedStyle:function(r,e){return e?this.getStylePropertyValue(r,e,!0):this.getRawStyle(r,!0)},getRawStyle:function(r,e){var t=this;if(r=r[0]){for(var n={},i=0;i<t.properties.length;i++){var o=t.properties[i],a=t.getStylePropertyValue(r,o.name,e);null!=a&&(n[o.name]=a,n[ag(o.name)]=a)}return n}},getIndexedStyle:function(r,e,t,n){return r.pstyle(e)[t][n]??r.cy().style().getDefaultProperty(e)[t][0]},getStylePropertyValue:function(r,e,t){if(r=r[0]){var i=this.properties[e];i.alias&&(i=i.pointsTo);var o=i.type,a=r.pstyle(i.name);if(a){var s=a.value,l=a.units,u=a.strValue;if(t&&o.number&&null!=s&&Ut(s)){var c=r.cy().zoom(),d=function(v){return v*c},h=function(v,m){return d(v)+m},f=un(s);return(f?l.every(function(y){return null!=y}):null!=l)?f?s.map(function(y,v){return h(y,l[v])}).join(" "):h(s,l):f?s.map(function(y){return sr(y)?y:""+d(y)}).join(" "):""+d(s)}if(null!=u)return u}return null}},getAnimationStartStyle:function(r,e){for(var t={},n=0;n<e.length;n++){var o=e[n].name,a=r.pstyle(o);void 0!==a&&(a=qr(a)?this.parse(o,a.strValue):this.parse(o,a)),a&&(t[o]=a)}return t},getPropsList:function(r){var t=[],n=r,i=this.properties;if(n)for(var o=Object.keys(n),a=0;a<o.length;a++){var s=o[a],l=n[s],u=i[s]||i[v0(s)],c=this.parse(u.name,l);c&&t.push(c)}return t},getNonDefaultPropertiesHash:function(r,e,t){var o,a,s,l,u,n=t.slice();for(l=0;l<e.length;l++)if(null!=(o=r.pstyle(e[l],!1)))if(null!=o.pfValue)n[0]=wh(s,n[0]),n[1]=bh(s,n[1]);else for(a=o.strValue,u=0;u<a.length;u++)s=a.charCodeAt(u),n[0]=wh(s,n[0]),n[1]=bh(s,n[1]);return n}};Ta.getPropertiesHash=Ta.getNonDefaultPropertiesHash;var qg={appendFromJson:function(r){for(var e=this,t=0;t<r.length;t++){var n=r[t],i=n.selector,o=n.style||n.css,a=Object.keys(o);e.selector(i);for(var s=0;s<a.length;s++){var l=a[s];e.css(l,o[l])}}return e},fromJson:function(r){var e=this;return e.resetToDefault(),e.appendFromJson(r),e},json:function(){for(var r=[],e=this.defaultLength;e<this.length;e++){for(var t=this[e],n=t.selector,i=t.properties,o={},a=0;a<i.length;a++){var s=i[a];o[s.name]=s.strValue}r.push({selector:n?n.toString():"core",style:o})}return r}},cT={appendFromString:function(r){var i,o,a,t=this,n=""+r;function s(){n=n.length>i.length?n.substr(i.length):""}function l(){o=o.length>a.length?o.substr(a.length):""}for(n=n.replace(/[/][*](\s|.)+?[*][/]/g,"");!n.match(/^\s*$/);){var c=n.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!c){Qr("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+n);break}i=c[0];var d=c[1];if("core"!==d&&new js(d).invalid)Qr("Skipping parsing of block: Invalid selector found in string stylesheet: "+d),s();else{var f=c[2],g=!1;o=f;for(var y=[];!o.match(/^\s*$/);){var m=o.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){Qr("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+f),g=!0;break}a=m[0];var b=m[1],T=m[2];this.properties[b]?t.parse(b,T)?(y.push({name:b,val:T}),l()):(Qr("Skipping property: Invalid property definition in: "+a),l()):(Qr("Skipping property: Invalid property name in: "+a),l())}if(g){s();break}t.selector(d);for(var Z=0;Z<y.length;Z++){var S=y[Z];t.css(S.name,S.val)}s()}}return t},fromString:function(r){var e=this;return e.resetToDefault(),e.appendFromString(r),e}},ei={};(function(){var r=ai,e=nG,t=oG,o=function(He){return"^"+He+"\\s*\\(\\s*([\\w\\.]+)\\s*\\)$"},a=function(He){var Ye=r+"|\\w+|"+e+"|"+t+"|\\#[0-9a-fA-F]{3}|\\#[0-9a-fA-F]{6}";return"^"+He+"\\s*\\(([\\w\\.]+)\\s*\\,\\s*("+r+")\\s*\\,\\s*("+r+")\\s*,\\s*("+Ye+")\\s*\\,\\s*("+Ye+")\\)$"},s=["^url\\s*\\(\\s*['\"]?(.+?)['\"]?\\s*\\)$","^(none)$","^(.+)$"];ei.types={time:{number:!0,min:0,units:"s|ms",implicitUnits:"ms"},percent:{number:!0,min:0,max:100,units:"%",implicitUnits:"%"},percentages:{number:!0,min:0,max:100,units:"%",implicitUnits:"%",multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:["parent","origin"]},nodeSize:{number:!0,min:0,enums:["label"]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:["horizontal","leftward","rightward","vertical","upward","downward","auto"]},axisDirectionExplicit:{enums:["leftward","rightward","upward","downward"]},axisDirectionPrimary:{enums:["horizontal","vertical"]},paddingRelativeTo:{enums:["width","height","average","min","max"]},bgWH:{number:!0,min:0,allowPercent:!0,enums:["auto"],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:["inner","include-padding"],multiple:!0},bgRepeat:{enums:["repeat","repeat-x","repeat-y","no-repeat"],multiple:!0},bgFit:{enums:["none","contain","cover"],multiple:!0},bgCrossOrigin:{enums:["anonymous","use-credentials","null"],multiple:!0},bgClip:{enums:["none","node"],multiple:!0},bgContainment:{enums:["inside","over"],multiple:!0},boxSelection:{enums:["contain","overlap","none"]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:["solid","linear-gradient","radial-gradient"]},bool:{enums:["yes","no"]},bools:{enums:["yes","no"],multiple:!0},lineStyle:{enums:["solid","dotted","dashed"]},lineCap:{enums:["butt","round","square"]},linePosition:{enums:["center","inside","outside"]},lineJoin:{enums:["round","bevel","miter"]},borderStyle:{enums:["solid","dotted","dashed","double"]},curveStyle:{enums:["bezier","unbundled-bezier","haystack","segments","straight","straight-triangle","taxi","round-segments","round-taxi"]},radiusType:{enums:["arc-radius","influence-radius"],multiple:!0},fontFamily:{regex:'^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$'},fontStyle:{enums:["italic","normal","oblique"]},fontWeight:{enums:["normal","bold","bolder","lighter","100","200","300","400","500","600","800","900",100,200,300,400,500,600,700,800,900]},textDecoration:{enums:["none","underline","overline","line-through"]},textTransform:{enums:["none","uppercase","lowercase"]},textWrap:{enums:["none","wrap","ellipsis"]},textOverflowWrap:{enums:["whitespace","anywhere"]},textBackgroundShape:{enums:["rectangle","roundrectangle","round-rectangle","circle"]},nodeShape:{enums:["rectangle","roundrectangle","round-rectangle","cutrectangle","cut-rectangle","bottomroundrectangle","bottom-round-rectangle","barrel","ellipse","triangle","round-triangle","square","pentagon","round-pentagon","hexagon","round-hexagon","concavehexagon","concave-hexagon","heptagon","round-heptagon","octagon","round-octagon","tag","round-tag","star","diamond","round-diamond","vee","rhomboid","right-rhomboid","polygon"]},overlayShape:{enums:["roundrectangle","round-rectangle","ellipse"]},cornerRadius:{number:!0,min:0,units:"px|em",implicitUnits:"px",enums:["auto"]},compoundIncludeLabels:{enums:["include","exclude"]},arrowShape:{enums:["tee","triangle","triangle-tee","circle-triangle","triangle-cross","triangle-backcurve","vee","square","circle","diamond","chevron","none"]},arrowFill:{enums:["filled","hollow"]},arrowWidth:{number:!0,units:"%|px|em",implicitUnits:"px",enums:["match-line"]},display:{enums:["element","none"]},visibility:{enums:["hidden","visible"]},zCompoundDepth:{enums:["bottom","orphan","auto","top"]},zIndexCompare:{enums:["auto","manual"]},valign:{enums:["top","center","bottom"]},halign:{enums:["left","center","right"]},justification:{enums:["left","center","right","auto"]},text:{string:!0},data:{mapping:!0,regex:o("data")},layoutData:{mapping:!0,regex:o("layoutData")},scratch:{mapping:!0,regex:o("scratch")},mapData:{mapping:!0,regex:a("mapData")},mapLayoutData:{mapping:!0,regex:a("mapLayoutData")},mapScratch:{mapping:!0,regex:a("mapScratch")},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:"deg|rad",implicitUnits:"rad"},textRotation:{number:!0,units:"deg|rad",implicitUnits:"rad",enums:["none","autorotate"]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:["intersection","node-position","endpoints"]},edgeEndpoint:{number:!0,multiple:!0,units:"%|px|em|deg|rad",implicitUnits:"px",enums:["inside-to-node","outside-to-node","outside-to-node-or-label","outside-to-line","outside-to-line-or-label"],singleEnum:!0,validate:function(He,Ye){switch(He.length){case 2:return"deg"!==Ye[0]&&"rad"!==Ye[0]&&"deg"!==Ye[1]&&"rad"!==Ye[1];case 1:return sr(He[0])||"deg"===Ye[0]||"rad"===Ye[0];default:return!1}}},easing:{regexes:["^(spring)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$","^(cubic-bezier)\\s*\\(\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*,\\s*("+r+")\\s*\\)$"],enums:["linear","ease","ease-in","ease-out","ease-in-out","ease-in-sine","ease-out-sine","ease-in-out-sine","ease-in-quad","ease-out-quad","ease-in-out-quad","ease-in-cubic","ease-out-cubic","ease-in-out-cubic","ease-in-quart","ease-out-quart","ease-in-out-quart","ease-in-quint","ease-out-quint","ease-in-out-quint","ease-in-expo","ease-out-expo","ease-in-out-expo","ease-in-circ","ease-out-circ","ease-in-out-circ"]},gradientDirection:{enums:["to-bottom","to-top","to-left","to-right","to-bottom-right","to-bottom-left","to-top-right","to-top-left","to-right-bottom","to-left-bottom","to-right-top","to-left-top"]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(He){var Ye=He.length;return 1===Ye||2===Ye||4===Ye}}};var l={zeroNonZero:function(He,Ye){return(null==He||null==Ye)&&He!==Ye||0==He&&0!=Ye||0!=He&&0==Ye},any:function(He,Ye){return He!=Ye},emptyNonEmpty:function(He,Ye){var pt=Ms(He),Lt=Ms(Ye);return pt&&!Lt||!pt&&Lt}},u=ei.types,c=[{name:"label",type:u.text,triggersBounds:l.any,triggersZOrder:l.emptyNonEmpty},{name:"text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any}],d=[{name:"source-label",type:u.text,triggersBounds:l.any},{name:"source-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"source-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"source-text-offset",type:u.size,triggersBounds:l.any}],h=[{name:"target-label",type:u.text,triggersBounds:l.any},{name:"target-text-rotation",type:u.textRotation,triggersBounds:l.any},{name:"target-text-margin-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-margin-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"target-text-offset",type:u.size,triggersBounds:l.any}],f=[{name:"font-family",type:u.fontFamily,triggersBounds:l.any},{name:"font-style",type:u.fontStyle,triggersBounds:l.any},{name:"font-weight",type:u.fontWeight,triggersBounds:l.any},{name:"font-size",type:u.size,triggersBounds:l.any},{name:"text-transform",type:u.textTransform,triggersBounds:l.any},{name:"text-wrap",type:u.textWrap,triggersBounds:l.any},{name:"text-overflow-wrap",type:u.textOverflowWrap,triggersBounds:l.any},{name:"text-max-width",type:u.size,triggersBounds:l.any},{name:"text-outline-width",type:u.size,triggersBounds:l.any},{name:"line-height",type:u.positiveNumber,triggersBounds:l.any}],g=[{name:"text-valign",type:u.valign,triggersBounds:l.any},{name:"text-halign",type:u.halign,triggersBounds:l.any},{name:"color",type:u.color},{name:"text-outline-color",type:u.color},{name:"text-outline-opacity",type:u.zeroOneNumber},{name:"text-background-color",type:u.color},{name:"text-background-opacity",type:u.zeroOneNumber},{name:"text-background-padding",type:u.size,triggersBounds:l.any},{name:"text-border-opacity",type:u.zeroOneNumber},{name:"text-border-color",type:u.color},{name:"text-border-width",type:u.size,triggersBounds:l.any},{name:"text-border-style",type:u.borderStyle,triggersBounds:l.any},{name:"text-background-shape",type:u.textBackgroundShape,triggersBounds:l.any},{name:"text-justification",type:u.justification},{name:"box-select-labels",type:u.bool,triggersBounds:l.any}],y=[{name:"events",type:u.bool,triggersZOrder:l.any},{name:"text-events",type:u.bool,triggersZOrder:l.any},{name:"box-selection",type:u.boxSelection,triggersZOrder:l.any}],v=[{name:"display",type:u.display,triggersZOrder:l.any,triggersBounds:l.any,triggersBoundsOfConnectedEdges:l.any,triggersBoundsOfParallelEdges:function(He,Ye,pt){return He!==Ye&&"bezier"===pt.pstyle("curve-style").value}},{name:"visibility",type:u.visibility,triggersZOrder:l.any},{name:"opacity",type:u.zeroOneNumber,triggersZOrder:l.zeroNonZero},{name:"text-opacity",type:u.zeroOneNumber},{name:"min-zoomed-font-size",type:u.size},{name:"z-compound-depth",type:u.zCompoundDepth,triggersZOrder:l.any},{name:"z-index-compare",type:u.zIndexCompare,triggersZOrder:l.any},{name:"z-index",type:u.number,triggersZOrder:l.any}],m=[{name:"overlay-padding",type:u.size,triggersBounds:l.any},{name:"overlay-color",type:u.color},{name:"overlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"overlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"overlay-corner-radius",type:u.cornerRadius}],b=[{name:"underlay-padding",type:u.size,triggersBounds:l.any},{name:"underlay-color",type:u.color},{name:"underlay-opacity",type:u.zeroOneNumber,triggersBounds:l.zeroNonZero},{name:"underlay-shape",type:u.overlayShape,triggersBounds:l.any},{name:"underlay-corner-radius",type:u.cornerRadius}],T=[{name:"transition-property",type:u.propList},{name:"transition-duration",type:u.time},{name:"transition-delay",type:u.time},{name:"transition-timing-function",type:u.easing}],O=function(He,Ye){return"label"===Ye.value?-He.poolIndex():Ye.pfValue},K=[{name:"height",type:u.nodeSize,triggersBounds:l.any,hashOverride:O},{name:"width",type:u.nodeSize,triggersBounds:l.any,hashOverride:O},{name:"shape",type:u.nodeShape,triggersBounds:l.any},{name:"shape-polygon-points",type:u.polygonPointList,triggersBounds:l.any},{name:"corner-radius",type:u.cornerRadius},{name:"background-color",type:u.color},{name:"background-fill",type:u.fill},{name:"background-opacity",type:u.zeroOneNumber},{name:"background-blacken",type:u.nOneOneNumber},{name:"background-gradient-stop-colors",type:u.colors},{name:"background-gradient-stop-positions",type:u.percentages},{name:"background-gradient-direction",type:u.gradientDirection},{name:"padding",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"padding-relative-to",type:u.paddingRelativeTo,triggersBounds:l.any},{name:"bounds-expansion",type:u.boundsExpansion,triggersBounds:l.any}],Z=[{name:"border-color",type:u.color},{name:"border-opacity",type:u.zeroOneNumber},{name:"border-width",type:u.size,triggersBounds:l.any},{name:"border-style",type:u.borderStyle},{name:"border-cap",type:u.lineCap},{name:"border-join",type:u.lineJoin},{name:"border-dash-pattern",type:u.numbers},{name:"border-dash-offset",type:u.number},{name:"border-position",type:u.linePosition}],S=[{name:"outline-color",type:u.color},{name:"outline-opacity",type:u.zeroOneNumber},{name:"outline-width",type:u.size,triggersBounds:l.any},{name:"outline-style",type:u.borderStyle},{name:"outline-offset",type:u.size,triggersBounds:l.any}],P=[{name:"background-image",type:u.urls},{name:"background-image-crossorigin",type:u.bgCrossOrigin},{name:"background-image-opacity",type:u.zeroOneNumbers},{name:"background-image-containment",type:u.bgContainment},{name:"background-image-smoothing",type:u.bools},{name:"background-position-x",type:u.bgPos},{name:"background-position-y",type:u.bgPos},{name:"background-width-relative-to",type:u.bgRelativeTo},{name:"background-height-relative-to",type:u.bgRelativeTo},{name:"background-repeat",type:u.bgRepeat},{name:"background-fit",type:u.bgFit},{name:"background-clip",type:u.bgClip},{name:"background-width",type:u.bgWH},{name:"background-height",type:u.bgWH},{name:"background-offset-x",type:u.bgPos},{name:"background-offset-y",type:u.bgPos}],M=[{name:"position",type:u.position,triggersBounds:l.any},{name:"compound-sizing-wrt-labels",type:u.compoundIncludeLabels,triggersBounds:l.any},{name:"min-width",type:u.size,triggersBounds:l.any},{name:"min-width-bias-left",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-width-bias-right",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height",type:u.size,triggersBounds:l.any},{name:"min-height-bias-top",type:u.sizeMaybePercent,triggersBounds:l.any},{name:"min-height-bias-bottom",type:u.sizeMaybePercent,triggersBounds:l.any}],q=[{name:"line-style",type:u.lineStyle},{name:"line-color",type:u.color},{name:"line-fill",type:u.fill},{name:"line-cap",type:u.lineCap},{name:"line-opacity",type:u.zeroOneNumber},{name:"line-dash-pattern",type:u.numbers},{name:"line-dash-offset",type:u.number},{name:"line-outline-width",type:u.size},{name:"line-outline-color",type:u.color},{name:"line-gradient-stop-colors",type:u.colors},{name:"line-gradient-stop-positions",type:u.percentages},{name:"curve-style",type:u.curveStyle,triggersBounds:l.any,triggersBoundsOfParallelEdges:function(He,Ye){return He!==Ye&&("bezier"===He||"bezier"===Ye)}},{name:"haystack-radius",type:u.zeroOneNumber,triggersBounds:l.any},{name:"source-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"target-endpoint",type:u.edgeEndpoint,triggersBounds:l.any},{name:"control-point-step-size",type:u.size,triggersBounds:l.any},{name:"control-point-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"control-point-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-distances",type:u.bidirectionalSizes,triggersBounds:l.any},{name:"segment-weights",type:u.numbers,triggersBounds:l.any},{name:"segment-radii",type:u.numbers,triggersBounds:l.any},{name:"radius-type",type:u.radiusType,triggersBounds:l.any},{name:"taxi-turn",type:u.bidirectionalSizeMaybePercent,triggersBounds:l.any},{name:"taxi-turn-min-distance",type:u.size,triggersBounds:l.any},{name:"taxi-direction",type:u.axisDirection,triggersBounds:l.any},{name:"taxi-radius",type:u.number,triggersBounds:l.any},{name:"edge-distances",type:u.edgeDistances,triggersBounds:l.any},{name:"arrow-scale",type:u.positiveNumber,triggersBounds:l.any},{name:"loop-direction",type:u.angle,triggersBounds:l.any},{name:"loop-sweep",type:u.angle,triggersBounds:l.any},{name:"source-distance-from-node",type:u.size,triggersBounds:l.any},{name:"target-distance-from-node",type:u.size,triggersBounds:l.any}],G=[{name:"ghost",type:u.bool,triggersBounds:l.any},{name:"ghost-offset-x",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-offset-y",type:u.bidirectionalSize,triggersBounds:l.any},{name:"ghost-opacity",type:u.zeroOneNumber}],X=[{name:"selection-box-color",type:u.color},{name:"selection-box-opacity",type:u.zeroOneNumber},{name:"selection-box-border-color",type:u.color},{name:"selection-box-border-width",type:u.size},{name:"active-bg-color",type:u.color},{name:"active-bg-opacity",type:u.zeroOneNumber},{name:"active-bg-size",type:u.size},{name:"outside-texture-bg-color",type:u.color},{name:"outside-texture-bg-opacity",type:u.zeroOneNumber}],U=[];ei.pieBackgroundN=16,U.push({name:"pie-size",type:u.sizeMaybePercent}),U.push({name:"pie-hole",type:u.sizeMaybePercent}),U.push({name:"pie-start-angle",type:u.angle});for(var me=1;me<=ei.pieBackgroundN;me++)U.push({name:"pie-"+me+"-background-color",type:u.color}),U.push({name:"pie-"+me+"-background-size",type:u.percent}),U.push({name:"pie-"+me+"-background-opacity",type:u.zeroOneNumber});var be=[];ei.stripeBackgroundN=16,be.push({name:"stripe-size",type:u.sizeMaybePercent}),be.push({name:"stripe-direction",type:u.axisDirectionPrimary});for(var Ae=1;Ae<=ei.stripeBackgroundN;Ae++)be.push({name:"stripe-"+Ae+"-background-color",type:u.color}),be.push({name:"stripe-"+Ae+"-background-size",type:u.percent}),be.push({name:"stripe-"+Ae+"-background-opacity",type:u.zeroOneNumber});var _e=[],Se=ei.arrowPrefixes=["source","mid-source","target","mid-target"];[{name:"arrow-shape",type:u.arrowShape,triggersBounds:l.any},{name:"arrow-color",type:u.color},{name:"arrow-fill",type:u.arrowFill},{name:"arrow-width",type:u.arrowWidth}].forEach(function(Ue){Se.forEach(function(He){_e.push({name:He+"-"+Ue.name,type:Ue.type,triggersBounds:Ue.triggersBounds})})},{});var je=ei.properties=[].concat(y,T,v,m,b,G,g,f,c,d,h,K,Z,S,P,U,be,M,q,_e,X),Xe=ei.propertyGroups={behavior:y,transition:T,visibility:v,overlay:m,underlay:b,ghost:G,commonLabel:g,labelDimensions:f,mainLabel:c,sourceLabel:d,targetLabel:h,nodeBody:K,nodeBorder:Z,nodeOutline:S,backgroundImage:P,pie:U,stripe:be,compound:M,edgeLine:q,edgeArrow:_e,core:X},De=ei.propertyGroupNames={};(ei.propertyGroupKeys=Object.keys(Xe)).forEach(function(Ue){De[Ue]=Xe[Ue].map(function(He){return He.name}),Xe[Ue].forEach(function(He){return He.groupKey=Ue})});var lt=ei.aliases=[{name:"content",pointsTo:"label"},{name:"control-point-distance",pointsTo:"control-point-distances"},{name:"control-point-weight",pointsTo:"control-point-weights"},{name:"segment-distance",pointsTo:"segment-distances"},{name:"segment-weight",pointsTo:"segment-weights"},{name:"segment-radius",pointsTo:"segment-radii"},{name:"edge-text-rotation",pointsTo:"text-rotation"},{name:"padding-left",pointsTo:"padding"},{name:"padding-right",pointsTo:"padding"},{name:"padding-top",pointsTo:"padding"},{name:"padding-bottom",pointsTo:"padding"}];ei.propertyNames=je.map(function(Ue){return Ue.name});for(var yt=0;yt<je.length;yt++){var ot=je[yt];je[ot.name]=ot}for(var bt=0;bt<lt.length;bt++){var xt=lt[bt],_t={name:xt.name,alias:!0,pointsTo:je[xt.pointsTo]};je.push(_t),je[xt.name]=_t}})(),ei.getDefaultProperty=function(r){return this.getDefaultProperties()[r]},ei.getDefaultProperties=function(){var r=this._private;if(null!=r.defaultProperties)return r.defaultProperties;for(var e=gr({"selection-box-color":"#ddd","selection-box-opacity":.65,"selection-box-border-color":"#aaa","selection-box-border-width":1,"active-bg-color":"black","active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":"#000","outside-texture-bg-opacity":.125,events:"yes","text-events":"no","text-valign":"top","text-halign":"center","text-justification":"auto","line-height":1,color:"#000","box-selection":"contain","text-outline-color":"#000","text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":"none","text-transform":"none","text-wrap":"none","text-overflow-wrap":"whitespace","text-max-width":9999,"text-background-color":"#000","text-background-opacity":0,"text-background-shape":"rectangle","text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":"solid","text-border-color":"#000","font-family":"Helvetica Neue, Helvetica, sans-serif","font-style":"normal","font-weight":"normal","font-size":16,"min-zoomed-font-size":0,"text-rotation":"none","source-text-rotation":"none","target-text-rotation":"none",visibility:"visible",display:"element",opacity:1,"z-compound-depth":"auto","z-index-compare":"auto","z-index":0,label:"","text-margin-x":0,"text-margin-y":0,"source-label":"","source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":"","target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":"#000","overlay-padding":10,"overlay-shape":"round-rectangle","overlay-corner-radius":"auto","underlay-opacity":0,"underlay-color":"#000","underlay-padding":10,"underlay-shape":"round-rectangle","underlay-corner-radius":"auto","transition-property":"none","transition-duration":0,"transition-delay":0,"transition-timing-function":"linear","box-select-labels":"no","background-blacken":0,"background-color":"#999","background-fill":"solid","background-opacity":1,"background-image":"none","background-image-crossorigin":"anonymous","background-image-opacity":1,"background-image-containment":"inside","background-image-smoothing":"yes","background-position-x":"50%","background-position-y":"50%","background-offset-x":0,"background-offset-y":0,"background-width-relative-to":"include-padding","background-height-relative-to":"include-padding","background-repeat":"no-repeat","background-fit":"none","background-clip":"node","background-width":"auto","background-height":"auto","border-color":"#000","border-opacity":1,"border-width":0,"border-style":"solid","border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":"butt","border-join":"miter","border-position":"center","outline-color":"#999","outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":"solid",height:30,width:30,shape:"ellipse","shape-polygon-points":"-1, -1, 1, -1, 1, 1, -1, 1","corner-radius":"auto","bounds-expansion":0,"background-gradient-direction":"to-bottom","background-gradient-stop-colors":"#999","background-gradient-stop-positions":"0%",ghost:"no","ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":"width",position:"origin","compound-sizing-wrt-labels":"include","min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":"100%","pie-hole":0,"pie-start-angle":"0deg"},[{name:"pie-{{i}}-background-color",value:"black"},{name:"pie-{{i}}-background-size",value:"0%"},{name:"pie-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=ei.pieBackgroundN;c++)l[u.name.replace("{{i}}",c)]=u.value;return l},{}),{"stripe-size":"100%","stripe-direction":"horizontal"},[{name:"stripe-{{i}}-background-color",value:"black"},{name:"stripe-{{i}}-background-size",value:"0%"},{name:"stripe-{{i}}-background-opacity",value:1}].reduce(function(l,u){for(var c=1;c<=ei.stripeBackgroundN;c++)l[u.name.replace("{{i}}",c)]=u.value;return l},{}),{"line-style":"solid","line-color":"#999","line-fill":"solid","line-cap":"butt","line-opacity":1,"line-outline-width":0,"line-outline-color":"#000","line-gradient-stop-colors":"#999","line-gradient-stop-positions":"0%","control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":"arc-radius","taxi-turn":"50%","taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":"auto","edge-distances":"intersection","curve-style":"haystack","haystack-radius":0,"arrow-scale":1,"loop-direction":"-45deg","loop-sweep":"-90deg","source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":"outside-to-node","target-endpoint":"outside-to-node","line-dash-pattern":[6,3],"line-dash-offset":0},[{name:"arrow-shape",value:"none"},{name:"arrow-color",value:"#999"},{name:"arrow-fill",value:"filled"},{name:"arrow-width",value:1}].reduce(function(l,u){return ei.arrowPrefixes.forEach(function(c){l[c+"-"+u.name]=u.value}),l},{})),t={},n=0;n<this.properties.length;n++){var i=this.properties[n];if(!i.pointsTo){var o=i.name,s=this.parse(o,e[o]);t[o]=s}}return r.defaultProperties=t,r.defaultProperties},ei.addDefaultStylesheet=function(){this.selector(":parent").css({shape:"rectangle",padding:10,"background-color":"#eee","border-color":"#ccc","border-width":1}).selector("edge").css({width:3}).selector(":loop").css({"curve-style":"bezier"}).selector("edge:compound").css({"curve-style":"bezier","source-endpoint":"outside-to-line","target-endpoint":"outside-to-line"}).selector(":selected").css({"background-color":"#0169D9","line-color":"#0169D9","source-arrow-color":"#0169D9","target-arrow-color":"#0169D9","mid-source-arrow-color":"#0169D9","mid-target-arrow-color":"#0169D9"}).selector(":parent:selected").css({"background-color":"#CCE1F9","border-color":"#aec8e5"}).selector(":active").css({"overlay-color":"black","overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var jg={parse:function(r,e,t,n){var i=this;if(On(e))return i.parseImplWarn(r,e,t,n);var c,l=kP(r,""+e,t?"t":"f","mapping"===n||!0===n||!1===n||null==n?"dontcare":n),u=i.propCache=i.propCache||[];return(c=u[l])||(c=u[l]=i.parseImplWarn(r,e,t,n)),(t||"mapping"===n)&&(c=Ea(c))&&(c.value=Ea(c.value)),c},parseImplWarn:function(r,e,t,n){var i=this.parseImpl(r,e,t,n);return!i&&null!=e&&Qr("The style property `".concat(r,": ").concat(e,"` is invalid")),i&&("width"===i.name||"height"===i.name)&&"label"===e&&Qr("The style value of `label` is deprecated for `"+i.name+"`"),i},parseImpl:function(r,e,t,n){var i=this;r=v0(r);var o=i.properties[r],a=e,s=i.types;if(!o||void 0===e)return null;o.alias&&(r=(o=o.pointsTo).name);var l=sr(e);l&&(e=e.trim());var c,d,u=o.type;if(!u)return null;if(t&&(""===e||null===e))return{name:r,value:e,bypass:!0,deleteBypass:!0};if(On(e))return{name:r,value:e,strValue:"fn",mapped:s.fn,bypass:t};if(!(!l||n||e.length<7||"a"!==e[1])){if(e.length>=7&&"d"===e[0]&&(c=new RegExp(s.data.regex).exec(e)))return!t&&{name:r,value:c,strValue:""+e,mapped:s.data,field:c[1],bypass:t};if(e.length>=10&&"m"===e[0]&&(d=new RegExp(s.mapData.regex).exec(e))){if(t||u.multiple)return!1;var f=s.mapData;if(!u.color&&!u.number)return!1;var g=this.parse(r,d[4]);if(!g||g.mapped)return!1;var y=this.parse(r,d[5]);if(!y||y.mapped)return!1;if(g.pfValue===y.pfValue||g.strValue===y.strValue)return Qr("`"+r+": "+e+"` is not a valid mapper because the output range is zero; converting to `"+r+": "+g.strValue+"`"),this.parse(r,g.strValue);if(u.color){var v=g.value,m=y.value;if(!(v[0]!==m[0]||v[1]!==m[1]||v[2]!==m[2]||v[3]!==m[3]&&(null!=v[3]&&1!==v[3]||null!=m[3]&&1!==m[3])))return!1}return{name:r,value:d,strValue:""+e,mapped:f,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:g.value,valueMax:y.value,bypass:t}}}if(u.multiple&&"multiple"!==n){var T;if(T=l?e.split(/\s+/):un(e)?e:[e],u.evenMultiple&&T.length%2!=0)return null;for(var O=[],K=[],Z=[],S="",P=!1,M=0;M<T.length;M++){var q=i.parse(r,T[M],t,"multiple");P=P||sr(q.value),O.push(q.value),Z.push(null!=q.pfValue?q.pfValue:q.value),K.push(q.units),S+=(M>0?" ":"")+q.strValue}return u.validate&&!u.validate(O,K)?null:u.singleEnum&&P?1===O.length&&sr(O[0])?{name:r,value:O[0],strValue:O[0],bypass:t}:null:{name:r,value:O,pfValue:Z,strValue:S,bypass:t,units:K}}var G=function(){for(var _t=0;_t<u.enums.length;_t++)if(u.enums[_t]===e)return{name:r,value:e,strValue:""+e,bypass:t};return null};if(u.number){var X,U="px";if(u.units&&(X=u.units),u.implicitUnits&&(U=u.implicitUnits),!u.unitless)if(l){var me="px|em"+(u.allowPercent?"|\\%":"");X&&(me=X);var be=e.match("^("+ai+")("+me+")?$");be&&(e=be[1],X=be[2]||U)}else(!X||u.implicitUnits)&&(X=U);if(e=parseFloat(e),isNaN(e)&&void 0===u.enums)return null;if(isNaN(e)&&void 0!==u.enums)return e=a,G();if(u.integer&&!function(e){return Ut(e)&&Math.floor(e)===e}(e)||void 0!==u.min&&(e<u.min||u.strictMin&&e===u.min)||void 0!==u.max&&(e>u.max||u.strictMax&&e===u.max))return null;var Ae={name:r,value:e,strValue:""+e+(X||""),units:X,bypass:t};return Ae.pfValue=u.unitless||"px"!==X&&"em"!==X?e:"px"!==X&&X?this.getEmSizeInPixels()*e:e,("ms"===X||"s"===X)&&(Ae.pfValue="ms"===X?e:1e3*e),("deg"===X||"rad"===X)&&(Ae.pfValue="rad"===X?e:function(e){return Math.PI*e/180}(e)),"%"===X&&(Ae.pfValue=e/100),Ae}if(u.propList){var _e=[],Se=""+e;if("none"!==Se){for(var je=Se.split(/\s*,\s*|\s+/),Xe=0;Xe<je.length;Xe++){var De=je[Xe].trim();i.properties[De]?_e.push(De):Qr("`"+De+"` is not a valid property name")}if(0===_e.length)return null}return{name:r,value:_e,strValue:0===_e.length?"none":_e.join(" "),bypass:t}}if(u.color){var ze=uP(e);return ze?{name:r,value:ze,pfValue:ze,strValue:"rgb("+ze[0]+","+ze[1]+","+ze[2]+")",bypass:t}:null}if(u.regex||u.regexes){if(u.enums){var lt=G();if(lt)return lt}for(var yt=u.regexes?u.regexes:[u.regex],ot=0;ot<yt.length;ot++){var xt=new RegExp(yt[ot]).exec(e);if(xt)return{name:r,value:u.singleRegexMatchValue?xt[1]:xt,strValue:""+e,bypass:t}}return null}return u.string?{name:r,value:""+e,strValue:""+e,bypass:t}:u.enums?G():null}},vi=function(e){if(!(this instanceof vi))return new vi(e);m0(e)?(this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()):kn("A style must have a core reference")},ji=vi.prototype;ji.instanceString=function(){return"style"},ji.clear=function(){for(var r=this._private,t=r.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,r.contextStyles={},r.propDiffs={},this.cleanElements(t,!0),t.forEach(function(i){var o=i[0]._private;o.styleDirty=!0,o.appliedInitStyle=!1}),this},ji.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},ji.core=function(r){return this._private.coreStyle[r]||this.getDefaultProperty(r)},ji.selector=function(r){var e="core"===r?null:new js(r),t=this.length++;return this[t]={selector:e,properties:[],mappedProperties:[],index:t},this},ji.css=function(){var e=arguments;if(1===e.length)for(var t=e[0],n=0;n<this.properties.length;n++){var i=this.properties[n],o=t[i.name];void 0===o&&(o=t[ag(i.name)]),void 0!==o&&this.cssRule(i.name,o)}else 2===e.length&&this.cssRule(e[0],e[1]);return this},ji.style=ji.css,ji.cssRule=function(r,e){var t=this.parse(r,e);if(t){var n=this.length-1;this[n].properties.push(t),this[n].properties[t.name]=t,t.name.match(/pie-(\d+)-background-size/)&&t.value&&(this._private.hasPie=!0),t.name.match(/stripe-(\d+)-background-size/)&&t.value&&(this._private.hasStripe=!0),t.mapped&&this[n].mappedProperties.push(t),!this[n].selector&&(this._private.coreStyle[t.name]=t)}return this},ji.append=function(r){return oP(r)?r.appendToStyle(this):un(r)?this.appendFromJson(r):sr(r)&&this.appendFromString(r),this},vi.fromJson=function(r,e){var t=new vi(r);return t.fromJson(e),t},vi.fromString=function(r,e){return new vi(r).fromString(e)},[mi,Mh,uT,Ta,qg,cT,ei,jg].forEach(function(r){gr(ji,r)}),vi.types=ji.types,vi.properties=ji.properties,vi.propertyGroups=ji.propertyGroups,vi.propertyGroupNames=ji.propertyGroupNames,vi.propertyGroupKeys=ji.propertyGroupKeys;var c$={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return t.style=oP(e)?e.generateStyle(this):un(e)?vi.fromJson(this,e):sr(e)?vi.fromString(this,e):vi(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},Kl={autolock:function(e){return void 0===e?this._private.autolock:(this._private.autolock=!!e,this)},autoungrabify:function(e){return void 0===e?this._private.autoungrabify:(this._private.autoungrabify=!!e,this)},autounselectify:function(e){return void 0===e?this._private.autounselectify:(this._private.autounselectify=!!e,this)},selectionType:function(e){var t=this._private;return null==t.selectionType&&(t.selectionType="single"),void 0===e?t.selectionType:(("additive"===e||"single"===e)&&(t.selectionType=e),this)},panningEnabled:function(e){return void 0===e?this._private.panningEnabled:(this._private.panningEnabled=!!e,this)},userPanningEnabled:function(e){return void 0===e?this._private.userPanningEnabled:(this._private.userPanningEnabled=!!e,this)},zoomingEnabled:function(e){return void 0===e?this._private.zoomingEnabled:(this._private.zoomingEnabled=!!e,this)},userZoomingEnabled:function(e){return void 0===e?this._private.userZoomingEnabled:(this._private.userZoomingEnabled=!!e,this)},boxSelectionEnabled:function(e){return void 0===e?this._private.boxSelectionEnabled:(this._private.boxSelectionEnabled=!!e,this)},pan:function(){var n,i,o,a,s,e=arguments,t=this._private.pan;switch(e.length){case 0:return t;case 1:if(sr(e[0]))return t[n=e[0]];if(qr(e[0])){if(!this._private.panningEnabled)return this;s=(o=e[0]).y,Ut(a=o.x)&&(t.x=a),Ut(s)&&(t.y=s),this.emit("pan viewport")}break;case 2:if(!this._private.panningEnabled)return this;i=e[1],("x"===(n=e[0])||"y"===n)&&Ut(i)&&(t[n]=i),this.emit("pan viewport")}return this.notify("viewport"),this},panBy:function(e,t){var o,a,s,l,u,n=arguments,i=this._private.pan;if(!this._private.panningEnabled)return this;switch(n.length){case 1:qr(e)&&(u=(s=n[0]).y,Ut(l=s.x)&&(i.x+=l),Ut(u)&&(i.y+=u),this.emit("pan viewport"));break;case 2:a=t,("x"===(o=e)||"y"===o)&&Ut(a)&&(i[o]+=a),this.emit("pan viewport")}return this.notify("viewport"),this},gc:function(){this.notify("gc")},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var i=this._private;i.zoom=n.zoom,i.pan=n.pan,this.emit("pan zoom viewport"),this.notify("viewport")}return this},getFitViewport:function(e,t){var n;if((Ut(e)&&void 0===t&&(t=e,e=void 0),this._private.panningEnabled&&this._private.zoomingEnabled)&&(sr(e)?e=this.$(e):!function(e){return qr(e)&&Ut(e.x1)&&Ut(e.x2)&&Ut(e.y1)&&Ut(e.y2)}(e)?So(e)||(e=this.mutableElements()):((n={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}).w=n.x2-n.x1,n.h=n.y2-n.y1),!So(e)||!e.empty())){n=n||e.boundingBox();var l,a=this.width(),s=this.height();if(t=Ut(t)?t:0,!isNaN(a)&&!isNaN(s)&&a>0&&s>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0)return{zoom:l=(l=(l=Math.min((a-2*t)/n.w,(s-2*t)/n.h))>this._private.maxZoom?this._private.maxZoom:l)<this._private.minZoom?this._private.minZoom:l,pan:{x:(a-l*(n.x1+n.x2))/2,y:(s-l*(n.y1+n.y2))/2}}}},zoomRange:function(e,t){var n=this._private;if(null==t){var i=e;e=i.min,t=i.max}return Ut(e)&&Ut(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):Ut(e)&&void 0===t&&e<=n.maxZoom?n.minZoom=e:Ut(t)&&void 0===e&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return void 0===e?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return void 0===e?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var o,a,t=this._private,n=t.pan,i=t.zoom,s=!1;return t.zoomingEnabled||(s=!0),Ut(e)?a=e:qr(e)&&(a=e.level,null!=e.position?o=pg(e.position,i,n):null!=e.renderedPosition&&(o=e.renderedPosition),null!=o&&!t.panningEnabled&&(s=!0)),a=(a=a>t.maxZoom?t.maxZoom:a)<t.minZoom?t.minZoom:a,!s&&Ut(a)&&a!==i&&(null==o||Ut(o.x)&&Ut(o.y))?null!=o?{zoomed:!0,panned:!0,zoom:a,pan:{x:-a/i*(o.x-n.x)+o.x,y:-a/i*(o.y-n.y)+o.y}}:{zoomed:!0,panned:!1,zoom:a,pan:n}:null},zoom:function(e){if(void 0===e)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return null!=t&&t.zoomed?(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit("zoom"+(t.panned?" pan":"")+" viewport"),this.notify("viewport"),this):this},viewport:function(e){var t=this._private,n=!0,i=!0,o=[],a=!1,s=!1;if(!e)return this;if(Ut(e.zoom)||(n=!1),qr(e.pan)||(i=!1),!n&&!i)return this;if(n){var l=e.zoom;l<t.minZoom||l>t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=l,o.push("zoom"))}if(i&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var u=e.pan;Ut(u.x)&&(t.pan.x=u.x,s=!1),Ut(u.y)&&(t.pan.y=u.y,s=!1),s||o.push("pan")}return o.length>0&&(o.push("viewport"),this.emit(o.join(" ")),this.notify("viewport")),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit("pan viewport"),this.notify("viewport")),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(sr(e)){var n=e;e=this.mutableElements().filter(n)}else So(e)||(e=this.mutableElements());if(0!==e.length){var i=e.boundingBox(),o=this.width(),a=this.height();return{x:(o-(t=void 0===t?this._private.zoom:t)*(i.x1+i.x2))/2,y:(a-t*(i.y1+i.y2))/2}}}},reset:function(){return this._private.panningEnabled&&this._private.zoomingEnabled?(this.viewport({pan:{x:0,y:0},zoom:1}),this):this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var i,o,e=this._private,t=e.container;return e.sizeCache=e.sizeCache||(t?(i=this.window().getComputedStyle(t),{width:t.clientWidth-(o=function(s){return parseFloat(i.getPropertyValue(s))})("padding-left")-o("padding-right"),height:t.clientHeight-o("padding-top")-o("padding-bottom")}):{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),i={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return i.w=i.x2-i.x1,i.h=i.y2-i.y1,i},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){return e?(this._private.multiClickDebounceTime=e,this):this._private.multiClickDebounceTime}};Kl.centre=Kl.center,Kl.autolockNodes=Kl.autolock,Kl.autoungrabifyNodes=Kl.autoungrabify;var Fh={data:Jr.data({field:"data",bindingEvent:"data",allowBinding:!0,allowSetting:!0,settingEvent:"data",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeData:Jr.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0}),scratch:Jr.data({field:"scratch",bindingEvent:"scratch",allowBinding:!0,allowSetting:!0,settingEvent:"scratch",settingTriggersEvent:!0,triggerFnName:"trigger",allowGetting:!0,updateStyle:!0}),removeScratch:Jr.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:!0,updateStyle:!0})};Fh.attr=Fh.data,Fh.removeAttr=Fh.removeData;var Vh=function(e){var t=this,n=(e=gr({},e)).container;n&&!og(n)&&og(n[0])&&(n=n[0]);var i=n?n._cyreg:null;(i=i||{})&&i.cy&&(i.cy.destroy(),i={});var o=i.readies=i.readies||[];n&&(n._cyreg=i),i.cy=t;var a=void 0!==oi&&void 0!==n&&!e.headless,s=e;s.layout=gr({name:a?"grid":"null"},s.layout),s.renderer=gr({name:a?"canvas":"null"},s.renderer);var l=function(g,y,v){return void 0!==y?y:void 0!==v?v:g},u=this._private={container:n,ready:!1,options:s,elements:new ki(this),listeners:[],aniEles:new ki(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(!0,s.zoomingEnabled),userZoomingEnabled:l(!0,s.userZoomingEnabled),panningEnabled:l(!0,s.panningEnabled),userPanningEnabled:l(!0,s.userPanningEnabled),boxSelectionEnabled:l(!0,s.boxSelectionEnabled),autolock:l(!1,s.autolock,s.autolockNodes),autoungrabify:l(!1,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(!1,s.autounselectify),styleEnabled:void 0===s.styleEnabled?a:s.styleEnabled,zoom:Ut(s.zoom)?s.zoom:1,pan:{x:qr(s.pan)&&Ut(s.pan.x)?s.pan.x:0,y:qr(s.pan)&&Ut(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter(),this.selectionType(s.selectionType),this.zoomRange({min:s.minZoom,max:s.maxZoom}),u.styleEnabled&&t.setStyle([]);var d=gr({},s,s.renderer);t.initRenderer(d),function(g,y){if(g.some(eG))return _c.all(g).then(y);y(g)}([s.style,s.elements],function(f){var g=f[0],y=f[1];u.styleEnabled&&t.style().append(g),function(g,y,v){t.notifications(!1);var m=t.mutableElements();m.length>0&&m.remove(),null!=g&&(qr(g)||un(g))&&t.add(g),t.one("layoutready",function(T){t.notifications(!0),t.emit(T),t.one("load",y),t.emitAndNotify("load")}).one("layoutstop",function(){t.one("done",v),t.emit("done")});var b=gr({},t._private.options.layout);b.eles=t.elements(),t.layout(b).run()}(y,function(){t.startAnimationLoop(),u.ready=!0,On(s.ready)&&t.on("ready",s.ready);for(var v=0;v<o.length;v++)t.on("ready",o[v]);i&&(i.readies=[]),t.emit("ready")},s.done)})},$g=Vh.prototype;gr($g,{instanceString:function(){return"core"},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit("ready",[],e):this.on("ready",e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit("destroy"),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(null==this._private.container)return oi;var t=this._private.container.ownerDocument;return void 0===t||null==t?oi:t.defaultView||oi},mount:function(e){if(null!=e){var t=this,n=t._private,i=n.options;return!og(e)&&og(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(gr({},i,i.renderer,{name:"null"===i.renderer.name?"canvas":i.renderer.name})),t.startAnimationLoop(),t.style(i.style),t.emit("mount"),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:"null"}),e.emit("unmount"),e},options:function(){return Ea(this._private.options)},json:function(e){var t=this,n=t._private,i=t.mutableElements();if(qr(e)){if(t.startBatch(),e.elements){var a={},s=function(O,K){for(var Z=[],S=[],P=0;P<O.length;P++){var M=O[P];if(M.data.id){var q=""+M.data.id,G=t.getElementById(q);a[q]=!0,0!==G.length?S.push({ele:G,json:M}):(K&&(M.group=K),Z.push(M))}else Qr("cy.json() cannot handle elements without an ID attribute")}t.add(Z);for(var X=0;X<S.length;X++){var U=S[X];U.ele.json(U.json)}};if(un(e.elements))s(e.elements);else for(var l=["nodes","edges"],u=0;u<l.length;u++){var c=l[u],d=e.elements[c];un(d)&&s(d,c)}var h=t.collection();i.filter(function(T){return!a[T.id()]}).forEach(function(T){T.isParent()?h.merge(T):T.remove()}),h.forEach(function(T){return T.children().move({parent:null})}),h.forEach(function(T){return(O=T,t.getElementById(O.id())).remove();var O})}e.style&&t.style(e.style),null!=e.zoom&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var f=["minZoom","maxZoom","zoomingEnabled","userZoomingEnabled","panningEnabled","userPanningEnabled","boxSelectionEnabled","autolock","autoungrabify","autounselectify","multiClickDebounceTime"],g=0;g<f.length;g++){var y=f[g];null!=e[y]&&t[y](e[y])}return t.endBatch(),this}var m={};e?m.elements=this.elements().map(function(T){return T.json()}):(m.elements={},i.forEach(function(T){var O=T.group();m.elements[O]||(m.elements[O]=[]),m.elements[O].push(T.json())})),this._private.styleEnabled&&(m.style=t.style().json()),m.data=Ea(t.data());var b=n.options;return m.zoomingEnabled=n.zoomingEnabled,m.userZoomingEnabled=n.userZoomingEnabled,m.zoom=n.zoom,m.minZoom=n.minZoom,m.maxZoom=n.maxZoom,m.panningEnabled=n.panningEnabled,m.userPanningEnabled=n.userPanningEnabled,m.pan=Ea(n.pan),m.boxSelectionEnabled=n.boxSelectionEnabled,m.renderer=Ea(b.renderer),m.hideEdgesOnViewport=b.hideEdgesOnViewport,m.textureOnViewport=b.textureOnViewport,m.wheelSensitivity=b.wheelSensitivity,m.motionBlur=b.motionBlur,m.multiClickDebounceTime=b.multiClickDebounceTime,m}}),$g.$id=$g.getElementById,[e$,o$,iN,sT,zg,s$,lT,Gg,c$,Kl,Fh].forEach(function(r){gr($g,r)});var h$={fit:!0,directed:!1,direction:"downward",padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},f$={maximal:!1,acyclic:!1},Sc=function(e){return e.scratch("breadthfirst")},oN=function(e,t){return e.scratch("breadthfirst",t)};function aN(r){this.options=gr({},h$,f$,r)}aN.prototype.run=function(){var u,r=this.options,e=r.cy,t=r.eles,n=t.nodes().filter(function(ar){return ar.isChildless()}),i=t,o=r.directed,a=r.acyclic||r.maximal||r.maximalAdjustments>0,s=!!r.boundingBox,l=eo(s?r.boundingBox:structuredClone(e.extent()));if(So(r.roots))u=r.roots;else if(un(r.roots)){for(var c=[],d=0;d<r.roots.length;d++){var f=e.getElementById(r.roots[d]);c.push(f)}u=e.collection(c)}else if(sr(r.roots))u=e.$(r.roots);else if(o)u=n.roots();else{var g=t.components();u=e.collection();for(var y=function(){var Rt=g[v],Gt=Rt.maxDegree(!1),rr=Rt.filter(function(_r){return _r.degree(!1)===Gt});u=u.add(rr)},v=0;v<g.length;v++)y()}var m=[],b={},T=function(Rt,Gt){null==m[Gt]&&(m[Gt]=[]);var rr=m[Gt].length;m[Gt].push(Rt),oN(Rt,{index:rr,depth:Gt})};i.bfs({roots:u,directed:r.directed,visit:function(Rt,Gt,rr,_r,or){var Ar=Rt[0],Rr=Ar.id();Ar.isChildless()&&T(Ar,or),b[Rr]=!0}});for(var K=[],Z=0;Z<n.length;Z++){var S=n[Z];b[S.id()]||K.push(S)}var P=function(Rt){for(var Gt=m[Rt],rr=0;rr<Gt.length;rr++){var _r=Gt[rr];null!=_r?oN(_r,{depth:Rt,index:rr}):(Gt.splice(rr,1),rr--)}},M=function(Rt,Gt){for(var rr=Sc(Rt),_r=Rt.incomers().filter(function(yr){return yr.isNode()&&t.has(yr)}),or=-1,Ar=Rt.id(),Rr=0;Rr<_r.length;Rr++){var Hr=Sc(_r[Rr]);or=Math.max(or,Hr.depth)}if(rr.depth<=or){if(!r.acyclic&&Gt[Ar])return null;var Gr=or+1;return function(Rt,Gt){var rr=Sc(Rt);m[rr.depth][rr.index]=null,Rt.isChildless()&&T(Rt,Gt)}(Rt,Gr),Gt[Ar]=Gr,!0}return!1};if(o&&a){var q=[],G={},X=function(Rt){return q.push(Rt)},U=function(){return q.shift()};for(n.forEach(function(ar){return q.push(ar)});q.length>0;){var me=U(),be=M(me,G);if(be)me.outgoers().filter(function(ar){return ar.isNode()&&t.has(ar)}).forEach(X);else if(null===be){Qr("Detected double maximal shift for node `"+me.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var Ae=0;if(r.avoidOverlap)for(var _e=0;_e<n.length;_e++){var je=n[_e].layoutDimensions(r);Ae=Math.max(Ae,je.w,je.h)}var ze={},lt=function(Rt){if(ze[Rt.id()])return ze[Rt.id()];for(var Gt=Sc(Rt).depth,rr=Rt.neighborhood(),_r=0,or=0,Ar=0;Ar<rr.length;Ar++){var Rr=rr[Ar];if(!Rr.isEdge()&&!Rr.isParent()&&n.has(Rr)){var $r=Sc(Rr);if(null!=$r){var Hr=$r.index,Gr=$r.depth;null!=Hr&&null!=Gr&&Gr<Gt&&(_r+=Hr/m[Gr].length,or++)}}}return _r/=or=Math.max(1,or),0===or&&(_r=0),ze[Rt.id()]=_r,_r},yt=function(Rt,Gt){var or=lt(Rt)-lt(Gt);return 0===or?lP(Rt.id(),Gt.id()):or};void 0!==r.depthSort&&(yt=r.depthSort);for(var ot=m.length,bt=0;bt<ot;bt++)m[bt].sort(yt),P(bt);for(var xt=[],zt=0;zt<K.length;zt++)xt.push(K[zt]);xt.length&&(m.unshift(xt),ot=m.length,function(){for(var Rt=0;Rt<ot;Rt++)P(Rt)}());for(var Ue=0,He=0;He<ot;He++)Ue=Math.max(m[He].length,Ue);var Ye_x=l.x1+l.w/2,Ye_y=l.y1+l.h/2,pt=n.reduce(function(ar,Rt){return Gt=Rt.boundingBox({includeLabels:r.nodeDimensionsIncludeLabels}),{w:-1===ar.w?Gt.w:(ar.w+Gt.w)/2,h:-1===ar.h?Gt.h:(ar.h+Gt.h)/2};var Gt},{w:-1,h:-1}),Lt=Math.max(1===ot?0:s?(l.h-2*r.padding-pt.h)/(ot-1):(l.h-2*r.padding-pt.h)/(ot+1),Ae),tr=m.reduce(function(ar,Rt){return Math.max(ar,Rt.length)},0),vr={downward:0,leftward:90,upward:180,rightward:-90};return-1===Object.keys(vr).indexOf(r.direction)&&kn("Invalid direction '".concat(r.direction,"' specified for breadthfirst layout. Valid values are: ").concat(Object.keys(vr).join(", "))),t.nodes().layoutPositions(this,r,function(Rt){return function RG(r,e,t){if(0===t)return r;var n=(e.x1+e.x2)/2,i=(e.y1+e.y2)/2,o=e.w/e.h,a=1/o,s=function SG(r,e,t,n,i){var o=i*Math.PI/180;return{x:Math.cos(o)*(r-t)-Math.sin(o)*(e-n)+t,y:Math.sin(o)*(r-t)+Math.cos(o)*(e-n)+n}}(r.x,r.y,n,i,t),l=function(e,t,n,i,o,a){return{x:(e-n)*o+n,y:(t-i)*a+i}}(s.x,s.y,n,i,o,a);return{x:l.x,y:l.y}}(function(Rt){var Gt=Sc(Rt),rr=Gt.depth,_r=Gt.index;if(r.circle){var or=Math.min(l.w/2/ot,l.h/2/ot),Ar=(or=Math.max(or,Ae))*rr+or-(ot>0&&m[0].length<=3?or/2:0),Rr=2*Math.PI/m[rr].length*_r;return 0===rr&&1===m[0].length&&(Ar=1),{x:Ye_x+Ar*Math.cos(Rr),y:Ye_y+Ar*Math.sin(Rr)}}var $r=m[rr].length,Hr=Math.max(1===$r?0:s?(l.w-2*r.padding-pt.w)/((r.grid?tr:$r)-1):(l.w-2*r.padding-pt.w)/((r.grid?tr:$r)+1),Ae);return{x:Ye_x+(_r+1-($r+1)/2)*Hr,y:Ye_y+(rr+1-(ot+1)/2)*Lt}}(Rt),l,vr[r.direction])}),this};var p$={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function sN(r){this.options=gr({},p$,r)}sN.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,i=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,o=n.nodes().not(":parent");e.sort&&(o=o.sort(e.sort));for(var c,a=eo(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()}),s={x:a.x1+a.w/2,y:a.y1+a.h/2},u=(void 0===e.sweep?2*Math.PI-2*Math.PI/o.length:e.sweep)/Math.max(1,o.length-1),d=0,h=0;h<o.length;h++){var g=o[h].layoutDimensions(e);d=Math.max(d,g.w,g.h)}if(c=Ut(e.radius)?e.radius:o.length<=1?0:Math.min(a.h,a.w)/2-d,o.length>1&&e.avoidOverlap){d*=1.75;var m=Math.cos(u)-Math.cos(0),b=Math.sin(u)-Math.sin(0),T=Math.sqrt(d*d/(m*m+b*b));c=Math.max(T,c)}return n.nodes().layoutPositions(this,e,function(Z,S){var P=e.startAngle+S*u*(i?1:-1),M=c*Math.cos(P),q=c*Math.sin(P);return{x:s.x+M,y:s.y+q}}),this};var g$={fit:!0,padding:30,startAngle:1.5*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function lN(r){this.options=gr({},g$,r)}lN.prototype.run=function(){for(var r=this.options,e=r,t=void 0!==e.counterclockwise?!e.counterclockwise:e.clockwise,n=r.cy,i=e.eles,o=i.nodes().not(":parent"),a=eo(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:a.x1+a.w/2,y:a.y1+a.h/2},l=[],u=0,c=0;c<o.length;c++){var h,d=o[c];h=e.concentric(d),l.push({value:h,node:d}),d._private.scratch.concentric=h}o.updateStyle();for(var f=0;f<o.length;f++){var y=o[f].layoutDimensions(e);u=Math.max(u,y.w,y.h)}l.sort(function(Lt,tr){return tr.value-Lt.value});for(var v=e.levelWidth(o),m=[[]],b=m[0],T=0;T<l.length;T++){var O=l[T];b.length>0&&Math.abs(b[0].value-O.value)>=v&&m.push(b=[]),b.push(O)}var Z=u+e.minNodeSpacing;if(!e.avoidOverlap){var S=m.length>0&&m[0].length>1,P=Math.min(a.w,a.h)/2-Z;Z=Math.min(Z,P/(m.length+S?1:0))}for(var q=0,G=0;G<m.length;G++){var X=m[G],U=void 0===e.sweep?2*Math.PI-2*Math.PI/X.length:e.sweep,me=X.dTheta=U/Math.max(1,X.length-1);if(X.length>1&&e.avoidOverlap){var be=Math.cos(me)-Math.cos(0),Ae=Math.sin(me)-Math.sin(0),_e=Math.sqrt(Z*Z/(be*be+Ae*Ae));q=Math.max(_e,q)}X.r=q,q+=Z}if(e.equidistant){for(var Se=0,je=0,Xe=0;Xe<m.length;Xe++)Se=Math.max(Se,m[Xe].r-je);je=0;for(var lt=0;lt<m.length;lt++){var yt=m[lt];0===lt&&(je=yt.r),yt.r=je,je+=Se}}for(var ot={},bt=0;bt<m.length;bt++)for(var xt=m[bt],zt=xt.dTheta,_t=xt.r,Ue=0;Ue<xt.length;Ue++){var He=xt[Ue],Ye=e.startAngle+(t?1:-1)*zt*Ue,pt={x:s.x+_t*Math.cos(Ye),y:s.y+_t*Math.sin(Ye)};ot[He.node.id()]=pt}return i.nodes().layoutPositions(this,e,function(Lt){var tr=Lt.id();return ot[tr]}),this};var dT,m$={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function Hg(r){this.options=gr({},m$,r),this.options.layout=this;var e=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(i){var o=i.source().data("id"),a=i.target().data("id"),s=e.some(function(u){return u.data("id")===o}),l=e.some(function(u){return u.data("id")===a});return!s||!l});this.options.eles=this.options.eles.not(n)}Hg.prototype.run=function(){var r=this.options,e=r.cy,t=this;t.stopped=!1,(!0===r.animate||!1===r.animate)&&t.emit({type:"layoutstart",layout:t}),dT=!0===r.debug;var n=v$(e,t,r);dT&&(void 0)(n),r.randomize&&w$(n);var i=Za(),o=function(){b$(n,e,r),!0===r.fit&&e.fit(r.padding)},a=function(h){return!(t.stopped||h>=r.numIter||(E$(n,r),n.temperature=n.temperature*r.coolingFactor,n.temperature<r.minTemp))},s=function(){if(!0===r.animate||!1===r.animate)o(),t.one("layoutstop",r.stop),t.emit({type:"layoutstop",layout:t});else{var h=r.eles.nodes(),f=cN(n,r,h);h.layoutPositions(t,r,f)}},l=0,u=!0;if(!0===r.animate){var c=function(){for(var h=0;u&&h<r.refresh;)u=a(l),l++,h++;u?(Za()-i>=r.animationThreshold&&o(),ug(c)):(fN(n,r),s())};c()}else{for(;u;)u=a(l),l++;fN(n,r),s()}return this},Hg.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit("layoutstop"),this},Hg.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var v$=function(e,t,n){for(var i=n.eles.edges(),o=n.eles.nodes(),a=eo(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),s={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:o.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:i.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},l=n.eles.components(),u={},c=0;c<l.length;c++)for(var d=l[c],h=0;h<d.length;h++)u[d[h].id()]=c;for(c=0;c<s.nodeSize;c++){var y=(g=o[c]).layoutDimensions(n);(v={}).isLocked=g.locked(),v.id=g.data("id"),v.parentId=g.data("parent"),v.cmptId=u[g.id()],v.children=[],v.positionX=g.position("x"),v.positionY=g.position("y"),v.offsetX=0,v.offsetY=0,v.height=y.w,v.width=y.h,v.maxX=v.positionX+v.width/2,v.minX=v.positionX-v.width/2,v.maxY=v.positionY+v.height/2,v.minY=v.positionY-v.height/2,v.padLeft=parseFloat(g.style("padding")),v.padRight=parseFloat(g.style("padding")),v.padTop=parseFloat(g.style("padding")),v.padBottom=parseFloat(g.style("padding")),v.nodeRepulsion=On(n.nodeRepulsion)?n.nodeRepulsion(g):n.nodeRepulsion,s.layoutNodes.push(v),s.idToIndex[v.id]=c}var m=[],b=0,T=-1,O=[];for(c=0;c<s.nodeSize;c++){var g,K=(g=s.layoutNodes[c]).parentId;null!=K?s.layoutNodes[s.idToIndex[K]].children.push(g.id):(m[++T]=g.id,O.push(g.id))}for(s.graphSet.push(O);b<=T;){var Z=m[b++],P=s.layoutNodes[s.idToIndex[Z]].children;if(P.length>0)for(s.graphSet.push(P),c=0;c<P.length;c++)m[++T]=P[c]}for(c=0;c<s.graphSet.length;c++){var M=s.graphSet[c];for(h=0;h<M.length;h++)s.indexToGraph[s.idToIndex[M[h]]]=c}for(c=0;c<s.edgeSize;c++){var G=i[c],X={};X.id=G.data("id"),X.sourceId=G.data("source"),X.targetId=G.data("target");var U=On(n.idealEdgeLength)?n.idealEdgeLength(G):n.idealEdgeLength,me=On(n.edgeElasticity)?n.edgeElasticity(G):n.edgeElasticity,be=s.idToIndex[X.sourceId],Ae=s.idToIndex[X.targetId];if(s.indexToGraph[be]!=s.indexToGraph[Ae]){for(var je=y$(X.sourceId,X.targetId,s),Xe=s.graphSet[je],De=0,v=s.layoutNodes[be];-1===Xe.indexOf(v.id);)v=s.layoutNodes[s.idToIndex[v.parentId]],De++;for(v=s.layoutNodes[Ae];-1===Xe.indexOf(v.id);)v=s.layoutNodes[s.idToIndex[v.parentId]],De++;U*=De*n.nestingFactor}X.idealLength=U,X.elasticity=me,s.layoutEdges.push(X)}return s},y$=function(e,t,n){var i=uN(e,t,0,n);return 2>i.count?0:i.graph},uN=function(e,t,n,i){var o=i.graphSet[n];if(-1<o.indexOf(e)&&-1<o.indexOf(t))return{count:2,graph:n};for(var a=0,s=0;s<o.length;s++){var c=i.layoutNodes[i.idToIndex[o[s]]].children;if(0!==c.length){var h=uN(e,t,i.indexToGraph[i.idToIndex[c[0]]],i);if(0!==h.count){if(1!==h.count)return h;if(2===++a)break}}}return{count:a,graph:n}},w$=function(e,t){for(var n=e.clientWidth,i=e.clientHeight,o=0;o<e.nodeSize;o++){var a=e.layoutNodes[o];0===a.children.length&&!a.isLocked&&(a.positionX=Math.random()*n,a.positionY=Math.random()*i)}},cN=function(e,t,n){var i=e.boundingBox,o={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(a){var s=e.layoutNodes[e.idToIndex[a.data("id")]];o.x1=Math.min(o.x1,s.positionX),o.x2=Math.max(o.x2,s.positionX),o.y1=Math.min(o.y1,s.positionY),o.y2=Math.max(o.y2,s.positionY)}),o.w=o.x2-o.x1,o.h=o.y2-o.y1),function(a,s){var l=e.layoutNodes[e.idToIndex[a.data("id")]];return t.boundingBox?{x:i.x1+(0===o.w?.5:(l.positionX-o.x1)/o.w)*i.w,y:i.y1+(0===o.h?.5:(l.positionY-o.y1)/o.h)*i.h}:{x:l.positionX,y:l.positionY}}},b$=function(e,t,n){var i=n.layout,o=n.eles.nodes(),a=cN(e,n,o);o.positions(a),!0!==e.ready&&(e.ready=!0,i.one("layoutready",n.ready),i.emit({type:"layoutready",layout:this}))},E$=function(e,t,n){T$(e,t),A$(e),S$(e,t),C$(e),R$(e)},T$=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var i=e.graphSet[n],o=i.length,a=0;a<o;a++)for(var s=e.layoutNodes[e.idToIndex[i[a]]],l=a+1;l<o;l++)I$(s,e.layoutNodes[e.idToIndex[i[l]]],e,t)},dN=function(e){return 2*e*Math.random()-1},I$=function(e,t,n,i){if(e.cmptId===t.cmptId||n.isCompound){var s=t.positionX-e.positionX,l=t.positionY-e.positionY;0===s&&0===l&&(s=dN(1),l=dN(1));var c=x$(e,t,s,l);if(c>0)var f=(d=i.nodeOverlap*c)*s/(h=Math.sqrt(s*s+l*l)),g=d*l/h;else{var d,y=Wg(e,s,l),v=Wg(t,-1*s,-1*l),m=v.x-y.x,b=v.y-y.y,T=m*m+b*b,h=Math.sqrt(T);f=(d=(e.nodeRepulsion+t.nodeRepulsion)/T)*m/h,g=d*b/h}e.isLocked||(e.offsetX-=f,e.offsetY-=g),t.isLocked||(t.offsetX+=f,t.offsetY+=g)}},x$=function(e,t,n,i){if(n>0)var o=e.maxX-t.minX;else o=t.maxX-e.minX;if(i>0)var a=e.maxY-t.minY;else a=t.maxY-e.minY;return o>=0&&a>=0?Math.sqrt(o*o+a*a):0},Wg=function(e,t,n){var i=e.positionX,o=e.positionY,a=e.height||1,s=e.width||1,l=n/t,u=a/s,c={};return 0===t&&0<n||0===t&&0>n?(c.x=i,c.y=o+a/2,c):0<t&&-1*u<=l&&l<=u?(c.x=i+s/2,c.y=o+s*n/2/t,c):0>t&&-1*u<=l&&l<=u?(c.x=i-s/2,c.y=o-s*n/2/t,c):0<n&&(l<=-1*u||l>=u)?(c.x=i+a*t/2/n,c.y=o+a/2,c):(0>n&&(l<=-1*u||l>=u)&&(c.x=i-a*t/2/n,c.y=o-a/2),c)},A$=function(e,t){for(var n=0;n<e.edgeSize;n++){var i=e.layoutEdges[n],a=e.layoutNodes[e.idToIndex[i.sourceId]],l=e.layoutNodes[e.idToIndex[i.targetId]],u=l.positionX-a.positionX,c=l.positionY-a.positionY;if(0!==u||0!==c){var d=Wg(a,u,c),h=Wg(l,-1*u,-1*c),f=h.x-d.x,g=h.y-d.y,y=Math.sqrt(f*f+g*g),v=Math.pow(i.idealLength-y,2)/i.elasticity;if(0!==y)var m=v*f/y,b=v*g/y;else m=0,b=0;a.isLocked||(a.offsetX+=m,a.offsetY+=b),l.isLocked||(l.offsetX-=m,l.offsetY-=b)}}},S$=function(e,t){if(0!==t.gravity)for(var i=0;i<e.graphSet.length;i++){var o=e.graphSet[i],a=o.length;if(0===i)var s=e.clientHeight/2,l=e.clientWidth/2;else{var c=e.layoutNodes[e.idToIndex[e.layoutNodes[e.idToIndex[o[0]]].parentId]];s=c.positionX,l=c.positionY}for(var d=0;d<a;d++){var h=e.layoutNodes[e.idToIndex[o[d]]];if(!h.isLocked){var f=s-h.positionX,g=l-h.positionY,y=Math.sqrt(f*f+g*g);if(y>1){var m=t.gravity*g/y;h.offsetX+=t.gravity*f/y,h.offsetY+=m}}}}},C$=function(e,t){var n=[],i=0,o=-1;for(n.push.apply(n,e.graphSet[0]),o+=e.graphSet[0].length;i<=o;){var a=n[i++],l=e.layoutNodes[e.idToIndex[a]],u=l.children;if(0<u.length&&!l.isLocked){for(var c=l.offsetX,d=l.offsetY,h=0;h<u.length;h++){var f=e.layoutNodes[e.idToIndex[u[h]]];f.offsetX+=c,f.offsetY+=d,n[++o]=u[h]}l.offsetX=0,l.offsetY=0}}},R$=function(e,t){for(var n=0;n<e.nodeSize;n++)0<(i=e.layoutNodes[n]).children.length&&(i.maxX=void 0,i.minX=void 0,i.maxY=void 0,i.minY=void 0);for(n=0;n<e.nodeSize;n++)if(!(0<(i=e.layoutNodes[n]).children.length||i.isLocked)){var o=P$(i.offsetX,i.offsetY,e.temperature);i.positionX+=o.x,i.positionY+=o.y,i.offsetX=0,i.offsetY=0,i.minX=i.positionX-i.width,i.maxX=i.positionX+i.width,i.minY=i.positionY-i.height,i.maxY=i.positionY+i.height,hN(i,e)}for(n=0;n<e.nodeSize;n++){var i;0<(i=e.layoutNodes[n]).children.length&&!i.isLocked&&(i.positionX=(i.maxX+i.minX)/2,i.positionY=(i.maxY+i.minY)/2,i.width=i.maxX-i.minX,i.height=i.maxY-i.minY)}},P$=function(e,t,n){var i=Math.sqrt(e*e+t*t);if(i>n)var o={x:n*e/i,y:n*t/i};else o={x:e,y:t};return o},hN=function(e,t){var n=e.parentId;if(null!=n){var i=t.layoutNodes[t.idToIndex[n]],o=!1;if((null==i.maxX||e.maxX+i.padRight>i.maxX)&&(i.maxX=e.maxX+i.padRight,o=!0),(null==i.minX||e.minX-i.padLeft<i.minX)&&(i.minX=e.minX-i.padLeft,o=!0),(null==i.maxY||e.maxY+i.padBottom>i.maxY)&&(i.maxY=e.maxY+i.padBottom,o=!0),(null==i.minY||e.minY-i.padTop<i.minY)&&(i.minY=e.minY-i.padTop,o=!0),o)return hN(i,t)}},fN=function(e,t){for(var n=e.layoutNodes,i=[],o=0;o<n.length;o++){var a=n[o],s=a.cmptId;(i[s]=i[s]||[]).push(a)}var u=0;for(o=0;o<i.length;o++)if(c=i[o]){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var d=0;d<c.length;d++){var h=c[d];c.x1=Math.min(c.x1,h.positionX-h.width/2),c.x2=Math.max(c.x2,h.positionX+h.width/2),c.y1=Math.min(c.y1,h.positionY-h.height/2),c.y2=Math.max(c.y2,h.positionY+h.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,u+=c.w*c.h}i.sort(function(b,T){return T.w*T.h-b.w*b.h});var f=0,g=0,y=0,v=0,m=Math.sqrt(u)*e.clientWidth/e.clientHeight;for(o=0;o<i.length;o++){var c;if(c=i[o]){for(d=0;d<c.length;d++)(h=c[d]).isLocked||(h.positionX+=f-c.x1,h.positionY+=g-c.y1);f+=c.w+t.componentSpacing,y+=c.w+t.componentSpacing,v=Math.max(v,c.h),y>m&&(g+=v+t.componentSpacing,f=0,y=0,v=0)}}},k$={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function pN(r){this.options=gr({},k$,r)}pN.prototype.run=function(){var r=this.options,e=r,t=r.cy,n=e.eles,i=n.nodes().not(":parent");e.sort&&(i=i.sort(e.sort));var o=eo(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});if(0===o.h||0===o.w)n.nodes().layoutPositions(this,e,function(lt){return{x:o.x1,y:o.y1}});else{var a=i.size(),s=Math.sqrt(a*o.h/o.w),l=Math.round(s),u=Math.round(o.w/o.h*s),c=function(yt){if(null==yt)return Math.min(l,u);Math.min(l,u)==l?l=yt:u=yt},d=function(yt){if(null==yt)return Math.max(l,u);Math.max(l,u)==l?l=yt:u=yt},h=e.rows,f=null!=e.cols?e.cols:e.columns;if(null!=h&&null!=f)l=h,u=f;else if(null!=h&&null==f)l=h,u=Math.ceil(a/l);else if(null==h&&null!=f)u=f,l=Math.ceil(a/u);else if(u*l>a){var g=c(),y=d();(g-1)*y>=a?c(g-1):(y-1)*g>=a&&d(y-1)}else for(;u*l<a;){var v=c(),m=d();(m+1)*v>=a?d(m+1):c(v+1)}var b=o.w/u,T=o.h/l;if(e.condense&&(b=0,T=0),e.avoidOverlap)for(var O=0;O<i.length;O++){var K=i[O],Z=K._private.position;(null==Z.x||null==Z.y)&&(Z.x=0,Z.y=0);var S=K.layoutDimensions(e),P=e.avoidOverlapPadding,q=S.h+P;b=Math.max(b,S.w+P),T=Math.max(T,q)}for(var G={},X=function(yt,ot){return!!G["c-"+yt+"-"+ot]},U=function(yt,ot){G["c-"+yt+"-"+ot]=!0},me=0,be=0,Ae=function(){++be>=u&&(be=0,me++)},_e={},Se=0;Se<i.length;Se++){var je=i[Se],Xe=e.position(je);if(Xe&&(void 0!==Xe.row||void 0!==Xe.col)){var De={row:Xe.row,col:Xe.col};if(void 0===De.col)for(De.col=0;X(De.row,De.col);)De.col++;else if(void 0===De.row)for(De.row=0;X(De.row,De.col);)De.row++;_e[je.id()]=De,U(De.row,De.col)}}i.layoutPositions(this,e,function(yt,ot){var bt,xt;if(yt.locked()||yt.isParent())return!1;var zt=_e[yt.id()];if(zt)bt=zt.col*b+b/2+o.x1,xt=zt.row*T+T/2+o.y1;else{for(;X(me,be);)Ae();bt=be*b+b/2+o.x1,xt=me*T+T/2+o.y1,U(me,be),Ae()}return{x:bt,y:xt}})}return this};var D$={ready:function(){},stop:function(){}};function hT(r){this.options=gr({},D$,r)}hT.prototype.run=function(){var r=this.options,e=r.eles,t=this;return t.emit("layoutstart"),e.nodes().positions(function(){return{x:0,y:0}}),t.one("layoutready",r.ready),t.emit("layoutready"),t.one("layoutstop",r.stop),t.emit("layoutstop"),this},hT.prototype.stop=function(){return this};var N$={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function gN(r){this.options=gr({},N$,r)}gN.prototype.run=function(){var r=this.options,t=r.eles.nodes(),n=On(r.positions);return t.layoutPositions(this,r,function(o,a){var s=function i(o){return null==r.positions?function(e){return{x:e.x,y:e.y}}(o.position()):n?r.positions(o):r.positions[o._private.data.id]??null}(o);return!o.locked()&&null!=s&&s}),this};var L$={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function mN(r){this.options=gr({},L$,r)}mN.prototype.run=function(){var r=this.options,e=r.cy,t=r.eles,n=eo(r.boundingBox?r.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()});return t.nodes().layoutPositions(this,r,function(a,s){return{x:n.x1+Math.round(Math.random()*n.w),y:n.y1+Math.round(Math.random()*n.h)}}),this};var O$=[{name:"breadthfirst",impl:aN},{name:"circle",impl:sN},{name:"concentric",impl:lN},{name:"cose",impl:Hg},{name:"grid",impl:pN},{name:"null",impl:hT},{name:"preset",impl:gN},{name:"random",impl:mN}];function vN(r){this.options=r,this.notifications=0}var yN=function(){},_N=function(){throw new Error("A headless instance can not render images")};vN.prototype={recalculateRenderedStyle:yN,notify:function(){this.notifications++},init:yN,isHeadless:function(){return!0},png:_N,jpg:_N};var fT={arrowShapeWidth:.3,registerArrowShapes:function(){var r=this.arrowShapes={},e=this,t=function(u,c,d,h,f,g,y){return f.x-d/2-y<=u&&u<=f.x+d/2+y&&f.y-d/2-y<=c&&c<=f.y+d/2+y},n=function(u,c,d,h,f){var g=u*Math.cos(h)-c*Math.sin(h),y=u*Math.sin(h)+c*Math.cos(h);return{x:g*d+f.x,y:y*d+f.y}},i=function(u,c,d,h){for(var f=[],g=0;g<u.length;g+=2)f.push(n(u[g],u[g+1],c,d,h));return f},o=function(u){for(var c=[],d=0;d<u.length;d++){var h=u[d];c.push(h.x,h.y)}return c},a=function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").pfValue*2},s=function(u,c){sr(c)&&(c=r[c]),r[u]=gr({name:u,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(h,f,g,y,v,m){var b=o(i(this.points,g+2*m,y,v));return fo(h,f,b)},roughCollide:t,draw:function(h,f,g,y){var v=i(this.points,f,g,y);e.arrowShapeImpl("polygon")(h,v)},spacing:function(h){return 0},gap:a},c)};s("none",{collide:dg,roughCollide:dg,draw:O0,spacing:LP,gap:LP}),s("triangle",{points:[-.15,-.3,0,0,.15,-.3]}),s("arrow","triangle"),s("triangle-backcurve",{points:r.triangle.points,controlPoint:[0,-.15],roughCollide:t,draw:function(u,c,d,h,f){var g=i(this.points,c,d,h),y=this.controlPoint,v=n(y[0],y[1],c,d,h);e.arrowShapeImpl(this.name)(u,g,v)},gap:function(u){return.8*a(u)}}),s("triangle-tee",{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(u,c,d,h,f,g,y){var v=o(i(this.points,d+2*y,h,f)),m=o(i(this.pointsTee,d+2*y,h,f));return fo(u,c,v)||fo(u,c,m)},draw:function(u,c,d,h,f){var g=i(this.points,c,d,h),y=i(this.pointsTee,c,d,h);e.arrowShapeImpl(this.name)(u,g,y)}}),s("circle-triangle",{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(u,c,d,h,f,g,y){var v=f,m=Math.pow(v.x-u,2)+Math.pow(v.y-c,2)<=Math.pow((d+2*y)*this.radius,2),b=o(i(this.points,d+2*y,h,f));return fo(u,c,b)||m},draw:function(u,c,d,h,f){var g=i(this.pointsTr,c,d,h);e.arrowShapeImpl(this.name)(u,g,h.x,h.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("triangle-cross",{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(u,c){var d=this.baseCrossLinePts.slice(),h=c/u;return d[3]=d[3]-h,d[5]=d[5]-h,d},collide:function(u,c,d,h,f,g,y){var v=o(i(this.points,d+2*y,h,f)),m=o(i(this.crossLinePts(d,g),d+2*y,h,f));return fo(u,c,v)||fo(u,c,m)},draw:function(u,c,d,h,f){var g=i(this.points,c,d,h),y=i(this.crossLinePts(c,f),c,d,h);e.arrowShapeImpl(this.name)(u,g,y)}}),s("vee",{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(u){return.525*a(u)}}),s("circle",{radius:.15,collide:function(u,c,d,h,f,g,y){var v=f;return Math.pow(v.x-u,2)+Math.pow(v.y-c,2)<=Math.pow((d+2*y)*this.radius,2)},draw:function(u,c,d,h,f){e.arrowShapeImpl(this.name)(u,h.x,h.y,this.radius*c)},spacing:function(u){return e.getArrowWidth(u.pstyle("width").pfValue,u.pstyle("arrow-scale").value)*this.radius}}),s("tee",{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(u){return 1},gap:function(u){return 1}}),s("square",{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s("diamond",{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(u){return u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}}),s("chevron",{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(u){return.95*u.pstyle("width").pfValue*u.pstyle("arrow-scale").value}})}},Yl={projectIntoViewport:function(r,e){var t=this.cy,n=this.findContainerClientCoords(),i=n[0],o=n[1],a=n[4],s=t.pan(),l=t.zoom();return[((r-i)/a-s.x)/l,((e-o)/a-s.y)/l]},findContainerClientCoords:function(){if(this.containerBB)return this.containerBB;var r=this.container,e=r.getBoundingClientRect(),t=this.cy.window().getComputedStyle(r),n=function(m){return parseFloat(t.getPropertyValue(m))},i_left=n("padding-left"),i_right=n("padding-right"),i_top=n("padding-top"),i_bottom=n("padding-bottom"),o_left=n("border-left-width"),o_right=n("border-right-width"),o_top=n("border-top-width"),a=(n("border-bottom-width"),r.clientWidth);return this.containerBB=[e.left+i_left+o_left,e.top+i_top+o_top,a-(i_left+i_right),r.clientHeight-(i_top+i_bottom),e.width/(a+(o_left+o_right))]},invalidateContainerClientCoordsCache:function(){this.containerBB=null},findNearestElement:function(r,e,t,n){return this.findNearestElements(r,e,t,n)[0]},findNearestElements:function(r,e,t,n){var g,y,i=this,o=this,a=o.getCachedZSortedEles(),s=[],l=o.cy.zoom(),u=o.cy.hasCompoundNodes(),c=(n?24:8)/l,d=(n?8:2)/l,h=(n?8:2)/l,f=1/0;function v(S,P){if(S.isNode()){if(y)return;y=S,s.push(S)}if(S.isEdge()&&(null==P||P<f))if(g){if(g.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value&&g.pstyle("z-compound-depth").value===S.pstyle("z-compound-depth").value)for(var M=0;M<s.length;M++)if(s[M].isEdge()){s[M]=S,g=S,f=P??f;break}}else s.push(S),g=S,f=P??f}function m(S){var P=S.outerWidth()+2*d,M=S.outerHeight()+2*d,q=P/2,G=M/2,X=S.position(),U="auto"===S.pstyle("corner-radius").value?"auto":S.pstyle("corner-radius").pfValue,me=S._private.rscratch;if(X.x-q<=r&&r<=X.x+q&&X.y-G<=e&&e<=X.y+G&&o.nodeShapes[i.getNodeShape(S)].checkPoint(r,e,0,P,M,X.x,X.y,U,me))return v(S,0),!0}function b(S){var be,P=S._private,M=P.rscratch,q=S.pstyle("width").pfValue,G=S.pstyle("arrow-scale").value,X=q/2+c,U=X*X,me=2*X,Se=P.source,je=P.target;if("segments"===M.edgeType||"straight"===M.edgeType||"haystack"===M.edgeType){for(var Ae=M.allpts,_e=0;_e+3<Ae.length;_e+=2)if(gq(r,e,Ae[_e],Ae[_e+1],Ae[_e+2],Ae[_e+3],me)&&U>(be=wq(r,e,Ae[_e],Ae[_e+1],Ae[_e+2],Ae[_e+3])))return v(S,be),!0}else if("bezier"===M.edgeType||"multibezier"===M.edgeType||"self"===M.edgeType||"compound"===M.edgeType)for(Ae=M.allpts,_e=0;_e+5<M.allpts.length;_e+=4)if(mq(r,e,Ae[_e],Ae[_e+1],Ae[_e+2],Ae[_e+3],Ae[_e+4],Ae[_e+5],me)&&U>(be=_q(r,e,Ae[_e],Ae[_e+1],Ae[_e+2],Ae[_e+3],Ae[_e+4],Ae[_e+5])))return v(S,be),!0;Se=Se||P.source,je=je||P.target;var Xe=i.getArrowWidth(q,G),De=[{name:"source",x:M.arrowStartX,y:M.arrowStartY,angle:M.srcArrowAngle},{name:"target",x:M.arrowEndX,y:M.arrowEndY,angle:M.tgtArrowAngle},{name:"mid-source",x:M.midX,y:M.midY,angle:M.midsrcArrowAngle},{name:"mid-target",x:M.midX,y:M.midY,angle:M.midtgtArrowAngle}];for(_e=0;_e<De.length;_e++){var ze=De[_e],lt=o.arrowShapes[S.pstyle(ze.name+"-arrow-shape").value],yt=S.pstyle("width").pfValue;if(lt.roughCollide(r,e,Xe,ze.angle,{x:ze.x,y:ze.y},yt,c)&&lt.collide(r,e,Xe,ze.angle,{x:ze.x,y:ze.y},yt,c))return v(S),!0}u&&s.length>0&&(m(Se),m(je))}function T(S,P,M){return ho(S,P,M)}function O(S,P){var G,M=S._private,q=h;G=P?P+"-":"",S.boundingBox();var X=M.labelBounds[P||"main"],U=S.pstyle(G+"label").value;if("yes"===S.pstyle("text-events").strValue&&U){var be=T(M.rscratch,"labelX",P),Ae=T(M.rscratch,"labelY",P),_e=T(M.rscratch,"labelAngle",P),Se=S.pstyle(G+"text-margin-x").pfValue,je=S.pstyle(G+"text-margin-y").pfValue,Xe=X.x1-q-Se,De=X.x2+q-Se,ze=X.y1-q-je,lt=X.y2+q-je;if(_e){var yt=Math.cos(_e),ot=Math.sin(_e),bt=function(pt,Lt){return{x:(pt-=be)*yt-(Lt-=Ae)*ot+be,y:pt*ot+Lt*yt+Ae}},xt=bt(Xe,ze),zt=bt(Xe,lt),_t=bt(De,ze),Ue=bt(De,lt);if(fo(r,e,[xt.x+Se,xt.y+je,_t.x+Se,_t.y+je,Ue.x+Se,Ue.y+je,zt.x+Se,zt.y+je]))return v(S),!0}else if(Us(X,r,e))return v(S),!0}}t&&(a=a.interactive);for(var K=a.length-1;K>=0;K--){var Z=a[K];Z.isNode()?m(Z)||O(Z):b(Z)||O(Z)||O(Z,"source")||O(Z,"target")}return s},getAllInBox:function(r,e,t,n){var i=this.getCachedZSortedEles().interactive,a=2/this.cy.zoom(),s=[],l=Math.min(r,t),u=Math.max(r,t),c=Math.min(e,n),d=Math.max(e,n),h=eo({x1:r=l,y1:e=c,x2:t=u,y2:n=d}),f=[{x:h.x1,y:h.y1},{x:h.x2,y:h.y1},{x:h.x2,y:h.y2},{x:h.x1,y:h.y2}],g=[[f[0],f[1]],[f[1],f[2]],[f[2],f[3]],[f[3],f[0]]];function y(pt,Lt,tr){return ho(pt,Lt,tr)}function v(pt,Lt){var tr=pt._private,Ur=a;pt.boundingBox();var cr=tr.labelBounds.main;if(!cr)return null;var ar=y(tr.rscratch,"labelX",Lt),Rt=y(tr.rscratch,"labelY",Lt),Gt=y(tr.rscratch,"labelAngle",Lt),rr=pt.pstyle("text-margin-x").pfValue,_r=pt.pstyle("text-margin-y").pfValue,or=cr.x1-Ur-rr,Ar=cr.x2+Ur-rr,Rr=cr.y1-Ur-_r,$r=cr.y2+Ur-_r;if(Gt){var Hr=Math.cos(Gt),Gr=Math.sin(Gt),yr=function(ut,le){return{x:(ut-=ar)*Hr-(le-=Rt)*Gr+ar,y:ut*Gr+le*Hr+Rt}};return[yr(or,Rr),yr(Ar,Rr),yr(Ar,$r),yr(or,$r)]}return[{x:or,y:Rr},{x:Ar,y:Rr},{x:Ar,y:$r},{x:or,y:$r}]}function m(pt,Lt,tr,Ur){function vr(cr,ar,Rt){return(Rt.y-cr.y)*(ar.x-cr.x)>(ar.y-cr.y)*(Rt.x-cr.x)}return vr(pt,tr,Ur)!==vr(Lt,tr,Ur)&&vr(pt,Lt,tr)!==vr(pt,Lt,Ur)}for(var b=0;b<i.length;b++){var T=i[b];if(T.isNode()){var O=T,K="yes"===O.pstyle("text-events").strValue,Z=O.pstyle("box-selection").strValue,S="yes"===O.pstyle("box-select-labels").strValue;if("none"===Z)continue;var M=O.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:("overlap"===Z||S)&&K});if("contain"===Z){var q=!1;if(S&&K){var G=v(O);G&&W0(G,f)&&(s.push(O),q=!0)}!q&&$P(h,M)&&s.push(O)}else if("overlap"===Z&&G0(h,M)){var X=O.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if(W0([{x:X.x1,y:X.y1},{x:X.x2,y:X.y1},{x:X.x2,y:X.y2},{x:X.x1,y:X.y2}],f))s.push(O);else{var me=v(O);me&&W0(me,f)&&s.push(O)}}}else{var be=T,Ae=be._private,_e=Ae.rscratch,Se=be.pstyle("box-selection").strValue;if("none"===Se)continue;if("contain"===Se){if(null!=_e.startX&&null!=_e.startY&&!Us(h,_e.startX,_e.startY)||null!=_e.endX&&null!=_e.endY&&!Us(h,_e.endX,_e.endY))continue;if("bezier"===_e.edgeType||"multibezier"===_e.edgeType||"self"===_e.edgeType||"compound"===_e.edgeType||"segments"===_e.edgeType||"haystack"===_e.edgeType){for(var je=Ae.rstyle.bezierPts||Ae.rstyle.linePts||Ae.rstyle.haystackPts,Xe=!0,De=0;De<je.length;De++)if(!jP(h,je[De])){Xe=!1;break}Xe&&s.push(be)}else"straight"===_e.edgeType&&s.push(be)}else if("overlap"===Se){var ze=!1;if(null!=_e.startX&&null!=_e.startY&&null!=_e.endX&&null!=_e.endY&&(Us(h,_e.startX,_e.startY)||Us(h,_e.endX,_e.endY)))s.push(be),ze=!0;else if(!ze&&"haystack"===_e.edgeType)for(var lt=Ae.rstyle.haystackPts,yt=0;yt<lt.length;yt++)if(jP(h,lt[yt])){s.push(be),ze=!0;break}if(!ze){var ot=Ae.rstyle.bezierPts||Ae.rstyle.linePts||Ae.rstyle.haystackPts;if((!ot||ot.length<2)&&"straight"===_e.edgeType&&null!=_e.startX&&null!=_e.startY&&null!=_e.endX&&null!=_e.endY&&(ot=[{x:_e.startX,y:_e.startY},{x:_e.endX,y:_e.endY}]),!ot||ot.length<2)continue;for(var bt=0;bt<ot.length-1;bt++){for(var xt=ot[bt],zt=ot[bt+1],_t=0;_t<g.length;_t++){var Ue=Zn(g[_t],2);if(m(xt,zt,Ue[0],Ue[1])){s.push(be),ze=!0;break}}if(ze)break}}}}}return s}},Xg={calculateArrowAngles:function(r){var l,u,c,d,h,f,e=r._private.rscratch,t="haystack"===e.edgeType,n="bezier"===e.edgeType,i="multibezier"===e.edgeType,o="segments"===e.edgeType,a="compound"===e.edgeType,s="self"===e.edgeType;t?(c=e.haystackPts[0],d=e.haystackPts[1],h=e.haystackPts[2],f=e.haystackPts[3]):(c=e.arrowStartX,d=e.arrowStartY,h=e.arrowEndX,f=e.arrowEndY),m=e.midX,b=e.midY,o?(l=c-e.segpts[0],u=d-e.segpts[1]):i||a||s||n?(l=c-gi((g=e.allpts)[0],g[2],g[4],.1),u=d-gi(g[1],g[3],g[5],.1)):(l=c-m,u=d-b),e.srcArrowAngle=gg(l,u);var m=e.midX,b=e.midY;if(t&&(m=(c+h)/2,b=(d+f)/2),l=h-c,u=f-d,o)if((g=e.allpts).length/2%2==0)l=g[T=g.length/2]-g[O=T-2],u=g[T+1]-g[O+1];else if(e.isRound)l=e.midVector[1],u=-e.midVector[0];else{var O;l=g[T=g.length/2-1]-g[O=T-2],u=g[T+1]-g[O+1]}else if(i||a||s){var Z,S,P,M,G,q,X,g=e.allpts;e.ctrlpts.length/2%2==0?(Z=gi(g[q=g.length/2-1],g[G=q+2],g[X=G+2],0),S=gi(g[q+1],g[G+1],g[X+1],0),P=gi(g[q],g[G],g[X],1e-4),M=gi(g[q+1],g[G+1],g[X+1],1e-4)):(Z=gi(g[q=(G=g.length/2-1)-2],g[G],g[X=G+2],.4999),S=gi(g[q+1],g[G+1],g[X+1],.4999),P=gi(g[q],g[G],g[X],.5),M=gi(g[q+1],g[G+1],g[X+1],.5)),l=P-Z,u=M-S}if(e.midtgtArrowAngle=gg(l,u),e.midDispX=l,e.midDispY=u,l*=-1,u*=-1,o&&(g=e.allpts).length/2%2!=0&&!e.isRound){var T,U=2+(T=g.length/2-1);l=-(g[U]-g[T]),u=-(g[U+1]-g[T+1])}if(e.midsrcArrowAngle=gg(l,u),o)l=h-e.segpts[e.segpts.length-2],u=f-e.segpts[e.segpts.length-1];else if(i||a||s||n){var me=(g=e.allpts).length;l=h-gi(g[me-6],g[me-4],g[me-2],.9),u=f-gi(g[me-5],g[me-3],g[me-1],.9)}else l=h-m,u=f-b;e.tgtArrowAngle=gg(l,u)}};Xg.getArrowWidth=Xg.getArrowHeight=function(r,e){var t=this.arrowWidthCache=this.arrowWidthCache||{},n=t[r+", "+e];return n||(n=Math.max(Math.pow(13.37*r,.9),29)*e,t[r+", "+e]=n,n)};var pT,gT,bN,Ql,Kg,ns,Jl,Zl,xa,Cc,Yg,EN,TN,mT,vT,IN,Ia={},Uo={},xN=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)};function AN(r,e){0===e.radius?r.lineTo(e.cx,e.cy):r.arc(e.cx,e.cy,e.radius,e.startAngle,e.endAngle,e.counterClockwise)}function yT(r,e,t,n){return 0===n||0===e.radius?{cx:e.x,cy:e.y,radius:0,startX:e.x,startY:e.y,stopX:e.x,stopY:e.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(function(e,t,n,i,o){if(e!==IN?xN(t,e,Ia):function(e,t){t.x=-1*e.x,t.y=-1*e.y,t.nx=-1*e.nx,t.ny=-1*e.ny,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang}(Uo,Ia),xN(t,n,Uo),bN=Ia.nx*Uo.nx-Ia.ny*-Uo.ny,ns=Math.asin(Math.max(-1,Math.min(1,Ia.nx*Uo.ny-Ia.ny*Uo.nx))),Math.abs(ns)<1e-6)return pT=t.x,gT=t.y,void(Zl=Cc=0);Ql=1,Kg=!1,bN<0?ns<0?ns=Math.PI+ns:(ns=Math.PI-ns,Ql=-1,Kg=!0):ns>0&&(Ql=-1,Kg=!0),Cc=void 0!==t.radius?t.radius:i,Jl=ns/2,Yg=Math.min(Ia.len/2,Uo.len/2),o?(xa=Math.abs(Math.cos(Jl)*Cc/Math.sin(Jl)))>Yg?(xa=Yg,Zl=Math.abs(xa*Math.sin(Jl)/Math.cos(Jl))):Zl=Cc:(xa=Math.min(Yg,Cc),Zl=Math.abs(xa*Math.sin(Jl)/Math.cos(Jl))),pT=(mT=t.x+Uo.nx*xa)-Uo.ny*Zl*Ql,gT=(vT=t.y+Uo.ny*xa)+Uo.nx*Zl*Ql,EN=t.x+Ia.nx*xa,TN=t.y+Ia.ny*xa,IN=t}(r,e,t,n,!(arguments.length>4&&void 0!==arguments[4])||arguments[4]),{cx:pT,cy:gT,radius:Zl,startX:EN,startY:TN,stopX:mT,stopY:vT,startAngle:Ia.ang+Math.PI/2*Ql,endAngle:Uo.ang-Math.PI/2*Ql,counterClockwise:Kg})}var V$=Math.sqrt(.02),$i={};function SN(r){var e=[];if(null!=r){for(var t=0;t<r.length;t+=2)e.push({x:r[t],y:r[t+1]});return e}}$i.findMidptPtsEtc=function(r,e){var o,M,q,G,t=e.posPts,n=e.intersectionPts,i=e.vectorNormInverse,a=r.pstyle("source-endpoint"),s=r.pstyle("target-endpoint"),l=null!=a.units&&null!=s.units;switch(r.pstyle("edge-distances").value){case"node-position":o=t;break;case"intersection":o=n;break;case"endpoints":if(l){var h=Zn(this.manualEndptToPx(r.source()[0],a),2),f=h[0],g=h[1],v=Zn(this.manualEndptToPx(r.target()[0],s),2),m=v[0],b=v[1],T={x1:f,y1:g,x2:m,y2:b};q=m-f,i={x:-(M=b-g)/(G=Math.sqrt(q*q+M*M)),y:q/G},o=T}else Qr("Edge ".concat(r.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).")),o=n}return{midptPts:o,vectorNormInverse:i}},$i.findHaystackPoints=function(r){for(var e=0;e<r.length;e++){var t=r[e],n=t._private,i=n.rscratch;if(!i.haystack){var o=2*Math.random()*Math.PI;i.source={x:Math.cos(o),y:Math.sin(o)},o=2*Math.random()*Math.PI,i.target={x:Math.cos(o),y:Math.sin(o)}}var a=n.source,s=n.target,l=a.position(),u=s.position(),c=a.width(),d=s.width(),h=a.height(),f=s.height(),y=t.pstyle("haystack-radius").value/2;i.haystackPts=i.allpts=[i.source.x*c*y+l.x,i.source.y*h*y+l.y,i.target.x*d*y+u.x,i.target.y*f*y+u.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType="haystack",i.haystack=!0,this.storeEdgeProjections(t),this.calculateArrowAngles(t),this.recalculateEdgeLabelProjections(t),this.calculateLabelAngles(t)}},$i.findSegmentsPoints=function(r,e){var t=r._private.rscratch,n=r.pstyle("segment-weights"),i=r.pstyle("segment-distances"),o=r.pstyle("segment-radii"),a=r.pstyle("radius-type"),s=Math.min(n.pfValue.length,i.pfValue.length),l=o.pfValue[o.pfValue.length-1],u=a.pfValue[a.pfValue.length-1];t.edgeType="segments",t.segpts=[],t.radii=[],t.isArcRadius=[];for(var c=0;c<s;c++){var d=n.pfValue[c],h=i.pfValue[c],f=1-d,g=d,y=this.findMidptPtsEtc(r,e),v=y.midptPts,m=y.vectorNormInverse,b={x:v.x1*f+v.x2*g,y:v.y1*f+v.y2*g};t.segpts.push(b.x+m.x*h,b.y+m.y*h),t.radii.push(void 0!==o.pfValue[c]?o.pfValue[c]:l),t.isArcRadius.push("arc-radius"===(void 0!==a.pfValue[c]?a.pfValue[c]:u))}},$i.findLoopPoints=function(r,e,t,n){var i=r._private.rscratch,o=e.dirCounts,a=e.srcPos,s=r.pstyle("control-point-distances"),l=s?s.pfValue[0]:void 0,u=r.pstyle("loop-direction").pfValue,c=r.pstyle("loop-sweep").pfValue,d=r.pstyle("control-point-step-size").pfValue;i.edgeType="self";var h=t,f=d;n&&(h=0,f=l);var g=u-Math.PI/2,y=g-c/2,v=g+c/2,m=u+"_"+c;h=void 0===o[m]?o[m]=0:++o[m],i.ctrlpts=[a.x+1.4*Math.cos(y)*f*(h/3+1),a.y+1.4*Math.sin(y)*f*(h/3+1),a.x+1.4*Math.cos(v)*f*(h/3+1),a.y+1.4*Math.sin(v)*f*(h/3+1)]},$i.findCompoundLoopPoints=function(r,e,t,n){var i=r._private.rscratch;i.edgeType="compound";var o=e.srcPos,a=e.tgtPos,s=e.srcW,l=e.srcH,u=e.tgtW,c=e.tgtH,d=r.pstyle("control-point-step-size").pfValue,h=r.pstyle("control-point-distances"),g=t,y=d;n&&(g=0,y=h?h.pfValue[0]:void 0);var m={x:o.x-s/2,y:o.y-l/2},b={x:a.x-u/2,y:a.y-c/2},T={x:Math.min(m.x,b.x),y:Math.min(m.y,b.y)},K=Math.max(.5,Math.log(.01*s)),Z=Math.max(.5,Math.log(.01*u));i.ctrlpts=[T.x,T.y-(1+Math.pow(50,1.12)/100)*y*(g/3+1)*K,T.x-(1+Math.pow(50,1.12)/100)*y*(g/3+1)*Z,T.y]},$i.findStraightEdgePoints=function(r){r._private.rscratch.edgeType="straight"},$i.findBezierPoints=function(r,e,t,n,i){var o=r._private.rscratch,a=r.pstyle("control-point-step-size").pfValue,s=r.pstyle("control-point-distances"),l=r.pstyle("control-point-weights"),u=s&&l?Math.min(s.value.length,l.value.length):1,c=s?s.pfValue[0]:void 0,d=l.value[0],h=n;o.edgeType=h?"multibezier":"bezier",o.ctrlpts=[];for(var f=0;f<u;f++){var y,g=(.5-e.eles.length/2+t)*a*(i?-1:1),v=z0(g);h&&(c=s?s.pfValue[f]:a,d=l.value[f]);var m=void 0!==(y=n?c:void 0!==c?v*c:void 0)?y:g,b=1-d,T=d,O=this.findMidptPtsEtc(r,e),K=O.midptPts,Z=O.vectorNormInverse,S={x:K.x1*b+K.x2*T,y:K.y1*b+K.y2*T};o.ctrlpts.push(S.x+Z.x*m,S.y+Z.y*m)}},$i.findTaxiPoints=function(r,e){var t=r._private.rscratch;t.edgeType="segments";var n="vertical",i="horizontal",o="leftward",a="rightward",s="downward",l="upward",c=e.posPts,d=e.srcW,h=e.srcH,f=e.tgtW,g=e.tgtH,v="node-position"!==r.pstyle("edge-distances").value,m=r.pstyle("taxi-direction").value,b=m,T=r.pstyle("taxi-turn"),O="%"===T.units,K=T.pfValue,Z=K<0,S=r.pstyle("taxi-turn-min-distance").pfValue,M=v?(h+g)/2:0,q=c.x2-c.x1,G=c.y2-c.y1,X=function(le,$e){return le>0?Math.max(le-$e,0):Math.min(le+$e,0)},U=X(q,v?(d+f)/2:0),me=X(G,M),be=!1;"auto"===b?m=Math.abs(U)>Math.abs(me)?i:n:b===l||b===s?(m=n,be=!0):(b===o||b===a)&&(m=i,be=!0);var De,Ae=m===n,_e=Ae?me:U,Se=Ae?G:q,je=z0(Se),Xe=!1;(!be||!O&&!Z)&&(b===s&&Se<0||b===l&&Se>0||b===o&&Se>0||b===a&&Se<0)&&(_e=(je*=-1)*Math.abs(_e),Xe=!0);var yt=function(le){return Math.abs(le)<S||Math.abs(le)>=Math.abs(_e)},ot=yt(De=O?(K<0?1+K:K)*_e:(K<0?_e:0)+K*je),bt=yt(Math.abs(_e)-Math.abs(De));if(!ot&&!bt||Xe)if(Ae){var or=c.y1+De+(v?h/2*je:0);t.segpts=[c.x1,or,c.x2,or]}else{var $r=c.x1+De+(v?d/2*je:0);t.segpts=[$r,c.y1,$r,c.y2]}else if(Ae){var zt=Math.abs(Se)<=h/2,_t=Math.abs(q)<=f/2;if(zt){var Ue=(c.x1+c.x2)/2;t.segpts=[Ue,c.y1,Ue,c.y2]}else if(_t){var pt=(c.y1+c.y2)/2;t.segpts=[c.x1,pt,c.x2,pt]}else t.segpts=[c.x1,c.y2]}else{var Ur=Math.abs(Se)<=d/2,vr=Math.abs(G)<=g/2;if(Ur){var cr=(c.y1+c.y2)/2;t.segpts=[c.x1,cr,c.x2,cr]}else if(vr){var Gt=(c.x1+c.x2)/2;t.segpts=[Gt,c.y1,Gt,c.y2]}else t.segpts=[c.x2,c.y1]}if(t.isRound){var yr=r.pstyle("taxi-radius").value,Xt="arc-radius"===r.pstyle("radius-type").value[0];t.radii=new Array(t.segpts.length/2).fill(yr),t.isArcRadius=new Array(t.segpts.length/2).fill(Xt)}},$i.tryToCorrectInvalidPoints=function(r,e){var t=r._private.rscratch;if("bezier"===t.edgeType){var n=e.srcPos,i=e.tgtPos,o=e.srcW,a=e.srcH,s=e.tgtW,l=e.tgtH,u=e.srcShape,c=e.tgtShape,d=e.srcCornerRadius,h=e.tgtCornerRadius,f=e.srcRs,g=e.tgtRs,y=!Ut(t.startX)||!Ut(t.startY),v=!Ut(t.arrowStartX)||!Ut(t.arrowStartY),m=!Ut(t.endX)||!Ut(t.endY),b=!Ut(t.arrowEndX)||!Ut(t.arrowEndY),K=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth*3,Z=$l({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.startX,y:t.startY}),S=Z<K,P=$l({x:t.ctrlpts[0],y:t.ctrlpts[1]},{x:t.endX,y:t.endY}),M=P<K,q=!1;if(y||v||S){q=!0;var G={x:t.ctrlpts[0]-n.x,y:t.ctrlpts[1]-n.y},X=Math.sqrt(G.x*G.x+G.y*G.y),U={x:G.x/X,y:G.y/X},me=Math.max(o,a),be={x:t.ctrlpts[0]+2*U.x*me,y:t.ctrlpts[1]+2*U.y*me},Ae=u.intersectLine(n.x,n.y,o,a,be.x,be.y,0,d,f);S?(t.ctrlpts[0]=t.ctrlpts[0]+U.x*(K-Z),t.ctrlpts[1]=t.ctrlpts[1]+U.y*(K-Z)):(t.ctrlpts[0]=Ae[0]+U.x*K,t.ctrlpts[1]=Ae[1]+U.y*K)}if(m||b||M){q=!0;var _e={x:t.ctrlpts[0]-i.x,y:t.ctrlpts[1]-i.y},Se=Math.sqrt(_e.x*_e.x+_e.y*_e.y),je={x:_e.x/Se,y:_e.y/Se},Xe=Math.max(o,a),De={x:t.ctrlpts[0]+2*je.x*Xe,y:t.ctrlpts[1]+2*je.y*Xe},ze=c.intersectLine(i.x,i.y,s,l,De.x,De.y,0,h,g);M?(t.ctrlpts[0]=t.ctrlpts[0]+je.x*(K-P),t.ctrlpts[1]=t.ctrlpts[1]+je.y*(K-P)):(t.ctrlpts[0]=ze[0]+je.x*K,t.ctrlpts[1]=ze[1]+je.y*K)}q&&this.findEndpoints(r)}},$i.storeAllpts=function(r){var e=r._private.rscratch;if("multibezier"===e.edgeType||"bezier"===e.edgeType||"self"===e.edgeType||"compound"===e.edgeType){e.allpts=[],e.allpts.push(e.startX,e.startY);for(var t=0;t+1<e.ctrlpts.length;t+=2)e.allpts.push(e.ctrlpts[t],e.ctrlpts[t+1]),t+3<e.ctrlpts.length&&e.allpts.push((e.ctrlpts[t]+e.ctrlpts[t+2])/2,(e.ctrlpts[t+1]+e.ctrlpts[t+3])/2);var n;e.allpts.push(e.endX,e.endY),e.ctrlpts.length/2%2==0?(e.midX=e.allpts[n=e.allpts.length/2-1],e.midY=e.allpts[n+1]):(e.midX=gi(e.allpts[n=e.allpts.length/2-3],e.allpts[n+2],e.allpts[n+4],.5),e.midY=gi(e.allpts[n+1],e.allpts[n+3],e.allpts[n+5],.5))}else if("straight"===e.edgeType)e.allpts=[e.startX,e.startY,e.endX,e.endY],e.midX=(e.startX+e.endX+e.arrowStartX+e.arrowEndX)/4,e.midY=(e.startY+e.endY+e.arrowStartY+e.arrowEndY)/4;else if("segments"===e.edgeType){if(e.allpts=[],e.allpts.push(e.startX,e.startY),e.allpts.push.apply(e.allpts,e.segpts),e.allpts.push(e.endX,e.endY),e.isRound){e.roundCorners=[];for(var o=2;o+3<e.allpts.length;o+=2){var a=e.radii[o/2-1];e.roundCorners.push(yT({x:e.allpts[o-2],y:e.allpts[o-1]},{x:e.allpts[o],y:e.allpts[o+1],radius:a},{x:e.allpts[o+2],y:e.allpts[o+3]},a,e.isArcRadius[o/2-1]))}}if(e.segpts.length%4==0){var l=e.segpts.length/2,u=l-2;e.midX=(e.segpts[u]+e.segpts[l])/2,e.midY=(e.segpts[u+1]+e.segpts[l+1])/2}else{var c=e.segpts.length/2-1;if(e.isRound){var d={x:e.segpts[c],y:e.segpts[c+1]},h=e.roundCorners[c/2];if(0===h.radius){var f={x:e.segpts[c+2],y:e.segpts[c+3]};e.midX=d.x,e.midY=d.y,e.midVector=[d.y-f.y,f.x-d.x]}else{var g=[d.x-h.cx,d.y-h.cy],y=h.radius/Math.sqrt(Math.pow(g[0],2)+Math.pow(g[1],2));g=g.map(function(v){return v*y}),e.midX=h.cx+g[0],e.midY=h.cy+g[1],e.midVector=g}}else e.midX=e.segpts[c],e.midY=e.segpts[c+1]}}},$i.checkForInvalidEdgeWarning=function(r){var e=r[0]._private.rscratch;e.nodesOverlap||Ut(e.startX)&&Ut(e.startY)&&Ut(e.endX)&&Ut(e.endY)?e.loggedErr=!1:e.loggedErr||(e.loggedErr=!0,Qr("Edge `"+r.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},$i.findEdgeControlPoints=function(r){var e=this;if(r&&0!==r.length){for(var t=this,i=t.cy.hasCompoundNodes(),o=new ts,a=function(M,q){return[].concat(ig(M),[q?1:0]).join("-")},s=[],l=[],u=0;u<r.length;u++){var c=r[u],d=c._private,h=c.pstyle("curve-style").value;if(!c.removed()&&c.takesUpSpace()){if("haystack"===h){l.push(c);continue}var f="unbundled-bezier"===h||Fs(h,"segments")||"straight"===h||"straight-triangle"===h||Fs(h,"taxi"),g="unbundled-bezier"===h||"bezier"===h,v=d.target,T=[d.source.poolIndex(),v.poolIndex()].sort(),O=a(T,f),K=o.get(O);null==K&&(K={eles:[]},s.push({pairId:T,edgeIsUnbundled:f}),o.set(O,K)),K.eles.push(c),f&&(K.hasUnbundled=!0),g&&(K.hasBezier=!0)}}for(var Z=function(){var me,M=s[S],X=a(M.pairId,M.edgeIsUnbundled),U=o.get(X);if(!U.hasUnbundled){var be=U.eles[0].parallelEdges().filter(function(Xt){return Xt.isBundledBezier()});M0(U.eles),be.forEach(function(Xt){return U.eles.push(Xt)}),U.eles.sort(function(Xt,ut){return Xt.poolIndex()-ut.poolIndex()})}var Ae=U.eles[0],_e=Ae.source(),Se=Ae.target();if(_e.poolIndex()>Se.poolIndex()){var je=_e;_e=Se,Se=je}var Xe=U.srcPos=_e.position(),De=U.tgtPos=Se.position(),ze=U.srcW=_e.outerWidth(),lt=U.srcH=_e.outerHeight(),yt=U.tgtW=Se.outerWidth(),ot=U.tgtH=Se.outerHeight(),bt=U.srcShape=t.nodeShapes[e.getNodeShape(_e)],xt=U.tgtShape=t.nodeShapes[e.getNodeShape(Se)],zt=U.srcCornerRadius="auto"===_e.pstyle("corner-radius").value?"auto":_e.pstyle("corner-radius").pfValue,_t=U.tgtCornerRadius="auto"===Se.pstyle("corner-radius").value?"auto":Se.pstyle("corner-radius").pfValue,Ue=U.tgtRs=Se._private.rscratch,He=U.srcRs=_e._private.rscratch;U.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var Ye=0;Ye<U.eles.length;Ye++){var pt=U.eles[Ye],Lt=pt[0]._private.rscratch,tr=pt.pstyle("curve-style").value,Ur="unbundled-bezier"===tr||Fs(tr,"segments")||Fs(tr,"taxi"),vr=!_e.same(pt.source());if(!U.calculatedIntersection&&_e!==Se&&(U.hasBezier||U.hasUnbundled)){U.calculatedIntersection=!0;var cr=bt.intersectLine(Xe.x,Xe.y,ze,lt,De.x,De.y,0,zt,He),ar=U.srcIntn=cr,Rt=xt.intersectLine(De.x,De.y,yt,ot,Xe.x,Xe.y,0,_t,Ue),Gt=U.tgtIntn=Rt,rr=U.intersectionPts={x1:cr[0],x2:Rt[0],y1:cr[1],y2:Rt[1]},_r=U.posPts={x1:Xe.x,x2:De.x,y1:Xe.y,y2:De.y},or=Rt[1]-cr[1],Ar=Rt[0]-cr[0],Rr=Math.sqrt(Ar*Ar+or*or);Ut(Rr)&&Rr>=V$||(Rr=Math.sqrt(Math.max(Ar*Ar,.01)+Math.max(or*or,.01)));var $r=U.vector={x:Ar,y:or},Hr=U.vectorNorm={x:$r.x/Rr,y:$r.y/Rr},Gr={x:-Hr.y,y:Hr.x};U.nodesOverlap=!Ut(Rr)||xt.checkPoint(cr[0],cr[1],0,yt,ot,De.x,De.y,_t,Ue)||bt.checkPoint(Rt[0],Rt[1],0,ze,lt,Xe.x,Xe.y,zt,He),U.vectorNormInverse=Gr,me={nodesOverlap:U.nodesOverlap,dirCounts:U.dirCounts,calculatedIntersection:!0,hasBezier:U.hasBezier,hasUnbundled:U.hasUnbundled,eles:U.eles,srcPos:De,srcRs:Ue,tgtPos:Xe,tgtRs:He,srcW:yt,srcH:ot,tgtW:ze,tgtH:lt,srcIntn:Gt,tgtIntn:ar,srcShape:xt,tgtShape:bt,posPts:{x1:_r.x2,y1:_r.y2,x2:_r.x1,y2:_r.y1},intersectionPts:{x1:rr.x2,y1:rr.y2,x2:rr.x1,y2:rr.y1},vector:{x:-$r.x,y:-$r.y},vectorNorm:{x:-Hr.x,y:-Hr.y},vectorNormInverse:{x:-Gr.x,y:-Gr.y}}}var yr=vr?me:U;Lt.nodesOverlap=yr.nodesOverlap,Lt.srcIntn=yr.srcIntn,Lt.tgtIntn=yr.tgtIntn,Lt.isRound=tr.startsWith("round"),i&&(_e.isParent()||_e.isChild()||Se.isParent()||Se.isChild())&&(_e.parents().anySame(Se)||Se.parents().anySame(_e)||_e.same(Se)&&_e.isParent())?e.findCompoundLoopPoints(pt,yr,Ye,Ur):_e===Se?e.findLoopPoints(pt,yr,Ye,Ur):tr.endsWith("segments")?e.findSegmentsPoints(pt,yr):tr.endsWith("taxi")?e.findTaxiPoints(pt,yr):"straight"===tr||!Ur&&U.eles.length%2==1&&Ye===Math.floor(U.eles.length/2)?e.findStraightEdgePoints(pt):e.findBezierPoints(pt,yr,Ye,Ur,vr),e.findEndpoints(pt),e.tryToCorrectInvalidPoints(pt,yr),e.checkForInvalidEdgeWarning(pt),e.storeAllpts(pt),e.storeEdgeProjections(pt),e.calculateArrowAngles(pt),e.recalculateEdgeLabelProjections(pt),e.calculateLabelAngles(pt)}},S=0;S<s.length;S++)Z();this.findHaystackPoints(l)}},$i.getSegmentPoints=function(r){var e=r[0]._private.rscratch;if(this.recalculateRenderedStyle(r),"segments"===e.edgeType)return SN(e.segpts)},$i.getControlPoints=function(r){var e=r[0]._private.rscratch;this.recalculateRenderedStyle(r);var t=e.edgeType;if("bezier"===t||"multibezier"===t||"self"===t||"compound"===t)return SN(e.ctrlpts)},$i.getEdgeMidpoint=function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),{x:e.midX,y:e.midY}};var Uh={manualEndptToPx:function(r,e){var n=r.position(),i=r.outerWidth(),o=r.outerHeight(),a=r._private.rscratch;if(2===e.value.length){var s=[e.pfValue[0],e.pfValue[1]];return"%"===e.units[0]&&(s[0]=s[0]*i),"%"===e.units[1]&&(s[1]=s[1]*o),s[0]+=n.x,s[1]+=n.y,s}var l=e.pfValue[0];l=-Math.PI/2+l;var u=2*Math.max(i,o),c=[n.x+Math.cos(l)*u,n.y+Math.sin(l)*u];return this.nodeShapes[this.getNodeShape(r)].intersectLine(n.x,n.y,i,o,c[0],c[1],0,"auto"===r.pstyle("corner-radius").value?"auto":r.pstyle("corner-radius").pfValue,a)},findEndpoints:function(r){var e,t,n,i,a,o=this,s=r.source()[0],l=r.target()[0],u=s.position(),c=l.position(),d=r.pstyle("target-arrow-shape").value,h=r.pstyle("source-arrow-shape").value,f=r.pstyle("target-distance-from-node").pfValue,g=r.pstyle("source-distance-from-node").pfValue,y=s._private.rscratch,v=l._private.rscratch,m=r.pstyle("curve-style").value,b=r._private.rscratch,T=b.edgeType,O=Fs(m,"taxi"),K="self"===T||"compound"===T,Z="bezier"===T||"multibezier"===T||K,S="bezier"!==T,P="straight"===T||"segments"===T,M="segments"===T,q=Z||S||P,G=K||O,X=r.pstyle("source-endpoint"),U=G?"outside-to-node":X.value,me="auto"===s.pstyle("corner-radius").value?"auto":s.pstyle("corner-radius").pfValue,be=r.pstyle("target-endpoint"),Ae=G?"outside-to-node":be.value,_e="auto"===l.pstyle("corner-radius").value?"auto":l.pstyle("corner-radius").pfValue;b.srcManEndpt=X,b.tgtManEndpt=be;var Se,je,Xe,De,ze=null!==(e=2===(null==be||null===(t=be.pfValue)||void 0===t?void 0:t.length)?be.pfValue:null)&&void 0!==e?e:[0,0],lt=null!==(n=2===(null==X||null===(i=X.pfValue)||void 0===i?void 0:i.length)?X.pfValue:null)&&void 0!==n?n:[0,0];if(Z){var yt=[b.ctrlpts[0],b.ctrlpts[1]];Se=S?[b.ctrlpts[b.ctrlpts.length-2],b.ctrlpts[b.ctrlpts.length-1]]:yt,je=yt}else if(P){var bt=M?b.segpts.slice(0,2):[c.x+ze[0],c.y+ze[1]];Se=M?b.segpts.slice(b.segpts.length-2):[u.x+lt[0],u.y+lt[1]],je=bt}if("inside-to-node"===Ae)a=[c.x,c.y];else if(be.units)a=this.manualEndptToPx(l,be);else if("outside-to-line"===Ae)a=b.tgtIntn;else if("outside-to-node"===Ae||"outside-to-node-or-label"===Ae?Xe=Se:("outside-to-line"===Ae||"outside-to-line-or-label"===Ae)&&(Xe=[u.x,u.y]),a=o.nodeShapes[this.getNodeShape(l)].intersectLine(c.x,c.y,l.outerWidth(),l.outerHeight(),Xe[0],Xe[1],0,_e,v),"outside-to-node-or-label"===Ae||"outside-to-line-or-label"===Ae){var zt=l._private.rscratch,He=zt.labelX,Ye=zt.labelY,pt=zt.labelWidth/2,Lt=zt.labelHeight/2,tr=l.pstyle("text-valign").value;"top"===tr?Ye-=Lt:"bottom"===tr&&(Ye+=Lt);var Ur=l.pstyle("text-halign").value;"left"===Ur?He-=pt:"right"===Ur&&(He+=pt);var vr=Ah(Xe[0],Xe[1],[He-pt,Ye-Lt,He+pt,Ye-Lt,He+pt,Ye+Lt,He-pt,Ye+Lt],c.x,c.y);if(vr.length>0){var cr=u,ar=Hl(cr,fc(a)),Rt=Hl(cr,fc(vr)),Gt=ar;Rt<ar&&(a=vr,Gt=Rt),vr.length>2&&Hl(cr,{x:vr[2],y:vr[3]})<Gt&&(a=[vr[2],vr[3]])}}var _r=wg(a,Se,o.arrowShapes[d].spacing(r)+f),or=wg(a,Se,o.arrowShapes[d].gap(r)+f);if(b.endX=or[0],b.endY=or[1],b.arrowEndX=_r[0],b.arrowEndY=_r[1],"inside-to-node"===U)a=[u.x,u.y];else if(X.units)a=this.manualEndptToPx(s,X);else if("outside-to-line"===U)a=b.srcIntn;else if("outside-to-node"===U||"outside-to-node-or-label"===U?De=je:("outside-to-line"===U||"outside-to-line-or-label"===U)&&(De=[c.x,c.y]),a=o.nodeShapes[this.getNodeShape(s)].intersectLine(u.x,u.y,s.outerWidth(),s.outerHeight(),De[0],De[1],0,me,y),"outside-to-node-or-label"===U||"outside-to-line-or-label"===U){var Ar=s._private.rscratch,Hr=Ar.labelX,Gr=Ar.labelY,yr=Ar.labelWidth/2,Xt=Ar.labelHeight/2,ut=s.pstyle("text-valign").value;"top"===ut?Gr-=Xt:"bottom"===ut&&(Gr+=Xt);var le=s.pstyle("text-halign").value;"left"===le?Hr-=yr:"right"===le&&(Hr+=yr);var $e=Ah(De[0],De[1],[Hr-yr,Gr-Xt,Hr+yr,Gr-Xt,Hr+yr,Gr+Xt,Hr-yr,Gr+Xt],u.x,u.y);if($e.length>0){var rt=c,nt=Hl(rt,fc(a)),it=Hl(rt,fc($e)),Ht=nt;it<nt&&(a=[$e[0],$e[1]],Ht=it),$e.length>2&&Hl(rt,{x:$e[2],y:$e[3]})<Ht&&(a=[$e[2],$e[3]])}}var Jt=wg(a,je,o.arrowShapes[h].spacing(r)+g),$t=wg(a,je,o.arrowShapes[h].gap(r)+g);b.startX=$t[0],b.startY=$t[1],b.arrowStartX=Jt[0],b.arrowStartY=Jt[1],q&&(b.badLine=!(Ut(b.startX)&&Ut(b.startY)&&Ut(b.endX)&&Ut(b.endY)))},getSourceEndpoint:function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),"haystack"===e.edgeType?{x:e.haystackPts[0],y:e.haystackPts[1]}:{x:e.arrowStartX,y:e.arrowStartY}},getTargetEndpoint:function(r){var e=r[0]._private.rscratch;return this.recalculateRenderedStyle(r),"haystack"===e.edgeType?{x:e.haystackPts[2],y:e.haystackPts[3]}:{x:e.arrowEndX,y:e.arrowEndY}}},_T={};function B$(r,e,t){for(var n=function(u,c,d,h){return gi(u,c,d,h)},o=e._private.rstyle.bezierPts,a=0;a<r.bezierProjPcts.length;a++){var s=r.bezierProjPcts[a];o.push({x:n(t[0],t[2],t[4],s),y:n(t[1],t[3],t[5],s)})}}_T.storeEdgeProjections=function(r){var e=r._private,t=e.rscratch,n=t.edgeType;if(e.rstyle.bezierPts=null,e.rstyle.linePts=null,e.rstyle.haystackPts=null,"multibezier"===n||"bezier"===n||"self"===n||"compound"===n){e.rstyle.bezierPts=[];for(var i=0;i+5<t.allpts.length;i+=4)B$(this,r,t.allpts.slice(i,i+6))}else if("segments"===n){var o=e.rstyle.linePts=[];for(i=0;i+1<t.allpts.length;i+=2)o.push({x:t.allpts[i],y:t.allpts[i+1]})}else if("haystack"===n){var a=t.haystackPts;e.rstyle.haystackPts=[{x:a[0],y:a[1]},{x:a[2],y:a[3]}]}e.rstyle.arrowWidth=this.getArrowWidth(r.pstyle("width").pfValue,r.pstyle("arrow-scale").value)*this.arrowShapeWidth},_T.recalculateEdgeProjections=function(r){this.findEdgeControlPoints(r)};var Aa={recalculateNodeLabelProjection:function(r){var e=r.pstyle("label").strValue;if(!Ms(e)){var t,n,i=r._private,o=r.width(),a=r.height(),s=r.padding(),l=r.position(),u=r.pstyle("text-halign").strValue,c=r.pstyle("text-valign").strValue,d=i.rscratch,h=i.rstyle;switch(u){case"left":t=l.x-o/2-s;break;case"right":t=l.x+o/2+s;break;default:t=l.x}switch(c){case"top":n=l.y-a/2-s;break;case"bottom":n=l.y+a/2+s;break;default:n=l.y}d.labelX=t,d.labelY=n,h.labelX=t,h.labelY=n,this.calculateLabelAngles(r),this.applyLabelDimensions(r)}}},CN=function(e,t){var n=Math.atan(t/e);return 0===e&&n<0&&(n*=-1),n},RN=function(e,t){return CN(t.x-e.x,t.y-e.y)};Aa.recalculateEdgeLabelProjections=function(r){var e,t=r._private,n=t.rscratch,i=this,o={mid:r.pstyle("label").strValue,source:r.pstyle("source-label").strValue,target:r.pstyle("target-label").strValue};if(o.mid||o.source||o.target){var a=function(d,h,f){es(t.rscratch,d,h,f),es(t.rstyle,d,h,f)};a("labelX",null,(e={x:n.midX,y:n.midY}).x),a("labelY",null,e.y);var s=CN(n.midDispX,n.midDispY);a("labelAutoAngle",null,s);var l=function(){if(l.cache)return l.cache;for(var d=[],h=0;h+5<n.allpts.length;h+=4)d.push({p0:{x:n.allpts[h],y:n.allpts[h+1]},p1:{x:n.allpts[h+2],y:n.allpts[h+3]},p2:{x:n.allpts[h+4],y:n.allpts[h+5]},startDist:0,length:0,segments:[]});var v=t.rstyle.bezierPts,m=i.bezierProjPcts.length;function b(S,P,M,q,G){var X=$l(P,M),U=S.segments[S.segments.length-1];S.segments.push({p0:P,p1:M,t0:q,t1:G,startDist:U?U.startDist+U.length:0,length:X}),S.length+=X}for(var T=0;T<d.length;T++){var O=d[T],K=d[T-1];K&&(O.startDist=K.startDist+K.length),b(O,O.p0,v[T*m],0,i.bezierProjPcts[0]);for(var Z=0;Z<m-1;Z++)b(O,v[T*m+Z],v[T*m+Z+1],i.bezierProjPcts[Z],i.bezierProjPcts[Z+1]);b(O,v[T*m+m-1],O.p2,i.bezierProjPcts[m-1],1)}return l.cache=d},u=function(d){var h,f="source"===d;if(o[d]){var g=r.pstyle(d+"-text-offset").pfValue;switch(n.edgeType){case"self":case"compound":case"bezier":case"multibezier":for(var v,y=l(),m=0,b=0,T=0;T<y.length;T++){for(var O=y[f?T:y.length-1-T],K=0;K<O.segments.length;K++){var Z=O.segments[f?K:O.segments.length-1-K];if(m=b,(b+=Z.length)>=g||T===y.length-1&&K===O.segments.length-1){v={cp:O,segment:Z};break}}if(v)break}var P=v.cp,M=v.segment,q=(g-m)/M.length,G=M.t1-M.t0,X=f?M.t0+G*q:M.t1-G*q;X=Ih(0,X,1),e=pc(P.p0,P.p1,P.p2,X),h=function(e,t,n,i){var o=Ih(0,i-.001,1),a=Ih(0,i+.001,1),s=pc(e,t,n,o),l=pc(e,t,n,a);return RN(s,l)}(P.p0,P.p1,P.p2,X);break;case"straight":case"segments":case"haystack":for(var me,be,Ae,_e,U=0,Se=n.allpts.length,je=0;je+3<Se&&(f?(Ae={x:n.allpts[je],y:n.allpts[je+1]},_e={x:n.allpts[je+2],y:n.allpts[je+3]}):(Ae={x:n.allpts[Se-2-je],y:n.allpts[Se-1-je]},_e={x:n.allpts[Se-4-je],y:n.allpts[Se-3-je]}),be=U,!((U+=me=$l(Ae,_e))>=g));je+=2);var De=(g-be)/me;De=Ih(0,De,1),e=function(e,t,n,i){var o_x=t.x-e.x,o_y=t.y-e.y,a=$l(e,t);return n=n??0,{x:e.x+o_x/a*(i=i??n*a),y:e.y+o_y/a*i}}(Ae,_e,De),h=RN(Ae,_e)}a("labelX",d,e.x),a("labelY",d,e.y),a("labelAutoAngle",d,h)}};u("source"),u("target"),this.applyLabelDimensions(r)}},Aa.applyLabelDimensions=function(r){this.applyPrefixedLabelDimensions(r),r.isEdge()&&(this.applyPrefixedLabelDimensions(r,"source"),this.applyPrefixedLabelDimensions(r,"target"))},Aa.applyPrefixedLabelDimensions=function(r,e){var t=r._private,n=this.getLabelText(r,e),i=jl(n,r._private.labelDimsKey);if(ho(t.rscratch,"prefixedLabelDimsKey",e)!==i){es(t.rscratch,"prefixedLabelDimsKey",e,i);var o=this.calculateLabelDimensions(r,n),a=r.pstyle("line-height").pfValue,s=r.pstyle("text-wrap").strValue,l=ho(t.rscratch,"labelWrapCachedLines",e)||[],u="wrap"!==s?1:Math.max(l.length,1),c=o.height/u,d=c*a,h=o.width,f=o.height+(u-1)*(a-1)*c;es(t.rstyle,"labelWidth",e,h),es(t.rscratch,"labelWidth",e,h),es(t.rstyle,"labelHeight",e,f),es(t.rscratch,"labelHeight",e,f),es(t.rscratch,"labelLineHeight",e,d)}},Aa.getLabelText=function(r,e){var t=r._private,i=r.pstyle((e?e+"-":"")+"label").strValue,o=r.pstyle("text-transform").value,a=function(lt,yt){return yt?(es(t.rscratch,lt,e,yt),yt):ho(t.rscratch,lt,e)};if(!i)return"";"none"==o||("uppercase"==o?i=i.toUpperCase():"lowercase"==o&&(i=i.toLowerCase()));var s=r.pstyle("text-wrap").value;if("wrap"===s){var l=a("labelKey");if(null!=l&&a("labelWrapKey")===l)return a("labelWrapCachedText");for(var c=i.split("\n"),d=r.pstyle("text-max-width").pfValue,f="anywhere"===r.pstyle("text-overflow-wrap").value,g=[],y=/[\s\u200b]+|$/g,v=0;v<c.length;v++){var m=c[v],T=this.calculateLabelDimensions(r,m).width;if(f){var O=m.split("").join("\u200b");m=O}if(T>d){var M,Z="",S=0,P=co(m.matchAll(y));try{for(P.s();!(M=P.n()).done;){var q=M.value,G=q[0],X=m.substring(S,q.index);S=q.index+G.length,this.calculateLabelDimensions(r,0===Z.length?X:Z+X+G).width<=d?Z+=X+G:(Z&&g.push(Z),Z=X+G)}}catch(ze){P.e(ze)}finally{P.f()}Z.match(/^[\s\u200b]+$/)||g.push(Z)}else g.push(m)}a("labelWrapCachedLines",g),i=a("labelWrapCachedText",g.join("\n")),a("labelWrapKey",l)}else if("ellipsis"===s){var Ae=r.pstyle("text-max-width").pfValue,_e="",je=!1;if(this.calculateLabelDimensions(r,i).width<Ae)return i;for(var Xe=0;Xe<i.length&&!(this.calculateLabelDimensions(r,_e+i[Xe]+"\u2026").width>Ae);Xe++)_e+=i[Xe],Xe===i.length-1&&(je=!0);return je||(_e+="\u2026"),_e}return i},Aa.getLabelJustification=function(r){var e=r.pstyle("text-justification").strValue,t=r.pstyle("text-halign").strValue;if("auto"!==e)return e;if(!r.isNode())return"center";switch(t){case"left":return"right";case"right":return"left";default:return"center"}},Aa.calculateLabelDimensions=function(r,e){var i=this.cy.window().document,a=r.pstyle("font-style").strValue,s=r.pstyle("font-size").pfValue,l=r.pstyle("font-family").strValue,u=r.pstyle("font-weight").strValue,c=this.labelCalcCanvas,d=this.labelCalcCanvasContext;if(!c){c=this.labelCalcCanvas=i.createElement("canvas"),d=this.labelCalcCanvasContext=c.getContext("2d");var h=c.style;h.position="absolute",h.left="-9999px",h.top="-9999px",h.zIndex="-1",h.visibility="hidden",h.pointerEvents="none"}d.font="".concat(a," ").concat(u," ").concat(s,"px ").concat(l);for(var f=0,g=0,y=e.split("\n"),v=0;v<y.length;v++){var b=d.measureText(y[v]),T=Math.ceil(b.width),O=s;f=Math.max(T,f),g+=O}return{width:f+=0,height:g+=0}},Aa.calculateLabelAngle=function(r,e){var n=r._private.rscratch,i=r.isEdge(),a=r.pstyle((e?e+"-":"")+"text-rotation"),s=a.strValue;return"none"===s?0:i&&"autorotate"===s?n.labelAutoAngle:"autorotate"===s?0:a.pfValue},Aa.calculateLabelAngles=function(r){var e=this,t=r.isEdge(),i=r._private.rscratch;i.labelAngle=e.calculateLabelAngle(r),t&&(i.sourceLabelAngle=e.calculateLabelAngle(r,"source"),i.targetLabelAngle=e.calculateLabelAngle(r,"target"))};var PN={},DN=!1;PN.getNodeShape=function(r){var t=r.pstyle("shape").value;if("cutrectangle"===t&&(r.width()<28||r.height()<28))return DN||(Qr("The `cutrectangle` node shape can not be used at small sizes so `rectangle` is used instead"),DN=!0),"rectangle";if(r.isParent())return"rectangle"===t||"roundrectangle"===t||"round-rectangle"===t||"cutrectangle"===t||"cut-rectangle"===t||"barrel"===t?t:"rectangle";if("polygon"===t){var n=r.pstyle("shape-polygon-points").value;return this.nodeShapes.makePolygon(n).name}return t};var Jg={updateCachedGrabbedEles:function(){var r=this.cachedZSortedEles;if(r){r.drag=[],r.nondrag=[];for(var e=[],t=0;t<r.length;t++){var i=(n=r[t])._private.rscratch;n.grabbed()&&!n.isParent()?e.push(n):i.inDragLayer?r.drag.push(n):r.nondrag.push(n)}for(t=0;t<e.length;t++){var n;r.drag.push(n=e[t])}}},invalidateCachedZSortedEles:function(){this.cachedZSortedEles=null},getCachedZSortedEles:function(r){if(r||!this.cachedZSortedEles){var e=this.cy.mutableElements().toArray();e.sort(HD),e.interactive=e.filter(function(t){return t.interactive()}),this.cachedZSortedEles=e,this.updateCachedGrabbedEles()}else e=this.cachedZSortedEles;return e}},NN={};[Yl,Xg,$i,Uh,_T,Aa,PN,{registerCalculationListeners:function(){var r=this.cy,e=r.collection(),t=this,n=function(a){var s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.merge(a),s)for(var l=0;l<a.length;l++){var d=a[l]._private.rstyle;d.clean=!1,d.cleanConnected=!1}};t.binder(r).on("bounds.* dirty.*",function(a){n(a.target)}).on("style.* background.*",function(a){n(a.target,!1)});var i=function(a){if(a){var s=t.onUpdateEleCalcsFns;e.cleanStyle();for(var l=0;l<e.length;l++){var u=e[l],c=u._private.rstyle;u.isNode()&&!c.cleanConnected&&(n(u.connectedEdges()),c.cleanConnected=!0)}if(s)for(var d=0;d<s.length;d++)(0,s[d])(a,e);t.recalculateRenderedStyle(e),e=r.collection()}};t.flushRenderedStyleQueue=function(){i(!0)},t.beforeRender(i,t.beforeRenderPriorities.eleCalcs)},onUpdateEleCalcs:function(r){(this.onUpdateEleCalcsFns=this.onUpdateEleCalcsFns||[]).push(r)},recalculateRenderedStyle:function(r,e){var t=function(O){return O._private.rstyle.cleanConnected};if(0!==r.length){var n=[],i=[];if(!this.destroyed){void 0===e&&(e=!0);for(var o=0;o<r.length;o++){var a=r[o],s=a._private,l=s.rstyle;a.isEdge()&&(!t(a.source())||!t(a.target()))&&(l.clean=!1),a.isEdge()&&a.isBundledBezier()&&a.parallelEdges().some(function(T){return!T._private.rstyle.clean&&T.isBundledBezier()})&&(l.clean=!1),!(e&&l.clean||a.removed())&&"none"!==a.pstyle("display").value&&("nodes"===s.group?i.push(a):n.push(a),l.clean=!0)}for(var u=0;u<i.length;u++){var c=i[u],h=c._private.rstyle,f=c.position();this.recalculateNodeLabelProjection(c),h.nodeX=f.x,h.nodeY=f.y,h.nodeW=c.pstyle("width").pfValue,h.nodeH=c.pstyle("height").pfValue}this.recalculateEdgeProjections(n);for(var g=0;g<n.length;g++){var v=n[g]._private,m=v.rstyle,b=v.rscratch;m.srcX=b.arrowStartX,m.srcY=b.arrowStartY,m.tgtX=b.arrowEndX,m.tgtY=b.arrowEndY,m.midX=b.midX,m.midY=b.midY,m.labelAngle=b.labelAngle,m.sourceLabelAngle=b.sourceLabelAngle,m.targetLabelAngle=b.targetLabelAngle}}}}},Jg].forEach(function(r){gr(NN,r)});var LN={getCachedImage:function(r,e,t){var i=this.imageCache=this.imageCache||{},o=i[r];if(o)return o.image.complete||o.image.addEventListener("load",t),o.image;var a=(o=i[r]=i[r]||{}).image=new Image;a.addEventListener("load",t),a.addEventListener("error",function(){a.error=!0});return"data:"===r.substring(0,5).toLowerCase()||(a.crossOrigin=e="null"===e?null:e),a.src=r,a}},Rc={registerBinding:function(r,e,t,n){var i=Array.prototype.slice.apply(arguments,[1]);if(Array.isArray(r)){for(var o=[],a=0;a<r.length;a++){var s=r[a];if(void 0!==s){var l=this.binder(s);o.push(l.on.apply(l,i))}}return o}return(l=this.binder(r)).on.apply(l,i)},binder:function(r){var e=this,t=e.cy.window(),n=r===t||r===t.document||r===t.document.body||function(e){return!(typeof HTMLElement>"u")&&e instanceof HTMLElement}(r);if(null==e.supportsPassiveEvents){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){return i=!0,!0}});t.addEventListener("test",null,o)}catch{}e.supportsPassiveEvents=i}var a=function(l,u,c){var d=Array.prototype.slice.call(arguments);return n&&e.supportsPassiveEvents&&(d[2]={capture:c??!1,passive:!1,once:!1}),e.bindings.push({target:r,args:d}),(r.addEventListener||r.on).apply(r,d),this};return{on:a,addEventListener:a,addListener:a,bind:a}},nodeIsDraggable:function(r){return r&&r.isNode()&&!r.locked()&&r.grabbable()},nodeIsGrabbable:function(r){return this.nodeIsDraggable(r)&&r.interactive()}};Rc.load=function(){var r=this,e=r.cy.window(),t=function(le){return le.selected()},i=function(le,$e,rt,nt){null==le&&(le=r.cy);for(var it=0;it<$e.length;it++)le.emit({originalEvent:rt,type:$e[it],position:nt})},o=function(le){return le.shiftKey||le.metaKey||le.ctrlKey},a=function(le,$e){var rt=!0;if(r.cy.hasCompoundNodes()&&le&&le.pannable()){for(var nt=0;$e&&nt<$e.length;nt++)if((le=$e[nt]).isNode()&&le.isParent()&&!le.pannable()){rt=!1;break}}else rt=!0;return rt},u=function(le){le[0]._private.rscratch.inDragLayer=!0},d=function(le){le[0]._private.rscratch.isGrabTarget=!0},f=function(le,$e){var rt=$e.addToList;!rt.has(le)&&le.grabbable()&&!le.locked()&&(rt.merge(le),function(le){le[0]._private.grabbed=!0}(le))},y=function(le,$e){$e=$e||{};var rt=le.cy().hasCompoundNodes();$e.inDragLayer&&(le.forEach(u),le.neighborhood().stdFilter(function(nt){return!rt||nt.isEdge()}).forEach(u)),$e.addToList&&le.forEach(function(nt){f(nt,$e)}),function(le,$e){if(le.cy().hasCompoundNodes()&&(null!=$e.inDragLayer||null!=$e.addToList)){var rt=le.descendants();$e.inDragLayer&&(rt.forEach(u),rt.connectedEdges().forEach(u)),$e.addToList&&f(rt,$e)}}(le,$e),b(le,{inDragLayer:$e.inDragLayer}),r.updateCachedGrabbedEles()},v=y,m=function(le){le&&(r.getCachedZSortedEles().forEach(function($e){(function(le){le[0]._private.grabbed=!1})($e),function(le){le[0]._private.rscratch.inDragLayer=!1}($e),function(le){le[0]._private.rscratch.isGrabTarget=!1}($e)}),r.updateCachedGrabbedEles())},b=function(le,$e){if((null!=$e.inDragLayer||null!=$e.addToList)&&le.cy().hasCompoundNodes()){var rt=le.ancestors().orphans();if(!rt.same(le)){var nt=rt.descendants().spawnSelf().merge(rt).unmerge(le).unmerge(le.descendants()),it=nt.connectedEdges();$e.inDragLayer&&(it.forEach(u),nt.forEach(u)),$e.addToList&&nt.forEach(function(Ht){f(Ht,$e)})}}},T=function(){null!=document.activeElement&&null!=document.activeElement.blur&&document.activeElement.blur()},O=typeof MutationObserver<"u",K=typeof ResizeObserver<"u";O?(r.removeObserver=new MutationObserver(function(ut){for(var le=0;le<ut.length;le++){var rt=ut[le].removedNodes;if(rt)for(var nt=0;nt<rt.length;nt++)if(rt[nt]===r.container){r.destroy();break}}}),r.container.parentNode&&r.removeObserver.observe(r.container.parentNode,{childList:!0})):r.registerBinding(r.container,"DOMNodeRemoved",function(ut){r.destroy()});var Z=_h(function(){r.cy.resize()},100);O&&(r.styleObserver=new MutationObserver(Z),r.styleObserver.observe(r.container,{attributes:!0})),r.registerBinding(e,"resize",Z),K&&(r.resizeObserver=new ResizeObserver(Z),r.resizeObserver.observe(r.container));var P=function(){r.invalidateContainerClientCoordsCache()};(function(le,$e){for(;null!=le;)$e(le),le=le.parentNode})(r.container,function(ut){r.registerBinding(ut,"transitionend",P),r.registerBinding(ut,"animationend",P),r.registerBinding(ut,"scroll",P)}),r.registerBinding(r.container,"contextmenu",function(ut){ut.preventDefault()});var q=function(le){for(var $e=r.findContainerClientCoords(),rt=$e[0],nt=$e[1],it=$e[2],Ht=$e[3],Et=le.touches?le.touches:[le],Jt=!1,$t=0;$t<Et.length;$t++){var dr=Et[$t];if(rt<=dr.clientX&&dr.clientX<=rt+it&&nt<=dr.clientY&&dr.clientY<=nt+Ht){Jt=!0;break}}if(!Jt)return!1;for(var hr=r.container,Yt=le.target.parentNode,Er=!1;Yt;){if(Yt===hr){Er=!0;break}Yt=Yt.parentNode}return!!Er};r.registerBinding(r.container,"mousedown",function(le){if(q(le)&&(1!==r.hoverData.which||1===le.which)){le.preventDefault(),T(),r.hoverData.capture=!0,r.hoverData.which=le.which;var $e=r.cy,rt=[le.clientX,le.clientY],nt=r.projectIntoViewport(rt[0],rt[1]),it=r.selection,Ht=r.findNearestElements(nt[0],nt[1],!0,!1),Et=Ht[0],Jt=r.dragData.possibleDragElements;r.hoverData.mdownPos=nt,r.hoverData.mdownGPos=rt;var $t=function(Pr){return{originalEvent:le,type:Pr,position:{x:nt[0],y:nt[1]}}};if(3==le.which){r.hoverData.cxtStarted=!0;var hr={originalEvent:le,type:"cxttapstart",position:{x:nt[0],y:nt[1]}};Et?(Et.activate(),Et.emit(hr),r.hoverData.down=Et):$e.emit(hr),r.hoverData.downTime=(new Date).getTime(),r.hoverData.cxtDragged=!1}else if(1==le.which){if(Et&&Et.activate(),null!=Et&&r.nodeIsGrabbable(Et)){if(d(Et),Et.selected()){Jt=r.dragData.possibleDragElements=$e.collection();var Yt=$e.$(function(Er){return Er.isNode()&&Er.selected()&&r.nodeIsGrabbable(Er)});y(Yt,{addToList:Jt}),Et.emit($t("grabon")),Yt.forEach(function(Pr){Pr.emit($t("grab"))})}else Jt=r.dragData.possibleDragElements=$e.collection(),v(Et,{addToList:Jt}),Et.emit($t("grabon")).emit($t("grab"));r.redrawHint("eles",!0),r.redrawHint("drag",!0)}r.hoverData.down=Et,r.hoverData.downs=Ht,r.hoverData.downTime=(new Date).getTime(),i(Et,["mousedown","tapstart","vmousedown"],le,{x:nt[0],y:nt[1]}),null==Et?(it[4]=1,r.data.bgActivePosistion={x:nt[0],y:nt[1]},r.redrawHint("select",!0),r.redraw()):Et.pannable()&&(it[4]=1),r.hoverData.tapholdCancelled=!1,clearTimeout(r.hoverData.tapholdTimeout),r.hoverData.tapholdTimeout=setTimeout(function(){if(!r.hoverData.tapholdCancelled){var Pr=r.hoverData.down;Pr?Pr.emit($t("taphold")):$e.emit($t("taphold"))}},r.tapholdDuration)}it[0]=it[2]=nt[0],it[1]=it[3]=nt[1]}},!1);var X,U,me,G=function(le){var $e=le.getRootNode();if($e&&11===$e.nodeType&&void 0!==$e.host)return $e}(r.container);r.registerBinding([e,G],"mousemove",function(le){var mo;if(r.hoverData.capture||q(le)){var rt=!1,nt=r.cy,it=nt.zoom(),Ht=[le.clientX,le.clientY],Et=r.projectIntoViewport(Ht[0],Ht[1]),Jt=r.hoverData.mdownPos,$t=r.hoverData.mdownGPos,dr=r.selection,hr=null;!r.hoverData.draggingEles&&!r.hoverData.dragging&&!r.hoverData.selecting&&(hr=r.findNearestElement(Et[0],Et[1],!0,!1));var Wn,br=r.hoverData.last,Yt=r.hoverData.down,Er=[Et[0]-dr[2],Et[1]-dr[3]],Pr=r.dragData.possibleDragElements;if($t){var tn=Ht[0]-$t[0],Un=Ht[1]-$t[1];r.hoverData.isOverThresholdDrag=Wn=tn*tn+Un*Un>=r.desktopTapThreshold2}var ti=o(le);Wn&&(r.hoverData.tapholdCancelled=!0),rt=!0,i(hr,["mousemove","vmousemove","tapdrag"],le,{x:Et[0],y:Et[1]});var bn=function(mo){return{originalEvent:le,type:mo,position:{x:Et[0],y:Et[1]}}},sa=function(){r.data.bgActivePosistion=void 0,r.hoverData.selecting||nt.emit(bn("boxstart")),dr[4]=1,r.hoverData.selecting=!0,r.redrawHint("select",!0),r.redraw()};if(3===r.hoverData.which){if(Wn){var _i=bn("cxtdrag");Yt?Yt.emit(_i):nt.emit(_i),r.hoverData.cxtDragged=!0,(!r.hoverData.cxtOver||hr!==r.hoverData.cxtOver)&&(r.hoverData.cxtOver&&r.hoverData.cxtOver.emit(bn("cxtdragout")),r.hoverData.cxtOver=hr,hr&&hr.emit(bn("cxtdragover")))}}else if(r.hoverData.dragging){if(rt=!0,nt.panningEnabled()&&nt.userPanningEnabled()){var ss;if(r.hoverData.justStartedPan){var su=r.hoverData.mdownPos;ss={x:(Et[0]-su[0])*it,y:(Et[1]-su[1])*it},r.hoverData.justStartedPan=!1}else ss={x:Er[0]*it,y:Er[1]*it};nt.panBy(ss),nt.emit(bn("dragpan")),r.hoverData.dragged=!0}Et=r.projectIntoViewport(le.clientX,le.clientY)}else if(1!=dr[4]||null!=Yt&&!Yt.pannable()){if(Yt&&Yt.pannable()&&Yt.active()&&Yt.unactivate(),(!Yt||!Yt.grabbed())&&hr!=br&&(br&&i(br,["mouseout","tapdragout"],le,{x:Et[0],y:Et[1]}),hr&&i(hr,["mouseover","tapdragover"],le,{x:Et[0],y:Et[1]}),r.hoverData.last=hr),Yt)if(Wn){if(nt.boxSelectionEnabled()&&ti)Yt&&Yt.grabbed()&&(m(Pr),Yt.emit(bn("freeon")),Pr.emit(bn("free")),r.dragData.didDrag&&(Yt.emit(bn("dragfreeon")),Pr.emit(bn("dragfree")))),sa();else if(Yt&&Yt.grabbed()&&r.nodeIsDraggable(Yt)){var wi=!r.dragData.didDrag;wi&&r.redrawHint("eles",!0),r.dragData.didDrag=!0,r.hoverData.draggingEles||y(Pr,{inDragLayer:!0});var li={x:0,y:0};if(Ut(Er[0])&&Ut(Er[1])&&(li.x+=Er[0],li.y+=Er[1],wi)){var Wi=r.hoverData.dragDelta;Wi&&Ut(Wi[0])&&Ut(Wi[1])&&(li.x+=Wi[0],li.y+=Wi[1])}r.hoverData.draggingEles=!0,Pr.silentShift(li).emit(bn("position")).emit(bn("drag")),r.redrawHint("drag",!0),r.redraw()}}else 0===(mo=r.hoverData.dragDelta=r.hoverData.dragDelta||[]).length?(mo.push(Er[0]),mo.push(Er[1])):(mo[0]+=Er[0],mo[1]+=Er[1]);rt=!0}else Wn&&(r.hoverData.dragging||!nt.boxSelectionEnabled()||!ti&&nt.panningEnabled()&&nt.userPanningEnabled()?!r.hoverData.selecting&&nt.panningEnabled()&&nt.userPanningEnabled()&&a(Yt,r.hoverData.downs)&&(r.hoverData.dragging=!0,r.hoverData.justStartedPan=!0,dr[4]=0,r.data.bgActivePosistion=fc(Jt),r.redrawHint("select",!0),r.redraw()):sa(),Yt&&Yt.pannable()&&Yt.active()&&Yt.unactivate());if(dr[2]=Et[0],dr[3]=Et[1],rt)return le.stopPropagation&&le.stopPropagation(),le.preventDefault&&le.preventDefault(),!1}},!1),r.registerBinding(e,"mouseup",function(le){if((1!==r.hoverData.which||1===le.which||!r.hoverData.capture)&&r.hoverData.capture){r.hoverData.capture=!1;var rt=r.cy,nt=r.projectIntoViewport(le.clientX,le.clientY),it=r.selection,Ht=r.findNearestElement(nt[0],nt[1],!0,!1),Et=r.dragData.possibleDragElements,Jt=r.hoverData.down,$t=o(le);r.data.bgActivePosistion&&(r.redrawHint("select",!0),r.redraw()),r.hoverData.tapholdCancelled=!0,r.data.bgActivePosistion=void 0,Jt&&Jt.unactivate();var dr=function(tn){return{originalEvent:le,type:tn,position:{x:nt[0],y:nt[1]}}};if(3===r.hoverData.which){var hr=dr("cxttapend");if(Jt?Jt.emit(hr):rt.emit(hr),!r.hoverData.cxtDragged){var br=dr("cxttap");Jt?Jt.emit(br):rt.emit(br)}r.hoverData.cxtDragged=!1,r.hoverData.which=null}else if(1===r.hoverData.which){if(i(Ht,["mouseup","tapend","vmouseup"],le,{x:nt[0],y:nt[1]}),!r.dragData.didDrag&&!r.hoverData.dragged&&!r.hoverData.selecting&&!r.hoverData.isOverThresholdDrag&&(i(Jt,["click","tap","vclick"],le,{x:nt[0],y:nt[1]}),U=!1,le.timeStamp-me<=rt.multiClickDebounceTime()?(X&&clearTimeout(X),U=!0,me=null,i(Jt,["dblclick","dbltap","vdblclick"],le,{x:nt[0],y:nt[1]})):(X=setTimeout(function(){U||i(Jt,["oneclick","onetap","voneclick"],le,{x:nt[0],y:nt[1]})},rt.multiClickDebounceTime()),me=le.timeStamp)),null==Jt&&!r.dragData.didDrag&&!r.hoverData.selecting&&!r.hoverData.dragged&&!o(le)&&(rt.$(t).unselect(["tapunselect"]),Et.length>0&&r.redrawHint("eles",!0),r.dragData.possibleDragElements=Et=rt.collection()),Ht==Jt&&!r.dragData.didDrag&&!r.hoverData.selecting&&null!=Ht&&Ht._private.selectable&&(r.hoverData.dragging||("additive"===rt.selectionType()||$t?Ht.selected()?Ht.unselect(["tapunselect"]):Ht.select(["tapselect"]):$t||(rt.$(t).unmerge(Ht).unselect(["tapunselect"]),Ht.select(["tapselect"]))),r.redrawHint("eles",!0)),r.hoverData.selecting){var Yt=rt.collection(r.getAllInBox(it[0],it[1],it[2],it[3]));r.redrawHint("select",!0),Yt.length>0&&r.redrawHint("eles",!0),rt.emit(dr("boxend")),"additive"===rt.selectionType()||$t||rt.$(t).unmerge(Yt).unselect(),Yt.emit(dr("box")).stdFilter(function(tn){return tn.selectable()&&!tn.selected()}).select().emit(dr("boxselect")),r.redraw()}if(r.hoverData.dragging&&(r.hoverData.dragging=!1,r.redrawHint("select",!0),r.redrawHint("eles",!0),r.redraw()),!it[4]){r.redrawHint("drag",!0),r.redrawHint("eles",!0);var Pr=Jt&&Jt.grabbed();m(Et),Pr&&(Jt.emit(dr("freeon")),Et.emit(dr("free")),r.dragData.didDrag&&(Jt.emit(dr("dragfreeon")),Et.emit(dr("dragfree"))))}}it[4]=0,r.hoverData.down=null,r.hoverData.cxtStarted=!1,r.hoverData.draggingEles=!1,r.hoverData.selecting=!1,r.hoverData.isOverThresholdDrag=!1,r.dragData.didDrag=!1,r.hoverData.dragged=!1,r.hoverData.dragDelta=[],r.hoverData.mdownPos=null,r.hoverData.mdownGPos=null,r.hoverData.which=null}},!1);var _e,be=[],Se=1e5,De=function(le){var $e=!1,rt=le.deltaY;if(null==rt&&(null!=le.wheelDeltaY?rt=le.wheelDeltaY/4:null!=le.wheelDelta&&(rt=le.wheelDelta/4)),0!==rt){if(null==_e)if(be.length>=4){var nt=be;if(_e=function(le){for(var rt=0;rt<le.length;rt++)if(le[rt]%5!=0)return!1;return!0}(nt),!_e){var it=Math.abs(nt[0]);_e=function(le){for(var $e=Math.abs(le[0]),rt=1;rt<le.length;rt++)if(Math.abs(le[rt])!==$e)return!1;return!0}(nt)&&it>5}if(_e)for(var Ht=0;Ht<nt.length;Ht++)Se=Math.min(Math.abs(nt[Ht]),Se)}else be.push(rt),$e=!0;else _e&&(Se=Math.min(Math.abs(rt),Se));if(!r.scrollingPage){var Et=r.cy,Jt=Et.zoom(),$t=Et.pan(),dr=r.projectIntoViewport(le.clientX,le.clientY),hr=[dr[0]*Jt+$t.x,dr[1]*Jt+$t.y];if(r.hoverData.draggingEles||r.hoverData.dragging||r.hoverData.cxtStarted||0!==r.selection[4])return void le.preventDefault();if(Et.panningEnabled()&&Et.userPanningEnabled()&&Et.zoomingEnabled()&&Et.userZoomingEnabled()){var br;le.preventDefault(),r.data.wheelZooming=!0,clearTimeout(r.data.wheelTimeout),r.data.wheelTimeout=setTimeout(function(){r.data.wheelZooming=!1,r.redrawHint("eles",!0),r.redraw()},150),$e&&Math.abs(rt)>5&&(rt=5*z0(rt)),br=rt/-250,_e&&(br/=Se,br*=3),br*=r.wheelSensitivity,1===le.deltaMode&&(br*=33);var Er=Et.zoom()*Math.pow(10,br);"gesturechange"===le.type&&(Er=r.gestureStartZoom*le.scale),Et.zoom({level:Er,renderedPosition:{x:hr[0],y:hr[1]}}),Et.emit({type:"gesturechange"===le.type?"pinchzoom":"scrollzoom",originalEvent:le,position:{x:dr[0],y:dr[1]}})}}}};r.registerBinding(r.container,"wheel",De,!0),r.registerBinding(e,"scroll",function(le){r.scrollingPage=!0,clearTimeout(r.scrollingPageTimeout),r.scrollingPageTimeout=setTimeout(function(){r.scrollingPage=!1},250)},!0),r.registerBinding(r.container,"gesturestart",function(le){r.gestureStartZoom=r.cy.zoom(),r.hasTouchStarted||le.preventDefault()},!0),r.registerBinding(r.container,"gesturechange",function(ut){r.hasTouchStarted||De(ut)},!0),r.registerBinding(r.container,"mouseout",function(le){var $e=r.projectIntoViewport(le.clientX,le.clientY);r.cy.emit({originalEvent:le,type:"mouseout",position:{x:$e[0],y:$e[1]}})},!1),r.registerBinding(r.container,"mouseover",function(le){var $e=r.projectIntoViewport(le.clientX,le.clientY);r.cy.emit({originalEvent:le,type:"mouseover",position:{x:$e[0],y:$e[1]}})},!1);var ze,lt,yt,ot,bt,xt,zt,_t,Ue,He,Ye,pt,Lt,vr,cr,ar,Rt,Gt,rr,_r,tr=function(le,$e,rt,nt){return Math.sqrt((rt-le)*(rt-le)+(nt-$e)*(nt-$e))},Ur=function(le,$e,rt,nt){return(rt-le)*(rt-le)+(nt-$e)*(nt-$e)};if(r.registerBinding(r.container,"touchstart",vr=function(le){if(r.hasTouchStarted=!0,q(le)){T(),r.touchData.capture=!0,r.data.bgActivePosistion=void 0;var $e=r.cy,rt=r.touchData.now,nt=r.touchData.earlier;if(le.touches[0]){var it=r.projectIntoViewport(le.touches[0].clientX,le.touches[0].clientY);rt[0]=it[0],rt[1]=it[1]}le.touches[1]&&(it=r.projectIntoViewport(le.touches[1].clientX,le.touches[1].clientY),rt[2]=it[0],rt[3]=it[1]),le.touches[2]&&(it=r.projectIntoViewport(le.touches[2].clientX,le.touches[2].clientY),rt[4]=it[0],rt[5]=it[1]);var Ht=function(ti){return{originalEvent:le,type:ti,position:{x:rt[0],y:rt[1]}}};if(le.touches[1]){r.touchData.singleTouchMoved=!0,m(r.dragData.touchDragEles);var Et=r.findContainerClientCoords();Ye=Et[2],pt=Et[3],lt=le.touches[0].clientY-(He=Et[1]),yt=le.touches[1].clientX-(Ue=Et[0]),ot=le.touches[1].clientY-He,Lt=0<=(ze=le.touches[0].clientX-Ue)&&ze<=Ye&&0<=yt&&yt<=Ye&&0<=lt&&lt<=pt&&0<=ot&&ot<=pt;var Jt=$e.pan(),$t=$e.zoom();if(bt=tr(ze,lt,yt,ot),xt=Ur(ze,lt,yt,ot),_t=[((zt=[(ze+yt)/2,(lt+ot)/2])[0]-Jt.x)/$t,(zt[1]-Jt.y)/$t],xt<4e4&&!le.touches[2]){var br=r.findNearestElement(rt[0],rt[1],!0,!0),Yt=r.findNearestElement(rt[2],rt[3],!0,!0);return br&&br.isNode()?(br.activate().emit(Ht("cxttapstart")),r.touchData.start=br):Yt&&Yt.isNode()?(Yt.activate().emit(Ht("cxttapstart")),r.touchData.start=Yt):$e.emit(Ht("cxttapstart")),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!0,r.touchData.cxtDragged=!1,r.data.bgActivePosistion=void 0,void r.redraw()}}if(le.touches[2])$e.boxSelectionEnabled()&&le.preventDefault();else if(!le.touches[1]&&le.touches[0]){var Er=r.findNearestElements(rt[0],rt[1],!0,!0),Pr=Er[0];if(null!=Pr&&(Pr.activate(),r.touchData.start=Pr,r.touchData.starts=Er,r.nodeIsGrabbable(Pr))){var Wn=r.dragData.touchDragEles=$e.collection(),tn=null;r.redrawHint("eles",!0),r.redrawHint("drag",!0),Pr.selected()?(tn=$e.$(function(zn){return zn.selected()&&r.nodeIsGrabbable(zn)}),y(tn,{addToList:Wn})):v(Pr,{addToList:Wn}),d(Pr),Pr.emit(Ht("grabon")),tn?tn.forEach(function(zn){zn.emit(Ht("grab"))}):Pr.emit(Ht("grab"))}i(Pr,["touchstart","tapstart","vmousedown"],le,{x:rt[0],y:rt[1]}),null==Pr&&(r.data.bgActivePosistion={x:it[0],y:it[1]},r.redrawHint("select",!0),r.redraw()),r.touchData.singleTouchMoved=!1,r.touchData.singleTouchStartTime=+new Date,clearTimeout(r.touchData.tapholdTimeout),r.touchData.tapholdTimeout=setTimeout(function(){!1===r.touchData.singleTouchMoved&&!r.pinching&&!r.touchData.selecting&&i(r.touchData.start,["taphold"],le,{x:rt[0],y:rt[1]})},r.tapholdDuration)}if(le.touches.length>=1){for(var Ni=r.touchData.startPosition=[null,null,null,null,null,null],Un=0;Un<rt.length;Un++)Ni[Un]=nt[Un]=rt[Un];var Mn=le.touches[0];r.touchData.startGPosition=[Mn.clientX,Mn.clientY]}}},!1),r.registerBinding(e,"touchmove",cr=function(le){var $e=r.touchData.capture;if($e||q(le)){var rt=r.selection,nt=r.cy,it=r.touchData.now,Ht=r.touchData.earlier,Et=nt.zoom();if(le.touches[0]){var Jt=r.projectIntoViewport(le.touches[0].clientX,le.touches[0].clientY);it[0]=Jt[0],it[1]=Jt[1]}le.touches[1]&&(Jt=r.projectIntoViewport(le.touches[1].clientX,le.touches[1].clientY),it[2]=Jt[0],it[3]=Jt[1]),le.touches[2]&&(Jt=r.projectIntoViewport(le.touches[2].clientX,le.touches[2].clientY),it[4]=Jt[0],it[5]=Jt[1]);var hr,$t=function(hn){return{originalEvent:le,type:hn,position:{x:it[0],y:it[1]}}},dr=r.touchData.startGPosition;if($e&&le.touches[0]&&dr){for(var br=[],Yt=0;Yt<it.length;Yt++)br[Yt]=it[Yt]-Ht[Yt];var Er=le.touches[0].clientX-dr[0],Wn=le.touches[0].clientY-dr[1];hr=Er*Er+Wn*Wn>=r.touchTapThreshold2}if($e&&r.touchData.cxt){le.preventDefault();var Go=Ur(Un=le.touches[0].clientX-Ue,Mn=le.touches[0].clientY-He,zn=le.touches[1].clientX-Ue,ti=le.touches[1].clientY-He);if(Go/xt>=2.25||Go>=22500){r.touchData.cxt=!1,r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var la=$t("cxttapend");r.touchData.start?(r.touchData.start.unactivate().emit(la),r.touchData.start=null):nt.emit(la)}}if($e&&r.touchData.cxt){la=$t("cxtdrag"),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.touchData.start?r.touchData.start.emit(la):nt.emit(la),r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxtDragged=!0;var wi=r.findNearestElement(it[0],it[1],!0,!0);(!r.touchData.cxtOver||wi!==r.touchData.cxtOver)&&(r.touchData.cxtOver&&r.touchData.cxtOver.emit($t("cxtdragout")),r.touchData.cxtOver=wi,wi&&wi.emit($t("cxtdragover")))}else if($e&&le.touches[2]&&nt.boxSelectionEnabled())le.preventDefault(),r.data.bgActivePosistion=void 0,this.lastThreeTouch=+new Date,r.touchData.selecting||nt.emit($t("boxstart")),r.touchData.selecting=!0,r.touchData.didSelect=!0,rt[4]=1,rt&&0!==rt.length&&void 0!==rt[0]?(rt[2]=(it[0]+it[2]+it[4])/3,rt[3]=(it[1]+it[3]+it[5])/3):(rt[0]=(it[0]+it[2]+it[4])/3,rt[1]=(it[1]+it[3]+it[5])/3,rt[2]=(it[0]+it[2]+it[4])/3+1,rt[3]=(it[1]+it[3]+it[5])/3+1),r.redrawHint("select",!0),r.redraw();else if($e&&le.touches[1]&&!r.touchData.didSelect&&nt.zoomingEnabled()&&nt.panningEnabled()&&nt.userZoomingEnabled()&&nt.userPanningEnabled()){if(le.preventDefault(),r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),li=r.dragData.touchDragEles){r.redrawHint("drag",!0);for(var Wi=0;Wi<li.length;Wi++){var il=li[Wi]._private;il.grabbed=!1,il.rscratch.inDragLayer=!1}}var Un,Mn,zn,ti,mo=r.touchData.start,lu=tr(Un=le.touches[0].clientX-Ue,Mn=le.touches[0].clientY-He,zn=le.touches[1].clientX-Ue,ti=le.touches[1].clientY-He),Em=lu/bt;if(Lt){var fI=(Un-ze+(zn-yt))/2,Tm=(Mn-lt+(ti-ot))/2,ol=nt.zoom(),zc=ol*Em,al=nt.pan(),Gc=_t[0]*ol+al.x,af=_t[1]*ol+al.y,Im={x:-zc/ol*(Gc-al.x-fI)+Gc,y:-zc/ol*(af-al.y-Tm)+af};mo&&mo.active()&&(m(li=r.dragData.touchDragEles),r.redrawHint("drag",!0),r.redrawHint("eles",!0),mo.unactivate().emit($t("freeon")),li.emit($t("free")),r.dragData.didDrag&&(mo.emit($t("dragfreeon")),li.emit($t("dragfree")))),nt.viewport({zoom:zc,pan:Im,cancelOnFailedZoom:!0}),nt.emit($t("pinchzoom")),bt=lu,ze=Un,lt=Mn,yt=zn,ot=ti,r.pinching=!0}le.touches[0]&&(Jt=r.projectIntoViewport(le.touches[0].clientX,le.touches[0].clientY),it[0]=Jt[0],it[1]=Jt[1]),le.touches[1]&&(Jt=r.projectIntoViewport(le.touches[1].clientX,le.touches[1].clientY),it[2]=Jt[0],it[3]=Jt[1]),le.touches[2]&&(Jt=r.projectIntoViewport(le.touches[2].clientX,le.touches[2].clientY),it[4]=Jt[0],it[5]=Jt[1])}else if(le.touches[0]&&!r.touchData.didSelect){var vo=r.touchData.start,sf=r.touchData.last;if(!r.hoverData.draggingEles&&!r.swipePanning&&(wi=r.findNearestElement(it[0],it[1],!0,!0)),$e&&null!=vo&&le.preventDefault(),$e&&null!=vo&&r.nodeIsDraggable(vo))if(hr){var li=r.dragData.touchDragEles,ua=!r.dragData.didDrag;ua&&y(li,{inDragLayer:!0}),r.dragData.didDrag=!0;var Xi={x:0,y:0};Ut(br[0])&&Ut(br[1])&&(Xi.x+=br[0],Xi.y+=br[1],ua)&&(r.redrawHint("eles",!0),(Li=r.touchData.dragDelta)&&Ut(Li[0])&&Ut(Li[1])&&(Xi.x+=Li[0],Xi.y+=Li[1])),r.hoverData.draggingEles=!0,li.silentShift(Xi).emit($t("position")).emit($t("drag")),r.redrawHint("drag",!0),r.touchData.startPosition[0]==Ht[0]&&r.touchData.startPosition[1]==Ht[1]&&r.redrawHint("eles",!0),r.redraw()}else{var Li;0===(Li=r.touchData.dragDelta=r.touchData.dragDelta||[]).length?(Li.push(br[0]),Li.push(br[1])):(Li[0]+=br[0],Li[1]+=br[1])}if(i(vo||wi,["touchmove","tapdrag","vmousemove"],le,{x:it[0],y:it[1]}),(!vo||!vo.grabbed())&&wi!=sf&&(sf&&sf.emit($t("tapdragout")),wi&&wi.emit($t("tapdragover"))),r.touchData.last=wi,$e)for(Wi=0;Wi<it.length;Wi++)it[Wi]&&r.touchData.startPosition[Wi]&&hr&&(r.touchData.singleTouchMoved=!0);$e&&(null==vo||vo.pannable())&&nt.panningEnabled()&&nt.userPanningEnabled()&&(a(vo,r.touchData.starts)&&(le.preventDefault(),r.data.bgActivePosistion||(r.data.bgActivePosistion=fc(r.touchData.startPosition)),r.swipePanning?(nt.panBy({x:br[0]*Et,y:br[1]*Et}),nt.emit($t("dragpan"))):hr&&(r.swipePanning=!0,nt.panBy({x:Er*Et,y:Wn*Et}),nt.emit($t("dragpan")),vo&&(vo.unactivate(),r.redrawHint("select",!0),r.touchData.start=null))),Jt=r.projectIntoViewport(le.touches[0].clientX,le.touches[0].clientY),it[0]=Jt[0],it[1]=Jt[1])}for(Yt=0;Yt<it.length;Yt++)Ht[Yt]=it[Yt];$e&&le.touches.length>0&&!r.hoverData.draggingEles&&!r.swipePanning&&null!=r.data.bgActivePosistion&&(r.data.bgActivePosistion=void 0,r.redrawHint("select",!0),r.redraw())}},!1),r.registerBinding(e,"touchcancel",ar=function(le){var $e=r.touchData.start;r.touchData.capture=!1,$e&&$e.unactivate()}),r.registerBinding(e,"touchend",Rt=function(le){var $e=r.touchData.start;if(r.touchData.capture){0===le.touches.length&&(r.touchData.capture=!1),le.preventDefault();var nt=r.selection;r.swipePanning=!1,r.hoverData.draggingEles=!1;var it=r.cy,Ht=it.zoom(),Et=r.touchData.now,Jt=r.touchData.earlier;if(le.touches[0]){var $t=r.projectIntoViewport(le.touches[0].clientX,le.touches[0].clientY);Et[0]=$t[0],Et[1]=$t[1]}le.touches[1]&&($t=r.projectIntoViewport(le.touches[1].clientX,le.touches[1].clientY),Et[2]=$t[0],Et[3]=$t[1]),le.touches[2]&&($t=r.projectIntoViewport(le.touches[2].clientX,le.touches[2].clientY),Et[4]=$t[0],Et[5]=$t[1]);var hr,dr=function(_i){return{originalEvent:le,type:_i,position:{x:Et[0],y:Et[1]}}};if($e&&$e.unactivate(),r.touchData.cxt){if(hr=dr("cxttapend"),$e?$e.emit(hr):it.emit(hr),!r.touchData.cxtDragged){var br=dr("cxttap");$e?$e.emit(br):it.emit(br)}return r.touchData.start&&(r.touchData.start._private.grabbed=!1),r.touchData.cxt=!1,r.touchData.start=null,void r.redraw()}if(!le.touches[2]&&it.boxSelectionEnabled()&&r.touchData.selecting){r.touchData.selecting=!1;var Yt=it.collection(r.getAllInBox(nt[0],nt[1],nt[2],nt[3]));nt[0]=void 0,nt[1]=void 0,nt[2]=void 0,nt[3]=void 0,nt[4]=0,r.redrawHint("select",!0),it.emit(dr("boxend")),Yt.emit(dr("box")).stdFilter(function(_i){return _i.selectable()&&!_i.selected()}).select().emit(dr("boxselect")),Yt.nonempty()&&r.redrawHint("eles",!0),r.redraw()}if($e?.unactivate(),le.touches[2])r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);else if(!le.touches[1]&&!le.touches[0]&&!le.touches[0]){r.data.bgActivePosistion=void 0,r.redrawHint("select",!0);var Pr=r.dragData.touchDragEles;if(null!=$e){var Wn=$e._private.grabbed;m(Pr),r.redrawHint("drag",!0),r.redrawHint("eles",!0),Wn&&($e.emit(dr("freeon")),Pr.emit(dr("free")),r.dragData.didDrag&&($e.emit(dr("dragfreeon")),Pr.emit(dr("dragfree")))),i($e,["touchend","tapend","vmouseup","tapdragout"],le,{x:Et[0],y:Et[1]}),$e.unactivate(),r.touchData.start=null}else{var tn=r.findNearestElement(Et[0],Et[1],!0,!0);i(tn,["touchend","tapend","vmouseup","tapdragout"],le,{x:Et[0],y:Et[1]})}var Ni=r.touchData.startPosition[0]-Et[0],Mn=r.touchData.startPosition[1]-Et[1],Go=(Ni*Ni+Mn*Mn)*Ht*Ht;r.touchData.singleTouchMoved||($e||it.$(":selected").unselect(["tapunselect"]),i($e,["tap","vclick"],le,{x:Et[0],y:Et[1]}),Gt=!1,le.timeStamp-_r<=it.multiClickDebounceTime()?(rr&&clearTimeout(rr),Gt=!0,_r=null,i($e,["dbltap","vdblclick"],le,{x:Et[0],y:Et[1]})):(rr=setTimeout(function(){Gt||i($e,["onetap","voneclick"],le,{x:Et[0],y:Et[1]})},it.multiClickDebounceTime()),_r=le.timeStamp)),null!=$e&&!r.dragData.didDrag&&$e._private.selectable&&Go<r.touchTapThreshold2&&!r.pinching&&("single"===it.selectionType()?(it.$(t).unmerge($e).unselect(["tapunselect"]),$e.select(["tapselect"])):$e.selected()?$e.unselect(["tapunselect"]):$e.select(["tapselect"]),r.redrawHint("eles",!0)),r.touchData.singleTouchMoved=!0}for(var bn=0;bn<Et.length;bn++)Jt[bn]=Et[bn];r.dragData.didDrag=!1,0===le.touches.length&&(r.touchData.dragDelta=[],r.touchData.startPosition=[null,null,null,null,null,null],r.touchData.startGPosition=null,r.touchData.didSelect=!1),le.touches.length<2&&(1===le.touches.length&&(r.touchData.startGPosition=[le.touches[0].clientX,le.touches[0].clientY]),r.pinching=!1,r.redrawHint("eles",!0),r.redraw())}},!1),typeof TouchEvent>"u"){var or=[],Ar=function(le){return{clientX:le.clientX,clientY:le.clientY,force:1,identifier:le.pointerId,pageX:le.pageX,pageY:le.pageY,radiusX:le.width/2,radiusY:le.height/2,screenX:le.screenX,screenY:le.screenY,target:le.target}},Hr=function(le){for(var $e=0;$e<or.length;$e++)if(or[$e].event.pointerId===le.pointerId)return void or.splice($e,1)},yr=function(le){le.touches=or.map(function($e){return $e.touch})},Xt=function(le){return"mouse"===le.pointerType||4===le.pointerType};r.registerBinding(r.container,"pointerdown",function(ut){Xt(ut)||(ut.preventDefault(),or.push(function(le){return{event:le,touch:Ar(le)}}(ut)),yr(ut),vr(ut))}),r.registerBinding(r.container,"pointerup",function(ut){Xt(ut)||(Hr(ut),yr(ut),Rt(ut))}),r.registerBinding(r.container,"pointercancel",function(ut){Xt(ut)||(Hr(ut),yr(ut),ar())}),r.registerBinding(r.container,"pointermove",function(ut){var le,$e;Xt(ut)||(ut.preventDefault(),le=ut,($e=or.filter(function(rt){return rt.event.pointerId===le.pointerId})[0]).event=le,$e.touch=Ar(le),yr(ut),cr(ut))})}};var is={generatePolygon:function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,draw:function(n,i,o,a,s,l){this.renderer.nodeShapeImpl("polygon",n,i,o,a,s,this.points)},intersectLine:function(n,i,o,a,s,l,u,c){return Ah(s,l,this.points,n,i,o/2,a/2,u)},checkPoint:function(n,i,o,a,s,l,u,c){return rs(n,i,this.points,l,u,a,s,[0,-1],o)},hasMiterBounds:"rectangle"!==r,miterBounds:function(n,i,o,a,s,l){return function pq(r,e,t,n,i,o){var s=function fq(r,e){if(r.length<3)throw new Error("Need at least 3 vertices");var t=function(P,M){return{x:P.x+M.x,y:P.y+M.y}},n=function(P,M){return{x:P.x-M.x,y:P.y-M.y}},i=function(P,M){return{x:P.x*M,y:P.y*M}},o=function(P,M){return P.x*M.y-P.y*M.x},a=function(P){var M=hq(P.x,P.y);return 0===M?{x:0,y:0}:{x:P.x/M,y:P.y/M}},l=function(P,M,q,G){var X=n(M,P),U=n(G,q),me=o(X,U);if(Math.abs(me)<1e-9)return t(P,i(X,.5));var be=o(n(q,P),U)/me;return t(P,i(X,be))},u=r.map(function(S){return{x:S.x,y:S.y}});(function(P){for(var M=0,q=0;q<P.length;q++){var G=P[q],X=P[(q+1)%P.length];M+=G.x*X.y-X.x*G.y}return M/2})(u)<0&&u.reverse();for(var c=u.length,d=[],h=0;h<c;h++){var y=n(u[(h+1)%c],u[h]),v=a({x:y.y,y:-y.x});d.push(v)}for(var m=d.map(function(S,P){return{p1:t(u[P],i(S,e)),p2:t(u[(P+1)%c],i(S,e))}}),b=[],T=0;T<c;T++){var O=m[(T-1+c)%c],K=m[T],Z=l(O.p1,O.p2,K.p1,K.p2);b.push(Z)}return b}(Tq(r,e,t,n,i),o),l=eo();return s.forEach(function(u){return GP(l,u.x,u.y)}),l}(this.points,n,i,o,a,s)}}},generateEllipse:function(){return this.nodeShapes.ellipse={renderer:this,name:"ellipse",draw:function(e,t,n,i,o,a){this.renderer.nodeShapeImpl(this.name,e,t,n,i,o)},intersectLine:function(e,t,n,i,o,a,s,l){return function(e,t,n,i,o,a){var s=n-e,l=i-t;s/=o,l/=a;var u=Math.sqrt(s*s+l*l),c=u-1;if(c<0)return[];var d=c/u;return[(n-e)*d+e,(i-t)*d+t]}(o,a,e,t,n/2+s,i/2+s)},checkPoint:function(e,t,n,i,o,a,s,l){return Wl(e,t,i,o,a,s,n)}}},generateRoundPolygon:function(r,e){return this.nodeShapes[r]={renderer:this,name:r,points:e,getOrCreateCorners:function(n,i,o,a,s,l,u){if(void 0!==l[u]&&l[u+"-cx"]===n&&l[u+"-cy"]===i)return l[u];l[u]=new Array(e.length/2),l[u+"-cx"]=n,l[u+"-cy"]=i;var c=o/2,d=a/2;s="auto"===s?XP(o,a):s;for(var h=new Array(e.length/2),f=0;f<e.length/2;f++)h[f]={x:n+c*e[2*f],y:i+d*e[2*f+1]};var g,y,v,m,b=h.length;for(y=h[b-1],g=0;g<b;g++)l[u][g]=yT(y,v=h[g%b],m=h[(g+1)%b],s),y=v,v=m;return l[u]},draw:function(n,i,o,a,s,l,u){this.renderer.nodeShapeImpl("round-polygon",n,i,o,a,s,this.points,this.getOrCreateCorners(i,o,a,s,l,u,"drawCorners"))},intersectLine:function(n,i,o,a,s,l,u,c,d){return function(e,t,n,i,o,a,s,l,u){var d,c=[],h=new Array(2*n.length);u.forEach(function(b,T){0===T?(h[h.length-2]=b.startX,h[h.length-1]=b.startY):(h[4*T-2]=b.startX,h[4*T-1]=b.startY),h[4*T]=b.stopX,h[4*T+1]=b.stopY,0!==(d=xh(e,t,i,o,b.cx,b.cy,b.radius)).length&&c.push(d[0],d[1])});for(var f=0;f<h.length/4;f++)0!==(d=zs(e,t,i,o,h[4*f],h[4*f+1],h[4*f+2],h[4*f+3],!1)).length&&c.push(d[0],d[1]);if(c.length>2){for(var g=[c[0],c[1]],y=Math.pow(g[0]-e,2)+Math.pow(g[1]-t,2),v=1;v<c.length/2;v++){var m=Math.pow(c[2*v]-e,2)+Math.pow(c[2*v+1]-t,2);m<=y&&(g[0]=c[2*v],g[1]=c[2*v+1],y=m)}return g}return c}(s,l,this.points,n,i,0,0,0,this.getOrCreateCorners(n,i,o,a,c,d,"corners"))},checkPoint:function(n,i,o,a,s,l,u,c,d){return function(e,t,n,i,o,a,s,l){for(var u=new Array(2*n.length),c=0;c<l.length;c++){var d=l[c];if(u[4*c+0]=d.startX,u[4*c+1]=d.startY,u[4*c+2]=d.stopX,u[4*c+3]=d.stopY,Math.pow(d.cx-e,2)+Math.pow(d.cy-t,2)<=Math.pow(d.radius,2))return!0}return fo(e,t,u)}(n,i,this.points,0,0,0,0,this.getOrCreateCorners(l,u,a,s,c,d,"corners"))}}},generateRoundRectangle:function(){return this.nodeShapes["round-rectangle"]=this.nodeShapes.roundrectangle={renderer:this,name:"round-rectangle",points:to(4,0),draw:function(e,t,n,i,o,a){this.renderer.nodeShapeImpl(this.name,e,t,n,i,o,this.points,a)},intersectLine:function(e,t,n,i,o,a,s,l){return HP(o,a,e,t,n,i,s,l)},checkPoint:function(e,t,n,i,o,a,s,l){var u=i/2,c=o/2;l="auto"===l?Gs(i,o):l;var d=2*(l=Math.min(u,c,l));return!!(rs(e,t,this.points,a,s,i,o-d,[0,-1],n)||rs(e,t,this.points,a,s,i-d,o,[0,-1],n)||Wl(e,t,d,d,a-u+l,s-c+l,n)||Wl(e,t,d,d,a+u-l,s-c+l,n)||Wl(e,t,d,d,a+u-l,s+c-l,n)||Wl(e,t,d,d,a-u+l,s+c-l,n))}}},generateCutRectangle:function(){return this.nodeShapes["cut-rectangle"]=this.nodeShapes.cutrectangle={renderer:this,name:"cut-rectangle",cornerLength:8,points:to(4,0),draw:function(e,t,n,i,o,a){this.renderer.nodeShapeImpl(this.name,e,t,n,i,o,null,a)},generateCutTrianglePts:function(e,t,n,i,o){var a="auto"===o?this.cornerLength:o,s=t/2,l=e/2,u=n-l,c=n+l,d=i-s,h=i+s;return{topLeft:[u,d+a,u+a,d,u+a,d+a],topRight:[c-a,d,c,d+a,c-a,d+a],bottomRight:[c,h-a,c-a,h,c-a,h-a],bottomLeft:[u+a,h,u,h-a,u+a,h-a]}},intersectLine:function(e,t,n,i,o,a,s,l){var u=this.generateCutTrianglePts(n+2*s,i+2*s,e,t,l),c=[].concat.apply([],[u.topLeft.splice(0,4),u.topRight.splice(0,4),u.bottomRight.splice(0,4),u.bottomLeft.splice(0,4)]);return Ah(o,a,c,e,t)},checkPoint:function(e,t,n,i,o,a,s,l){var u="auto"===l?this.cornerLength:l;if(rs(e,t,this.points,a,s,i,o-2*u,[0,-1],n)||rs(e,t,this.points,a,s,i-2*u,o,[0,-1],n))return!0;var c=this.generateCutTrianglePts(i,o,a,s);return fo(e,t,c.topLeft)||fo(e,t,c.topRight)||fo(e,t,c.bottomRight)||fo(e,t,c.bottomLeft)}}},generateBarrel:function(){return this.nodeShapes.barrel={renderer:this,name:"barrel",points:to(4,0),draw:function(e,t,n,i,o,a){this.renderer.nodeShapeImpl(this.name,e,t,n,i,o)},intersectLine:function(e,t,n,i,o,a,s,l){var h=this.generateBarrelBezierPts(n+2*s,i+2*s,e,t),f=function(v){var m=pc({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},.15),b=pc({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},.5),T=pc({x:v[0],y:v[1]},{x:v[2],y:v[3]},{x:v[4],y:v[5]},.85);return[v[0],v[1],m.x,m.y,b.x,b.y,T.x,T.y,v[4],v[5]]},g=[].concat(f(h.topLeft),f(h.topRight),f(h.bottomRight),f(h.bottomLeft));return Ah(o,a,g,e,t)},generateBarrelBezierPts:function(e,t,n,i){var o=t/2,a=e/2,s=n-a,l=n+a,u=i-o,c=i+o,d=H0(e,t),h=d.heightOffset,f=d.widthOffset,g=d.ctrlPtOffsetPct*e,y={topLeft:[s,u+h,s+g,u,s+f,u],topRight:[l-f,u,l-g,u,l,u+h],bottomRight:[l,c-h,l-g,c,l-f,c],bottomLeft:[s+f,c,s+g,c,s,c-h]};return y.topLeft.isTop=!0,y.topRight.isTop=!0,y.bottomLeft.isBottom=!0,y.bottomRight.isBottom=!0,y},checkPoint:function(e,t,n,i,o,a,s,l){var u=H0(i,o),d=u.widthOffset;if(rs(e,t,this.points,a,s,i,o-2*u.heightOffset,[0,-1],n)||rs(e,t,this.points,a,s,i-2*d,o,[0,-1],n))return!0;for(var h=this.generateBarrelBezierPts(i,o,a,s),f=function(P,M,q){var G=q[4],X=q[2],U=q[0],me=q[5],be=q[1],Ae=Math.min(G,U),_e=Math.max(G,U),Se=Math.min(me,be),je=Math.max(me,be);if(Ae<=P&&P<=_e&&Se<=M&&M<=je){var Xe=function(e,t,n){return[e-2*t+n,2*(t-e),e]}(G,X,U),De=function(e,t,n,i){var o=t*t-4*e*(n-=i);if(o<0)return[];var a=Math.sqrt(o),s=2*e;return[(-t+a)/s,(-t-a)/s]}(Xe[0],Xe[1],Xe[2],P),ze=De.filter(function(lt){return 0<=lt&&lt<=1});if(ze.length>0)return ze[0]}return null},g=Object.keys(h),y=0;y<g.length;y++){var m=h[g[y]],b=f(e,t,m);if(null!=b){var Z=gi(m[5],m[3],m[1],b);if(m.isTop&&Z<=t||m.isBottom&&t<=Z)return!0}}return!1}}},generateBottomRoundrectangle:function(){return this.nodeShapes["bottom-round-rectangle"]=this.nodeShapes.bottomroundrectangle={renderer:this,name:"bottom-round-rectangle",points:to(4,0),draw:function(e,t,n,i,o,a){this.renderer.nodeShapeImpl(this.name,e,t,n,i,o,this.points,a)},intersectLine:function(e,t,n,i,o,a,s,l){var c=t-(i/2+s),f=zs(o,a,e,t,e-(n/2+s),c,e+(n/2+s),c,!1);return f.length>0?f:HP(o,a,e,t,n,i,s,l)},checkPoint:function(e,t,n,i,o,a,s,l){var u=2*(l="auto"===l?Gs(i,o):l);if(rs(e,t,this.points,a,s,i,o-u,[0,-1],n)||rs(e,t,this.points,a,s,i-u,o,[0,-1],n))return!0;var c=i/2+2*n,d=o/2+2*n;return!!(fo(e,t,[a-c,s-d,a-c,s,a+c,s,a+c,s-d])||Wl(e,t,u,u,a+i/2-l,s+o/2-l,n)||Wl(e,t,u,u,a-i/2+l,s+o/2-l,n))}}},registerNodeShapes:function(){var r=this.nodeShapes={},e=this;this.generateEllipse(),this.generatePolygon("triangle",to(3,0)),this.generateRoundPolygon("round-triangle",to(3,0)),this.generatePolygon("rectangle",to(4,0)),r.square=r.rectangle,this.generateRoundRectangle(),this.generateCutRectangle(),this.generateBarrel(),this.generateBottomRoundrectangle();var t=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",t),this.generateRoundPolygon("round-diamond",t),this.generatePolygon("pentagon",to(5,0)),this.generateRoundPolygon("round-pentagon",to(5,0)),this.generatePolygon("hexagon",to(6,0)),this.generateRoundPolygon("round-hexagon",to(6,0)),this.generatePolygon("heptagon",to(7,0)),this.generateRoundPolygon("round-heptagon",to(7,0)),this.generatePolygon("octagon",to(8,0)),this.generateRoundPolygon("round-octagon",to(8,0));var n=new Array(20),i=j0(5,0),o=j0(5,Math.PI/5),a=.5*(3-Math.sqrt(5));a*=1.57;for(var s=0;s<o.length/2;s++)o[2*s]*=a,o[2*s+1]*=a;for(s=0;s<5;s++)n[4*s]=i[2*s],n[4*s+1]=i[2*s+1],n[4*s+2]=o[2*s],n[4*s+3]=o[2*s+1];n=WP(n),this.generatePolygon("star",n),this.generatePolygon("vee",[-1,-1,0,-.333,1,-1,0,1]),this.generatePolygon("rhomboid",[-1,-1,.333,-1,1,1,-.333,1]),this.generatePolygon("right-rhomboid",[-.333,-1,1,-1,.333,1,-1,1]),this.nodeShapes.concavehexagon=this.generatePolygon("concave-hexagon",[-1,-.95,-.75,0,-1,.95,1,.95,.75,0,1,-.95]);var l=[-1,-1,.25,-1,1,0,.25,1,-1,1];this.generatePolygon("tag",l),this.generateRoundPolygon("round-tag",l),r.makePolygon=function(u){var h,d="polygon-"+u.join("$");return(h=this[d])?h:e.generatePolygon(d,u)}}},zh={timeToRender:function(){return this.redrawTotalTime/this.redrawCount},redraw:function(r){r=r||FP();var e=this;void 0===e.averageRedrawTime&&(e.averageRedrawTime=0),void 0===e.lastRedrawTime&&(e.lastRedrawTime=0),void 0===e.lastDrawTime&&(e.lastDrawTime=0),e.requestedFrame=!0,e.renderOptions=r},beforeRender:function(r,e){if(!this.destroyed){null==e&&kn("Priority is not optional for beforeRender");var t=this.beforeRenderCallbacks;t.push({fn:r,priority:e}),t.sort(function(n,i){return i.priority-n.priority})}}},ON=function(e,t,n){for(var i=e.beforeRenderCallbacks,o=0;o<i.length;o++)i[o].fn(t,n)};zh.startRenderLoop=function(){var r=this,e=r.cy;if(!r.renderLoopStarted){r.renderLoopStarted=!0;var t=function(i){if(!r.destroyed){if(!e.batching())if(r.requestedFrame&&!r.skipFrame){ON(r,!0,i);var o=Za();r.render(r.renderOptions);var a=r.lastDrawTime=Za();void 0===r.averageRedrawTime&&(r.averageRedrawTime=a-o),void 0===r.redrawCount&&(r.redrawCount=0),r.redrawCount++,void 0===r.redrawTotalTime&&(r.redrawTotalTime=0);var s=a-o;r.redrawTotalTime+=s,r.lastRedrawTime=s,r.averageRedrawTime=r.averageRedrawTime/2+s/2,r.requestedFrame=!1}else ON(r,!1,i);r.skipFrame=!1,ug(t)}};ug(t)}};var MN=function(e){this.init(e)},Pc=MN.prototype;Pc.clientFunctions=["redrawHint","render","renderTo","matchCanvasSize","nodeShapeImpl","arrowShapeImpl"],Pc.init=function(r){var e=this;e.options=r,e.cy=r.cy;var t=e.container=r.cy.container(),n=e.cy.window();if(n){var i=n.document,o=i.head,a="__________cytoscape_stylesheet",s="__________cytoscape_container",l=null!=i.getElementById(a);if(t.className.indexOf(s)<0&&(t.className=(t.className||"")+" "+s),!l){var u=i.createElement("style");u.id=a,u.textContent="."+s+" { position: relative; }",o.insertBefore(u,o.children[0])}"static"===n.getComputedStyle(t).getPropertyValue("position")&&Qr("A Cytoscape container has style position:static and so can not use UI extensions properly")}e.selection=[void 0,void 0,void 0,void 0,0],e.bezierProjPcts=[.05,.225,.4,.5,.6,.775,.95],e.hoverData={down:null,last:null,downTime:null,triggerMode:null,dragging:!1,initialPan:[null,null],capture:!1},e.dragData={possibleDragElements:[]},e.touchData={start:null,capture:!1,startPosition:[null,null,null,null,null,null],singleTouchStartTime:null,singleTouchMoved:!0,now:[null,null,null,null,null,null],earlier:[null,null,null,null,null,null]},e.redraws=0,e.showFps=r.showFps,e.debug=r.debug,e.webgl=r.webgl,e.hideEdgesOnViewport=r.hideEdgesOnViewport,e.textureOnViewport=r.textureOnViewport,e.wheelSensitivity=r.wheelSensitivity,e.motionBlurEnabled=r.motionBlur,e.forcedPixelRatio=Ut(r.pixelRatio)?r.pixelRatio:null,e.motionBlur=r.motionBlur,e.motionBlurOpacity=r.motionBlurOpacity,e.motionBlurTransparency=1-e.motionBlurOpacity,e.motionBlurPxRatio=1,e.mbPxRBlurry=1,e.minMbLowQualFrames=4,e.fullQualityMb=!1,e.clearedForMotionBlur=[],e.desktopTapThreshold=r.desktopTapThreshold,e.desktopTapThreshold2=r.desktopTapThreshold*r.desktopTapThreshold,e.touchTapThreshold=r.touchTapThreshold,e.touchTapThreshold2=r.touchTapThreshold*r.touchTapThreshold,e.tapholdDuration=500,e.bindings=[],e.beforeRenderCallbacks=[],e.beforeRenderPriorities={animations:400,eleCalcs:300,eleTxrDeq:200,lyrTxrDeq:150,lyrTxrSkip:100},e.registerNodeShapes(),e.registerArrowShapes(),e.registerCalculationListeners()},Pc.notify=function(r,e){var t=this,n=t.cy;if(!this.destroyed){if("init"===r)return void t.load();if("destroy"===r)return void t.destroy();("add"===r||"remove"===r||"move"===r&&n.hasCompoundNodes()||"load"===r||"zorder"===r||"mount"===r)&&t.invalidateCachedZSortedEles(),"viewport"===r&&t.redrawHint("select",!0),"gc"===r&&t.redrawHint("gc",!0),("load"===r||"resize"===r||"mount"===r)&&(t.invalidateContainerClientCoordsCache(),t.matchCanvasSize(t.container)),t.redrawHint("eles",!0),t.redrawHint("drag",!0),this.startRenderLoop(),this.redraw()}},Pc.destroy=function(){var r=this;r.destroyed=!0,r.cy.stopAnimationLoop();for(var e=0;e<r.bindings.length;e++){var t=r.bindings[e],i=t.target;(i.off||i.removeEventListener).apply(i,t.args)}if(r.bindings=[],r.beforeRenderCallbacks=[],r.onUpdateEleCalcsFns=[],r.removeObserver&&r.removeObserver.disconnect(),r.styleObserver&&r.styleObserver.disconnect(),r.resizeObserver&&r.resizeObserver.disconnect(),r.labelCalcDiv)try{document.body.removeChild(r.labelCalcDiv)}catch{}},Pc.isHeadless=function(){return!1},[fT,NN,LN,Rc,is,zh].forEach(function(r){gr(Pc,r)});var wT=1e3/60,FN_setupDequeueing=function(e){return function(){var n=this,i=this.renderer;if(!n.dequeueingSetup){n.dequeueingSetup=!0;var o=_h(function(){i.redrawHint("eles",!0),i.redrawHint("drag",!0),i.redraw()},e.deqRedrawThreshold);i.beforeRender(function(u,c){var d=Za(),h=i.averageRedrawTime,f=i.lastRedrawTime,g=[],y=i.cy.extent(),v=i.getPixelRatio();for(u||i.flushRenderedStyleQueue();;){var m=Za(),b=m-d,T=m-c;if(f<wT){if(T>=e.deqFastCost*(wT-(u?h:0)))break}else if(u){if(b>=e.deqCost*f||b>=e.deqAvgCost*h)break}else if(T>=e.deqNoDrawCost*wT)break;var K=e.deq(n,v,y);if(!(K.length>0))break;for(var Z=0;Z<K.length;Z++)g.push(K[Z])}g.length>0&&(e.onDeqd(n,g),!u&&e.shouldRedraw(n,g,v,y)&&o())},(e.priority||O0)(n))}}},G$=function(){return Os(function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:dg;Ls(this,r),this.idsByKey=new ts,this.keyForId=new ts,this.cachesByLvl=new ts,this.lvls=[],this.getKey=e,this.doesEleInvalidateKey=t},[{key:"getIdsFor",value:function(t){null==t&&kn("Can not get id list for null key");var n=this.idsByKey,i=this.idsByKey.get(t);return i||(i=new hc,n.set(t,i)),i}},{key:"addIdForKey",value:function(t,n){null!=t&&this.getIdsFor(t).add(n)}},{key:"deleteIdForKey",value:function(t,n){null!=t&&this.getIdsFor(t).delete(n)}},{key:"getNumberOfIdsForKey",value:function(t){return null==t?0:this.getIdsFor(t).size}},{key:"updateKeyMappingFor",value:function(t){var n=t.id(),i=this.keyForId.get(n),o=this.getKey(t);this.deleteIdForKey(i,n),this.addIdForKey(o,n),this.keyForId.set(n,o)}},{key:"deleteKeyMappingFor",value:function(t){var n=t.id(),i=this.keyForId.get(n);this.deleteIdForKey(i,n),this.keyForId.delete(n)}},{key:"keyHasChangedFor",value:function(t){var n=t.id();return this.keyForId.get(n)!==this.getKey(t)}},{key:"isInvalid",value:function(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function(t){var n=this.cachesByLvl,i=this.lvls,o=n.get(t);return o||(o=new ts,n.set(t,o),i.push(t)),o}},{key:"getCache",value:function(t,n){return this.getCachesAt(n).get(t)}},{key:"get",value:function(t,n){var i=this.getKey(t),o=this.getCache(i,n);return null!=o&&this.updateKeyMappingFor(t),o}},{key:"getForCachedKey",value:function(t,n){var i=this.keyForId.get(t.id());return this.getCache(i,n)}},{key:"hasCache",value:function(t,n){return this.getCachesAt(n).has(t)}},{key:"has",value:function(t,n){var i=this.getKey(t);return this.hasCache(i,n)}},{key:"setCache",value:function(t,n,i){i.key=t,this.getCachesAt(n).set(t,i)}},{key:"set",value:function(t,n,i){var o=this.getKey(t);this.setCache(o,n,i),this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function(t,n){this.getCachesAt(n).delete(t)}},{key:"delete",value:function(t,n){var i=this.getKey(t);this.deleteCache(i,n)}},{key:"invalidateKey",value:function(t){var n=this;this.lvls.forEach(function(i){return n.deleteCache(t,i)})}},{key:"invalidate",value:function(t){var n=t.id(),i=this.keyForId.get(n);this.deleteKeyMappingFor(t);var o=this.doesEleInvalidateKey(t);return o&&this.invalidateKey(i),o||0===this.getNumberOfIdsForKey(i)}}])}(),kc={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"},rH=Ri({getKey:null,doesEleInvalidateKey:dg,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:NP,allowEdgeTxrCaching:!0,allowParentTxrCaching:!0}),Gh=function(e,t){var n=this;n.renderer=e,n.onDequeues=[];var i=rH(t);gr(n,i),n.lookup=new G$(i.getKey,i.doesEleInvalidateKey),n.setupDequeueing()},si=Gh.prototype;si.reasons=kc,si.getTextureQueue=function(r){var e=this;return e.eleImgCaches=e.eleImgCaches||{},e.eleImgCaches[r]=e.eleImgCaches[r]||[]},si.getRetiredTextureQueue=function(r){var t=this.eleImgCaches.retired=this.eleImgCaches.retired||{};return t[r]=t[r]||[]},si.getElementQueue=function(){return this.eleCacheQueue=this.eleCacheQueue||new Th(function(t,n){return n.reqs-t.reqs})},si.getElementKeyToQueue=function(){return this.eleKeyToCacheQueue=this.eleKeyToCacheQueue||{}},si.getElement=function(r,e,t,n,i){var o=this,a=this.renderer,s=a.cy.zoom(),l=this.lookup;if(!e||0===e.w||0===e.h||isNaN(e.w)||isNaN(e.h)||!r.visible()||r.removed()||!o.allowEdgeTxrCaching&&r.isEdge()||!o.allowParentTxrCaching&&r.isParent())return null;if(null==n&&(n=Math.ceil(U0(s*t))),n<-4)n=-4;else if(s>=7.99||n>3)return null;var u=Math.pow(2,n),c=e.h*u,d=e.w*u,h=a.eleTextBiggerThanMin(r,u);if(!this.isVisible(r,h))return null;var g,f=l.get(r,n);if(f&&f.invalidated&&(f.invalidated=!1,f.texture.invalidatedWidth-=f.width),f)return f;if(g=c<=25?25:c<=50?50:50*Math.ceil(c/50),c>1024||d>1024)return null;var y=o.getTextureQueue(g),v=y[y.length-2],m=function(){return o.recycleTexture(g,d)||o.addTexture(g,d)};v||(v=y[y.length-1]),v||(v=m()),v.width-v.usedWidth<d&&(v=m());for(var Z,b=function(Ae){return Ae&&Ae.scaledLabelShown===h},T=i&&i===kc.dequeue,O=i&&i===kc.highQuality,K=i&&i===kc.downscale,S=n+1;S<=3;S++){var P=l.get(r,S);if(P){Z=P;break}}var M=Z&&Z.level===n+1?Z:null,q=function(){v.context.drawImage(M.texture.canvas,M.x,0,M.width,M.height,v.usedWidth,0,d,c)};if(v.context.setTransform(1,0,0,1,0,0),v.context.clearRect(v.usedWidth,0,d,g),b(M))q();else if(b(Z)){if(!O)return o.queueElement(r,Z.level-1),Z;for(var G=Z.level;G>n;G--)M=o.getElement(r,e,t,G,kc.downscale);q()}else{var X;if(!T&&!O&&!K)for(var U=n-1;U>=-4;U--){var me=l.get(r,U);if(me){X=me;break}}if(b(X))return o.queueElement(r,n),X;v.context.translate(v.usedWidth,0),v.context.scale(u,u),this.drawElement(v.context,r,e,h,!1),v.context.scale(1/u,1/u),v.context.translate(-v.usedWidth,0)}return f={x:v.usedWidth,texture:v,level:n,scale:u,width:d,height:c,scaledLabelShown:h},v.usedWidth+=Math.ceil(d+8),v.eleCaches.push(f),l.set(r,n,f),o.checkTextureFullness(v),f},si.invalidateElements=function(r){for(var e=0;e<r.length;e++)this.invalidateElement(r[e])},si.invalidateElement=function(r){var e=this,t=e.lookup,n=[];if(t.isInvalid(r)){for(var o=-4;o<=3;o++){var a=t.getForCachedKey(r,o);a&&n.push(a)}if(t.invalidate(r))for(var l=0;l<n.length;l++){var u=n[l],c=u.texture;c.invalidatedWidth+=u.width,u.invalidated=!0,e.checkTextureUtility(c)}e.removeFromQueue(r)}},si.checkTextureUtility=function(r){r.invalidatedWidth>=.2*r.width&&this.retireTexture(r)},si.checkTextureFullness=function(r){var t=this.getTextureQueue(r.height);r.usedWidth/r.width>.8&&r.fullnessChecks>=10?Bs(t,r):r.fullnessChecks++},si.retireTexture=function(r){var t=r.height,n=this.getTextureQueue(t),i=this.lookup;Bs(n,r),r.retired=!0;for(var o=r.eleCaches,a=0;a<o.length;a++){var s=o[a];i.deleteCache(s.key,s.level)}M0(o),this.getRetiredTextureQueue(t).push(r)},si.addTexture=function(r,e){var i={};return this.getTextureQueue(r).push(i),i.eleCaches=[],i.height=r,i.width=Math.max(1024,e),i.usedWidth=0,i.invalidatedWidth=0,i.fullnessChecks=0,i.canvas=this.renderer.makeOffscreenCanvas(i.width,i.height),i.context=i.canvas.getContext("2d"),i},si.recycleTexture=function(r,e){for(var n=this.getTextureQueue(r),i=this.getRetiredTextureQueue(r),o=0;o<i.length;o++){var a=i[o];if(a.width>=e)return a.retired=!1,a.usedWidth=0,a.invalidatedWidth=0,a.fullnessChecks=0,M0(a.eleCaches),a.context.setTransform(1,0,0,1,0,0),a.context.clearRect(0,0,a.width,a.height),Bs(i,a),n.push(a),a}},si.queueElement=function(r,e){var n=this.getElementQueue(),i=this.getElementKeyToQueue(),o=this.getKey(r),a=i[o];if(a)a.level=Math.max(a.level,e),a.eles.merge(r),a.reqs++,n.updateItem(a);else{var s={eles:r.spawn().merge(r),level:e,reqs:1,key:o};n.push(s),i[o]=s}},si.dequeue=function(r){for(var e=this,t=e.getElementQueue(),n=e.getElementKeyToQueue(),i=[],o=e.lookup,a=0;a<1&&t.size()>0;a++){var s=t.pop(),l=s.key,u=s.eles[0],c=o.hasCache(u,s.level);if(n[l]=null,!c){i.push(s);var d=e.getBoundingBox(u);e.getElement(u,d,r,s.level,kc.dequeue)}}return i},si.removeFromQueue=function(r){var t=this.getElementQueue(),n=this.getElementKeyToQueue(),i=this.getKey(r),o=n[i];null!=o&&(1===o.eles.length?(o.reqs=L0,t.updateItem(o),t.pop(),n[i]=null):o.eles.unmerge(r))},si.onDequeue=function(r){this.onDequeues.push(r)},si.offDequeue=function(r){Bs(this.onDequeues,r)},si.setupDequeueing=FN_setupDequeueing({deqRedrawThreshold:100,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t,n){return e.dequeue(t,n)},onDeqd:function(e,t){for(var n=0;n<e.onDequeues.length;n++)(0,e.onDequeues[n])(t)},shouldRedraw:function(e,t,n,i){for(var o=0;o<t.length;o++)for(var a=t[o].eles,s=0;s<a.length;s++){var l=a[s].boundingBox();if(G0(l,i))return!0}return!1},priority:function(e){return e.renderer.beforeRenderPriorities.eleTxrDeq}});var GN=function(e){var t=this,n=t.renderer=e,i=n.cy;t.layersByLevel={},t.firstGet=!0,t.lastInvalidationTime=Za()-500,t.skipping=!1,t.eleTxrDeqs=i.collection(),t.scheduleElementRefinement=_h(function(){t.refineElementTextures(t.eleTxrDeqs),t.eleTxrDeqs.unmerge(t.eleTxrDeqs)},50),n.beforeRender(function(a,s){t.skipping=s-t.lastInvalidationTime<=250},n.beforeRenderPriorities.lyrTxrSkip),t.layersQueue=new Th(function(s,l){return l.reqs-s.reqs}),t.setupDequeueing()},Di=GN.prototype,qN=0,pH=Math.pow(2,53)-1;Di.makeLayer=function(r,e){var t=Math.pow(2,e),n=Math.ceil(r.w*t),i=Math.ceil(r.h*t),o=this.renderer.makeOffscreenCanvas(n,i),a={id:qN=++qN%pH,bb:r,level:e,width:n,height:i,canvas:o,context:o.getContext("2d"),eles:[],elesQueue:[],reqs:0},s=a.context,l=-a.bb.x1,u=-a.bb.y1;return s.scale(t,t),s.translate(l,u),a},Di.getLayers=function(r,e,t){var n=this,a=n.renderer.cy.zoom(),s=n.firstGet;if(n.firstGet=!1,null==t)if((t=Math.ceil(U0(a*e)))<-4)t=-4;else if(a>=3.99||t>2)return null;n.validateLayersElesOrdering(t,r);var d,f,l=n.layersByLevel,u=Math.pow(2,t),c=l[t]=l[t]||[];if(n.levelIsComplete(t,r))return c;!function(){var q=function(be){if(n.validateLayersElesOrdering(be,r),n.levelIsComplete(be,r))return f=l[be],!0},G=function(be){if(!f)for(var Ae=t+be;-4<=Ae&&Ae<=2&&!q(Ae);Ae+=be);};G(1),G(-1);for(var X=c.length-1;X>=0;X--){var U=c[X];U.invalid&&Bs(c,U)}}();var v=function(q){var G=(q=q||{}).after;!function(){if(!d){d=eo();for(var q=0;q<r.length;q++)dq(d,r[q].boundingBox())}}();var X=Math.ceil(d.w*u),U=Math.ceil(d.h*u);if(X>32767||U>32767)return null;if(X*U>16e6)return null;var be=n.makeLayer(d,t);if(null!=G){var Ae=c.indexOf(G)+1;c.splice(Ae,0,be)}else(void 0===q.insert||q.insert)&&c.unshift(be);return be};if(n.skipping&&!s)return null;for(var m=null,b=r.length/1,T=!s,O=0;O<r.length;O++){var K=r[O],Z=K._private.rscratch,S=Z.imgLayerCaches=Z.imgLayerCaches||{},P=S[t];if(P)m=P;else{if((!m||m.eles.length>=b||!$P(m.bb,K.boundingBox()))&&!(m=v({insert:!0,after:m})))return null;f||T?n.queueLayer(m,K):n.drawEleInLayer(m,K,t,e),m.eles.push(K),S[t]=m}}return f||(T?null:c)},Di.getEleLevelForLayerLevel=function(r,e){return r},Di.drawEleInLayer=function(r,e,t,n){var o=this.renderer,a=r.context,s=e.boundingBox();0===s.w||0===s.h||!e.visible()||(t=this.getEleLevelForLayerLevel(t,n),o.setImgSmoothing(a,!1),o.drawCachedElement(a,e,null,null,t,!0),o.setImgSmoothing(a,!0))},Di.levelIsComplete=function(r,e){var n=this.layersByLevel[r];if(!n||0===n.length)return!1;for(var i=0,o=0;o<n.length;o++){var a=n[o];if(a.reqs>0||a.invalid)return!1;i+=a.eles.length}return i===e.length},Di.validateLayersElesOrdering=function(r,e){var t=this.layersByLevel[r];if(t)for(var n=0;n<t.length;n++){for(var i=t[n],o=-1,a=0;a<e.length;a++)if(i.eles[0]===e[a]){o=a;break}if(o<0)this.invalidateLayer(i);else{var s=o;for(a=0;a<i.eles.length;a++)if(i.eles[a]!==e[s+a]){this.invalidateLayer(i);break}}}},Di.updateElementsInLayers=function(r,e){for(var n=gh(r[0]),i=0;i<r.length;i++)for(var o=n?null:r[i],a=n?r[i]:r[i].ele,s=a._private.rscratch,l=s.imgLayerCaches=s.imgLayerCaches||{},u=-4;u<=2;u++){var c=l[u];c&&(o&&this.getEleLevelForLayerLevel(c.level)!==o.level||e(c,a,o))}},Di.haveLayers=function(){for(var e=!1,t=-4;t<=2;t++){var n=this.layersByLevel[t];if(n&&n.length>0){e=!0;break}}return e},Di.invalidateElements=function(r){var e=this;0!==r.length&&(e.lastInvalidationTime=Za(),0!==r.length&&e.haveLayers()&&e.updateElementsInLayers(r,function(n,i,o){e.invalidateLayer(n)}))},Di.invalidateLayer=function(r){if(this.lastInvalidationTime=Za(),!r.invalid){var e=r.level,t=r.eles;Bs(this.layersByLevel[e],r),r.elesQueue=[],r.invalid=!0,r.replacement&&(r.replacement.invalid=!0);for(var i=0;i<t.length;i++){var o=t[i]._private.rscratch.imgLayerCaches;o&&(o[e]=null)}}},Di.refineElementTextures=function(r){var e=this;e.updateElementsInLayers(r,function(n,i,o){var a=n.replacement;if(a||((a=n.replacement=e.makeLayer(n.bb,n.level)).replaces=n,a.eles=n.eles),!a.reqs)for(var s=0;s<a.eles.length;s++)e.queueLayer(a,a.eles[s])})},Di.enqueueElementRefinement=function(r){this.eleTxrDeqs.merge(r),this.scheduleElementRefinement()},Di.queueLayer=function(r,e){var n=this.layersQueue,i=r.elesQueue,o=i.hasId=i.hasId||{};if(!r.replacement){if(e){if(o[e.id()])return;i.push(e),o[e.id()]=!0}r.reqs?(r.reqs++,n.updateItem(r)):(r.reqs=1,n.push(r))}},Di.dequeue=function(r){for(var e=this,t=e.layersQueue,n=[],i=0;i<1&&0!==t.size();){var o=t.peek();if(o.replacement)t.pop();else if(o.replaces&&o!==o.replaces.replacement)t.pop();else if(o.invalid)t.pop();else{var a=o.elesQueue.shift();a&&(e.drawEleInLayer(o,a,o.level,r),i++),0===n.length&&n.push(!0),0===o.elesQueue.length&&(t.pop(),o.reqs=0,o.replaces&&e.applyLayerReplacement(o),e.requestRedraw())}}return n},Di.applyLayerReplacement=function(r){var t=this.layersByLevel[r.level],n=r.replaces,i=t.indexOf(n);if(!(i<0||n.invalid)){t[i]=r;for(var o=0;o<r.eles.length;o++){var a=r.eles[o]._private,s=a.imgLayerCaches=a.imgLayerCaches||{};s&&(s[r.level]=r)}this.requestRedraw()}},Di.requestRedraw=_h(function(){var r=this.renderer;r.redrawHint("eles",!0),r.redrawHint("drag",!0),r.redraw()},100),Di.setupDequeueing=FN_setupDequeueing({deqRedrawThreshold:50,deqCost:.15,deqAvgCost:.1,deqNoDrawCost:.9,deqFastCost:.9,deq:function(e,t){return e.dequeue(t)},onDeqd:O0,shouldRedraw:NP,priority:function(e){return e.renderer.beforeRenderPriorities.lyrTxrDeq}});var $N,jN={};function gH(r,e){for(var t=0;t<e.length;t++){var n=e[t];r.lineTo(n.x,n.y)}}function mH(r,e,t){for(var n,i=0;i<e.length;i++){var o=e[i];0===i&&(n=o),r.lineTo(o.x,o.y)}r.quadraticCurveTo(t.x,t.y,n.x,n.y)}function HN(r,e,t){r.beginPath&&r.beginPath();for(var n=e,i=0;i<n.length;i++)r.lineTo((o=n[i]).x,o.y);var a=t,s=t[0];for(r.moveTo(s.x,s.y),i=1;i<a.length;i++){var o;r.lineTo((o=a[i]).x,o.y)}r.closePath&&r.closePath()}function vH(r,e,t,n,i){r.beginPath&&r.beginPath(),r.arc(t,n,i,0,2*Math.PI,!1);var o=e,a=o[0];r.moveTo(a.x,a.y);for(var s=0;s<o.length;s++){var l=o[s];r.lineTo(l.x,l.y)}r.closePath&&r.closePath()}function yH(r,e,t,n){r.arc(e,t,n,0,2*Math.PI,!1)}jN.arrowShapeImpl=function(r){return($N||($N={polygon:gH,"triangle-backcurve":mH,"triangle-tee":HN,"circle-triangle":vH,"triangle-cross":HN,circle:yH}))[r]};var Sa={drawElement:function(r,e,t,n,i,o){e.isNode()?this.drawNode(r,e,t,n,i,o):this.drawEdge(r,e,t,n,i,o)},drawElementOverlay:function(r,e){e.isNode()?this.drawNodeOverlay(r,e):this.drawEdgeOverlay(r,e)},drawElementUnderlay:function(r,e){e.isNode()?this.drawNodeUnderlay(r,e):this.drawEdgeUnderlay(r,e)},drawCachedElementPortion:function(r,e,t,n,i,o,a,s){var l=this,u=t.getBoundingBox(e);if(0!==u.w&&0!==u.h){var c=t.getElement(e,u,n,i,o);if(null!=c){var d=s(l,e);if(0===d)return;var m,b,T,O,K,P,h=a(l,e),f=u.x1,g=u.y1,y=u.w,v=u.h;if(0!==h){var Z=t.getRotationPoint(e);r.translate(T=Z.x,O=Z.y),r.rotate(h),(K=l.getImgSmoothing(r))||l.setImgSmoothing(r,!0);var S=t.getRotationOffset(e);m=S.x,b=S.y}else m=f,b=g;1!==d&&(r.globalAlpha=(P=r.globalAlpha)*d),r.drawImage(c.texture.canvas,c.x,0,c.width,c.height,m,b,y,v),1!==d&&(r.globalAlpha=P),0!==h&&(r.rotate(-h),r.translate(-T,-O),K||l.setImgSmoothing(r,!1))}else t.drawElement(r,e)}}},_H=function(){return 0},wH=function(e,t){return e.getTextAngle(t,null)},bH=function(e,t){return e.getTextAngle(t,"source")},EH=function(e,t){return e.getTextAngle(t,"target")},TH=function(e,t){return t.effectiveOpacity()},ET=function(e,t){return t.pstyle("text-opacity").pfValue*t.effectiveOpacity()};Sa.drawCachedElement=function(r,e,t,n,i,o){var a=this,s=a.data,l=s.eleTxrCache,u=s.lblTxrCache,c=s.slbTxrCache,d=s.tlbTxrCache,h=e.boundingBox(),f=!0===o?l.reasons.highQuality:null;if(0!==h.w&&0!==h.h&&e.visible()&&(!n||G0(h,n))){var g=e.isEdge(),y=e.element()._private.rscratch.badLine;a.drawElementUnderlay(r,e),a.drawCachedElementPortion(r,e,l,t,i,f,_H,TH),(!g||!y)&&a.drawCachedElementPortion(r,e,u,t,i,f,wH,ET),g&&!y&&(a.drawCachedElementPortion(r,e,c,t,i,f,bH,ET),a.drawCachedElementPortion(r,e,d,t,i,f,EH,ET)),a.drawElementOverlay(r,e)}},Sa.drawElements=function(r,e){for(var n=0;n<e.length;n++)this.drawElement(r,e[n])},Sa.drawCachedElements=function(r,e,t,n){for(var o=0;o<e.length;o++)this.drawCachedElement(r,e[o],t,n)},Sa.drawCachedNodes=function(r,e,t,n){for(var o=0;o<e.length;o++){var a=e[o];a.isNode()&&this.drawCachedElement(r,a,t,n)}},Sa.drawLayeredElements=function(r,e,t,n){var o=this.data.lyrTxrCache.getLayers(e,t);if(o)for(var a=0;a<o.length;a++){var s=o[a],l=s.bb;0===l.w||0===l.h||r.drawImage(s.canvas,l.x1,l.y1,l.w,l.h)}else this.drawCachedElements(r,e,t,n)};var os={drawEdge:function(r,e,t){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,s=e._private.rscratch;if((!o||e.visible())&&!s.badLine&&null!=s.allpts&&!isNaN(s.allpts[0])){var l;t&&r.translate(-(l=t).x1,-l.y1);var u=o?e.pstyle("opacity").value:1,c=o?e.pstyle("line-opacity").value:1,d=e.pstyle("curve-style").value,h=e.pstyle("line-style").value,f=e.pstyle("width").pfValue,g=e.pstyle("line-cap").value,y=e.pstyle("line-outline-width").value,v=e.pstyle("line-outline-color").value,m=u*c,b=u*c,T=function(){var be=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;"straight-triangle"===d?(a.eleStrokeStyle(r,e,be),a.drawEdgeTrianglePath(e,r,s.allpts)):(r.lineWidth=f,r.lineCap=g,a.eleStrokeStyle(r,e,be),a.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")},S=function(){a.drawArrowheads(r,e,arguments.length>0&&void 0!==arguments[0]?arguments[0]:b)};if(r.lineJoin="round","yes"===e.pstyle("ghost").value){var q=e.pstyle("ghost-offset-x").pfValue,G=e.pstyle("ghost-offset-y").pfValue,X=e.pstyle("ghost-opacity").value,U=m*X;r.translate(q,G),T(U),S(U),r.translate(-q,-G)}else!function(){var be=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m;r.lineWidth=f+y,r.lineCap=g,y>0?(a.colorStrokeStyle(r,v[0],v[1],v[2],be),"straight-triangle"===d?a.drawEdgeTrianglePath(e,r,s.allpts):(a.drawEdgePath(e,r,s.allpts,h),r.lineCap="butt")):r.lineCap="butt"}();i&&a.drawEdgeUnderlay(r,e),T(),S(),i&&a.drawEdgeOverlay(r,e),a.drawElementText(r,e,null,n),t&&r.translate(l.x1,l.y1)}}},WN=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n){if(n.visible()){var i=n.pstyle("".concat(e,"-opacity")).value;if(0!==i){var o=this,a=o.usePaths(),s=n._private.rscratch,u=2*n.pstyle("".concat(e,"-padding")).pfValue,c=n.pstyle("".concat(e,"-color")).value;t.lineWidth=u,t.lineCap="self"!==s.edgeType||a?"round":"butt",o.colorStrokeStyle(t,c[0],c[1],c[2],i),o.drawEdgePath(n,t,s.allpts,"solid")}}}};os.drawEdgeOverlay=WN("overlay"),os.drawEdgeUnderlay=WN("underlay"),os.drawEdgePath=function(r,e,t,n){var a,i=r._private.rscratch,o=e,s=!1,l=this.usePaths(),u=r.pstyle("line-dash-pattern").pfValue,c=r.pstyle("line-dash-offset").pfValue;if(l){var d=t.join("$");i.pathCacheKey&&i.pathCacheKey===d?(a=e=i.pathCache,s=!0):(a=e=new Path2D,i.pathCacheKey=d,i.pathCache=a)}if(o.setLineDash)switch(n){case"dotted":o.setLineDash([1,1]);break;case"dashed":o.setLineDash(u),o.lineDashOffset=c;break;case"solid":o.setLineDash([])}if(!s&&!i.badLine)switch(e.beginPath&&e.beginPath(),e.moveTo(t[0],t[1]),i.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var f=2;f+3<t.length;f+=4)e.quadraticCurveTo(t[f],t[f+1],t[f+2],t[f+3]);break;case"straight":case"haystack":for(var g=2;g+1<t.length;g+=2)e.lineTo(t[g],t[g+1]);break;case"segments":if(i.isRound){var v,y=co(i.roundCorners);try{for(y.s();!(v=y.n()).done;)AN(e,v.value)}catch(T){y.e(T)}finally{y.f()}e.lineTo(t[t.length-2],t[t.length-1])}else for(var b=2;b+1<t.length;b+=2)e.lineTo(t[b],t[b+1])}e=o,l?e.stroke(a):e.stroke(),e.setLineDash&&e.setLineDash([])},os.drawEdgeTrianglePath=function(r,e,t){e.fillStyle=e.strokeStyle;for(var n=r.pstyle("width").pfValue,i=0;i+1<t.length;i+=2){var o=[t[i+2]-t[i],t[i+3]-t[i+1]],a=Math.sqrt(o[0]*o[0]+o[1]*o[1]),s=[o[1]/a,-o[0]/a],l=[s[0]*n/2,s[1]*n/2];e.beginPath(),e.moveTo(t[i]-l[0],t[i+1]-l[1]),e.lineTo(t[i]+l[0],t[i+1]+l[1]),e.lineTo(t[i+2],t[i+3]),e.closePath(),e.fill()}},os.drawArrowheads=function(r,e,t){var n=e._private.rscratch,i="haystack"===n.edgeType;i||this.drawArrowhead(r,e,"source",n.arrowStartX,n.arrowStartY,n.srcArrowAngle,t),this.drawArrowhead(r,e,"mid-target",n.midX,n.midY,n.midtgtArrowAngle,t),this.drawArrowhead(r,e,"mid-source",n.midX,n.midY,n.midsrcArrowAngle,t),i||this.drawArrowhead(r,e,"target",n.arrowEndX,n.arrowEndY,n.tgtArrowAngle,t)},os.drawArrowhead=function(r,e,t,n,i,o,a){if(!(isNaN(n)||null==n||isNaN(i)||null==i||isNaN(o)||null==o)){var s=this,l=e.pstyle(t+"-arrow-shape").value;if("none"!==l){var u="hollow"===e.pstyle(t+"-arrow-fill").value?"both":"filled",c=e.pstyle(t+"-arrow-fill").value,d=e.pstyle("width").pfValue,h=e.pstyle(t+"-arrow-width"),f="match-line"===h.value?d:h.pfValue;"%"===h.units&&(f*=d);var g=e.pstyle("opacity").value;void 0===a&&(a=g);var y=r.globalCompositeOperation;(1!==a||"hollow"===c)&&(r.globalCompositeOperation="destination-out",s.colorFillStyle(r,255,255,255,1),s.colorStrokeStyle(r,255,255,255,1),s.drawArrowShape(e,r,u,d,l,f,n,i,o),r.globalCompositeOperation=y);var v=e.pstyle(t+"-arrow-color").value;s.colorFillStyle(r,v[0],v[1],v[2],a),s.colorStrokeStyle(r,v[0],v[1],v[2],a),s.drawArrowShape(e,r,c,d,l,f,n,i,o)}}},os.drawArrowShape=function(r,e,t,n,i,o,a,s,l){var h,u=this,c=this.usePaths()&&"triangle-cross"!==i,d=!1,f=e,g={x:a,y:s},y=r.pstyle("arrow-scale").value,v=this.getArrowWidth(n,y),m=u.arrowShapes[i];if(c){var b=u.arrowPathCache=u.arrowPathCache||[],T=jl(i),O=b[T];null!=O?(h=e=O,d=!0):(h=e=new Path2D,b[T]=h)}d||(e.beginPath&&e.beginPath(),c?m.draw(e,1,0,{x:0,y:0},1):m.draw(e,v,l,g,n),e.closePath&&e.closePath()),e=f,c&&(e.translate(a,s),e.rotate(l),e.scale(v,v)),("filled"===t||"both"===t)&&(c?e.fill(h):e.fill()),("hollow"===t||"both"===t)&&(e.lineWidth=o/(c?v:1),e.lineJoin="miter",c?e.stroke(h):e.stroke()),c&&(e.scale(1/v,1/v),e.rotate(-l),e.translate(-a,-s))};var TT={safeDrawImage:function(r,e,t,n,i,o,a,s,l,u){if(!(i<=0||o<=0||l<=0||u<=0))try{r.drawImage(e,t,n,i,o,a,s,l,u)}catch(c){Qr(c)}},drawInscribedImage:function(r,e,t,n,i){var o=this,a=t.position(),s=a.x,l=a.y,u=t.cy().style(),c=u.getIndexedStyle.bind(u),d=c(t,"background-fit","value",n),h=c(t,"background-repeat","value",n),f=t.width(),g=t.height(),y=2*t.padding(),v=f+("inner"===c(t,"background-width-relative-to","value",n)?0:y),m=g+("inner"===c(t,"background-height-relative-to","value",n)?0:y),b=t._private.rscratch,O="node"===c(t,"background-clip","value",n),K=c(t,"background-image-opacity","value",n)*i,Z=c(t,"background-image-smoothing","value",n),S=t.pstyle("corner-radius").value;"auto"!==S&&(S=t.pstyle("corner-radius").pfValue);var P=e.width||e.cachedW,M=e.height||e.cachedH;(null==P||null==M)&&(document.body.appendChild(e),P=e.cachedW=e.width||e.offsetWidth,M=e.cachedH=e.height||e.offsetHeight,document.body.removeChild(e));var q=P,G=M;if("auto"!==c(t,"background-width","value",n)&&(q="%"===c(t,"background-width","units",n)?c(t,"background-width","pfValue",n)*v:c(t,"background-width","pfValue",n)),"auto"!==c(t,"background-height","value",n)&&(G="%"===c(t,"background-height","units",n)?c(t,"background-height","pfValue",n)*m:c(t,"background-height","pfValue",n)),0!==q&&0!==G){if("contain"===d)q*=X=Math.min(v/q,m/G),G*=X;else if("cover"===d){var X;q*=X=Math.max(v/q,m/G),G*=X}var U=s-v/2,me=c(t,"background-position-x","units",n),be=c(t,"background-position-x","pfValue",n);U+="%"===me?(v-q)*be:be;var Ae=c(t,"background-offset-x","units",n),_e=c(t,"background-offset-x","pfValue",n);U+="%"===Ae?(v-q)*_e:_e;var Se=l-m/2,je=c(t,"background-position-y","units",n),Xe=c(t,"background-position-y","pfValue",n);Se+="%"===je?(m-G)*Xe:Xe;var De=c(t,"background-offset-y","units",n),ze=c(t,"background-offset-y","pfValue",n);Se+="%"===De?(m-G)*ze:ze,b.pathCache&&(U-=s,Se-=l,s=0,l=0);var lt=r.globalAlpha;r.globalAlpha=K;var yt=o.getImgSmoothing(r),ot=!1;if("no"===Z&&yt?(o.setImgSmoothing(r,!1),ot=!0):"yes"===Z&&!yt&&(o.setImgSmoothing(r,!0),ot=!0),"no-repeat"===h)O&&(r.save(),b.pathCache?r.clip(b.pathCache):(o.nodeShapes[o.getNodeShape(t)].draw(r,s,l,v,m,S,b),r.clip())),o.safeDrawImage(r,e,0,0,P,M,U,Se,q,G),O&&r.restore();else{var bt=r.createPattern(e,h);r.fillStyle=bt,o.nodeShapes[o.getNodeShape(t)].draw(r,s,l,v,m,S,b),r.translate(U,Se),r.fill(),r.translate(-U,-Se)}r.globalAlpha=lt,ot&&o.setImgSmoothing(r,yt)}}},eu={};function XN(r,e,t,n,i){var a=Math.min(arguments.length>5&&void 0!==arguments[5]?arguments[5]:5,n/2,i/2);r.beginPath(),r.moveTo(e+a,t),r.lineTo(e+n-a,t),r.quadraticCurveTo(e+n,t,e+n,t+a),r.lineTo(e+n,t+i-a),r.quadraticCurveTo(e+n,t+i,e+n-a,t+i),r.lineTo(e+a,t+i),r.quadraticCurveTo(e,t+i,e,t+i-a),r.lineTo(e,t+a),r.quadraticCurveTo(e,t,e+a,t),r.closePath()}eu.eleTextBiggerThanMin=function(r,e){if(!e){var t=r.cy().zoom(),n=this.getPixelRatio(),i=Math.ceil(U0(t*n));e=Math.pow(2,i)}return!(r.pstyle("font-size").pfValue*e<r.pstyle("min-zoomed-font-size").pfValue)},eu.drawElementText=function(r,e,t,n,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this;if(null==n){if(o&&!a.eleTextBiggerThanMin(e))return}else if(!1===n)return;if(e.isNode()){var s=e.pstyle("label");if(!s||!s.value)return;var l=a.getLabelJustification(e);r.textAlign=l,r.textBaseline="bottom"}else{var u=e.element()._private.rscratch.badLine,c=e.pstyle("label"),d=e.pstyle("source-label"),h=e.pstyle("target-label");if(u||(!c||!c.value)&&(!d||!d.value)&&(!h||!h.value))return;r.textAlign="center",r.textBaseline="bottom"}var g,f=!t;t&&r.translate(-(g=t).x1,-g.y1),null==i?(a.drawText(r,e,null,f,o),e.isEdge()&&(a.drawText(r,e,"source",f,o),a.drawText(r,e,"target",f,o))):a.drawText(r,e,i,f,o),t&&r.translate(g.x1,g.y1)},eu.getFontCache=function(r){var e;this.fontCaches=this.fontCaches||[];for(var t=0;t<this.fontCaches.length;t++)if((e=this.fontCaches[t]).context===r)return e;return this.fontCaches.push(e={context:r}),e},eu.setupTextStyle=function(r,e){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=e.pstyle("font-style").strValue,i=e.pstyle("font-size").pfValue+"px",o=e.pstyle("font-family").strValue,a=e.pstyle("font-weight").strValue,s=t?e.effectiveOpacity()*e.pstyle("text-opacity").value:1,l=e.pstyle("text-outline-opacity").value*s,u=e.pstyle("color").value,c=e.pstyle("text-outline-color").value;r.font=n+" "+a+" "+i+" "+o,r.lineJoin="round",this.colorFillStyle(r,u[0],u[1],u[2],s),this.colorStrokeStyle(r,c[0],c[1],c[2],l)},eu.getTextAngle=function(r,e){var t,i=r._private.rscratch,a=r.pstyle((e?e+"-":"")+"text-rotation");if("autorotate"===a.strValue){var s=ho(i,"labelAngle",e);t=r.isEdge()?s:0}else t="none"===a.strValue?0:a.pfValue;return t},eu.drawText=function(r,e,t){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=e._private.rscratch,s=i?e.effectiveOpacity():1;if(!i||0!==s&&0!==e.pstyle("text-opacity").value){"main"===t&&(t=null);var c,d,l=ho(a,"labelX",t),u=ho(a,"labelY",t),h=this.getLabelText(e,t);if(null!=h&&""!==h&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(r,e,i);var K,f=t?t+"-":"",g=ho(a,"labelWidth",t),y=ho(a,"labelHeight",t),v=e.pstyle(f+"text-margin-x").pfValue,m=e.pstyle(f+"text-margin-y").pfValue,b=e.isEdge(),T=e.pstyle("text-halign").value,O=e.pstyle("text-valign").value;switch(b&&(T="center",O="center"),l+=v,u+=m,0!==(K=n?this.getTextAngle(e,t):0)&&(r.translate(c=l,d=u),r.rotate(K),l=0,u=0),O){case"top":break;case"center":u+=y/2;break;case"bottom":u+=y}var Z=e.pstyle("text-background-opacity").value,S=e.pstyle("text-border-opacity").value,P=e.pstyle("text-border-width").pfValue,M=e.pstyle("text-background-padding").pfValue,q=e.pstyle("text-background-shape").strValue,G="round-rectangle"===q||"roundrectangle"===q,X="circle"===q;if(Z>0||P>0&&S>0){var me=r.fillStyle,be=r.strokeStyle,Ae=r.lineWidth,_e=e.pstyle("text-background-color").value,Se=e.pstyle("text-border-color").value,je=e.pstyle("text-border-style").value,Xe=Z>0,De=P>0&&S>0,ze=l-M;switch(T){case"left":ze-=g;break;case"center":ze-=g/2}var lt=u-y-M,yt=g+2*M,ot=y+2*M;if(Xe&&(r.fillStyle="rgba(".concat(_e[0],",").concat(_e[1],",").concat(_e[2],",").concat(Z*s,")")),De&&(r.strokeStyle="rgba(".concat(Se[0],",").concat(Se[1],",").concat(Se[2],",").concat(S*s,")"),r.lineWidth=P,r.setLineDash))switch(je){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"double":r.lineWidth=P/4,r.setLineDash([]);break;default:r.setLineDash([])}if(G?(r.beginPath(),XN(r,ze,lt,yt,ot,2)):X?(r.beginPath(),function IH(r,e,t,n,i){var a=Math.min(n,i)/2,s=e+n/2,l=t+i/2;r.beginPath(),r.arc(s,l,a,0,2*Math.PI),r.closePath()}(r,ze,lt,yt,ot)):(r.beginPath(),r.rect(ze,lt,yt,ot)),Xe&&r.fill(),De&&r.stroke(),De&&"double"===je){var bt=P/2;r.beginPath(),G?XN(r,ze+bt,lt+bt,yt-2*bt,ot-2*bt,2):r.rect(ze+bt,lt+bt,yt-2*bt,ot-2*bt),r.stroke()}r.fillStyle=me,r.strokeStyle=be,r.lineWidth=Ae,r.setLineDash&&r.setLineDash([])}var xt=2*e.pstyle("text-outline-width").pfValue;if(xt>0&&(r.lineWidth=xt),"wrap"===e.pstyle("text-wrap").value){var zt=ho(a,"labelWrapCachedLines",t),_t=ho(a,"labelLineHeight",t),Ue=g/2,He=this.getLabelJustification(e);switch("auto"===He||("left"===T?"left"===He?l+=-g:"center"===He&&(l+=-Ue):"center"===T?"left"===He?l+=-Ue:"right"===He&&(l+=Ue):"right"===T&&("center"===He?l+=Ue:"right"===He&&(l+=g))),O){case"top":case"center":case"bottom":u-=(zt.length-1)*_t}for(var Ye=0;Ye<zt.length;Ye++)xt>0&&r.strokeText(zt[Ye],l,u),r.fillText(zt[Ye],l,u),u+=_t}else xt>0&&r.strokeText(h,l,u),r.fillText(h,l,u);0!==K&&(r.rotate(-K),r.translate(-c,-d))}}};var Qs={drawNode:function(r,e,t){var s,l,n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],a=this,u=e._private,c=u.rscratch,d=e.position();if(Ut(d.x)&&Ut(d.y)&&(!o||e.visible())){var g,m,h=o?e.effectiveOpacity():1,f=a.usePaths(),y=!1,v=e.padding();s=e.width()+2*v,l=e.height()+2*v,t&&r.translate(-(m=t).x1,-m.y1);for(var T=e.pstyle("background-image").value,O=new Array(T.length),K=new Array(T.length),Z=0,S=0;S<T.length;S++){var P=T[S];if(O[S]=null!=P&&"none"!==P){var q=e.cy().style().getIndexedStyle(e,"background-image-crossorigin","value",S);Z++,K[S]=a.getCachedImage(P,q,function(){u.backgroundTimestamp=Date.now(),e.emitAndNotify("background")})}}var G=e.pstyle("background-blacken").value,X=e.pstyle("border-width").pfValue,U=e.pstyle("background-opacity").value*h,me=e.pstyle("border-color").value,be=e.pstyle("border-style").value,Ae=e.pstyle("border-join").value,_e=e.pstyle("border-cap").value,Se=e.pstyle("border-position").value,je=e.pstyle("border-dash-pattern").pfValue,Xe=e.pstyle("border-dash-offset").pfValue,De=e.pstyle("border-opacity").value*h,ze=e.pstyle("outline-width").pfValue,lt=e.pstyle("outline-color").value,yt=e.pstyle("outline-style").value,ot=e.pstyle("outline-opacity").value*h,bt=e.pstyle("outline-offset").value,xt=e.pstyle("corner-radius").value;"auto"!==xt&&(xt=e.pstyle("corner-radius").pfValue);var zt=function(){a.eleFillStyle(r,e,arguments.length>0&&void 0!==arguments[0]?arguments[0]:U)},_t=function(){a.colorStrokeStyle(r,me[0],me[1],me[2],arguments.length>0&&void 0!==arguments[0]?arguments[0]:De)},Ue=function(){a.colorStrokeStyle(r,lt[0],lt[1],lt[2],arguments.length>0&&void 0!==arguments[0]?arguments[0]:ot)},He=function(Xt,ut,le,$e){var Ht,rt=a.nodePathCache=a.nodePathCache||[],nt=kP("polygon"===le?le+","+$e.join(","):le,""+ut,""+Xt,""+xt),it=rt[nt],Et=!1;return null!=it?(Et=!0,c.pathCache=Ht=it):(Ht=new Path2D,rt[nt]=c.pathCache=Ht),{path:Ht,cacheHit:Et}},Ye=e.pstyle("shape").strValue,pt=e.pstyle("shape-polygon-points").pfValue;if(f){r.translate(d.x,d.y);var Lt=He(s,l,Ye,pt);g=Lt.path,y=Lt.cacheHit}var tr=function(){if(!y){var Xt=d;f&&(Xt={x:0,y:0}),a.nodeShapes[a.getNodeShape(e)].draw(g||r,Xt.x,Xt.y,s,l,xt,c)}f?r.fill(g):r.fill()},Ur=function(){for(var Xt=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,ut=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],le=u.backgrounding,$e=0,rt=0;rt<K.length;rt++){var nt=e.cy().style().getIndexedStyle(e,"background-image-containment","value",rt);ut&&"over"===nt||!ut&&"inside"===nt?$e++:O[rt]&&K[rt].complete&&!K[rt].error&&($e++,a.drawInscribedImage(r,K[rt],e,rt,Xt))}u.backgrounding=$e!==Z,le!==u.backgrounding&&e.updateStyle(!1)},vr=function(){var Xt=arguments.length>0&&void 0!==arguments[0]&&arguments[0],ut=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;a.hasPie(e)&&(a.drawPie(r,e,ut),Xt&&(f||a.nodeShapes[a.getNodeShape(e)].draw(r,d.x,d.y,s,l,xt,c)))},cr=function(){var Xt=arguments.length>0&&void 0!==arguments[0]&&arguments[0],ut=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;a.hasStripe(e)&&(r.save(),f?r.clip(c.pathCache):(a.nodeShapes[a.getNodeShape(e)].draw(r,d.x,d.y,s,l,xt,c),r.clip()),a.drawStripe(r,e,ut),r.restore(),Xt&&(f||a.nodeShapes[a.getNodeShape(e)].draw(r,d.x,d.y,s,l,xt,c)))},ar=function(){var le=G>0?0:255;0!==G&&(a.colorFillStyle(r,le,le,le,(G>0?G:-G)*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:h)),f?r.fill(g):r.fill())},Rt=function(){if(X>0){if(r.lineWidth=X,r.lineCap=_e,r.lineJoin=Ae,r.setLineDash)switch(be){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash(je),r.lineDashOffset=Xe;break;case"solid":case"double":r.setLineDash([])}if("center"!==Se){if(r.save(),r.lineWidth*=2,"inside"===Se)f?r.clip(g):r.clip();else{var Xt=new Path2D;Xt.rect(-s/2-X,-l/2-X,s+2*X,l+2*X),Xt.addPath(g),r.clip(Xt,"evenodd")}f?r.stroke(g):r.stroke(),r.restore()}else f?r.stroke(g):r.stroke();if("double"===be){r.lineWidth=X/3;var ut=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",f?r.stroke(g):r.stroke(),r.globalCompositeOperation=ut}r.setLineDash&&r.setLineDash([])}},Gt=function(){if(ze>0){if(r.lineWidth=ze,r.lineCap="butt",r.setLineDash)switch(yt){case"dotted":r.setLineDash([1,1]);break;case"dashed":r.setLineDash([4,2]);break;case"solid":case"double":r.setLineDash([])}var Xt=d;f&&(Xt={x:0,y:0});var ut=a.getNodeShape(e),le=X;"inside"===Se&&(le=0),"outside"===Se&&(le*=2);var Et,$e=(s+le+(ze+bt))/s,rt=(l+le+(ze+bt))/l,nt=s*$e,it=l*rt,Ht=a.nodeShapes[ut].points;if(f&&(Et=He(nt,it,ut,Ht).path),"ellipse"===ut)a.drawEllipsePath(Et||r,Xt.x,Xt.y,nt,it);else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(ut)){var $t=0,dr=0,hr=0;"round-diamond"===ut?$t=1.4*(le+bt+ze):"round-heptagon"===ut?($t=1.075*(le+bt+ze),hr=-(le/2+bt+ze)/35):"round-hexagon"===ut?$t=1.12*(le+bt+ze):"round-pentagon"===ut?($t=1.13*(le+bt+ze),hr=-(le/2+bt+ze)/15):"round-tag"===ut?($t=1.12*(le+bt+ze),dr=.07*(le/2+ze+bt)):"round-triangle"===ut&&($t=(le+bt+ze)*(Math.PI/2),hr=-(le+bt/2+ze)/Math.PI),0!==$t&&(nt=s*($e=(s+$t)/s),["round-hexagon","round-tag"].includes(ut)||(it=l*(rt=(l+$t)/l)));for(var br=nt/2,Yt=it/2,Er=(xt="auto"===xt?XP(nt,it):xt)+(le+ze+bt)/2,Pr=new Array(Ht.length/2),Wn=new Array(Ht.length/2),tn=0;tn<Ht.length/2;tn++)Pr[tn]={x:Xt.x+dr+br*Ht[2*tn],y:Xt.y+hr+Yt*Ht[2*tn+1]};var Ni,Un,Mn,zn,ti=Pr.length;for(Un=Pr[ti-1],Ni=0;Ni<ti;Ni++)Wn[Ni]=yT(Un,Mn=Pr[Ni%ti],zn=Pr[(Ni+1)%ti],Er),Un=Mn,Mn=zn;a.drawRoundPolygonPath(Et||r,Xt.x+dr,Xt.y+hr,s*$e,l*rt,Ht,Wn)}else["roundrectangle","round-rectangle"].includes(ut)?(xt="auto"===xt?Gs(nt,it):xt,a.drawRoundRectanglePath(Et||r,Xt.x,Xt.y,nt,it,xt+(le+ze+bt)/2)):["cutrectangle","cut-rectangle"].includes(ut)?a.drawCutRectanglePath(Et||r,Xt.x,Xt.y,nt,it,null,(xt="auto"===xt?8:xt)+(le+ze+bt)/4):["bottomroundrectangle","bottom-round-rectangle"].includes(ut)?(xt="auto"===xt?Gs(nt,it):xt,a.drawBottomRoundRectanglePath(Et||r,Xt.x,Xt.y,nt,it,xt+(le+ze+bt)/2)):"barrel"===ut?a.drawBarrelPath(Et||r,Xt.x,Xt.y,nt,it):ut.startsWith("polygon")||["rhomboid","right-rhomboid","round-tag","tag","vee"].includes(ut)?(Ht=yg(_g(Ht,(le+ze+bt)/s)),a.drawPolygonPath(Et||r,Xt.x,Xt.y,s,l,Ht)):(Ht=yg(_g(Ht,-(le+ze+bt)/s)),a.drawPolygonPath(Et||r,Xt.x,Xt.y,s,l,Ht));if(f?r.stroke(Et):r.stroke(),"double"===yt){r.lineWidth=le/3;var sa=r.globalCompositeOperation;r.globalCompositeOperation="destination-out",f?r.stroke(Et):r.stroke(),r.globalCompositeOperation=sa}r.setLineDash&&r.setLineDash([])}};if("yes"===e.pstyle("ghost").value){var Rr=e.pstyle("ghost-offset-x").pfValue,$r=e.pstyle("ghost-offset-y").pfValue,Hr=e.pstyle("ghost-opacity").value,Gr=Hr*h;r.translate(Rr,$r),Ue(),Gt(),zt(Hr*U),tr(),Ur(Gr,!0),_t(Hr*De),Rt(),vr(0!==G||0!==X),cr(0!==G||0!==X),Ur(Gr,!1),ar(Gr),r.translate(-Rr,-$r)}f&&r.translate(-d.x,-d.y),i&&a.drawNodeUnderlay(r,e,d,s,l),f&&r.translate(d.x,d.y),Ue(),Gt(),zt(),tr(),Ur(h,!0),_t(),Rt(),vr(0!==G||0!==X),cr(0!==G||0!==X),Ur(h,!1),ar(),f&&r.translate(-d.x,-d.y),a.drawElementText(r,e,null,n),i&&a.drawNodeOverlay(r,e,d,s,l),t&&r.translate(m.x1,m.y1)}}},KN=function(e){if(!["overlay","underlay"].includes(e))throw new Error("Invalid state");return function(t,n,i,o,a){if(n.visible()){var l=n.pstyle("".concat(e,"-padding")).pfValue,u=n.pstyle("".concat(e,"-opacity")).value,c=n.pstyle("".concat(e,"-color")).value,d=n.pstyle("".concat(e,"-shape")).value,h=n.pstyle("".concat(e,"-corner-radius")).value;if(u>0){if(i=i||n.position(),null==o||null==a){var f=n.padding();o=n.width()+2*f,a=n.height()+2*f}this.colorFillStyle(t,c[0],c[1],c[2],u),this.nodeShapes[d].draw(t,i.x,i.y,o+2*l,a+2*l,h),t.fill()}}}};Qs.drawNodeOverlay=KN("overlay"),Qs.drawNodeUnderlay=KN("underlay"),Qs.hasPie=function(r){return(r=r[0])._private.hasPie},Qs.hasStripe=function(r){return(r=r[0])._private.hasStripe},Qs.drawPie=function(r,e,t,n){e=e[0],n=n||e.position();var f,i=e.cy().style(),o=e.pstyle("pie-size"),a=e.pstyle("pie-hole"),s=e.pstyle("pie-start-angle").pfValue,l=n.x,u=n.y,c=e.width(),d=e.height(),h=Math.min(c,d)/2,g=0;if(this.usePaths()&&(l=0,u=0),"%"===o.units?h*=o.pfValue:void 0!==o.pfValue&&(h=o.pfValue/2),"%"===a.units?f=h*a.pfValue:void 0!==a.pfValue&&(f=a.pfValue/2),!(f>=h))for(var v=1;v<=i.pieBackgroundN;v++){var m=e.pstyle("pie-"+v+"-background-size").value,b=e.pstyle("pie-"+v+"-background-color").value,T=e.pstyle("pie-"+v+"-background-opacity").value*t,O=m/100;O+g>1&&(O=1-g);var K=1.5*Math.PI+2*Math.PI*g,S=(K+=s)+2*Math.PI*O;0===m||g>=1||g+O>1||(0===f?(r.beginPath(),r.moveTo(l,u),r.arc(l,u,h,K,S),r.closePath()):(r.beginPath(),r.arc(l,u,h,K,S),r.arc(l,u,f,S,K,!0),r.closePath()),this.colorFillStyle(r,b[0],b[1],b[2],T),r.fill(),g+=O)}},Qs.drawStripe=function(r,e,t,n){e=e[0],n=n||e.position();var i=e.cy().style(),o=n.x,a=n.y,s=e.width(),l=e.height(),u=0,c=this.usePaths();r.save();var d=e.pstyle("stripe-direction").value,h=e.pstyle("stripe-size");switch(d){case"vertical":break;case"righward":r.rotate(-Math.PI/2)}var f=s,g=l;"%"===h.units?(f*=h.pfValue,g*=h.pfValue):void 0!==h.pfValue&&(f=h.pfValue,g=h.pfValue),c&&(o=0,a=0),a-=f/2,o-=g/2;for(var y=1;y<=i.stripeBackgroundN;y++){var v=e.pstyle("stripe-"+y+"-background-size").value,m=e.pstyle("stripe-"+y+"-background-color").value,b=e.pstyle("stripe-"+y+"-background-opacity").value*t,T=v/100;T+u>1&&(T=1-u),!(0===v||u>=1||u+T>1)&&(r.beginPath(),r.rect(o,a+g*u,f,g*T),r.closePath(),this.colorFillStyle(r,m[0],m[1],m[2],b),r.fill(),u+=T)}r.restore()};var jh,ro={};function YN(r,e,t){var n=r.createShader(e);if(r.shaderSource(n,t),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw new Error(r.getShaderInfoLog(n));return n}function SH(r,e,t){void 0===t&&(t=e);var n=r.makeOffscreenCanvas(e,t),i=n.context=n.getContext("2d");return n.clear=function(){return i.clearRect(0,0,n.width,n.height)},n.clear(),n}function IT(r){var e=r.pixelRatio,t=r.cy.zoom(),n=r.cy.pan();return{zoom:t*e,pan:{x:n.x*e,y:n.y*e}}}function PH(r){return"solid"===r.pstyle("background-fill").value&&"none"===r.pstyle("background-image").strValue&&(0===r.pstyle("border-width").value||0===r.pstyle("border-opacity").value||"solid"===r.pstyle("border-style").value)}function kH(r,e){if(r.length!==e.length)return!1;for(var t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}function tu(r,e,t){var n=r[0]/255,i=r[1]/255,o=r[2]/255,a=e,s=t||new Array(4);return s[0]=n*a,s[1]=i*a,s[2]=o*a,s[3]=a,s}function Dc(r,e){var t=e||new Array(4);return t[0]=(255&r)/255,t[1]=(r>>8&255)/255,t[2]=(r>>16&255)/255,t[3]=(r>>24&255)/255,t}function DH(r){return r[0]+(r[1]<<8)+(r[2]<<16)+(r[3]<<24)}function QN(r,e){switch(e){case"float":return[1,r.FLOAT,4];case"vec2":return[2,r.FLOAT,4];case"vec3":return[3,r.FLOAT,4];case"vec4":return[4,r.FLOAT,4];case"int":return[1,r.INT,4];case"ivec2":return[2,r.INT,4]}}function JN(r,e,t){switch(e){case r.FLOAT:return new Float32Array(t);case r.INT:return new Int32Array(t)}}function LH(r,e,t,n,i,o){switch(e){case r.FLOAT:return new Float32Array(t.buffer,o*n,i);case r.INT:return new Int32Array(t.buffer,o*n,i)}}function Ca(r,e,t,n){var o=Zn(QN(r,t),3),a=o[0],s=o[1],l=o[2],u=JN(r,s,e*a),c=a*l,d=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,d),r.bufferData(r.ARRAY_BUFFER,e*c,r.DYNAMIC_DRAW),r.enableVertexAttribArray(n),s===r.FLOAT?r.vertexAttribPointer(n,a,s,!1,c,0):s===r.INT&&r.vertexAttribIPointer(n,a,s,c,0),r.vertexAttribDivisor(n,1),r.bindBuffer(r.ARRAY_BUFFER,null);for(var h=new Array(e),f=0;f<e;f++)h[f]=LH(r,s,u,c,a,f);return d.dataArray=u,d.stride=c,d.size=a,d.getView=function(g){return h[g]},d.setPoint=function(g,y,v){var m=h[g];m[0]=y,m[1]=v},d.bufferSubData=function(g){r.bindBuffer(r.ARRAY_BUFFER,d),g?r.bufferSubData(r.ARRAY_BUFFER,0,u,0,g*a):r.bufferSubData(r.ARRAY_BUFFER,0,u)},d}ro.getPixelRatio=function(){var r=this.data.contexts[0];return null!=this.forcedPixelRatio?this.forcedPixelRatio:(this.cy.window().devicePixelRatio||1)/(r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1)},ro.paintCache=function(r){for(var n,e=this.paintCaches=this.paintCaches||[],t=!0,i=0;i<e.length;i++)if((n=e[i]).context===r){t=!1;break}return t&&e.push(n={context:r}),n},ro.createGradientStyleFor=function(r,e,t,n,i){var o,a=this.usePaths(),s=t.pstyle(e+"-gradient-stop-colors").value,l=t.pstyle(e+"-gradient-stop-positions").pfValue;if("radial-gradient"===n)if(t.isEdge()){var u=t.sourceEndpoint(),c=t.targetEndpoint(),d=t.midpoint(),h=$l(u,d),f=$l(c,d);o=r.createRadialGradient(d.x,d.y,0,d.x,d.y,Math.max(h,f))}else{var g=a?{x:0,y:0}:t.position(),y=t.paddedWidth(),v=t.paddedHeight();o=r.createRadialGradient(g.x,g.y,0,g.x,g.y,Math.max(y,v))}else if(t.isEdge()){var m=t.sourceEndpoint(),b=t.targetEndpoint();o=r.createLinearGradient(m.x,m.y,b.x,b.y)}else{var T=a?{x:0,y:0}:t.position(),Z=t.paddedWidth()/2,S=t.paddedHeight()/2;switch(t.pstyle("background-gradient-direction").value){case"to-bottom":o=r.createLinearGradient(T.x,T.y-S,T.x,T.y+S);break;case"to-top":o=r.createLinearGradient(T.x,T.y+S,T.x,T.y-S);break;case"to-left":o=r.createLinearGradient(T.x+Z,T.y,T.x-Z,T.y);break;case"to-right":o=r.createLinearGradient(T.x-Z,T.y,T.x+Z,T.y);break;case"to-bottom-right":case"to-right-bottom":o=r.createLinearGradient(T.x-Z,T.y-S,T.x+Z,T.y+S);break;case"to-top-right":case"to-right-top":o=r.createLinearGradient(T.x-Z,T.y+S,T.x+Z,T.y-S);break;case"to-bottom-left":case"to-left-bottom":o=r.createLinearGradient(T.x+Z,T.y-S,T.x-Z,T.y+S);break;case"to-top-left":case"to-left-top":o=r.createLinearGradient(T.x+Z,T.y+S,T.x-Z,T.y-S)}}if(!o)return null;for(var M=l.length===s.length,q=s.length,G=0;G<q;G++)o.addColorStop(M?l[G]:G/(q-1),"rgba("+s[G][0]+","+s[G][1]+","+s[G][2]+","+i+")");return o},ro.gradientFillStyle=function(r,e,t,n){var i=this.createGradientStyleFor(r,"background",e,t,n);if(!i)return null;r.fillStyle=i},ro.colorFillStyle=function(r,e,t,n,i){r.fillStyle="rgba("+e+","+t+","+n+","+i+")"},ro.eleFillStyle=function(r,e,t){var n=e.pstyle("background-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientFillStyle(r,e,n,t);else{var i=e.pstyle("background-color").value;this.colorFillStyle(r,i[0],i[1],i[2],t)}},ro.gradientStrokeStyle=function(r,e,t,n){var i=this.createGradientStyleFor(r,"line",e,t,n);if(!i)return null;r.strokeStyle=i},ro.colorStrokeStyle=function(r,e,t,n,i){r.strokeStyle="rgba("+e+","+t+","+n+","+i+")"},ro.eleStrokeStyle=function(r,e,t){var n=e.pstyle("line-fill").value;if("linear-gradient"===n||"radial-gradient"===n)this.gradientStrokeStyle(r,e,n,t);else{var i=e.pstyle("line-color").value;this.colorStrokeStyle(r,i[0],i[1],i[2],t)}},ro.matchCanvasSize=function(r){var e=this,t=e.data,n=e.findContainerClientCoords(),i=n[2],o=n[3],a=e.getPixelRatio();(r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE]||r===e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG])&&(a=e.motionBlurPxRatio);var c,l=i*a,u=o*a;if(l!==e.canvasWidth||u!==e.canvasHeight){e.fontCaches=null;var d=t.canvasContainer;d.style.width=i+"px",d.style.height=o+"px";for(var h=0;h<e.CANVAS_LAYERS;h++)(c=t.canvases[h]).width=l,c.height=u,c.style.width=i+"px",c.style.height=o+"px";for(h=0;h<e.BUFFER_COUNT;h++)(c=t.bufferCanvases[h]).width=l,c.height=u,c.style.width=i+"px",c.style.height=o+"px";e.textureMult=1,a<=1&&(c=t.bufferCanvases[e.TEXTURE_BUFFER],e.textureMult=2,c.width=l*e.textureMult,c.height=u*e.textureMult),e.canvasWidth=l,e.canvasHeight=u,e.pixelRatio=a}},ro.renderTo=function(r,e,t,n){this.render({forcedContext:r,forcedZoom:e,forcedPan:t,drawAllLayers:!0,forcedPxRatio:n})},ro.clearCanvas=function(){var r=this,e=r.data;function t(n){n.clearRect(0,0,r.canvasWidth,r.canvasHeight)}t(e.contexts[r.NODE]),t(e.contexts[r.DRAG])},ro.render=function(r){var e=this;r=r||FP();var t=e.cy,n=r.forcedContext,i=r.drawAllLayers,o=r.drawOnlyNodeLayer,a=r.forcedZoom,s=r.forcedPan,l=void 0===r.forcedPxRatio?this.getPixelRatio():r.forcedPxRatio,u=e.data,c=u.canvasNeedsRedraw,d=e.textureOnViewport&&!n&&(e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming),h=void 0!==r.motionBlur?r.motionBlur:e.motionBlur,f=e.motionBlurPxRatio,g=t.hasCompoundNodes(),y=e.hoverData.draggingEles,m=h=h&&!n&&e.motionBlurEnabled&&!(e.hoverData.selecting||e.touchData.selecting);n||(e.prevPxRatio!==l&&(e.invalidateContainerClientCoordsCache(),e.matchCanvasSize(e.container),e.redrawHint("eles",!0),e.redrawHint("drag",!0)),e.prevPxRatio=l),!n&&e.motionBlurTimeout&&clearTimeout(e.motionBlurTimeout),h&&(null==e.mbFrames&&(e.mbFrames=0),e.mbFrames++,e.mbFrames<3&&(m=!1),e.mbFrames>e.minMbLowQualFrames&&(e.motionBlurPxRatio=e.mbPxRBlurry)),e.clearingMotionBlur&&(e.motionBlurPxRatio=1),e.textureDrawLastFrame&&!d&&(c[e.NODE]=!0,c[e.SELECT_BOX]=!0);var b=t.style(),T=t.zoom(),O=void 0!==a?a:T,K=t.pan(),Z={x:K.x,y:K.y},S={zoom:T,pan:{x:K.x,y:K.y}},P=e.prevViewport;!(void 0===P||S.zoom!==P.zoom||S.pan.x!==P.pan.x||S.pan.y!==P.pan.y)&&!(y&&!g)&&(e.motionBlurPxRatio=1),s&&(Z=s),O*=l,Z.x*=l,Z.y*=l;var q=e.getCachedZSortedEles();function G(_t,Ue,He,Ye,pt){var Lt=_t.globalCompositeOperation;_t.globalCompositeOperation="destination-out",e.colorFillStyle(_t,255,255,255,e.motionBlurTransparency),_t.fillRect(Ue,He,Ye,pt),_t.globalCompositeOperation=Lt}function X(_t,Ue){var He,Ye,pt,Lt;e.clearingMotionBlur||_t!==u.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]&&_t!==u.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]?(He=Z,Ye=O,pt=e.canvasWidth,Lt=e.canvasHeight):(He={x:K.x*f,y:K.y*f},Ye=T*f,pt=e.canvasWidth*f,Lt=e.canvasHeight*f),_t.setTransform(1,0,0,1,0,0),"motionBlur"===Ue?G(_t,0,0,pt,Lt):!n&&(void 0===Ue||Ue)&&_t.clearRect(0,0,pt,Lt),i||(_t.translate(He.x,He.y),_t.scale(Ye,Ye)),s&&_t.translate(s.x,s.y),a&&_t.scale(a,a)}if(d||(e.textureDrawLastFrame=!1),d){if(e.textureDrawLastFrame=!0,!e.textureCache){e.textureCache={},e.textureCache.bb=t.mutableElements().boundingBox(),e.textureCache.texture=e.data.bufferCanvases[e.TEXTURE_BUFFER];var U=e.data.bufferContexts[e.TEXTURE_BUFFER];U.setTransform(1,0,0,1,0,0),U.clearRect(0,0,e.canvasWidth*e.textureMult,e.canvasHeight*e.textureMult),e.render({forcedContext:U,drawOnlyNodeLayer:!0,forcedPxRatio:l*e.textureMult}),(S=e.textureCache.viewport={zoom:t.zoom(),pan:t.pan(),width:e.canvasWidth,height:e.canvasHeight}).mpan={x:(0-S.pan.x)/S.zoom,y:(0-S.pan.y)/S.zoom}}c[e.DRAG]=!1,c[e.NODE]=!1;var be=e.textureCache.texture;S=e.textureCache.viewport,(me=u.contexts[e.NODE]).setTransform(1,0,0,1,0,0),h?G(me,0,0,S.width,S.height):me.clearRect(0,0,S.width,S.height);var Ae=b.core("outside-texture-bg-color").value,_e=b.core("outside-texture-bg-opacity").value;e.colorFillStyle(me,Ae[0],Ae[1],Ae[2],_e),me.fillRect(0,0,S.width,S.height),T=t.zoom(),X(me,!1),me.clearRect(S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l),me.drawImage(be,S.mpan.x,S.mpan.y,S.width/S.zoom/l,S.height/S.zoom/l)}else e.textureOnViewport&&!n&&(e.textureCache=null);var me,Se=t.extent(),je=e.pinching||e.hoverData.dragging||e.swipePanning||e.data.wheelZooming||e.hoverData.draggingEles||e.cy.animated(),Xe=e.hideEdgesOnViewport&&je,De=[];if(De[e.NODE]=!c[e.NODE]&&h&&!e.clearedForMotionBlur[e.NODE]||e.clearingMotionBlur,De[e.NODE]&&(e.clearedForMotionBlur[e.NODE]=!0),De[e.DRAG]=!c[e.DRAG]&&h&&!e.clearedForMotionBlur[e.DRAG]||e.clearingMotionBlur,De[e.DRAG]&&(e.clearedForMotionBlur[e.DRAG]=!0),c[e.NODE]||i||o||De[e.NODE]){var ze=h&&!De[e.NODE]&&1!==f;X(me=n||(ze?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_NODE]:u.contexts[e.NODE]),h&&!ze?"motionBlur":void 0),Xe?e.drawCachedNodes(me,q.nondrag,l,Se):e.drawLayeredElements(me,q.nondrag,l,Se),e.debug&&e.drawDebugPoints(me,q.nondrag),!i&&!h&&(c[e.NODE]=!1)}!o&&(c[e.DRAG]||i||De[e.DRAG])&&(ze=h&&!De[e.DRAG]&&1!==f,X(me=n||(ze?e.data.bufferContexts[e.MOTIONBLUR_BUFFER_DRAG]:u.contexts[e.DRAG]),h&&!ze?"motionBlur":void 0),Xe?e.drawCachedNodes(me,q.drag,l,Se):e.drawCachedElements(me,q.drag,l,Se),e.debug&&e.drawDebugPoints(me,q.drag),!i&&!h&&(c[e.DRAG]=!1));if(this.drawSelectionRectangle(r,X),h&&1!==f){var bt=u.contexts[e.DRAG],xt=e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_DRAG],zt=function(Ue,He,Ye){Ue.setTransform(1,0,0,1,0,0),Ye||!m?Ue.clearRect(0,0,e.canvasWidth,e.canvasHeight):G(Ue,0,0,e.canvasWidth,e.canvasHeight),Ue.drawImage(He,0,0,e.canvasWidth*f,e.canvasHeight*f,0,0,e.canvasWidth,e.canvasHeight)};(c[e.NODE]||De[e.NODE])&&(zt(u.contexts[e.NODE],e.data.bufferCanvases[e.MOTIONBLUR_BUFFER_NODE],De[e.NODE]),c[e.NODE]=!1),(c[e.DRAG]||De[e.DRAG])&&(zt(bt,xt,De[e.DRAG]),c[e.DRAG]=!1)}e.prevViewport=S,e.clearingMotionBlur&&(e.clearingMotionBlur=!1,e.motionBlurCleared=!0,e.motionBlur=!0),h&&(e.motionBlurTimeout=setTimeout(function(){e.motionBlurTimeout=null,e.clearedForMotionBlur[e.NODE]=!1,e.clearedForMotionBlur[e.DRAG]=!1,e.motionBlur=!1,e.clearingMotionBlur=!d,e.mbFrames=0,c[e.NODE]=!0,c[e.DRAG]=!0,e.redraw()},100)),n||t.emit("render")},ro.drawSelectionRectangle=function(r,e){var t=this,i=t.data,o=t.cy.style(),s=r.drawAllLayers,l=i.canvasNeedsRedraw;if(t.showFps||!r.drawOnlyNodeLayer&&l[t.SELECT_BOX]&&!s){var c=r.forcedContext||i.contexts[t.SELECT_BOX];if(e(c),1==t.selection[4]&&(t.hoverData.selecting||t.touchData.selecting)){var d=t.cy.zoom(),h=o.core("selection-box-border-width").value/d;c.lineWidth=h,c.fillStyle="rgba("+o.core("selection-box-color").value[0]+","+o.core("selection-box-color").value[1]+","+o.core("selection-box-color").value[2]+","+o.core("selection-box-opacity").value+")",c.fillRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]),h>0&&(c.strokeStyle="rgba("+o.core("selection-box-border-color").value[0]+","+o.core("selection-box-border-color").value[1]+","+o.core("selection-box-border-color").value[2]+","+o.core("selection-box-opacity").value+")",c.strokeRect(t.selection[0],t.selection[1],t.selection[2]-t.selection[0],t.selection[3]-t.selection[1]))}if(i.bgActivePosistion&&!t.hoverData.selecting){d=t.cy.zoom();var f=i.bgActivePosistion;c.fillStyle="rgba("+o.core("active-bg-color").value[0]+","+o.core("active-bg-color").value[1]+","+o.core("active-bg-color").value[2]+","+o.core("active-bg-opacity").value+")",c.beginPath(),c.arc(f.x,f.y,o.core("active-bg-size").pfValue/d,0,2*Math.PI),c.fill()}var g=t.lastRedrawTime;if(t.showFps&&g){g=Math.round(g);var y=Math.round(1e3/g),v="1 frame = "+g+" ms = "+y+" fps";if(c.setTransform(1,0,0,1,0,0),c.fillStyle="rgba(255, 0, 0, 0.75)",c.strokeStyle="rgba(255, 0, 0, 0.75)",c.font="30px Arial",!jh){var m=c.measureText(v);jh=m.actualBoundingBoxAscent}c.fillText(v,0,jh),c.strokeRect(0,jh+10,250,20),c.fillRect(0,jh+10,250*Math.min(y/60,1),20)}s||(l[t.SELECT_BOX]=!1)}};var ZN=typeof Float32Array<"u"?Float32Array:Array;function xT(){var r=new ZN(9);return ZN!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[5]=0,r[6]=0,r[7]=0),r[0]=1,r[4]=1,r[8]=1,r}function eL(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=0,r[8]=1,r}function rm(r,e,t){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=t[0],f=t[1];return r[0]=n,r[1]=i,r[2]=o,r[3]=a,r[4]=s,r[5]=l,r[6]=h*n+f*a+u,r[7]=h*i+f*s+c,r[8]=h*o+f*l+d,r}function tL(r,e,t){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=Math.sin(t),f=Math.cos(t);return r[0]=f*n+h*a,r[1]=f*i+h*s,r[2]=f*o+h*l,r[3]=f*a-h*n,r[4]=f*s-h*i,r[5]=f*l-h*o,r[6]=u,r[7]=c,r[8]=d,r}function AT(r,e,t){var n=t[0],i=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=i*e[3],r[4]=i*e[4],r[5]=i*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}Math.hypot||(Math.hypot=function(){for(var r=0,e=arguments.length;e--;)r+=arguments[e]*arguments[e];return Math.sqrt(r)});var UH=function(){return Os(function r(e,t,n,i){Ls(this,r),this.debugID=Math.floor(1e4*Math.random()),this.r=e,this.texSize=t,this.texRows=n,this.texHeight=Math.floor(t/n),this.enableWrapping=!0,this.locked=!1,this.texture=null,this.needsBuffer=!0,this.freePointer={x:0,row:0},this.keyToLocation=new Map,this.canvas=i(e,t,t),this.scratch=i(e,t,this.texHeight,"scratch")},[{key:"lock",value:function(){this.locked=!0}},{key:"getKeys",value:function(){return new Set(this.keyToLocation.keys())}},{key:"getScale",value:function(t){var n=t.w,i=t.h,a=this.texSize,s=this.texHeight/i,l=n*s,u=i*s;return l>a&&(l=n*(s=a/n),u=i*s),{scale:s,texW:l,texH:u}}},{key:"draw",value:function(t,n,i){var o=this;if(this.locked)throw new Error("can't draw, atlas is locked");var a=this.texSize,s=this.texRows,l=this.texHeight,u=this.getScale(n),c=u.scale,d=u.texW,h=u.texH,f=function(T,O){if(i&&O){var K=O.context,P=T.x,M=l*T.row;K.save(),K.translate(P,M),K.scale(c,c),i(K,n),K.restore()}},g=[null,null],y=function(){f(o.freePointer,o.canvas),g[0]={x:o.freePointer.x,y:o.freePointer.row*l,w:d,h},g[1]={x:o.freePointer.x+d,y:o.freePointer.row*l,w:0,h},o.freePointer.x+=d,o.freePointer.x==a&&(o.freePointer.x=0,o.freePointer.row++)},m=function(){o.freePointer.x=0,o.freePointer.row++};if(this.freePointer.x+d<=a)y();else{if(this.freePointer.row>=s-1)return!1;this.freePointer.x===a?(m(),y()):this.enableWrapping?function(){var T=o.scratch,O=o.canvas;T.clear(),f({x:0,row:0},T);var K=a-o.freePointer.x,Z=d-K,S=l,P=o.freePointer.x,M=o.freePointer.row*l,q=K;O.context.drawImage(T,0,0,q,S,P,M,q,S),g[0]={x:P,y:M,w:q,h};var X=(o.freePointer.row+1)*l,U=Z;O&&O.context.drawImage(T,K,0,U,S,0,X,U,S),g[1]={x:0,y:X,w:U,h},o.freePointer.x=Z,o.freePointer.row++}():(m(),y())}return this.keyToLocation.set(t,g),this.needsBuffer=!0,g}},{key:"getOffsets",value:function(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function(){return 0===this.freePointer.x&&0===this.freePointer.row}},{key:"canFit",value:function(t){if(this.locked)return!1;var n=this.texSize,i=this.texRows,o=this.getScale(t);return!(this.freePointer.x+o.texW>n)||this.freePointer.row<i-1}},{key:"bufferIfNeeded",value:function(t){this.texture||(this.texture=function NH(r){var t=r.createTexture();return t.buffer=function(n){r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,n),r.generateMipmap(r.TEXTURE_2D),r.bindTexture(r.TEXTURE_2D,null)},t.deleteTexture=function(){r.deleteTexture(t)},t}(t)),this.needsBuffer&&(this.texture.buffer(this.canvas),this.needsBuffer=!1,this.locked&&(this.canvas=null,this.scratch=null))}},{key:"dispose",value:function(){this.texture&&(this.texture.deleteTexture(),this.texture=null),this.canvas=null,this.scratch=null,this.locked=!0}}])}(),zH=function(){return Os(function r(e,t,n,i){Ls(this,r),this.r=e,this.texSize=t,this.texRows=n,this.createTextureCanvas=i,this.atlases=[],this.styleKeyToAtlas=new Map,this.markedKeys=new Set},[{key:"getKeys",value:function(){return new Set(this.styleKeyToAtlas.keys())}},{key:"_createAtlas",value:function(){return new UH(this.r,this.texSize,this.texRows,this.createTextureCanvas)}},{key:"_getScratchCanvas",value:function(){if(!this.scratch){var t=this.r,n=this.texSize,o=this.createTextureCanvas,a=Math.floor(n/this.texRows);this.scratch=o(t,n,a,"scratch")}return this.scratch}},{key:"draw",value:function(t,n,i){var o=this.styleKeyToAtlas.get(t);return o||((!(o=this.atlases[this.atlases.length-1])||!o.canFit(n))&&(o&&o.lock(),o=this._createAtlas(),this.atlases.push(o)),o.draw(t,n,i),this.styleKeyToAtlas.set(t,o)),o}},{key:"getAtlas",value:function(t){return this.styleKeyToAtlas.get(t)}},{key:"hasAtlas",value:function(t){return this.styleKeyToAtlas.has(t)}},{key:"markKeyForGC",value:function(t){this.markedKeys.add(t)}},{key:"gc",value:function(){var t=this,n=this.markedKeys;if(0!==n.size){var l,i=[],o=new Map,a=null,s=co(this.atlases);try{var u=function(){var d=l.value,h=d.getKeys(),f=function GH(r,e){return r.intersection?r.intersection(e):new Set(ig(r).filter(function(t){return e.has(t)}))}(n,h);if(0===f.size)return i.push(d),h.forEach(function(K){return o.set(K,d)}),1;a||(a=t._createAtlas(),i.push(a));var y,g=co(h);try{for(g.s();!(y=g.n()).done;){var v=y.value;if(!f.has(v)){var b=Zn(d.getOffsets(v),2),T=b[0];a.canFit({w:T.w+b[1].w,h:T.h})||(a.lock(),a=t._createAtlas(),i.push(a)),d.canvas&&(t._copyTextureToNewAtlas(v,d,a),o.set(v,a))}}}catch(K){g.e(K)}finally{g.f()}d.dispose()};for(s.s();!(l=s.n()).done;)u()}catch(c){s.e(c)}finally{s.f()}this.atlases=i,this.styleKeyToAtlas=o,this.markedKeys=new Set}else console.log("nothing to garbage collect")}},{key:"_copyTextureToNewAtlas",value:function(t,n,i){var a=Zn(n.getOffsets(t),2),s=a[0],l=a[1];if(0===l.w)i.draw(t,s,function(h){h.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h)});else{var u=this._getScratchCanvas();u.clear(),u.context.drawImage(n.canvas,s.x,s.y,s.w,s.h,0,0,s.w,s.h),u.context.drawImage(n.canvas,l.x,l.y,l.w,l.h,s.w,0,l.w,l.h);var c=s.w+l.w,d=s.h;i.draw(t,{w:c,h:d},function(h){h.drawImage(u,0,0,c,d,0,0,c,d)})}}},{key:"getCounts",value:function(){return{keyCount:this.styleKeyToAtlas.size,atlasCount:new Set(this.styleKeyToAtlas.values()).size}}}])}(),qH=function(){return Os(function r(e,t){Ls(this,r),this.r=e,this.globalOptions=t,this.atlasSize=t.webglTexSize,this.maxAtlasesPerBatch=t.webglTexPerBatch,this.renderTypes=new Map,this.collections=new Map,this.typeAndIdToKey=new Map},[{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"addAtlasCollection",value:function(t,n){var i=this.globalOptions,o=i.webglTexSize,s=n.texRows,l=this._cacheScratchCanvas(i.createTextureCanvas),u=new zH(this.r,o,s,l);this.collections.set(t,u)}},{key:"addRenderType",value:function(t,n){var i=n.collection;if(!this.collections.has(i))throw new Error("invalid atlas collection name '".concat(i,"'"));var o=this.collections.get(i),a=gr({type:t,atlasCollection:o},n);this.renderTypes.set(t,a)}},{key:"getRenderTypeOpts",value:function(t){return this.renderTypes.get(t)}},{key:"getAtlasCollection",value:function(t){return this.collections.get(t)}},{key:"_cacheScratchCanvas",value:function(t){var n=-1,i=-1,o=null;return function(a,s,l,u){return u?((!o||s!=n||l!=i)&&(n=s,i=l,o=t(a,s,l)),o):t(a,s,l)}}},{key:"_key",value:function(t,n){return"".concat(t,"-").concat(n)}},{key:"invalidate",value:function(t){var g,n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.forceRedraw,a=void 0!==o&&o,s=i.filterEle,l=void 0===s?function(){return!0}:s,u=i.filterType,c=void 0===u?function(){return!0}:u,d=!1,h=!1,f=co(t);try{for(f.s();!(g=f.n()).done;){var y=g.value;if(l(y)){var m,v=co(this.renderTypes.values());try{var b=function(){var O=m.value,K=O.type;if(c(K)){var Z=n.collections.get(O.collection),S=O.getKey(y),P=Array.isArray(S)?S:[S];if(a)P.forEach(function(X){return Z.markKeyForGC(X)}),h=!0;else{var M=O.getID?O.getID(y):y.id(),q=n._key(K,M),G=n.typeAndIdToKey.get(q);void 0!==G&&!kH(P,G)&&(d=!0,n.typeAndIdToKey.delete(q),G.forEach(function(X){return Z.markKeyForGC(X)}))}}};for(v.s();!(m=v.n()).done;)b()}catch(T){v.e(T)}finally{v.f()}}}}catch(T){f.e(T)}finally{f.f()}return h&&(this.gc(),d=!1),d}},{key:"gc",value:function(){var n,t=co(this.collections.values());try{for(t.s();!(n=t.n()).done;)n.value.gc()}catch(o){t.e(o)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function(t,n,i,o){var a=this.renderTypes.get(n),s=this.collections.get(a.collection),l=!1,u=s.draw(o,i,function(h){a.drawClipped?(h.save(),h.beginPath(),h.rect(0,0,i.w,i.h),h.clip(),a.drawElement(h,t,i,!0,!0),h.restore()):a.drawElement(h,t,i,!0,!0),l=!0});if(l){var c=a.getID?a.getID(t):t.id(),d=this._key(n,c);this.typeAndIdToKey.has(d)?this.typeAndIdToKey.get(d).push(o):this.typeAndIdToKey.set(d,[o])}return u}},{key:"getAtlasInfo",value:function(t,n){var i=this,o=this.renderTypes.get(n),a=o.getKey(t);return(Array.isArray(a)?a:[a]).map(function(l){var u=o.getBoundingBox(t,l),c=i.getOrCreateAtlas(t,n,u,l),h=Zn(c.getOffsets(l),2),f=h[0];return{atlas:c,tex:f,tex1:f,tex2:h[1],bb:u}})}},{key:"getDebugInfo",value:function(){var i,t=[],n=co(this.collections);try{for(n.s();!(i=n.n()).done;){var o=Zn(i.value,2),a=o[0],l=o[1].getCounts();t.push({type:a,keyCount:l.keyCount,atlasCount:l.atlasCount})}}catch(d){n.e(d)}finally{n.f()}return t}}])}(),jH=function(){return Os(function r(e){Ls(this,r),this.globalOptions=e,this.atlasSize=e.webglTexSize,this.maxAtlasesPerBatch=e.webglTexPerBatch,this.batchAtlases=[]},[{key:"getMaxAtlasesPerBatch",value:function(){return this.maxAtlasesPerBatch}},{key:"getAtlasSize",value:function(){return this.atlasSize}},{key:"getIndexArray",value:function(){return Array.from({length:this.maxAtlasesPerBatch},function(t,n){return n})}},{key:"startBatch",value:function(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function(){return this.batchAtlases.length}},{key:"getAtlases",value:function(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function(t){return this.batchAtlases.length!==this.maxAtlasesPerBatch||this.batchAtlases.includes(t)}},{key:"getAtlasIndexForBatch",value:function(t){var n=this.batchAtlases.indexOf(t);if(n<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch)throw new Error("cannot add more atlases to batch");this.batchAtlases.push(t),n=this.batchAtlases.length-1}return n}}])}(),$h={SCREEN:{name:"screen",screen:!0},PICKING:{name:"picking",picking:!0}},KH=function(){return Os(function r(e,t,n){Ls(this,r),this.r=e,this.gl=t,this.maxInstances=n.webglBatchSize,this.atlasSize=n.webglTexSize,this.bgColor=n.bgColor,this.debug=n.webglDebug,this.batchDebugInfo=[],n.enableWrapping=!0,n.createTextureCanvas=SH,this.atlasManager=new qH(e,n),this.batchManager=new jH(n),this.simpleShapeOptions=new Map,this.program=this._createShaderProgram($h.SCREEN),this.pickingProgram=this._createShaderProgram($h.PICKING),this.vao=this._createVAO()},[{key:"addAtlasCollection",value:function(t,n){this.atlasManager.addAtlasCollection(t,n)}},{key:"addTextureAtlasRenderType",value:function(t,n){this.atlasManager.addRenderType(t,n)}},{key:"addSimpleShapeRenderType",value:function(t,n){this.simpleShapeOptions.set(t,n)}},{key:"invalidate",value:function(t){var i=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).type,o=this.atlasManager;return i?o.invalidate(t,{filterType:function(s){return s===i},forceRedraw:!0}):o.invalidate(t)}},{key:"gc",value:function(){this.atlasManager.gc()}},{key:"_createShaderProgram",value:function(t){var n=this.gl,i="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; // a vertex from the unit square\n \n in mat3 aTransform; // used to transform verticies, eg into a bounding box\n in int aVertType; // the type of thing we are rendering\n\n // the z-index that is output when using picking mode\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in vec2 aLineWidth; // also used for node border width\n\n // simple shapes\n in vec4 aCornerRadius; // for round-rectangle [top-right, bottom-right, top-left, bottom-left]\n in vec4 aColor; // also used for edges\n in vec4 aBorderColor; // aLineWidth is used for border width\n\n // output values passed to the fragment shader\n out vec2 vTexCoord;\n out vec4 vColor;\n out vec2 vPosition;\n // flat values are not interpolated\n flat out int vAtlasId; \n flat out int vVertType;\n flat out vec2 vTopRight;\n flat out vec2 vBotLeft;\n flat out vec4 vCornerRadius;\n flat out vec4 vBorderColor;\n flat out vec2 vBorderWidth;\n flat out vec4 vIndex;\n \n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition; // TODO make this a vec3, simplifies some code below\n\n if(aVertType == ".concat(0,") {\n float texX = aTex.x; // texture coordinates\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(4," || aVertType == ").concat(7," \n || aVertType == ").concat(5," || aVertType == ").concat(6,") { // simple shapes\n\n // the bounding box is needed by the fragment shader\n vBotLeft = (aTransform * vec3(0, 0, 1)).xy; // flat\n vTopRight = (aTransform * vec3(1, 1, 1)).xy; // flat\n vPosition = (aTransform * vec3(position, 1)).xy; // will be interpolated\n\n // calculations are done in the fragment shader, just pass these along\n vColor = aColor;\n vCornerRadius = aCornerRadius;\n vBorderColor = aBorderColor;\n vBorderWidth = aLineWidth;\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(1,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n // stretch the unit square into a long skinny rectangle\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth[0] * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat(2,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0, p1, p2, pos;\n if(position.x == 0.0) { // The left side of the unit square\n p0 = pointA;\n p1 = pointB;\n p2 = pointC;\n pos = position;\n } else { // The right side of the unit square, use same approach but flip the geometry upside down\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth[0];\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(3," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vVertType = aVertType;\n vIndex = aIndex;\n }\n "),o=this.batchManager.getIndexArray(),s=function AH(r,e,t){var n=YN(r,r.VERTEX_SHADER,e),i=YN(r,r.FRAGMENT_SHADER,t),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getProgramParameter(o,r.LINK_STATUS))throw new Error("Could not initialize shaders");return o}(n,i,"#version 300 es\n precision highp float;\n\n // declare texture unit for each texture atlas in the batch\n ".concat(o.map(function(u){return"uniform sampler2D uTexture".concat(u,";")}).join("\n\t"),"\n\n uniform vec4 uBGColor;\n uniform float uZoom;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n in vec2 vPosition; // model coordinates\n\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n flat in vec2 vTopRight;\n flat in vec2 vBotLeft;\n flat in vec4 vCornerRadius;\n flat in vec4 vBorderColor;\n flat in vec2 vBorderWidth;\n\n out vec4 outColor;\n\n ").concat("\n float circleSD(vec2 p, float r) {\n return distance(vec2(0), p) - r; // signed distance\n }\n","\n ").concat("\n float rectangleSD(vec2 p, vec2 b) {\n vec2 d = abs(p)-b;\n return distance(vec2(0),max(d,0.0)) + min(max(d.x,d.y),0.0);\n }\n","\n ").concat("\n float roundRectangleSD(vec2 p, vec2 b, vec4 cr) {\n cr.xy = (p.x > 0.0) ? cr.xy : cr.zw;\n cr.x = (p.y > 0.0) ? cr.x : cr.y;\n vec2 q = abs(p) - b + cr.x;\n return min(max(q.x, q.y), 0.0) + distance(vec2(0), max(q, 0.0)) - cr.x;\n }\n","\n ").concat("\n float ellipseSD(vec2 p, vec2 ab) {\n p = abs( p ); // symmetry\n\n // find root with Newton solver\n vec2 q = ab*(p-ab);\n float w = (q.x<q.y)? 1.570796327 : 0.0;\n for( int i=0; i<5; i++ ) {\n vec2 cs = vec2(cos(w),sin(w));\n vec2 u = ab*vec2( cs.x,cs.y);\n vec2 v = ab*vec2(-cs.y,cs.x);\n w = w + dot(p-u,v)/(dot(p-u,u)+dot(v,v));\n }\n \n // compute final point and distance\n float d = length(p-ab*vec2(cos(w),sin(w)));\n \n // return signed distance\n return (dot(p/ab,p/ab)>1.0) ? d : -d;\n }\n","\n\n vec4 blend(vec4 top, vec4 bot) { // blend colors with premultiplied alpha\n return vec4( \n top.rgb + (bot.rgb * (1.0 - top.a)),\n top.a + (bot.a * (1.0 - top.a)) \n );\n }\n\n vec4 distInterp(vec4 cA, vec4 cB, float d) { // interpolate color using Signed Distance\n // scale to the zoom level so that borders don't look blurry when zoomed in\n // note 1.5 is an aribitrary value chosen because it looks good\n return mix(cA, cB, 1.0 - smoothstep(0.0, 1.5 / uZoom, abs(d))); \n }\n\n void main(void) {\n if(vVertType == ").concat(0,") {\n // look up the texel from the texture unit\n ").concat(o.map(function(u){return"if(vAtlasId == ".concat(u,") outColor = texture(uTexture").concat(u,", vTexCoord);")}).join("\n\telse "),"\n } \n else if(vVertType == ").concat(3,") {\n // mimics how canvas renderer uses context.globalCompositeOperation = 'destination-out';\n outColor = blend(vColor, uBGColor);\n outColor.a = 1.0; // make opaque, masks out line under arrow\n }\n else if(vVertType == ").concat(4," && vBorderWidth == vec2(0.0)) { // simple rectangle with no border\n outColor = vColor; // unit square is already transformed to the rectangle, nothing else needs to be done\n }\n else if(vVertType == ").concat(4," || vVertType == ").concat(7," \n || vVertType == ").concat(5," || vVertType == ").concat(6,") { // use SDF\n\n float outerBorder = vBorderWidth[0];\n float innerBorder = vBorderWidth[1];\n float borderPadding = outerBorder * 2.0;\n float w = vTopRight.x - vBotLeft.x - borderPadding;\n float h = vTopRight.y - vBotLeft.y - borderPadding;\n vec2 b = vec2(w/2.0, h/2.0); // half width, half height\n vec2 p = vPosition - vec2(vTopRight.x - b[0] - outerBorder, vTopRight.y - b[1] - outerBorder); // translate to center\n\n float d; // signed distance\n if(vVertType == ").concat(4,") {\n d = rectangleSD(p, b);\n } else if(vVertType == ").concat(7," && w == h) {\n d = circleSD(p, b.x); // faster than ellipse\n } else if(vVertType == ").concat(7,") {\n d = ellipseSD(p, b);\n } else {\n d = roundRectangleSD(p, b, vCornerRadius.wzyx);\n }\n\n // use the distance to interpolate a color to smooth the edges of the shape, doesn't need multisampling\n // we must smooth colors inwards, because we can't change pixels outside the shape's bounding box\n if(d > 0.0) {\n if(d > outerBorder) {\n discard;\n } else {\n outColor = distInterp(vBorderColor, vec4(0), d - outerBorder);\n }\n } else {\n if(d > innerBorder) {\n vec4 outerColor = outerBorder == 0.0 ? vec4(0) : vBorderColor;\n vec4 innerBorderColor = blend(vBorderColor, vColor);\n outColor = distInterp(innerBorderColor, outerColor, d);\n } \n else {\n vec4 outerColor;\n if(innerBorder == 0.0 && outerBorder == 0.0) {\n outerColor = vec4(0);\n } else if(innerBorder == 0.0) {\n outerColor = vBorderColor;\n } else {\n outerColor = blend(vBorderColor, vColor);\n }\n outColor = distInterp(vColor, outerColor, d - innerBorder);\n }\n }\n }\n else {\n outColor = vColor;\n }\n\n ").concat(t.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n "));s.aPosition=n.getAttribLocation(s,"aPosition"),s.aIndex=n.getAttribLocation(s,"aIndex"),s.aVertType=n.getAttribLocation(s,"aVertType"),s.aTransform=n.getAttribLocation(s,"aTransform"),s.aAtlasId=n.getAttribLocation(s,"aAtlasId"),s.aTex=n.getAttribLocation(s,"aTex"),s.aPointAPointB=n.getAttribLocation(s,"aPointAPointB"),s.aPointCPointD=n.getAttribLocation(s,"aPointCPointD"),s.aLineWidth=n.getAttribLocation(s,"aLineWidth"),s.aColor=n.getAttribLocation(s,"aColor"),s.aCornerRadius=n.getAttribLocation(s,"aCornerRadius"),s.aBorderColor=n.getAttribLocation(s,"aBorderColor"),s.uPanZoomMatrix=n.getUniformLocation(s,"uPanZoomMatrix"),s.uAtlasSize=n.getUniformLocation(s,"uAtlasSize"),s.uBGColor=n.getUniformLocation(s,"uBGColor"),s.uZoom=n.getUniformLocation(s,"uZoom"),s.uTextures=[];for(var l=0;l<this.batchManager.getMaxAtlasesPerBatch();l++)s.uTextures.push(n.getUniformLocation(s,"uTexture".concat(l)));return s}},{key:"_createVAO",value:function(){var t=[0,0,1,0,1,1,0,0,1,1,0,1];this.vertexCount=t.length/2;var n=this.maxInstances,i=this.gl,o=this.program,a=i.createVertexArray();return i.bindVertexArray(a),function OH(r,e,t,n){var o=Zn(QN(r,e),2),a=o[0],s=o[1],l=JN(r,s,n),u=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,u),r.bufferData(r.ARRAY_BUFFER,l,r.STATIC_DRAW),s===r.FLOAT?r.vertexAttribPointer(t,a,s,!1,0,0):s===r.INT&&r.vertexAttribIPointer(t,a,s,0,0),r.enableVertexAttribArray(t),r.bindBuffer(r.ARRAY_BUFFER,null)}(i,"vec2",o.aPosition,t),this.transformBuffer=function MH(r,e,t){for(var i=new Float32Array(9*e),o=new Array(e),a=0;a<e;a++)o[a]=new Float32Array(i.buffer,9*a*4,9);var l=r.createBuffer();r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferData(r.ARRAY_BUFFER,i.byteLength,r.DYNAMIC_DRAW);for(var u=0;u<3;u++){var c=t+u;r.enableVertexAttribArray(c),r.vertexAttribPointer(c,3,r.FLOAT,!1,36,12*u),r.vertexAttribDivisor(c,1)}return r.bindBuffer(r.ARRAY_BUFFER,null),l.getMatrixView=function(d){return o[d]},l.setData=function(d,h){o[h].set(d,0)},l.bufferSubData=function(){r.bindBuffer(r.ARRAY_BUFFER,l),r.bufferSubData(r.ARRAY_BUFFER,0,i)},l}(i,n,o.aTransform),this.indexBuffer=Ca(i,n,"vec4",o.aIndex),this.vertTypeBuffer=Ca(i,n,"int",o.aVertType),this.atlasIdBuffer=Ca(i,n,"int",o.aAtlasId),this.texBuffer=Ca(i,n,"vec4",o.aTex),this.pointAPointBBuffer=Ca(i,n,"vec4",o.aPointAPointB),this.pointCPointDBuffer=Ca(i,n,"vec4",o.aPointCPointD),this.lineWidthBuffer=Ca(i,n,"vec2",o.aLineWidth),this.colorBuffer=Ca(i,n,"vec4",o.aColor),this.cornerRadiusBuffer=Ca(i,n,"vec4",o.aCornerRadius),this.borderColorBuffer=Ca(i,n,"vec4",o.aBorderColor),i.bindVertexArray(null),a}},{key:"buffers",get:function(){var t=this;return this._buffers||(this._buffers=Object.keys(this).filter(function(n){return Fs(n,"Buffer")}).map(function(n){return t[n]})),this._buffers}},{key:"startFrame",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$h.SCREEN;this.panZoomMatrix=t,this.renderTarget=n,this.batchDebugInfo=[],this.wrappedCount=0,this.simpleCount=0,this.startBatch()}},{key:"startBatch",value:function(){this.instanceCount=0,this.batchManager.startBatch()}},{key:"endFrame",value:function(){this.endBatch()}},{key:"_isVisible",value:function(t,n){return!!t.visible()&&(!n||!n.isVisible||n.isVisible(t))}},{key:"drawTexture",value:function(t,n,i){var o=this.atlasManager,a=this.batchManager,s=o.getRenderTypeOpts(i);if(this._isVisible(t,s)&&(!t.isEdge()||this._isValidEdge(t))){if(this.renderTarget.picking&&s.getTexPickingMode){var l=s.getTexPickingMode(t);if(1===l)return;if(2==l)return void this.drawPickingRectangle(t,n,i)}var d,c=co(o.getAtlasInfo(t,i));try{for(c.s();!(d=c.n()).done;){var h=d.value,f=h.atlas,g=h.tex1,y=h.tex2;a.canAddToCurrentBatch(f)||this.endBatch();for(var v=a.getAtlasIndexForBatch(f),m=0,b=[[g,!0],[y,!1]];m<b.length;m++){var T=Zn(b[m],2),O=T[0],K=T[1];if(0!=O.w){var Z=this.instanceCount;this.vertTypeBuffer.getView(Z)[0]=0,Dc(n,this.indexBuffer.getView(Z)),this.atlasIdBuffer.getView(Z)[0]=v;var M=this.texBuffer.getView(Z);M[0]=O.x,M[1]=O.y,M[2]=O.w,M[3]=O.h;var q=this.transformBuffer.getMatrixView(Z);this.setTransformMatrix(t,q,s,h,K),this.instanceCount++,K||this.wrappedCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}catch(G){c.e(G)}finally{c.f()}}}},{key:"setTransformMatrix",value:function(t,n,i,o){var a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=0;if(i.shapeProps&&i.shapeProps.padding&&(s=t.pstyle(i.shapeProps.padding).pfValue),o){var u=o.tex1,d=u.w/(u.w+o.tex2.w);a||(d=1-d);var h=this._getAdjustedBB(o.bb,s,a,d);this._applyTransformMatrix(n,h,i,t)}else{var f=i.getBoundingBox(t),g=this._getAdjustedBB(f,s,!0,1);this._applyTransformMatrix(n,g,i,t)}}},{key:"_applyTransformMatrix",value:function(t,n,i,o){var a,s;eL(t);var l=i.getRotation?i.getRotation(o):0;if(0!==l){var u=i.getRotationPoint(o);rm(t,t,[u.x,u.y]),tL(t,t,l);var h=i.getRotationOffset(o);a=h.x+(n.xOffset||0),s=h.y+(n.yOffset||0)}else a=n.x1,s=n.y1;rm(t,t,[a,s]),AT(t,t,[n.w,n.h])}},{key:"_getAdjustedBB",value:function(t,n,i,o){var a=t.x1,s=t.y1,l=t.w,u=t.h;n&&(a-=n,s-=n,l+=2*n,u+=2*n);var d=0,h=l*o;return i&&o<1?l=h:!i&&o<1&&(a+=d=l-h,l=h),{x1:a,y1:s,w:l,h:u,xOffset:d,yOffset:t.yOffset}}},{key:"drawPickingRectangle",value:function(t,n,i){var o=this.atlasManager.getRenderTypeOpts(i),a=this.instanceCount;this.vertTypeBuffer.getView(a)[0]=4,Dc(n,this.indexBuffer.getView(a)),tu([0,0,0],1,this.colorBuffer.getView(a));var u=this.transformBuffer.getMatrixView(a);this.setTransformMatrix(t,u,o),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}},{key:"drawNode",value:function(t,n,i){var o=this.simpleShapeOptions.get(i);if(this._isVisible(t,o)){var a=o.shapeProps,s=this._getVertTypeForShape(t,a.shape);if(void 0===s||o.isSimple&&!o.isSimple(t))return void this.drawTexture(t,n,i);var l=this.instanceCount;if(this.vertTypeBuffer.getView(l)[0]=s,5===s||6===s){var u=o.getBoundingBox(t),c=this._getCornerRadius(t,a.radius,u),d=this.cornerRadiusBuffer.getView(l);d[0]=c,d[1]=c,d[2]=c,d[3]=c,6===s&&(d[0]=0,d[2]=0)}Dc(n,this.indexBuffer.getView(l)),tu(t.pstyle(a.color).value,t.pstyle(a.opacity).value,this.colorBuffer.getView(l));var v=this.lineWidthBuffer.getView(l);if(v[0]=0,v[1]=0,a.border){var m=t.pstyle("border-width").value;if(m>0){tu(t.pstyle("border-color").value,t.pstyle("border-opacity").value,this.borderColorBuffer.getView(l));var K=t.pstyle("border-position").value;if("inside"===K)v[0]=0,v[1]=-m;else if("outside"===K)v[0]=m,v[1]=0;else{var Z=m/2;v[0]=Z,v[1]=-Z}}}var S=this.transformBuffer.getMatrixView(l);this.setTransformMatrix(t,S,o),this.simpleCount++,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}},{key:"_getVertTypeForShape",value:function(t,n){switch(t.pstyle(n).value){case"rectangle":return 4;case"ellipse":return 7;case"roundrectangle":case"round-rectangle":return 5;case"bottom-round-rectangle":return 6;default:return}}},{key:"_getCornerRadius",value:function(t,n,i){var o=i.w,a=i.h;if("auto"===t.pstyle(n).value)return Gs(o,a);var s=t.pstyle(n).pfValue;return Math.min(s,a/2,o/2)}},{key:"drawEdgeArrow",value:function(t,n,i){if(t.visible()){var a,s,l,o=t._private.rscratch;if(!("source"===i?(a=o.arrowStartX,s=o.arrowStartY,l=o.srcArrowAngle):(a=o.arrowEndX,s=o.arrowEndY,l=o.tgtArrowAngle),isNaN(a)||null==a||isNaN(s)||null==s||isNaN(l)||null==l||"none"===t.pstyle(i+"-arrow-shape").value)){var c=t.pstyle(i+"-arrow-color").value,f=t.pstyle("opacity").value*t.pstyle("line-opacity").value,g=t.pstyle("width").pfValue,y=t.pstyle("arrow-scale").value,v=this.r.getArrowWidth(g,y),m=this.instanceCount,b=this.transformBuffer.getMatrixView(m);eL(b),rm(b,b,[a,s]),AT(b,b,[v,v]),tL(b,b,l),this.vertTypeBuffer.getView(m)[0]=3,Dc(n,this.indexBuffer.getView(m)),tu(c,f,this.colorBuffer.getView(m)),this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}},{key:"drawEdgeLine",value:function(t,n){if(t.visible()){var i=this._getEdgePoints(t);if(i){var o=t.pstyle("opacity").value,a=t.pstyle("line-opacity").value,s=t.pstyle("width").pfValue,l=t.pstyle("line-color").value,u=o*a;if(i.length/2+this.instanceCount>this.maxInstances&&this.endBatch(),4==i.length){var c=this.instanceCount;this.vertTypeBuffer.getView(c)[0]=1,Dc(n,this.indexBuffer.getView(c)),tu(l,u,this.colorBuffer.getView(c)),this.lineWidthBuffer.getView(c)[0]=s;var g=this.pointAPointBBuffer.getView(c);g[0]=i[0],g[1]=i[1],g[2]=i[2],g[3]=i[3],this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}else for(var y=0;y<i.length-2;y+=2){var v=this.instanceCount;this.vertTypeBuffer.getView(v)[0]=2,Dc(n,this.indexBuffer.getView(v)),tu(l,u,this.colorBuffer.getView(v)),this.lineWidthBuffer.getView(v)[0]=s;var O=i[y-2],K=i[y-1],Z=i[y],S=i[y+1],P=i[y+2],M=i[y+3],q=i[y+4],G=i[y+5];0==y&&(O=2*Z-P+.001,K=2*S-M+.001),y==i.length-4&&(q=2*P-Z+.001,G=2*M-S+.001);var X=this.pointAPointBBuffer.getView(v);X[0]=O,X[1]=K,X[2]=Z,X[3]=S;var U=this.pointCPointDBuffer.getView(v);U[0]=P,U[1]=M,U[2]=q,U[3]=G,this.instanceCount++,this.instanceCount>=this.maxInstances&&this.endBatch()}}}}},{key:"_isValidEdge",value:function(t){var n=t._private.rscratch;return!(n.badLine||null==n.allpts||isNaN(n.allpts[0]))}},{key:"_getEdgePoints",value:function(t){var n=t._private.rscratch;if(this._isValidEdge(t)){var i=n.allpts;if(4==i.length)return i;var o=this._getNumSegments(t);return this._getCurveSegmentPoints(i,o)}}},{key:"_getNumSegments",value:function(t){return Math.min(Math.max(15,5),this.maxInstances)}},{key:"_getCurveSegmentPoints",value:function(t,n){if(4==t.length)return t;for(var i=Array(2*(n+1)),o=0;o<=n;o++)0==o?(i[0]=t[0],i[1]=t[1]):o==n?(i[2*o]=t[t.length-2],i[2*o+1]=t[t.length-1]):this._setCurvePoint(t,o/n,i,2*o);return i}},{key:"_setCurvePoint",value:function(t,n,i,o){if(!(t.length<=2)){for(var a=Array(t.length-2),s=0;s<a.length;s+=2){var u=(1-n)*t[s+1]+n*t[s+3];a[s]=(1-n)*t[s]+n*t[s+2],a[s+1]=u}return this._setCurvePoint(a,n,i,o)}i[o]=t[0],i[o+1]=t[1]}},{key:"endBatch",value:function(){var t=this.gl,n=this.vao,i=this.vertexCount,o=this.instanceCount;if(0!==o){var a=this.renderTarget.picking?this.pickingProgram:this.program;t.useProgram(a),t.bindVertexArray(n);var l,s=co(this.buffers);try{for(s.s();!(l=s.n()).done;)l.value.bufferSubData(o)}catch(g){s.e(g)}finally{s.f()}for(var c=this.batchManager.getAtlases(),d=0;d<c.length;d++)c[d].bufferIfNeeded(t);for(var h=0;h<c.length;h++)t.activeTexture(t.TEXTURE0+h),t.bindTexture(t.TEXTURE_2D,c[h].texture),t.uniform1i(a.uTextures[h],h);t.uniform1f(a.uZoom,function CH(r){var e=r.pixelRatio;return r.cy.zoom()*e}(this.r)),t.uniformMatrix3fv(a.uPanZoomMatrix,!1,this.panZoomMatrix),t.uniform1i(a.uAtlasSize,this.batchManager.getAtlasSize());var f=tu(this.bgColor,1);t.uniform4fv(a.uBGColor,f),t.drawArraysInstanced(t.TRIANGLES,0,i,o),t.bindVertexArray(null),t.bindTexture(t.TEXTURE_2D,null),this.debug&&this.batchDebugInfo.push({count:o,atlasCount:c.length}),this.startBatch()}}},{key:"getDebugInfo",value:function(){var t=this.atlasManager.getDebugInfo(),n=t.reduce(function(a,s){return a+s.atlasCount},0),i=this.batchDebugInfo,o=i.reduce(function(a,s){return a+s.count},0);return{atlasInfo:t,totalAtlases:n,wrappedCount:this.wrappedCount,simpleCount:this.simpleCount,batchCount:i.length,batchInfo:i,totalInstances:o}}}])}(),iL={};function oL(r,e){return ho(r._private.rscratch,"labelWrapCachedLines",e)||[]}iL.initWebgl=function(r,e){var t=this,n=t.data.contexts[t.WEBGL];r.bgColor=function YH(r){var e=r.cy.container();return uP(e&&e.style&&e.style.backgroundColor||"white")}(t),r.webglTexSize=Math.min(r.webglTexSize,n.getParameter(n.MAX_TEXTURE_SIZE)),r.webglTexRows=Math.min(r.webglTexRows,54),r.webglTexRowsNodes=Math.min(r.webglTexRowsNodes,54),r.webglBatchSize=Math.min(r.webglBatchSize,16384),r.webglTexPerBatch=Math.min(r.webglTexPerBatch,n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS)),t.webglDebug=r.webglDebug,t.webglDebugShowAtlases=r.webglDebugShowAtlases,t.pickingFrameBuffer=function FH(r){var e=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,e);var t=r.createTexture();return r.bindTexture(r.TEXTURE_2D,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,t,0),r.bindFramebuffer(r.FRAMEBUFFER,null),e.setFramebufferAttachmentSizes=function(n,i){r.bindTexture(r.TEXTURE_2D,t),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,i,0,r.RGBA,r.UNSIGNED_BYTE,null)},e}(n),t.pickingFrameBuffer.needsDraw=!0,t.drawing=new KH(t,n,r);var i=function(d){return function(h){return t.getTextAngle(h,d)}},o=function(d){return function(h){var f=h.pstyle(d);return f&&f.value}},a=function(d){return function(h){return h.pstyle("".concat(d,"-opacity")).value>0}},s=function(d){return"yes"===d.pstyle("text-events").strValue?2:1},l=function(d){var h=d.position(),f=h.x,g=h.y,y=d.outerWidth(),v=d.outerHeight();return{w:y,h:v,x1:f-y/2,y1:g-v/2}};t.drawing.addAtlasCollection("node",{texRows:r.webglTexRowsNodes}),t.drawing.addAtlasCollection("label",{texRows:r.webglTexRows}),t.drawing.addTextureAtlasRenderType("node-body",{collection:"node",getKey:e.getStyleKey,getBoundingBox:e.getElementBox,drawElement:e.drawElement}),t.drawing.addSimpleShapeRenderType("node-body",{getBoundingBox:l,isSimple:PH,shapeProps:{shape:"shape",color:"background-color",opacity:"background-opacity",radius:"corner-radius",border:!0}}),t.drawing.addSimpleShapeRenderType("node-overlay",{getBoundingBox:l,isVisible:a("overlay"),shapeProps:{shape:"overlay-shape",color:"overlay-color",opacity:"overlay-opacity",padding:"overlay-padding",radius:"overlay-corner-radius"}}),t.drawing.addSimpleShapeRenderType("node-underlay",{getBoundingBox:l,isVisible:a("underlay"),shapeProps:{shape:"underlay-shape",color:"underlay-color",opacity:"underlay-opacity",padding:"underlay-padding",radius:"underlay-corner-radius"}}),t.drawing.addTextureAtlasRenderType("label",{collection:"label",getTexPickingMode:s,getKey:RT(e.getLabelKey,null),getBoundingBox:PT(e.getLabelBox,null),drawClipped:!0,drawElement:e.drawLabel,getRotation:i(null),getRotationPoint:e.getLabelRotationPoint,getRotationOffset:e.getLabelRotationOffset,isVisible:o("label")}),t.drawing.addTextureAtlasRenderType("edge-source-label",{collection:"label",getTexPickingMode:s,getKey:RT(e.getSourceLabelKey,"source"),getBoundingBox:PT(e.getSourceLabelBox,"source"),drawClipped:!0,drawElement:e.drawSourceLabel,getRotation:i("source"),getRotationPoint:e.getSourceLabelRotationPoint,getRotationOffset:e.getSourceLabelRotationOffset,isVisible:o("source-label")}),t.drawing.addTextureAtlasRenderType("edge-target-label",{collection:"label",getTexPickingMode:s,getKey:RT(e.getTargetLabelKey,"target"),getBoundingBox:PT(e.getTargetLabelBox,"target"),drawClipped:!0,drawElement:e.drawTargetLabel,getRotation:i("target"),getRotationPoint:e.getTargetLabelRotationPoint,getRotationOffset:e.getTargetLabelRotationOffset,isVisible:o("target-label")});var u=_h(function(){console.log("garbage collect flag set"),t.data.gc=!0},1e4);t.onUpdateEleCalcs(function(c,d){var h=!1;d&&d.length>0&&(h|=t.drawing.invalidate(d)),h&&u()}),function QH(r){var e=r.render;r.render=function(o){o=o||{},r.webgl&&(r.cy.zoom()>7.99?(function JH(r){var e=r.data.contexts[r.WEBGL];e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT)}(r),e.call(r,o)):(function ZH(r){var e=function(n){n.save(),n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,r.canvasWidth,r.canvasHeight),n.restore()};e(r.data.contexts[r.NODE]),e(r.data.contexts[r.DRAG])}(r),sL(r,o,$h.SCREEN)))};var t=r.matchCanvasSize;r.matchCanvasSize=function(o){t.call(r,o),r.pickingFrameBuffer.setFramebufferAttachmentSizes(r.canvasWidth,r.canvasHeight),r.pickingFrameBuffer.needsDraw=!0},r.findNearestElements=function(o,a,s,l){return function o9(r,e,t){var o,a,l,n=function i9(r,e,t){var o,a,u=IT(r),h=function RH(r,e,t,n,i){var a=i*t+e.y;return[n*t+e.x,a=Math.round(r.canvasHeight-a)]}(r,u.pan,u.zoom,e,t),f=Zn(h,2);o=f[0]-3,a=f[1]-3;var m=r.data.contexts[r.WEBGL];m.bindFramebuffer(m.FRAMEBUFFER,r.pickingFrameBuffer),r.pickingFrameBuffer.needsDraw&&(m.viewport(0,0,m.canvas.width,m.canvas.height),sL(r,null,$h.PICKING),r.pickingFrameBuffer.needsDraw=!1);var T=new Uint8Array(144);m.readPixels(o,a,6,6,m.RGBA,m.UNSIGNED_BYTE,T),m.bindFramebuffer(m.FRAMEBUFFER,null);for(var O=new Set,K=0;K<36;K++){var S=DH(T.slice(4*K,4*K+4))-1;S>=0&&O.add(S)}return O}(r,e,t),i=r.getCachedZSortedEles(),s=co(n);try{for(s.s();!(l=s.n()).done;){var c=i[l.value];if(!o&&c.isNode()&&(o=c),!a&&c.isEdge()&&(a=c),o&&a)break}}catch(d){s.e(d)}finally{s.f()}return[o,a].filter(Boolean)}(r,o,a)};var n=r.invalidateCachedZSortedEles;r.invalidateCachedZSortedEles=function(){n.call(r),r.pickingFrameBuffer.needsDraw=!0};var i=r.notify;r.notify=function(o,a){i.call(r,o,a),"viewport"===o||"bounds"===o?r.pickingFrameBuffer.needsDraw=!0:"background"===o&&r.drawing.invalidate(a,{type:"node-body"})}}(t)};var RT=function(e,t){return function(n){var i=e(n),o=oL(n,t);return o.length>1?o.map(function(a,s){return"".concat(i,"_").concat(s)}):i}},PT=function(e,t){return function(n,i){var o=e(n);if("string"==typeof i){var a=i.indexOf("_");if(a>0){var s=Number(i.substring(a+1)),l=oL(n,t),u=o.h/l.length,c=u*s;return{x1:o.x1,w:o.w,y1:o.y1+c,h:u,yOffset:c}}}return o}};function aL(r,e){var t=r.canvasWidth,n=r.canvasHeight,i=IT(r),o=i.pan,a=i.zoom;e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t,n),e.translate(o.x,o.y),e.scale(a,a)}function kT(r,e,t){var n=r.drawing;e+=1,t.isNode()?(n.drawNode(t,e,"node-underlay"),n.drawNode(t,e,"node-body"),n.drawTexture(t,e,"label"),n.drawNode(t,e,"node-overlay")):(n.drawEdgeLine(t,e),n.drawEdgeArrow(t,e,"source"),n.drawEdgeArrow(t,e,"target"),n.drawTexture(t,e,"label"),n.drawTexture(t,e,"edge-source-label"),n.drawTexture(t,e,"edge-target-label"))}function sL(r,e,t){var n;r.webglDebug&&(n=performance.now());var i=r.drawing,o=0;if(t.screen&&r.data.canvasNeedsRedraw[r.SELECT_BOX]&&function t9(r,e){r.drawSelectionRectangle(e,function(t){return aL(r,t)})}(r,e),r.data.canvasNeedsRedraw[r.NODE]||t.picking){var a=r.data.contexts[r.WEBGL];t.screen?(a.clearColor(0,0,0,0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)):a.disable(a.BLEND),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT),a.viewport(0,0,a.canvas.width,a.canvas.height);var s=function e9(r){var e=r.canvasWidth,t=r.canvasHeight,n=IT(r),i=n.pan,o=n.zoom,a=xT();rm(a,a,[i.x,i.y]),AT(a,a,[o,o]);var s=xT();!function BH(r,e,t){r[0]=2/e,r[1]=0,r[2]=0,r[3]=0,r[4]=-2/t,r[5]=0,r[6]=-1,r[7]=1,r[8]=1}(s,e,t);var l=xT();return function VH(r,e,t){var n=e[0],i=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=t[0],f=t[1],g=t[2],y=t[3],v=t[4],m=t[5],b=t[6],T=t[7],O=t[8];r[0]=h*n+f*a+g*u,r[1]=h*i+f*s+g*c,r[2]=h*o+f*l+g*d,r[3]=y*n+v*a+m*u,r[4]=y*i+v*s+m*c,r[5]=y*o+v*l+m*d,r[6]=b*n+T*a+O*u,r[7]=b*i+T*s+O*c,r[8]=b*o+T*l+O*d}(l,s,a),l}(r),l=r.getCachedZSortedEles();if(o=l.length,i.startFrame(s,t),t.screen){for(var u=0;u<l.nondrag.length;u++)kT(r,u,l.nondrag[u]);for(var c=0;c<l.drag.length;c++)kT(r,c,l.drag[c])}else if(t.picking)for(var d=0;d<l.length;d++)kT(r,d,l[d]);i.endFrame(),t.screen&&r.webglDebugShowAtlases&&(function r9(r){var e=r.data.contexts[r.NODE];e.save(),aL(r,e),e.strokeStyle="rgba(0, 0, 0, 0.3)",e.beginPath(),e.moveTo(-1e3,0),e.lineTo(1e3,0),e.stroke(),e.beginPath(),e.moveTo(0,-1e3),e.lineTo(0,1e3),e.stroke(),e.restore()}(r),function n9(r){var e=function(i,o,a){for(var s=i.atlasManager.getAtlasCollection(o),l=r.data.contexts[r.NODE],u=s.atlases,c=0;c<u.length;c++){var h=u[c].canvas;if(h){var f=h.width,g=h.height,y=f*c,v=h.height*a;l.save(),l.scale(.4,.4),l.drawImage(h,y,v),l.strokeStyle="black",l.rect(y,v,f,g),l.stroke(),l.restore()}}},t=0;e(r.drawing,"node",t++),e(r.drawing,"label",t++)}(r)),r.data.canvasNeedsRedraw[r.NODE]=!1,r.data.canvasNeedsRedraw[r.DRAG]=!1}if(r.webglDebug){var h=performance.now(),g=Math.ceil(h-n),y=i.getDebugInfo(),v=["".concat(o," elements"),"".concat(y.totalInstances," instances"),"".concat(y.batchCount," batches"),"".concat(y.totalAtlases," atlases"),"".concat(y.wrappedCount," wrapped textures"),"".concat(y.simpleCount," simple shapes")].join(", ");console.log("WebGL (".concat(t.name,") - frame time ").concat(g,"ms")),console.log("Totals:"),console.log(" ".concat(v)),console.log("Texture Atlases Used:");var T,b=co(y.atlasInfo);try{for(b.s();!(T=b.n()).done;){var O=T.value;console.log(" ".concat(O.type,": ").concat(O.keyCount," keys, ").concat(O.atlasCount," atlases"))}}catch(K){b.e(K)}finally{b.f()}console.log("")}r.data.gc&&(console.log("Garbage Collect!"),r.data.gc=!1,i.gc())}for(var Js={drawPolygonPath:function(r,e,t,n,i,o){var a=n/2,s=i/2;r.beginPath&&r.beginPath(),r.moveTo(e+a*o[0],t+s*o[1]);for(var l=1;l<o.length/2;l++)r.lineTo(e+a*o[2*l],t+s*o[2*l+1]);r.closePath()},drawRoundPolygonPath:function(r,e,t,n,i,o,a){a.forEach(function(s){return AN(r,s)}),r.closePath()},drawRoundRectanglePath:function(r,e,t,n,i,o){var a=n/2,s=i/2,l="auto"===o?Gs(n,i):Math.min(o,s,a);r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.arcTo(e+a,t-s,e+a,t,l),r.arcTo(e+a,t+s,e,t+s,l),r.arcTo(e-a,t+s,e-a,t,l),r.arcTo(e-a,t-s,e,t-s,l),r.lineTo(e,t-s),r.closePath()},drawBottomRoundRectanglePath:function(r,e,t,n,i,o){var a=n/2,s=i/2,l="auto"===o?Gs(n,i):o;r.beginPath&&r.beginPath(),r.moveTo(e,t-s),r.lineTo(e+a,t-s),r.lineTo(e+a,t),r.arcTo(e+a,t+s,e,t+s,l),r.arcTo(e-a,t+s,e-a,t,l),r.lineTo(e-a,t-s),r.lineTo(e,t-s),r.closePath()},drawCutRectanglePath:function(r,e,t,n,i,o,a){var s=n/2,l=i/2,u="auto"===a?8:a;r.beginPath&&r.beginPath(),r.moveTo(e-s+u,t-l),r.lineTo(e+s-u,t-l),r.lineTo(e+s,t-l+u),r.lineTo(e+s,t+l-u),r.lineTo(e+s-u,t+l),r.lineTo(e-s+u,t+l),r.lineTo(e-s,t+l-u),r.lineTo(e-s,t-l+u),r.closePath()},drawBarrelPath:function(r,e,t,n,i){var o=n/2,a=i/2,s=e-o,l=e+o,u=t-a,c=t+a,d=H0(n,i),h=d.widthOffset,f=d.heightOffset,g=d.ctrlPtOffsetPct*h;r.beginPath&&r.beginPath(),r.moveTo(s,u+f),r.lineTo(s,c-f),r.quadraticCurveTo(s+g,c,s+h,c),r.lineTo(l-h,c),r.quadraticCurveTo(l-g,c,l,c-f),r.lineTo(l,u+f),r.quadraticCurveTo(l-g,u,l-h,u),r.lineTo(s+h,u),r.quadraticCurveTo(s+g,u,s,u+f),r.closePath()}},lL=Math.sin(0),uL=Math.cos(0),DT={},NT={},cL=Math.PI/40,Lc=0*Math.PI;Lc<2*Math.PI;Lc+=cL)DT[Lc]=Math.sin(Lc),NT[Lc]=Math.cos(Lc);Js.drawEllipsePath=function(r,e,t,n,i){if(r.beginPath&&r.beginPath(),r.ellipse)r.ellipse(e,t,n/2,i/2,0,0,2*Math.PI);else for(var o,a,s=n/2,l=i/2,u=0*Math.PI;u<2*Math.PI;u+=cL)o=e-s*DT[u]*lL+s*NT[u]*uL,a=t+l*NT[u]*lL+l*DT[u]*uL,0===u?r.moveTo(o,a):r.lineTo(o,a);r.closePath()};var Xh={};function dL(r){var e=r.indexOf(",");return r.substr(e+1)}function hL(r,e,t){var n=function(){return e.toDataURL(t,r.quality)};switch(r.output){case"blob-promise":return new _c(function(i,o){try{e.toBlob(function(a){null!=a?i(a):o(new Error("`canvas.toBlob()` sent a null value in its callback"))},t,r.quality)}catch(a){o(a)}});case"blob":return function a9(r,e){for(var t=atob(r),n=new ArrayBuffer(t.length),i=new Uint8Array(n),o=0;o<t.length;o++)i[o]=t.charCodeAt(o);return new Blob([n],{type:e})}(dL(n()),t);case"base64":return dL(n());default:return n()}}Xh.createBuffer=function(r,e){var t=document.createElement("canvas");return t.width=r,t.height=e,[t,t.getContext("2d")]},Xh.bufferCanvasImage=function(r){var e=this.cy,n=e.mutableElements().boundingBox(),i=this.findContainerClientCoords(),o=r.full?Math.ceil(n.w):i[2],a=r.full?Math.ceil(n.h):i[3],s=Ut(r.maxWidth)||Ut(r.maxHeight),l=this.getPixelRatio(),u=1;if(void 0!==r.scale)o*=r.scale,a*=r.scale,u=r.scale;else if(s){var c=1/0,d=1/0;Ut(r.maxWidth)&&(c=u*r.maxWidth/o),Ut(r.maxHeight)&&(d=u*r.maxHeight/a),o*=u=Math.min(c,d),a*=u}s||(o*=l,a*=l,u*=l);var h=document.createElement("canvas");h.width=o,h.height=a,h.style.width=o+"px",h.style.height=a+"px";var f=h.getContext("2d");if(o>0&&a>0){f.clearRect(0,0,o,a),f.globalCompositeOperation="source-over";var g=this.getCachedZSortedEles();if(r.full)f.translate(-n.x1*u,-n.y1*u),f.scale(u,u),this.drawElements(f,g),f.scale(1/u,1/u),f.translate(n.x1*u,n.y1*u);else{var y=e.pan(),v={x:y.x*u,y:y.y*u};u*=e.zoom(),f.translate(v.x,v.y),f.scale(u,u),this.drawElements(f,g),f.scale(1/u,1/u),f.translate(-v.x,-v.y)}r.bg&&(f.globalCompositeOperation="destination-over",f.fillStyle=r.bg,f.rect(0,0,o,a),f.fill())}return h},Xh.png=function(r){return hL(r,this.bufferCanvasImage(r),"image/png")},Xh.jpg=function(r){return hL(r,this.bufferCanvasImage(r),"image/jpeg")};var s9=pL,Nr=pL.prototype;function pL(r){var e=this,n=e.cy.window().document;r.webgl&&(Nr.CANVAS_LAYERS=e.CANVAS_LAYERS=4,console.log("webgl rendering enabled")),e.data={canvases:new Array(Nr.CANVAS_LAYERS),contexts:new Array(Nr.CANVAS_LAYERS),canvasNeedsRedraw:new Array(Nr.CANVAS_LAYERS),bufferCanvases:new Array(Nr.BUFFER_COUNT),bufferContexts:new Array(Nr.CANVAS_LAYERS)};var i="-webkit-tap-highlight-color",o="rgba(0,0,0,0)";e.data.canvasContainer=n.createElement("div");var a=e.data.canvasContainer.style;e.data.canvasContainer.style[i]=o,a.position="relative",a.zIndex="0",a.overflow="hidden";var s=r.cy.container();s.appendChild(e.data.canvasContainer),s.style[i]=o;var l={"-webkit-user-select":"none","-moz-user-select":"-moz-none","user-select":"none","-webkit-tap-highlight-color":"rgba(0,0,0,0)","outline-style":"none"};rP&&rP.userAgent.match(/msie|trident|edge/i)&&(l["-ms-touch-action"]="none",l["touch-action"]="none");for(var u=0;u<Nr.CANVAS_LAYERS;u++){var c=e.data.canvases[u]=n.createElement("canvas"),d=Nr.CANVAS_TYPES[u];e.data.contexts[u]=c.getContext(d),e.data.contexts[u]||kn("Could not create canvas of type "+d),Object.keys(l).forEach(function(_t){c.style[_t]=l[_t]}),c.style.position="absolute",c.setAttribute("data-id","layer"+u),c.style.zIndex=String(Nr.CANVAS_LAYERS-u),e.data.canvasContainer.appendChild(c),e.data.canvasNeedsRedraw[u]=!1}for(e.data.topCanvas=e.data.canvases[0],e.data.canvases[Nr.NODE].setAttribute("data-id","layer"+Nr.NODE+"-node"),e.data.canvases[Nr.SELECT_BOX].setAttribute("data-id","layer"+Nr.SELECT_BOX+"-selectbox"),e.data.canvases[Nr.DRAG].setAttribute("data-id","layer"+Nr.DRAG+"-drag"),e.data.canvases[Nr.WEBGL]&&e.data.canvases[Nr.WEBGL].setAttribute("data-id","layer"+Nr.WEBGL+"-webgl"),u=0;u<Nr.BUFFER_COUNT;u++)e.data.bufferCanvases[u]=n.createElement("canvas"),e.data.bufferContexts[u]=e.data.bufferCanvases[u].getContext("2d"),e.data.bufferCanvases[u].style.position="absolute",e.data.bufferCanvases[u].setAttribute("data-id","buffer"+u),e.data.bufferCanvases[u].style.zIndex=String(-u-1),e.data.bufferCanvases[u].style.visibility="hidden";e.pathsEnabled=!0;var h=eo(),g=function(Ue){return{x:-Ue.w/2,y:-Ue.h/2}},v=function(Ue){return Ue[0]._private.nodeKey},m=function(Ue){return Ue[0]._private.labelStyleKey},b=function(Ue){return Ue[0]._private.sourceLabelStyleKey},T=function(Ue){return Ue[0]._private.targetLabelStyleKey},O=function(Ue,He,Ye,pt,Lt){return e.drawElement(Ue,He,Ye,!1,!1,Lt)},K=function(Ue,He,Ye,pt,Lt){return e.drawElementText(Ue,He,Ye,pt,"main",Lt)},Z=function(Ue,He,Ye,pt,Lt){return e.drawElementText(Ue,He,Ye,pt,"source",Lt)},S=function(Ue,He,Ye,pt,Lt){return e.drawElementText(Ue,He,Ye,pt,"target",Lt)},P=function(Ue){return Ue.boundingBox(),Ue[0]._private.bodyBounds},M=function(Ue){return Ue.boundingBox(),Ue[0]._private.labelBounds.main||h},q=function(Ue){return Ue.boundingBox(),Ue[0]._private.labelBounds.source||h},G=function(Ue){return Ue.boundingBox(),Ue[0]._private.labelBounds.target||h},X=function(Ue,He){return He},U=function(Ue){return function(Ue){return{x:(Ue.x1+Ue.x2)/2,y:(Ue.y1+Ue.y2)/2}}(P(Ue))},me=function(Ue,He,Ye){var pt=Ue?Ue+"-":"";return{x:He.x+Ye.pstyle(pt+"text-margin-x").pfValue,y:He.y+Ye.pstyle(pt+"text-margin-y").pfValue}},be=function(Ue,He,Ye){var pt=Ue[0]._private.rscratch;return{x:pt[He],y:pt[Ye]}},Ae=function(Ue){return me("",be(Ue,"labelX","labelY"),Ue)},_e=function(Ue){return me("source",be(Ue,"sourceLabelX","sourceLabelY"),Ue)},Se=function(Ue){return me("target",be(Ue,"targetLabelX","targetLabelY"),Ue)},je=function(Ue){return g(P(Ue))},Xe=function(Ue){return g(q(Ue))},De=function(Ue){return g(G(Ue))},ze=function(Ue){var He=M(Ue),Ye=g(M(Ue));if(Ue.isNode()){switch(Ue.pstyle("text-halign").value){case"left":Ye.x=-He.w-(He.leftPad||0);break;case"right":Ye.x=-(He.rightPad||0)}switch(Ue.pstyle("text-valign").value){case"top":Ye.y=-He.h-(He.topPad||0);break;case"bottom":Ye.y=-(He.botPad||0)}}return Ye},lt=e.data.eleTxrCache=new Gh(e,{getKey:v,doesEleInvalidateKey:function(Ue){var He=Ue[0]._private;return!(He.oldBackgroundTimestamp===He.backgroundTimestamp)},drawElement:O,getBoundingBox:P,getRotationPoint:U,getRotationOffset:je,allowEdgeTxrCaching:!1,allowParentTxrCaching:!1}),yt=e.data.lblTxrCache=new Gh(e,{getKey:m,drawElement:K,getBoundingBox:M,getRotationPoint:Ae,getRotationOffset:ze,isVisible:X}),ot=e.data.slbTxrCache=new Gh(e,{getKey:b,drawElement:Z,getBoundingBox:q,getRotationPoint:_e,getRotationOffset:Xe,isVisible:X}),bt=e.data.tlbTxrCache=new Gh(e,{getKey:T,drawElement:S,getBoundingBox:G,getRotationPoint:Se,getRotationOffset:De,isVisible:X}),xt=e.data.lyrTxrCache=new GN(e);e.onUpdateEleCalcs(function(Ue,He){lt.invalidateElements(He),yt.invalidateElements(He),ot.invalidateElements(He),bt.invalidateElements(He),xt.invalidateElements(He);for(var Ye=0;Ye<He.length;Ye++){var pt=He[Ye]._private;pt.oldBackgroundTimestamp=pt.backgroundTimestamp}});var zt=function(Ue){for(var He=0;He<Ue.length;He++)xt.enqueueElementRefinement(Ue[He].ele)};lt.onDequeue(zt),yt.onDequeue(zt),ot.onDequeue(zt),bt.onDequeue(zt),r.webgl&&e.initWebgl(r,{getStyleKey:v,getLabelKey:m,getSourceLabelKey:b,getTargetLabelKey:T,drawElement:O,drawLabel:K,drawSourceLabel:Z,drawTargetLabel:S,getElementBox:P,getLabelBox:M,getSourceLabelBox:q,getTargetLabelBox:G,getElementRotationPoint:U,getElementRotationOffset:je,getLabelRotationPoint:Ae,getSourceLabelRotationPoint:_e,getTargetLabelRotationPoint:Se,getLabelRotationOffset:ze,getSourceLabelRotationOffset:Xe,getTargetLabelRotationOffset:De})}Nr.CANVAS_LAYERS=3,Nr.SELECT_BOX=0,Nr.DRAG=1,Nr.NODE=2,Nr.WEBGL=3,Nr.CANVAS_TYPES=["2d","2d","2d","webgl2"],Nr.BUFFER_COUNT=3,Nr.TEXTURE_BUFFER=0,Nr.MOTIONBLUR_BUFFER_NODE=1,Nr.MOTIONBLUR_BUFFER_DRAG=2,Nr.redrawHint=function(r,e){var t=this;switch(r){case"eles":t.data.canvasNeedsRedraw[Nr.NODE]=e;break;case"drag":t.data.canvasNeedsRedraw[Nr.DRAG]=e;break;case"select":t.data.canvasNeedsRedraw[Nr.SELECT_BOX]=e;break;case"gc":t.data.gc=!0}};var l9=typeof Path2D<"u";Nr.path2dEnabled=function(r){if(void 0===r)return this.pathsEnabled;this.pathsEnabled=!!r},Nr.usePaths=function(){return l9&&this.pathsEnabled},Nr.setImgSmoothing=function(r,e){null!=r.imageSmoothingEnabled?r.imageSmoothingEnabled=e:(r.webkitImageSmoothingEnabled=e,r.mozImageSmoothingEnabled=e,r.msImageSmoothingEnabled=e)},Nr.getImgSmoothing=function(r){return null!=r.imageSmoothingEnabled?r.imageSmoothingEnabled:r.webkitImageSmoothingEnabled||r.mozImageSmoothingEnabled||r.msImageSmoothingEnabled},Nr.makeOffscreenCanvas=function(r,e){var t;return"undefined"!==(typeof OffscreenCanvas>"u"?"undefined":ii(OffscreenCanvas))?t=new OffscreenCanvas(r,e):((t=this.cy.window().document.createElement("canvas")).width=r,t.height=e),t},[jN,Sa,os,TT,eu,Qs,ro,iL,Js,Xh,{nodeShapeImpl:function(r,e,t,n,i,o,a,s){switch(r){case"ellipse":return this.drawEllipsePath(e,t,n,i,o);case"polygon":return this.drawPolygonPath(e,t,n,i,o,a);case"round-polygon":return this.drawRoundPolygonPath(e,t,n,i,o,a,s);case"roundrectangle":case"round-rectangle":return this.drawRoundRectanglePath(e,t,n,i,o,s);case"cutrectangle":case"cut-rectangle":return this.drawCutRectanglePath(e,t,n,i,o,a,s);case"bottomroundrectangle":case"bottom-round-rectangle":return this.drawBottomRoundRectanglePath(e,t,n,i,o,s);case"barrel":return this.drawBarrelPath(e,t,n,i,o)}}}].forEach(function(r){gr(Nr,r)});var c9=[{type:"layout",extensions:O$},{type:"renderer",extensions:[{name:"null",impl:vN},{name:"base",impl:MN},{name:"canvas",impl:s9}]}],gL={},mL={};function vL(r,e,t){var n=t,i=function(P){Qr("Can not register `"+e+"` for `"+r+"` since `"+P+"` already exists in the prototype and can not be overridden")};if("core"===r){if(Vh.prototype[e])return i(e);Vh.prototype[e]=t}else if("collection"===r){if(ki.prototype[e])return i(e);ki.prototype[e]=t}else if("layout"===r){for(var o=function(P){this.options=P,t.call(this,P),qr(this._private)||(this._private={}),this._private.cy=P.cy,this._private.listeners=[],this.createEmitter()},a=o.prototype=Object.create(t.prototype),s=[],l=0;l<s.length;l++){var u=s[l];a[u]=a[u]||function(){return this}}a.start&&!a.run?a.run=function(){return this.start(),this}:!a.start&&a.run&&(a.start=function(){return this.run(),this});var c=t.prototype.stop;a.stop=function(){var S=this.options;if(S&&S.animate){var P=this.animations;if(P)for(var M=0;M<P.length;M++)P[M].stop()}return c?c.call(this):this.emit("layoutstop"),this},a.destroy||(a.destroy=function(){return this}),a.cy=function(){return this._private.cy};var d=function(P){return P._private.cy},h={addEventFields:function(P,M){M.layout=P,M.cy=d(P),M.target=P},bubble:function(){return!0},parent:function(P){return d(P)}};gr(a,{createEmitter:function(){return this._private.emitter=new Ng(h,this),this},emitter:function(){return this._private.emitter},on:function(P,M){return this.emitter().on(P,M),this},one:function(P,M){return this.emitter().one(P,M),this},once:function(P,M){return this.emitter().one(P,M),this},removeListener:function(P,M){return this.emitter().removeListener(P,M),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},emit:function(P,M){return this.emitter().emit(P,M),this}}),Jr.eventAliasesOn(a),n=o}else if("renderer"===r&&"null"!==e&&"base"!==e){var f=yL("renderer","base"),g=f.prototype,y=t,v=t.prototype,m=function(){f.apply(this,arguments),y.apply(this,arguments)},b=m.prototype;for(var T in g){var O=g[T];if(null!=v[T])return i(T);b[T]=O}for(var Z in v)b[Z]=v[Z];g.clientFunctions.forEach(function(S){b[S]=b[S]||function(){kn("Renderer does not implement `renderer."+S+"()` on its prototype")}}),n=m}else if("__proto__"===r||"constructor"===r||"prototype"===r)return kn(r+" is an illegal type to be registered, possibly lead to prototype pollutions");return cP({map:gL,keys:[r,e],value:n})}function yL(r,e){return dP({map:gL,keys:[r,e]})}function d9(r,e,t,n,i){return cP({map:mL,keys:[r,e,t,n],value:i})}function h9(r,e,t,n){return dP({map:mL,keys:[r,e,t,n]})}var LT=function(){return 2===arguments.length?yL.apply(null,arguments):3===arguments.length?vL.apply(null,arguments):4===arguments.length?h9.apply(null,arguments):5===arguments.length?d9.apply(null,arguments):void kn("Invalid extension access syntax")};Vh.prototype.extension=LT,c9.forEach(function(r){r.extensions.forEach(function(e){vL(r.type,e.name,e.impl)})});var om=function(){if(!(this instanceof om))return new om;this.length=0},ru=om.prototype;ru.instanceString=function(){return"stylesheet"},ru.selector=function(r){return this[this.length++]={selector:r,properties:[]},this},ru.css=function(r,e){var t=this.length-1;if(sr(r))this[t].properties.push({name:r,value:e});else if(qr(r))for(var n=r,i=Object.keys(n),o=0;o<i.length;o++){var a=i[o],s=n[a];if(null!=s){var l=vi.properties[a]||vi.properties[ag(a)];null!=l&&this[t].properties.push({name:l.name,value:s})}}return this},ru.style=ru.css,ru.generateStyle=function(r){var e=new vi(r);return this.appendToStyle(e)},ru.appendToStyle=function(r){for(var e=0;e<this.length;e++){var t=this[e],i=t.properties;r.selector(t.selector);for(var o=0;o<i.length;o++){var a=i[o];r.css(a.name,a.value)}}return r};var Zs=function(e){return void 0===e&&(e={}),qr(e)?new Vh(e):sr(e)?LT.apply(LT,arguments):void 0};Zs.use=function(r){var e=Array.prototype.slice.call(arguments,1);return e.unshift(Zs),r.apply(null,e),this},Zs.warnings=function(r){return OP(r)},Zs.version="3.33.1",Zs.stylesheet=Zs.Stylesheet=om;var _L=ne(5970);const p9=["graphContainer"],g9=(r,e)=>e.key,wL=(r,e)=>e.id;function m9(r,e){if(1&r&&(V.j41(0,"div",5)(1,"span",6),V.EFF(2),V.k0s(),V.j41(3,"span",7),V.EFF(4),V.k0s()()),2&r){const t=e.$implicit;V.R7$(2),V.JRh(t.key),V.R7$(2),V.JRh(t.value)}}function v9(r,e){if(1&r&&(V.j41(0,"div",4),V.Z7z(1,m9,5,2,"div",5,g9),V.k0s()),2&r){const t=e;V.xc7("left",t.x,"px")("top",t.y,"px"),V.R7$(),V.Dyx(t.entries)}}function y9(r,e){if(1&r){const t=V.RV6();V.j41(0,"button",10),V.bIt("mousedown",function(i){return i.stopPropagation()})("click",function(){const i=w.eBV(t).$implicit,o=V.XpG(2);return w.Njj(o._onContextMenuAction(i.id))}),V.EFF(1),V.k0s()}if(2&r){const t=e.$implicit;V.R7$(),V.SpI(" ",t.label," ")}}function _9(r,e){if(1&r&&(V.j41(0,"div",8),V.Z7z(1,y9,2,1,"button",9,wL),V.k0s()),2&r){const t=V.XpG();V.xc7("left",t.contextMenuPos().x,"px")("top",t.contextMenuPos().y,"px"),V.R7$(),V.Dyx(t.contextMenuItems())}}function w9(r,e){if(1&r){const t=V.RV6();V.j41(0,"button",10),V.bIt("mousedown",function(i){return i.stopPropagation()})("click",function(){const i=w.eBV(t).$implicit,o=V.XpG(2);return w.Njj(o._onEdgeContextMenuAction(i.id))}),V.EFF(1),V.k0s()}if(2&r){const t=e.$implicit;V.R7$(),V.SpI(" ",t.label," ")}}function b9(r,e){if(1&r&&(V.j41(0,"div",8),V.Z7z(1,w9,2,1,"button",9,wL),V.k0s()),2&r){const t=V.XpG();V.xc7("left",t.edgeContextMenuPos().x,"px")("top",t.edgeContextMenuPos().y,"px"),V.R7$(),V.Dyx(t.edgeContextMenuItems())}}try{Zs.use(F5())}catch{}let OT=(()=>{class r{elements=R.hFB.required();animate=(0,R.hFB)(!1);stopAnimationAfterFirstNodeHover=(0,R.hFB)(!0);layout=(0,R.hFB)("cose-bilkent");highlightNeighborsOnHover=(0,R.hFB)(!0);userZoomingEnabled=(0,R.hFB)(!0);userPanningEnabled=(0,R.hFB)(!0);appendHTMLLabels=(0,R.hFB)(!0);directed=(0,R.hFB)(!0);labelPropsSettings=(0,R.hFB)(new fh);contextMenuItems=(0,R.hFB)([]);edgeContextMenuItems=(0,R.hFB)([]);nodeHover=(0,R.CGW)();nodeClick=(0,R.CGW)();canvasClick=(0,R.CGW)();contextMenuAction=(0,R.CGW)();edgeContextMenuAction=(0,R.CGW)();_cy=(0,w.vPA)(void 0);_container=(0,w.vPA)(void 0);_animate;_positionCache=new Map;hoverNodeOverlay=(0,w.vPA)(null);contextMenuVisible=(0,w.vPA)(!1);contextMenuPos=(0,w.vPA)({x:0,y:0});_contextMenuNode=null;edgeContextMenuVisible=(0,w.vPA)(!1);edgeContextMenuPos=(0,w.vPA)({x:0,y:0});_edgeContextMenuLabel="";_edgeContextMenuEdge={source:"",target:""};graphContainer;handleElements=(0,w.QZP)(()=>{const t=this.elements();if(void 0===this._container())return;const n=this._cy();n?this._patch(n,t):this._build(),this._setupClickHoverEvents()});handleAnimate=(0,w.QZP)(()=>{const t=this._cy();void 0!==t&&(this.animate()?this._setAnimation(t):this._stopAnimation())});handleHTMLLabels=(0,w.QZP)(()=>{const t=this._cy(),n=this._container();if(void 0===t||void 0===n)return;const i=this.labelPropsSettings(),o=new fh;o.boxLabels={...i.boxLabels},o.props={display:!1,displayOnlyOnHover:i.props.displayOnlyOnHover},JR(t,n,o)});_bodyObserver;_resizeDebounce;_startBodyObserver(){this._bodyObserver=new MutationObserver(()=>{this._reapplyStyles()}),this._bodyObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]})}_reapplyStyles(){const t=this._cy(),n=this._container();if(!t||!n)return;const i=this._resolveParentBg(n),o={...ng,directed:this.directed(),backgroundColor:i};t.style(ZR(o)).update()}_resolveParentBg(t){let n=t.parentElement;for(;n;){const i=window.getComputedStyle(n).backgroundColor;if(i&&"rgba(0, 0, 0, 0)"!==i&&"transparent"!==i)return i;n=n.parentElement}return"#ffffff"}ngAfterViewInit(){const t=this.graphContainer.nativeElement;void 0!==t&&this._container.update(()=>t)}ngOnDestroy(){this._bodyObserver?.disconnect(),clearTimeout(this._resizeDebounce),this._cy()?.destroy()}onResize(){const t=this._cy();t&&(t.resize(),clearTimeout(this._resizeDebounce),this._resizeDebounce=setTimeout(()=>{t.resize(),this._nodesHavePosition()||t.fit(void 0,60),t.center()},250))}_setAnimation(t){this._stopAnimation(),this._animate=new O5(t,this.stopAnimationAfterFirstNodeHover(),1e-4,.02)}_stopAnimation(){this._animate?.stop()}_patch(t,n){const i=new Set(n.nodes.map(m=>m.data.id)),o=new Set(n.edges.map(m=>m.data.id??""));t.nodes().filter(m=>!i.has(m.id())).forEach(m=>{this._positionCache.set(m.id(),{...m.position()})}),t.remove(t.nodes().filter(m=>!i.has(m.id()))),t.remove(t.edges().filter(m=>!o.has(m.id())));const a=new Set(t.nodes().map(m=>m.id())),s=new Set(t.edges().map(m=>m.id()));for(const m of n.nodes)if(a.has(m.data.id)){const b=t.getElementById(m.data.id);b.data(m.data),b.classes(m.classes??"")}const l=n.nodes.filter(m=>!a.has(m.data.id)),u=n.edges.filter(m=>!s.has(m.data.id??""));if(0===l.length&&0===u.length)return;t.nodes().lock();const c=new Set(l.map(m=>m.data.id)),d=t.nodes();t.add([...l.map(m=>({group:"nodes",data:m.data,classes:m.classes??""})),...u.map(m=>({group:"edges",data:m.data,classes:m.classes??""}))]);const h=new Map;for(const m of u){const b=c.has(m.data.source),T=c.has(m.data.target??"");if(b&&!T){const O=t.getElementById(m.data.target??"");O.length>0&&!h.has(m.data.source)&&h.set(m.data.source,{...O.position()})}if(T&&!b){const O=t.getElementById(m.data.source);O.length>0&&!h.has(m.data.target)&&h.set(m.data.target,{...O.position()})}}const f=[];let g=0;if(t.nodes().filter(m=>c.has(m.id())).forEach(m=>{const b=this._positionCache.get(m.id());if(b)m.position(b),m.lock(),this._positionCache.delete(m.id());else{const T=h.get(m.id());if(T){const O=g++*(2*Math.PI/Math.max(l.length,1)),K=100+60*Math.random();m.position({x:T.x+K*Math.cos(O),y:T.y+K*Math.sin(O)})}else f.push(m)}}),f.length>0&&d.length>0){const m=d.boundingBox({}),b=(m.x1+m.x2)/2,T=(m.y1+m.y2)/2,O=Math.max(m.x2-m.x1,m.y2-m.y1)/2+180,K=2*Math.PI/Math.max(f.length,1);f.forEach((Z,S)=>{Z.position({x:b+O*Math.cos(K*S),y:T+O*Math.sin(K*S)})})}const y=this._container();if(y&&this.appendHTMLLabels()){const m=new fh,b=this.labelPropsSettings();m.boxLabels={...b.boxLabels},m.props={display:!1,displayOnlyOnHover:b.props.displayOnlyOnHover},JR(t,y,m)}const v=t.layout({...this._layoutOptions(),randomize:!1,fit:!1,animate:!0});v.on("layoutstop",()=>t.nodes().unlock()),v.run()}_build(){this._bodyObserver?.disconnect(),this._bodyObserver=void 0;const t=this._container(),n=t?this._resolveParentBg(t):ng.backgroundColor,i={...ng,directed:this.directed(),backgroundColor:n},o=ZR(i),a=this._nodesHavePosition()?{name:"preset",padding:100,animate:!1}:{...this._layoutOptions(),padding:80,animate:!1},s=Zs({container:this._container(),style:o,layout:a,elements:this.elements(),userZoomingEnabled:this.userZoomingEnabled(),userPanningEnabled:this.userPanningEnabled(),minZoom:.2,maxZoom:3});s.one("layoutstop",()=>{s.resize(),this._nodesHavePosition()||s.fit(void 0,60),s.center()}),this._cy.update(()=>s),this._startBodyObserver()}_setupClickHoverEvents(){const t=this._cy();if(null==t)return;let n=t.collection();t.nodes().unbind("tapstart"),t.nodes().bind("tapstart",i=>{const o=i.target.data();!o.isCollapser&&!o.isChainExpander&&this.contextMenuItems().length>0&&(i.originalEvent?.preventDefault(),i.originalEvent?.stopPropagation())}),t.nodes().unbind("click"),t.nodes().bind("click",i=>{const o=i.target,a=o.data();if(a.isCollapser||a.isChainExpander)return this.contextMenuVisible.set(!1),this.nodeClick.emit(a),void(n=n.union(o));if(this.contextMenuItems().length>0){const s=o.renderedPosition();return this._contextMenuNode=a,this.contextMenuPos.set({x:s.x,y:s.y}),void this.contextMenuVisible.set(!0)}this.nodeClick.emit(a),n=n.union(o)}),t.nodes().unbind("mouseover"),t.nodes().bind("mouseover",i=>{this._dimAllButNeighbors(i.target);const o=i.target.data();this.nodeHover.emit(o);const a=o.properties;if(this.labelPropsSettings().props.display&&a){const s=Object.entries(a).map(([l,u])=>({key:l,value:String(u)}));if(s.length>0){const l=i.target.renderedBoundingBox();this.hoverNodeOverlay.set({x:(l.x1+l.x2)/2,y:l.y2,entries:s})}}}),t.nodes().unbind("mouseout"),t.nodes().bind("mouseout",()=>{this._unDimAll(),this.nodeHover.emit(void 0),this.hoverNodeOverlay.set(null)}),t.nodes().unbind("drag"),t.nodes().bind("drag",i=>{if(null===this.hoverNodeOverlay())return;const o=i.target.renderedBoundingBox(),a=this.hoverNodeOverlay();this.hoverNodeOverlay.set({...a,x:(o.x1+o.x2)/2,y:o.y2})}),t.nodes().unbind("dragfree"),t.nodes().bind("dragfree",()=>{this.hoverNodeOverlay.set(null)}),t.edges().unbind("mouseover"),t.edges().bind("mouseover",i=>{i.target.addClass("edge-hover")}),t.edges().unbind("mouseout"),t.edges().bind("mouseout",i=>{i.target.removeClass("edge-hover")}),t.edges().unbind("tap"),t.edges().bind("tap",i=>{if(!this.edgeContextMenuItems().length)return;const o=i.target,a=o.renderedMidpoint();this._edgeContextMenuLabel=o.data("label")??"",this._edgeContextMenuEdge={id:o.data("id"),iri:o.data("iri"),label:o.data("label"),source:o.data("source"),target:o.data("target"),color:o.data("color"),width:o.data("width")},this.edgeContextMenuPos.set({x:a.x,y:a.y}),this.edgeContextMenuVisible.set(!0),this.contextMenuVisible.set(!1)}),t.off("click"),t.on("click",i=>{0===Object.keys(i.target.data()).length&&(this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1),this.canvasClick.emit())}),t.off("viewport"),t.on("viewport",()=>{this.contextMenuVisible.set(!1),this.edgeContextMenuVisible.set(!1)})}_onContextMenuAction(t){this.contextMenuVisible.set(!1),this._contextMenuNode&&this.contextMenuAction.emit({actionId:t,node:this._contextMenuNode})}_onEdgeContextMenuAction(t){this.edgeContextMenuVisible.set(!1),this.edgeContextMenuAction.emit({actionId:t,edgeLabel:this._edgeContextMenuLabel,edge:this._edgeContextMenuEdge})}_layoutOptions(){const t=this.layout();if("cose-bilkent"!==t)return{name:t};const n=this.elements().nodes,i=this.elements().edges,o=n.length>0?2*i.length/n.length:1,a=n.map(y=>{const b=[y.data.label||"",...y.data.boxLabels||[]].filter(Boolean);return Math.max(...b.map(T=>T.length),0)}),s=a.length>0?a.reduce((y,v)=>y+v,0)/a.length:0,l=a.length>0?Math.max(...a):0,c=1.5*s,d=.8*Math.max(0,l-20),h=7.2*o;return{name:"cose-bilkent",nodeDimensionsIncludeLabels:!0,randomize:!0,nodeRepulsion:Math.round(4500+500*o),idealEdgeLength:Math.round(48+c+d+h),edgeElasticity:.45,gravity:.25,gravityRange:3.8,numIter:2500}}_nodesHavePosition(){return void 0!==this.elements().nodes.find(n=>void 0!==n.position)}fitTo(t,n=80){const i=this._cy();if(!i||0===t.length)return;let o=i.collection();for(const a of t){const s=i.getElementById(a);s.length>0&&(o=o.union(s))}0!==o.length&&i.animate({fit:{eles:o,padding:n},duration:400,easing:"ease-in-out-cubic"})}_unDimAll(){const t=this._cy();t?.elements().forEach(n=>{n.removeClass("faded")})}_dimAllButNeighbors(t){const n=this._cy();if(null==n)return;const i=t.neighborhood().map(o=>o.id());n.elements().forEach(o=>{i.includes(o.id())||o.id()===t.id()?o.removeClass("faded"):o.addClass("faded")})}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-simple-graph"]],viewQuery:function(n,i){if(1&n&&V.GBs(p9,5),2&n){let o;V.mGM(o=V.lsd())&&(i.graphContainer=o.first)}},inputs:{elements:[1,"elements"],animate:[1,"animate"],stopAnimationAfterFirstNodeHover:[1,"stopAnimationAfterFirstNodeHover"],layout:[1,"layout"],highlightNeighborsOnHover:[1,"highlightNeighborsOnHover"],userZoomingEnabled:[1,"userZoomingEnabled"],userPanningEnabled:[1,"userPanningEnabled"],appendHTMLLabels:[1,"appendHTMLLabels"],directed:[1,"directed"],labelPropsSettings:[1,"labelPropsSettings"],contextMenuItems:[1,"contextMenuItems"],edgeContextMenuItems:[1,"edgeContextMenuItems"]},outputs:{nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick",contextMenuAction:"contextMenuAction",edgeContextMenuAction:"edgeContextMenuAction"},decls:5,vars:3,consts:[["graphContainer",""],["id","graph","cueResized","",3,"resized"],[1,"node-props-overlay",3,"left","top"],[1,"cy-context-menu",3,"left","top"],[1,"node-props-overlay"],[1,"prop-row"],[1,"prop-key"],[1,"prop-value"],[1,"cy-context-menu"],[1,"cy-context-item"],[1,"cy-context-item",3,"mousedown","click"]],template:function(n,i){if(1&n&&(V.j41(0,"div",1,0),V.bIt("resized",function(){return i.onResize()}),V.nVh(2,v9,3,4,"div",2),V.nVh(3,_9,3,4,"div",3),V.nVh(4,b9,3,4,"div",3),V.k0s()),2&n){let o;V.R7$(2),V.vxM((o=i.hoverNodeOverlay())?2:-1,o),V.R7$(),V.vxM(i.contextMenuVisible()&&i.contextMenuItems().length>0?3:-1),V.R7$(),V.vxM(i.edgeContextMenuVisible()&&i.edgeContextMenuItems().length>0?4:-1)}},dependencies:[_L.C],styles:["[_nghost-%COMP%]{display:contents}#graph[_ngcontent-%COMP%]{display:block!important;text-align:left!important;margin:0!important;min-height:100px;flex:1 1;width:100%;position:relative;overflow:hidden} .box-label{position:absolute;pointer-events:none;display:flex;flex-direction:column;align-items:flex-start;gap:4px}.node-props-overlay[_ngcontent-%COMP%]{position:absolute;transform:translate(-50%,8px);z-index:20;pointer-events:none;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:var(--cue-menu-padding-y) var(--cue-menu-padding-x);display:flex;flex-direction:column;gap:8px;min-width:140px;max-width:260px}.prop-row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px}.prop-key[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.6rem;font-weight:600;color:var(--cue-neutral);text-transform:uppercase;letter-spacing:.05em}.prop-value[_ngcontent-%COMP%]{font-family:Poppins,sans-serif;font-size:.72rem;color:var(--cue-menu-foreground-color);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.cy-context-menu[_ngcontent-%COMP%]{position:absolute;z-index:30;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);border:1px solid var(--cue-menu-border-color);border-radius:var(--cue-menu-border-radius);box-shadow:var(--cue-menu-box-shadow);padding:4px 0;min-width:160px;display:flex;flex-direction:column}.cy-context-item[_ngcontent-%COMP%]{background:none;border:none;padding:8px 16px;text-align:left;font-family:Poppins,sans-serif;font-size:.8rem;color:var(--cue-menu-foreground-color);cursor:pointer}.cy-context-item[_ngcontent-%COMP%]:hover{background:var(--cue-menu-hover-color, rgba(0,0,0,.06))}"],changeDetection:0})}return r})();const bL=["#2859e1","#4caf50","#fc2626","#f59e0b","#8b5cf6","#06b6d4","#f97316","#14b8a6","#ec4899","#6366f1"],xL="__collapser__",MT="__chain__";var A9=ne(9134);function S9(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-simple-graph",4),V.bIt("nodeHover",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onNodeHover(i))})("nodeClick",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onNodeClick(i))})("canvasClick",function(){w.eBV(t);const i=V.XpG();return w.Njj(i._onCanvasClick())})("contextMenuAction",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onContextMenuAction(i))})("edgeContextMenuAction",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onEdgeContextMenuAction(i))}),V.k0s()}if(2&r){const t=V.XpG();V.Y8G("elements",e)("labelPropsSettings",t.labelPropsSettings())("contextMenuItems",t._nodeMenuItems())("edgeContextMenuItems",t._edgeMenuItems())}}function C9(r,e){1&r&&V.EFF(0," No elements ")}function R9(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-color-legend-panel",5),V.nI1(1,"transloco"),V.bIt("close",function(){w.eBV(t);const i=V.XpG();return w.Njj(i._legendClosed.set(!0))})("layerChange",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onCategoryLayerChange(i))})("visibilityAll",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onCategoryVisibilityAll(i))}),V.k0s()}if(2&r){const t=V.XpG();V.Y8G("title",V.bMT(1,2,"components.graph.rdf.legendCategories"))("layers",t._categoryLayers())}}function P9(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-color-legend-panel",6),V.nI1(1,"transloco"),V.bIt("close",function(){w.eBV(t);const i=V.XpG();return w.Njj(i._predicateLegendClosed.set(!0))})("layerChange",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onPredicateLayerChange(i))})("visibilityAll",function(i){w.eBV(t);const o=V.XpG();return w.Njj(o._onPredicateVisibilityAll(i))}),V.k0s()}if(2&r){const t=V.XpG();V.Y8G("title",V.bMT(1,3,"components.graph.rdf.legendRelationships"))("layers",t._predicateLayers())("position",t.legendPosition())}}let k9=(()=>{class r{_graph=(0,R.ebz)(OT);doc=(0,R.hFB)();collapseClasses=(0,R.hFB)(!0);collapseAttributes=(0,R.hFB)(!0);collapseRelationships=(0,R.hFB)(!0);classPredicates=(0,R.hFB)([]);focusNodes=(0,R.hFB)([]);focusNodeColor=(0,R.hFB)("red");zoomToFocusNodes=(0,R.hFB)(!1);colorByCategory=(0,R.hFB)(!1);showRelationshipLegend=(0,R.hFB)(!1);legendPosition=(0,R.hFB)("top-left");categoryLabelsOnHover=(0,R.hFB)(!0);nodeMenuItems=(0,R.hFB)(void 0);edgeMenuItems=(0,R.hFB)(void 0);nodeHover=(0,R.CGW)();nodeClick=(0,R.CGW)();canvasClick=(0,R.CGW)();_fullElements=null;_collapserGroups=[];_chainGroups=[];_focusedNodeId=void 0;_hiddenPredicates=new Set;_categoryColors=new Map;_labelFocusOnNeighbours=(0,Jo.Xx)("components.graph.rdf.labelFocusOnNeighbours");_labelUnhideEdges=(0,Jo.Xx)("components.graph.rdf.labelUnhideEdges");_labelHideEdgeType=(0,Jo.Xx)("components.graph.rdf.labelHideEdgeType");_labelCollapseRelationship=(0,Jo.Xx)("components.graph.rdf.labelCollapseRelationship");_hoveredNode=(0,w.vPA)(null);_nodeMenuItems=(0,E.EW)(()=>{const t=this.nodeMenuItems();if(void 0!==t)return t;const n=this._hoveredNode()?.id,i=!!n&&this._collapserGroups.some(o=>o.allTargetNodeIds.includes(n));return[{id:"focus",label:this._labelFocusOnNeighbours()},{id:"unhide-edges",label:this._labelUnhideEdges()},...i?[{id:"collapse-relationship",label:this._labelCollapseRelationship()}]:[]]});_edgeMenuItems=(0,E.EW)(()=>{const t=this.edgeMenuItems();return void 0!==t?t:[{id:"hide-edge-type",label:this._labelHideEdgeType()}]});elements=(0,w.vPA)(void 0);_categoryLayers=(0,w.vPA)([]);_legendClosed=(0,w.vPA)(!1);_predicateLayers=(0,w.vPA)([]);_predicateLegendClosed=(0,w.vPA)(!1);onDoc=(0,w.QZP)((()=>{var t=this;return(0,_.A)(function*(){const n=t.doc();if(void 0===n)return;const i=new KR;i.hideClassAssignmentTriples=t.collapseClasses(),i.hideDatatypePropertyTriples=t.collapseAttributes(),i.collapseIntoClassificationLabels=t.classPredicates();const a=yield new N5(n,i).init();t._fullElements=a,t._collapserGroups=t.collapseRelationships()?function T9(r){const e=new Map,t=new Map;for(const o of r.edges)o.data.target&&e.set(o.data.target,(e.get(o.data.target)??0)+1),o.data.source&&t.set(o.data.source,(t.get(o.data.source)??0)+1);const n=new Map;for(const o of r.edges){const a=`${o.data.source}\0${o.data.label}`;n.has(a)||n.set(a,[]),n.get(a).push(o)}const i=[];for(const[o,a]of n){if(a.length<4)continue;const s=o.indexOf("\0"),l=o.slice(0,s),u=o.slice(s+1),c=a.map(d=>d.data.target).filter(d=>d&&1===(e.get(d)??0)&&0===(t.get(d)??0));c.length<4||i.push({id:`${xL}${l}\0${u}`,sourceId:l,predicateLabel:u,allTargetNodeIds:c,visibleCount:0})}return i}(a):[],t._chainGroups=function I9(r){const e=new Map,t=new Map;for(const u of r.nodes)e.set(u.data.id,[]),t.set(u.data.id,[]);for(const u of r.edges)e.get(u.data.source)?.push(u),u.data.target&&t.get(u.data.target)?.push(u);const n=new Map,i=(u,c=new Set)=>{if(n.has(u))return n.get(u);if(c.has(u))return 0;c.add(u);const f=1+(e.get(u)??[]).reduce((g,y)=>Math.max(g,y.data.target?i(y.data.target,c):0),0);return n.set(u,f),f};for(const u of r.nodes)i(u.data.id);const o=new Set,a=[...r.nodes].sort((u,c)=>(n.get(c.data.id)??0)-(n.get(u.data.id)??0));for(const u of a){if(o.size>=20)break;let c=u.data.id;for(;c&&!o.has(c)&&o.size<20;)o.add(c),c=(e.get(c)??[]).filter(h=>h.data.target&&!o.has(h.data.target)).sort((h,f)=>(n.get(f.data.target)??0)-(n.get(h.data.target)??0))[0]?.data.target}const s=new Set(r.nodes.map(u=>u.data.id).filter(u=>!o.has(u)));if(0===s.size)return[];const l=new Map;for(const u of o)for(const c of e.get(u)??[]){if(!c.data.target||!s.has(c.data.target))continue;const d=`${u}\0${c.data.label??""}`;l.has(d)||l.set(d,{id:`${MT}${u}\0${c.data.label??""}`,sourceId:u,predicateLabel:c.data.label??"",hiddenNodeIds:[],visibleCount:0});const h=l.get(d);let f=c.data.target;for(;f&&s.has(f)&&!h.hiddenNodeIds.includes(f);)h.hiddenNodeIds.push(f),s.delete(f),f=(e.get(f)??[]).filter(y=>y.data.target&&s.has(y.data.target)).sort((y,v)=>(n.get(v.data.target)??0)-(n.get(y.data.target)??0))[0]?.data.target}return s.size>0&&l.set("__orphan__",{id:`${MT}__orphan__`,sourceId:a[0]?.data.id??"",predicateLabel:"",hiddenNodeIds:[...s],visibleCount:0}),[...l.values()].filter(u=>u.hiddenNodeIds.length>0)}(a),t._categoryLayers.set(t._buildCategoryLayers(a)),t._predicateLayers.set(t._buildPredicateLayers(a)),t._legendClosed.set(!1),t._predicateLegendClosed.set(!1),t.elements.set(t._display());const s=t.focusNodes();s.length>0&&t.zoomToFocusNodes()&&setTimeout(()=>t._graph()?.fitTo(s),450)})})());focusEffect=(0,w.QZP)(()=>{const t=this.focusNodes();this._fullElements&&(this.elements.set(this._display()),t.length>0&&this.zoomToFocusNodes()&&setTimeout(()=>this._graph()?.fitTo(t),200))});triggerResize(){const t=this._graph();if(t){const n=t._cy();n.resize(),setTimeout(()=>{const i=n.container(),o=i?.offsetWidth||0,a=i?.offsetHeight||0;if(o>=100&&a>=100){n.resize();const s=n.elements();if(s.length>0){const l=s.nodes();if(!(l.length>0&&l.every(q=>{const G=q.position();return 0!==G.x||0!==G.y}))){const q=this._graph();return void(q&&q._build?.())}const c=Math.min(o,a),d=Math.min(Math.max(.15*c,40),120),h=s.boundingBox(),T=Math.min((o-2*d)/(h.w||1),(a-2*d)/(h.h||1)),O=s.nodes().length,K=s.edges().length,Z=O>0?2*K/O:1;let S=2.5;Z>10?S=1:Z>6?S=1.5:Z>3&&(S=2);const M=Math.min(Math.max(T,.2),S);n.animate(M!==T?{zoom:M,center:{eles:s},duration:300}:{fit:{eles:s,padding:d},duration:300})}}else console.warn("\u{1f3af} RDFGraph: container too small or invalid dimensions, skipping fit")},150)}}colorByCategoryEffect=(0,w.QZP)(()=>{this.colorByCategory()&&this._legendClosed.set(!1),this._fullElements&&this.elements.set(this._display())});showRelationshipLegendEffect=(0,w.QZP)(()=>{this.showRelationshipLegend()&&this._predicateLegendClosed.set(!1)});labelPropsSettings=(0,E.EW)(()=>{const t=new fh;return t.boxLabels.display=this.collapseClasses(),t.props.display=this.collapseAttributes(),t.boxLabels.displayOnlyOnHover=this.colorByCategory()||this.categoryLabelsOnHover(),t});_onNodeHover(t){t&&this._hoveredNode.set(t),this.nodeHover.emit(t)}_onNodeClick(t){const n=t;if(n.isCollapser&&n.collapserGroupId){const i=this._collapserGroups.find(o=>o.id===n.collapserGroupId);if(i)return i.visibleCount=n.isExpanded?0:Math.min(i.visibleCount+5,i.allTargetNodeIds.length),void this.elements.set(this._display())}if(n.isChainExpander&&n.chainGroupId){const i=this._chainGroups.find(o=>o.id===n.chainGroupId);if(i)return i.visibleCount=n.isExpanded?0:Math.min(i.visibleCount+5,i.hiddenNodeIds.length),void this.elements.set(this._display())}this.nodeClick.emit(t)}_onCanvasClick(){this.canvasClick.emit(),this._focusedNodeId&&(this._focusedNodeId=void 0,this.elements.set(this._display()))}_onContextMenuAction(t){const n=this.nodeMenuItems();if(void 0===n){if("focus"===t.actionId){const i=t.node.id;this._focusedNodeId=this._focusedNodeId===i?void 0:i,this.elements.set(this._display())}else if("unhide-edges"===t.actionId)this._hiddenPredicates.clear(),this._predicateLayers.update(i=>i.map(o=>({...o,visible:!0}))),this.elements.set(this._display());else if("collapse-relationship"===t.actionId){const i=t.node.id;for(const o of this._collapserGroups)o.allTargetNodeIds.includes(i)&&(o.visibleCount=0);this.elements.set(this._display())}}else n.find(i=>i.id===t.actionId)?.action(t.node)}_onEdgeContextMenuAction(t){const n=this.edgeMenuItems();void 0===n?"hide-edge-type"===t.actionId&&(this._hiddenPredicates.add(t.edgeLabel),this.elements.set(this._display())):n.find(i=>i.id===t.actionId)?.action(t.edge)}_onCategoryLayerChange(t){this._categoryLayers.update(n=>[...n]),this.elements.set(this._display())}_onCategoryVisibilityAll(t){this._categoryLayers.update(n=>[...n]),this.elements.set(this._display())}_onPredicateLayerChange(t){this._predicateLayers.update(n=>[...n]),this.elements.set(this._display())}_onPredicateVisibilityAll(t){this._predicateLayers.update(n=>[...n]),this.elements.set(this._display())}static _PREDICATE_COLOR="#4a90d9";_buildPredicateLayers(t){const n=new Set,i=[];for(const o of t.edges){const a=o.data.label??"";a&&!n.has(a)&&(n.add(a),i.push(a))}return i.map(o=>({label:o,color:r._PREDICATE_COLOR,visible:!0}))}_buildCategoryLayers(t){const n=new Set,i=[];for(const o of t.nodes){if(o.data.id.startsWith(xL)||o.data.id.startsWith(MT))continue;const a=o.data.boxLabels?.[0];a&&!n.has(a)&&(n.add(a),i.push(a))}return this._categoryColors=function E9(r){const e=new Map;return r.forEach((t,n)=>{e.set(t,bL[n%bL.length])}),e}(i),i.map(o=>({label:o,color:this._categoryColors.get(o),visible:!0}))}_display(){if(!this._fullElements)return{nodes:[],edges:[]};let t=function x9(r,e,t){const n=new Set,i=new Set,o=[],a=[];for(const l of t){const u=l.hiddenNodeIds.length-l.visibleCount;if(u<=0)continue;for(const h of l.hiddenNodeIds.slice(l.visibleCount))n.add(h);const c=l.visibleCount>0,d=c?l.hiddenNodeIds[l.visibleCount-1]:l.sourceId;o.push({data:{id:l.id,label:c?"\u2212":`+${u}`,size:28,isChainExpander:!0,isExpanded:c,chainGroupId:l.id},classes:c?"collapser collapser-expanded":"collapser"}),a.push({data:{id:`edge_${l.id}`,source:d,target:l.id,label:l.predicateLabel}})}for(const l of e){const u=l.allTargetNodeIds.length-l.visibleCount;if(u<=0)continue;for(const h of l.allTargetNodeIds.slice(l.visibleCount))n.add(h);const c=r.edges.filter(h=>h.data.source===l.sourceId&&h.data.label===l.predicateLabel&&l.allTargetNodeIds.includes(h.data.target));for(const h of c)i.add(h.data.id??"");for(const h of c)l.allTargetNodeIds.indexOf(h.data.target)<l.visibleCount&&a.push(h);const d=l.visibleCount>0;o.push({data:{id:l.id,label:d?"\u2212":`+${u}`,size:28,isCollapser:!0,isExpanded:d,collapserGroupId:l.id},classes:d?"collapser collapser-expanded":"collapser"}),a.push({data:{id:`edge_${l.id}`,source:l.sourceId,target:l.id,label:l.predicateLabel}})}const s=new Set(o.map(l=>l.data.id));return{nodes:[...r.nodes.filter(l=>!n.has(l.data.id)),...o],edges:[...r.edges.filter(l=>!(i.has(l.data.id??"")||n.has(l.data.source)||n.has(l.data.target??"")||s.has(l.data.source)||s.has(l.data.target??""))),...a]}}(this._fullElements,this._collapserGroups,this._chainGroups);const n=new Set(this._predicateLayers().filter(s=>!s.visible).map(s=>s.label)),i=new Set([...this._hiddenPredicates,...n]);if(i.size>0){const s=t.edges.filter(u=>!i.has(u.data.label??"")),l=new Set;for(const u of s)l.add(u.data.source),l.add(u.data.target);t={nodes:t.nodes.filter(u=>l.has(u.data.id)),edges:s}}if(this.colorByCategory()){const s=new Set(this._categoryLayers().filter(l=>!l.visible).map(l=>l.label));if(s.size>0){const l=new Map(this._fullElements.nodes.map(d=>[d.data.id,d.data.boxLabels?.[0]])),u=d=>{const h=l.get(d);return void 0!==h&&s.has(h)},c=new Set(t.nodes.filter(d=>{const h=d.data.boxLabels?.[0];return void 0!==h&&s.has(h)}).map(d=>d.data.id));for(const d of this._collapserGroups)d.allTargetNodeIds.every(u)&&c.add(d.id);for(const d of this._chainGroups){const h=d.hiddenNodeIds.slice(d.visibleCount);h.length>0&&h.every(u)&&c.add(d.id)}t={nodes:t.nodes.filter(d=>!c.has(d.data.id)),edges:t.edges.filter(d=>!c.has(d.data.source)&&!c.has(d.data.target))}}t={...t,nodes:t.nodes.map(l=>{const u=l.data.boxLabels?.[0],c=u?this._categoryColors.get(u):void 0;return c?{...l,data:{...l.data,color:c}}:l})}}this._focusedNodeId&&(t=this._applyFocus(t,this._focusedNodeId));const o=new Set(this.focusNodes()),a=this.focusNodeColor();return o.size>0&&(t={...t,nodes:t.nodes.map(s=>{if(!o.has(s.data.id))return s;const l=s.classes?s.classes.trim():"";return{...s,data:{...s.data,color:a},classes:l?`${l} focused`:"focused"}})}),t}_applyFocus(t,n){return{...t,nodes:t.nodes.map(i=>{if(i.data.id!==n)return i;const o=i.classes?i.classes.trim():"";return{...i,classes:o?`${o} focused`:"focused"}})}}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-rdf-graph"]],viewQuery:function(n,i){1&n&&V.wEZ(i._graph,OT,5),2&n&&V.NyB()},inputs:{doc:[1,"doc"],collapseClasses:[1,"collapseClasses"],collapseAttributes:[1,"collapseAttributes"],collapseRelationships:[1,"collapseRelationships"],classPredicates:[1,"classPredicates"],focusNodes:[1,"focusNodes"],focusNodeColor:[1,"focusNodeColor"],zoomToFocusNodes:[1,"zoomToFocusNodes"],colorByCategory:[1,"colorByCategory"],showRelationshipLegend:[1,"showRelationshipLegend"],legendPosition:[1,"legendPosition"],categoryLabelsOnHover:[1,"categoryLabelsOnHover"],nodeMenuItems:[1,"nodeMenuItems"],edgeMenuItems:[1,"edgeMenuItems"]},outputs:{nodeHover:"nodeHover",nodeClick:"nodeClick",canvasClick:"canvasClick"},decls:5,vars:3,consts:[[2,"display","flex","flex-direction","column","position","relative","width","100%","flex","1","min-height","0"],[3,"elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems"],["position","top-right",3,"title","layers"],[3,"title","layers","position"],[3,"nodeHover","nodeClick","canvasClick","contextMenuAction","edgeContextMenuAction","elements","labelPropsSettings","contextMenuItems","edgeContextMenuItems"],["position","top-right",3,"close","layerChange","visibilityAll","title","layers"],[3,"close","layerChange","visibilityAll","title","layers","position"]],template:function(n,i){if(1&n&&(V.j41(0,"div",0),V.nVh(1,S9,1,4,"cue-simple-graph",1)(2,C9,1,0),V.nVh(3,R9,2,4,"cue-color-legend-panel",2),V.nVh(4,P9,2,5,"cue-color-legend-panel",3),V.k0s()),2&n){let o;V.R7$(),V.vxM((o=i.elements())?1:2,o),V.R7$(2),V.vxM(i.colorByCategory()&&i._categoryLayers().length>0&&!i._legendClosed()?3:-1),V.R7$(),V.vxM(i.showRelationshipLegend()&&i._predicateLayers().length>0&&!i._predicateLegendClosed()?4:-1)}},dependencies:[OT,A9.v,Jo.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return r})();var D9=ne(4284);function N9(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-rdf-graph",1),V.bIt("nodeHover",function(i){w.eBV(t);const o=V.XpG(2);return w.Njj(o.hoveredNode.set(i))}),V.k0s()}if(2&r){const t=V.XpG(),n=V.XpG();V.Y8G("doc",t)("collapseClasses",!0)("collapseAttributes",!0)("collapseRelationships",!0)("colorByCategory",!1)("categoryLabelsOnHover",!0)("showRelationshipLegend",!0)("legendPosition",n.legendPosition())("nodeMenuItems",n.nodeMenuItems())("focusNodes",n.focusNodes())("focusNodeColor",n.focusNodeColor())("zoomToFocusNodes",!1)}}function L9(r,e){if(1&r&&V.nVh(0,N9,1,12,"cue-rdf-graph",0),2&r){const t=V.XpG();V.vxM(t._containerReady()?0:-1)}}let O9=(()=>{class r{entity=R.hFB.required();availableEntityCategories=R.hFB.required();availableEntityRelationships=(0,R.hFB)([]);relationships=(0,R.hFB)(void 0);legendPosition=(0,R.hFB)("top-left");showOpenEntityMenuItem=(0,R.hFB)(!0);clickedOpenEntity=(0,R.CGW)();doc=(0,w.vPA)(void 0);_containerReady=(0,w.vPA)(!1);_hostElement=(0,w.WQX)(V.aKT);_resolvedEntityIRI=(0,E.EW)(()=>{const t=this.entity()?.iri;if(t){if(!t.includes("://"))throw new Error(`Expected a full IRI but got: ${t}`);return t}});focusNodes=(0,E.EW)(()=>{const t=this._resolvedEntityIRI();return t?[t]:[]});focusNodeColor=(0,w.vPA)("green");_document=(0,w.WQX)(w.qQL);hoveredNode=(0,w.vPA)(void 0);labelOpenEntity=(0,Jo.Xx)("components.graph.entityGraph.labelOpenEntity");nodeMenuItems=(0,E.EW)(()=>{const t=[];return this.showOpenEntityMenuItem()&&this.hoveredNode()?.id!==this._resolvedEntityIRI()&&t.push({id:"open",label:this.labelOpenEntity(),action:n=>this.clickedOpenEntity.emit(n.id)}),t});constructor(){(0,V.mal)(()=>{const t=getComputedStyle(this._document.documentElement).getPropertyValue("--cue-color-green").trim();t&&this.focusNodeColor.set(t)}),(0,w.QZP)(()=>{const t=this.entity()?.iri,n=this.relationships();void 0===t||void 0===n||this._buildDoc(n)}),(0,V.mal)(()=>{if(this._containerReady())return;const t=this._hostElement.nativeElement,n=new ResizeObserver(i=>{if(this._containerReady())return void n.disconnect();const o=i[0]?.contentRect;o&&o.width>=100&&o.height>=100&&(this._containerReady.set(!0),n.disconnect())});return n.observe(t),()=>n.disconnect()})}ngAfterViewInit(){const t=this._hostElement.nativeElement;t.clientWidth>=100&&t.clientHeight>=100&&this._containerReady.set(!0)}_buildDoc(t){const{incoming:n,outgoing:i}=t,o={"@context":{qcy:`${f0.E.qcy}`,"qcy-e":`${f0.E["qcy-e"]}`,skos:`${D9.B.skos}`},"@graph":[]},a=this._resolvedEntityIRI(),s={"@id":a,"qcy:value":this.entity()?.value,"@type":this.entity()?.categories};o["@graph"].push(s),i.forEach(c=>{o["@graph"].push({"@id":c.nodeIRI,"qcy:value":c.nodeValue,"@type":c.nodeCategories}),o["@graph"].push({"@id":a,[c.relIRI]:{"@id":c.nodeIRI}})}),n.forEach(c=>{o["@graph"].push({"@id":c.nodeIRI,"qcy:value":c.nodeValue,"@type":c.nodeCategories}),o["@graph"].push({"@id":c.nodeIRI,[c.relIRI]:{"@id":a}})});const l=new Set;n.forEach(c=>c.nodeCategories.forEach(d=>l.add(d))),i.forEach(c=>c.nodeCategories.forEach(d=>l.add(d))),this.entity()?.categories.forEach(c=>l.add(c)),l.forEach(c=>{const d=this.availableEntityCategories().find(h=>h.iri===c)?.label;void 0!==d&&o["@graph"].push({"@id":c,"skos:prefLabel":d})}),new Set(n.map(c=>c.relIRI).concat(i.map(c=>c.relIRI))).forEach(c=>{const d=this.availableEntityRelationships().find(h=>h.iri===c)?.label;void 0!==d&&o["@graph"].push({"@id":c,"skos:prefLabel":d})}),this.doc.update(()=>o)}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-entity-graph"]],inputs:{entity:[1,"entity"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],relationships:[1,"relationships"],legendPosition:[1,"legendPosition"],showOpenEntityMenuItem:[1,"showOpenEntityMenuItem"]},outputs:{clickedOpenEntity:"clickedOpenEntity"},decls:1,vars:1,consts:[[3,"doc","collapseClasses","collapseAttributes","collapseRelationships","colorByCategory","categoryLabelsOnHover","showRelationshipLegend","legendPosition","nodeMenuItems","focusNodes","focusNodeColor","zoomToFocusNodes"],[3,"nodeHover","doc","collapseClasses","collapseAttributes","collapseRelationships","colorByCategory","categoryLabelsOnHover","showRelationshipLegend","legendPosition","nodeMenuItems","focusNodes","focusNodeColor","zoomToFocusNodes"]],template:function(n,i){if(1&n&&V.nVh(0,L9,1,1),2&n){let o;V.vxM((o=i.doc())?0:-1,o)}},dependencies:[k9],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:400px;min-width:100px}"]})}return r})();var M9=ne(6170),el=ne(1413),F9=ne(4412),Oc=ne(2306),as=ne(140);function VT(r){let e=1/0,t=1/0,n=-1/0,i=-1/0;const o=r.features,a=l=>{l.length>=2&&(e=Math.min(e,l[0]),t=Math.min(t,l[1]),n=Math.max(n,l[0]),i=Math.max(i,l[1]))},s=(l,u)=>{if(0===u)a(l);else if(Array.isArray(l))for(const c of l)s(c,u-1)};for(const l of o){const u=l.geometry;switch(u.type){case"Point":s(u.coordinates,0);break;case"LineString":case"MultiPoint":s(u.coordinates,1);break;case"Polygon":case"MultiLineString":s(u.coordinates,2);break;case"MultiPolygon":s(u.coordinates,3);break;case"GeometryCollection":for(const c of u.geometries){const f=VT(new as.o([{type:"Feature",geometry:c,properties:null}]));f&&(a([f[0],f[1]]),a([f[2],f[3]]))}}}return e===1/0?null:[e,t,n,i]}function AL(r,e,t){return{id:r,source:e,type:"circle",maxzoom:12,filter:["==",["get","_isCentroid"],!0],paint:{"circle-radius":6,"circle-color":["coalesce",["get","_color"],t],"circle-stroke-width":2,"circle-stroke-color":"white","circle-opacity":.8}}}function q9(r,e,t,n){return function j9(r,e,t,n,i){const o={id:r,source:n},a=i||t;switch(e){case"Point":case"MultiPoint":return[{...o,id:`${r}-clusters`,type:"circle",filter:["has","point_count"],paint:{"circle-color":a,"circle-radius":["step",["get","point_count"],15,100,20,750,25],"circle-stroke-width":2,"circle-stroke-color":"white","circle-opacity":.8}},{...o,id:`${r}-cluster-count`,type:"symbol",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["Poppins Medium","Arial Unicode MS Bold"],"text-size":12,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#ffffff","text-halo-color":"rgba(0, 0, 0, 0.3)","text-halo-width":1}},{...o,id:`${r}-unclustered`,type:"circle",filter:["!",["has","point_count"]],paint:{"circle-radius":6,"circle-color":["coalesce",["get","_color"],t],"circle-stroke-width":2,"circle-stroke-color":"white","circle-opacity":.8}}];case"LineString":case"MultiLineString":return{...o,type:"line",paint:{"line-color":["coalesce",["get","_color"],t],"line-width":3,"line-opacity":.8},layout:{"line-join":"round","line-cap":"round"}};case"Polygon":case"MultiPolygon":return[{id:`${r}-fill`,source:n,type:"fill",paint:{"fill-color":["coalesce",["get","_color"],t],"fill-opacity":.3}},{id:`${r}-stroke`,source:n,type:"line",paint:{"line-color":["coalesce",["get","_color"],t],"line-width":2,"line-opacity":.8},layout:{"line-join":"round","line-cap":"round"}},{id:`${r}-labels`,source:n,type:"symbol",layout:{"text-field":["coalesce",["get","label"],""],"text-font":["Poppins Medium","Arial Unicode MS Bold"],"text-size":13,"text-anchor":"center","text-allow-overlap":!1},paint:{"text-color":"#333333","text-halo-color":"rgba(255, 255, 255, 0.9)","text-halo-width":2}}];default:return console.warn(`Unsupported geometry type: ${e}`),null}}(r,e,t,n,t)}function UT(r){return"Polygon"===r||"MultiPolygon"===r}function SL(r){return"LineString"===r||"MultiLineString"===r}function Kh(r,e){return e&&("Point"===r||"MultiPoint"===r)}function CL(r,e){return Kh(r,e)?{cluster:!0,clusterMaxZoom:14,clusterRadius:50,clusterMinPoints:2}:{cluster:!1}}let am=(()=>{class r{_layers$=new F9.t([]);_map;_sources={};_sourceLayers={};_sourceIds=[];_attachedListeners=[];_hoveredFeature=(0,w.vPA)(void 0);_layerGroups={};_layerClickable={};_pointLayerIds=new Set;_lineLayerIds=new Set;_processedClickEvents=new WeakSet;_clearHoverTimeout;_hoverSequence=0;layers=this._layers$.asObservable();layersSignal=(0,E.EW)(()=>this._layers$.getValue());clickedFeature=new el.B;hoveredFeature=new el.B;initializeWithMap(t){this._map=t,t.on("mousemove",n=>{const i=t.getCanvas();if(!i)return;const o=Object.keys(this._layerClickable).filter(s=>this._layerClickable[s]&&t.getLayer(s)),a=t.queryRenderedFeatures(n.point,{layers:o});i.style.cursor=a.length>0?"pointer":""})}getLayers(){return this._layers$.getValue()}setLayers(t){this._layers$.next([...t])}addLayer(t){const n=this._layers$.getValue(),i=n.findIndex(o=>o.id===t.id);i>=0?n[i]={...t}:n.push({...t}),this._layers$.next([...n])}removeLayer(t){const i=this._layers$.getValue().filter(o=>o.id!==t);this._layers$.next(i),this._deleteSourceIfExists(t.toString()),delete this._sources[t.toString()],delete this._sourceLayers[t.toString()],delete this._layerClickable[t.toString()],this._pointLayerIds.delete(t.toString()),this._lineLayerIds.delete(t.toString()),this._sourceIds=this._sourceIds.filter(o=>o!==t.toString())}toggleVisibility(t){const n=t.toString();if(this._layerGroups[n])return void this.toggleLayerGroupVisibility(n);const o=this._layers$.getValue().map(a=>{if(a.id===t){const s={...a,visible:!a.visible};return this._updateLayerVisibility(t.toString(),s.visible),s}return a});this._layers$.next(o)}setLayerVisibility(t,n){const i=t.toString();if(this._layerGroups[i]){if(this._map){const l=n?"visible":"none";this._layerGroups[i].forEach(u=>{this._map.setLayoutProperty(u,"visibility",l)})}}else this._updateLayerVisibility(i,n);const a=this._layers$.getValue().map(s=>s.id===t?{...s,visible:n}:s);this._layers$.next(a)}loadGeoJSONLayerGroup(t,n,i){var o=this;return(0,_.A)(function*(a,s,l,u={}){const{cluster:c=!1,zoomToFit:d=!0,visible:h=!0,label:f=a,color:g=o._extractColorFromLayer(l[0])}=u;if(!o._map)return void console.warn("Map not initialized in LayerService");const y=a;yield o._addSource(a,{type:"geojson",data:s,...CL("Point",c)});const v=[];for(const b of l){v.push(b.id),o._layerClickable[b.id]=!0,o._sourceLayers[y]||(o._sourceLayers[y]={layer:b,clickable:!0});const O=b.type;if("circle"===O||"symbol"===O)o._pointLayerIds.add(b.id),o._map.addLayer(b);else if("line"===O){o._lineLayerIds.add(b.id);const K=o._getBeforePointLayerId();o._map.addLayer(b,K)}else{const K=o._getBeforeLineLayerId()??o._getBeforePointLayerId();o._map.addLayer(b,K)}o._map&&o._map.setLayoutProperty(b.id,"visibility",h?"visible":"none")}for(const b of l)o._setLayerEvents(y,b);o._layerGroups[a]=v;const m=new Oc.ux(f,a);m.collection=s,m.color=g,m.visible=h,o.addLayer(m),d&&o.fitLayerBounds(a)}).apply(this,arguments)}toggleLayerGroupVisibility(t){const n=this._layerGroups[t];if(!n)return;const i=this.getLayer(t);if(!i)return;const o=!i.visible;if(this._map){const a=o?"visible":"none";n.forEach(s=>{this._map.setLayoutProperty(s,"visibility",a)})}this.updateLayer(t,{visible:o})}removeLayerGroup(t){const n=this._layerGroups[t];n&&(this._map&&(n.forEach(i=>{this._map.removeLayer(i),this._attachedListeners=this._attachedListeners.filter(o=>o!==t),delete this._layerClickable[i],this._pointLayerIds.delete(i),this._lineLayerIds.delete(i)}),this._deleteSourceIfExists(t)),delete this._sources[t],delete this._sourceLayers[t],this._sourceIds=this._sourceIds.filter(i=>i!==t),delete this._layerGroups[t],this.removeLayer(t))}loadGeoJSONLayer(t,n,i){var o=this;return(0,_.A)(function*(a,s,l,u={}){const{cluster:c=!0,zoomToFit:d=!0,visible:h=!0,label:f=a,color:g=o._extractColorFromLayer(l)}=u;if(!o._map)return void console.warn("Map not initialized in LayerService");yield o._addSource(a,{type:"geojson",data:s,...CL("Point",c)},l);const y=new Oc.ux(f,a);y.collection=s,y.color=g,y.visible=h,o.addLayer(y),o._updateLayerVisibility(a,h),d&&o.fitLayerBounds(a)}).apply(this,arguments)}_addSource(t,n,i){var o=this;return(0,_.A)(function*(a,s,l,u=!0){o._map&&(o._sources[a]=s,o._deleteSourceIfExists(a),o._sourceIds.push(a),o._map.getSource(a)&&o._map.removeSource(a),o._map.addSource(a,s),l&&o._addSourceLayer(a,l,u))}).apply(this,arguments)}_getBeforePointLayerId(){if(!this._map||0===this._pointLayerIds.size)return;const t=this._map.getStyle()?.layers??[];for(const n of t)if(this._pointLayerIds.has(n.id))return n.id}_getBeforeLineLayerId(){if(!this._map||0===this._lineLayerIds.size)return;const t=this._map.getStyle()?.layers??[];for(const n of t)if(this._lineLayerIds.has(n.id))return n.id}_addSourceLayer(t,n,i=!0){if(!this._map)return;this._layerClickable[n.id]=i,this._sourceLayers[t]||(this._sourceLayers[t]={layer:n,clickable:i});const o=n.type;if("circle"===o||"symbol"===o)this._pointLayerIds.add(n.id),this._map.addLayer(n);else if("line"===o){this._lineLayerIds.add(n.id);const a=this._getBeforePointLayerId();this._map.addLayer(n,a)}else{const a=this._getBeforeLineLayerId()??this._getBeforePointLayerId();this._map.addLayer(n,a)}i&&this._setLayerEvents(t,n)}_updateLayerVisibility(t,n){if(!this._map)return;const i=this._sourceLayers[t];i&&this._map.setLayoutProperty(i.layer.id,"visibility",n?"visible":"none")}getLayer(t){return this._layers$.getValue().find(n=>n.id===t)}updateLayer(t,n){const o=this._layers$.getValue().map(a=>{if(a.id===t){const s={...a,...n};return void 0!==n.visible&&this._updateLayerVisibility(t.toString(),n.visible),s}return a});this._layers$.next(o)}toggleAllLayers(){const t=this._layers$.getValue(),i=!t.some(a=>a.visible),o=t.map(a=>(this._updateLayerVisibility(a.id.toString(),i),{...a,visible:i}));this._layers$.next(o)}getVisibleLayersCount(){return this._layers$.getValue().filter(t=>t.visible).length}getTotalLayersCount(){return this._layers$.getValue().length}hasLayer(t){return this._layers$.getValue().some(n=>n.id===t)}fitGeoJSONBounds(t,n=50,i=!0,o=19){this._fitGeoJSONBounds(t,n,i,o)}fitLayerBounds(t,n=50){const i=this._layers$.getValue().find(o=>o.id===t);!i||!i.collection||!this._map||("features"in i.collection?this._fitGeoJSONBounds(i.collection,n):console.warn("Layer collection is not a FeatureCollection, cannot fit bounds."))}fitAllVisibleLayers(t=50){const n=this._layers$.getValue().filter(s=>s.visible&&s.collection);if(0===n.length||!this._map)return;const i=n.flatMap(s=>{const l=s.collection;return l&&"features"in l&&Array.isArray(l.features)?l.features:[]}),o=new as.o(i),a=VT(o);a&&(o.bbox=a),this._fitGeoJSONBounds(o,t)}clearAllLayers(){if(this._map){for(const[t,n]of Object.entries(this._layerGroups))n.forEach(i=>{this._map.getLayer(i)&&this._map.removeLayer(i)}),this._map.getSource(t)&&this._map.removeSource(t);for(const t of this._sourceIds)this._layerGroups[t]||this._deleteSourceIfExists(t)}this._sourceIds=[],this._sourceLayers={},this._sources={},this._attachedListeners=[],this._layerGroups={},this._layerClickable={},this._layers$.next([])}reapplyLayers(){this._map&&(Object.keys(this._sources).forEach(t=>{this._deleteSourceIfExists(t),this._map.addSource(t,this._sources[t]);const n=this._sourceLayers[t];if(n){this._map.addLayer(n.layer);const i=this._layers$.getValue().find(o=>o.id===t);i&&this._updateLayerVisibility(t,i.visible)}}),this._reattachAllLayerEvents())}_extractColorFromLayer(t){if("paint"in t&&"object"==typeof t.paint){const n=t.paint;return n["circle-color"]||n["fill-color"]||n["line-color"]||""}return""}_fitGeoJSONBounds(t,n=50,i=!0,o=19){if(!this._map)return void console.warn("Map not initialized when trying to fit bounds");if(!t.features||0===t.features.length)return void console.warn("No features to fit bounds to");let a=t.bbox;if(!a){const s=VT(t);if(!s)return void console.warn("Failed to calculate bbox for GeoJSON");t.bbox=s,a=s}if(a&&4===a.length)try{this._map.fitBounds([[a[0],a[1]],[a[2],a[3]]],{padding:n,maxZoom:o,animate:i})}catch(s){console.error("Error fitting bounds:",s)}}_deleteSourceIfExists(t){if(!this._map||!this._map.getSource(t))return;const i=this._layerGroups[t];if(i)i.forEach(o=>{this._map.getLayer(o)&&this._map.removeLayer(o)});else{const o=Object.values(this._sourceLayers).find(a=>"source"in a.layer&&a.layer.source===t);o&&this._map.getLayer(o.layer.id)&&(this._map.removeLayer(o.layer.id),this._attachedListeners=this._attachedListeners.filter(a=>a!==o.layer.id))}this._map.removeSource(t)}_setLayerEvents(t,n){if(!this._map)return;const i=n.id.endsWith("-fill"),o=n.id.endsWith("-stroke"),a=i?n.id.replace("-fill",""):o?n.id.replace("-stroke",""):n.id;if(i||o){const u=`${a}-stroke`;this._layerClickable[`${a}-fill`]=!0,this._layerClickable[u]=!0}if(!this._layerClickable[n.id])return;const s=[];if(i||o){const l=`${a}-fill`,u=`${a}-stroke`;this._map.getLayer(l)&&s.push(l),this._map.getLayer(u)&&s.push(u)}else s.push(n.id);s.forEach(l=>{this._attachedListeners.includes(l)||(this._map.on("click",l,u=>{if(!u.features||this._processedClickEvents.has(u.originalEvent))return;const c=u.features[0],d=c.properties;if(d&&!d.cluster){const h=this.getLayer(t)||this.getLayer(a)||this.getLayer(l);if(h){const f={...c,geometry:c.geometry};if(h.collection&&"features"in h.collection){const g=h.collection.features.find(y=>y.geometry.type===c.geometry?.type&&JSON.stringify(y.properties)===JSON.stringify(c.properties));g&&g.id&&(f.id=g.id)}this._processedClickEvents.add(u.originalEvent),this.clickedFeature.next({feature:f,event:u.originalEvent,layer:h,lngLat:u.lngLat})}}}),this._map.on("mouseenter",l,u=>{if(this._hoverSequence++,this._clearHoverTimeout&&(clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=void 0),!u.features)return;const c=u.features[0],d=c.properties,h={...c,geometry:c.geometry};if(d&&!d.cluster){const f=this.getLayer(t)||this.getLayer(a)||this.getLayer(l);if(f){if(f.collection&&"features"in f.collection){const g=f.collection.features.find(y=>y.geometry.type===c.geometry?.type&&JSON.stringify(y.properties)===JSON.stringify(c.properties));g&&g.id&&(h.id=g.id)}this.hoveredFeature.next({feature:h,event:u.originalEvent,layer:f,lngLat:u.lngLat})}this._hoveredFeature.set(h)}}),this._map.on("mouseleave",l,()=>{const u=this._hoverSequence;this._clearHoverTimeout=window.setTimeout(()=>{this._hoverSequence===u&&(this._hoveredFeature.set(void 0),this.hoveredFeature.next(void 0)),this._clearHoverTimeout=void 0},50)}),this._map.on("click",l,u=>{if(!u.features)return;const c=u.features[0].properties;if(c&&c.cluster){const d=this._map?.getZoom();d&&this._map?.flyTo({center:u.lngLat,zoom:d+1})}}),this._attachedListeners.push(l))})}_reattachAllLayerEvents(){this._attachedListeners=[],Object.keys(this._sourceLayers).forEach(t=>{const n=this._sourceLayers[t];n&&this._setLayerEvents(t,n.layer)})}static \u0275fac=function(n){return new(n||r)};static \u0275prov=w.jDH({token:r,factory:r.\u0275fac})}return r})();const po={CANVAS:"mapboxgl-canvas",CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},zo={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},Dn={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},go={POLYGON:"polygon",LINE:"line_string",POINT:"point"},lr={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},Br={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select"},no={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},Yh={MOVE:"move",CHANGE_PROPERTIES:"change_properties",CHANGE_COORDINATES:"change_coordinates"},Hi={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},yi={ACTIVE:"true",INACTIVE:"false"},RL=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],$9=-90,zT=-85,H9=90,GT=85,W9=-270,X9=270;function sm(r){return function(e){const t=e.featureTarget;return!(!t||!t.properties)&&t.properties.meta===r}}function PL(r){return!(!r.originalEvent||!r.originalEvent.shiftKey)&&0===r.originalEvent.button}function nu(r){return!(!r.featureTarget||!r.featureTarget.properties)&&r.featureTarget.properties.active===yi.ACTIVE&&r.featureTarget.properties.meta===Hi.FEATURE}function qT(r){return!(!r.featureTarget||!r.featureTarget.properties)&&r.featureTarget.properties.active===yi.INACTIVE&&r.featureTarget.properties.meta===Hi.FEATURE}function lm(r){return void 0===r.featureTarget}function jT(r){return!(!r.featureTarget||!r.featureTarget.properties)&&r.featureTarget.properties.meta===Hi.FEATURE}function Qh(r){const e=r.featureTarget;return!(!e||!e.properties)&&e.properties.meta===Hi.VERTEX}function um(r){return!!r.originalEvent&&!0===r.originalEvent.shiftKey}function cm(r){return"Escape"===r.key||27===r.keyCode}function dm(r){return"Enter"===r.key||13===r.keyCode}function $T(r){return"Backspace"===r.key||8===r.keyCode}function HT(r){return"Delete"===r.key||46===r.keyCode}function kL(r){return"1"===r.key||49===r.keyCode}function DL(r){return"2"===r.key||50===r.keyCode}function NL(r){return"3"===r.key||51===r.keyCode}function LL(r){const e=r.key||String.fromCharCode(r.keyCode);return e>="0"&&e<="9"}function K9(){return!0}var Y9=ne(503);const OL={Point:0,LineString:1,MultiLineString:1,Polygon:2};function Q9(r,e){const t=OL[r.geometry.type]-OL[e.geometry.type];return 0===t&&r.geometry.type===lr.POLYGON?r.area-e.area:t}const ML=function J9(r){return r.map(e=>(e.geometry.type===lr.POLYGON&&(e.area=Y9.geometry({type:lr.FEATURE,property:{},geometry:e.geometry})),e)).sort(Q9).map(e=>(delete e.area,e))},FL=function Z9(r,e=0){return[[r.point.x-e,r.point.y-e],[r.point.x+e,r.point.y+e]]};function Mc(r){if(this._items={},this._nums={},this._length=r?r.length:0,r)for(let e=0,t=r.length;e<t;e++)this.add(r[e]),void 0!==r[e]&&("string"==typeof r[e]?this._items[r[e]]=e:this._nums[r[e]]=e)}Mc.prototype.add=function(r){return this.has(r)||(this._length++,"string"==typeof r?this._items[r]=this._length:this._nums[r]=this._length),this},Mc.prototype.delete=function(r){return!1===this.has(r)||(this._length--,delete this._items[r],delete this._nums[r]),this},Mc.prototype.has=function(r){return!("string"!=typeof r&&"number"!=typeof r||void 0===this._items[r]&&void 0===this._nums[r])},Mc.prototype.values=function(){const r=[];return Object.keys(this._items).forEach(e=>{r.push({k:e,v:this._items[e]})}),Object.keys(this._nums).forEach(e=>{r.push({k:JSON.parse(e),v:this._nums[e]})}),r.sort((e,t)=>e.v-t.v).map(e=>e.k)},Mc.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};const iu=Mc,e7=[Hi.FEATURE,Hi.MIDPOINT,Hi.VERTEX],Fc={click:function t7(r,e,t){return VL(r,e,t,t.options.clickBuffer)},touch:function r7(r,e,t){return VL(r,e,t,t.options.touchBuffer)}};function VL(r,e,t,n){if(null===t.map)return[];const i=r?FL(r,n):e,o={};t.options.styles&&(o.layers=t.options.styles.map(u=>u.id).filter(u=>null!=t.map.getLayer(u)));const a=t.map.queryRenderedFeatures(i,o).filter(u=>-1!==e7.indexOf(u.properties.meta)),s=new iu,l=[];return a.forEach(u=>{const c=u.properties.id;s.has(c)||(s.add(c),l.push(u))}),ML(l)}function hm(r,e){const t=Fc.click(r,null,e),n={mouse:Dn.NONE};return t[0]&&(n.mouse=t[0].properties.active===yi.ACTIVE?Dn.MOVE:Dn.POINTER,n.feature=t[0].properties.meta),-1!==e.events.currentModeName().indexOf("draw")&&(n.mouse=Dn.ADD),e.ui.queueMapClasses(n),e.ui.updateMapClasses(),t[0]}function WT(r,e){const t=r.x-e.x,n=r.y-e.y;return Math.sqrt(t*t+n*n)}function XT(r,e,t={}){const n=null!=t.fineTolerance?t.fineTolerance:4,i=null!=t.grossTolerance?t.grossTolerance:12,o=null!=t.interval?t.interval:500;r.point=r.point||e.point,r.time=r.time||e.time;const a=WT(r.point,e.point);return a<n||a<i&&e.time-r.time<o}function KT(r,e,t={}){const n=null!=t.tolerance?t.tolerance:25,i=null!=t.interval?t.interval:250;return r.point=r.point||e.point,r.time=r.time||e.time,WT(r.point,e.point)<n&&e.time-r.time<i}const YT=function(r,e){const t={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},n={on(o,a,s){if(void 0===t[o])throw new Error(`Invalid event type: ${o}`);t[o].push({selector:a,fn:s})},render(o){e.store.featureChanged(o)}},i=function(o,a){const s=t[o];let l=s.length;for(;l--;){const u=s[l];if(u.selector(a)){u.fn.call(n,a)||e.store.render(),e.ui.updateMapClasses();break}}};return r.start.call(n),{render:r.render,stop(){r.stop&&r.stop()},trash(){r.trash&&(r.trash(),e.store.render())},combineFeatures(){r.combineFeatures&&r.combineFeatures()},uncombineFeatures(){r.uncombineFeatures&&r.uncombineFeatures()},drag(o){i("drag",o)},click(o){i("click",o)},mousemove(o){i("mousemove",o)},mousedown(o){i("mousedown",o)},mouseup(o){i("mouseup",o)},mouseout(o){i("mouseout",o)},keydown(o){i("keydown",o)},keyup(o){i("keyup",o)},touchstart(o){i("touchstart",o)},touchmove(o){i("touchmove",o)},touchend(o){i("touchend",o)},tap(o){i("tap",o)}}},c7=((r,e=21)=>(t=e)=>{let n="",i=0|t;for(;i--;)n+=r[Math.random()*r.length|0];return n})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",32);function QT(){return c7()}const tl=function(r,e){this.ctx=r,this.properties=e.properties||{},this.coordinates=e.geometry.coordinates,this.id=e.id||QT(),this.type=e.geometry.type};tl.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},tl.prototype.incomingCoords=function(r){this.setCoordinates(r)},tl.prototype.setCoordinates=function(r){this.coordinates=r,this.changed()},tl.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},tl.prototype.setProperty=function(r,e){this.properties[r]=e},tl.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:lr.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},tl.prototype.internal=function(r){const e={id:this.id,meta:Hi.FEATURE,"meta:type":this.type,active:yi.INACTIVE,mode:r};if(this.ctx.options.userProperties)for(const t in this.properties)e[`user_${t}`]=this.properties[t];return{type:lr.FEATURE,properties:e,geometry:{coordinates:this.getCoordinates(),type:this.type}}};const rl=tl,Jh=function(r,e){rl.call(this,r,e)};(Jh.prototype=Object.create(rl.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},Jh.prototype.updateCoordinate=function(r,e,t){this.coordinates=3===arguments.length?[e,t]:[r,e],this.changed()},Jh.prototype.getCoordinate=function(){return this.getCoordinates()};const fm=Jh,ou=function(r,e){rl.call(this,r,e)};(ou.prototype=Object.create(rl.prototype)).isValid=function(){return this.coordinates.length>1},ou.prototype.addCoordinate=function(r,e,t){this.changed();const n=parseInt(r,10);this.coordinates.splice(n,0,[e,t])},ou.prototype.getCoordinate=function(r){const e=parseInt(r,10);return JSON.parse(JSON.stringify(this.coordinates[e]))},ou.prototype.removeCoordinate=function(r){this.changed(),this.coordinates.splice(parseInt(r,10),1)},ou.prototype.updateCoordinate=function(r,e,t){const n=parseInt(r,10);this.coordinates[n]=[e,t],this.changed()};const pm=ou,Ra=function(r,e){rl.call(this,r,e),this.coordinates=this.coordinates.map(t=>t.slice(0,-1))};(Ra.prototype=Object.create(rl.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every(r=>r.length>2)},Ra.prototype.incomingCoords=function(r){this.coordinates=r.map(e=>e.slice(0,-1)),this.changed()},Ra.prototype.setCoordinates=function(r){this.coordinates=r,this.changed()},Ra.prototype.addCoordinate=function(r,e,t){this.changed();const n=r.split(".").map(o=>parseInt(o,10));this.coordinates[n[0]].splice(n[1],0,[e,t])},Ra.prototype.removeCoordinate=function(r){this.changed();const e=r.split(".").map(n=>parseInt(n,10)),t=this.coordinates[e[0]];t&&(t.splice(e[1],1),t.length<3&&this.coordinates.splice(e[0],1))},Ra.prototype.getCoordinate=function(r){const e=r.split(".").map(n=>parseInt(n,10));return JSON.parse(JSON.stringify(this.coordinates[e[0]][e[1]]))},Ra.prototype.getCoordinates=function(){return this.coordinates.map(r=>r.concat([r[0]]))},Ra.prototype.updateCoordinate=function(r,e,t){this.changed();const n=r.split("."),i=parseInt(n[0],10),o=parseInt(n[1],10);void 0===this.coordinates[i]&&(this.coordinates[i]=[]),this.coordinates[i][o]=[e,t]};const gm=Ra,d7={MultiPoint:fm,MultiLineString:pm,MultiPolygon:gm},mm=(r,e,t,n,i)=>{const o=t.split("."),a=parseInt(o[0],10),s=o[1]?o.slice(1).join("."):null;return r[a][e](s,n,i)},na=function(r,e){if(rl.call(this,r,e),delete this.coordinates,this.model=d7[e.geometry.type],void 0===this.model)throw new TypeError(`${e.geometry.type} is not a valid type`);this.features=this._coordinatesToFeatures(e.geometry.coordinates)};(na.prototype=Object.create(rl.prototype))._coordinatesToFeatures=function(r){const e=this.model.bind(this);return r.map(t=>new e(this.ctx,{id:QT(),type:lr.FEATURE,properties:{},geometry:{coordinates:t,type:this.type.replace("Multi","")}}))},na.prototype.isValid=function(){return this.features.every(r=>r.isValid())},na.prototype.setCoordinates=function(r){this.features=this._coordinatesToFeatures(r),this.changed()},na.prototype.getCoordinate=function(r){return mm(this.features,"getCoordinate",r)},na.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(r=>r.type===lr.POLYGON?r.getCoordinates():r.coordinates)))},na.prototype.updateCoordinate=function(r,e,t){mm(this.features,"updateCoordinate",r,e,t),this.changed()},na.prototype.addCoordinate=function(r,e,t){mm(this.features,"addCoordinate",r,e,t),this.changed()},na.prototype.removeCoordinate=function(r){mm(this.features,"removeCoordinate",r),this.changed()},na.prototype.getFeatures=function(){return this.features};const Zh=na;function Cr(r){this.map=r.map,this.drawConfig=JSON.parse(JSON.stringify(r.options||{})),this._ctx=r}Cr.prototype.setSelected=function(r){return this._ctx.store.setSelected(r)},Cr.prototype.setSelectedCoordinates=function(r){this._ctx.store.setSelectedCoordinates(r),r.reduce((e,t)=>(void 0===e[t.feature_id]&&(e[t.feature_id]=!0,this._ctx.store.get(t.feature_id).changed()),e),{})},Cr.prototype.getSelected=function(){return this._ctx.store.getSelected()},Cr.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},Cr.prototype.isSelected=function(r){return this._ctx.store.isSelected(r)},Cr.prototype.getFeature=function(r){return this._ctx.store.get(r)},Cr.prototype.select=function(r){return this._ctx.store.select(r)},Cr.prototype.deselect=function(r){return this._ctx.store.deselect(r)},Cr.prototype.deleteFeature=function(r,e={}){return this._ctx.store.delete(r,e)},Cr.prototype.addFeature=function(r,e={}){return this._ctx.store.add(r,e)},Cr.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},Cr.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},Cr.prototype.setActionableState=function(r={}){return this._ctx.events.actionable({trash:r.trash||!1,combineFeatures:r.combineFeatures||!1,uncombineFeatures:r.uncombineFeatures||!1})},Cr.prototype.changeMode=function(r,e={},t={}){return this._ctx.events.changeMode(r,e,t)},Cr.prototype.fire=function(r,e){return this._ctx.events.fire(r,e)},Cr.prototype.updateUIClasses=function(r){return this._ctx.ui.queueMapClasses(r)},Cr.prototype.activateUIButton=function(r){return this._ctx.ui.setActiveButton(r)},Cr.prototype.featuresAt=function(r,e,t="click"){if("click"!==t&&"touch"!==t)throw new Error("invalid buffer type");return Fc[t](r,e,this._ctx)},Cr.prototype.newFeature=function(r){const e=r.geometry.type;return e===lr.POINT?new fm(this._ctx,r):e===lr.LINE_STRING?new pm(this._ctx,r):e===lr.POLYGON?new gm(this._ctx,r):new Zh(this._ctx,r)},Cr.prototype.isInstanceOf=function(r,e){if(r===lr.POINT)return e instanceof fm;if(r===lr.LINE_STRING)return e instanceof pm;if(r===lr.POLYGON)return e instanceof gm;if("MultiFeature"===r)return e instanceof Zh;throw new Error(`Unknown feature class: ${r}`)},Cr.prototype.doRender=function(r){return this._ctx.store.featureChanged(r)};const h7=Cr;Cr.prototype.onSetup=function(){},Cr.prototype.onDrag=function(){},Cr.prototype.onClick=function(){},Cr.prototype.onMouseMove=function(){},Cr.prototype.onMouseDown=function(){},Cr.prototype.onMouseUp=function(){},Cr.prototype.onMouseOut=function(){},Cr.prototype.onKeyUp=function(){},Cr.prototype.onKeyDown=function(){},Cr.prototype.onTouchStart=function(){},Cr.prototype.onTouchMove=function(){},Cr.prototype.onTouchEnd=function(){},Cr.prototype.onTap=function(){},Cr.prototype.onStop=function(){},Cr.prototype.onTrash=function(){},Cr.prototype.onCombineFeature=function(){},Cr.prototype.onUncombineFeature=function(){},Cr.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};const BL={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},f7=Object.keys(BL);const ef=function m7(r){return[].concat(r).filter(e=>void 0!==e)};function v7(){const r=this;if(!r.ctx.map||void 0===r.ctx.map.getSource(zo.HOT))return l();const t=r.ctx.events.currentModeName();r.ctx.ui.queueMapClasses({mode:t});let n=[],i=[];r.isDirty?i=r.getAllIds():(n=r.getChangedIds().filter(u=>void 0!==r.get(u)),i=r.sources.hot.filter(u=>u.properties.id&&-1===n.indexOf(u.properties.id)&&void 0!==r.get(u.properties.id)).map(u=>u.properties.id)),r.sources.hot=[];const o=r.sources.cold.length;r.sources.cold=r.isDirty?[]:r.sources.cold.filter(u=>-1===n.indexOf(u.properties.id||u.properties.parent));const a=o!==r.sources.cold.length||i.length>0;function s(u,c){const h=r.get(u).internal(t);r.ctx.events.currentModeRender(h,f=>{f.properties.mode=t,r.sources[c].push(f)})}function l(){r.isDirty=!1,r.clearChangedIds()}n.forEach(u=>s(u,"hot")),i.forEach(u=>s(u,"cold")),a&&r.ctx.map.getSource(zo.COLD).setData({type:lr.FEATURE_COLLECTION,features:r.sources.cold}),r.ctx.map.getSource(zo.HOT).setData({type:lr.FEATURE_COLLECTION,features:r.sources.hot}),l()}function wn(r){let e;this._features={},this._featureIds=new iu,this._selectedFeatureIds=new iu,this._selectedCoordinates=[],this._changedFeatureIds=new iu,this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=r,this.sources={hot:[],cold:[]},this.render=()=>{e||(e=requestAnimationFrame(()=>{e=null,v7.call(this),this._emitSelectionChange&&(this.ctx.events.fire(no.SELECTION_CHANGE,{features:this.getSelected().map(t=>t.toGeoJSON()),points:this.getSelectedCoordinates().map(t=>({type:lr.FEATURE,properties:{},geometry:{type:lr.POINT,coordinates:t.coordinates}}))}),this._emitSelectionChange=!1),this.ctx.events.fire(no.RENDER,{})}))},this.isDirty=!1}function UL(r,e={}){const t=r._selectedCoordinates.filter(n=>r._selectedFeatureIds.has(n.feature_id));r._selectedCoordinates.length!==t.length&&!e.silent&&(r._emitSelectionChange=!0),r._selectedCoordinates=t}wn.prototype.createRenderBatch=function(){const r=this.render;let e=0;return this.render=function(){e++},()=>{this.render=r,e>0&&this.render()}},wn.prototype.setDirty=function(){return this.isDirty=!0,this},wn.prototype.featureCreated=function(r,e={}){if(this._changedFeatureIds.add(r),!0!==(null!=e.silent?e.silent:this.ctx.options.suppressAPIEvents)){const n=this.get(r);this.ctx.events.fire(no.CREATE,{features:[n.toGeoJSON()]})}return this},wn.prototype.featureChanged=function(r,e={}){return this._changedFeatureIds.add(r),!0!==(null!=e.silent?e.silent:this.ctx.options.suppressAPIEvents)&&this.ctx.events.fire(no.UPDATE,{action:e.action?e.action:Yh.CHANGE_COORDINATES,features:[this.get(r).toGeoJSON()]}),this},wn.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},wn.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},wn.prototype.getAllIds=function(){return this._featureIds.values()},wn.prototype.add=function(r,e={}){return this._features[r.id]=r,this._featureIds.add(r.id),this.featureCreated(r.id,{silent:e.silent}),this},wn.prototype.delete=function(r,e={}){const t=[];return ef(r).forEach(n=>{this._featureIds.has(n)&&(this._featureIds.delete(n),this._selectedFeatureIds.delete(n),e.silent||-1===t.indexOf(this._features[n])&&t.push(this._features[n].toGeoJSON()),delete this._features[n],this.isDirty=!0)}),t.length&&this.ctx.events.fire(no.DELETE,{features:t}),UL(this,e),this},wn.prototype.get=function(r){return this._features[r]},wn.prototype.getAll=function(){return Object.keys(this._features).map(r=>this._features[r])},wn.prototype.select=function(r,e={}){return ef(r).forEach(t=>{this._selectedFeatureIds.has(t)||(this._selectedFeatureIds.add(t),this._changedFeatureIds.add(t),e.silent||(this._emitSelectionChange=!0))}),this},wn.prototype.deselect=function(r,e={}){return ef(r).forEach(t=>{this._selectedFeatureIds.has(t)&&(this._selectedFeatureIds.delete(t),this._changedFeatureIds.add(t),e.silent||(this._emitSelectionChange=!0))}),UL(this,e),this},wn.prototype.clearSelected=function(r={}){return this.deselect(this._selectedFeatureIds.values(),{silent:r.silent}),this},wn.prototype.setSelected=function(r,e={}){return r=ef(r),this.deselect(this._selectedFeatureIds.values().filter(t=>-1===r.indexOf(t)),{silent:e.silent}),this.select(r.filter(t=>!this._selectedFeatureIds.has(t)),{silent:e.silent}),this},wn.prototype.setSelectedCoordinates=function(r){return this._selectedCoordinates=r,this._emitSelectionChange=!0,this},wn.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},wn.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},wn.prototype.getSelected=function(){return this.getSelectedIds().map(r=>this.get(r))},wn.prototype.getSelectedCoordinates=function(){return this._selectedCoordinates.map(e=>({coordinates:this.get(e.feature_id).getCoordinate(e.coord_path)}))},wn.prototype.isSelected=function(r){return this._selectedFeatureIds.has(r)},wn.prototype.setFeatureProperty=function(r,e,t,n={}){this.get(r).setProperty(e,t),this.featureChanged(r,{silent:n.silent,action:Yh.CHANGE_PROPERTIES})},wn.prototype.storeMapConfig=function(){RL.forEach(r=>{this.ctx.map[r]&&(this._mapInitialConfig[r]=this.ctx.map[r].isEnabled())})},wn.prototype.restoreMapConfig=function(){Object.keys(this._mapInitialConfig).forEach(r=>{this._mapInitialConfig[r]?this.ctx.map[r].enable():this.ctx.map[r].disable()})},wn.prototype.getInitialConfigValue=function(r){return void 0===this._mapInitialConfig[r]||this._mapInitialConfig[r]};const y7=["mode","feature","mouse"];function w7(r){let e=null,t=null;const n={onRemove(){return r.map.off("load",n.connect),clearInterval(t),n.removeLayers(),r.store.restoreMapConfig(),r.ui.removeButtons(),r.events.removeEventListeners(),r.ui.clearMapClasses(),r.boxZoomInitial&&r.map.boxZoom.enable(),r.map=null,r.container=null,r.store=null,e&&e.parentNode&&e.parentNode.removeChild(e),e=null,this},connect(){r.map.off("load",n.connect),clearInterval(t),n.addLayers(),r.store.storeMapConfig(),r.events.addEventListeners()},onAdd(i){if(r.map=i,r.events=function g7(r){const e=Object.keys(r.options.modes).reduce((h,f)=>(h[f]=function p7(r){const e=Object.keys(r);return function(t,n={}){let i={};const o=e.reduce((s,l)=>(s[l]=r[l],s),new h7(t));return{start(){i=o.onSetup(n),f7.forEach(s=>{const l=BL[s];let u=()=>!1;r[l]&&(u=()=>!0),this.on(s,u,function a(s){return l=>o[s](i,l)}(l))})},stop(){o.onStop(i)},trash(){o.onTrash(i)},combineFeatures(){o.onCombineFeatures(i)},uncombineFeatures(){o.onUncombineFeatures(i)},render(s,l){o.toDisplayFeatures(i,s,l)}}}}(r.options.modes[f]),h),{});let t={},n={};const i={};let o=null,a=null;i.drag=function(h,f){f({point:h.point,time:(new Date).getTime()})?(r.ui.queueMapClasses({mouse:Dn.DRAG}),a.drag(h)):h.originalEvent.stopPropagation()},i.mousedrag=function(h){i.drag(h,f=>!XT(t,f))},i.touchdrag=function(h){i.drag(h,f=>!KT(n,f))},i.mousemove=function(h){if(1===(void 0!==h.originalEvent.buttons?h.originalEvent.buttons:h.originalEvent.which))return i.mousedrag(h);const g=hm(h,r);h.featureTarget=g,a.mousemove(h)},i.mousedown=function(h){t={time:(new Date).getTime(),point:h.point};const f=hm(h,r);h.featureTarget=f,a.mousedown(h)},i.mouseup=function(h){const f=hm(h,r);h.featureTarget=f,XT(t,{point:h.point,time:(new Date).getTime()})?a.click(h):a.mouseup(h)},i.mouseout=function(h){a.mouseout(h)},i.touchstart=function(h){if(!r.options.touchEnabled)return;n={time:(new Date).getTime(),point:h.point};const f=Fc.touch(h,null,r)[0];h.featureTarget=f,a.touchstart(h)},i.touchmove=function(h){if(r.options.touchEnabled)return a.touchmove(h),i.touchdrag(h)},i.touchend=function(h){if(h.originalEvent.preventDefault(),!r.options.touchEnabled)return;const f=Fc.touch(h,null,r)[0];h.featureTarget=f,KT(n,{time:(new Date).getTime(),point:h.point})?a.tap(h):a.touchend(h)};const s=h=>{const f=$T(h),g=HT(h),y=LL(h);return!(f||g||y)};function l(h,f,g={}){a.stop();const y=e[h];if(void 0===y)throw new Error(`${h} is not valid`);o=h;const v=y(r,f);a=YT(v,r),g.silent||r.map.fire(no.MODE_CHANGE,{mode:h}),r.store.setDirty(),r.store.render()}i.keydown=function(h){(h.srcElement||h.target).classList.contains(po.CANVAS)&&(($T(h)||HT(h))&&r.options.controls.trash?(h.preventDefault(),a.trash()):s(h)?a.keydown(h):kL(h)&&r.options.controls.point?l(Br.DRAW_POINT):DL(h)&&r.options.controls.line_string?l(Br.DRAW_LINE_STRING):NL(h)&&r.options.controls.polygon&&l(Br.DRAW_POLYGON))},i.keyup=function(h){s(h)&&a.keyup(h)},i.zoomend=function(){r.store.changeZoom()},i.data=function(h){if("style"===h.dataType){const{setup:f,map:g,options:y,store:v}=r;y.styles.some(b=>g.getLayer(b.id))||(f.addLayers(),v.setDirty(),v.render())}};const u={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start(){o=r.options.defaultMode,a=YT(e[o](r),r)},changeMode:l,actionable:function c(h){let f=!1;Object.keys(h).forEach(g=>{if(void 0===u[g])throw new Error("Invalid action type");u[g]!==h[g]&&(f=!0),u[g]=h[g]}),f&&r.map.fire(no.ACTIONABLE,{actions:u})},currentModeName:()=>o,currentModeRender:(h,f)=>a.render(h,f),fire(h,f){r.map&&r.map.fire(h,f)},addEventListeners(){r.map.on("mousemove",i.mousemove),r.map.on("mousedown",i.mousedown),r.map.on("mouseup",i.mouseup),r.map.on("data",i.data),r.map.on("touchmove",i.touchmove),r.map.on("touchstart",i.touchstart),r.map.on("touchend",i.touchend),r.container.addEventListener("mouseout",i.mouseout),r.options.keybindings&&(r.container.addEventListener("keydown",i.keydown),r.container.addEventListener("keyup",i.keyup))},removeEventListeners(){r.map.off("mousemove",i.mousemove),r.map.off("mousedown",i.mousedown),r.map.off("mouseup",i.mouseup),r.map.off("data",i.data),r.map.off("touchmove",i.touchmove),r.map.off("touchstart",i.touchstart),r.map.off("touchend",i.touchend),r.container.removeEventListener("mouseout",i.mouseout),r.options.keybindings&&(r.container.removeEventListener("keydown",i.keydown),r.container.removeEventListener("keyup",i.keyup))},trash(h){a.trash(h)},combineFeatures(){a.combineFeatures()},uncombineFeatures(){a.uncombineFeatures()},getMode:()=>o}}(r),r.ui=function _7(r){const e={};let t=null,n={mode:null,feature:null,mouse:null},i={mode:null,feature:null,mouse:null};function a(f){i=Object.assign(i,f)}function s(){if(!r.container)return;const f=[],g=[];y7.forEach(y=>{i[y]!==n[y]&&(f.push(`${y}-${n[y]}`),null!==i[y]&&g.push(`${y}-${i[y]}`))}),f.length>0&&r.container.classList.remove(...f),g.length>0&&r.container.classList.add(...g),n=Object.assign(n,i)}function l(f,g={}){const y=document.createElement("button");return y.className=`${po.CONTROL_BUTTON} ${g.className}`,y.setAttribute("title",g.title),g.container.appendChild(y),y.addEventListener("click",v=>{if(v.preventDefault(),v.stopPropagation(),v.target===t)return u(),void g.onDeactivate();c(f),g.onActivate()},!0),y}function u(){t&&(t.classList.remove(po.ACTIVE_BUTTON),t=null)}function c(f){u();const g=e[f];g&&g&&"trash"!==f&&(g.classList.add(po.ACTIVE_BUTTON),t=g)}return{setActiveButton:c,queueMapClasses:a,updateMapClasses:s,clearMapClasses:function o(){a({mode:null,feature:null,mouse:null}),s()},addButtons:function d(){const f=r.options.controls,g=document.createElement("div");return g.className=`${po.CONTROL_GROUP} ${po.CONTROL_BASE}`,f&&(f[go.POINT]&&(e[go.POINT]=l(go.POINT,{container:g,className:po.CONTROL_BUTTON_POINT,title:"Marker tool "+(r.options.keybindings?"(1)":""),onActivate:()=>r.events.changeMode(Br.DRAW_POINT),onDeactivate:()=>r.events.trash()})),f[go.LINE]&&(e[go.LINE]=l(go.LINE,{container:g,className:po.CONTROL_BUTTON_LINE,title:"LineString tool "+(r.options.keybindings?"(2)":""),onActivate:()=>r.events.changeMode(Br.DRAW_LINE_STRING),onDeactivate:()=>r.events.trash()})),f[go.POLYGON]&&(e[go.POLYGON]=l(go.POLYGON,{container:g,className:po.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(r.options.keybindings?"(3)":""),onActivate:()=>r.events.changeMode(Br.DRAW_POLYGON),onDeactivate:()=>r.events.trash()})),f.trash&&(e.trash=l("trash",{container:g,className:po.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:()=>{r.events.trash()}})),f.combine_features&&(e.combine_features=l("combineFeatures",{container:g,className:po.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:()=>{r.events.combineFeatures()}})),f.uncombine_features&&(e.uncombine_features=l("uncombineFeatures",{container:g,className:po.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:()=>{r.events.uncombineFeatures()}}))),g},removeButtons:function h(){Object.keys(e).forEach(f=>{const g=e[f];g.parentNode&&g.parentNode.removeChild(g),delete e[f]})}}}(r),r.container=i.getContainer(),r.store=new wn(r),e=r.ui.addButtons(),r.options.boxSelect){r.boxZoomInitial=i.boxZoom.isEnabled(),i.boxZoom.disable();const o=i.dragPan.isEnabled();i.dragPan.disable(),i.dragPan.enable(),o||i.dragPan.disable()}return i.loaded()?n.connect():(i.on("load",n.connect),t=setInterval(()=>{i.loaded()&&n.connect()},16)),r.events.start(),e},addLayers(){r.map.addSource(zo.COLD,{data:{type:lr.FEATURE_COLLECTION,features:[]},type:"geojson"}),r.map.addSource(zo.HOT,{data:{type:lr.FEATURE_COLLECTION,features:[]},type:"geojson"}),r.options.styles.forEach(i=>{r.map.addLayer(i)}),r.store.setDirty(!0),r.store.render()},removeLayers(){r.options.styles.forEach(i=>{r.map.getLayer(i.id)&&r.map.removeLayer(i.id)}),r.map.getSource(zo.COLD)&&r.map.removeSource(zo.COLD),r.map.getSource(zo.HOT)&&r.map.removeSource(zo.HOT)}};return r.setup=n,n}const JT="#3bb2d0",tf="#fbb03b",GL=[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":["case",["==",["get","active"],"true"],tf,JT],"fill-opacity":.1}},{id:"gl-draw-lines",type:"line",filter:["any",["==","$type","LineString"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["==",["get","active"],"true"],tf,JT],"line-dasharray":["case",["==",["get","active"],"true"],[.2,2],[2,0]],"line-width":2}},{id:"gl-draw-point-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":"#fff"}},{id:"gl-draw-point-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":["case",["==",["get","active"],"true"],tf,JT]}},{id:"gl-draw-vertex-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":"#fff"}},{id:"gl-draw-vertex-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":tf}},{id:"gl-draw-midpoint",type:"circle",filter:["all",["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":tf}}];function nl(r,e){this.x=r,this.y=e}nl.prototype={clone(){return new nl(this.x,this.y)},add(r){return this.clone()._add(r)},sub(r){return this.clone()._sub(r)},multByPoint(r){return this.clone()._multByPoint(r)},divByPoint(r){return this.clone()._divByPoint(r)},mult(r){return this.clone()._mult(r)},div(r){return this.clone()._div(r)},rotate(r){return this.clone()._rotate(r)},rotateAround(r,e){return this.clone()._rotateAround(r,e)},matMult(r){return this.clone()._matMult(r)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(r){return this.x===r.x&&this.y===r.y},dist(r){return Math.sqrt(this.distSqr(r))},distSqr(r){const e=r.x-this.x,t=r.y-this.y;return e*e+t*t},angle(){return Math.atan2(this.y,this.x)},angleTo(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith(r){return this.angleWithSep(r.x,r.y)},angleWithSep(r,e){return Math.atan2(this.x*e-this.y*r,this.x*r+this.y*e)},_matMult(r){const t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add(r){return this.x+=r.x,this.y+=r.y,this},_sub(r){return this.x-=r.x,this.y-=r.y,this},_mult(r){return this.x*=r,this.y*=r,this},_div(r){return this.x/=r,this.y/=r,this},_multByPoint(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint(r){return this.x/=r.x,this.y/=r.y,this},_unit(){return this._div(this.mag()),this},_perp(){const r=this.y;return this.y=this.x,this.x=-r,this},_rotate(r){const e=Math.cos(r),t=Math.sin(r),i=t*this.x+e*this.y;return this.x=e*this.x-t*this.y,this.y=i,this},_rotateAround(r,e){const t=Math.cos(r),n=Math.sin(r),o=e.y+n*(this.x-e.x)+t*(this.y-e.y);return this.x=e.x+t*(this.x-e.x)-n*(this.y-e.y),this.y=o,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:nl},nl.convert=function(r){if(r instanceof nl)return r;if(Array.isArray(r))return new nl(+r[0],+r[1]);if(void 0!==r.x&&void 0!==r.y)return new nl(+r.x,+r.y);throw new Error("Expected [x, y] or {x, y} point format")};const ZT=function b7(r,e){const t=e.getBoundingClientRect();return new nl(r.clientX-t.left-(e.clientLeft||0),r.clientY-t.top-(e.clientTop||0))};function Vc(r,e,t,n){return{type:lr.FEATURE,properties:{meta:Hi.VERTEX,parent:r,coord_path:t,active:n?yi.ACTIVE:yi.INACTIVE},geometry:{type:lr.POINT,coordinates:e}}}function rf(r,e,t){if(null!==r)for(var n,i,o,a,s,l,u,h,c=0,d=0,f=r.type,g="FeatureCollection"===f,y="Feature"===f,v=g?r.features.length:1,m=0;m<v;m++){s=(h=!!(u=g?r.features[m].geometry:y?r.geometry:r)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var b=0;b<s;b++){var T=0,O=0;if(null!==(a=h?u.geometries[b]:u)){l=a.coordinates;var K=a.type;switch(c=!t||"Polygon"!==K&&"MultiPolygon"!==K?0:1,K){case null:break;case"Point":if(!1===e(l,d,m,T,O))return!1;d++,T++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===e(l[n],d,m,T,O))return!1;d++,"MultiPoint"===K&&T++}"LineString"===K&&T++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(i=0;i<l[n].length-c;i++){if(!1===e(l[n][i],d,m,T,O))return!1;d++}"MultiLineString"===K&&T++,"Polygon"===K&&O++}"Polygon"===K&&T++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(O=0,i=0;i<l[n].length;i++){for(o=0;o<l[n][i].length-c;o++){if(!1===e(l[n][i][o],d,m,T,O))return!1;d++}O++}T++}break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===rf(a.geometries[n],e,t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function JL(r){const e={type:"Feature"};return Object.keys(r).forEach(t=>{switch(t){case"type":case"properties":case"geometry":return;default:e[t]=r[t]}}),e.properties=ZL(r.properties),e.geometry=null==r.geometry?null:rI(r.geometry),e}function ZL(r){const e={};return r&&Object.keys(r).forEach(t=>{const n=r[t];e[t]="object"==typeof n?null===n?null:Array.isArray(n)?n.map(i=>i):ZL(n):n}),e}function rI(r){const e={type:r.type};return r.bbox&&(e.bbox=r.bbox),"GeometryCollection"===r.type?(e.geometries=r.geometries.map(t=>rI(t)),e):(e.coordinates=e2(r.coordinates),e)}function e2(r){const e=r;return"object"!=typeof e[0]?e.slice():e.map(t=>e2(t))}function t2(r,e={}){return r2(r,"mercator",e)}function r2(r,e,t={}){var n=(t=t||{}).mutate;if(!r)throw new Error("geojson is required");return Array.isArray(r)&&function vm(r){return!isNaN(r)&&null!==r&&!Array.isArray(r)}(r[0])?r="mercator"===e?n2(r):i2(r):(!0!==n&&(r=function k7(r){if(!r)throw new Error("geojson is required");switch(r.type){case"Feature":return JL(r);case"FeatureCollection":return function D7(r){const e={type:"FeatureCollection"};return Object.keys(r).forEach(t=>{switch(t){case"type":case"features":return;default:e[t]=r[t]}}),e.features=r.features.map(t=>JL(t)),e}(r);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return rI(r);default:throw new Error("unknown GeoJSON type")}}(r)),rf(r,function(i){var o="mercator"===e?n2(i):i2(i);i[0]=o[0],i[1]=o[1]})),r}function n2(r){var e=Math.PI/180,t=6378137,n=20037508.342789244,i=Math.abs(r[0])<=180?r[0]:r[0]-360*function L7(r){return r<0?-1:r>0?1:0}(r[0]),o=[t*i*e,t*Math.log(Math.tan(.25*Math.PI+.5*r[1]*e))];return o[0]>n&&(o[0]=n),o[0]<-n&&(o[0]=-n),o[1]>n&&(o[1]=n),o[1]<-n&&(o[1]=-n),o}function i2(r){var e=180/Math.PI,t=6378137;return[r[0]*e/t,(.5*Math.PI-2*Math.atan(Math.exp(-r[1]/t)))*e]}function o2(r,e,t){const n=e.geometry.coordinates,i=t.geometry.coordinates;if(n[1]>GT||n[1]<zT||i[1]>GT||i[1]<zT)return null;const o=t2(n),a=t2(i),s=d=>Number(d.toFixed(8)),l=(d,h)=>(d+h)/2,u=function N7(r,e={}){return r2(r,"wgs84",e)}([l(o[0],a[0]),l(o[1],a[1])]),c=[s(u[0]),s(u[1])];return{type:lr.FEATURE,properties:{meta:Hi.MIDPOINT,parent:r,lng:c[0],lat:c[1],coord_path:t.properties.coord_path},geometry:{type:lr.POINT,coordinates:c}}}Math;const nI=function a2(r,e={},t=null){const{type:n,coordinates:i}=r.geometry,o=r.properties&&r.properties.id;let a=[];function s(c,d){let h="",f=null;c.forEach((g,y)=>{const v=null!=d?`${d}.${y}`:String(y),m=Vc(o,g,v,l(v));if(e.midpoints&&f){const T=o2(o,f,m);T&&a.push(T)}f=m;const b=JSON.stringify(g);h!==b&&a.push(m),0===y&&(h=b)})}function l(c){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(c)}return n===lr.POINT?a.push(Vc(o,i,t,l(t))):n===lr.POLYGON?i.forEach((c,d)=>{s(c,null!==t?`${t}.${d}`:String(d))}):n===lr.LINE_STRING?s(i,t):0===n.indexOf(lr.MULTI_PREFIX)&&function u(){const c=n.replace(lr.MULTI_PREFIX,"");i.forEach((d,h)=>{a=a.concat(a2({type:lr.FEATURE,properties:r.properties,geometry:{type:c,coordinates:d}},e,h))})}(),a},ia={enable(r){setTimeout(()=>{!r.map||!r.map.doubleClickZoom||!r._ctx||!r._ctx.store||!r._ctx.store.getInitialConfigValue||r._ctx.store.getInitialConfigValue("doubleClickZoom")&&r.map.doubleClickZoom.enable()},0)},disable(r){setTimeout(()=>{!r.map||!r.map.doubleClickZoom||r.map.doubleClickZoom.disable()},0)}},{LAT_MIN:ym,LAT_MAX:_m,LAT_RENDERED_MIN:s2,LAT_RENDERED_MAX:l2,LNG_MIN:u2,LNG_MAX:c2}=ae;function iI(r,e){let t=ym,n=_m,i=ym,o=_m,a=c2,s=u2;r.forEach(u=>{const c=function O7(r){const t=[r.geometry.coordinates].flat({Point:0,LineString:1,Polygon:2,MultiPoint:1,MultiLineString:2,MultiPolygon:3}[r.geometry.type]),n=t.map(s=>s[0]),i=t.map(s=>s[1]),o=s=>Math.min.apply(null,s),a=s=>Math.max.apply(null,s);return[o(n),o(i),a(n),a(i)]}(u),d=c[1],h=c[3],f=c[0],g=c[2];d>t&&(t=d),h<n&&(n=h),h>i&&(i=h),d<o&&(o=d),f<a&&(a=f),g>s&&(s=g)});const l=e;return t+l.lat>l2&&(l.lat=l2-t),i+l.lat>_m&&(l.lat=_m-i),n+l.lat<s2&&(l.lat=s2-n),o+l.lat<ym&&(l.lat=ym-o),a+l.lng<=u2&&(l.lng+=360*Math.ceil(Math.abs(l.lng)/360)),s+l.lng>=c2&&(l.lng-=360*Math.ceil(Math.abs(l.lng)/360)),l}function oI(r,e){const t=iI(r.map(n=>n.toGeoJSON()),e);r.forEach(n=>{const i=n.getCoordinates(),o=u=>{const c={lng:u[0]+t.lng,lat:u[1]+t.lat};return[c.lng,c.lat]},a=u=>u.map(c=>o(c));let l;n.type===lr.POINT?l=o(i):n.type===lr.LINE_STRING||n.type===lr.MULTI_POINT?l=i.map(o):n.type===lr.POLYGON||n.type===lr.MULTI_LINE_STRING?l=i.map(a):n.type===lr.MULTI_POLYGON&&(l=i.map(u=>u.map(c=>a(c)))),n.incomingCoords(l)})}const cn={onSetup:function(r){const e={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initialDragPanState:this.map.dragPan.isEnabled(),initiallySelectedFeatureIds:r.featureIds||[]};return this.setSelected(e.initiallySelectedFeatureIds.filter(t=>void 0!==this.getFeature(t))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),e},fireUpdate:function(){this.fire(no.UPDATE,{action:Yh.MOVE,features:this.getSelected().map(r=>r.toGeoJSON())})},fireActionable:function(){const r=this.getSelected(),e=r.filter(o=>this.isInstanceOf("MultiFeature",o));let t=!1;if(r.length>1){t=!0;const o=r[0].type.replace("Multi","");r.forEach(a=>{a.type.replace("Multi","")!==o&&(t=!1)})}this.setActionableState({combineFeatures:t,uncombineFeatures:e.length>0,trash:r.length>0})},getUniqueIds:function(r){return r.length?r.map(t=>t.properties.id).filter(t=>void 0!==t).reduce((t,n)=>(t.add(n),t),new iu).values():[]},stopExtendedInteractions:function(r){r.boxSelectElement&&(r.boxSelectElement.parentNode&&r.boxSelectElement.parentNode.removeChild(r.boxSelectElement),r.boxSelectElement=null),(r.canDragMove||r.canBoxSelect)&&!0===r.initialDragPanState&&this.map.dragPan.enable(),r.boxSelecting=!1,r.canBoxSelect=!1,r.dragMoving=!1,r.canDragMove=!1},onStop:function(){ia.enable(this)},onMouseMove:function(r,e){return jT(e)&&r.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(r),!0},onMouseOut:function(r){return!r.dragMoving||this.fireUpdate()}};cn.onTap=cn.onClick=function(r,e){return lm(e)?this.clickAnywhere(r,e):sm(Hi.VERTEX)(e)?this.clickOnVertex(r,e):jT(e)?this.clickOnFeature(r,e):void 0},cn.clickAnywhere=function(r){const e=this.getSelectedIds();e.length&&(this.clearSelectedFeatures(),e.forEach(t=>this.doRender(t))),ia.enable(this),this.stopExtendedInteractions(r)},cn.clickOnVertex=function(r,e){this.changeMode(Br.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:Dn.MOVE})},cn.startOnActiveFeature=function(r,e){this.stopExtendedInteractions(r),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),r.canDragMove=!0,r.dragMoveLocation=e.lngLat},cn.clickOnFeature=function(r,e){ia.disable(this),this.stopExtendedInteractions(r);const t=um(e),n=this.getSelectedIds(),i=e.featureTarget.properties.id,o=this.isSelected(i);if(!t&&o&&this.getFeature(i).type!==lr.POINT)return this.changeMode(Br.DIRECT_SELECT,{featureId:i});o&&t?(this.deselect(i),this.updateUIClasses({mouse:Dn.POINTER}),1===n.length&&ia.enable(this)):!o&&t?(this.select(i),this.updateUIClasses({mouse:Dn.MOVE})):!o&&!t&&(n.forEach(a=>this.doRender(a)),this.setSelected(i),this.updateUIClasses({mouse:Dn.MOVE})),this.doRender(i)},cn.onMouseDown=function(r,e){return r.initialDragPanState=this.map.dragPan.isEnabled(),nu(e)?this.startOnActiveFeature(r,e):this.drawConfig.boxSelect&&PL(e)?this.startBoxSelect(r,e):void 0},cn.startBoxSelect=function(r,e){this.stopExtendedInteractions(r),this.map.dragPan.disable(),r.boxSelectStartLocation=ZT(e.originalEvent,this.map.getContainer()),r.canBoxSelect=!0},cn.onTouchStart=function(r,e){if(nu(e))return this.startOnActiveFeature(r,e)},cn.onDrag=function(r,e){return r.canDragMove?this.dragMove(r,e):this.drawConfig.boxSelect&&r.canBoxSelect?this.whileBoxSelect(r,e):void 0},cn.whileBoxSelect=function(r,e){r.boxSelecting=!0,this.updateUIClasses({mouse:Dn.ADD}),r.boxSelectElement||(r.boxSelectElement=document.createElement("div"),r.boxSelectElement.classList.add(po.BOX_SELECT),this.map.getContainer().appendChild(r.boxSelectElement));const t=ZT(e.originalEvent,this.map.getContainer()),n=Math.min(r.boxSelectStartLocation.x,t.x),i=Math.max(r.boxSelectStartLocation.x,t.x),o=Math.min(r.boxSelectStartLocation.y,t.y),a=Math.max(r.boxSelectStartLocation.y,t.y),s=`translate(${n}px, ${o}px)`;r.boxSelectElement.style.transform=s,r.boxSelectElement.style.WebkitTransform=s,r.boxSelectElement.style.width=i-n+"px",r.boxSelectElement.style.height=a-o+"px"},cn.dragMove=function(r,e){r.dragMoving=!0,e.originalEvent.stopPropagation();const t={lng:e.lngLat.lng-r.dragMoveLocation.lng,lat:e.lngLat.lat-r.dragMoveLocation.lat};oI(this.getSelected(),t),r.dragMoveLocation=e.lngLat},cn.onTouchEnd=cn.onMouseUp=function(r,e){if(r.dragMoving)this.fireUpdate();else if(r.boxSelecting){const t=[r.boxSelectStartLocation,ZT(e.originalEvent,this.map.getContainer())],n=this.featuresAt(null,t,"click"),i=this.getUniqueIds(n).filter(o=>!this.isSelected(o));i.length&&(this.select(i),i.forEach(o=>this.doRender(o)),this.updateUIClasses({mouse:Dn.MOVE}))}this.stopExtendedInteractions(r)},cn.toDisplayFeatures=function(r,e,t){e.properties.active=this.isSelected(e.properties.id)?yi.ACTIVE:yi.INACTIVE,t(e),this.fireActionable(),e.properties.active===yi.ACTIVE&&e.geometry.type!==lr.POINT&&nI(e).forEach(t)},cn.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},cn.onCombineFeatures=function(){const r=this.getSelected();if(0===r.length||r.length<2)return;const e=[],t=[],n=r[0].type.replace("Multi","");for(let i=0;i<r.length;i++){const o=r[i];if(o.type.replace("Multi","")!==n)return;o.type.includes("Multi")?o.getCoordinates().forEach(a=>{e.push(a)}):e.push(o.getCoordinates()),t.push(o.toGeoJSON())}if(t.length>1){const i=this.newFeature({type:lr.FEATURE,properties:t[0].properties,geometry:{type:`Multi${n}`,coordinates:e}});this.addFeature(i),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([i.id]),this.fire(no.COMBINE_FEATURES,{createdFeatures:[i.toGeoJSON()],deletedFeatures:t})}this.fireActionable()},cn.onUncombineFeatures=function(){const r=this.getSelected();if(0===r.length)return;const e=[],t=[];for(let n=0;n<r.length;n++){const i=r[n];this.isInstanceOf("MultiFeature",i)&&(i.getFeatures().forEach(o=>{this.addFeature(o),o.properties=i.properties,e.push(o.toGeoJSON()),this.select([o.id])}),this.deleteFeature(i.id,{silent:!0}),t.push(i.toGeoJSON()))}e.length>1&&this.fire(no.UNCOMBINE_FEATURES,{createdFeatures:e,deletedFeatures:t}),this.fireActionable()};const M7=cn,d2=sm(Hi.VERTEX),h2=sm(Hi.MIDPOINT),dn={fireUpdate:function(){this.fire(no.UPDATE,{action:Yh.CHANGE_COORDINATES,features:this.getSelected().map(r=>r.toGeoJSON())})},fireActionable:function(r){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:r.selectedCoordPaths.length>0})},startDragging:function(r,e){null==r.initialDragPanState&&(r.initialDragPanState=this.map.dragPan.isEnabled()),this.map.dragPan.disable(),r.canDragMove=!0,r.dragMoveLocation=e.lngLat},stopDragging:function(r){r.canDragMove&&!0===r.initialDragPanState&&this.map.dragPan.enable(),r.initialDragPanState=null,r.dragMoving=!1,r.canDragMove=!1,r.dragMoveLocation=null},onVertex:function(r,e){this.startDragging(r,e);const t=e.featureTarget.properties,n=r.selectedCoordPaths.indexOf(t.coord_path);um(e)||-1!==n?um(e)&&-1===n&&r.selectedCoordPaths.push(t.coord_path):r.selectedCoordPaths=[t.coord_path];const i=this.pathsToCoordinates(r.featureId,r.selectedCoordPaths);this.setSelectedCoordinates(i)},onMidpoint:function(r,e){this.startDragging(r,e);const t=e.featureTarget.properties;r.feature.addCoordinate(t.coord_path,t.lng,t.lat),this.fireUpdate(),r.selectedCoordPaths=[t.coord_path]},pathsToCoordinates:function(r,e){return e.map(t=>({feature_id:r,coord_path:t}))},onFeature:function(r,e){0===r.selectedCoordPaths.length?this.startDragging(r,e):this.stopDragging(r)},dragFeature:function(r,e,t){oI(this.getSelected(),t),r.dragMoveLocation=e.lngLat},dragVertex:function(r,e,t){const n=r.selectedCoordPaths.map(a=>r.feature.getCoordinate(a)),o=iI(n.map(a=>({type:lr.FEATURE,properties:{},geometry:{type:lr.POINT,coordinates:a}})),t);for(let a=0;a<n.length;a++){const s=n[a];r.feature.updateCoordinate(r.selectedCoordPaths[a],s[0]+o.lng,s[1]+o.lat)}},clickNoTarget:function(){this.changeMode(Br.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(Br.SIMPLE_SELECT)},clickActiveFeature:function(r){r.selectedCoordPaths=[],this.clearSelectedCoordinates(),r.feature.changed()},onSetup:function(r){const e=r.featureId,t=this.getFeature(e);if(!t)throw new Error("You must provide a featureId to enter direct_select mode");if(t.type===lr.POINT)throw new TypeError("direct_select mode doesn't handle point features");const n={featureId:e,feature:t,dragMoveLocation:r.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:r.coordPath?[r.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(e,n.selectedCoordPaths)),this.setSelected(e),ia.disable(this),this.setActionableState({trash:!0}),n},onStop:function(){ia.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(r,e,t){r.featureId===e.properties.id?(e.properties.active=yi.ACTIVE,t(e),nI(e,{map:this.map,midpoints:!0,selectedPaths:r.selectedCoordPaths}).forEach(t)):(e.properties.active=yi.INACTIVE,t(e)),this.fireActionable(r)},onTrash:function(r){r.selectedCoordPaths.sort((e,t)=>t.localeCompare(e,"en",{numeric:!0})).forEach(e=>r.feature.removeCoordinate(e)),this.fireUpdate(),r.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(r),!1===r.feature.isValid()&&(this.deleteFeature([r.featureId]),this.changeMode(Br.SIMPLE_SELECT,{}))},onMouseMove:function(r,e){const t=nu(e),n=d2(e),i=h2(e),o=0===r.selectedCoordPaths.length;return this.updateUIClasses(t&&o||n&&!o?{mouse:Dn.MOVE}:{mouse:Dn.NONE}),(n||t||i)&&r.dragMoving&&this.fireUpdate(),this.stopDragging(r),!0},onMouseOut:function(r){return r.dragMoving&&this.fireUpdate(),!0}};dn.onTouchStart=dn.onMouseDown=function(r,e){return d2(e)?this.onVertex(r,e):nu(e)?this.onFeature(r,e):h2(e)?this.onMidpoint(r,e):void 0},dn.onDrag=function(r,e){if(!0!==r.canDragMove)return;r.dragMoving=!0,e.originalEvent.stopPropagation();const t={lng:e.lngLat.lng-r.dragMoveLocation.lng,lat:e.lngLat.lat-r.dragMoveLocation.lat};r.selectedCoordPaths.length>0?this.dragVertex(r,e,t):this.dragFeature(r,e,t),r.dragMoveLocation=e.lngLat},dn.onClick=function(r,e){return lm(e)?this.clickNoTarget(r,e):nu(e)?this.clickActiveFeature(r,e):qT(e)?this.clickInactive(r,e):void this.stopDragging(r)},dn.onTap=function(r,e){return lm(e)?this.clickNoTarget(r,e):nu(e)?this.clickActiveFeature(r,e):qT(e)?this.clickInactive(r,e):void 0},dn.onTouchEnd=dn.onMouseUp=function(r){r.dragMoving&&this.fireUpdate(),this.stopDragging(r)};const F7=dn,Pa={onSetup:function(){const r=this.newFeature({type:lr.FEATURE,properties:{},geometry:{type:lr.POINT,coordinates:[]}});return this.addFeature(r),this.clearSelectedFeatures(),this.updateUIClasses({mouse:Dn.ADD}),this.activateUIButton(go.POINT),this.setActionableState({trash:!0}),{point:r}},stopDrawingAndRemove:function(r){this.deleteFeature([r.point.id],{silent:!0}),this.changeMode(Br.SIMPLE_SELECT)}};Pa.onTap=Pa.onClick=function(r,e){this.updateUIClasses({mouse:Dn.MOVE}),r.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.fire(no.CREATE,{features:[r.point.toGeoJSON()]}),this.changeMode(Br.SIMPLE_SELECT,{featureIds:[r.point.id]})},Pa.onStop=function(r){this.activateUIButton(),r.point.getCoordinate().length||this.deleteFeature([r.point.id],{silent:!0})},Pa.toDisplayFeatures=function(r,e,t){const n=e.properties.id===r.point.id;if(e.properties.active=n?yi.ACTIVE:yi.INACTIVE,!n)return t(e)},Pa.onTrash=Pa.stopDrawingAndRemove,Pa.onKeyUp=function(r,e){if(cm(e)||dm(e))return this.stopDrawingAndRemove(r,e)};const V7=Pa,wm=function B7(r,e){return!!r.lngLat&&r.lngLat.lng===e[0]&&r.lngLat.lat===e[1]},oa={onSetup:function(){const r=this.newFeature({type:lr.FEATURE,properties:{},geometry:{type:lr.POLYGON,coordinates:[[]]}});return this.addFeature(r),this.clearSelectedFeatures(),ia.disable(this),this.updateUIClasses({mouse:Dn.ADD}),this.activateUIButton(go.POLYGON),this.setActionableState({trash:!0}),{polygon:r,currentVertexPosition:0}},clickAnywhere:function(r,e){if(r.currentVertexPosition>0&&wm(e,r.polygon.coordinates[0][r.currentVertexPosition-1]))return this.changeMode(Br.SIMPLE_SELECT,{featureIds:[r.polygon.id]});this.updateUIClasses({mouse:Dn.ADD}),r.polygon.updateCoordinate(`0.${r.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),r.currentVertexPosition++,r.polygon.updateCoordinate(`0.${r.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(r){return this.changeMode(Br.SIMPLE_SELECT,{featureIds:[r.polygon.id]})},onMouseMove:function(r,e){r.polygon.updateCoordinate(`0.${r.currentVertexPosition}`,e.lngLat.lng,e.lngLat.lat),Qh(e)&&this.updateUIClasses({mouse:Dn.POINTER})}};oa.onTap=oa.onClick=function(r,e){return Qh(e)?this.clickOnVertex(r,e):this.clickAnywhere(r,e)},oa.onKeyUp=function(r,e){cm(e)?(this.deleteFeature([r.polygon.id],{silent:!0}),this.changeMode(Br.SIMPLE_SELECT)):dm(e)&&this.changeMode(Br.SIMPLE_SELECT,{featureIds:[r.polygon.id]})},oa.onStop=function(r){this.updateUIClasses({mouse:Dn.NONE}),ia.enable(this),this.activateUIButton(),void 0!==this.getFeature(r.polygon.id)&&(r.polygon.removeCoordinate(`0.${r.currentVertexPosition}`),r.polygon.isValid()?this.fire(no.CREATE,{features:[r.polygon.toGeoJSON()]}):(this.deleteFeature([r.polygon.id],{silent:!0}),this.changeMode(Br.SIMPLE_SELECT,{},{silent:!0})))},oa.toDisplayFeatures=function(r,e,t){const n=e.properties.id===r.polygon.id;if(e.properties.active=n?yi.ACTIVE:yi.INACTIVE,!n)return t(e);if(0===e.geometry.coordinates.length)return;const i=e.geometry.coordinates[0].length;if(!(i<3)){if(e.properties.meta=Hi.FEATURE,t(Vc(r.polygon.id,e.geometry.coordinates[0][0],"0.0",!1)),i>3){const o=e.geometry.coordinates[0].length-3;t(Vc(r.polygon.id,e.geometry.coordinates[0][o],`0.${o}`,!1))}if(i<=4&&(t({type:lr.FEATURE,properties:e.properties,geometry:{coordinates:[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]],type:lr.LINE_STRING}}),3===i))return;return t(e)}},oa.onTrash=function(r){this.deleteFeature([r.polygon.id],{silent:!0}),this.changeMode(Br.SIMPLE_SELECT)};const U7=oa,aa={onSetup:function(r){const e=(r=r||{}).featureId;let t,n,i="forward";if(e){if(t=this.getFeature(e),!t)throw new Error("Could not find a feature with the provided featureId");let o=r.from;if(o&&"Feature"===o.type&&o.geometry&&"Point"===o.geometry.type&&(o=o.geometry),o&&"Point"===o.type&&o.coordinates&&2===o.coordinates.length&&(o=o.coordinates),!o||!Array.isArray(o))throw new Error("Please use the `from` property to indicate which point to continue the line from");const a=t.coordinates.length-1;if(t.coordinates[a][0]===o[0]&&t.coordinates[a][1]===o[1])n=a+1,t.addCoordinate(n,...t.coordinates[a]);else{if(t.coordinates[0][0]!==o[0]||t.coordinates[0][1]!==o[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");i="backwards",n=0,t.addCoordinate(n,...t.coordinates[0])}}else t=this.newFeature({type:lr.FEATURE,properties:{},geometry:{type:lr.LINE_STRING,coordinates:[]}}),n=0,this.addFeature(t);return this.clearSelectedFeatures(),ia.disable(this),this.updateUIClasses({mouse:Dn.ADD}),this.activateUIButton(go.LINE),this.setActionableState({trash:!0}),{line:t,currentVertexPosition:n,direction:i}},clickAnywhere:function(r,e){if(r.currentVertexPosition>0&&wm(e,r.line.coordinates[r.currentVertexPosition-1])||"backwards"===r.direction&&wm(e,r.line.coordinates[r.currentVertexPosition+1]))return this.changeMode(Br.SIMPLE_SELECT,{featureIds:[r.line.id]});this.updateUIClasses({mouse:Dn.ADD}),r.line.updateCoordinate(r.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===r.direction?(r.currentVertexPosition++,r.line.updateCoordinate(r.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):r.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(r){return this.changeMode(Br.SIMPLE_SELECT,{featureIds:[r.line.id]})},onMouseMove:function(r,e){r.line.updateCoordinate(r.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),Qh(e)&&this.updateUIClasses({mouse:Dn.POINTER})}};aa.onTap=aa.onClick=function(r,e){if(Qh(e))return this.clickOnVertex(r,e);this.clickAnywhere(r,e)},aa.onKeyUp=function(r,e){dm(e)?this.changeMode(Br.SIMPLE_SELECT,{featureIds:[r.line.id]}):cm(e)&&(this.deleteFeature([r.line.id],{silent:!0}),this.changeMode(Br.SIMPLE_SELECT))},aa.onStop=function(r){ia.enable(this),this.activateUIButton(),void 0!==this.getFeature(r.line.id)&&(r.line.removeCoordinate(`${r.currentVertexPosition}`),r.line.isValid()?this.fire(no.CREATE,{features:[r.line.toGeoJSON()]}):(this.deleteFeature([r.line.id],{silent:!0}),this.changeMode(Br.SIMPLE_SELECT,{},{silent:!0})))},aa.onTrash=function(r){this.deleteFeature([r.line.id],{silent:!0}),this.changeMode(Br.SIMPLE_SELECT)},aa.toDisplayFeatures=function(r,e,t){const n=e.properties.id===r.line.id;if(e.properties.active=n?yi.ACTIVE:yi.INACTIVE,!n)return t(e);e.geometry.coordinates.length<2||(e.properties.meta=Hi.FEATURE,t(Vc(r.line.id,e.geometry.coordinates["forward"===r.direction?e.geometry.coordinates.length-2:1],""+("forward"===r.direction?e.geometry.coordinates.length-2:1),!1)),t(e))};const f2={simple_select:M7,direct_select:F7,draw_point:V7,draw_polygon:U7,draw_line_string:aa},z7={defaultMode:Br.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:GL,modes:f2,controls:{},userProperties:!1,suppressAPIEvents:!0},G7={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},q7={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function p2(r,e){return r.map(t=>t.source?t:Object.assign({},t,{id:`${t.id}.${e}`,source:"hot"===e?zo.HOT:zo.COLD}))}var g2=ne(362),$7=ne(5341);function m2(r,e){return r.length===e.length&&JSON.stringify(r.map(t=>t).sort())===JSON.stringify(e.map(t=>t).sort())}const H7={Polygon:gm,LineString:pm,Point:fm,MultiPolygon:Zh,MultiLineString:Zh,MultiPoint:Zh};function bm(r){!function(r,e){r=function j7(r={}){let e=Object.assign({},r);return r.controls||(e.controls={}),e.controls=Object.assign({},!1===r.displayControlsDefault?q7:G7,r.controls),e=Object.assign({},z7,e),e.styles=p2(e.styles,"cold").concat(p2(e.styles,"hot")),e}(r);const t={options:r};e=function W7(r,e){e.modes=Br;const t=void 0===r.options.suppressAPIEvents||!!r.options.suppressAPIEvents;return e.getFeatureIdsAt=function(n){return Fc.click({point:n},null,r).map(o=>o.properties.id)},e.getSelectedIds=function(){return r.store.getSelectedIds()},e.getSelected=function(){return{type:lr.FEATURE_COLLECTION,features:r.store.getSelectedIds().map(n=>r.store.get(n)).map(n=>n.toGeoJSON())}},e.getSelectedPoints=function(){return{type:lr.FEATURE_COLLECTION,features:r.store.getSelectedCoordinates().map(n=>({type:lr.FEATURE,properties:{},geometry:{type:lr.POINT,coordinates:n.coordinates}}))}},e.set=function(n){if(void 0===n.type||n.type!==lr.FEATURE_COLLECTION||!Array.isArray(n.features))throw new Error("Invalid FeatureCollection");const i=r.store.createRenderBatch();let o=r.store.getAllIds().slice();const a=e.add(n),s=new iu(a);return o=o.filter(l=>!s.has(l)),o.length&&e.delete(o),i(),a},e.add=function(n){const o=JSON.parse(JSON.stringify($7(n))).features.map(a=>{if(a.id=a.id||QT(),null===a.geometry)throw new Error("Invalid geometry: null");if(void 0===r.store.get(a.id)||r.store.get(a.id).type!==a.geometry.type){const s=H7[a.geometry.type];if(void 0===s)throw new Error(`Invalid geometry type: ${a.geometry.type}.`);const l=new s(r,a);r.store.add(l,{silent:t})}else{const s=r.store.get(a.id),l=s.properties;s.properties=a.properties,g2(l,a.properties)||r.store.featureChanged(s.id,{silent:t}),g2(s.getCoordinates(),a.geometry.coordinates)||s.incomingCoords(a.geometry.coordinates)}return a.id});return r.store.render(),o},e.get=function(n){const i=r.store.get(n);if(i)return i.toGeoJSON()},e.getAll=function(){return{type:lr.FEATURE_COLLECTION,features:r.store.getAll().map(n=>n.toGeoJSON())}},e.delete=function(n){return r.store.delete(n,{silent:t}),e.getMode()!==Br.DIRECT_SELECT||r.store.getSelectedIds().length?r.store.render():r.events.changeMode(Br.SIMPLE_SELECT,void 0,{silent:t}),e},e.deleteAll=function(){return r.store.delete(r.store.getAllIds(),{silent:t}),e.getMode()===Br.DIRECT_SELECT?r.events.changeMode(Br.SIMPLE_SELECT,void 0,{silent:t}):r.store.render(),e},e.changeMode=function(n,i={}){return n===Br.SIMPLE_SELECT&&e.getMode()===Br.SIMPLE_SELECT?(m2(i.featureIds||[],r.store.getSelectedIds())||(r.store.setSelected(i.featureIds,{silent:t}),r.store.render()),e):(n===Br.DIRECT_SELECT&&e.getMode()===Br.DIRECT_SELECT&&i.featureId===r.store.getSelectedIds()[0]||r.events.changeMode(n,i,{silent:t}),e)},e.getMode=function(){return r.events.getMode()},e.trash=function(){return r.events.trash({silent:t}),e},e.combineFeatures=function(){return r.events.combineFeatures({silent:t}),e},e.uncombineFeatures=function(){return r.events.uncombineFeatures({silent:t}),e},e.setFeatureProperty=function(n,i,o){return r.store.setFeatureProperty(n,i,o,{silent:t}),e},e}(t,e),t.api=e;const n=w7(t);e.onAdd=n.onAdd,e.onRemove=n.onRemove,e.types=go,e.options=r}(r,this)}bm.modes=f2,bm.constants=ae,bm.lib=D;const v2=bm;let aI=(()=>{class r{_draw;_map;_drawMode=(0,w.vPA)(!1);_settingDrawMode=!1;_eventListeners=[];_clearAfterFinish=!0;drawEvent=(0,w.vPA)(void 0);destroy(){this._cleanup()}initializeWithMap(t){this._map=t,this._initDrawControl(t)}setDrawMode(t,n){if(this._draw&&this._map&&!this._settingDrawMode){if(this._clearAfterFinish=n,this._settingDrawMode=!0,this._drawMode.set(t),t){this._draw.deleteAll(),this._draw.changeMode("draw_polygon");const i={type:"polygon",status:"started",coordinates:[],bbox:{minLng:0,minLat:0,maxLng:0,maxLat:0}};this.drawEvent.update(()=>i)}else this._draw.changeMode("simple_select"),this._draw.deleteAll();this._settingDrawMode=!1}}setClearAfterFinish(t){this._clearAfterFinish=t}getClearAfterFinish(){return this._clearAfterFinish}getDrawMode(){return this._drawMode()}clearDrawings(){this._draw&&this._draw.deleteAll()}getDrawInstance(){return this._draw}_initDrawControl(t){this._draw=new v2({displayControlsDefault:!1,modes:{...v2.modes}}),t.addControl(this._draw,"top-left");const n=document.querySelector(".mapbox-gl-draw_ctrl-draw-btn")?.parentElement;n&&(n.style.display="none");const i=s=>{const l=s.features[0];if("Polygon"===l.geometry.type){const u=l.geometry.coordinates[0],d={type:"polygon",status:"ended",coordinates:u,bbox:this._calculateBBox(u)};this.drawEvent.update(()=>d),this._drawMode.set(!1),this._clearAfterFinish&&this._draw?.deleteAll()}},o=s=>{const l=s.features[0];if("Polygon"===l.geometry.type){const u=l.geometry.coordinates[0],d={type:"polygon",status:"in-progress",coordinates:u,bbox:this._calculateBBox(u)};this.drawEvent.update(()=>d)}},a=()=>{if(this._drawMode()){const s=this._draw?.getAll();if(s?.features?.length){const l=s.features[0];if("Polygon"===l.geometry.type){const u=l.geometry.coordinates[0];if(u.length>2){const d={type:"polygon",status:"in-progress",coordinates:u,bbox:this._calculateBBox(u)};this.drawEvent.update(()=>d)}}}}};t.on("draw.create",i),t.on("draw.update",o),t.on("mousemove",a),this._eventListeners.push({event:"draw.create",handler:i}),this._eventListeners.push({event:"draw.update",handler:o}),this._eventListeners.push({event:"mousemove",handler:a})}_cleanup(){this._map&&(this._eventListeners.forEach(({event:t,handler:n})=>{this._map?.off(t,n)}),this._eventListeners=[],this._draw&&this._map._controls?.includes(this._draw)&&this._map.removeControl(this._draw)),this._draw=void 0,this._map=void 0,this.drawEvent.set(void 0)}_calculateBBox(t){return t.reduce((n,i)=>({minLng:Math.min(n.minLng,i[0]),minLat:Math.min(n.minLat,i[1]),maxLng:Math.max(n.maxLng,i[0]),maxLat:Math.max(n.maxLat,i[1])}),{minLng:1/0,minLat:1/0,maxLng:-1/0,maxLat:-1/0})}static \u0275fac=function(n){return new(n||r)};static \u0275prov=w.jDH({token:r,factory:r.\u0275fac})}return r})();var ka=ne(9079);let sI=(()=>{class r{_map;_mapContainer;_isInitializing=!1;_mapReadyPromiseResolve;_mapReady=new Promise(t=>{this._mapReadyPromiseResolve=t});_emittedReady=!1;_firstThemeReceived=!1;_hoveredFeature=(0,w.vPA)(void 0);_layerService=(0,w.WQX)(am);_drawService=(0,w.WQX)(aI);mapboxToken=(0,w.vPA)("");center=(0,w.vPA)([8.5,47.4]);zoom=(0,w.vPA)(2);borderRadius=(0,w.vPA)("0");mapReady=new el.B;clickedMap=new el.B;pannedMap=new el.B;panningMap=new el.B;zoomedMap=new el.B;error=(0,w.vPA)("");get clickedFeature(){return this._layerService.clickedFeature}get hoveredFeature(){return this._layerService.hoveredFeature}get layers(){return this._layerService.layers}get layersSignal(){return this._layerService.layersSignal}get layerService(){return this._layerService}get drawService(){return this._drawService}get drawEvent(){return this._drawService.drawEvent}_darkMode=(0,w.vPA)(this._getSystemColorPreference());_styleId=(0,E.EW)(()=>this._darkMode()?"madsholten/clwjh4xeu00q601pnczm07jq6":"madsholten/clwjh6ug900q701pn6eor8p51");get map(){return this._map}constructor(){this._layerService.hoveredFeature.pipe((0,ka.pQ)()).subscribe(t=>{this._hoveredFeature.set(t?.feature)}),(0,w.QZP)(()=>{this._styleId(),this._firstThemeReceived?void 0!==this._map&&this._updateStyle().catch(t=>{console.error("Failed to update map style:",t)}):this._firstThemeReceived=!0})}destroy(){if(this._layerService?.clearAllLayers(),this._drawService?.destroy(),this._map)try{this._map.remove()}catch(t){console.warn("Error removing map:",t)}this._map=void 0,this._mapContainer&&(this._mapContainer.innerHTML="",this._mapContainer=void 0),this._isInitializing=!1,this._emittedReady=!1,this._mapReady=new Promise(t=>{this._mapReadyPromiseResolve=t})}isMapReady(){return void 0!==this._map&&this._emittedReady&&!this._isInitializing}waitForMapReady(){var t=this;return(0,_.A)(function*(){return t._mapReady})()}init(t,n,i,o,a){var s=this;return(0,_.A)(function*(){if(n&&""!==n.trim())if(s._map||s._isInitializing)console.warn("MapService: Map is already initialized or currently initializing");else{s._isInitializing=!0,s.mapboxToken.set(n),s.center.set(i),s.zoom.set(o),s.borderRadius.set(a),s._mapContainer=t,s._mapContainer&&(s._mapContainer.innerHTML="");try{yield s._loadMapboxCSS();const l=yield ne.e(247).then(ne.t.bind(ne,1247,23)),u=l.default||l;if(!u||"function"!=typeof u.Map)throw new Error("Mapbox GL JS not properly loaded");u.accessToken=s.mapboxToken(),s._map=new u.Map({container:t,style:s._getMapStyleURL(),center:s.center(),zoom:s.zoom()}),s._applyBorderRadius(t),s._initEventListeners(s._map)}catch(l){console.error("Failed to load mapbox-gl:",l),s.error.set("Failed to load map library. Please ensure mapbox-gl is installed.")}finally{s._isInitializing=!1}}else console.warn("MapService: Cannot initialize map without valid mapbox token")})()}loadGeoJSON(t,n,i){var o=this;return(0,_.A)(function*(a,s,l,u=!0,c=!0){return yield o._mapReady,o._layerService.loadGeoJSONLayer(a,s,l,{cluster:u,zoomToFit:c,visible:!0,label:a})}).apply(this,arguments)}fitGeoJSONBBOX(t){var n=this;return(0,_.A)(function*(i,o=50,a=!0,s=19){yield n._mapReady,i?n._layerService.fitGeoJSONBounds(i,o,a,s):n._layerService.fitAllVisibleLayers(o)}).apply(this,arguments)}jumpTo(t,n){this._map?.jumpTo({center:t,zoom:n??this.zoom()})}setDarkMode(t){this._darkMode.set(t)}zoomToCoordinate(t){const n=this._map?.getZoom();if(!n)return;const i=n+1;this._map?.flyTo({center:t,zoom:i})}getZoom(){return this._map?.getZoom()}flyTo(t,n,i){this._map?.flyTo({center:t,zoom:n??this.zoom(),essential:!0,padding:i})}zoomIn(){if(!this._map)return;const t=this._map.getZoom();this._map.flyTo({zoom:t+1})}zoomOut(){if(!this._map)return;const t=this._map.getZoom();this._map.flyTo({zoom:t-1})}clearLayers(){this._layerService.clearAllLayers()}getImage(){const t=this._map?.getCanvas();if(void 0!==t)return t.toDataURL("image/png")}onParentResize(){this._map?.resize()}_loadMapboxCSS(){return(0,_.A)(function*(){return new Promise((t,n)=>{if(document.querySelector('link[href*="mapbox-gl.css"]'))return void t();const i=document.createElement("link");i.rel="stylesheet",i.href="https://api.mapbox.com/mapbox-gl-js/v3.3.0/mapbox-gl.css",i.onload=()=>t(),i.onerror=()=>{const o=document.createElement("link");o.rel="stylesheet",o.href="node_modules/mapbox-gl/dist/mapbox-gl.css",o.onload=()=>t(),o.onerror=()=>n(new Error("Failed to load Mapbox CSS")),document.head.appendChild(o)},document.head.appendChild(i)})})()}_applyBorderRadius(t){const n=this.borderRadius();let i=n;if("0"===n){const a=t.closest("cue-map")?.parentElement;a&&(i=getComputedStyle(a).borderRadius||"0")}"0"!==i&&(t.style.borderRadius=i,t.style.overflow="hidden",setTimeout(()=>{const o=t.querySelector(".mapboxgl-canvas"),a=t.querySelector(".mapboxgl-canvas-container"),s=t.querySelector(".mapboxgl-map");o&&(o.style.borderRadius=i),a&&(a.style.borderRadius=i),s&&(s.style.borderRadius=i)},100))}_initEventListeners(t){t.on("click",n=>{void 0===this._hoveredFeature()&&this.clickedMap.next(n)}),t.on("drag",n=>{void 0===this._hoveredFeature()&&this.panningMap.next(n)}),t.on("dragend",n=>{void 0===this._hoveredFeature()&&this.pannedMap.next(n)}),t.on("zoomend",n=>{this.zoomedMap.next(n)}),t.on("load",()=>{this._emittedReady||(this._layerService.initializeWithMap(t),this._drawService.initializeWithMap(t),this._mapReadyPromiseResolve(),this.mapReady.next(),this._emittedReady=!0)}),t.on("error",n=>{this.error.set(n.error.message)})}_getMapStyleURL(){return`mapbox://styles/${this._styleId()}`}_updateStyle(){var t=this;return(0,_.A)(function*(){if(void 0===t._map)return;const n=t._map.getZoom(),i=t._map.getCenter();void 0!==t._mapContainer&&(yield t.init(t._mapContainer,t.mapboxToken(),i,n,t.borderRadius()),setTimeout(()=>{t._layerService.reapplyLayers(),t._map?.flyTo({center:i,zoom:n})},500))})()}_getSystemColorPreference(){return typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches}static \u0275fac=function(n){return new(n||r)};static \u0275prov=w.jDH({token:r,factory:r.\u0275fac})}return r})();var K7=ne(7089);function Y7(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-button",5),V.nI1(1,"transloco"),V.bIt("click",function(){w.eBV(t);const i=V.XpG(2);return w.Njj(i.handleZoomFit())}),V.nrm(2,"cue-button-icon",9),V.k0s()}2&r&&V.Y8G("cueTooltip",V.bMT(1,1,"components.map.tooltipZoomFit"))}function Q7(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-flexcontainer",3)(1,"cue-button",5),V.nI1(2,"transloco"),V.bIt("click",function(){w.eBV(t);const i=V.XpG();return w.Njj(i.handleZoomOut())}),V.nrm(3,"cue-button-icon",6),V.k0s(),V.j41(4,"cue-button",5),V.nI1(5,"transloco"),V.bIt("click",function(){w.eBV(t);const i=V.XpG();return w.Njj(i.handleZoomIn())}),V.nrm(6,"cue-button-icon",7),V.k0s(),V.nVh(7,Y7,3,3,"cue-button",8),V.k0s()}if(2&r){const t=V.XpG();V.R7$(),V.Y8G("cueTooltip",V.bMT(2,3,"components.map.tooltipZoomOut")),V.R7$(3),V.Y8G("cueTooltip",V.bMT(5,5,"components.map.tooltipZoomIn")),V.R7$(3),V.vxM(t.displayZoomFit()?7:-1)}}function J7(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-button",10),V.nI1(1,"transloco"),V.nI1(2,"transloco"),V.mxI("selectedChange",function(i){w.eBV(t);const o=V.XpG();return V.DH7(o.layersVisible,i)||(o.layersVisible=i),w.Njj(i)}),V.nrm(3,"cue-button-icon",11),V.k0s()}if(2&r){const t=V.XpG();V.AVh("border-left",t.options().displayZoom&&t.displayLayerToggle()),V.Y8G("cueTooltip",t.layersVisible()?V.bMT(1,6,"components.map.tooltipHideLayers"):V.bMT(2,8,"components.map.tooltipShowLayers"))("toggleButton",!0),V.R50("selected",t.layersVisible),V.R7$(3),V.Y8G("icon",t.layersVisible()?"layers-clear":"layers")}}function Z7(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-button",10),V.nI1(1,"transloco"),V.nI1(2,"transloco"),V.mxI("selectedChange",function(i){w.eBV(t);const o=V.XpG();return V.DH7(o.geoFenceDrawEnabled,i)||(o.geoFenceDrawEnabled=i),w.Njj(i)}),V.nrm(3,"cue-button-icon",12),V.k0s()}if(2&r){const t=V.XpG();V.AVh("border-left",t.options().displayGeofenceDraw),V.Y8G("cueTooltip",t.geoFenceDrawEnabled()?V.bMT(1,5,"components.map.tooltipEndDrawGeofence"):V.bMT(2,7,"components.map.tooltipDrawGeofence"))("toggleButton",!0),V.R50("selected",t.geoFenceDrawEnabled)}}let e8=(()=>{class r{_service=(0,w.WQX)(sI);layerService=(0,w.WQX)(am);mapLayers=(0,ka.ot)(this.layerService.layers);options=(0,R.hFB)(new Oc.AA);zoom=(0,R.geq)(1);rotate=(0,R.CGW)();geoFenceDrawEnabled=(0,R.geq)(!1);layersVisible=(0,R.geq)(!1);hasLayers=(0,E.EW)(()=>void 0!==this.mapLayers()&&this.mapLayers().length>0);displayLayerToggle=(0,E.EW)(()=>this.options().displayLayerToggle&&this.hasLayers());displayZoomFit=(0,E.EW)(()=>this.options().displayZoom&&this.hasLayers());selectMenuPositions=(0,E.EW)(()=>"top"===this.options().position?"bottomleft":"topleft");handleZoomIn(){this._service.zoomIn()}handleZoomOut(){this._service.zoomOut()}handleZoomFit(){this._service.fitGeoJSONBBOX(void 0,.01)}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-map-toolbar"]],inputs:{options:[1,"options"],zoom:[1,"zoom"],geoFenceDrawEnabled:[1,"geoFenceDrawEnabled"],layersVisible:[1,"layersVisible"]},outputs:{zoom:"zoomChange",rotate:"rotate",geoFenceDrawEnabled:"geoFenceDrawEnabledChange",layersVisible:"layersVisibleChange"},decls:6,vars:4,consts:[["justify","center",1,"container"],[1,"toolbar",3,"padded"],["align","center"],["align","center","gap","s"],["size","xs","variant","ghost",3,"border-left","cueTooltip","toggleButton","selected"],["size","xs","variant","tertiary",3,"click","cueTooltip"],["icon","zoom-out"],["icon","zoom-in"],["size","xs","variant","tertiary",3,"cueTooltip"],["icon","zoom-fit"],["size","xs","variant","ghost",3,"selectedChange","cueTooltip","toggleButton","selected"],[3,"icon"],["icon","polygon"]],template:function(n,i){1&n&&(V.j41(0,"cue-flexcontainer",0)(1,"cue-card",1)(2,"cue-flexcontainer",2),V.nVh(3,Q7,8,7,"cue-flexcontainer",3),V.nVh(4,J7,4,10,"cue-button",4),V.nVh(5,Z7,4,9,"cue-button",4),V.k0s()()()),2&n&&(V.R7$(),V.Y8G("padded",!1),V.R7$(2),V.vxM(i.options().displayZoom?3:-1),V.R7$(),V.vxM(i.displayLayerToggle()?4:-1),V.R7$(),V.vxM(i.options().displayGeofenceDraw?5:-1))},dependencies:[hh.n,h0.Z,XR.$,WR.a,K7.d,Jo.Kj],styles:[".container[_ngcontent-%COMP%]{width:100%;pointer-events:none}.toolbar[_ngcontent-%COMP%]{pointer-events:all;padding:5px 10px}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return r})();var t8=ne(7023);function r8(r,e){if(1&r&&V.nrm(0,"cue-key-val",1),2&r){const t=e.$implicit;V.Y8G("key",t.key)("val",t.val)}}let n8=(()=>{class r{props=(0,R.hFB)(null);keyVals=(0,E.EW)(()=>{const t=this.props();return t?Object.entries(t).map(([n,i])=>({key:n,val:String(i)})):[]});static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-props-panel"]],inputs:{props:[1,"props"]},decls:4,vars:0,consts:[[2,"height","100%","overflow-y","auto"],[3,"key","val"]],template:function(n,i){1&n&&(V.j41(0,"cue-flexcontainer",0)(1,"cue-key-val-list"),V.Z7z(2,r8,1,2,"cue-key-val",1,V.Vm6),V.k0s()()),2&n&&(V.R7$(2),V.Dyx(i.keyVals()))},dependencies:[$R.p,HR.F,hh.n],encapsulation:2,changeDetection:0})}return r})();var i8=ne(7517);let o8=(()=>{class r{layerService=(0,w.WQX)(am);mapLayers=(0,ka.ot)(this.layerService.layers);layerDefs=(0,E.EW)(()=>{const t=this.mapLayers();return t?t.map(n=>({label:n.label,color:n.color??"#000000",visible:n.visible,category:n.category})):[]});updateSingle(t){const n=this.mapLayers()?.find(i=>i.label===t.label);n&&this.layerService.toggleVisibility(n.id)}updateAll(t){const n=this.mapLayers();if(n)for(const i of n)i.visible===t&&this.layerService.toggleVisibility(i.id)}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-layer-panel"]],decls:1,vars:1,consts:[[3,"layerChange","visibilityAll","layers"]],template:function(n,i){1&n&&(V.j41(0,"cue-layer-legend",0),V.bIt("layerChange",function(a){return i.updateSingle(a)})("visibilityAll",function(a){return i.updateAll(a)}),V.k0s()),2&n&&V.Y8G("layers",i.layerDefs())},dependencies:[d0.MD,i8.P],encapsulation:2})}return r})();function y2(r){const e=r.flatMap(t=>{const n=function s8(r){switch(r.type){case"Point":return[r.coordinates[0],r.coordinates[1]];case"MultiPoint":{if(!r.coordinates.length)return null;const e=r.coordinates.reduce((t,n)=>[t[0]+n[0],t[1]+n[1]],[0,0]);return[e[0]/r.coordinates.length,e[1]/r.coordinates.length]}case"LineString":{if(!r.coordinates.length)return null;const e=Math.floor(r.coordinates.length/2);return[r.coordinates[e][0],r.coordinates[e][1]]}case"MultiLineString":{if(!r.coordinates.length||!r.coordinates[0].length)return null;const e=r.coordinates[0],t=Math.floor(e.length/2);return[e[t][0],e[t][1]]}case"Polygon":{if(!r.coordinates.length||!r.coordinates[0].length)return null;const e=r.coordinates[0],t=e.reduce((n,i)=>[n[0]+i[0],n[1]+i[1]],[0,0]);return[t[0]/e.length,t[1]/e.length]}case"MultiPolygon":{if(!r.coordinates.length||!r.coordinates[0]?.length||!r.coordinates[0][0]?.length)return null;const e=r.coordinates[0][0],t=e.reduce((n,i)=>[n[0]+i[0],n[1]+i[1]],[0,0]);return[t[0]/e.length,t[1]/e.length]}default:return null}}(t.geometry);return n?[{type:"Feature",id:t.id,geometry:{type:"Point",coordinates:n},properties:{...t.properties??{},_isCentroid:!0}}]:[]});return[...r,...e]}const _2=["rgba(255, 0, 0, 0.5)","rgba(0, 0, 255, 0.5)","rgba(0, 255, 0, 0.5)","rgba(255, 165, 0, 0.5)","rgba(128, 0, 128, 0.5)","rgba(255, 192, 203, 0.5)","rgba(255, 255, 0, 0.5)"];function l8(r){const e=r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d\.]+))?\)/);if(e)return{r:parseInt(e[1]),g:parseInt(e[2]),b:parseInt(e[3]),a:e[4]?parseFloat(e[4]):1};const t=r.match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/);if(t){const n=t[1];return{r:parseInt(3===n.length?n[0]+n[0]:n.slice(0,2),16),g:parseInt(3===n.length?n[1]+n[1]:n.slice(2,4),16),b:parseInt(3===n.length?n[2]+n[2]:n.slice(4,6),16),a:1}}return{r:0,g:0,b:0,a:1}}function lI(r){if(0===r.length)return _2[0];if(1===r.length)return r[0].color;const e=r.map(c=>({...c,totalWeight:c.featureCount*c.weight})).sort((c,d)=>d.totalWeight-c.totalWeight),t=e.reduce((c,d)=>c+d.totalWeight,0),n=e[0];if(n.totalWeight/t>.6)return n.color;const i=e.slice(0,Math.min(3,e.length)),o=i.reduce((c,d)=>c+d.totalWeight,0);let a=0,s=0,l=0,u=0;for(const c of i){const d=l8(c.color),h=c.totalWeight/o;a+=d.r*h,s+=d.g*h,l+=d.b*h,u+=d.a*h}return function u8(r,e,t,n=1){return n<1?`rgba(${Math.round(r)}, ${Math.round(e)}, ${Math.round(t)}, ${n})`:`rgb(${Math.round(r)}, ${Math.round(e)}, ${Math.round(t)})`}(a,s,l,u)}function uI(r,e,t,n){if(!n||"Point"!==t&&"MultiPoint"!==t)return[{color:e,weight:1,featureCount:r.length}];const i=r.length;if(i<10)return[{color:e,weight:1,featureCount:i}];let o=0,a=0,s=0;i>=750?(o=Math.floor(.1*i),a=Math.floor(.3*i),s=i-o-a):i>=100?(a=Math.floor(.4*i),s=i-a):(s=Math.floor(.8*i),a=i-s);const l=[];return s>0&&l.push({color:e,weight:1,featureCount:s}),a>0&&l.push({color:"#f28cb1",weight:2,featureCount:a}),o>0&&l.push({color:"#e2f552",weight:3,featureCount:o}),l}function cI(r,e,t,n,i,o){const a=Array.isArray(n)?n:[n];UT(i)?r.layerService.loadGeoJSONLayerGroup(e,t,a,{cluster:!1,zoomToFit:o.zoomToFit,visible:o.visible,label:o.label,color:o.color}):a.length>1||("Point"===i||"MultiPoint"===i)&&Array.isArray(a)&&a.length>1?r.layerService.loadGeoJSONLayerGroup(e,t,a,{cluster:Kh(i,o.cluster),zoomToFit:o.zoomToFit,visible:o.visible,label:o.label,color:o.color}):r.loadGeoJSON(e,t,a[0],Kh(i,o.cluster),o.zoomToFit)}var f8=ne(6756),p8=ne(356),g8=ne(6279);const m8=["map"],v8=r=>({position:"bottomleft",hoveredFeature:r}),y8=(r,e)=>e.label;function _8(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-menu-item",6),V.bIt("click",function(i){const o=w.eBV(t).$implicit;return w.Njj(o.action(i))}),V.EFF(1),V.k0s()}if(2&r){const t=e.$implicit;V.R7$(),V.JRh(t.label)}}function w8(r,e){if(1&r&&(V.j41(0,"cue-menu-wrap"),V.Z7z(1,_8,2,1,"cue-menu-item",null,y8),V.k0s()),2&r){const t=V.XpG();V.R7$(),V.Dyx(t.contextMenuItems())}}function b8(r,e){if(1&r&&(V.j41(0,"span"),V.EFF(1),V.k0s()),2&r){const t=V.XpG();V.R7$(),V.JRh(t.mapService.error())}}function E8(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-map-toolbar",8),V.mxI("zoomChange",function(i){w.eBV(t);const o=V.XpG(2);return V.DH7(o.zoom,i)||(o.zoom=i),w.Njj(i)})("layersVisibleChange",function(i){w.eBV(t);const o=V.XpG(2);return V.DH7(o.layerPanelVisible,i)||(o.layerPanelVisible=i),w.Njj(i)})("geoFenceDrawEnabledChange",function(i){w.eBV(t);const o=V.XpG(2);return V.DH7(o.geoFenceDrawEnabled,i)||(o.geoFenceDrawEnabled=i),w.Njj(i)}),V.k0s()}if(2&r){const t=V.XpG(),n=V.XpG();V.Aen(n.toolbarStyle()),V.Y8G("options",t),V.R50("zoom",n.zoom)("layersVisible",n.layerPanelVisible)("geoFenceDrawEnabled",n.geoFenceDrawEnabled)}}function T8(r,e){1&r&&V.nVh(0,E8,1,6,"cue-map-toolbar",7),2&r&&V.vxM(e.hidden?-1:0)}function I8(r,e){1&r&&(V.j41(0,"cue-card",4),V.nrm(1,"cue-layer-panel"),V.k0s())}function x8(r,e){1&r&&(V.j41(0,"cue-card",5),V.nrm(1,"cue-props-panel",9),V.k0s()),2&r&&(V.R7$(),V.Y8G("props",e))}let A8=(()=>{class r{mapService=(0,w.WQX)(sI);drawService=(0,w.WQX)(aI);settings=(0,R.hFB)(new Oc.yY);center=(0,R.hFB)([8.5,47.4]);layerPanelVisible=(0,R.geq)(!1);zoom=(0,R.geq)(2);instruction=(0,R.geq)("Hello");layers=(0,R.hFB)([]);zoomToFit=(0,R.hFB)(!0);zoomToFitEachLayer=(0,R.hFB)(!1);splitLayersByGeometryType=(0,R.hFB)(!0);maxClickZoom=(0,R.hFB)(1/0);borderRadius=(0,R.hFB)("0");geoFenceDrawEnabled=(0,R.geq)(!1);contextMenuItemsBefore=(0,R.hFB)([]);contextMenuItemsAfter=(0,R.hFB)([]);immidiateDrawMode=(0,R.hFB)(void 0);mapReady=(0,R.CGW)();clickedMap=(0,R.CGW)();pannedMap=(0,R.CGW)();panningMap=(0,R.CGW)();zoomedMap=(0,R.CGW)();clickedFeature=(0,R.CGW)();hoveredFeature=(0,R.CGW)();drawEvent=(0,R.CGW)();layersSaturated=(0,E.EW)(()=>this.layers().map((t,n)=>{const i={...t};return i.color||(i.color=f8.BK[n]),i}));toolbarOptions=(0,E.EW)(()=>this.settings().toolbar);featureBeingHovered=(0,w.vPA)(void 0);lastClickedFeatureEvent=(0,w.vPA)(void 0);lastHoveredFeatureEvent=(0,w.vPA)(void 0);shownProperties=(0,w.vPA)(null);_featureClickedThisTick=!1;_previousLayersHash=(0,w.vPA)("");_userHasInteracted=(0,w.vPA)(!1);toolbarStyle=(0,E.EW)(()=>{const t=this.toolbarOptions();return{position:"absolute",left:t.margin,right:t.margin,["top"===t.position?"top":"bottom"]:t.margin,"z-index":"10",display:"flex","justify-content":"center"}});contextMenuEnabled=(0,E.EW)(()=>{const t=this.contextMenuItems().length>0,n=this.featureBeingHovered(),i=this.lastClickedFeatureEvent();return t&&(void 0!==n||void 0!==i)});contextMenuItems=(0,E.EW)(()=>{const t=this.lastHoveredFeatureEvent(),n=this.lastClickedFeatureEvent(),o=(t?.feature||n?.feature)?.properties||null,a=o?Object.fromEntries(Object.entries(o).filter(([h])=>!h.startsWith("_"))):null,s=t?.lngLat||n?.lngLat||null,u=[...this.contextMenuItemsBefore()||[]],c=this.settings().contextMenu;a&&Object.keys(a).length>0&&c.showProperties&&u.push({label:"Show properties",action:()=>{this.shownProperties.update(()=>a)}}),s&&c.showFlyTo&&u.push({label:"Fly to feature",action:()=>{this.mapService.flyTo([s.lng,s.lat],this.zoom())}});const d=this.contextMenuItemsAfter()||[];return[...u,...d]});_mapContainer;_destroy$=new el.B;constructor(){this._subscribeToServiceOutputs(),this._setupEffects(),(0,V.mal)(()=>{this._destroy$.closed||this._tryInitializeMap()})}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete(),this.drawService.destroy(),this.mapService.destroy()}_subscribeToServiceOutputs(){this.mapService.mapReady.pipe((0,ka.pQ)()).subscribe(()=>this.mapReady.emit()),this.mapService.clickedMap.pipe((0,ka.pQ)()).subscribe(t=>{this._featureClickedThisTick||(this.lastClickedFeatureEvent.update(()=>{}),this.lastHoveredFeatureEvent.update(()=>{}),this.featureBeingHovered.update(()=>{}),this.clickedMap.emit(t),this.shownProperties.update(()=>null))}),this.mapService.pannedMap.pipe((0,ka.pQ)()).subscribe(t=>{this._userHasInteracted.set(!0),this.pannedMap.emit(t)}),this.mapService.panningMap.pipe((0,ka.pQ)()).subscribe(t=>this.panningMap.emit(t)),this.mapService.zoomedMap.pipe((0,ka.pQ)()).subscribe(t=>{this._userHasInteracted.set(!0),this.zoomedMap.emit(this.mapService.getZoom()??this.zoom())}),this.mapService.clickedFeature.pipe((0,ka.pQ)()).subscribe(t=>{this._featureClickedThisTick=!0,queueMicrotask(()=>{this._featureClickedThisTick=!1}),this.lastClickedFeatureEvent.update(()=>t),this.clickedFeature.emit(t);const n=t.feature?.geometry?.type,i="Point"===n||"MultiPoint"===n,o=this.mapService.getZoom()??0,a=this.contextMenuItems().length>0;i&&!a&&o<this.maxClickZoom()&&this.mapService.zoomToCoordinate(t.lngLat)}),this.mapService.hoveredFeature.pipe((0,ka.pQ)()).subscribe(t=>{this.featureBeingHovered.update(()=>t?.feature),this.lastHoveredFeatureEvent.update(()=>t),this.hoveredFeature.emit(t)})}_setupEffects(){var t=this;(0,w.QZP)(()=>{"polygon"===this.immidiateDrawMode()&&(this.geoFenceDrawEnabled.set(!0),setTimeout(()=>{this.drawService.setDrawMode(!0,this.settings().toolbar.clearGeofenceAfterDraw)},500))}),(0,w.QZP)(()=>this.mapService.flyTo(this.center(),this.zoom())),(0,w.QZP)(()=>{const i=this.settings()?.mapboxToken;i&&"string"==typeof i&&""!==i.trim()&&!this.mapService.isMapReady()&&this._tryInitializeMap()}),(0,w.QZP)(()=>{const n=this.geoFenceDrawEnabled();this.drawService.setDrawMode(n,this.settings().toolbar.clearGeofenceAfterDraw)}),(0,w.QZP)(()=>{const n=this.drawService.drawEvent();void 0!==n&&this.drawEvent.emit(n)}),(0,w.QZP)((0,_.A)(function*(){const n=t.layersSaturated();if(!n||0===n.length)return;const i=t._createLayersHash(n);if(i===t._previousLayersHash())return;t._previousLayersHash.set(i),yield t.mapService.waitForMapReady(),t.mapService.clearLayers();const a=t.zoomToFitEachLayer();n.forEach((s,l)=>{!function h8(r,e,t,n,i,o,a){const s=e.collection,l=e.color??_2[t];let u;u="geometries"in s?function c8(r){const e=r.geometries.map((n,i)=>({type:"Feature",geometry:n,properties:{},id:r.id?`${r.id}_${i}`:void 0})),t=new as.o(e);return t.id=r.id,t.bbox=r.bbox,t}(s):s;const c=function d8(r){const e=[];return r.forEach(t=>{t.geometry&&"GeometryCollection"===t.geometry.type?t.geometry.geometries.forEach((n,i)=>{e.push({type:"Feature",geometry:n,properties:t.properties||{},id:t.id?`${t.id}_${i}`:void 0})}):e.push(t)}),e}(u.features),d=new as.o(c);d.id=u.id,d.bbox=u.bbox;let h=l;if(!o){const y=e.id.toString(),v=c[0]?.geometry?.type||"Point";h=lI(uI(c,l,v,n));let b=a(y,v,h,y),T=d;const O="Point"!==v&&"MultiPoint"!==v,K=UT(v),Z=SL(v);if(n&&O&&!K&&!Z&&b){const S=Array.isArray(b)?b:[b],P=y2(c);T=new as.o(P),T.id=d.id,T.bbox=d.bbox,b=[AL(`${y}-centroid`,y,h),...S.map(q=>({...q,minzoom:12}))]}return void(b&&cI(r,y,T,b,v,{cluster:n,zoomToFit:i,visible:!0,label:e.label||e.id.toString(),color:h}))}if(o){const y=new Set(c.map(m=>m.geometry.type)),v=[];return y.forEach(m=>{const b=`${e.id.toString()}-${m}`,T=c.filter(Z=>Z.geometry.type===m),O=uI(T,l,m,n);v.push(...O);let K=a(b,m,l,b);if(K){let Z=new as.o(T);Z.id=d.id,Z.bbox=d.bbox;const S="Point"!==m&&"MultiPoint"!==m,P=UT(m),M=SL(m);if(n&&S&&!P&&!M){const q=Array.isArray(K)?K:[K],G=y2(T);Z=new as.o(G),Z.id=d.id,Z.bbox=d.bbox,K=[AL(`${b}-centroid`,b,l),...q.map(U=>({...U,minzoom:12}))]}cI(r,b,Z,K,m,{cluster:n,zoomToFit:i,visible:!0,label:y.size>1?`${e.label||e.id} (${m})`:`${e.label||e.id}`,color:l})}}),void(v.length>0&&(h=lI(v),r.layerService.getLayer(e.id.toString())&&r.layerService.updateLayer(e.id.toString(),{color:h})))}const f=new Map;c.forEach(y=>{const v=y.geometry.type;let m;m="Point"===v||"MultiPoint"===v?"Point":"LineString"===v||"MultiLineString"===v?"LineString":"Polygon"===v||"MultiPolygon"===v?"Polygon":v,f.has(m)||f.set(m,[]),f.get(m).push(v)});const g=[];f.forEach((y,v)=>{const m=`${e.id.toString()}-${v}`,b=c.filter(K=>{const Z=K.geometry.type;return"Point"===v?"Point"===Z||"MultiPoint"===Z:"LineString"===v?"LineString"===Z||"MultiLineString"===Z:"Polygon"===v?"Polygon"===Z||"MultiPolygon"===Z:Z===v}),T=uI(b,l,v,n);g.push(...T);const O=a(m,v,l,m);if(O){const K=new as.o(b);K.id=d.id,K.bbox=d.bbox,cI(r,m,K,O,v,{cluster:n,zoomToFit:i,visible:!0,label:f.size>1?`${e.label||e.id} (${v})`:`${e.label||e.id}`,color:l})}}),g.length>0&&(h=lI(g),r.layerService.getLayer(e.id.toString())&&r.layerService.updateLayer(e.id.toString(),{color:h}))}(t.mapService,s,l,s.cluster,a&&s.zoomToFit,t.splitLayersByGeometryType(),q9)}),t.zoomToFit()&&!a&&!t._userHasInteracted()&&t.mapService.fitGeoJSONBBOX()}))}_tryInitializeMap(){if(this._destroy$.closed)return;const n=this.settings()?.mapboxToken,i=n&&"string"==typeof n&&""!==n.trim(),o=this._mapContainer,a=!this.mapService.isMapReady();i&&o&&a&&(this._userHasInteracted.set(!1),this.mapService.init(this._mapContainer.nativeElement,n,this.center(),this.zoom(),this.borderRadius()))}_createLayersHash(t){return t.map(n=>{const i=n.collection;let o=0;return i&&"FeatureCollection"===i.type&&"features"in i&&(o=Array.isArray(i.features)?i.features.length:0),`${n.id}|${n.label}|${n.visible}|${o}`}).join("::")}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-map"]],viewQuery:function(n,i){if(1&n&&V.GBs(m8,5),2&n){let o;V.mGM(o=V.lsd())&&(i._mapContainer=o.first)}},hostAttrs:["data-component","cue-map-main"],inputs:{settings:[1,"settings"],center:[1,"center"],layerPanelVisible:[1,"layerPanelVisible"],zoom:[1,"zoom"],instruction:[1,"instruction"],layers:[1,"layers"],zoomToFit:[1,"zoomToFit"],zoomToFitEachLayer:[1,"zoomToFitEachLayer"],splitLayersByGeometryType:[1,"splitLayersByGeometryType"],maxClickZoom:[1,"maxClickZoom"],borderRadius:[1,"borderRadius"],geoFenceDrawEnabled:[1,"geoFenceDrawEnabled"],contextMenuItemsBefore:[1,"contextMenuItemsBefore"],contextMenuItemsAfter:[1,"contextMenuItemsAfter"],immidiateDrawMode:[1,"immidiateDrawMode"]},outputs:{layerPanelVisible:"layerPanelVisibleChange",zoom:"zoomChange",instruction:"instructionChange",geoFenceDrawEnabled:"geoFenceDrawEnabledChange",mapReady:"mapReady",clickedMap:"clickedMap",pannedMap:"pannedMap",panningMap:"panningMap",zoomedMap:"zoomedMap",clickedFeature:"clickedFeature",hoveredFeature:"hoveredFeature",drawEvent:"drawEvent"},features:[V.Jv_([sI,aI,am])],decls:9,vars:9,consts:[["hoveringFeature",""],["map",""],["direction","row",1,"container"],["id","map","cueResized","","cueDarkMode","","trigger","leftclick",3,"darkModeChange","resized","cueContextMenu","contextMenuData","cueContextEnabled"],[1,"layer-panel"],[1,"props-panel"],[3,"click"],[3,"options","style","zoom","layersVisible","geoFenceDrawEnabled"],[3,"zoomChange","layersVisibleChange","geoFenceDrawEnabledChange","options","zoom","layersVisible","geoFenceDrawEnabled"],[3,"props"]],template:function(n,i){if(1&n&&(V.DNE(0,w8,3,0,"ng-template",null,0,V.C5r),V.j41(2,"cue-flexcontainer",2)(3,"div",3,1),V.bIt("darkModeChange",function(a){return i.mapService.setDarkMode(a)})("resized",function(){return i.mapService.onParentResize()}),V.k0s(),V.nVh(5,b8,2,1,"span"),V.nVh(6,T8,1,1),V.nVh(7,I8,2,0,"cue-card",4),V.nVh(8,x8,2,1,"cue-card",5),V.k0s()),2&n){let o,a;const s=V.sdS(1);V.R7$(3),V.Y8G("cueContextMenu",s)("contextMenuData",V.eq3(7,v8,i.lastHoveredFeatureEvent()))("cueContextEnabled",i.contextMenuEnabled()),V.R7$(2),V.vxM(i.mapService.error()?5:-1),V.R7$(),V.vxM((o=i.toolbarOptions())?6:-1,o),V.R7$(),V.vxM(i.layerPanelVisible()?7:-1),V.R7$(),V.vxM((a=i.shownProperties())?8:-1,a)}},dependencies:[d0.MD,_L.C,M9.R,e8,t8.Q,p8.M,g8.D,hh.n,n8,o8,h0.Z],styles:["#map[_ngcontent-%COMP%]{flex:1;min-height:0;border-radius:inherit;overflow:hidden}[_nghost-%COMP%]{display:flex;flex-direction:column;position:relative;width:100%;height:100%;min-height:400px;min-width:200px;flex:1 1 auto;align-self:stretch;box-sizing:border-box;overflow:hidden;border-radius:var(--cue-card-border-radius, inherit)}.mapboxgl-canvas-container[_ngcontent-%COMP%], .mapboxgl-canvas[_ngcontent-%COMP%]{border-radius:inherit!important}.mapboxgl-map[_ngcontent-%COMP%]{border-radius:inherit!important;overflow:hidden!important}.container[_ngcontent-%COMP%]{position:relative;width:100%;flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}.props-panel[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;bottom:8px;z-index:10}.layer-panel[_ngcontent-%COMP%]{position:absolute;top:10px;left:10px;z-index:10}cue-map-toolbar[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:0;z-index:10;display:flex;justify-content:center}"]})}return r})();var w2=ne(58);const C8=["*"];let dI=(()=>{class r{label=R.hFB.required();active=(0,R.geq)(!1);static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-tab"]],hostVars:1,hostBindings:function(n,i){2&n&&V.Avn("hidden",!i.active())},inputs:{label:[1,"label"],active:[1,"active"]},outputs:{active:"activeChange"},ngContentSelectors:C8,decls:1,vars:0,template:function(n,i){1&n&&(V.NAR(),V.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0}[hidden][_nghost-%COMP%]{display:none!important}"]})}return r})();const R8=["*"],P8=(r,e)=>e.label();function k8(r,e){if(1&r){const t=V.RV6();V.rj2(0,"button",3),V.VwU("click",function(){const i=w.eBV(t).$index,o=V.XpG();return w.Njj(o.setActive(i))}),V.EFF(1),V.eux()}if(2&r){const t=e.$implicit,n=e.$index,i=V.XpG();V.AVh("active",i.activeIndex()===n),V.R7$(),V.SpI(" ",t.label()," ")}}let D8=(()=>{class r{tabs=(0,R.tEk)(dI);activeIndex=(0,w.vPA)(0);constructor(){(0,w.QZP)(()=>{const t=this.tabs(),n=this.activeIndex();t.forEach((i,o)=>i.active.set(o===n))})}setActive(t){this.activeIndex.set(t)}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-tabs"]],contentQueries:function(n,i,o){1&n&&V.C6U(o,i.tabs,dI,4),2&n&&V.NyB()},ngContentSelectors:R8,decls:5,vars:0,consts:[[1,"tabs-header"],[1,"tab-button",3,"active"],[1,"tabs-content"],[1,"tab-button",3,"click"]],template:function(n,i){1&n&&(V.NAR(),V.rj2(0,"div",0),V.Z7z(1,k8,2,3,"button",1,P8),V.eux(),V.rj2(3,"div",2),V.SdG(4),V.eux()),2&n&&(V.R7$(),V.Dyx(i.tabs()))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--cue-card-border-radius);border:1px solid var(--cue-card-border-color);background-color:var(--cue-default);color:var(--cue-defaultContrast);box-sizing:border-box;overflow:hidden}.tabs-header[_ngcontent-%COMP%]{display:flex;border-bottom:1px solid var(--cue-card-border-color);background-color:var(--cue-default)}.tab-button[_ngcontent-%COMP%]{padding:10px 16px;background:none;border:none;border-bottom:2px solid transparent;cursor:pointer;color:var(--cue-defaultContrast);font-family:var(--cue-font-family);font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);opacity:.6;transition:opacity .15s,border-bottom-color .15s}.tab-button[_ngcontent-%COMP%]:hover{opacity:.9}.tab-button.active[_ngcontent-%COMP%]{border-bottom-color:var(--cue-accent);opacity:1;font-weight:500}.tabs-content[_ngcontent-%COMP%]{padding:var(--cue-card-padding-y) var(--cue-card-padding-x);flex:1;min-height:0;box-sizing:border-box;display:flex;flex-direction:column}"]})}return r})();var b2=ne(2245);function N8(r,e){1&r&&(V.EFF(0),V.nI1(1,"transloco")),2&r&&V.SpI(" ",V.bMT(1,1,"components.entityData.infoLoading")," ")}function L8(r,e){1&r&&(V.EFF(0),V.nI1(1,"transloco")),2&r&&V.SpI(" ",V.bMT(1,1,"components.entityData.infoNoData")," ")}function O8(r,e){if(1&r&&(V.j41(0,"div",0)(1,"cue-typography",2),V.nVh(2,N8,2,3)(3,L8,2,3),V.k0s()()),2&r){V.XpG();const t=V.r8f(6);V.R7$(2),V.vxM(t?2:3)}}function M8(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-tab",3),V.nI1(1,"transloco"),V.j41(2,"cue-entity-graph",5),V.bIt("clickedOpenEntity",function(i){let o;w.eBV(t);const a=V.XpG(2);return a.clickedOpenEntity.emit(i),w.Njj(null==(o=a.handlers())||null==o.openEntity?null:o.openEntity(i))}),V.k0s()()}if(2&r){V.XpG();const t=V.r8f(1),n=V.XpG(),i=V.r8f(0);V.Y8G("label",V.bMT(1,5,"components.entityData.titleEntityGraph")),V.R7$(2),V.Y8G("entity",t)("availableEntityCategories",n.availableEntityCategories())("availableEntityRelationships",n.availableEntityRelationships())("relationships",i)}}function F8(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-tab",4),V.nI1(1,"transloco"),V.j41(2,"cue-doc-list",6),V.bIt("clickedDocument",function(i){w.eBV(t);const o=V.XpG(2);return w.Njj(o.clickedDocument.emit(i))}),V.k0s()()}if(2&r){const t=V.XpG(2);V.Y8G("label",V.bMT(1,4,"components.entityData.titleRelatedDocuments")),V.R7$(2),V.Y8G("documentRefs",t.documentRefs())("handlers",t.internalDocumentListHandlers())("documentData",t.documentData())}}function V8(r,e){if(1&r){const t=V.RV6();V.j41(0,"cue-tab",4),V.nI1(1,"transloco"),V.j41(2,"div",7)(3,"cue-map",8),V.bIt("clickedFeature",function(i){w.eBV(t);const o=V.XpG(2);return w.Njj(o.mapFeatureClicked.emit(i))}),V.k0s()()()}if(2&r){V.XpG(2);const t=V.r8f(3),n=V.r8f(4);V.Y8G("label",V.bMT(1,3,"components.entityData.titleMap")),V.R7$(3),V.Y8G("layers",t)("settings",n)}}function B8(r,e){if(1&r&&(V.j41(0,"cue-tabs",1),V.SS7(1),V.nVh(2,M8,3,7,"cue-tab",3),V.nVh(3,F8,3,6,"cue-tab",4),V.nVh(4,V8,4,5,"cue-tab",4),V.k0s()),2&r){const t=V.XpG(),n=V.r8f(1),i=V.r8f(2),o=V.r8f(5);V.R7$();const a=V.bH3(t.entity());V.R7$(),V.vxM(n&&a?2:-1),V.R7$(),V.vxM(i?3:-1),V.R7$(),V.vxM(o?4:-1)}}let U8=(()=>{class r{iri=R.hFB.required();availableEntityCategories=R.hFB.required();availableEntityRelationships=(0,R.hFB)([]);mapboxToken=R.hFB.required();handlers=(0,R.hFB)(void 0);clickedOpenEntity=(0,R.CGW)();clickedDocument=(0,R.CGW)();mapFeatureClicked=(0,R.CGW)();relationshipData=(0,R.hFB)(void 0);documentRefs=(0,R.hFB)([]);documentData=(0,R.hFB)({});entityDetailedData=(0,R.hFB)(void 0);_fetchedIRIs=new Set;_mapLayers=(0,w.vPA)([]);_isLoading=(0,w.vPA)(!1);mapSettings=(0,E.EW)(()=>{const t=this.mapboxToken();if(void 0!==t)return{...new Oc.yY,mapboxToken:t}});mapLayers=this._mapLayers.asReadonly();isEntityLoading=this._isLoading.asReadonly();entity=(0,E.EW)(()=>{const t=this.entityDetailedData();return t?{iri:this.iri(),value:t.value,categories:t.categories}:void 0});internalDocumentListHandlers=(0,E.EW)(()=>{const t=this.handlers();return{requestData:n=>{t?.requestDocumentData?.(n)},requestDownload:t?.downloadDocument,requestOpen:t?.openDocument,requestOpenInDir:t?.openDocumentInFileManager}});constructor(){(0,w.QZP)(()=>{const t=this.iri(),n=this.handlers();if(!t||!n||this._fetchedIRIs.has(t))return;this._fetchedIRIs.add(t),this._isLoading.set(!0),this._mapLayers.set([]),n.requestEntityLocations?.([t]);const i=n.requestRelationships?.(t);i?i.then(()=>this._isLoading.set(!1)).catch(()=>this._isLoading.set(!1)):this._isLoading.set(!1)}),(0,w.QZP)(()=>{const t=this.entityDetailedData();if(!t)return;const n=this.iri(),i=function S8({entityData:r,availableEntityRelationships:e}){const t=l=>e.find(u=>u.iri===l)?.label??l.split("#").pop()??l,n=[],i={};for(const[l,u]of Object.entries(r)){for(const c of u.directMapGeometries??[])n.push({iri:l,wkt:c.wkt});for(const c of u.indirectMapGeometries??[]){i[c.rel]||(i[c.rel]=[]);for(const d of c.geometries)i[c.rel].push({iri:c.entityUUID,wkt:d.wkt})}}const o=(l,u,c)=>{if(!u.length)return null;const d=new Oc.ux(l,l);return d.category=c,d.collection=new as.o(u.flatMap(({iri:h,wkt:f})=>{const g=(0,w2.S)(f);return g?[{type:"Feature",geometry:(0,w2.n)(g),properties:{iri:h}}]:[]})),d},a=[],s=o("direct",n,"Direct");s&&a.push(s);for(const[l,u]of Object.entries(i)){const c=t(l),d=o(c,u,c);d&&a.push(d)}return a}({entityData:{[n]:t},availableEntityRelationships:this.availableEntityRelationships()});this._mapLayers.set(i)})}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-entity-data"]],inputs:{iri:[1,"iri"],availableEntityCategories:[1,"availableEntityCategories"],availableEntityRelationships:[1,"availableEntityRelationships"],mapboxToken:[1,"mapboxToken"],handlers:[1,"handlers"],relationshipData:[1,"relationshipData"],documentRefs:[1,"documentRefs"],documentData:[1,"documentData"],entityDetailedData:[1,"entityDetailedData"]},outputs:{clickedOpenEntity:"clickedOpenEntity",clickedDocument:"clickedDocument",mapFeatureClicked:"mapFeatureClicked"},decls:9,vars:8,consts:[[2,"height","400px","width","100%","display","flex","align-items","center","justify-content","center","background","var(--cue-color-background-subtle, #f8f9fa)","border-radius","4px"],[2,"width","100%","flex","1","min-height","400px","height","100%"],[2,"text-align","center","color","var(--cue-color-text-muted, #6c757d)"],[2,"height","100%",3,"label"],[3,"label"],["legendPosition","top-right",2,"flex","1","min-height","400px","width","100%",3,"clickedOpenEntity","entity","availableEntityCategories","availableEntityRelationships","relationships"],[3,"clickedDocument","documentRefs","handlers","documentData"],[2,"display","flex","flex-direction","column","flex","1","min-height","400px","width","100%","position","relative"],[2,"width","100%",3,"clickedFeature","layers","settings"]],template:function(n,i){if(1&n&&(V.SS7(0)(1)(2)(3)(4)(5)(6),V.nVh(7,O8,4,1,"div",0)(8,B8,5,4,"cue-tabs",1)),2&n){const o=V.bH3(i.relationshipData());V.R7$();const a=V.bH3(o&&o.incoming.length+o.outgoing.length>0);V.R7$();const s=V.bH3(i.documentRefs().length>0);V.R7$();const l=V.bH3(i.mapLayers());V.R7$();const u=V.bH3(i.mapSettings());V.R7$();const c=V.bH3(void 0!==u&&l.length>0);V.R7$(),V.bH3(i.isEntityLoading()),V.R7$(),V.vxM(a||s||c?8:7)}},dependencies:[O9,P5.g,D8,dI,A8,b2.Typography,Jo.Kj],styles:["[_nghost-%COMP%]{display:contents}"],changeDetection:0})}return r})();var z8=ne(2403);function G8(r,e){if(1&r&&(V.j41(0,"cue-flexcontainer",4)(1,"cue-typography",5),V.EFF(2),V.k0s()()),2&r){const t=V.XpG(2);V.R7$(2),V.SpI(" ",t.errorMessage()," ")}}function q8(r,e){1&r&&(V.j41(0,"cue-flexcontainer",4)(1,"cue-typography",6),V.EFF(2," No project connected. "),V.k0s()())}function j8(r,e){1&r&&(V.j41(0,"cue-flexcontainer",4)(1,"cue-typography",6),V.EFF(2," No entity selected. "),V.k0s()())}function $8(r,e){if(1&r&&V.nrm(0,"cue-entity-info",7),2&r){V.XpG();const t=V.r8f(0),n=V.XpG(2);V.Y8G("entity",t)("entityCategoriesEditable",!1)("availableEntityCategories",n.availableEntityCategories())("collapsed",!1)("handlers",n._entityInfoHandlers)}}function H8(r,e){1&r&&(V.j41(0,"cue-typography",8),V.EFF(1),V.nI1(2,"transloco"),V.k0s()),2&r&&(V.Y8G("cuePulse",!0),V.R7$(),V.JRh(V.bMT(2,2,"common.infoLoading")))}function W8(r,e){if(1&r&&(V.SS7(0),V.nVh(1,$8,1,5,"cue-entity-info",7)(2,H8,3,4,"cue-typography",8),V.nrm(3,"div",9),V.j41(4,"div",10),V.nrm(5,"cue-entity-data",11),V.k0s()),2&r){const t=V.XpG(2),n=V.bH3(t._entity());V.R7$(),V.vxM(n?1:2),V.R7$(4),V.Y8G("iri",t._currentIri())("availableEntityCategories",t.availableEntityCategories())("availableEntityRelationships",t.availableEntityRelationships())("mapboxToken",t.mapboxToken()??"")("handlers",t._entityDataHandlers())("relationshipData",t.relationshipData())("documentRefs",t.documentRefs())("documentData",t.documentData())("entityDetailedData",t.entityData())}}function X8(r,e){if(1&r&&(V.j41(0,"div",3),V.nVh(1,G8,3,1,"cue-flexcontainer",4)(2,q8,3,0,"cue-flexcontainer",4)(3,j8,3,0,"cue-flexcontainer",4)(4,W8,6,11),V.k0s()),2&r){const t=V.XpG();V.R7$(),V.vxM("error"===t.state()?1:"idle"===t.state()?2:"no-entity"===t.state()?3:t._currentIri()?4:-1)}}function K8(r,e){if(1&r&&(V.j41(0,"cue-card",1),V.eu8(1,2),V.k0s()),2&r){const t=V.XpG(),n=V.sdS(1);V.Y8G("variant",t._cardVariant())("padded",!0),V.R7$(),V.Y8G("ngTemplateOutlet",n)}}function Y8(r,e){if(1&r&&V.eu8(0,2),2&r){V.XpG();const t=V.sdS(1);V.Y8G("ngTemplateOutlet",t)}}function hI(r){return r.split("/").pop()}function Q8(r){return{id:r.id,contentIRI:r.contentIRI??r.id,path:r.path??"",suffix:r.suffix??"",size:r.size??0,tags:r.tags??[],summary:r.summary??"",categories:r.categories??[],subject:r.subject,providerId:r.providerId,relevance:0}}let J8=(()=>{class r{cue=(0,R.hFB)(void 0);projectId=(0,R.hFB)(void 0);iri=(0,R.hFB)(void 0);mapboxToken=(0,R.hFB)(void 0);variant=(0,R.hFB)("none");_cardVariant=(0,E.EW)(()=>this.variant());openEntity=(0,R.CGW)();state=(0,w.vPA)("idle");errorMessage=(0,w.vPA)(null);availableEntityCategories=(0,w.vPA)([]);availableEntityRelationships=(0,w.vPA)([]);relationshipData=(0,w.vPA)(void 0);documentRefs=(0,w.vPA)([]);documentData=(0,w.vPA)({});entityData=(0,w.vPA)(void 0);_entities=(0,w.vPA)(void 0);_documents=(0,w.vPA)(void 0);_unsubscribeEntities;_unsubscribeDocuments;_unsubscribeSchema;_lastIri;_currentIri=(0,E.EW)(()=>this.iri());_entity=(0,E.EW)(()=>{const t=this.entityData();return t?{iri:this.iri(),value:t.value,categories:t.categories}:void 0});_entityInfoHandlers={};_entityDataHandlers=(0,E.EW)(()=>{var t=this;const n=this._entities(),i=this._documents();return{requestRelationships:(o=(0,_.A)(function*(a){yield Promise.all([n?.fetchEntityRelationships(a).then(s=>t.relationshipData.set(s)),n?.fetchEntityDocuments(a).then(s=>{t.documentRefs.set(s.map(l=>({id:l}))),i&&s.length>0&&i.requestDocumentData(s)})])}),function(s){return o.apply(this,arguments)}),requestDocumentData:o=>i?.requestDocumentData(o),requestEntityLocations:o=>{const a=o.map(hI).filter(Boolean);n?.requestEntityLocations(a)},openEntity:o=>this.openEntity.emit(o)};var o});constructor(){(0,w.QZP)(()=>{this._setup(this.cue(),this.projectId())}),(0,w.QZP)(()=>{const t=this._entities(),n=this.iri();t&&n&&void 0===this._entity()&&t.requestEntityData([hI(n)],!1)}),(0,w.QZP)(()=>{const t=this._entities(),n=this.iri();!t||!n||(n!==this._lastIri&&(this._lastIri=n,this.relationshipData.set(void 0),this.documentRefs.set([]),this.entityData.set(void 0),this.state.set("ready")),this._syncEntityData(t,n))})}ngOnDestroy(){this._teardown()}_setup(t,n){if(this._teardown(),!t||!n)return this._entities.set(void 0),this._documents.set(void 0),void this.state.set("idle");const i=new t0(t.api,n),o=new Zp(t.api,n);this._entities.set(i),this._documents.set(o),this._lastIri=void 0,this.state.set(this.iri()?"ready":"no-entity"),this._unsubscribeEntities=i.entityInfoMap.subscribe(()=>{const s=this.iri();s&&this._syncEntityData(i,s)}),this._unsubscribeDocuments=o.documentInfoMap.subscribe(()=>{this._syncDocumentData(o)}),i.contentCategoriesInProject(!0).then(s=>this.availableEntityCategories.set(s)).catch(s=>console.error("[cue-entity-viewer] Failed to fetch categories",s));const a=new FR(t.api,n,t.api.language);this._unsubscribeSchema=a.availableEntityRelationships.subscribe(()=>{this.availableEntityRelationships.set(a.availableEntityRelationships.get())})}_syncEntityData(t,n){const i=hI(n),o=t.entityInfoMap.get()[i];if(!o)return;const a=Array.isArray(o.documentRefs)?o.documentRefs.map(u=>"string"==typeof u?{id:u}:u):[],{documentRefs:s,...l}=o;this.entityData.set({...l,documentRefs:a}),a.length>0&&this.documentRefs.set(a)}_syncDocumentData(t){const n=t.documentInfoMap.get(),i={};for(const[o,a]of Object.entries(n))i[o]=Q8(a);this.documentData.set(i)}_teardown(){this._unsubscribeEntities?.(),this._unsubscribeDocuments?.(),this._unsubscribeSchema?.(),this._unsubscribeEntities=void 0,this._unsubscribeDocuments=void 0,this._unsubscribeSchema=void 0}static \u0275fac=function(n){return new(n||r)};static \u0275cmp=V.VBU({type:r,selectors:[["cue-entity-viewer-wc"]],inputs:{cue:[1,"cue"],projectId:[1,"projectId"],iri:[1,"iri"],mapboxToken:[1,"mapboxToken"],variant:[1,"variant"]},outputs:{openEntity:"openEntity"},decls:4,vars:1,consts:[["body",""],[2,"height","100%","width","100%",3,"variant","padded"],[3,"ngTemplateOutlet"],[2,"display","flex","flex-direction","column","height","100%","overflow","hidden","width","100%"],["direction","column","align","center","justify","center",2,"height","100%","width","100%","padding","8px"],[2,"color","#c44","font-size","13px"],[2,"color","#9ca3af","font-size","13px"],[3,"entity","entityCategoriesEditable","availableEntityCategories","collapsed","handlers"],["cuePulseMode","text",3,"cuePulse"],[2,"height","16px"],[2,"flex","1","min-height","0"],[2,"width","100%","height","100%",3,"iri","availableEntityCategories","availableEntityRelationships","mapboxToken","handlers","relationshipData","documentRefs","documentData","entityDetailedData"]],template:function(n,i){1&n&&(V.DNE(0,X8,5,1,"ng-template",null,0,V.C5r),V.nVh(2,K8,2,3,"cue-card",1)(3,Y8,1,1,"ng-container",2)),2&n&&(V.R7$(2),V.vxM("none"!==i.variant()?2:3))},dependencies:[R5,U8,hh.n,b2.Typography,z8.V,h0.Z,d0.T3,Jo.Kj],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}"],changeDetection:0})}return r})()},8846(at){"use strict";at.exports=function Fe(ne){return null===ne||"object"!=typeof ne||null!=ne.toJSON?JSON.stringify(ne):Array.isArray(ne)?"["+ne.reduce((ae,$,D)=>ae+(0===D?"":",")+Fe(void 0===$||"symbol"==typeof $?null:$),"")+"]":"{"+Object.keys(ne).sort().reduce((ae,$,D)=>void 0===ne[$]||"symbol"==typeof ne[$]?ae:ae+(0===ae.length?"":",")+Fe($)+":"+Fe(ne[$]),"")+"}"}},1692(at,Fe,ne){var ae;at.exports=(ae=ne(6556),function($){var D={};function _(R){if(D[R])return D[R].exports;var E=D[R]={i:R,l:!1,exports:{}};return $[R].call(E.exports,E,E.exports,_),E.l=!0,E.exports}return _.m=$,_.c=D,_.i=function(R){return R},_.d=function(R,E,w){_.o(R,E)||Object.defineProperty(R,E,{configurable:!1,enumerable:!0,get:w})},_.n=function(R){var E=R&&R.__esModule?function(){return R.default}:function(){return R};return _.d(E,"a",E),E},_.o=function(R,E){return Object.prototype.hasOwnProperty.call(R,E)},_.p="",_(_.s=7)}([function($,D){$.exports=ae},function($,D,_){"use strict";var R=_(0).FDLayoutConstants;function E(){}for(var w in R)E[w]=R[w];E.DEFAULT_USE_MULTI_LEVEL_SCALING=!1,E.DEFAULT_RADIAL_SEPARATION=R.DEFAULT_EDGE_LENGTH,E.DEFAULT_COMPONENT_SEPERATION=60,E.TILE=!0,E.TILING_PADDING_VERTICAL=10,E.TILING_PADDING_HORIZONTAL=10,E.TREE_REDUCTION_ON_INCREMENTAL=!1,$.exports=E},function($,D,_){"use strict";var R=_(0).FDLayoutEdge;function E(A,B,x){R.call(this,A,B,x)}for(var w in E.prototype=Object.create(R.prototype),R)E[w]=R[w];$.exports=E},function($,D,_){"use strict";var R=_(0).LGraph;function E(A,B,x){R.call(this,A,B,x)}for(var w in E.prototype=Object.create(R.prototype),R)E[w]=R[w];$.exports=E},function($,D,_){"use strict";var R=_(0).LGraphManager;function E(A){R.call(this,A)}for(var w in E.prototype=Object.create(R.prototype),R)E[w]=R[w];$.exports=E},function($,D,_){"use strict";var R=_(0).FDLayoutNode,E=_(0).IMath;function w(B,x,L,Q){R.call(this,B,x,L,Q)}for(var A in w.prototype=Object.create(R.prototype),R)w[A]=R[A];w.prototype.move=function(){var B=this.graphManager.getLayout();this.displacementX=B.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren,this.displacementY=B.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren,Math.abs(this.displacementX)>B.coolingFactor*B.maxNodeDisplacement&&(this.displacementX=B.coolingFactor*B.maxNodeDisplacement*E.sign(this.displacementX)),Math.abs(this.displacementY)>B.coolingFactor*B.maxNodeDisplacement&&(this.displacementY=B.coolingFactor*B.maxNodeDisplacement*E.sign(this.displacementY)),null==this.child||0==this.child.getNodes().length?this.moveBy(this.displacementX,this.displacementY):this.propogateDisplacementToChildren(this.displacementX,this.displacementY),B.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0},w.prototype.propogateDisplacementToChildren=function(B,x){for(var Q,L=this.getChild().getNodes(),j=0;j<L.length;j++)null==(Q=L[j]).getChild()?(Q.moveBy(B,x),Q.displacementX+=B,Q.displacementY+=x):Q.propogateDisplacementToChildren(B,x)},w.prototype.setPred1=function(B){this.pred1=B},w.prototype.getPred1=function(){return pred1},w.prototype.getPred2=function(){return pred2},w.prototype.setNext=function(B){this.next=B},w.prototype.getNext=function(){return next},w.prototype.setProcessed=function(B){this.processed=B},w.prototype.isProcessed=function(){return processed},$.exports=w},function($,D,_){"use strict";var R=_(0).FDLayout,E=_(4),w=_(3),A=_(5),B=_(2),x=_(1),L=_(0).FDLayoutConstants,Q=_(0).LayoutConstants,j=_(0).Point,H=_(0).PointD,oe=_(0).Layout,F=_(0).Integer,te=_(0).IGeometry,k=_(0).LGraph,ie=_(0).Transform;function ee(){R.call(this),this.toBeTiled={}}for(var I in ee.prototype=Object.create(R.prototype),R)ee[I]=R[I];ee.prototype.newGraphManager=function(){var N=new E(this);return this.graphManager=N,N},ee.prototype.newGraph=function(N){return new w(null,this.graphManager,N)},ee.prototype.newNode=function(N){return new A(this.graphManager,N)},ee.prototype.newEdge=function(N){return new B(null,null,N)},ee.prototype.initParameters=function(){R.prototype.initParameters.call(this,arguments),this.isSubLayout||(this.idealEdgeLength=x.DEFAULT_EDGE_LENGTH<10?10:x.DEFAULT_EDGE_LENGTH,this.useSmartIdealEdgeLengthCalculation=x.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.springConstant=L.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=L.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=L.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=L.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=L.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=L.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.prunedNodesAll=[],this.growTreeIterations=0,this.afterGrowthIterations=0,this.isTreeGrowing=!1,this.isGrowthFinished=!1,this.coolingCycle=0,this.maxCoolingCycle=this.maxIterations/L.CONVERGENCE_CHECK_PERIOD,this.finalTemperature=L.CONVERGENCE_CHECK_PERIOD/this.maxIterations,this.coolingAdjuster=1)},ee.prototype.layout=function(){return Q.DEFAULT_CREATE_BENDS_AS_NEEDED&&(this.createBendpoints(),this.graphManager.resetAllEdges()),this.level=0,this.classicLayout()},ee.prototype.classicLayout=function(){if(this.nodesWithGravity=this.calculateNodesToApplyGravitationTo(),this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity),this.calcNoOfChildrenForAllNodes(),this.graphManager.calcLowestCommonAncestors(),this.graphManager.calcInclusionTreeDepths(),this.graphManager.getRoot().calcEstimatedSize(),this.calcIdealEdgeLengths(),this.incremental){if(x.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation();var z=new Set(this.getAllNodes()),re=this.nodesWithGravity.filter(function(se){return z.has(se)});this.graphManager.setAllNodesToApplyGravitation(re)}}else{var N=this.getFlatForest();N.length>0?this.positionNodesRadially(N):(this.reduceTrees(),this.graphManager.resetAllNodesToApplyGravitation(),z=new Set(this.getAllNodes()),re=this.nodesWithGravity.filter(function(de){return z.has(de)}),this.graphManager.setAllNodesToApplyGravitation(re),this.positionNodesRandomly())}return this.initSpringEmbedder(),this.runSpringEmbedder(),!0},ee.prototype.tick=function(){if(this.totalIterations++,this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}if(this.totalIterations%L.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(!(this.prunedNodesAll.length>0))return!0;this.isTreeGrowing=!0}this.coolingCycle++,0==this.layoutQuality?this.coolingAdjuster=this.coolingCycle:1==this.layoutQuality&&(this.coolingAdjuster=this.coolingCycle/3),this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature),this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0)if(this.prunedNodesAll.length>0){this.graphManager.updateBounds(),this.updateGrid(),this.growTree(this.prunedNodesAll),this.graphManager.resetAllNodesToApplyGravitation();var N=new Set(this.getAllNodes()),z=this.nodesWithGravity.filter(function(pe){return N.has(pe)});this.graphManager.setAllNodesToApplyGravitation(z),this.graphManager.updateBounds(),this.updateGrid(),this.coolingFactor=L.DEFAULT_COOLING_FACTOR_INCREMENTAL}else this.isTreeGrowing=!1,this.isGrowthFinished=!0;this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged())return!0;this.afterGrowthIterations%10==0&&(this.graphManager.updateBounds(),this.updateGrid()),this.coolingFactor=L.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100),this.afterGrowthIterations++}var re=!this.isTreeGrowing&&!this.isGrowthFinished,de=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;return this.totalDisplacement=0,this.graphManager.updateBounds(),this.calcSpringForces(),this.calcRepulsionForces(re,de),this.calcGravitationalForces(),this.moveNodes(),this.animate(),!1},ee.prototype.getPositionsData=function(){for(var N=this.graphManager.getAllNodes(),z={},re=0;re<N.length;re++){var de=N[re].rect,pe=N[re].id;z[pe]={id:pe,x:de.getCenterX(),y:de.getCenterY(),w:de.width,h:de.height}}return z},ee.prototype.runSpringEmbedder=function(){this.initialAnimationPeriod=25,this.animationPeriod=this.initialAnimationPeriod;var N=!1;if("during"===L.ANIMATE)this.emit("layoutstarted");else{for(;!N;)N=this.tick();this.graphManager.updateBounds()}},ee.prototype.calculateNodesToApplyGravitationTo=function(){var z,pe,N=[],re=this.graphManager.getGraphs(),de=re.length;for(pe=0;pe<de;pe++)(z=re[pe]).updateConnected(),z.isConnected||(N=N.concat(z.getNodes()));return N},ee.prototype.createBendpoints=function(){var N=[];N=N.concat(this.graphManager.getAllEdges());var re,z=new Set;for(re=0;re<N.length;re++){var de=N[re];if(!z.has(de)){var pe=de.getSource(),se=de.getTarget();if(pe==se)de.getBendpoints().push(new H),de.getBendpoints().push(new H),this.createDummyNodesForBendpoints(de),z.add(de);else{var fe=[];if(fe=(fe=fe.concat(pe.getEdgeListToNode(se))).concat(se.getEdgeListToNode(pe)),!z.has(fe[0])){var Pe;if(fe.length>1)for(Pe=0;Pe<fe.length;Pe++){var xe=fe[Pe];xe.getBendpoints().push(new H),this.createDummyNodesForBendpoints(xe)}fe.forEach(function(Ne){z.add(Ne)})}}}if(z.size==N.length)break}},ee.prototype.positionNodesRadially=function(N){for(var z=new j(0,0),re=Math.ceil(Math.sqrt(N.length)),de=0,pe=0,se=0,fe=new H(0,0),Pe=0;Pe<N.length;Pe++){Pe%re==0&&(se=0,pe=de,0!=Pe&&(pe+=x.DEFAULT_COMPONENT_SEPERATION),de=0);var xe=N[Pe],Ne=oe.findCenterOfTree(xe);z.x=se,z.y=pe,(fe=ee.radialLayout(xe,Ne,z)).y>de&&(de=Math.floor(fe.y)),se=Math.floor(fe.x+x.DEFAULT_COMPONENT_SEPERATION)}this.transform(new H(Q.WORLD_CENTER_X-fe.x/2,Q.WORLD_CENTER_Y-fe.y/2))},ee.radialLayout=function(N,z,re){var de=Math.max(this.maxDiagonalInTree(N),x.DEFAULT_RADIAL_SEPARATION);ee.branchRadialLayout(z,null,0,359,0,de);var pe=k.calculateBounds(N),se=new ie;se.setDeviceOrgX(pe.getMinX()),se.setDeviceOrgY(pe.getMinY()),se.setWorldOrgX(re.x),se.setWorldOrgY(re.y);for(var fe=0;fe<N.length;fe++)N[fe].transform(se);var xe=new H(pe.getMaxX(),pe.getMaxY());return se.inverseTransformPoint(xe)},ee.branchRadialLayout=function(N,z,re,de,pe,se){var fe=(de-re+1)/2;fe<0&&(fe+=180);var xe=(fe+re)%360*te.TWO_PI/360,tt=(Math.cos(xe),pe*Math.cos(xe)),Ie=pe*Math.sin(xe);N.setCenter(tt,Ie);var he=[],ye=(he=he.concat(N.getEdges())).length;null!=z&&ye--;for(var ge,Ke=0,Ve=he.length,et=N.getEdgesBetween(z);et.length>1;){var ct=et[0];et.splice(0,1);var gt=he.indexOf(ct);gt>=0&&he.splice(gt,1),Ve--,ye--}ge=null!=z?(he.indexOf(et[0])+1)%Ve:0;for(var Tt=Math.abs(de-re)/ye,Qe=ge;Ke!=ye;Qe=++Qe%Ve){var st=he[Qe].getOtherEnd(N);if(st!=z){var Le=(re+Ke*Tt)%360;ee.branchRadialLayout(st,N,Le,(Le+Tt)%360,pe+se,se),Ke++}}},ee.maxDiagonalInTree=function(N){for(var z=F.MIN_VALUE,re=0;re<N.length;re++){var pe=N[re].getDiagonal();pe>z&&(z=pe)}return z},ee.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength},ee.prototype.groupZeroDegreeMembers=function(){var N=this,z={};this.memberGroups={},this.idToDummyNode={};for(var re=[],de=this.graphManager.getAllNodes(),pe=0;pe<de.length;pe++){var fe=(se=de[pe]).getParent();0===this.getNodeDegreeWithChildren(se)&&(null==fe.id||!this.getToBeTiled(fe))&&re.push(se)}for(pe=0;pe<re.length;pe++){var se,Pe=(se=re[pe]).getParent().id;typeof z[Pe]>"u"&&(z[Pe]=[]),z[Pe]=z[Pe].concat(se)}Object.keys(z).forEach(function(xe){if(z[xe].length>1){var Ne="DummyCompound_"+xe;N.memberGroups[Ne]=z[xe];var tt=z[xe][0].getParent(),Ie=new A(N.graphManager);Ie.id=Ne,Ie.paddingLeft=tt.paddingLeft||0,Ie.paddingRight=tt.paddingRight||0,Ie.paddingBottom=tt.paddingBottom||0,Ie.paddingTop=tt.paddingTop||0,N.idToDummyNode[Ne]=Ie;var he=N.getGraphManager().add(N.newGraph(),Ie),ye=tt.getChild();ye.add(Ie);for(var Ke=0;Ke<z[xe].length;Ke++){var Ve=z[xe][Ke];ye.remove(Ve),he.add(Ve)}}})},ee.prototype.clearCompounds=function(){var N={},z={};this.performDFSOnCompounds();for(var re=0;re<this.compoundOrder.length;re++)z[this.compoundOrder[re].id]=this.compoundOrder[re],N[this.compoundOrder[re].id]=[].concat(this.compoundOrder[re].getChild().getNodes()),this.graphManager.remove(this.compoundOrder[re].getChild()),this.compoundOrder[re].child=null;this.graphManager.resetAllNodes(),this.tileCompoundMembers(N,z)},ee.prototype.clearZeroDegreeMembers=function(){var N=this,z=this.tiledZeroDegreePack=[];Object.keys(this.memberGroups).forEach(function(re){var de=N.idToDummyNode[re];z[re]=N.tileNodes(N.memberGroups[re],de.paddingLeft+de.paddingRight),de.rect.width=z[re].width,de.rect.height=z[re].height})},ee.prototype.repopulateCompounds=function(){for(var N=this.compoundOrder.length-1;N>=0;N--){var z=this.compoundOrder[N];this.adjustLocations(this.tiledMemberPack[z.id],z.rect.x,z.rect.y,z.paddingLeft,z.paddingTop)}},ee.prototype.repopulateZeroDegreeMembers=function(){var N=this,z=this.tiledZeroDegreePack;Object.keys(z).forEach(function(re){var de=N.idToDummyNode[re];N.adjustLocations(z[re],de.rect.x,de.rect.y,de.paddingLeft,de.paddingTop)})},ee.prototype.getToBeTiled=function(N){var z=N.id;if(null!=this.toBeTiled[z])return this.toBeTiled[z];var re=N.getChild();if(null==re)return this.toBeTiled[z]=!1,!1;for(var de=re.getNodes(),pe=0;pe<de.length;pe++){var se=de[pe];if(this.getNodeDegree(se)>0)return this.toBeTiled[z]=!1,!1;if(null!=se.getChild()){if(!this.getToBeTiled(se))return this.toBeTiled[z]=!1,!1}else this.toBeTiled[se.id]=!1}return this.toBeTiled[z]=!0,!0},ee.prototype.getNodeDegree=function(N){for(var re=N.getEdges(),de=0,pe=0;pe<re.length;pe++){var se=re[pe];se.getSource().id!==se.getTarget().id&&(de+=1)}return de},ee.prototype.getNodeDegreeWithChildren=function(N){var z=this.getNodeDegree(N);if(null==N.getChild())return z;for(var re=N.getChild().getNodes(),de=0;de<re.length;de++)z+=this.getNodeDegreeWithChildren(re[de]);return z},ee.prototype.performDFSOnCompounds=function(){this.compoundOrder=[],this.fillCompexOrderByDFS(this.graphManager.getRoot().getNodes())},ee.prototype.fillCompexOrderByDFS=function(N){for(var z=0;z<N.length;z++){var re=N[z];null!=re.getChild()&&this.fillCompexOrderByDFS(re.getChild().getNodes()),this.getToBeTiled(re)&&this.compoundOrder.push(re)}},ee.prototype.adjustLocations=function(N,z,re,de,pe){re+=pe;for(var se=z+=de,fe=0;fe<N.rows.length;fe++){var Pe=N.rows[fe];z=se;for(var xe=0,Ne=0;Ne<Pe.length;Ne++){var tt=Pe[Ne];tt.rect.x=z,tt.rect.y=re,z+=tt.rect.width+N.horizontalPadding,tt.rect.height>xe&&(xe=tt.rect.height)}re+=xe+N.verticalPadding}},ee.prototype.tileCompoundMembers=function(N,z){var re=this;this.tiledMemberPack=[],Object.keys(N).forEach(function(de){var pe=z[de];re.tiledMemberPack[de]=re.tileNodes(N[de],pe.paddingLeft+pe.paddingRight),pe.rect.width=re.tiledMemberPack[de].width,pe.rect.height=re.tiledMemberPack[de].height})},ee.prototype.tileNodes=function(N,z){var pe={rows:[],rowWidth:[],rowHeight:[],width:0,height:z,verticalPadding:x.TILING_PADDING_VERTICAL,horizontalPadding:x.TILING_PADDING_HORIZONTAL};N.sort(function(Pe,xe){return Pe.rect.width*Pe.rect.height>xe.rect.width*xe.rect.height?-1:Pe.rect.width*Pe.rect.height<xe.rect.width*xe.rect.height?1:0});for(var se=0;se<N.length;se++){var fe=N[se];0==pe.rows.length?this.insertNodeToRow(pe,fe,0,z):this.canAddHorizontal(pe,fe.rect.width,fe.rect.height)?this.insertNodeToRow(pe,fe,this.getShortestRowIndex(pe),z):this.insertNodeToRow(pe,fe,pe.rows.length,z),this.shiftToLastRow(pe)}return pe},ee.prototype.insertNodeToRow=function(N,z,re,de){var pe=de;re==N.rows.length&&(N.rows.push([]),N.rowWidth.push(pe),N.rowHeight.push(0));var fe=N.rowWidth[re]+z.rect.width;N.rows[re].length>0&&(fe+=N.horizontalPadding),N.rowWidth[re]=fe,N.width<fe&&(N.width=fe);var Pe=z.rect.height;re>0&&(Pe+=N.verticalPadding);var xe=0;Pe>N.rowHeight[re]&&(xe=N.rowHeight[re],N.rowHeight[re]=Pe,xe=N.rowHeight[re]-xe),N.height+=xe,N.rows[re].push(z)},ee.prototype.getShortestRowIndex=function(N){for(var z=-1,re=Number.MAX_VALUE,de=0;de<N.rows.length;de++)N.rowWidth[de]<re&&(z=de,re=N.rowWidth[de]);return z},ee.prototype.getLongestRowIndex=function(N){for(var z=-1,re=Number.MIN_VALUE,de=0;de<N.rows.length;de++)N.rowWidth[de]>re&&(z=de,re=N.rowWidth[de]);return z},ee.prototype.canAddHorizontal=function(N,z,re){var de=this.getShortestRowIndex(N);if(de<0)return!0;var pe=N.rowWidth[de];if(pe+N.horizontalPadding+z<=N.width)return!0;var fe,Pe,se=0;return N.rowHeight[de]<re&&de>0&&(se=re+N.verticalPadding-N.rowHeight[de]),fe=N.width-pe>=z+N.horizontalPadding?(N.height+se)/(pe+z+N.horizontalPadding):(N.height+se)/N.width,se=re+N.verticalPadding,(Pe=N.width<z?(N.height+se)/z:(N.height+se)/N.width)<1&&(Pe=1/Pe),fe<1&&(fe=1/fe),fe<Pe},ee.prototype.shiftToLastRow=function(N){var z=this.getLongestRowIndex(N),re=N.rowWidth.length-1,de=N.rows[z],pe=de[de.length-1],se=pe.width+N.horizontalPadding;if(N.width-N.rowWidth[re]>se&&z!=re){de.splice(-1,1),N.rows[re].push(pe),N.rowWidth[z]=N.rowWidth[z]-se,N.rowWidth[re]=N.rowWidth[re]+se,N.width=N.rowWidth[instance.getLongestRowIndex(N)];for(var fe=Number.MIN_VALUE,Pe=0;Pe<de.length;Pe++)de[Pe].height>fe&&(fe=de[Pe].height);z>0&&(fe+=N.verticalPadding);var xe=N.rowHeight[z]+N.rowHeight[re];N.rowHeight[z]=fe,N.rowHeight[re]<pe.height+N.verticalPadding&&(N.rowHeight[re]=pe.height+N.verticalPadding),N.height+=N.rowHeight[z]+N.rowHeight[re]-xe,this.shiftToLastRow(N)}},ee.prototype.tilingPreLayout=function(){x.TILE&&(this.groupZeroDegreeMembers(),this.clearCompounds(),this.clearZeroDegreeMembers())},ee.prototype.tilingPostLayout=function(){x.TILE&&(this.repopulateZeroDegreeMembers(),this.repopulateCompounds())},ee.prototype.reduceTrees=function(){for(var re,N=[],z=!0;z;){var de=this.graphManager.getAllNodes(),pe=[];z=!1;for(var se=0;se<de.length;se++)1==(re=de[se]).getEdges().length&&!re.getEdges()[0].isInterGraph&&null==re.getChild()&&(pe.push([re,re.getEdges()[0],re.getOwner()]),z=!0);if(1==z){for(var fe=[],Pe=0;Pe<pe.length;Pe++)1==pe[Pe][0].getEdges().length&&(fe.push(pe[Pe]),pe[Pe][0].getOwner().remove(pe[Pe][0]));N.push(fe),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()}}this.prunedNodesAll=N},ee.prototype.growTree=function(N){for(var de,re=N[N.length-1],pe=0;pe<re.length;pe++)this.findPlaceforPrunedNode(de=re[pe]),de[2].add(de[0]),de[2].add(de[1],de[1].source,de[1].target);N.splice(N.length-1,1),this.graphManager.resetAllNodes(),this.graphManager.resetAllEdges()},ee.prototype.findPlaceforPrunedNode=function(N){var z,re,de=N[0],pe=(re=de==N[1].source?N[1].target:N[1].source).startX,se=re.finishX,fe=re.startY,Pe=re.finishY,he=[0,0,0,0];if(fe>0)for(var ye=pe;ye<=se;ye++)he[0]+=this.grid[ye][fe-1].length+this.grid[ye][fe].length-1;if(se<this.grid.length-1)for(ye=fe;ye<=Pe;ye++)he[1]+=this.grid[se+1][ye].length+this.grid[se][ye].length-1;if(Pe<this.grid[0].length-1)for(ye=pe;ye<=se;ye++)he[2]+=this.grid[ye][Pe+1].length+this.grid[ye][Pe].length-1;if(pe>0)for(ye=fe;ye<=Pe;ye++)he[3]+=this.grid[pe-1][ye].length+this.grid[pe][ye].length-1;for(var Ve,ge,Ke=F.MAX_VALUE,et=0;et<he.length;et++)he[et]<Ke?(Ke=he[et],Ve=1,ge=et):he[et]==Ke&&Ve++;if(3==Ve&&0==Ke)0==he[0]&&0==he[1]&&0==he[2]?z=1:0==he[0]&&0==he[1]&&0==he[3]?z=0:0==he[0]&&0==he[2]&&0==he[3]?z=3:0==he[1]&&0==he[2]&&0==he[3]&&(z=2);else if(2==Ve&&0==Ke){var ct=Math.floor(2*Math.random());z=0==he[0]&&0==he[1]?0==ct?0:1:0==he[0]&&0==he[2]?0==ct?0:2:0==he[0]&&0==he[3]?0==ct?0:3:0==he[1]&&0==he[2]?0==ct?1:2:0==he[1]&&0==he[3]?0==ct?1:3:0==ct?2:3}else z=4==Ve&&0==Ke?ct=Math.floor(4*Math.random()):ge;0==z?de.setCenter(re.getCenterX(),re.getCenterY()-re.getHeight()/2-L.DEFAULT_EDGE_LENGTH-de.getHeight()/2):1==z?de.setCenter(re.getCenterX()+re.getWidth()/2+L.DEFAULT_EDGE_LENGTH+de.getWidth()/2,re.getCenterY()):2==z?de.setCenter(re.getCenterX(),re.getCenterY()+re.getHeight()/2+L.DEFAULT_EDGE_LENGTH+de.getHeight()/2):de.setCenter(re.getCenterX()-re.getWidth()/2-L.DEFAULT_EDGE_LENGTH-de.getWidth()/2,re.getCenterY())},$.exports=ee},function($,D,_){"use strict";var R={};R.layoutBase=_(0),R.CoSEConstants=_(1),R.CoSEEdge=_(2),R.CoSEGraph=_(3),R.CoSEGraphManager=_(4),R.CoSELayout=_(6),R.CoSENode=_(5),$.exports=R}]))},6894(at,Fe,ne){var ae;at.exports=(ae=ne(1692),function($){var D={};function _(R){if(D[R])return D[R].exports;var E=D[R]={i:R,l:!1,exports:{}};return $[R].call(E.exports,E,E.exports,_),E.l=!0,E.exports}return _.m=$,_.c=D,_.i=function(R){return R},_.d=function(R,E,w){_.o(R,E)||Object.defineProperty(R,E,{configurable:!1,enumerable:!0,get:w})},_.n=function(R){var E=R&&R.__esModule?function(){return R.default}:function(){return R};return _.d(E,"a",E),E},_.o=function(R,E){return Object.prototype.hasOwnProperty.call(R,E)},_.p="",_(_.s=1)}([function($,D){$.exports=ae},function($,D,_){"use strict";var R=_(0).layoutBase.LayoutConstants,E=_(0).layoutBase.FDLayoutConstants,w=_(0).CoSEConstants,A=_(0).CoSELayout,B=_(0).CoSENode,x=_(0).layoutBase.PointD,L=_(0).layoutBase.DimensionD,Q={ready:function(){},stop:function(){},quality:"default",nodeDimensionsIncludeLabels:!1,refresh:30,fit:!0,padding:10,randomize:!0,nodeRepulsion:4500,idealEdgeLength:50,edgeElasticity:.45,nestingFactor:.1,gravity:.25,numIter:2500,tile:!0,animate:"end",animationDuration:500,tilingPaddingVertical:10,tilingPaddingHorizontal:10,gravityRangeCompound:1.5,gravityCompound:1,gravityRange:3.8,initialEnergyOnIncremental:.5};function H(te){this.options=function j(te,k){var ie={};for(var ee in te)ie[ee]=te[ee];for(var ee in k)ie[ee]=k[ee];return ie}(Q,te),oe(this.options)}var oe=function(k){null!=k.nodeRepulsion&&(w.DEFAULT_REPULSION_STRENGTH=E.DEFAULT_REPULSION_STRENGTH=k.nodeRepulsion),null!=k.idealEdgeLength&&(w.DEFAULT_EDGE_LENGTH=E.DEFAULT_EDGE_LENGTH=k.idealEdgeLength),null!=k.edgeElasticity&&(w.DEFAULT_SPRING_STRENGTH=E.DEFAULT_SPRING_STRENGTH=k.edgeElasticity),null!=k.nestingFactor&&(w.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=E.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=k.nestingFactor),null!=k.gravity&&(w.DEFAULT_GRAVITY_STRENGTH=E.DEFAULT_GRAVITY_STRENGTH=k.gravity),null!=k.numIter&&(w.MAX_ITERATIONS=E.MAX_ITERATIONS=k.numIter),null!=k.gravityRange&&(w.DEFAULT_GRAVITY_RANGE_FACTOR=E.DEFAULT_GRAVITY_RANGE_FACTOR=k.gravityRange),null!=k.gravityCompound&&(w.DEFAULT_COMPOUND_GRAVITY_STRENGTH=E.DEFAULT_COMPOUND_GRAVITY_STRENGTH=k.gravityCompound),null!=k.gravityRangeCompound&&(w.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=E.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=k.gravityRangeCompound),null!=k.initialEnergyOnIncremental&&(w.DEFAULT_COOLING_FACTOR_INCREMENTAL=E.DEFAULT_COOLING_FACTOR_INCREMENTAL=k.initialEnergyOnIncremental),R.QUALITY="draft"==k.quality?0:"proof"==k.quality?2:1,w.NODE_DIMENSIONS_INCLUDE_LABELS=E.NODE_DIMENSIONS_INCLUDE_LABELS=R.NODE_DIMENSIONS_INCLUDE_LABELS=k.nodeDimensionsIncludeLabels,w.DEFAULT_INCREMENTAL=E.DEFAULT_INCREMENTAL=R.DEFAULT_INCREMENTAL=!k.randomize,w.ANIMATE=E.ANIMATE=R.ANIMATE=k.animate,w.TILE=k.tile,w.TILING_PADDING_VERTICAL="function"==typeof k.tilingPaddingVertical?k.tilingPaddingVertical.call():k.tilingPaddingVertical,w.TILING_PADDING_HORIZONTAL="function"==typeof k.tilingPaddingHorizontal?k.tilingPaddingHorizontal.call():k.tilingPaddingHorizontal};H.prototype.run=function(){var te,k,ie=this.options,I=(this.idToLNode={},this.layout=new A),N=this;N.stopped=!1,this.cy=this.options.cy,this.cy.trigger({type:"layoutstart",layout:this});var z=I.newGraphManager();this.gm=z;var re=this.options.eles.nodes(),de=this.options.eles.edges();this.root=z.addRoot(),this.processChildrenList(this.root,this.getTopMostNodes(re),I);for(var pe=0;pe<de.length;pe++){var se=de[pe],fe=this.idToLNode[se.data("source")],Pe=this.idToLNode[se.data("target")];fe!==Pe&&0==fe.getEdgesBetween(Pe).length&&(z.add(I.newEdge(),fe,Pe).id=se.id())}var Ne=function(he,ye){"number"==typeof he&&(he=ye);var Ke=he.data("id"),Ve=N.idToLNode[Ke];return{x:Ve.getRect().getCenterX(),y:Ve.getRect().getCenterY()}},tt=function Ie(){for(var Ke,he=function(){ie.fit&&ie.cy.fit(ie.eles,ie.padding),te||(te=!0,N.cy.one("layoutready",ie.ready),N.cy.trigger({type:"layoutready",layout:N}))},ye=N.options.refresh,Ve=0;Ve<ye&&!Ke;Ve++)Ke=N.stopped||N.layout.tick();if(Ke)return I.checkLayoutSuccess()&&!I.isSubLayout&&I.doPostLayout(),I.tilingPostLayout&&I.tilingPostLayout(),I.isLayoutFinished=!0,N.options.eles.nodes().positions(Ne),he(),N.cy.one("layoutstop",N.options.stop),N.cy.trigger({type:"layoutstop",layout:N}),k&&cancelAnimationFrame(k),void(te=!1);var ge=N.layout.getPositionsData();ie.eles.nodes().positions(function(et,ct){if("number"==typeof et&&(et=ct),!et.isParent()){for(var gt=et.id(),Tt=ge[gt],Qe=et;null==Tt&&(Tt=ge[Qe.data("parent")]||ge["DummyCompound_"+Qe.data("parent")],ge[gt]=Tt,null!=(Qe=Qe.parent()[0])););return null!=Tt?{x:Tt.x,y:Tt.y}:{x:et.position("x"),y:et.position("y")}}}),he(),k=requestAnimationFrame(Ie)};return I.addListener("layoutstarted",function(){"during"===N.options.animate&&(k=requestAnimationFrame(tt))}),I.runLayout(),"during"!==this.options.animate&&(N.options.eles.nodes().not(":parent").layoutPositions(N,N.options,Ne),te=!1),this},H.prototype.getTopMostNodes=function(te){for(var k={},ie=0;ie<te.length;ie++)k[te[ie].id()]=!0;return te.filter(function(I,N){"number"==typeof I&&(I=N);for(var z=I.parent()[0];null!=z;){if(k[z.id()])return!1;z=z.parent()[0]}return!0})},H.prototype.processChildrenList=function(te,k,ie){for(var ee=k.length,I=0;I<ee;I++){var re,Pe,N=k[I],z=N.children(),de=N.layoutDimensions({nodeDimensionsIncludeLabels:this.options.nodeDimensionsIncludeLabels});if((re=null!=N.outerWidth()&&null!=N.outerHeight()?te.add(new B(ie.graphManager,new x(N.position("x")-de.w/2,N.position("y")-de.h/2),new L(parseFloat(de.w),parseFloat(de.h)))):te.add(new B(this.graphManager))).id=N.data("id"),re.paddingLeft=parseInt(N.css("padding")),re.paddingTop=parseInt(N.css("padding")),re.paddingRight=parseInt(N.css("padding")),re.paddingBottom=parseInt(N.css("padding")),this.options.nodeDimensionsIncludeLabels&&N.isParent()){var pe=N.boundingBox({includeLabels:!0,includeNodes:!1}).w,se=N.boundingBox({includeLabels:!0,includeNodes:!1}).h,fe=N.css("text-halign");re.labelWidth=pe,re.labelHeight=se,re.labelPos=fe}this.idToLNode[N.data("id")]=re,isNaN(re.rect.x)&&(re.rect.x=0),isNaN(re.rect.y)&&(re.rect.y=0),null!=z&&z.length>0&&(Pe=ie.getGraphManager().add(ie.newGraph(),re),this.processChildrenList(Pe,z,ie))}},H.prototype.stop=function(){return this.stopped=!0,this};var F=function(k){k("layout","cose-bilkent",H)};typeof cytoscape<"u"&&F(cytoscape),$.exports=F}]))},362(at){"use strict";at.exports=function Fe(ne,ae){if(ne===ae)return!0;if(ne&&ae&&"object"==typeof ne&&"object"==typeof ae){if(ne.constructor!==ae.constructor)return!1;var $,D,_;if(Array.isArray(ne)){if(($=ne.length)!=ae.length)return!1;for(D=$;0!==D--;)if(!Fe(ne[D],ae[D]))return!1;return!0}if(ne.constructor===RegExp)return ne.source===ae.source&&ne.flags===ae.flags;if(ne.valueOf!==Object.prototype.valueOf)return ne.valueOf()===ae.valueOf();if(ne.toString!==Object.prototype.toString)return ne.toString()===ae.toString();if(($=(_=Object.keys(ne)).length)!==Object.keys(ae).length)return!1;for(D=$;0!==D--;)if(!Object.prototype.hasOwnProperty.call(ae,_[D]))return!1;for(D=$;0!==D--;){var R=_[D];if(!Fe(ne[R],ae[R]))return!1}return!0}return ne!=ne&&ae!=ae}},7839(at,Fe,ne){"use strict";var ae=ne(9293).default;const{isArray:$,isObject:D,isString:_}=ne(2831),{asArray:R}=ne(9420),{prependBase:E}=ne(2051),w=ne(262),A=ne(6181);function x(Q){throw new w("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:Q})}function L({context:Q,base:j}){if(!Q)return;const H=Q["@context"];if(_(H))Q["@context"]=E(j,H);else if($(H))for(let oe=0;oe<H.length;++oe){const F=H[oe];_(F)?H[oe]=E(j,F):D(F)&&L({context:{"@context":F},base:j})}else if(D(H))for(const oe in H)L({context:H[oe],base:j})}at.exports=class{constructor({sharedCache:j}){this.perOpCache=new Map,this.sharedCache=j}resolve(j){var H=this;return ae(function*({activeCtx:oe,context:F,documentLoader:te,base:k,cycles:ie=new Set}){F&&D(F)&&F["@context"]&&(F=F["@context"]),F=R(F);const ee=[];for(const I of F){if(_(I)){let re=H._get(I);re||(re=yield H._resolveRemoteContext({activeCtx:oe,url:I,documentLoader:te,base:k,cycles:ie})),$(re)?ee.push(...re):ee.push(re);continue}if(null===I){ee.push(new A({document:null}));continue}D(I)||x(F);const N=JSON.stringify(I);let z=H._get(N);z||(z=new A({document:I}),H._cacheResolvedContext({key:N,resolved:z,tag:"static"})),ee.push(z)}return ee}).apply(this,arguments)}_get(j){let H=this.perOpCache.get(j);if(!H){const oe=this.sharedCache.get(j);oe&&(H=oe.get("static"),H&&this.perOpCache.set(j,H))}return H}_cacheResolvedContext({key:j,resolved:H,tag:oe}){if(this.perOpCache.set(j,H),void 0!==oe){let F=this.sharedCache.get(j);F||(F=new Map,this.sharedCache.set(j,F)),F.set(oe,H)}return H}_resolveRemoteContext(j){var H=this;return ae(function*({activeCtx:oe,url:F,documentLoader:te,base:k,cycles:ie}){F=E(k,F);const{context:ee,remoteDoc:I}=yield H._fetchContext({activeCtx:oe,url:F,documentLoader:te,cycles:ie});L({context:ee,base:k=I.documentUrl||F});const N=yield H.resolve({activeCtx:oe,context:ee,documentLoader:te,base:k,cycles:ie});return H._cacheResolvedContext({key:F,resolved:N,tag:I.tag}),N}).apply(this,arguments)}_fetchContext(j){return ae(function*({activeCtx:H,url:oe,documentLoader:F,cycles:te}){if(te.size>10)throw new w("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===H.processingMode?"loading remote context failed":"context overflow",max:10});if(te.has(oe))throw new w("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===H.processingMode?"recursive context inclusion":"context overflow",url:oe});let k,ie;te.add(oe);try{ie=yield F(oe),k=ie.document||null,_(k)&&(k=JSON.parse(k))}catch(ee){throw new w(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${oe}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:oe,cause:ee})}if(!D(k))throw new w(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${oe}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:oe});return k="@context"in k?{"@context":k["@context"]}:{"@context":{}},ie.contextUrl&&($(k["@context"])||(k["@context"]=[k["@context"]]),k["@context"].push(ie.contextUrl)),{context:k,remoteDoc:ie}}).apply(this,arguments)}}},262(at){"use strict";at.exports=class extends Error{constructor(ne="An unspecified JSON-LD error occurred.",ae="jsonld.Error",$={}){super(ne),this.name=ae,this.message=ne,this.details=$}}},1328(at){"use strict";at.exports=Fe=>{class ne{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(ne,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(ne.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:ne}),ne.compact=function(ae,$){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):Fe.compact(ae,$)},ne.expand=function(ae){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):Fe.expand(ae)},ne.flatten=function(ae){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):Fe.flatten(ae)},ne}},5426(at,Fe,ne){"use strict";at.exports=ne(1224).NQuads},4808(at,Fe,ne){"use strict";var ae=ne(9293).default;at.exports=class{constructor(){this._requests={}}wrapLoader(D){const _=this;return _._loader=D,function(){return _.add.apply(_,arguments)}}add(D){var _=this;return ae(function*(){let R=_._requests[D];if(R)return Promise.resolve(R);R=_._requests[D]=_._loader(D);try{return yield R}finally{delete _._requests[D]}})()}}},6181(at,Fe,ne){"use strict";const ae=ne(3052);at.exports=class{constructor({document:_}){this.document=_,this.cache=new ae({max:10})}getProcessed(_){return this.cache.get(_)}setProcessed(_,R){this.cache.set(_,R)}}},3763(at,Fe,ne){"use strict";var ae=ne(9293).default;const $=ne(262),{isArray:D,isObject:_,isString:R,isUndefined:E}=ne(2831),{isList:w,isValue:A,isGraph:B,isSimpleGraph:x,isSubjectReference:L}=ne(4209),{expandIri:Q,getContextValue:j,isKeyword:H,process:oe,processingMode:F}=ne(429),{removeBase:te,prependBase:k}=ne(2051),{REGEX_KEYWORD:ie,addValue:ee,asArray:I,compareShortestLeast:N}=ne(9420),z={};function de(pe,se,fe){if("@nest"!==Q(pe,se,{vocab:!0},fe))throw new $("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}at.exports=z,z.compact=function(){var pe=ae(function*({activeCtx:se,activeProperty:fe=null,element:Pe,options:xe={}}){if(D(Pe)){let tt=[];for(let Ie=0;Ie<Pe.length;++Ie){const he=yield z.compact({activeCtx:se,activeProperty:fe,element:Pe[Ie],options:xe});null!==he&&tt.push(he)}return xe.compactArrays&&1===tt.length&&0===(j(se,fe,"@container")||[]).length&&(tt=tt[0]),tt}const Ne=j(se,fe,"@context");if(E(Ne)||(se=yield oe({activeCtx:se,localCtx:Ne,propagate:!0,overrideProtected:!0,options:xe})),_(Pe)){if(xe.link&&"@id"in Pe&&xe.link.hasOwnProperty(Pe["@id"])){const et=xe.link[Pe["@id"]];for(let ct=0;ct<et.length;++ct)if(et[ct].expanded===Pe)return et[ct].compacted}if(A(Pe)||L(Pe)){const et=z.compactValue({activeCtx:se,activeProperty:fe,value:Pe,options:xe});return xe.link&&L(Pe)&&(xe.link.hasOwnProperty(Pe["@id"])||(xe.link[Pe["@id"]]=[]),xe.link[Pe["@id"]].push({expanded:Pe,compacted:et})),et}if(w(Pe)&&(j(se,fe,"@container")||[]).includes("@list"))return z.compact({activeCtx:se,activeProperty:fe,element:Pe["@list"],options:xe});const tt="@reverse"===fe,Ie={},he=se;!A(Pe)&&!L(Pe)&&(se=se.revertToPreviousContext());const ye=j(he,fe,"@context");E(ye)||(se=yield oe({activeCtx:se,localCtx:ye,propagate:!0,overrideProtected:!0,options:xe})),xe.link&&"@id"in Pe&&(xe.link.hasOwnProperty(Pe["@id"])||(xe.link[Pe["@id"]]=[]),xe.link[Pe["@id"]].push({expanded:Pe,compacted:Ie}));let Ke=Pe["@type"]||[];Ke.length>1&&(Ke=Array.from(Ke).sort());const Ve=se;for(const et of Ke){const ct=z.compactIri({activeCtx:Ve,iri:et,relativeTo:{vocab:!0}}),gt=j(he,ct,"@context");E(gt)||(se=yield oe({activeCtx:se,localCtx:gt,options:xe,propagate:!1}))}const ge=Object.keys(Pe).sort();for(const et of ge){const ct=Pe[et];if("@id"===et){let gt=I(ct).map(Qe=>z.compactIri({activeCtx:se,iri:Qe,relativeTo:{vocab:!1},base:xe.base}));1===gt.length&&(gt=gt[0]),Ie[z.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=gt;continue}if("@type"===et){let gt=I(ct).map(Ce=>z.compactIri({activeCtx:he,iri:Ce,relativeTo:{vocab:!0}}));1===gt.length&&(gt=gt[0]);const Tt=z.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}}),Le=(j(se,Tt,"@container")||[]).includes("@set")&&F(se,1.1)||D(gt)&&0===ct.length;ee(Ie,Tt,gt,{propertyIsArray:Le});continue}if("@reverse"===et){const gt=yield z.compact({activeCtx:se,activeProperty:"@reverse",element:ct,options:xe});for(const Tt in gt)if(se.mappings.has(Tt)&&se.mappings.get(Tt).reverse){const Qe=gt[Tt],Le=(j(se,Tt,"@container")||[]).includes("@set")||!xe.compactArrays;ee(Ie,Tt,Qe,{propertyIsArray:Le}),delete gt[Tt]}if(Object.keys(gt).length>0){const Tt=z.compactIri({activeCtx:se,iri:et,relativeTo:{vocab:!0}});ee(Ie,Tt,gt)}continue}if("@preserve"===et){const gt=yield z.compact({activeCtx:se,activeProperty:fe,element:ct,options:xe});D(gt)&&0===gt.length||ee(Ie,et,gt);continue}if("@index"===et){if((j(se,fe,"@container")||[]).includes("@index"))continue;const Tt=z.compactIri({activeCtx:se,iri:et,relativeTo:{vocab:!0}});ee(Ie,Tt,ct);continue}if("@graph"!==et&&"@list"!==et&&"@included"!==et&&H(et)){const gt=z.compactIri({activeCtx:se,iri:et,relativeTo:{vocab:!0}});ee(Ie,gt,ct);continue}if(!D(ct))throw new $("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===ct.length){const gt=z.compactIri({activeCtx:se,iri:et,value:ct,relativeTo:{vocab:!0},reverse:tt}),Tt=se.mappings.has(gt)?se.mappings.get(gt)["@nest"]:null;let Qe=Ie;Tt&&(de(se,Tt,xe),_(Ie[Tt])||(Ie[Tt]={}),Qe=Ie[Tt]),ee(Qe,gt,ct,{propertyIsArray:!0})}for(const gt of ct){const Tt=z.compactIri({activeCtx:se,iri:et,value:gt,relativeTo:{vocab:!0},reverse:tt}),Qe=se.mappings.has(Tt)?se.mappings.get(Tt)["@nest"]:null;let st=Ie;Qe&&(de(se,Qe,xe),_(Ie[Qe])||(Ie[Qe]={}),st=Ie[Qe]);const Le=j(se,Tt,"@container")||[],Ce=B(gt),mt=w(gt);let At;mt?At=gt["@list"]:Ce&&(At=gt["@graph"]);let dt=yield z.compact({activeCtx:se,activeProperty:Tt,element:mt||Ce?At:gt,options:xe});if(mt){if(D(dt)||(dt=[dt]),Le.includes("@list")){ee(st,Tt,dt,{valueIsArray:!0,allowDuplicate:!0});continue}dt={[z.compactIri({activeCtx:se,iri:"@list",relativeTo:{vocab:!0}})]:dt},"@index"in gt&&(dt[z.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=gt["@index"])}if(Ce)if(Le.includes("@graph")&&(Le.includes("@id")||Le.includes("@index")&&x(gt))){let Mt;st.hasOwnProperty(Tt)?Mt=st[Tt]:st[Tt]=Mt={};const nr=(Le.includes("@id")?gt["@id"]:gt["@index"])||z.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}});ee(Mt,nr,dt,{propertyIsArray:!xe.compactArrays||Le.includes("@set")})}else Le.includes("@graph")&&x(gt)?(D(dt)&&dt.length>1&&(dt={"@included":dt}),ee(st,Tt,dt,{propertyIsArray:!xe.compactArrays||Le.includes("@set")})):(D(dt)&&1===dt.length&&xe.compactArrays&&(dt=dt[0]),dt={[z.compactIri({activeCtx:se,iri:"@graph",relativeTo:{vocab:!0}})]:dt},"@id"in gt&&(dt[z.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}})]=gt["@id"]),"@index"in gt&&(dt[z.compactIri({activeCtx:se,iri:"@index",relativeTo:{vocab:!0}})]=gt["@index"]),ee(st,Tt,dt,{propertyIsArray:!xe.compactArrays||Le.includes("@set")}));else if(Le.includes("@language")||Le.includes("@index")||Le.includes("@id")||Le.includes("@type")){let Mt,nr;if(st.hasOwnProperty(Tt)?Mt=st[Tt]:st[Tt]=Mt={},Le.includes("@language"))A(dt)&&(dt=dt["@value"]),nr=gt["@language"];else if(Le.includes("@index")){const mr=j(se,Tt,"@index")||"@index",Ct=z.compactIri({activeCtx:se,iri:mr,relativeTo:{vocab:!0}});if("@index"===mr)nr=gt["@index"],delete dt[Ct];else{let pr;if([nr,...pr]=I(dt[mr]||[]),R(nr))switch(pr.length){case 0:delete dt[mr];break;case 1:dt[mr]=pr[0];break;default:dt[mr]=pr}else nr=null}}else if(Le.includes("@id")){const mr=z.compactIri({activeCtx:se,iri:"@id",relativeTo:{vocab:!0}});nr=dt[mr],delete dt[mr]}else if(Le.includes("@type")){const mr=z.compactIri({activeCtx:se,iri:"@type",relativeTo:{vocab:!0}});let Ct;switch([nr,...Ct]=I(dt[mr]||[]),Ct.length){case 0:delete dt[mr];break;case 1:dt[mr]=Ct[0];break;default:dt[mr]=Ct}1===Object.keys(dt).length&&"@id"in gt&&(dt=yield z.compact({activeCtx:se,activeProperty:Tt,element:{"@id":gt["@id"]},options:xe}))}nr||(nr=z.compactIri({activeCtx:se,iri:"@none",relativeTo:{vocab:!0}})),ee(Mt,nr,dt,{propertyIsArray:Le.includes("@set")})}else{const Mt=!xe.compactArrays||Le.includes("@set")||Le.includes("@list")||D(dt)&&0===dt.length||"@list"===et||"@graph"===et;ee(st,Tt,dt,{propertyIsArray:Mt})}}}return Ie}return Pe});return function(se){return pe.apply(this,arguments)}}(),z.compactIri=({activeCtx:pe,iri:se,value:fe=null,relativeTo:Pe={vocab:!1},reverse:xe=!1,base:Ne=null})=>{if(null===se)return se;pe.isPropertyTermScoped&&pe.previousContext&&(pe=pe.previousContext);const tt=pe.getInverse();if(H(se)&&se in tt&&"@none"in tt[se]&&"@type"in tt[se]["@none"]&&"@none"in tt[se]["@none"]["@type"])return tt[se]["@none"]["@type"]["@none"];if(Pe.vocab&&se in tt){const Ve=pe["@language"]||"@none",ge=[];_(fe)&&"@index"in fe&&!("@graph"in fe)&&ge.push("@index","@index@set"),_(fe)&&"@preserve"in fe&&(fe=fe["@preserve"][0]),B(fe)?("@index"in fe&&ge.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in fe&&ge.push("@graph@id","@graph@id@set"),ge.push("@graph","@graph@set","@set"),"@index"in fe||ge.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in fe||ge.push("@graph@id","@graph@id@set")):_(fe)&&!A(fe)&&ge.push("@id","@id@set","@type","@set@type");let et="@language",ct="@null";if(xe)et="@type",ct="@reverse",ge.push("@set");else if(w(fe)){"@index"in fe||ge.push("@list");const Tt=fe["@list"];if(0===Tt.length)et="@any",ct="@none";else{let Qe=0===Tt.length?Ve:null,st=null;for(let Le=0;Le<Tt.length;++Le){const Ce=Tt[Le];let mt="@none",At="@none";if(A(Ce)?"@direction"in Ce?mt=`${(Ce["@language"]||"").toLowerCase()}_${Ce["@direction"]}`:"@language"in Ce?mt=Ce["@language"].toLowerCase():"@type"in Ce?At=Ce["@type"]:mt="@null":At="@id",null===Qe?Qe=mt:mt!==Qe&&A(Ce)&&(Qe="@none"),null===st?st=At:At!==st&&(st="@none"),"@none"===Qe&&"@none"===st)break}Qe=Qe||"@none",st=st||"@none","@none"!==st?(et="@type",ct=st):ct=Qe}}else{if(A(fe))if("@language"in fe&&!("@index"in fe)){ge.push("@language","@language@set"),ct=fe["@language"];const Tt=fe["@direction"];Tt&&(ct=`${ct}_${Tt}`)}else"@direction"in fe&&!("@index"in fe)?ct=`_${fe["@direction"]}`:"@type"in fe&&(et="@type",ct=fe["@type"]);else et="@type",ct="@id";ge.push("@set")}ge.push("@none"),_(fe)&&!("@index"in fe)&&ge.push("@index","@index@set"),A(fe)&&1===Object.keys(fe).length&&ge.push("@language","@language@set");const gt=function re(pe,se,fe,Pe,xe,Ne){null===Ne&&(Ne="@null");const tt=[];if(("@id"===Ne||"@reverse"===Ne)&&_(fe)&&"@id"in fe){"@reverse"===Ne&&tt.push("@reverse");const he=z.compactIri({activeCtx:pe,iri:fe["@id"],relativeTo:{vocab:!0}});pe.mappings.has(he)&&pe.mappings.get(he)&&pe.mappings.get(he)["@id"]===fe["@id"]?tt.push.apply(tt,["@vocab","@id"]):tt.push.apply(tt,["@id","@vocab"])}else{tt.push(Ne);const he=tt.find(ye=>ye.includes("_"));he&&tt.push(he.replace(/^[^_]+_/,"_"))}tt.push("@none");const Ie=pe.inverse[se];for(const he of Pe){if(!(he in Ie))continue;const ye=Ie[he][xe];for(const Ke of tt)if(Ke in ye)return ye[Ke]}return null}(pe,se,fe,ge,et,ct);if(null!==gt)return gt}if(Pe.vocab&&"@vocab"in pe){const Ve=pe["@vocab"];if(0===se.indexOf(Ve)&&se!==Ve){const ge=se.substr(Ve.length);if(!pe.mappings.has(ge))return ge}}let Ie=null;const he=[];let ye=pe.fastCurieMap;const Ke=se.length-1;for(let Ve=0;Ve<Ke&&se[Ve]in ye;++Ve)ye=ye[se[Ve]],""in ye&&he.push(ye[""][0]);for(let Ve=he.length-1;Ve>=0;--Ve){const ge=he[Ve],et=ge.terms;for(const ct of et){const gt=ct+":"+se.substr(ge.iri.length);pe.mappings.get(ct)._prefix&&(!pe.mappings.has(gt)||null===fe&&pe.mappings.get(gt)["@id"]===se)&&(null===Ie||N(gt,Ie)<0)&&(Ie=gt)}}if(null!==Ie)return Ie;for(const[Ve,ge]of pe.mappings)if(ge&&ge._prefix&&se.startsWith(Ve+":"))throw new $(`Absolute IRI "${se}" confused with prefix "${Ve}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:pe});if(!Pe.vocab){if("@base"in pe){if(pe["@base"]){const Ve=te(k(Ne,pe["@base"]),se);return ie.test(Ve)?`./${Ve}`:Ve}return se}return te(Ne,se)}return se},z.compactValue=({activeCtx:pe,activeProperty:se,value:fe,options:Pe})=>{if(A(fe)){const Ie=j(pe,se,"@type"),he=j(pe,se,"@language"),ye=j(pe,se,"@direction"),Ke=j(pe,se,"@container")||[],Ve="@index"in fe&&!Ke.includes("@index");if(!Ve&&"@none"!==Ie&&(fe["@type"]===Ie||"@language"in fe&&fe["@language"]===he&&"@direction"in fe&&fe["@direction"]===ye||"@language"in fe&&fe["@language"]===he||"@direction"in fe&&fe["@direction"]===ye))return fe["@value"];const ge=Object.keys(fe).length,et=1===ge||2===ge&&"@index"in fe&&!Ve,ct="@language"in pe,gt=R(fe["@value"]),Tt=pe.mappings.has(se)&&null===pe.mappings.get(se)["@language"];if(et&&"@none"!==Ie&&(!ct||!gt||Tt))return fe["@value"];const Qe={};return Ve&&(Qe[z.compactIri({activeCtx:pe,iri:"@index",relativeTo:{vocab:!0}})]=fe["@index"]),"@type"in fe?Qe[z.compactIri({activeCtx:pe,iri:"@type",relativeTo:{vocab:!0}})]=z.compactIri({activeCtx:pe,iri:fe["@type"],relativeTo:{vocab:!0}}):"@language"in fe&&(Qe[z.compactIri({activeCtx:pe,iri:"@language",relativeTo:{vocab:!0}})]=fe["@language"]),"@direction"in fe&&(Qe[z.compactIri({activeCtx:pe,iri:"@direction",relativeTo:{vocab:!0}})]=fe["@direction"]),Qe[z.compactIri({activeCtx:pe,iri:"@value",relativeTo:{vocab:!0}})]=fe["@value"],Qe}const xe=Q(pe,se,{vocab:!0},Pe),Ne=j(pe,se,"@type"),tt=z.compactIri({activeCtx:pe,iri:fe["@id"],relativeTo:{vocab:"@vocab"===Ne},base:Pe.base});return"@id"===Ne||"@vocab"===Ne||"@graph"===xe?tt:{[z.compactIri({activeCtx:pe,iri:"@id",relativeTo:{vocab:!0}})]:tt}}},5315(at){"use strict";const Fe="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ne="http://www.w3.org/2001/XMLSchema#";at.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:Fe,RDF_LIST:Fe+"List",RDF_FIRST:Fe+"first",RDF_REST:Fe+"rest",RDF_NIL:Fe+"nil",RDF_TYPE:Fe+"type",RDF_PLAIN_LITERAL:Fe+"PlainLiteral",RDF_XML_LITERAL:Fe+"XMLLiteral",RDF_JSON_LITERAL:Fe+"JSON",RDF_OBJECT:Fe+"object",RDF_LANGSTRING:Fe+"langString",XSD:ne,XSD_BOOLEAN:ne+"boolean",XSD_DOUBLE:ne+"double",XSD_INTEGER:ne+"integer",XSD_STRING:ne+"string"}},429(at,Fe,ne){"use strict";var ae=ne(9293).default;const $=ne(9420),D=ne(262),{isArray:_,isObject:R,isString:E,isUndefined:w}=ne(2831),{isAbsolute:A,isRelative:B,prependBase:x}=ne(2051),{handleEvent:L}=ne(2585),{REGEX_BCP47:Q,REGEX_KEYWORD:j,asArray:H,compareShortestLeast:oe}=ne(9420),F=new Map,k={};function ie(I,N,z,re,de,pe){if(null===N||!E(N)||k.isKeyword(N))return N;if(N.match(j))return null;if(re&&re.hasOwnProperty(N)&&!0!==de.get(N)&&k.createTermDefinition({activeCtx:I,localCtx:re,term:N,defined:de,options:pe}),(z=z||{}).vocab){const fe=I.mappings.get(N);if(null===fe)return null;if(R(fe)&&"@id"in fe)return fe["@id"]}const se=N.indexOf(":");if(se>0){const fe=N.substr(0,se),Pe=N.substr(se+1);if("_"===fe||0===Pe.indexOf("//"))return N;re&&re.hasOwnProperty(fe)&&k.createTermDefinition({activeCtx:I,localCtx:re,term:fe,defined:de,options:pe});const xe=I.mappings.get(fe);if(xe&&xe._prefix)return xe["@id"]+Pe;if(A(N))return N}if(z.vocab&&"@vocab"in I)N=I["@vocab"]+N;else if(z.base){let fe,Pe;"@base"in I?I["@base"]?(Pe=x(pe.base,I["@base"]),fe=x(Pe,N)):(Pe=I["@base"],fe=N):(Pe=pe.base,fe=x(pe.base,N)),N=fe}return N}function ee(I,N){if(!I||"object"!=typeof I||!N||"object"!=typeof N)return I===N;const z=Array.isArray(I);if(z!==Array.isArray(N))return!1;if(z){if(I.length!==N.length)return!1;for(let pe=0;pe<I.length;++pe)if(!ee(I[pe],N[pe]))return!1;return!0}const re=Object.keys(I),de=Object.keys(N);if(re.length!==de.length)return!1;for(const pe in I){let se=I[pe],fe=N[pe];if("@container"===pe&&Array.isArray(se)&&Array.isArray(fe)&&(se=se.slice().sort(),fe=fe.slice().sort()),!ee(se,fe))return!1}return!0}at.exports=k,k.process=function(){var I=ae(function*({activeCtx:N,localCtx:z,options:re,propagate:de=!0,overrideProtected:pe=!1,cycles:se=new Set}){if(R(z)&&"@context"in z&&_(z["@context"])&&(z=z["@context"]),0===H(z).length)return N;const Pe=[],xe=[({event:he,next:ye})=>{Pe.push(he),ye()}];re.eventHandler&&xe.push(re.eventHandler);const Ne=re;re={...re,eventHandler:xe};const tt=yield re.contextResolver.resolve({activeCtx:N,context:z,documentLoader:re.documentLoader,base:re.base});R(tt[0].document)&&"boolean"==typeof tt[0].document["@propagate"]&&(de=tt[0].document["@propagate"]);let Ie=N;!de&&!Ie.previousContext&&(Ie=Ie.clone(),Ie.previousContext=N);for(const he of tt){let{document:ye}=he;if(N=Ie,null===ye){if(!pe&&0!==Object.keys(N.protected).length)throw new D("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});Ie=N=k.getInitialContext(re).clone();continue}const Ke=he.getProcessed(N);if(Ke){if(Ne.eventHandler)for(const ge of Ke.events)L({event:ge,options:Ne});Ie=N=Ke.context;continue}if(R(ye)&&"@context"in ye&&(ye=ye["@context"]),!R(ye))throw new D("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:ye});Ie=Ie.clone();const Ve=new Map;if("@version"in ye){if(1.1!==ye["@version"])throw new D("Unsupported JSON-LD version: "+ye["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:ye});if(N.processingMode&&"json-ld-1.0"===N.processingMode)throw new D("@version: "+ye["@version"]+" not compatible with "+N.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:ye});Ie.processingMode="json-ld-1.1",Ie["@version"]=ye["@version"],Ve.set("@version",!0)}if(Ie.processingMode=Ie.processingMode||N.processingMode,"@base"in ye){let ge=ye["@base"];if(null!==ge&&!A(ge)){if(!B(ge))throw new D('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:ye});ge=x(Ie["@base"],ge)}Ie["@base"]=ge,Ve.set("@base",!0)}if("@vocab"in ye){const ge=ye["@vocab"];if(null===ge)delete Ie["@vocab"];else{if(!E(ge))throw new D('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:ye});if(!A(ge)&&k.processingMode(Ie,1))throw new D('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:ye});{const et=ie(Ie,ge,{vocab:!0,base:!0},void 0,void 0,re);A(et)||re.eventHandler&&L({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:et}},options:re}),Ie["@vocab"]=et}}Ve.set("@vocab",!0)}if("@language"in ye){const ge=ye["@language"];if(null===ge)delete Ie["@language"];else{if(!E(ge))throw new D('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:ye});ge.match(Q)||re.eventHandler&&L({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ge}},options:re}),Ie["@language"]=ge.toLowerCase()}Ve.set("@language",!0)}if("@direction"in ye){const ge=ye["@direction"];if("json-ld-1.0"===N.processingMode)throw new D("Invalid JSON-LD syntax; @direction not compatible with "+N.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:ye});if(null===ge)delete Ie["@direction"];else{if("ltr"!==ge&&"rtl"!==ge)throw new D('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:ye});Ie["@direction"]=ge}Ve.set("@direction",!0)}if("@propagate"in ye){const ge=ye["@propagate"];if("json-ld-1.0"===N.processingMode)throw new D("Invalid JSON-LD syntax; @propagate not compatible with "+N.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:ye});if("boolean"!=typeof ge)throw new D("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:z});Ve.set("@propagate",!0)}if("@import"in ye){const ge=ye["@import"];if("json-ld-1.0"===N.processingMode)throw new D("Invalid JSON-LD syntax; @import not compatible with "+N.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:ye});if(!E(ge))throw new D("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:z});const et=yield re.contextResolver.resolve({activeCtx:N,context:ge,documentLoader:re.documentLoader,base:re.base});if(1!==et.length)throw new D("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:z});const ct=et[0].getProcessed(N);if(ct)ye=ct;else{const gt=et[0].document;if("@import"in gt)throw new D("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:z});for(const Tt in gt)ye.hasOwnProperty(Tt)||(ye[Tt]=gt[Tt]);et[0].setProcessed(N,ye)}Ve.set("@import",!0)}Ve.set("@protected",ye["@protected"]||!1);for(const ge in ye)if(k.createTermDefinition({activeCtx:Ie,localCtx:ye,term:ge,defined:Ve,options:re,overrideProtected:pe}),R(ye[ge])&&"@context"in ye[ge]){const et=ye[ge]["@context"];let ct=!0;if(E(et)){const gt=x(re.base,et);se.has(gt)?ct=!1:se.add(gt)}if(ct)try{yield k.process({activeCtx:Ie.clone(),localCtx:ye[ge]["@context"],overrideProtected:!0,options:re,cycles:se})}catch{throw new D("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:ye[ge]["@context"],term:ge})}}he.setProcessed(N,{context:Ie,events:Pe})}return Ie});return function(N){return I.apply(this,arguments)}}(),k.createTermDefinition=({activeCtx:I,localCtx:N,term:z,defined:re,options:de,overrideProtected:pe=!1})=>{if(re.has(z)){if(re.get(z))return;throw new D("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:N,term:z})}let se;if(re.set(z,!1),N.hasOwnProperty(z)&&(se=N[z]),"@type"===z&&R(se)&&"@set"===(se["@container"]||"@set")&&k.processingMode(I,1.1)){const he=["@container","@id","@protected"],ye=Object.keys(se);if(0===ye.length||ye.some(Ke=>!he.includes(Ke)))throw new D("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:N,term:z})}else{if(k.isKeyword(z))throw new D("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:N,term:z});if(z.match(j))return void(de.eventHandler&&L({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:z}},options:de}));if(""===z)throw new D("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:N})}const fe=I.mappings.get(z);I.mappings.has(z)&&I.mappings.delete(z);let Pe=!1;if((E(se)||null===se)&&(Pe=!0,se={"@id":se}),!R(se))throw new D("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:N});const xe={};I.mappings.set(z,xe),xe.reverse=!1;const Ne=["@container","@id","@language","@reverse","@type"];k.processingMode(I,1.1)&&Ne.push("@context","@direction","@index","@nest","@prefix","@protected");for(const he in se)if(!Ne.includes(he))throw new D("Invalid JSON-LD syntax; a term definition must not contain "+he,"jsonld.SyntaxError",{code:"invalid term definition",context:N});const tt=z.indexOf(":");if(xe._termHasColon=tt>0,"@reverse"in se){if("@id"in se)throw new D("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:N});if("@nest"in se)throw new D("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:N});const he=se["@reverse"];if(!E(he))throw new D("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:N});if(he.match(j))return de.eventHandler&&L({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:he}},options:de}),void(fe?I.mappings.set(z,fe):I.mappings.delete(z));const ye=ie(I,he,{vocab:!0,base:!1},N,re,de);if(!A(ye))throw new D("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:N});xe["@id"]=ye,xe.reverse=!0}else if("@id"in se){let he=se["@id"];if(he&&!E(he))throw new D("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:N});if(null===he)xe["@id"]=null;else{if(!k.isKeyword(he)&&he.match(j))return de.eventHandler&&L({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:he}},options:de}),void(fe?I.mappings.set(z,fe):I.mappings.delete(z));if(he!==z){if(he=ie(I,he,{vocab:!0,base:!1},N,re,de),!A(he)&&!k.isKeyword(he))throw new D("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:N});if(z.match(/(?::[^:])|\//)&&ie(I,z,{vocab:!0,base:!1},N,new Map(re).set(z,!0),de)!==he)throw new D("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:N});xe["@id"]=he,xe._prefix=Pe&&!xe._termHasColon&&null!==he.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in xe))if(xe._termHasColon){const he=z.substr(0,tt);if(N.hasOwnProperty(he)&&k.createTermDefinition({activeCtx:I,localCtx:N,term:he,defined:re,options:de}),I.mappings.has(he)){const ye=z.substr(tt+1);xe["@id"]=I.mappings.get(he)["@id"]+ye}else xe["@id"]=z}else if("@type"===z)xe["@id"]=z;else{if(!("@vocab"in I))throw new D("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:N,term:z});xe["@id"]=I["@vocab"]+z}if((!0===se["@protected"]||!0===re.get("@protected")&&!1!==se["@protected"])&&(I.protected[z]=!0,xe.protected=!0),re.set(z,!0),"@type"in se){let he=se["@type"];if(!E(he))throw new D("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:N});if("@json"===he||"@none"===he){if(k.processingMode(I,1))throw new D(`Invalid JSON-LD syntax; an @context @type value must not be "${he}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:N})}else if("@id"!==he&&"@vocab"!==he){if(he=ie(I,he,{vocab:!0,base:!1},N,re,de),!A(he))throw new D("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:N});if(0===he.indexOf("_:"))throw new D("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:N})}xe["@type"]=he}if("@container"in se){const he=E(se["@container"])?[se["@container"]]:se["@container"]||[],ye=["@list","@set","@index","@language"];let Ke=!0;const Ve=he.includes("@set");if(k.processingMode(I,1.1)){if(ye.push("@graph","@id","@type"),he.includes("@list")){if(1!==he.length)throw new D("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:N})}else if(he.includes("@graph")){if(he.some(ge=>"@graph"!==ge&&"@id"!==ge&&"@index"!==ge&&"@set"!==ge))throw new D("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:N})}else Ke&=he.length<=(Ve?2:1);if(he.includes("@type")&&(xe["@type"]=xe["@type"]||"@id",!["@id","@vocab"].includes(xe["@type"])))throw new D("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:N})}else Ke&=!_(se["@container"]),Ke&=he.length<=1;if(Ke&=he.every(ge=>ye.includes(ge)),Ke&=!(Ve&&he.includes("@list")),!Ke)throw new D("Invalid JSON-LD syntax; @context @container value must be one of the following: "+ye.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:N});if(xe.reverse&&!he.every(ge=>["@index","@set"].includes(ge)))throw new D("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:N});xe["@container"]=he}if("@index"in se){if(!("@container"in se)||!xe["@container"].includes("@index"))throw new D(`Invalid JSON-LD syntax; @index without @index in @container: "${se["@index"]}" on term "${z}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:N});if(!E(se["@index"])||0===se["@index"].indexOf("@"))throw new D(`Invalid JSON-LD syntax; @index must expand to an IRI: "${se["@index"]}" on term "${z}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:N});xe["@index"]=se["@index"]}if("@context"in se&&(xe["@context"]=se["@context"]),"@language"in se&&!("@type"in se)){let he=se["@language"];if(null!==he&&!E(he))throw new D("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:N});null!==he&&(he=he.toLowerCase()),xe["@language"]=he}if("@prefix"in se){if(z.match(/:|\//))throw new D("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:N});if(k.isKeyword(xe["@id"]))throw new D("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:N});if("boolean"!=typeof se["@prefix"])throw new D("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:N});xe._prefix=!0===se["@prefix"]}if("@direction"in se){const he=se["@direction"];if(null!==he&&"ltr"!==he&&"rtl"!==he)throw new D('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:N});xe["@direction"]=he}if("@nest"in se){const he=se["@nest"];if(!E(he)||"@nest"!==he&&0===he.indexOf("@"))throw new D("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:N});xe["@nest"]=he}const Ie=xe["@id"];if("@context"===Ie||"@preserve"===Ie)throw new D("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:N});if(fe&&fe.protected&&!pe&&(I.protected[z]=!0,xe.protected=!0,!ee(fe,xe)))throw new D("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:N,term:z})},k.expandIri=(I,N,z,re)=>ie(I,N,z,void 0,void 0,re),k.getInitialContext=I=>{const N=JSON.stringify({processingMode:I.processingMode}),z=F.get(N);if(z)return z;const re={processingMode:I.processingMode,mappings:new Map,inverse:null,getInverse:function de(){const xe=this;if(xe.inverse)return xe.inverse;const Ne=xe.inverse={},tt=xe.fastCurieMap={},Ie={},he=(xe["@language"]||"@none").toLowerCase(),ye=xe["@direction"],Ke=xe.mappings,Ve=[...Ke.keys()].sort(oe);for(const ge of Ve){const et=Ke.get(ge);if(null===et)continue;let ct=et["@container"]||"@none";if(ct=[].concat(ct).sort().join(""),null===et["@id"])continue;const gt=H(et["@id"]);for(const Tt of gt){let Qe=Ne[Tt];const st=k.isKeyword(Tt);if(Qe)!st&&!et._termHasColon&&Ie[Tt].push(ge);else if(Ne[Tt]=Qe={},!st&&!et._termHasColon){Ie[Tt]=[ge];const Le={iri:Tt,terms:Ie[Tt]};Tt[0]in tt?tt[Tt[0]].push(Le):tt[Tt[0]]=[Le]}if(Qe[ct]||(Qe[ct]={"@language":{},"@type":{},"@any":{}}),Qe=Qe[ct],se(ge,Qe["@any"],"@none"),et.reverse)se(ge,Qe["@type"],"@reverse");else if("@none"===et["@type"])se(ge,Qe["@any"],"@none"),se(ge,Qe["@language"],"@none"),se(ge,Qe["@type"],"@none");else if("@type"in et)se(ge,Qe["@type"],et["@type"]);else if("@language"in et&&"@direction"in et){const Le=et["@language"],Ce=et["@direction"];se(ge,Qe["@language"],Le&&Ce?`${Le}_${Ce}`.toLowerCase():Le?Le.toLowerCase():Ce?`_${Ce}`:"@null")}else"@language"in et?se(ge,Qe["@language"],(et["@language"]||"@null").toLowerCase()):"@direction"in et?se(ge,Qe["@language"],et["@direction"]?`_${et["@direction"]}`:"@none"):ye?(se(ge,Qe["@language"],`_${ye}`),se(ge,Qe["@language"],"@none"),se(ge,Qe["@type"],"@none")):(se(ge,Qe["@language"],he),se(ge,Qe["@language"],"@none"),se(ge,Qe["@type"],"@none"))}}for(const ge in tt)pe(tt,ge,1);return Ne},clone:function fe(){const xe={};return xe.mappings=$.clone(this.mappings),xe.clone=this.clone,xe.inverse=null,xe.getInverse=this.getInverse,xe.protected=$.clone(this.protected),this.previousContext&&(xe.previousContext=this.previousContext.clone()),xe.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(xe["@base"]=this["@base"]),"@language"in this&&(xe["@language"]=this["@language"]),"@vocab"in this&&(xe["@vocab"]=this["@vocab"]),xe},revertToPreviousContext:function Pe(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===F.size&&F.clear(),F.set(N,re),re;function pe(xe,Ne,tt){const Ie=xe[Ne],he=xe[Ne]={};let ye,Ke;for(const Ve of Ie)ye=Ve.iri,Ke=tt>=ye.length?"":ye[tt],Ke in he?he[Ke].push(Ve):he[Ke]=[Ve];for(const Ve in he)""!==Ve&&pe(he,Ve,tt+1)}function se(xe,Ne,tt){Ne.hasOwnProperty(tt)||(Ne[tt]=xe)}},k.getContextValue=(I,N,z)=>{if(null===N)return"@context"===z?void 0:null;if(I.mappings.has(N)){const re=I.mappings.get(N);if(w(z))return re;if(re.hasOwnProperty(z))return re[z]}return"@language"===z&&z in I||"@direction"===z&&z in I?I[z]:"@context"!==z?null:void 0},k.processingMode=(I,N)=>N.toString()>="1.1"?!I.processingMode||I.processingMode>="json-ld-"+N.toString():"json-ld-1.0"===I.processingMode,k.isKeyword=I=>{if(!E(I)||"@"!==I[0])return!1;switch(I){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},3120(at,Fe,ne){"use strict";var ae=ne(9293).default;const{parseLinkHeader:$,buildHeaders:D}=ne(9420),{LINK_HEADER_CONTEXT:_}=ne(5315),R=ne(262),E=ne(4808),{prependBase:w}=ne(2051),A=/(^|(\r\n))link:/i;at.exports=({secure:x,headers:L={},xhr:Q}={headers:{}})=>{return L=D(L),(new E).wrapLoader(H);function H(F){return oe.apply(this,arguments)}function oe(){return oe=ae(function*(F){if(0!==F.indexOf("http:")&&0!==F.indexOf("https:"))throw new R('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:F});if(x&&0!==F.indexOf("https"))throw new R('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:F});let te;try{te=yield function B(x,L,Q){const j=new(x=x||XMLHttpRequest);return new Promise((H,oe)=>{j.onload=()=>H(j),j.onerror=F=>oe(F),j.open("GET",L,!0);for(const F in Q)j.setRequestHeader(F,Q[F]);j.send()})}(Q,F,L)}catch(N){throw new R("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:F,cause:N})}if(te.status>=400)throw new R("URL could not be dereferenced: "+te.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:F,httpStatusCode:te.status});let k={contextUrl:null,documentUrl:F,document:te.response},ie=null;const ee=te.getResponseHeader("Content-Type");let I;if(A.test(te.getAllResponseHeaders())&&(I=te.getResponseHeader("Link")),I&&"application/ld+json"!==ee){const N=$(I),z=N[_];if(Array.isArray(z))throw new R("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:F});z&&(k.contextUrl=z.target),ie=N.alternate,ie&&"application/ld+json"==ie.type&&!(ee||"").match(/^application\/(\w*\+)?json$/)&&(k=yield H(w(F,ie.target)))}return k}),oe.apply(this,arguments)}}},2585(at,Fe,ne){"use strict";const ae=ne(262),{isArray:$}=ne(2831),{asArray:D}=ne(9420),_={};function R({event:w,handlers:A}){let B=!0;for(let x=0;B&&x<A.length;++x){B=!1;const L=A[x];if($(L))B=R({event:w,handlers:L});else if("function"==typeof L)L({event:w,next:()=>{B=!0}});else{if("object"!=typeof L)throw new ae("Invalid event handler.","jsonld.InvalidEventHandler",{event:w});w.code in L?L[w.code]({event:w,next:()=>{B=!0}}):B=!0}}return B}at.exports=_,_.defaultEventHandler=null,_.setupEventHandler=({options:w={}})=>{const A=[].concat(w.safe?_.safeEventHandler:[],w.eventHandler?D(w.eventHandler):[],_.defaultEventHandler?_.defaultEventHandler:[]);return 0===A.length?null:A},_.handleEvent=({event:w,options:A})=>{R({event:w,handlers:A.eventHandler})};const E=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);_.safeEventHandler=function({event:A,next:B}){if("warning"===A.level&&E.has(A.code))throw new ae("Safe mode validation error.","jsonld.ValidationError",{event:A});B()},_.logEventHandler=function({event:A,next:B}){console.log(`EVENT: ${A.message}`,{event:A}),B()},_.logWarningEventHandler=function({event:A,next:B}){"warning"===A.level&&console.warn(`WARNING: ${A.message}`,{event:A}),B()},_.unhandledEventHandler=function({event:A}){throw new ae("No handler for event.","jsonld.UnhandledEvent",{event:A})},_.setDefaultEventHandler=function({eventHandler:w}={}){_.defaultEventHandler=w?D(w):null}},7336(at,Fe,ne){"use strict";var ae=ne(9293).default;const $=ne(262),{isArray:D,isObject:_,isEmptyObject:R,isString:E,isUndefined:w}=ne(2831),{isList:A,isValue:B,isGraph:x,isSubject:L}=ne(4209),{expandIri:Q,getContextValue:j,isKeyword:H,process:oe,processingMode:F}=ne(429),{isAbsolute:te}=ne(2051),{REGEX_BCP47:k,REGEX_KEYWORD:ie,addValue:ee,asArray:I,getValues:N,validateTypeValue:z}=ne(9420),{handleEvent:re}=ne(2585),de={};function pe({value:Ie,count:he,options:ye}){if(0===he||"@value"in Ie||"@list"in Ie||1===he&&"@id"in Ie){if(ye.eventHandler){let Ke,Ve;0===he?(Ke="empty object",Ve="Dropping empty object."):"@value"in Ie?(Ke="object with only @value",Ve="Dropping object with only @value."):"@list"in Ie?(Ke="object with only @list",Ve="Dropping object with only @list."):1===he&&"@id"in Ie&&(Ke="object with only @id",Ve="Dropping object with only @id."),re({event:{type:["JsonLdEvent"],code:Ke,level:"warning",message:Ve,details:{value:Ie}},options:ye})}return null}return Ie}function se(Ie){return fe.apply(this,arguments)}function fe(){return(fe=ae(function*({activeCtx:Ie,activeProperty:he,expandedActiveProperty:ye,element:Ke,expandedParent:Ve,options:ge={},insideList:et,typeKey:ct,typeScopedContext:gt}){const Tt=Object.keys(Ke).sort(),Qe=[];let st;const Le=Ke[ct]&&"@json"===Q(Ie,D(Ke[ct])?Ke[ct][0]:Ke[ct],{vocab:!0},{...ge,typeExpansion:!0});for(const Ce of Tt){let At,mt=Ke[Ce];if("@context"===Ce)continue;const dt=Q(Ie,Ce,{vocab:!0},ge);if(null===dt||!te(dt)&&!H(dt)){ge.eventHandler&&re({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:Ce,expandedProperty:dt}},options:ge});continue}if(H(dt)){if("@reverse"===ye)throw new $("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:mt});if(dt in Ve&&"@included"!==dt&&"@type"!==dt)throw new $("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:dt})}if("@id"===dt){if(!E(mt)){if(!ge.isFrame)throw new $('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:mt});if(_(mt)){if(!R(mt))throw new $('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:mt})}else{if(!D(mt))throw new $('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:mt});if(!mt.every(Ct=>E(Ct)))throw new $('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:mt})}}ee(Ve,"@id",I(mt).map(Ct=>{if(E(Ct)){const pr=Q(Ie,Ct,{base:!0},ge);return ge.eventHandler&&(null===pr?re(null===Ct?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:Ct}},options:ge}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:Ct}},options:ge}):te(pr)||re({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:Ct,expandedId:pr}},options:ge})),pr}return Ct}),{propertyIsArray:ge.isFrame});continue}if("@type"===dt){_(mt)&&(mt=Object.fromEntries(Object.entries(mt).map(([Ct,pr])=>[Q(gt,Ct,{vocab:!0}),I(pr).map(Lr=>Q(gt,Lr,{base:!0,vocab:!0},{...ge,typeExpansion:!0}))]))),z(mt,ge.isFrame),ee(Ve,"@type",I(mt).map(Ct=>{if(E(Ct)){const pr=Q(gt,Ct,{base:!0,vocab:!0},{...ge,typeExpansion:!0});return"@json"!==pr&&!te(pr)&&ge.eventHandler&&re({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:Ct}},options:ge}),pr}return Ct}),{propertyIsArray:!!ge.isFrame});continue}if("@included"===dt&&F(Ie,1.1)){const Ct=I(yield de.expand({activeCtx:Ie,activeProperty:he,element:mt,options:ge}));if(!Ct.every(pr=>L(pr)))throw new $("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:mt});ee(Ve,"@included",Ct,{propertyIsArray:!0});continue}if("@graph"===dt&&!_(mt)&&!D(mt))throw new $('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:mt});if("@value"===dt){st=mt,Le&&F(Ie,1.1)?Ve["@value"]=mt:ee(Ve,"@value",mt,{propertyIsArray:ge.isFrame});continue}if("@language"===dt){if(null===mt)continue;if(!E(mt)&&!ge.isFrame)throw new $('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:mt});mt=I(mt).map(Ct=>E(Ct)?Ct.toLowerCase():Ct);for(const Ct of mt)E(Ct)&&!Ct.match(k)&&ge.eventHandler&&re({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:Ct}},options:ge});ee(Ve,"@language",mt,{propertyIsArray:ge.isFrame});continue}if("@direction"===dt){if(!E(mt)&&!ge.isFrame)throw new $('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:mt});mt=I(mt);for(const Ct of mt)if(E(Ct)&&"ltr"!==Ct&&"rtl"!==Ct)throw new $('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:mt});ee(Ve,"@direction",mt,{propertyIsArray:ge.isFrame});continue}if("@index"===dt){if(!E(mt))throw new $('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:mt});ee(Ve,"@index",mt);continue}if("@reverse"===dt){if(!_(mt))throw new $('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:mt});if(At=yield de.expand({activeCtx:Ie,activeProperty:"@reverse",element:mt,options:ge}),"@reverse"in At)for(const pr in At["@reverse"])ee(Ve,pr,At["@reverse"][pr],{propertyIsArray:!0});let Ct=Ve["@reverse"]||null;for(const pr in At){if("@reverse"===pr)continue;null===Ct&&(Ct=Ve["@reverse"]={}),ee(Ct,pr,[],{propertyIsArray:!0});const Lr=At[pr];for(let an=0;an<Lr.length;++an){const Ei=Lr[an];if(B(Ei)||A(Ei))throw new $('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:At});ee(Ct,pr,Ei,{propertyIsArray:!0})}}continue}if("@nest"===dt){Qe.push(Ce);continue}let Mt=Ie;const nr=j(Ie,Ce,"@context");w(nr)||(Mt=yield oe({activeCtx:Ie,localCtx:nr,propagate:!0,overrideProtected:!0,options:ge}));const mr=j(Ie,Ce,"@container")||[];if(mr.includes("@language")&&_(mt))At=xe(Mt,mt,j(Mt,Ce,"@direction"),ge);else if(mr.includes("@index")&&_(mt)){const Ct=mr.includes("@graph"),pr=j(Mt,Ce,"@index")||"@index",Lr="@index"!==pr&&Q(Ie,pr,{vocab:!0},ge);At=yield Ne({activeCtx:Mt,options:ge,activeProperty:Ce,value:mt,asGraph:Ct,indexKey:pr,propertyIndex:Lr})}else if(mr.includes("@id")&&_(mt)){const Ct=mr.includes("@graph");At=yield Ne({activeCtx:Mt,options:ge,activeProperty:Ce,value:mt,asGraph:Ct,indexKey:"@id"})}else if(mr.includes("@type")&&_(mt))At=yield Ne({activeCtx:Mt.revertToPreviousContext(),options:ge,activeProperty:Ce,value:mt,asGraph:!1,indexKey:"@type"});else{const Ct="@list"===dt;if(Ct||"@set"===dt){let pr=he;Ct&&"@graph"===ye&&(pr=null),At=yield de.expand({activeCtx:Mt,activeProperty:pr,element:mt,options:ge,insideList:Ct})}else At="@json"===j(Ie,Ce,"@type")?{"@type":"@json","@value":mt}:yield de.expand({activeCtx:Mt,activeProperty:Ce,element:mt,options:ge,insideList:!1})}if(null!==At||"@value"===dt){if("@list"!==dt&&!A(At)&&mr.includes("@list")&&(At={"@list":I(At)}),mr.includes("@graph")&&!mr.some(Ct=>"@id"===Ct||"@index"===Ct)){if(At=I(At),ge.isFrame||(At=At.filter(Ct=>null!==pe({value:Ct,count:Object.keys(Ct).length,options:ge}))),0===At.length)continue;At=At.map(Ct=>({"@graph":I(Ct)}))}if(Mt.mappings.has(Ce)&&Mt.mappings.get(Ce).reverse){const Ct=Ve["@reverse"]=Ve["@reverse"]||{};At=I(At);for(let pr=0;pr<At.length;++pr){const Lr=At[pr];if(B(Lr)||A(Lr))throw new $('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:At});ee(Ct,dt,Lr,{propertyIsArray:!0})}continue}ee(Ve,dt,At,{propertyIsArray:!0})}}if("@value"in Ve&&("@json"!==Ve["@type"]||!F(Ie,1.1))&&(_(st)||D(st))&&!ge.isFrame)throw new $('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:st});for(const Ce of Qe){const mt=D(Ke[Ce])?Ke[Ce]:[Ke[Ce]];for(const At of mt){if(!_(At)||Object.keys(At).some(dt=>"@value"===Q(Ie,dt,{vocab:!0},ge)))throw new $("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:At});yield se({activeCtx:Ie,activeProperty:he,expandedActiveProperty:ye,element:At,expandedParent:Ve,options:ge,insideList:et,typeScopedContext:gt,typeKey:ct})}}})).apply(this,arguments)}function Pe({activeCtx:Ie,activeProperty:he,value:ye,options:Ke}){if(null==ye)return null;const Ve=Q(Ie,he,{vocab:!0},Ke);if("@id"===Ve)return Q(Ie,ye,{base:!0},Ke);if("@type"===Ve)return Q(Ie,ye,{vocab:!0,base:!0},{...Ke,typeExpansion:!0});const ge=j(Ie,he,"@type");if(("@id"===ge||"@graph"===Ve)&&E(ye)){const ct=Q(Ie,ye,{base:!0},Ke);return null===ct&&ye.match(ie)&&Ke.eventHandler&&re({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:he}},options:Ke}),{"@id":ct}}if("@vocab"===ge&&E(ye))return{"@id":Q(Ie,ye,{vocab:!0,base:!0},Ke)};if(H(Ve))return ye;const et={};if(ge&&!["@id","@vocab","@none"].includes(ge))et["@type"]=ge;else if(E(ye)){const ct=j(Ie,he,"@language");null!==ct&&(et["@language"]=ct);const gt=j(Ie,he,"@direction");null!==gt&&(et["@direction"]=gt)}return["boolean","number","string"].includes(typeof ye)||(ye=ye.toString()),et["@value"]=ye,et}function xe(Ie,he,ye,Ke){const Ve=[],ge=Object.keys(he).sort();for(const et of ge){const ct=Q(Ie,et,{vocab:!0},Ke);let gt=he[et];D(gt)||(gt=[gt]);for(const Tt of gt){if(null===Tt)continue;if(!E(Tt))throw new $("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:he});const Qe={"@value":Tt};"@none"!==ct&&(et.match(k)||Ke.eventHandler&&re({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:et}},options:Ke}),Qe["@language"]=et.toLowerCase()),ye&&(Qe["@direction"]=ye),Ve.push(Qe)}}return Ve}function Ne(Ie){return tt.apply(this,arguments)}function tt(){return(tt=ae(function*({activeCtx:Ie,options:he,activeProperty:ye,value:Ke,asGraph:Ve,indexKey:ge,propertyIndex:et}){const ct=[],gt=Object.keys(Ke).sort(),Tt="@type"===ge;for(let Qe of gt){if(Tt){const Ce=j(Ie,Qe,"@context");w(Ce)||(Ie=yield oe({activeCtx:Ie,localCtx:Ce,propagate:!1,options:he}))}let Le,st=Ke[Qe];D(st)||(st=[st]),st=yield de.expand({activeCtx:Ie,activeProperty:ye,element:st,options:he,insideList:!1,insideIndex:!0}),Le=et?"@none"===Qe?"@none":Pe({activeCtx:Ie,activeProperty:ge,value:Qe,options:he}):Q(Ie,Qe,{vocab:!0},he),"@id"===ge?Qe=Q(Ie,Qe,{base:!0},he):Tt&&(Qe=Le);for(let Ce of st){if(Ve&&!x(Ce)&&(Ce={"@graph":[Ce]}),"@type"===ge)"@none"===Le||(Ce["@type"]=Ce["@type"]?[Qe].concat(Ce["@type"]):[Qe]);else{if(B(Ce)&&!["@language","@type","@index"].includes(ge))throw new $(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${ge}".`,"jsonld.SyntaxError",{code:"invalid value object",value:Ce});et?"@none"!==Le&&ee(Ce,et,Le,{propertyIsArray:!0,prependValue:!0}):"@none"!==Le&&!(ge in Ce)&&(Ce[ge]=Qe)}ct.push(Ce)}}return ct})).apply(this,arguments)}at.exports=de,de.expand=function(){var Ie=ae(function*({activeCtx:he,activeProperty:ye=null,element:Ke,options:Ve={},insideList:ge=!1,insideIndex:et=!1,typeScopedContext:ct=null}){if(null==Ke)return null;if("@default"===ye&&(Ve=Object.assign({},Ve,{isFrame:!1})),!D(Ke)&&!_(Ke))return ge||null!==ye&&"@graph"!==Q(he,ye,{vocab:!0},Ve)?Pe({activeCtx:he,activeProperty:ye,value:Ke,options:Ve}):(Ve.eventHandler&&re({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:Ke}},options:Ve}),null);if(D(Ke)){let At=[];const dt=j(he,ye,"@container")||[];ge=ge||dt.includes("@list");for(let Mt=0;Mt<Ke.length;++Mt){let nr=yield de.expand({activeCtx:he,activeProperty:ye,element:Ke[Mt],options:Ve,insideIndex:et,typeScopedContext:ct});ge&&D(nr)&&(nr={"@list":nr}),null!==nr&&(D(nr)?At=At.concat(nr):At.push(nr))}return At}const gt=Q(he,ye,{vocab:!0},Ve),Tt=j(he,ye,"@context");ct=ct||(he.previousContext?he:null);let Qe=Object.keys(Ke).sort(),st=!et;if(st&&ct&&Qe.length<=2&&!Qe.includes("@context"))for(const At of Qe){const dt=Q(ct,At,{vocab:!0},Ve);if("@value"===dt){st=!1,he=ct;break}if("@id"===dt&&1===Qe.length){st=!1;break}}st&&(he=he.revertToPreviousContext()),w(Tt)||(he=yield oe({activeCtx:he,localCtx:Tt,propagate:!0,overrideProtected:!0,options:Ve})),"@context"in Ke&&(he=yield oe({activeCtx:he,localCtx:Ke["@context"],options:Ve})),ct=he;let Le=null;for(const At of Qe)if("@type"===Q(he,At,{vocab:!0},Ve)){Le=Le||At;const Mt=Ke[At],nr=Array.isArray(Mt)?Mt.length>1?Mt.slice().sort():Mt:[Mt];for(const mr of nr){const Ct=j(ct,mr,"@context");w(Ct)||(he=yield oe({activeCtx:he,localCtx:Ct,options:Ve,propagate:!1}))}}let Ce={};yield se({activeCtx:he,activeProperty:ye,expandedActiveProperty:gt,element:Ke,expandedParent:Ce,options:Ve,insideList:ge,typeKey:Le,typeScopedContext:ct}),Qe=Object.keys(Ce);let mt=Qe.length;if("@value"in Ce){if("@type"in Ce&&("@language"in Ce||"@direction"in Ce))throw new $('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:Ce});let At=mt-1;if("@type"in Ce&&(At-=1),"@index"in Ce&&(At-=1),"@language"in Ce&&(At-=1),"@direction"in Ce&&(At-=1),0!==At)throw new $('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:Ce});const dt=null===Ce["@value"]?[]:I(Ce["@value"]),Mt=N(Ce,"@type");if(!F(he,1.1)||!Mt.includes("@json")||1!==Mt.length)if(0===dt.length)Ve.eventHandler&&re({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:Ce}},options:Ve}),Ce=null;else{if(!dt.every(nr=>E(nr)||R(nr))&&"@language"in Ce)throw new $("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:Ce});if(!Mt.every(nr=>te(nr)&&!(E(nr)&&0===nr.indexOf("_:"))||R(nr)))throw new $('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:Ce})}}else if("@type"in Ce&&!D(Ce["@type"]))Ce["@type"]=[Ce["@type"]];else if("@set"in Ce||"@list"in Ce){if(mt>1&&(2!==mt||!("@index"in Ce)))throw new $('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:Ce});"@set"in Ce&&(Ce=Ce["@set"],Qe=Object.keys(Ce),mt=Qe.length)}else 1===mt&&"@language"in Ce&&(Ve.eventHandler&&re({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:Ce}},options:Ve}),Ce=null);return _(Ce)&&!Ve.keepFreeFloatingNodes&&!ge&&(null===ye||"@graph"===gt||(j(he,ye,"@container")||[]).includes("@graph"))&&(Ce=pe({value:Ce,count:mt,options:Ve})),Ce});return function(he){return Ie.apply(this,arguments)}}()},9392(at,Fe,ne){"use strict";const{isSubjectReference:ae}=ne(4209),{createMergedNodeMap:$}=ne(5096),D={};at.exports=D,D.flatten=_=>{const R=$(_),E=[],w=Object.keys(R).sort();for(let A=0;A<w.length;++A){const B=R[w[A]];ae(B)||E.push(B)}return E}},7031(at,Fe,ne){"use strict";const{isKeyword:ae}=ne(429),$=ne(4209),D=ne(2831),_=ne(9420),R=ne(2051),E=ne(262),{createNodeMap:w,mergeNodeMapGraphs:A}=ne(5096),B={};function x(I){const N={};for(const z in I)void 0!==I[z]&&(N["@"+z]=[I[z]]);return[N]}function L(I,N,z){for(let re=z.length-1;re>=0;--re){const de=z[re];if(de.graph===N&&de.subject["@id"]===I["@id"])return!0}return!1}function Q(I,N,z){const re="@"+z;let de=re in I?I[re][0]:N[z];if("embed"===z)if(!0===de)de="@once";else if(!1===de)de="@never";else if("@always"!==de&&"@never"!==de&&"@link"!==de&&"@first"!==de&&"@last"!==de&&"@once"!==de)throw new E("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:I});return de}function j(I){if(!D.isArray(I)||1!==I.length||!D.isObject(I[0]))throw new E("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:I});if("@id"in I[0])for(const N of _.asArray(I[0]["@id"]))if(!D.isObject(N)&&!R.isAbsolute(N)||D.isString(N)&&0===N.indexOf("_:"))throw new E("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:I});if("@type"in I[0])for(const N of _.asArray(I[0]["@type"]))if(!D.isObject(N)&&!R.isAbsolute(N)&&"@json"!==N||D.isString(N)&&0===N.indexOf("_:"))throw new E("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:I})}function oe(I,N,z,re){let de=!0,pe=!1;for(const se in z){let fe=!1;const Pe=_.getValues(N,se),xe=0===_.getValues(z,se).length;if("@id"===se){if(D.isEmptyObject(z["@id"][0]||{})?fe=!0:z["@id"].length>=0&&(fe=z["@id"].includes(Pe[0])),!re.requireAll)return fe}else if("@type"===se){if(de=!1,xe){if(Pe.length>0)return!1;fe=!0}else if(1===z["@type"].length&&D.isEmptyObject(z["@type"][0]))fe=Pe.length>0;else for(const Ne of z["@type"])fe=!(!D.isObject(Ne)||!("@default"in Ne))||fe||Pe.some(tt=>tt===Ne);if(!re.requireAll)return fe}else{if(ae(se))continue;{const Ne=_.getValues(z,se)[0];let tt=!1;if(Ne&&(j([Ne]),tt="@default"in Ne),de=!1,0===Pe.length&&tt)continue;if(Pe.length>0&&xe)return!1;if(void 0===Ne){if(Pe.length>0)return!1;fe=!0}else if($.isList(Ne)){const Ie=Ne["@list"][0];if($.isList(Pe[0])){const he=Pe[0]["@list"];$.isValue(Ie)?fe=he.some(ye=>ee(Ie,ye)):($.isSubject(Ie)||$.isSubjectReference(Ie))&&(fe=he.some(ye=>ie(I,Ie,ye,re)))}}else fe=$.isValue(Ne)?Pe.some(Ie=>ee(Ne,Ie)):$.isSubjectReference(Ne)?Pe.some(Ie=>ie(I,Ne,Ie,re)):!!D.isObject(Ne)&&Pe.length>0}}if(!fe&&re.requireAll)return!1;pe=pe||fe}return de||pe}function F(I,N){const z=I.uniqueEmbeds[I.graph],re=z[N],de=re.parent,pe=re.property,se={"@id":N};if(D.isArray(de)){for(let Pe=0;Pe<de.length;++Pe)if(_.compareValues(de[Pe],se)){de[Pe]=se;break}}else{const Pe=D.isArray(de[pe]);_.removeValue(de,pe,se,{propertyIsArray:Pe}),_.addValue(de,pe,se,{propertyIsArray:Pe})}const fe=Pe=>{const xe=Object.keys(z);for(const Ne of xe)Ne in z&&D.isObject(z[Ne].parent)&&z[Ne].parent["@id"]===Pe&&(delete z[Ne],fe(Ne))};fe(N)}function te(I,N){if(D.isArray(I))return I.map(z=>te(z,N));if(D.isObject(I)){if("@preserve"in I)return I["@preserve"][0];if($.isValue(I))return I;if($.isList(I))return I["@list"]=te(I["@list"],N),I;if("@id"in I){const z=I["@id"];if(N.link.hasOwnProperty(z)){const re=N.link[z].indexOf(I);if(-1!==re)return N.link[z][re];N.link[z].push(I)}else N.link[z]=[I]}for(const z in I)"@id"===z&&N.bnodesToClear.includes(I[z])?delete I["@id"]:I[z]=te(I[z],N)}return I}function k(I,N,z){D.isObject(I)?_.addValue(I,N,z,{propertyIsArray:!0}):I.push(z)}function ie(I,N,z,re){if(!("@id"in z))return!1;const de=I.subjects[z["@id"]];return de&&oe(I,de,N,re)}function ee(I,N){const z=N["@value"],re=N["@type"],de=N["@language"],pe=I["@value"]?D.isArray(I["@value"])?I["@value"]:[I["@value"]]:[],se=I["@type"]?D.isArray(I["@type"])?I["@type"]:[I["@type"]]:[],fe=I["@language"]?D.isArray(I["@language"])?I["@language"]:[I["@language"]]:[];return 0===pe.length&&0===se.length&&0===fe.length||!(!pe.includes(z)&&!D.isEmptyObject(pe[0])||!(!re&&0===se.length||se.includes(re)||re&&D.isEmptyObject(se[0]))||!(!de&&0===fe.length||fe.includes(de)||de&&D.isEmptyObject(fe[0])))}at.exports=B,B.frameMergedOrDefault=(I,N,z)=>{const re={options:z,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},de=new _.IdentifierIssuer("_:b");w(I,re.graphMap,"@default",de),z.merged&&(re.graphMap["@merged"]=A(re.graphMap),re.graph="@merged"),re.subjects=re.graphMap[re.graph];const pe=[];return B.frame(re,Object.keys(re.subjects).sort(),N,pe),z.pruneBlankNodeIdentifiers&&(z.bnodesToClear=Object.keys(re.bnodeMap).filter(se=>1===re.bnodeMap[se].length)),z.link={},te(pe,z)},B.frame=(I,N,z,re,de=null)=>{j(z);const pe=I.options,se={embed:Q(z=z[0],pe,"embed"),explicit:Q(z,pe,"explicit"),requireAll:Q(z,pe,"requireAll")};I.link.hasOwnProperty(I.graph)||(I.link[I.graph]={});const fe=I.link[I.graph],Pe=function H(I,N,z,re){const de={};for(const pe of N){const se=I.graphMap[I.graph][pe];oe(I,se,z,re)&&(de[pe]=se)}return de}(I,N,z,se),xe=Object.keys(Pe).sort();for(const Ne of xe){const tt=Pe[Ne];if(null===de?I.uniqueEmbeds={[I.graph]:{}}:I.uniqueEmbeds[I.graph]=I.uniqueEmbeds[I.graph]||{},"@link"===se.embed&&Ne in fe){k(re,de,fe[Ne]);continue}const Ie={"@id":Ne};if(0===Ne.indexOf("_:")&&_.addValue(I.bnodeMap,Ne,Ie,{propertyIsArray:!0}),fe[Ne]=Ie,("@first"===se.embed||"@last"===se.embed)&&I.is11)throw new E("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:z});if(I.embedded||!I.uniqueEmbeds[I.graph].hasOwnProperty(Ne)){if(I.embedded&&("@never"===se.embed||L(tt,I.graph,I.subjectStack))){k(re,de,Ie);continue}if(I.embedded&&("@first"==se.embed||"@once"==se.embed)&&I.uniqueEmbeds[I.graph].hasOwnProperty(Ne)){k(re,de,Ie);continue}if("@last"===se.embed&&Ne in I.uniqueEmbeds[I.graph]&&F(I,Ne),I.uniqueEmbeds[I.graph][Ne]={parent:re,property:de},I.subjectStack.push({subject:tt,graph:I.graph}),Ne in I.graphMap){let he=!1,ye=null;"@graph"in z?(ye=z["@graph"][0],he=!("@merged"===Ne||"@default"===Ne),D.isObject(ye)||(ye={})):(he="@merged"!==I.graph,ye={}),he&&B.frame({...I,graph:Ne,embedded:!1},Object.keys(I.graphMap[Ne]).sort(),[ye],Ie,"@graph")}"@included"in z&&B.frame({...I,embedded:!1},N,z["@included"],Ie,"@included");for(const he of Object.keys(tt).sort())if(ae(he)){if(Ie[he]=_.clone(tt[he]),"@type"===he)for(const ye of tt["@type"])0===ye.indexOf("_:")&&_.addValue(I.bnodeMap,ye,Ie,{propertyIsArray:!0})}else if(!se.explicit||he in z)for(const ye of tt[he]){const Ke=he in z?z[he]:x(se);if($.isList(ye)){const Ve=z[he]&&z[he][0]&&z[he][0]["@list"]?z[he][0]["@list"]:x(se),ge={"@list":[]};k(Ie,he,ge);const et=ye["@list"];for(const ct of et)$.isSubjectReference(ct)?B.frame({...I,embedded:!0},[ct["@id"]],Ve,ge,"@list"):k(ge,"@list",_.clone(ct))}else $.isSubjectReference(ye)?B.frame({...I,embedded:!0},[ye["@id"]],Ke,Ie,he):ee(Ke[0],ye)&&k(Ie,he,_.clone(ye))}for(const he of Object.keys(z).sort()){if("@type"===he){if(!D.isObject(z[he][0])||!("@default"in z[he][0]))continue}else if(ae(he))continue;const ye=z[he][0]||{};if(!Q(ye,pe,"omitDefault")&&!(he in Ie)){let Ve="@null";"@default"in ye&&(Ve=_.clone(ye["@default"])),D.isArray(Ve)||(Ve=[Ve]),Ie[he]=[{"@preserve":Ve}]}}for(const he of Object.keys(z["@reverse"]||{}).sort()){const ye=z["@reverse"][he];for(const Ke of Object.keys(I.subjects))_.getValues(I.subjects[Ke],he).some(ge=>ge["@id"]===Ne)&&(Ie["@reverse"]=Ie["@reverse"]||{},_.addValue(Ie["@reverse"],he,[],{propertyIsArray:!0}),B.frame({...I,embedded:!0},[Ke],ye,Ie["@reverse"][he],de))}k(re,de,Ie),I.subjectStack.pop()}}},B.cleanupNull=(I,N)=>{if(D.isArray(I))return I.map(re=>B.cleanupNull(re,N)).filter(re=>re);if("@null"===I)return null;if(D.isObject(I)){if("@id"in I){const z=I["@id"];if(N.link.hasOwnProperty(z)){const re=N.link[z].indexOf(I);if(-1!==re)return N.link[z][re];N.link[z].push(I)}else N.link[z]=[I]}for(const z in I)I[z]=B.cleanupNull(I[z],N)}return I}},4814(at,Fe,ne){"use strict";var ae=ne(9293).default;const $=ne(262),D=ne(4209),_=ne(2831),{REGEX_BCP47:R,addValue:E}=ne(9420),{handleEvent:w}=ne(2585),{RDF_LIST:A,RDF_FIRST:B,RDF_REST:x,RDF_NIL:L,RDF_TYPE:Q,RDF_JSON_LITERAL:j,XSD_BOOLEAN:H,XSD_DOUBLE:oe,XSD_INTEGER:F,XSD_STRING:te}=ne(5315),k={};function ie(ee,I,N,z){if(ee.termType.endsWith("Node"))return{"@id":ee.value};const re={"@value":ee.value};if(ee.language)ee.language.match(R)||z.eventHandler&&w({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ee.language}},options:z}),re["@language"]=ee.language;else{let de=ee.datatype.value;if(de||(de=te),de===j){de="@json";try{re["@value"]=JSON.parse(re["@value"])}catch(pe){throw new $("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:re["@value"],cause:pe})}}if(I){if(de===H)"true"===re["@value"]?re["@value"]=!0:"false"===re["@value"]&&(re["@value"]=!1);else if(_.isNumeric(re["@value"]))if(de===F){const pe=parseInt(re["@value"],10);pe.toFixed(0)===re["@value"]&&(re["@value"]=pe)}else de===oe&&(re["@value"]=parseFloat(re["@value"]));[H,F,oe,te].includes(de)||(re["@type"]=de)}else if("i18n-datatype"===N&&de.startsWith("https://www.w3.org/ns/i18n#")){const[,pe,se]=de.split(/[#_]/);pe.length>0&&(re["@language"]=pe,pe.match(R)||z.eventHandler&&w({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:pe}},options:z})),re["@direction"]=se}else de!==te&&(re["@type"]=de)}return re}at.exports=k,k.fromRDF=function(){var ee=ae(function*(I,N){const{useRdfType:z=!1,useNativeTypes:re=!1,rdfDirection:de=null}=N,pe={},se={"@default":pe},fe={};if(de){if("compound-literal"===de)throw new $("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:de});if("i18n-datatype"!==de)throw new $("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:de})}for(const Ne of I){const tt="DefaultGraph"===Ne.graph.termType?"@default":Ne.graph.value;tt in se||(se[tt]={}),"@default"!==tt&&!(tt in pe)&&(pe[tt]={"@id":tt});const Ie=se[tt],he=Ne.subject.value,ye=Ne.predicate.value,Ke=Ne.object;he in Ie||(Ie[he]={"@id":he});const Ve=Ie[he],ge=Ke.termType.endsWith("Node");if(ge&&!(Ke.value in Ie)&&(Ie[Ke.value]={"@id":Ke.value}),ye===Q&&!z&&ge){E(Ve,"@type",Ke.value,{propertyIsArray:!0});continue}const et=ie(Ke,re,de,N);if(E(Ve,ye,et,{propertyIsArray:!0}),ge)if(Ke.value===L){const ct=Ie[Ke.value];"usages"in ct||(ct.usages=[]),ct.usages.push({node:Ve,property:ye,value:et})}else fe[Ke.value]=!(Ke.value in fe)&&{node:Ve,property:ye,value:et}}for(const Ne in se){const tt=se[Ne];if(!(L in tt))continue;const Ie=tt[L];if(Ie.usages){for(let he of Ie.usages){let ye=he.node,Ke=he.property,Ve=he.value;const ge=[],et=[];let ct=Object.keys(ye).length;for(;Ke===x&&_.isObject(fe[ye["@id"]])&&_.isArray(ye[B])&&1===ye[B].length&&_.isArray(ye[x])&&1===ye[x].length&&(3===ct||4===ct&&_.isArray(ye["@type"])&&1===ye["@type"].length&&ye["@type"][0]===A)&&(ge.push(ye[B][0]),et.push(ye["@id"]),he=fe[ye["@id"]],ye=he.node,Ke=he.property,Ve=he.value,ct=Object.keys(ye).length,D.isBlankNode(ye)););delete Ve["@id"],Ve["@list"]=ge.reverse();for(const gt of et)delete tt[gt]}delete Ie.usages}}const Pe=[],xe=Object.keys(pe).sort();for(const Ne of xe){const tt=pe[Ne];if(Ne in se){const Ie=tt["@graph"]=[],he=se[Ne],ye=Object.keys(he).sort();for(const Ke of ye){const Ve=he[Ke];D.isSubjectReference(Ve)||Ie.push(Ve)}}D.isSubjectReference(tt)||Pe.push(tt)}return Pe});return function(I,N){return ee.apply(this,arguments)}}()},4209(at,Fe,ne){"use strict";const ae=ne(2831),$={};at.exports=$,$.isSubject=D=>!(!ae.isObject(D)||"@value"in D||"@set"in D||"@list"in D)&&(Object.keys(D).length>1||!("@id"in D)),$.isSubjectReference=D=>ae.isObject(D)&&1===Object.keys(D).length&&"@id"in D,$.isValue=D=>ae.isObject(D)&&"@value"in D,$.isList=D=>ae.isObject(D)&&"@list"in D,$.isGraph=D=>ae.isObject(D)&&"@graph"in D&&1===Object.keys(D).filter(_=>"@id"!==_&&"@index"!==_).length,$.isSimpleGraph=D=>$.isGraph(D)&&!("@id"in D),$.isBlankNode=D=>{if(ae.isObject(D)){if("@id"in D){const _=D["@id"];return!ae.isString(_)||0===_.indexOf("_:")}return 0===Object.keys(D).length||!("@value"in D||"@set"in D||"@list"in D)}return!1}},2130(at,Fe,ne){var ae=ne(9293).default;const $=ne(1224),D=ne(8666),_=ne(9420),R=ne(7839),E=_.IdentifierIssuer,w=ne(262),A=ne(3052),B=ne(5426),{expand:x}=ne(7336),{flatten:L}=ne(9392),{fromRDF:Q}=ne(4814),{toRDF:j}=ne(6397),{frameMergedOrDefault:H,cleanupNull:oe}=ne(7031),{isArray:F,isObject:te,isString:k}=ne(2831),{isSubjectReference:ie}=ne(4209),{expandIri:ee,getInitialContext:I,process:N,processingMode:z}=ne(429),{compact:re,compactIri:de}=ne(3763),{createNodeMap:pe,createMergedNodeMap:se,mergeNodeMaps:fe}=ne(5096),{logEventHandler:Pe,logWarningEventHandler:xe,safeEventHandler:Ne,setDefaultEventHandler:tt,setupEventHandler:Ie,strictEventHandler:he,unhandledEventHandler:ye}=ne(2585),Ke=function(ge){const et={},gt=new A({max:100});function Tt(Qe,{documentLoader:st=ge.documentLoader,...Le}){if(Qe&&"compactionMap"in Qe)throw new w('"compactionMap" not supported.',"jsonld.OptionsError");if(Qe&&"expansionMap"in Qe)throw new w('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:st},Le,Qe,{eventHandler:Ie({options:Qe})})}return ge.compact=function(){var Qe=ae(function*(st,Le,Ce){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===Le)throw new w("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===st)return null;let mt;(Ce=Tt(Ce,{base:k(st)?st:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new E("_:b"),contextResolver:new R({sharedCache:gt})})).link&&(Ce.skipExpansion=!0),Ce.compactToRelative||delete Ce.base,mt=Ce.skipExpansion?st:yield ge.expand(st,Ce);const At=yield ge.processContext(I(Ce),Le,Ce);let dt=yield re({activeCtx:At,element:mt,options:Ce});Ce.compactArrays&&!Ce.graph&&F(dt)?1===dt.length?dt=dt[0]:0===dt.length&&(dt={}):Ce.graph&&te(dt)&&(dt=[dt]),te(Le)&&"@context"in Le&&(Le=Le["@context"]),Le=_.clone(Le),F(Le)||(Le=[Le]);const Mt=Le;Le=[];for(let mr=0;mr<Mt.length;++mr)(!te(Mt[mr])||Object.keys(Mt[mr]).length>0)&&Le.push(Mt[mr]);const nr=Le.length>0;if(1===Le.length&&(Le=Le[0]),F(dt)){const mr=de({activeCtx:At,iri:"@graph",relativeTo:{vocab:!0}}),Ct=dt;dt={},nr&&(dt["@context"]=Le),dt[mr]=Ct}else if(te(dt)&&nr){const mr=dt;dt={"@context":Le};for(const Ct in mr)dt[Ct]=mr[Ct]}return dt});return function(st,Le,Ce){return Qe.apply(this,arguments)}}(),ge.expand=function(){var Qe=ae(function*(st,Le){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const Ce={},mt=[];if("expandContext"in(Le=Tt(Le,{keepFreeFloatingNodes:!1,contextResolver:new R({sharedCache:gt})}))){const nr=_.clone(Le.expandContext);Ce.expandContext=te(nr)&&"@context"in nr?nr:{"@context":nr},mt.push(Ce.expandContext)}let At;if(k(st)){const nr=yield ge.get(st,Le);At=nr.documentUrl,Ce.input=nr.document,nr.contextUrl&&(Ce.remoteContext={"@context":nr.contextUrl},mt.push(Ce.remoteContext))}else Ce.input=_.clone(st);"base"in Le||(Le.base=At||"");let dt=I(Le);for(const nr of mt)dt=yield N({activeCtx:dt,localCtx:nr,options:Le});let Mt=yield x({activeCtx:dt,element:Ce.input,options:Le});return te(Mt)&&"@graph"in Mt&&1===Object.keys(Mt).length?Mt=Mt["@graph"]:null===Mt&&(Mt=[]),F(Mt)||(Mt=[Mt]),Mt});return function(st,Le){return Qe.apply(this,arguments)}}(),ge.flatten=function(){var Qe=ae(function*(st,Le,Ce){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");Le="function"==typeof Le?null:Le||null,Ce=Tt(Ce,{base:k(st)?st:"",contextResolver:new R({sharedCache:gt})});const mt=yield ge.expand(st,Ce),At=L(mt);return null===Le?At:(Ce.graph=!0,Ce.skipExpansion=!0,yield ge.compact(At,Le,Ce))});return function(st,Le,Ce){return Qe.apply(this,arguments)}}(),ge.frame=function(){var Qe=ae(function*(st,Le,Ce){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Ce=Tt(Ce,{base:k(st)?st:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new R({sharedCache:gt})}),k(Le)){const Lr=yield ge.get(Le,Ce);if(Le=Lr.document,Lr.contextUrl){let an=Le["@context"];an?F(an)?an.push(Lr.contextUrl):an=[an,Lr.contextUrl]:an=Lr.contextUrl,Le["@context"]=an}}const mt=Le&&Le["@context"]||{},At=yield ge.processContext(I(Ce),mt,Ce);Ce.hasOwnProperty("omitGraph")||(Ce.omitGraph=z(At,1.1)),Ce.hasOwnProperty("pruneBlankNodeIdentifiers")||(Ce.pruneBlankNodeIdentifiers=z(At,1.1));const dt=yield ge.expand(st,Ce),Mt={...Ce};Mt.isFrame=!0,Mt.keepFreeFloatingNodes=!0;const nr=yield ge.expand(Le,Mt),mr=Object.keys(Le).map(Lr=>ee(At,Lr,{vocab:!0}));Mt.merged=!mr.includes("@graph"),Mt.is11=z(At,1.1);const Ct=H(dt,nr,Mt);Mt.graph=!Ce.omitGraph,Mt.skipExpansion=!0,Mt.link={},Mt.framing=!0;let pr=yield ge.compact(Ct,mt,Mt);return Mt.link={},pr=oe(pr,Mt),pr});return function(st,Le,Ce){return Qe.apply(this,arguments)}}(),ge.link=function(){var Qe=ae(function*(st,Le,Ce){const mt={};return Le&&(mt["@context"]=Le),mt["@embed"]="@link",ge.frame(st,mt,Ce)});return function(st,Le,Ce){return Qe.apply(this,arguments)}}(),ge.normalize=ge.canonize=function(){var Qe=ae(function*(st,Le){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(Le=Tt(Le,{base:k(st)?st:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new R({sharedCache:gt})}))){if("application/n-quads"!==Le.inputFormat&&"application/nquads"!==Le.inputFormat)throw new w("Unknown canonicalization input format.","jsonld.CanonizeError");const At=B.parse(st);return $.canonize(At,Le)}const Ce={...Le};delete Ce.format,Ce.produceGeneralizedRdf=!1;const mt=yield ge.toRDF(st,Ce);return $.canonize(mt,Le)});return function(st,Le){return Qe.apply(this,arguments)}}(),ge.fromRDF=function(){var Qe=ae(function*(st,Le){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");Le=Tt(Le,{format:k(st)?"application/n-quads":void 0});const{format:Ce}=Le;let{rdfParser:mt}=Le;if(Ce){if(mt=mt||et[Ce],!mt)throw new w("Unknown input format.","jsonld.UnknownFormat",{format:Ce})}else mt=()=>st;const At=yield mt(st);return Q(At,Le)});return function(st,Le){return Qe.apply(this,arguments)}}(),ge.toRDF=function(){var Qe=ae(function*(st,Le){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let Ce;Ce=(Le=Tt(Le,{base:k(st)?st:"",skipExpansion:!1,contextResolver:new R({sharedCache:gt})})).skipExpansion?st:yield ge.expand(st,Le);const mt=j(Ce,Le);if(Le.format){if("application/n-quads"===Le.format||"application/nquads"===Le.format)return B.serialize(mt);throw new w("Unknown output format.","jsonld.UnknownFormat",{format:Le.format})}return mt});return function(st,Le){return Qe.apply(this,arguments)}}(),ge.createNodeMap=function(){var Qe=ae(function*(st,Le){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");Le=Tt(Le,{base:k(st)?st:"",contextResolver:new R({sharedCache:gt})});const Ce=yield ge.expand(st,Le);return se(Ce,Le)});return function(st,Le){return Qe.apply(this,arguments)}}(),ge.merge=function(){var Qe=ae(function*(st,Le,Ce){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!F(st))throw new TypeError('Could not merge, "docs" must be an array.');Le="function"==typeof Le?null:Le||null,Ce=Tt(Ce,{contextResolver:new R({sharedCache:gt})});const mt=yield Promise.all(st.map(Lr=>{const an={...Ce};return ge.expand(Lr,an)}));let At=!0;"mergeNodes"in Ce&&(At=Ce.mergeNodes);const dt=Ce.issuer||new E("_:b"),Mt={"@default":{}};for(let Lr=0;Lr<mt.length;++Lr){const an=_.relabelBlankNodes(mt[Lr],{issuer:new E("_:b"+Lr+"-")}),Ei=At||0===Lr?Mt:{"@default":{}};if(pe(an,Ei,"@default",dt),Ei!==Mt)for(const yo in Ei){const pn=Ei[yo];if(!(yo in Mt)){Mt[yo]=pn;continue}const _o=Mt[yo];for(const Oi in pn)Oi in _o||(_o[Oi]=pn[Oi])}}const nr=fe(Mt),mr=[],Ct=Object.keys(nr).sort();for(let Lr=0;Lr<Ct.length;++Lr){const an=nr[Ct[Lr]];ie(an)||mr.push(an)}return null===Le?mr:(Ce.graph=!0,Ce.skipExpansion=!0,yield ge.compact(mr,Le,Ce))});return function(st,Le,Ce){return Qe.apply(this,arguments)}}(),Object.defineProperty(ge,"documentLoader",{get:()=>ge._documentLoader,set:Qe=>ge._documentLoader=Qe}),ge.documentLoader=function(){var Qe=ae(function*(st){throw new w("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:st})});return function(st){return Qe.apply(this,arguments)}}(),ge.get=function(){var Qe=ae(function*(st,Le){let Ce;Ce="function"==typeof Le.documentLoader?Le.documentLoader:ge.documentLoader;const mt=yield Ce(st);try{if(!mt.document)throw new w("No remote document found at the given URL.","jsonld.NullRemoteDocument");k(mt.document)&&(mt.document=JSON.parse(mt.document))}catch(At){throw new w("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:At,remoteDoc:mt})}return mt});return function(st,Le){return Qe.apply(this,arguments)}}(),ge.processContext=function(){var Qe=ae(function*(st,Le,Ce){return Ce=Tt(Ce,{base:"",contextResolver:new R({sharedCache:gt})}),null===Le?I(Ce):(Le=_.clone(Le),te(Le)&&"@context"in Le||(Le={"@context":Le}),N({activeCtx:st,localCtx:Le,options:Ce}))});return function(st,Le,Ce){return Qe.apply(this,arguments)}}(),ge.getContextValue=ne(429).getContextValue,ge.documentLoaders={},ge.useDocumentLoader=function(Qe){if(!(Qe in ge.documentLoaders))throw new w('Unknown document loader type: "'+Qe+'"',"jsonld.UnknownDocumentLoader",{type:Qe});ge.documentLoader=ge.documentLoaders[Qe].apply(ge,Array.prototype.slice.call(arguments,1))},ge.registerRDFParser=function(Qe,st){et[Qe]=st},ge.unregisterRDFParser=function(Qe){delete et[Qe]},ge.registerRDFParser("application/n-quads",B.parse),ge.registerRDFParser("application/nquads",B.parse),ge.url=ne(2051),ge.logEventHandler=Pe,ge.logWarningEventHandler=xe,ge.safeEventHandler=Ne,ge.setDefaultEventHandler=tt,ge.strictEventHandler=he,ge.unhandledEventHandler=ye,ge.util=_,Object.assign(ge,_),ge.promises=ge,ge.RequestQueue=ne(4808),ge.JsonLdProcessor=ne(1328)(ge),D.setupGlobals(ge),D.setupDocumentLoaders(ge),ge},Ve=function(){return Ke(function(){return Ve()})};Ke(Ve),at.exports=Ve},5096(at,Fe,ne){"use strict";const{isKeyword:ae}=ne(429),$=ne(4209),D=ne(2831),_=ne(9420),R=ne(262),E={};at.exports=E,E.createMergedNodeMap=(w,A)=>{const B=(A=A||{}).issuer||new _.IdentifierIssuer("_:b"),x={"@default":{}};return E.createNodeMap(w,x,"@default",B),E.mergeNodeMaps(x)},E.createNodeMap=(w,A,B,x,L,Q)=>{if(D.isArray(w)){for(const F of w)E.createNodeMap(F,A,B,x,void 0,Q);return}if(!D.isObject(w))return void(Q&&Q.push(w));if($.isValue(w)){if("@type"in w){let F=w["@type"];0===F.indexOf("_:")&&(w["@type"]=F=x.getId(F))}return void(Q&&Q.push(w))}if(Q&&$.isList(w)){const F=[];return E.createNodeMap(w["@list"],A,B,x,L,F),void Q.push({"@list":F})}if("@type"in w){const F=w["@type"];for(const te of F)0===te.indexOf("_:")&&x.getId(te)}D.isUndefined(L)&&(L=$.isBlankNode(w)?x.getId(w["@id"]):w["@id"]),Q&&Q.push({"@id":L});const j=A[B],H=j[L]=j[L]||{};H["@id"]=L;const oe=Object.keys(w).sort();for(let F of oe){if("@id"===F)continue;if("@reverse"===F){const k={"@id":L},ie=w["@reverse"];for(const ee in ie){const I=ie[ee];for(const N of I){let z=N["@id"];$.isBlankNode(N)&&(z=x.getId(z)),E.createNodeMap(N,A,B,x,z),_.addValue(j[z],ee,k,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===F){L in A||(A[L]={}),E.createNodeMap(w[F],A,L,x);continue}if("@included"===F){E.createNodeMap(w[F],A,B,x);continue}if("@type"!==F&&ae(F)){if("@index"===F&&F in H&&(w[F]!==H[F]||w[F]["@id"]!==H[F]["@id"]))throw new R("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:H});H[F]=w[F];continue}const te=w[F];if(0===F.indexOf("_:")&&(F=x.getId(F)),0!==te.length)for(let k of te)if("@type"===F&&(k=0===k.indexOf("_:")?x.getId(k):k),$.isSubject(k)||$.isSubjectReference(k)){if("@id"in k&&!k["@id"])continue;const ie=$.isBlankNode(k)?x.getId(k["@id"]):k["@id"];_.addValue(H,F,{"@id":ie},{propertyIsArray:!0,allowDuplicate:!1}),E.createNodeMap(k,A,B,x,ie)}else if($.isValue(k))_.addValue(H,F,k,{propertyIsArray:!0,allowDuplicate:!1});else if($.isList(k)){const ie=[];E.createNodeMap(k["@list"],A,B,x,L,ie),k={"@list":ie},_.addValue(H,F,k,{propertyIsArray:!0,allowDuplicate:!1})}else E.createNodeMap(k,A,B,x,L),_.addValue(H,F,k,{propertyIsArray:!0,allowDuplicate:!1});else _.addValue(H,F,[],{propertyIsArray:!0})}},E.mergeNodeMapGraphs=w=>{const A={};for(const B of Object.keys(w).sort())for(const x of Object.keys(w[B]).sort()){const L=w[B][x];x in A||(A[x]={"@id":x});const Q=A[x];for(const j of Object.keys(L).sort())if(ae(j)&&"@type"!==j)Q[j]=_.clone(L[j]);else for(const H of L[j])_.addValue(Q,j,_.clone(H),{propertyIsArray:!0,allowDuplicate:!1})}return A},E.mergeNodeMaps=w=>{const A=w["@default"],B=Object.keys(w).sort();for(const x of B){if("@default"===x)continue;const L=w[x];let Q=A[x];Q?"@graph"in Q||(Q["@graph"]=[]):A[x]=Q={"@id":x,"@graph":[]};const j=Q["@graph"];for(const H of Object.keys(L).sort()){const oe=L[H];$.isSubjectReference(oe)||j.push(oe)}}return A}},8666(at,Fe,ne){"use strict";const ae=ne(3120),$={};at.exports=$,$.setupDocumentLoaders=function(D){typeof XMLHttpRequest<"u"&&(D.documentLoaders.xhr=ae,D.useDocumentLoader("xhr"))},$.setupGlobals=function(D){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:D.JsonLdProcessor})}},6397(at,Fe,ne){"use strict";const{createNodeMap:ae}=ne(5096),{isKeyword:$}=ne(429),D=ne(4209),_=ne(8846),R=ne(262),E=ne(2831),w=ne(9420),{handleEvent:A}=ne(2585),{RDF_FIRST:B,RDF_REST:x,RDF_NIL:L,RDF_TYPE:Q,RDF_JSON_LITERAL:j,RDF_LANGSTRING:H,XSD_BOOLEAN:oe,XSD_DOUBLE:F,XSD_INTEGER:te,XSD_STRING:k}=ne(5315),{isAbsolute:ie}=ne(2051),ee={};function I(re,de,pe,se,fe){const Pe=Object.keys(de).sort();for(const xe of Pe){const Ne=de[xe],tt=Object.keys(Ne).sort();for(let Ie of tt){const he=Ne[Ie];if("@type"===Ie)Ie=Q;else if($(Ie))continue;for(const ye of he){const Ke={termType:xe.startsWith("_:")?"BlankNode":"NamedNode",value:xe};if(!ie(xe)){fe.eventHandler&&A({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:xe}},options:fe});continue}const Ve={termType:Ie.startsWith("_:")?"BlankNode":"NamedNode",value:Ie};if(!ie(Ie)){fe.eventHandler&&A({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:Ie}},options:fe});continue}if("BlankNode"===Ve.termType&&!fe.produceGeneralizedRdf){fe.eventHandler&&A({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:se.getOldIds().find(et=>se.getId(et)===Ie)}},options:fe});continue}const ge=z(ye,se,re,pe,fe.rdfDirection,fe);ge&&re.push({subject:Ke,predicate:Ve,object:ge,graph:pe})}}}}function z(re,de,pe,se,fe,Pe){const xe={};if(D.isValue(re)){xe.termType="Literal",xe.value=void 0,xe.datatype={termType:"NamedNode"};let Ne=re["@value"];const tt=re["@type"]||null;if("@json"===tt)xe.value=_(Ne),xe.datatype.value=j;else if(E.isBoolean(Ne))xe.value=Ne.toString(),xe.datatype.value=tt||oe;else if(E.isDouble(Ne)||tt===F)E.isDouble(Ne)||(Ne=parseFloat(Ne)),xe.value=Ne.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),xe.datatype.value=tt||F;else if(E.isNumber(Ne))xe.value=Ne.toFixed(0),xe.datatype.value=tt||te;else if("@direction"in re&&"i18n-datatype"===fe){const Ie=(re["@language"]||"").toLowerCase();xe.datatype.value=`https://www.w3.org/ns/i18n#${Ie}_${re["@direction"]}`,xe.value=Ne}else{if("@direction"in re&&"compound-literal"===fe)throw new R("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:fe});if("@direction"in re&&fe)throw new R("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:fe});"@language"in re?("@direction"in re&&!fe&&Pe.eventHandler&&A({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:xe.value}},options:Pe}),xe.value=Ne,xe.datatype.value=tt||H,xe.language=re["@language"]):("@direction"in re&&!fe&&Pe.eventHandler&&A({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:xe.value}},options:Pe}),xe.value=Ne,xe.datatype.value=tt||k)}}else if(D.isList(re)){const Ne=function N(re,de,pe,se,fe,Pe){const xe={termType:"NamedNode",value:B},Ne={termType:"NamedNode",value:x},tt={termType:"NamedNode",value:L},Ie=re.pop(),he=Ie?{termType:"BlankNode",value:de.getId()}:tt;let ye=he;for(const Ke of re){const Ve=z(Ke,de,pe,se,fe,Pe),ge={termType:"BlankNode",value:de.getId()};pe.push({subject:ye,predicate:xe,object:Ve,graph:se}),pe.push({subject:ye,predicate:Ne,object:ge,graph:se}),ye=ge}if(Ie){const Ke=z(Ie,de,pe,se,fe,Pe);pe.push({subject:ye,predicate:xe,object:Ke,graph:se}),pe.push({subject:ye,predicate:Ne,object:tt,graph:se})}return he}(re["@list"],de,pe,se,fe,Pe);xe.termType=Ne.termType,xe.value=Ne.value}else{const Ne=E.isObject(re)?re["@id"]:re;xe.termType=Ne.startsWith("_:")?"BlankNode":"NamedNode",xe.value=Ne}return"NamedNode"!==xe.termType||ie(xe.value)?xe:(Pe.eventHandler&&A({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:xe.value}},options:Pe}),null)}at.exports=ee,ee.toRDF=(re,de)=>{const pe=new w.IdentifierIssuer("_:b"),se={"@default":{}};ae(re,se,"@default",pe);const fe=[],Pe=Object.keys(se).sort();for(const xe of Pe){let Ne;if("@default"===xe)Ne={termType:"DefaultGraph",value:""};else{if(!ie(xe)){de.eventHandler&&A({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:xe}},options:de});continue}Ne=xe.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},Ne.value=xe}I(fe,se[xe],Ne,pe,de)}return fe}},2831(at){"use strict";const Fe={};at.exports=Fe,Fe.isArray=Array.isArray,Fe.isBoolean=ne=>"boolean"==typeof ne||"[object Boolean]"===Object.prototype.toString.call(ne),Fe.isDouble=ne=>Fe.isNumber(ne)&&(-1!==String(ne).indexOf(".")||Math.abs(ne)>=1e21),Fe.isEmptyObject=ne=>Fe.isObject(ne)&&0===Object.keys(ne).length,Fe.isNumber=ne=>"number"==typeof ne||"[object Number]"===Object.prototype.toString.call(ne),Fe.isNumeric=ne=>!isNaN(parseFloat(ne))&&isFinite(ne),Fe.isObject=ne=>"[object Object]"===Object.prototype.toString.call(ne),Fe.isString=ne=>"string"==typeof ne||"[object String]"===Object.prototype.toString.call(ne),Fe.isUndefined=ne=>typeof ne>"u"},2051(at,Fe,ne){"use strict";const ae=ne(2831),$={};at.exports=$,$.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},$.parse=(_,R)=>{const E={},w=$.parsers[R||"full"],A=w.regex.exec(_);let B=w.keys.length;for(;B--;)E[w.keys[B]]=void 0===A[B]?null:A[B];return("https"===E.scheme&&"443"===E.port||"http"===E.scheme&&"80"===E.port)&&(E.href=E.href.replace(":"+E.port,""),E.authority=E.authority.replace(":"+E.port,""),E.port=null),E.normalizedPath=$.removeDotSegments(E.path),E},$.prependBase=(_,R)=>{if(null===_||$.isAbsolute(R))return R;(!_||ae.isString(_))&&(_=$.parse(_||""));const E=$.parse(R),w={protocol:_.protocol||""};if(null!==E.authority)w.authority=E.authority,w.path=E.path,w.query=E.query;else if(w.authority=_.authority,""===E.path)w.path=_.path,w.query=null!==E.query?E.query:_.query;else{if(0===E.path.indexOf("/"))w.path=E.path;else{let B=_.path;B=B.substr(0,B.lastIndexOf("/")+1),(B.length>0||_.authority)&&"/"!==B.substr(-1)&&(B+="/"),B+=E.path,w.path=B}w.query=E.query}""!==E.path&&(w.path=$.removeDotSegments(w.path));let A=w.protocol;return null!==w.authority&&(A+="//"+w.authority),A+=w.path,null!==w.query&&(A+="?"+w.query),null!==E.fragment&&(A+="#"+E.fragment),""===A&&(A="./"),A},$.removeBase=(_,R)=>{if(null===_)return R;(!_||ae.isString(_))&&(_=$.parse(_||""));let E="";if(""!==_.href?E+=(_.protocol||"")+"//"+(_.authority||""):R.indexOf("//")&&(E+="//"),0!==R.indexOf(E))return R;const w=$.parse(R.substr(E.length)),A=_.normalizedPath.split("/"),B=w.normalizedPath.split("/"),x=w.fragment||w.query?0:1;for(;A.length>0&&B.length>x&&A[0]===B[0];)A.shift(),B.shift();let L="";if(A.length>0){A.pop();for(let Q=0;Q<A.length;++Q)L+="../"}return L+=B.join("/"),null!==w.query&&(L+="?"+w.query),null!==w.fragment&&(L+="#"+w.fragment),""===L&&(L="./"),L},$.removeDotSegments=_=>{if(0===_.length)return"";const R=_.split("/"),E=[];for(;R.length>0;){const w=R.shift(),A=0===R.length;"."!==w?".."!==w?E.push(w):(E.pop(),A&&E.push("")):A&&E.push("")}return"/"===_[0]&&E.length>0&&""!==E[0]&&E.unshift(""),1===E.length&&""===E[0]?"/":E.join("/")};const D=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;$.isAbsolute=_=>ae.isString(_)&&D.test(_),$.isRelative=_=>ae.isString(_)},9420(at,Fe,ne){"use strict";const ae=ne(4209),$=ne(2831),D=ne(1224).IdentifierIssuer,_=ne(262),E=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,w=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,A=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,x_headers_accept="application/ld+json, application/json",L={};function Q(j,H){if($.isArray(H))for(let oe=0;oe<H.length;++oe)H[oe]=Q(j,H[oe]);else if(ae.isList(H))H["@list"]=Q(j,H["@list"]);else if($.isObject(H)){ae.isBlankNode(H)&&(H["@id"]=j.getId(H["@id"]));const oe=Object.keys(H).sort();for(let F=0;F<oe.length;++F){const te=oe[F];"@id"!==te&&(H[te]=Q(j,H[te]))}}return H}at.exports=L,L.IdentifierIssuer=D,L.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,L.REGEX_KEYWORD=/^@[a-zA-Z]+$/,L.clone=function(j){if(j&&"object"==typeof j){let H;if($.isArray(j)){H=[];for(let oe=0;oe<j.length;++oe)H[oe]=L.clone(j[oe])}else if(j instanceof Map){H=new Map;for(const[oe,F]of j)H.set(oe,L.clone(F))}else if(j instanceof Set){H=new Set;for(const oe of j)H.add(L.clone(oe))}else if($.isObject(j)){H={};for(const oe in j)H[oe]=L.clone(j[oe])}else H=j.toString();return H}return j},L.asArray=function(j){return Array.isArray(j)?j:[j]},L.buildHeaders=(j={})=>{if(Object.keys(j).some(oe=>"accept"===oe.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+x_headers_accept+'" is supported.');return Object.assign({Accept:x_headers_accept},j)},L.parseLinkHeader=j=>{const H={},oe=j.match(E);for(let F=0;F<oe.length;++F){let te=oe[F].match(w);if(!te)continue;const k={target:te[1]},ie=te[2];for(;te=A.exec(ie);)k[te[1]]=void 0===te[2]?te[3]:te[2];const ee=k.rel||"";Array.isArray(H[ee])?H[ee].push(k):H[ee]=H.hasOwnProperty(ee)?[H[ee],k]:k}return H},L.validateTypeValue=(j,H)=>{if(!($.isString(j)||$.isArray(j)&&j.every(oe=>$.isString(oe)))){if(H&&$.isObject(j))switch(Object.keys(j).length){case 0:return;case 1:if("@default"in j&&L.asArray(j["@default"]).every(oe=>$.isString(oe)))return}throw new _('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:j})}},L.hasProperty=(j,H)=>{if(j.hasOwnProperty(H)){const oe=j[H];return!$.isArray(oe)||oe.length>0}return!1},L.hasValue=(j,H,oe)=>{if(L.hasProperty(j,H)){let F=j[H];const te=ae.isList(F);if($.isArray(F)||te){te&&(F=F["@list"]);for(let k=0;k<F.length;++k)if(L.compareValues(oe,F[k]))return!0}else if(!$.isArray(oe))return L.compareValues(oe,F)}return!1},L.addValue=(j,H,oe,F)=>{if("propertyIsArray"in(F=F||{})||(F.propertyIsArray=!1),"valueIsArray"in F||(F.valueIsArray=!1),"allowDuplicate"in F||(F.allowDuplicate=!0),"prependValue"in F||(F.prependValue=!1),F.valueIsArray)j[H]=oe;else if($.isArray(oe)){0===oe.length&&F.propertyIsArray&&!j.hasOwnProperty(H)&&(j[H]=[]),F.prependValue&&(oe=oe.concat(j[H]),j[H]=[]);for(let te=0;te<oe.length;++te)L.addValue(j,H,oe[te],F)}else if(j.hasOwnProperty(H)){const te=!F.allowDuplicate&&L.hasValue(j,H,oe);!$.isArray(j[H])&&(!te||F.propertyIsArray)&&(j[H]=[j[H]]),te||(F.prependValue?j[H].unshift(oe):j[H].push(oe))}else j[H]=F.propertyIsArray?[oe]:oe},L.getValues=(j,H)=>[].concat(j[H]||[]),L.removeProperty=(j,H)=>{delete j[H]},L.removeValue=(j,H,oe,F)=>{"propertyIsArray"in(F=F||{})||(F.propertyIsArray=!1);const te=L.getValues(j,H).filter(k=>!L.compareValues(k,oe));0===te.length?L.removeProperty(j,H):j[H]=1!==te.length||F.propertyIsArray?te:te[0]},L.relabelBlankNodes=(j,H)=>Q((H=H||{}).issuer||new D("_:b"),j),L.compareValues=(j,H)=>!!(j===H||ae.isValue(j)&&ae.isValue(H)&&j["@value"]===H["@value"]&&j["@type"]===H["@type"]&&j["@language"]===H["@language"]&&j["@index"]===H["@index"])||!!($.isObject(j)&&"@id"in j&&$.isObject(H)&&"@id"in H)&&j["@id"]===H["@id"],L.compareShortestLeast=(j,H)=>j.length<H.length?-1:H.length<j.length?1:j===H?0:j<H?-1:1},3052(at,Fe,ne){"use strict";const ae=ne(4842),$=Symbol("max"),D=Symbol("length"),_=Symbol("lengthCalculator"),R=Symbol("allowStale"),E=Symbol("maxAge"),w=Symbol("dispose"),A=Symbol("noDisposeOnSet"),B=Symbol("lruList"),x=Symbol("cache"),L=Symbol("updateAgeOnGet"),Q=()=>1,H=(ee,I,N)=>{const z=ee[x].get(I);if(z){const re=z.value;if(oe(ee,re)){if(te(ee,z),!ee[R])return}else N&&(ee[L]&&(z.value.now=Date.now()),ee[B].unshiftNode(z));return re.value}},oe=(ee,I)=>{if(!I||!I.maxAge&&!ee[E])return!1;const N=Date.now()-I.now;return I.maxAge?N>I.maxAge:ee[E]&&N>ee[E]},F=ee=>{if(ee[D]>ee[$])for(let I=ee[B].tail;ee[D]>ee[$]&&null!==I;){const N=I.prev;te(ee,I),I=N}},te=(ee,I)=>{if(I){const N=I.value;ee[w]&&ee[w](N.key,N.value),ee[D]-=N.length,ee[x].delete(N.key),ee[B].removeNode(I)}};class k{constructor(I,N,z,re,de){this.key=I,this.value=N,this.length=z,this.now=re,this.maxAge=de||0}}const ie=(ee,I,N,z)=>{let re=N.value;oe(ee,re)&&(te(ee,N),ee[R]||(re=void 0)),re&&I.call(z,re.value,re.key,ee)};at.exports=class j{constructor(I){if("number"==typeof I&&(I={max:I}),I||(I={}),I.max&&("number"!=typeof I.max||I.max<0))throw new TypeError("max must be a non-negative number");this[$]=I.max||1/0;const z=I.length||Q;if(this[_]="function"!=typeof z?Q:z,this[R]=I.stale||!1,I.maxAge&&"number"!=typeof I.maxAge)throw new TypeError("maxAge must be a number");this[E]=I.maxAge||0,this[w]=I.dispose,this[A]=I.noDisposeOnSet||!1,this[L]=I.updateAgeOnGet||!1,this.reset()}set max(I){if("number"!=typeof I||I<0)throw new TypeError("max must be a non-negative number");this[$]=I||1/0,F(this)}get max(){return this[$]}set allowStale(I){this[R]=!!I}get allowStale(){return this[R]}set maxAge(I){if("number"!=typeof I)throw new TypeError("maxAge must be a non-negative number");this[E]=I,F(this)}get maxAge(){return this[E]}set lengthCalculator(I){"function"!=typeof I&&(I=Q),I!==this[_]&&(this[_]=I,this[D]=0,this[B].forEach(N=>{N.length=this[_](N.value,N.key),this[D]+=N.length})),F(this)}get lengthCalculator(){return this[_]}get length(){return this[D]}get itemCount(){return this[B].length}rforEach(I,N){N=N||this;for(let z=this[B].tail;null!==z;){const re=z.prev;ie(this,I,z,N),z=re}}forEach(I,N){N=N||this;for(let z=this[B].head;null!==z;){const re=z.next;ie(this,I,z,N),z=re}}keys(){return this[B].toArray().map(I=>I.key)}values(){return this[B].toArray().map(I=>I.value)}reset(){this[w]&&this[B]&&this[B].length&&this[B].forEach(I=>this[w](I.key,I.value)),this[x]=new Map,this[B]=new ae,this[D]=0}dump(){return this[B].map(I=>!oe(this,I)&&{k:I.key,v:I.value,e:I.now+(I.maxAge||0)}).toArray().filter(I=>I)}dumpLru(){return this[B]}set(I,N,z){if((z=z||this[E])&&"number"!=typeof z)throw new TypeError("maxAge must be a number");const re=z?Date.now():0,de=this[_](N,I);if(this[x].has(I)){if(de>this[$])return te(this,this[x].get(I)),!1;const fe=this[x].get(I).value;return this[w]&&(this[A]||this[w](I,fe.value)),fe.now=re,fe.maxAge=z,fe.value=N,this[D]+=de-fe.length,fe.length=de,this.get(I),F(this),!0}const pe=new k(I,N,de,re,z);return pe.length>this[$]?(this[w]&&this[w](I,N),!1):(this[D]+=pe.length,this[B].unshift(pe),this[x].set(I,this[B].head),F(this),!0)}has(I){if(!this[x].has(I))return!1;const N=this[x].get(I).value;return!oe(this,N)}get(I){return H(this,I,!0)}peek(I){return H(this,I,!1)}pop(){const I=this[B].tail;return I?(te(this,I),I.value):null}del(I){te(this,this[x].get(I))}load(I){this.reset();const N=Date.now();for(let z=I.length-1;z>=0;z--){const re=I[z],de=re.e||0;if(0===de)this.set(re.k,re.v);else{const pe=de-N;pe>0&&this.set(re.k,re.v,pe)}}}prune(){this[x].forEach((I,N)=>H(this,N,!1))}}},7568(at){"use strict";at.exports=function(Fe){Fe.prototype[Symbol.iterator]=function*(){for(let ne=this.head;ne;ne=ne.next)yield ne.value}}},4842(at,Fe,ne){"use strict";function ae(E){var w=this;if(w instanceof ae||(w=new ae),w.tail=null,w.head=null,w.length=0,E&&"function"==typeof E.forEach)E.forEach(function(x){w.push(x)});else if(arguments.length>0)for(var A=0,B=arguments.length;A<B;A++)w.push(arguments[A]);return w}function $(E,w,A){var B=w===E.head?new R(A,null,w,E):new R(A,w,w.next,E);return null===B.next&&(E.tail=B),null===B.prev&&(E.head=B),E.length++,B}function D(E,w){E.tail=new R(w,E.tail,null,E),E.head||(E.head=E.tail),E.length++}function _(E,w){E.head=new R(w,null,E.head,E),E.tail||(E.tail=E.head),E.length++}function R(E,w,A,B){if(!(this instanceof R))return new R(E,w,A,B);this.list=B,this.value=E,w?(w.next=this,this.prev=w):this.prev=null,A?(A.prev=this,this.next=A):this.next=null}at.exports=ae,ae.Node=R,ae.create=ae,ae.prototype.removeNode=function(E){if(E.list!==this)throw new Error("removing node which does not belong to this list");var w=E.next,A=E.prev;return w&&(w.prev=A),A&&(A.next=w),E===this.head&&(this.head=w),E===this.tail&&(this.tail=A),E.list.length--,E.next=null,E.prev=null,E.list=null,w},ae.prototype.unshiftNode=function(E){if(E!==this.head){E.list&&E.list.removeNode(E);var w=this.head;E.list=this,E.next=w,w&&(w.prev=E),this.head=E,this.tail||(this.tail=E),this.length++}},ae.prototype.pushNode=function(E){if(E!==this.tail){E.list&&E.list.removeNode(E);var w=this.tail;E.list=this,E.prev=w,w&&(w.next=E),this.tail=E,this.head||(this.head=E),this.length++}},ae.prototype.push=function(){for(var E=0,w=arguments.length;E<w;E++)D(this,arguments[E]);return this.length},ae.prototype.unshift=function(){for(var E=0,w=arguments.length;E<w;E++)_(this,arguments[E]);return this.length},ae.prototype.pop=function(){if(this.tail){var E=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,E}},ae.prototype.shift=function(){if(this.head){var E=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,E}},ae.prototype.forEach=function(E,w){w=w||this;for(var A=this.head,B=0;null!==A;B++)E.call(w,A.value,B,this),A=A.next},ae.prototype.forEachReverse=function(E,w){w=w||this;for(var A=this.tail,B=this.length-1;null!==A;B--)E.call(w,A.value,B,this),A=A.prev},ae.prototype.get=function(E){for(var w=0,A=this.head;null!==A&&w<E;w++)A=A.next;if(w===E&&null!==A)return A.value},ae.prototype.getReverse=function(E){for(var w=0,A=this.tail;null!==A&&w<E;w++)A=A.prev;if(w===E&&null!==A)return A.value},ae.prototype.map=function(E,w){w=w||this;for(var A=new ae,B=this.head;null!==B;)A.push(E.call(w,B.value,this)),B=B.next;return A},ae.prototype.mapReverse=function(E,w){w=w||this;for(var A=new ae,B=this.tail;null!==B;)A.push(E.call(w,B.value,this)),B=B.prev;return A},ae.prototype.reduce=function(E,w){var A,B=this.head;if(arguments.length>1)A=w;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");B=this.head.next,A=this.head.value}for(var x=0;null!==B;x++)A=E(A,B.value,x),B=B.next;return A},ae.prototype.reduceReverse=function(E,w){var A,B=this.tail;if(arguments.length>1)A=w;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");B=this.tail.prev,A=this.tail.value}for(var x=this.length-1;null!==B;x--)A=E(A,B.value,x),B=B.prev;return A},ae.prototype.toArray=function(){for(var E=new Array(this.length),w=0,A=this.head;null!==A;w++)E[w]=A.value,A=A.next;return E},ae.prototype.toArrayReverse=function(){for(var E=new Array(this.length),w=0,A=this.tail;null!==A;w++)E[w]=A.value,A=A.prev;return E},ae.prototype.slice=function(E,w){(w=w||this.length)<0&&(w+=this.length),(E=E||0)<0&&(E+=this.length);var A=new ae;if(w<E||w<0)return A;E<0&&(E=0),w>this.length&&(w=this.length);for(var B=0,x=this.head;null!==x&&B<E;B++)x=x.next;for(;null!==x&&B<w;B++,x=x.next)A.push(x.value);return A},ae.prototype.sliceReverse=function(E,w){(w=w||this.length)<0&&(w+=this.length),(E=E||0)<0&&(E+=this.length);var A=new ae;if(w<E||w<0)return A;E<0&&(E=0),w>this.length&&(w=this.length);for(var B=this.length,x=this.tail;null!==x&&B>w;B--)x=x.prev;for(;null!==x&&B>E;B--,x=x.prev)A.push(x.value);return A},ae.prototype.splice=function(E,w,...A){E>this.length&&(E=this.length-1),E<0&&(E=this.length+E);for(var B=0,x=this.head;null!==x&&B<E;B++)x=x.next;var L=[];for(B=0;x&&B<w;B++)L.push(x.value),x=this.removeNode(x);for(null===x&&(x=this.tail),x!==this.head&&x!==this.tail&&(x=x.prev),B=0;B<A.length;B++)x=$(this,x,A[B]);return L},ae.prototype.reverse=function(){for(var E=this.head,w=this.tail,A=E;null!==A;A=A.prev){var B=A.prev;A.prev=A.next,A.next=B}return this.head=w,this.tail=E,this};try{ne(7568)(ae)}catch{}},6556(at){at.exports=function(Fe){var ne={};function ae($){if(ne[$])return ne[$].exports;var D=ne[$]={i:$,l:!1,exports:{}};return Fe[$].call(D.exports,D,D.exports,ae),D.l=!0,D.exports}return ae.m=Fe,ae.c=ne,ae.i=function($){return $},ae.d=function($,D,_){ae.o($,D)||Object.defineProperty($,D,{configurable:!1,enumerable:!0,get:_})},ae.n=function($){var D=$&&$.__esModule?function(){return $.default}:function(){return $};return ae.d(D,"a",D),D},ae.o=function($,D){return Object.prototype.hasOwnProperty.call($,D)},ae.p="",ae(ae.s=26)}([function(Fe,ne,ae){"use strict";function $(){}$.QUALITY=1,$.DEFAULT_CREATE_BENDS_AS_NEEDED=!1,$.DEFAULT_INCREMENTAL=!1,$.DEFAULT_ANIMATION_ON_LAYOUT=!0,$.DEFAULT_ANIMATION_DURING_LAYOUT=!1,$.DEFAULT_ANIMATION_PERIOD=50,$.DEFAULT_UNIFORM_LEAF_NODE_SIZES=!1,$.DEFAULT_GRAPH_MARGIN=15,$.NODE_DIMENSIONS_INCLUDE_LABELS=!1,$.SIMPLE_NODE_HALF_SIZE=($.SIMPLE_NODE_SIZE=40)/2,$.EMPTY_COMPOUND_NODE_SIZE=40,$.MIN_EDGE_LENGTH=1,$.INITIAL_WORLD_BOUNDARY=($.WORLD_BOUNDARY=1e6)/1e3,$.WORLD_CENTER_X=1200,$.WORLD_CENTER_Y=900,Fe.exports=$},function(Fe,ne,ae){"use strict";var $=ae(2),D=ae(8),_=ae(9);function R(w,A,B){$.call(this,B),this.isOverlapingSourceAndTarget=!1,this.vGraphObject=B,this.bendpoints=[],this.source=w,this.target=A}for(var E in R.prototype=Object.create($.prototype),$)R[E]=$[E];R.prototype.getSource=function(){return this.source},R.prototype.getTarget=function(){return this.target},R.prototype.isInterGraph=function(){return this.isInterGraph},R.prototype.getLength=function(){return this.length},R.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget},R.prototype.getBendpoints=function(){return this.bendpoints},R.prototype.getLca=function(){return this.lca},R.prototype.getSourceInLca=function(){return this.sourceInLca},R.prototype.getTargetInLca=function(){return this.targetInLca},R.prototype.getOtherEnd=function(w){if(this.source===w)return this.target;if(this.target===w)return this.source;throw"Node is not incident with this edge"},R.prototype.getOtherEndInGraph=function(w,A){for(var B=this.getOtherEnd(w),x=A.getGraphManager().getRoot();;){if(B.getOwner()==A)return B;if(B.getOwner()==x)break;B=B.getOwner().getParent()}return null},R.prototype.updateLength=function(){var w=new Array(4);this.isOverlapingSourceAndTarget=D.getIntersection(this.target.getRect(),this.source.getRect(),w),this.isOverlapingSourceAndTarget||(this.lengthX=w[0]-w[2],this.lengthY=w[1]-w[3],Math.abs(this.lengthX)<1&&(this.lengthX=_.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=_.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY))},R.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX(),this.lengthY=this.target.getCenterY()-this.source.getCenterY(),Math.abs(this.lengthX)<1&&(this.lengthX=_.sign(this.lengthX)),Math.abs(this.lengthY)<1&&(this.lengthY=_.sign(this.lengthY)),this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)},Fe.exports=R},function(Fe,ne,ae){"use strict";Fe.exports=function $(D){this.vGraphObject=D}},function(Fe,ne,ae){"use strict";var $=ae(2),D=ae(10),_=ae(13),R=ae(0),E=ae(16),w=ae(4);function A(x,L,Q,j){null==Q&&null==j&&(j=L),$.call(this,j),null!=x.graphManager&&(x=x.graphManager),this.estimatedSize=D.MIN_VALUE,this.inclusionTreeDepth=D.MAX_VALUE,this.vGraphObject=j,this.edges=[],this.graphManager=x,this.rect=null!=Q&&null!=L?new _(L.x,L.y,Q.width,Q.height):new _}for(var B in A.prototype=Object.create($.prototype),$)A[B]=$[B];A.prototype.getEdges=function(){return this.edges},A.prototype.getChild=function(){return this.child},A.prototype.getOwner=function(){return this.owner},A.prototype.getWidth=function(){return this.rect.width},A.prototype.setWidth=function(x){this.rect.width=x},A.prototype.getHeight=function(){return this.rect.height},A.prototype.setHeight=function(x){this.rect.height=x},A.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2},A.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2},A.prototype.getCenter=function(){return new w(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)},A.prototype.getLocation=function(){return new w(this.rect.x,this.rect.y)},A.prototype.getRect=function(){return this.rect},A.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)},A.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2},A.prototype.setRect=function(x,L){this.rect.x=x.x,this.rect.y=x.y,this.rect.width=L.width,this.rect.height=L.height},A.prototype.setCenter=function(x,L){this.rect.x=x-this.rect.width/2,this.rect.y=L-this.rect.height/2},A.prototype.setLocation=function(x,L){this.rect.x=x,this.rect.y=L},A.prototype.moveBy=function(x,L){this.rect.x+=x,this.rect.y+=L},A.prototype.getEdgeListToNode=function(x){var L=[],j=this;return j.edges.forEach(function(H){if(H.target==x){if(H.source!=j)throw"Incorrect edge source!";L.push(H)}}),L},A.prototype.getEdgesBetween=function(x){var L=[],j=this;return j.edges.forEach(function(H){if(H.source!=j&&H.target!=j)throw"Incorrect edge source and/or target";(H.target==x||H.source==x)&&L.push(H)}),L},A.prototype.getNeighborsList=function(){var x=new Set,L=this;return L.edges.forEach(function(Q){if(Q.source==L)x.add(Q.target);else{if(Q.target!=L)throw"Incorrect incidency!";x.add(Q.source)}}),x},A.prototype.withChildren=function(){var x=new Set;if(x.add(this),null!=this.child)for(var j=this.child.getNodes(),H=0;H<j.length;H++)j[H].withChildren().forEach(function(oe){x.add(oe)});return x},A.prototype.getNoOfChildren=function(){var x=0;if(null==this.child)x=1;else for(var Q=this.child.getNodes(),j=0;j<Q.length;j++)x+=Q[j].getNoOfChildren();return 0==x&&(x=1),x},A.prototype.getEstimatedSize=function(){if(this.estimatedSize==D.MIN_VALUE)throw"assert failed";return this.estimatedSize},A.prototype.calcEstimatedSize=function(){return null==this.child?this.estimatedSize=(this.rect.width+this.rect.height)/2:(this.estimatedSize=this.child.calcEstimatedSize(),this.rect.width=this.estimatedSize,this.rect.height=this.estimatedSize,this.estimatedSize)},A.prototype.scatter=function(){var x,L,Q=-R.INITIAL_WORLD_BOUNDARY,j=R.INITIAL_WORLD_BOUNDARY;x=R.WORLD_CENTER_X+E.nextDouble()*(j-Q)+Q;var H=-R.INITIAL_WORLD_BOUNDARY,oe=R.INITIAL_WORLD_BOUNDARY;L=R.WORLD_CENTER_Y+E.nextDouble()*(oe-H)+H,this.rect.x=x,this.rect.y=L},A.prototype.updateBounds=function(){if(null==this.getChild())throw"assert failed";if(0!=this.getChild().getNodes().length){var x=this.getChild();if(x.updateBounds(!0),this.rect.x=x.getLeft(),this.rect.y=x.getTop(),this.setWidth(x.getRight()-x.getLeft()),this.setHeight(x.getBottom()-x.getTop()),R.NODE_DIMENSIONS_INCLUDE_LABELS){var L=x.getRight()-x.getLeft(),Q=x.getBottom()-x.getTop();this.labelWidth>L&&(this.rect.x-=(this.labelWidth-L)/2,this.setWidth(this.labelWidth)),this.labelHeight>Q&&("center"==this.labelPos?this.rect.y-=(this.labelHeight-Q)/2:"top"==this.labelPos&&(this.rect.y-=this.labelHeight-Q),this.setHeight(this.labelHeight))}}},A.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==D.MAX_VALUE)throw"assert failed";return this.inclusionTreeDepth},A.prototype.transform=function(x){var L=this.rect.x;L>R.WORLD_BOUNDARY?L=R.WORLD_BOUNDARY:L<-R.WORLD_BOUNDARY&&(L=-R.WORLD_BOUNDARY);var Q=this.rect.y;Q>R.WORLD_BOUNDARY?Q=R.WORLD_BOUNDARY:Q<-R.WORLD_BOUNDARY&&(Q=-R.WORLD_BOUNDARY);var j=new w(L,Q),H=x.inverseTransformPoint(j);this.setLocation(H.x,H.y)},A.prototype.getLeft=function(){return this.rect.x},A.prototype.getRight=function(){return this.rect.x+this.rect.width},A.prototype.getTop=function(){return this.rect.y},A.prototype.getBottom=function(){return this.rect.y+this.rect.height},A.prototype.getParent=function(){return null==this.owner?null:this.owner.getParent()},Fe.exports=A},function(Fe,ne,ae){"use strict";function $(D,_){null==D&&null==_?(this.x=0,this.y=0):(this.x=D,this.y=_)}$.prototype.getX=function(){return this.x},$.prototype.getY=function(){return this.y},$.prototype.setX=function(D){this.x=D},$.prototype.setY=function(D){this.y=D},$.prototype.getDifference=function(D){return new DimensionD(this.x-D.x,this.y-D.y)},$.prototype.getCopy=function(){return new $(this.x,this.y)},$.prototype.translate=function(D){return this.x+=D.width,this.y+=D.height,this},Fe.exports=$},function(Fe,ne,ae){"use strict";var $=ae(2),D=ae(10),_=ae(0),R=ae(6),E=ae(3),w=ae(1),A=ae(13),B=ae(12),x=ae(11);function L(j,H,oe){$.call(this,oe),this.estimatedSize=D.MIN_VALUE,this.margin=_.DEFAULT_GRAPH_MARGIN,this.edges=[],this.nodes=[],this.isConnected=!1,this.parent=j,null!=H&&H instanceof R?this.graphManager=H:null!=H&&H instanceof Layout&&(this.graphManager=H.graphManager)}for(var Q in L.prototype=Object.create($.prototype),$)L[Q]=$[Q];L.prototype.getNodes=function(){return this.nodes},L.prototype.getEdges=function(){return this.edges},L.prototype.getGraphManager=function(){return this.graphManager},L.prototype.getParent=function(){return this.parent},L.prototype.getLeft=function(){return this.left},L.prototype.getRight=function(){return this.right},L.prototype.getTop=function(){return this.top},L.prototype.getBottom=function(){return this.bottom},L.prototype.isConnected=function(){return this.isConnected},L.prototype.add=function(j,H,oe){if(null==H&&null==oe){var F=j;if(null==this.graphManager)throw"Graph has no graph mgr!";if(this.getNodes().indexOf(F)>-1)throw"Node already in graph!";return F.owner=this,this.getNodes().push(F),F}var te=j;if(!(this.getNodes().indexOf(H)>-1&&this.getNodes().indexOf(oe)>-1))throw"Source or target not in graph!";if(H.owner!=oe.owner||H.owner!=this)throw"Both owners must be this graph!";return H.owner!=oe.owner?null:(te.source=H,te.target=oe,te.isInterGraph=!1,this.getEdges().push(te),H.edges.push(te),oe!=H&&oe.edges.push(te),te)},L.prototype.remove=function(j){var H=j;if(j instanceof E){if(null==H)throw"Node is null!";if(null==H.owner||H.owner!=this)throw"Owner graph is invalid!";if(null==this.graphManager)throw"Owner graph manager is invalid!";for(var oe=H.edges.slice(),te=oe.length,k=0;k<te;k++)(F=oe[k]).isInterGraph?this.graphManager.remove(F):F.source.owner.remove(F);if(-1==(ie=this.nodes.indexOf(H)))throw"Node not in owner node list!";this.nodes.splice(ie,1)}else if(j instanceof w){var F;if(null==(F=j))throw"Edge is null!";if(null==F.source||null==F.target)throw"Source and/or target is null!";if(null==F.source.owner||null==F.target.owner||F.source.owner!=this||F.target.owner!=this)throw"Source and/or target owner is invalid!";var ie,ee=F.source.edges.indexOf(F),I=F.target.edges.indexOf(F);if(!(ee>-1&&I>-1))throw"Source and/or target doesn't know this edge!";if(F.source.edges.splice(ee,1),F.target!=F.source&&F.target.edges.splice(I,1),-1==(ie=F.source.owner.getEdges().indexOf(F)))throw"Not in owner's edge list!";F.source.owner.getEdges().splice(ie,1)}},L.prototype.updateLeftTop=function(){for(var oe,F,te,j=D.MAX_VALUE,H=D.MAX_VALUE,k=this.getNodes(),ie=k.length,ee=0;ee<ie;ee++){var I=k[ee];j>(oe=I.getTop())&&(j=oe),H>(F=I.getLeft())&&(H=F)}return j==D.MAX_VALUE?null:(te=null!=k[0].getParent().paddingLeft?k[0].getParent().paddingLeft:this.margin,this.left=H-te,this.top=j-te,new B(this.left,this.top))},L.prototype.updateBounds=function(j){for(var k,ie,ee,I,N,H=D.MAX_VALUE,oe=-D.MAX_VALUE,F=D.MAX_VALUE,te=-D.MAX_VALUE,z=this.nodes,re=z.length,de=0;de<re;de++){var pe=z[de];j&&null!=pe.child&&pe.updateBounds(),H>(k=pe.getLeft())&&(H=k),oe<(ie=pe.getRight())&&(oe=ie),F>(ee=pe.getTop())&&(F=ee),te<(I=pe.getBottom())&&(te=I)}var se=new A(H,F,oe-H,te-F);H==D.MAX_VALUE&&(this.left=this.parent.getLeft(),this.right=this.parent.getRight(),this.top=this.parent.getTop(),this.bottom=this.parent.getBottom()),N=null!=z[0].getParent().paddingLeft?z[0].getParent().paddingLeft:this.margin,this.left=se.x-N,this.right=se.x+se.width+N,this.top=se.y-N,this.bottom=se.y+se.height+N},L.calculateBounds=function(j){for(var k,ie,ee,I,H=D.MAX_VALUE,oe=-D.MAX_VALUE,F=D.MAX_VALUE,te=-D.MAX_VALUE,N=j.length,z=0;z<N;z++){var re=j[z];H>(k=re.getLeft())&&(H=k),oe<(ie=re.getRight())&&(oe=ie),F>(ee=re.getTop())&&(F=ee),te<(I=re.getBottom())&&(te=I)}return new A(H,F,oe-H,te-F)},L.prototype.getInclusionTreeDepth=function(){return this==this.graphManager.getRoot()?1:this.parent.getInclusionTreeDepth()},L.prototype.getEstimatedSize=function(){if(this.estimatedSize==D.MIN_VALUE)throw"assert failed";return this.estimatedSize},L.prototype.calcEstimatedSize=function(){for(var j=0,H=this.nodes,oe=H.length,F=0;F<oe;F++)j+=H[F].calcEstimatedSize();return this.estimatedSize=0==j?_.EMPTY_COMPOUND_NODE_SIZE:j/Math.sqrt(this.nodes.length),this.estimatedSize},L.prototype.updateConnected=function(){var j=this;if(0!=this.nodes.length){var te,k,H=new x,oe=new Set,F=this.nodes[0];for(F.withChildren().forEach(function(de){H.push(de),oe.add(de)});0!==H.length;)for(var ee=(te=(F=H.shift()).getEdges()).length,I=0;I<ee;I++)null==(k=te[I].getOtherEndInGraph(F,this))||oe.has(k)||k.withChildren().forEach(function(de){H.push(de),oe.add(de)});if(this.isConnected=!1,oe.size>=this.nodes.length){var re=0;oe.forEach(function(de){de.owner==j&&re++}),re==this.nodes.length&&(this.isConnected=!0)}}else this.isConnected=!0},Fe.exports=L},function(Fe,ne,ae){"use strict";var $,D=ae(1);function _(R){$=ae(5),this.layout=R,this.graphs=[],this.edges=[]}_.prototype.addRoot=function(){var R=this.layout.newGraph(),E=this.layout.newNode(null),w=this.add(R,E);return this.setRootGraph(w),this.rootGraph},_.prototype.add=function(R,E,w,A,B){if(null==w&&null==A&&null==B){if(null==R)throw"Graph is null!";if(null==E)throw"Parent node is null!";if(this.graphs.indexOf(R)>-1)throw"Graph already in this graph mgr!";if(this.graphs.push(R),null!=R.parent)throw"Already has a parent!";if(null!=E.child)throw"Already has a child!";return R.parent=E,E.child=R,R}B=w,w=R;var x=(A=E).getOwner(),L=B.getOwner();if(null==x||x.getGraphManager()!=this)throw"Source not in this graph mgr!";if(null==L||L.getGraphManager()!=this)throw"Target not in this graph mgr!";if(x==L)return w.isInterGraph=!1,x.add(w,A,B);if(w.isInterGraph=!0,w.source=A,w.target=B,this.edges.indexOf(w)>-1)throw"Edge already in inter-graph edge list!";if(this.edges.push(w),null==w.source||null==w.target)throw"Edge source and/or target is null!";if(-1!=w.source.edges.indexOf(w)||-1!=w.target.edges.indexOf(w))throw"Edge already in source and/or target incidency list!";return w.source.edges.push(w),w.target.edges.push(w),w},_.prototype.remove=function(R){if(R instanceof $){var E=R;if(E.getGraphManager()!=this)throw"Graph not in this graph mgr";if(E!=this.rootGraph&&(null==E.parent||E.parent.graphManager!=this))throw"Invalid parent node!";for(var A,w=[],B=(w=w.concat(E.getEdges())).length,x=0;x<B;x++)E.remove(A=w[x]);var L=[];for(B=(L=L.concat(E.getNodes())).length,x=0;x<B;x++)E.remove(L[x]);E==this.rootGraph&&this.setRootGraph(null);var j=this.graphs.indexOf(E);this.graphs.splice(j,1),E.parent=null}else if(R instanceof D){if(null==(A=R))throw"Edge is null!";if(!A.isInterGraph)throw"Not an inter-graph edge!";if(null==A.source||null==A.target)throw"Source and/or target is null!";if(-1==A.source.edges.indexOf(A)||-1==A.target.edges.indexOf(A))throw"Source and/or target doesn't know this edge!";if(j=A.source.edges.indexOf(A),A.source.edges.splice(j,1),j=A.target.edges.indexOf(A),A.target.edges.splice(j,1),null==A.source.owner||null==A.source.owner.getGraphManager())throw"Edge owner graph or owner graph manager is null!";if(-1==A.source.owner.getGraphManager().edges.indexOf(A))throw"Not in owner graph manager's edge list!";j=A.source.owner.getGraphManager().edges.indexOf(A),A.source.owner.getGraphManager().edges.splice(j,1)}},_.prototype.updateBounds=function(){this.rootGraph.updateBounds(!0)},_.prototype.getGraphs=function(){return this.graphs},_.prototype.getAllNodes=function(){if(null==this.allNodes){for(var R=[],E=this.getGraphs(),w=E.length,A=0;A<w;A++)R=R.concat(E[A].getNodes());this.allNodes=R}return this.allNodes},_.prototype.resetAllNodes=function(){this.allNodes=null},_.prototype.resetAllEdges=function(){this.allEdges=null},_.prototype.resetAllNodesToApplyGravitation=function(){this.allNodesToApplyGravitation=null},_.prototype.getAllEdges=function(){if(null==this.allEdges){for(var R=[],E=this.getGraphs(),A=0;A<E.length;A++)R=R.concat(E[A].getEdges());R=R.concat(this.edges),this.allEdges=R}return this.allEdges},_.prototype.getAllNodesToApplyGravitation=function(){return this.allNodesToApplyGravitation},_.prototype.setAllNodesToApplyGravitation=function(R){if(null!=this.allNodesToApplyGravitation)throw"assert failed";this.allNodesToApplyGravitation=R},_.prototype.getRoot=function(){return this.rootGraph},_.prototype.setRootGraph=function(R){if(R.getGraphManager()!=this)throw"Root not in this graph mgr!";this.rootGraph=R,null==R.parent&&(R.parent=this.layout.newNode("Root node"))},_.prototype.getLayout=function(){return this.layout},_.prototype.isOneAncestorOfOther=function(R,E){if(null==R||null==E)throw"assert failed";if(R==E)return!0;for(var A,w=R.getOwner();null!=(A=w.getParent());){if(A==E)return!0;if(null==(w=A.getOwner()))break}for(w=E.getOwner();null!=(A=w.getParent());){if(A==R)return!0;if(null==(w=A.getOwner()))break}return!1},_.prototype.calcLowestCommonAncestors=function(){for(var R,E,w,A,B,x=this.getAllEdges(),L=x.length,Q=0;Q<L;Q++)if(E=(R=x[Q]).source,w=R.target,R.lca=null,R.sourceInLca=E,R.targetInLca=w,E!=w){for(A=E.getOwner();null==R.lca;){for(R.targetInLca=w,B=w.getOwner();null==R.lca;){if(B==A){R.lca=B;break}if(B==this.rootGraph)break;if(null!=R.lca)throw"assert failed";R.targetInLca=B.getParent(),B=R.targetInLca.getOwner()}if(A==this.rootGraph)break;null==R.lca&&(R.sourceInLca=A.getParent(),A=R.sourceInLca.getOwner())}if(null==R.lca)throw"assert failed"}else R.lca=E.getOwner()},_.prototype.calcLowestCommonAncestor=function(R,E){if(R==E)return R.getOwner();for(var w=R.getOwner();null!=w;){for(var A=E.getOwner();null!=A;){if(A==w)return A;A=A.getParent().getOwner()}w=w.getParent().getOwner()}return w},_.prototype.calcInclusionTreeDepths=function(R,E){null==R&&null==E&&(R=this.rootGraph,E=1);for(var w,A=R.getNodes(),B=A.length,x=0;x<B;x++)(w=A[x]).inclusionTreeDepth=E,null!=w.child&&this.calcInclusionTreeDepths(w.child,E+1)},_.prototype.includesInvalidEdge=function(){for(var R,E=this.edges.length,w=0;w<E;w++)if(this.isOneAncestorOfOther((R=this.edges[w]).source,R.target))return!0;return!1},Fe.exports=_},function(Fe,ne,ae){"use strict";var $=ae(0);function D(){}for(var _ in $)D[_]=$[_];D.MAX_ITERATIONS=2500,D.DEFAULT_EDGE_LENGTH=50,D.DEFAULT_SPRING_STRENGTH=.45,D.DEFAULT_REPULSION_STRENGTH=4500,D.DEFAULT_GRAVITY_STRENGTH=.4,D.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1,D.DEFAULT_GRAVITY_RANGE_FACTOR=3.8,D.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5,D.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=!0,D.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=!0,D.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3,D.COOLING_ADAPTATION_FACTOR=.33,D.ADAPTATION_LOWER_NODE_LIMIT=1e3,D.ADAPTATION_UPPER_NODE_LIMIT=5e3,D.MAX_NODE_DISPLACEMENT=3*(D.MAX_NODE_DISPLACEMENT_INCREMENTAL=100),D.MIN_REPULSION_DIST=D.DEFAULT_EDGE_LENGTH/10,D.CONVERGENCE_CHECK_PERIOD=100,D.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1,D.MIN_EDGE_LENGTH=1,D.GRID_CALCULATION_CHECK_PERIOD=10,Fe.exports=D},function(Fe,ne,ae){"use strict";var $=ae(12);function D(){}D.calcSeparationAmount=function(_,R,E,w){if(!_.intersects(R))throw"assert failed";var A=new Array(2);this.decideDirectionsForOverlappingNodes(_,R,A),E[0]=Math.min(_.getRight(),R.getRight())-Math.max(_.x,R.x),E[1]=Math.min(_.getBottom(),R.getBottom())-Math.max(_.y,R.y),_.getX()<=R.getX()&&_.getRight()>=R.getRight()?E[0]+=Math.min(R.getX()-_.getX(),_.getRight()-R.getRight()):R.getX()<=_.getX()&&R.getRight()>=_.getRight()&&(E[0]+=Math.min(_.getX()-R.getX(),R.getRight()-_.getRight())),_.getY()<=R.getY()&&_.getBottom()>=R.getBottom()?E[1]+=Math.min(R.getY()-_.getY(),_.getBottom()-R.getBottom()):R.getY()<=_.getY()&&R.getBottom()>=_.getBottom()&&(E[1]+=Math.min(_.getY()-R.getY(),R.getBottom()-_.getBottom()));var B=Math.abs((R.getCenterY()-_.getCenterY())/(R.getCenterX()-_.getCenterX()));R.getCenterY()===_.getCenterY()&&R.getCenterX()===_.getCenterX()&&(B=1);var x=B*E[0],L=E[1]/B;E[0]<L?L=E[0]:x=E[1],E[0]=-1*A[0]*(L/2+w),E[1]=-1*A[1]*(x/2+w)},D.decideDirectionsForOverlappingNodes=function(_,R,E){E[0]=_.getCenterX()<R.getCenterX()?-1:1,E[1]=_.getCenterY()<R.getCenterY()?-1:1},D.getIntersection2=function(_,R,E){var w=_.getCenterX(),A=_.getCenterY(),B=R.getCenterX(),x=R.getCenterY();if(_.intersects(R))return E[0]=w,E[1]=A,E[2]=B,E[3]=x,!0;var L=_.getX(),Q=_.getY(),j=_.getRight(),H=_.getX(),oe=_.getBottom(),F=_.getRight(),te=_.getWidthHalf(),k=_.getHeightHalf(),ie=R.getX(),ee=R.getY(),I=R.getRight(),N=R.getX(),z=R.getBottom(),re=R.getRight(),de=R.getWidthHalf(),pe=R.getHeightHalf(),se=!1,fe=!1;if(w===B){if(A>x)return E[0]=w,E[1]=Q,E[2]=B,E[3]=z,!1;if(A<x)return E[0]=w,E[1]=oe,E[2]=B,E[3]=ee,!1}else if(A===x){if(w>B)return E[0]=L,E[1]=A,E[2]=I,E[3]=x,!1;if(w<B)return E[0]=j,E[1]=A,E[2]=ie,E[3]=x,!1}else{var Pe=_.height/_.width,xe=R.height/R.width,Ne=(x-A)/(B-w),tt=void 0,Ie=void 0,ye=void 0,Ve=void 0;if(-Pe===Ne?w>B?(E[0]=H,E[1]=oe,se=!0):(E[0]=j,E[1]=Q,se=!0):Pe===Ne&&(w>B?(E[0]=L,E[1]=Q,se=!0):(E[0]=F,E[1]=oe,se=!0)),-xe===Ne?B>w?(E[2]=N,E[3]=z,fe=!0):(E[2]=I,E[3]=ee,fe=!0):xe===Ne&&(B>w?(E[2]=ie,E[3]=ee,fe=!0):(E[2]=re,E[3]=z,fe=!0)),se&&fe)return!1;if(w>B?A>x?(tt=this.getCardinalDirection(Pe,Ne,4),Ie=this.getCardinalDirection(xe,Ne,2)):(tt=this.getCardinalDirection(-Pe,Ne,3),Ie=this.getCardinalDirection(-xe,Ne,1)):A>x?(tt=this.getCardinalDirection(-Pe,Ne,1),Ie=this.getCardinalDirection(-xe,Ne,3)):(tt=this.getCardinalDirection(Pe,Ne,2),Ie=this.getCardinalDirection(xe,Ne,4)),!se)switch(tt){case 1:ye=Q,E[0]=w+-k/Ne,E[1]=ye;break;case 2:ye=A+te*Ne,E[0]=F,E[1]=ye;break;case 3:ye=oe,E[0]=w+k/Ne,E[1]=ye;break;case 4:ye=A+-te*Ne,E[0]=H,E[1]=ye}if(!fe)switch(Ie){case 1:Ve=ee,E[2]=B+-pe/Ne,E[3]=Ve;break;case 2:Ve=x+de*Ne,E[2]=re,E[3]=Ve;break;case 3:Ve=z,E[2]=B+pe/Ne,E[3]=Ve;break;case 4:Ve=x+-de*Ne,E[2]=N,E[3]=Ve}}return!1},D.getCardinalDirection=function(_,R,E){return _>R?E:1+E%4},D.getIntersection=function(_,R,E,w){if(null==w)return this.getIntersection2(_,R,E);var k,ie,ee,I,N,z,re,A=_.x,B=_.y,x=R.x,L=R.y,Q=E.x,j=E.y,H=w.x,oe=w.y;return N=x*B-A*L,z=H*j-Q*oe,0===(re=(k=L-B)*(I=Q-H)-(ie=oe-j)*(ee=A-x))?null:new $((ee*z-I*N)/re,(ie*N-k*z)/re)},D.angleOfVector=function(_,R,E,w){var A=void 0;return _!==E?(A=Math.atan((w-R)/(E-_)),E<_?A+=Math.PI:w<R&&(A+=this.TWO_PI)):A=w<R?this.ONE_AND_HALF_PI:this.HALF_PI,A},D.doIntersect=function(_,R,E,w){var A=_.x,B=_.y,x=R.x,L=R.y,Q=E.x,j=E.y,H=w.x,oe=w.y,F=(x-A)*(oe-j)-(H-Q)*(L-B);if(0===F)return!1;var te=((oe-j)*(H-A)+(Q-H)*(oe-B))/F,k=((B-L)*(H-A)+(x-A)*(oe-B))/F;return 0<te&&te<1&&0<k&&k<1},D.HALF_PI=.5*Math.PI,D.ONE_AND_HALF_PI=1.5*Math.PI,D.TWO_PI=2*Math.PI,D.THREE_PI=3*Math.PI,Fe.exports=D},function(Fe,ne,ae){"use strict";function $(){}$.sign=function(D){return D>0?1:D<0?-1:0},$.floor=function(D){return D<0?Math.ceil(D):Math.floor(D)},$.ceil=function(D){return D<0?Math.floor(D):Math.ceil(D)},Fe.exports=$},function(Fe,ne,ae){"use strict";function $(){}$.MAX_VALUE=2147483647,$.MIN_VALUE=-2147483648,Fe.exports=$},function(Fe,ne,ae){"use strict";var $=function(){function A(B,x){for(var L=0;L<x.length;L++){var Q=x[L];Q.enumerable=Q.enumerable||!1,Q.configurable=!0,"value"in Q&&(Q.writable=!0),Object.defineProperty(B,Q.key,Q)}}return function(B,x,L){return x&&A(B.prototype,x),L&&A(B,L),B}}();var _=function(B){return{value:B,next:null,prev:null}},R=function(B,x,L,Q){return null!==B?B.next=x:Q.head=x,null!==L?L.prev=x:Q.tail=x,x.prev=B,x.next=L,Q.length++,x},E=function(B,x){var L=B.prev,Q=B.next;return null!==L?L.next=Q:x.head=Q,null!==Q?Q.prev=L:x.tail=L,B.prev=B.next=null,x.length--,B},w=function(){function A(B){var x=this;(function D(A,B){if(!(A instanceof B))throw new TypeError("Cannot call a class as a function")})(this,A),this.length=0,this.head=null,this.tail=null,B?.forEach(function(L){return x.push(L)})}return $(A,[{key:"size",value:function(){return this.length}},{key:"insertBefore",value:function(x,L){return R(L.prev,_(x),L,this)}},{key:"insertAfter",value:function(x,L){return R(L,_(x),L.next,this)}},{key:"insertNodeBefore",value:function(x,L){return R(L.prev,x,L,this)}},{key:"insertNodeAfter",value:function(x,L){return R(L,x,L.next,this)}},{key:"push",value:function(x){return R(this.tail,_(x),null,this)}},{key:"unshift",value:function(x){return R(null,_(x),this.head,this)}},{key:"remove",value:function(x){return E(x,this)}},{key:"pop",value:function(){return E(this.tail,this).value}},{key:"popNode",value:function(){return E(this.tail,this)}},{key:"shift",value:function(){return E(this.head,this).value}},{key:"shiftNode",value:function(){return E(this.head,this)}},{key:"get_object_at",value:function(x){if(x<=this.length()){for(var L=1,Q=this.head;L<x;)Q=Q.next,L++;return Q.value}}},{key:"set_object_at",value:function(x,L){if(x<=this.length()){for(var Q=1,j=this.head;Q<x;)j=j.next,Q++;j.value=L}}}]),A}();Fe.exports=w},function(Fe,ne,ae){"use strict";function $(D,_,R){this.x=null,this.y=null,null==D&&null==_&&null==R?(this.x=0,this.y=0):"number"==typeof D&&"number"==typeof _&&null==R?(this.x=D,this.y=_):"Point"==D.constructor.name&&null==_&&null==R&&(this.x=(R=D).x,this.y=R.y)}$.prototype.getX=function(){return this.x},$.prototype.getY=function(){return this.y},$.prototype.getLocation=function(){return new $(this.x,this.y)},$.prototype.setLocation=function(D,_,R){"Point"==D.constructor.name&&null==_&&null==R?this.setLocation((R=D).x,R.y):"number"==typeof D&&"number"==typeof _&&null==R&&(parseInt(D)==D&&parseInt(_)==_?this.move(D,_):(this.x=Math.floor(D+.5),this.y=Math.floor(_+.5)))},$.prototype.move=function(D,_){this.x=D,this.y=_},$.prototype.translate=function(D,_){this.x+=D,this.y+=_},$.prototype.equals=function(D){return"Point"==D.constructor.name?this.x==D.x&&this.y==D.y:this==D},$.prototype.toString=function(){return(new $).constructor.name+"[x="+this.x+",y="+this.y+"]"},Fe.exports=$},function(Fe,ne,ae){"use strict";function $(D,_,R,E){this.x=0,this.y=0,this.width=0,this.height=0,null!=D&&null!=_&&null!=R&&null!=E&&(this.x=D,this.y=_,this.width=R,this.height=E)}$.prototype.getX=function(){return this.x},$.prototype.setX=function(D){this.x=D},$.prototype.getY=function(){return this.y},$.prototype.setY=function(D){this.y=D},$.prototype.getWidth=function(){return this.width},$.prototype.setWidth=function(D){this.width=D},$.prototype.getHeight=function(){return this.height},$.prototype.setHeight=function(D){this.height=D},$.prototype.getRight=function(){return this.x+this.width},$.prototype.getBottom=function(){return this.y+this.height},$.prototype.intersects=function(D){return!(this.getRight()<D.x||this.getBottom()<D.y||D.getRight()<this.x||D.getBottom()<this.y)},$.prototype.getCenterX=function(){return this.x+this.width/2},$.prototype.getMinX=function(){return this.getX()},$.prototype.getMaxX=function(){return this.getX()+this.width},$.prototype.getCenterY=function(){return this.y+this.height/2},$.prototype.getMinY=function(){return this.getY()},$.prototype.getMaxY=function(){return this.getY()+this.height},$.prototype.getWidthHalf=function(){return this.width/2},$.prototype.getHeightHalf=function(){return this.height/2},Fe.exports=$},function(Fe,ne,ae){"use strict";var $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(_){return typeof _}:function(_){return _&&"function"==typeof Symbol&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _};function D(){}D.lastID=0,D.createID=function(_){return D.isPrimitive(_)?_:(null!=_.uniqueID||(_.uniqueID=D.getString(),D.lastID++),_.uniqueID)},D.getString=function(_){return null==_&&(_=D.lastID),"Object#"+_},D.isPrimitive=function(_){var R=typeof _>"u"?"undefined":$(_);return null==_||"object"!=R&&"function"!=R},Fe.exports=D},function(Fe,ne,ae){"use strict";function $(Q){if(Array.isArray(Q)){for(var j=0,H=Array(Q.length);j<Q.length;j++)H[j]=Q[j];return H}return Array.from(Q)}var D=ae(0),_=ae(6),R=ae(3),E=ae(1),w=ae(5),A=ae(4),B=ae(17),x=ae(27);function L(Q){x.call(this),this.layoutQuality=D.QUALITY,this.createBendsAsNeeded=D.DEFAULT_CREATE_BENDS_AS_NEEDED,this.incremental=D.DEFAULT_INCREMENTAL,this.animationOnLayout=D.DEFAULT_ANIMATION_ON_LAYOUT,this.animationDuringLayout=D.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=D.DEFAULT_ANIMATION_PERIOD,this.uniformLeafNodeSizes=D.DEFAULT_UNIFORM_LEAF_NODE_SIZES,this.edgeToDummyNodes=new Map,this.graphManager=new _(this),this.isLayoutFinished=!1,this.isSubLayout=!1,this.isRemoteUse=!1,null!=Q&&(this.isRemoteUse=Q)}L.RANDOM_SEED=1,(L.prototype=Object.create(x.prototype)).getGraphManager=function(){return this.graphManager},L.prototype.getAllNodes=function(){return this.graphManager.getAllNodes()},L.prototype.getAllEdges=function(){return this.graphManager.getAllEdges()},L.prototype.getAllNodesToApplyGravitation=function(){return this.graphManager.getAllNodesToApplyGravitation()},L.prototype.newGraphManager=function(){var Q=new _(this);return this.graphManager=Q,Q},L.prototype.newGraph=function(Q){return new w(null,this.graphManager,Q)},L.prototype.newNode=function(Q){return new R(this.graphManager,Q)},L.prototype.newEdge=function(Q){return new E(null,null,Q)},L.prototype.checkLayoutSuccess=function(){return null==this.graphManager.getRoot()||0==this.graphManager.getRoot().getNodes().length||this.graphManager.includesInvalidEdge()},L.prototype.runLayout=function(){var Q;return this.isLayoutFinished=!1,this.tilingPreLayout&&this.tilingPreLayout(),this.initParameters(),Q=!this.checkLayoutSuccess()&&this.layout(),"during"!==D.ANIMATE&&(Q&&(this.isSubLayout||this.doPostLayout()),this.tilingPostLayout&&this.tilingPostLayout(),this.isLayoutFinished=!0,Q)},L.prototype.doPostLayout=function(){this.incremental||this.transform(),this.update()},L.prototype.update2=function(){if(this.createBendsAsNeeded&&(this.createBendpointsFromDummyNodes(),this.graphManager.resetAllEdges()),!this.isRemoteUse){for(var j=this.graphManager.getAllEdges(),H=0;H<j.length;H++);var F=this.graphManager.getRoot().getNodes();for(H=0;H<F.length;H++);this.update(this.graphManager.getRoot())}},L.prototype.update=function(Q){if(null==Q)this.update2();else if(Q instanceof R){var j=Q;if(null!=j.getChild())for(var H=j.getChild().getNodes(),oe=0;oe<H.length;oe++)update(H[oe]);null!=j.vGraphObject&&j.vGraphObject.update(j)}else Q instanceof E?null!=Q.vGraphObject&&Q.vGraphObject.update(Q):Q instanceof w&&null!=Q.vGraphObject&&Q.vGraphObject.update(Q)},L.prototype.initParameters=function(){this.isSubLayout||(this.layoutQuality=D.QUALITY,this.animationDuringLayout=D.DEFAULT_ANIMATION_DURING_LAYOUT,this.animationPeriod=D.DEFAULT_ANIMATION_PERIOD,this.animationOnLayout=D.DEFAULT_ANIMATION_ON_LAYOUT,this.incremental=D.DEFAULT_INCREMENTAL,this.createBendsAsNeeded=D.DEFAULT_CREATE_BENDS_AS_NEEDED,this.uniformLeafNodeSizes=D.DEFAULT_UNIFORM_LEAF_NODE_SIZES),this.animationDuringLayout&&(this.animationOnLayout=!1)},L.prototype.transform=function(Q){if(null==Q)this.transform(new A(0,0));else{var j=new B,H=this.graphManager.getRoot().updateLeftTop();if(null!=H){j.setWorldOrgX(Q.x),j.setWorldOrgY(Q.y),j.setDeviceOrgX(H.x),j.setDeviceOrgY(H.y);for(var oe=this.getAllNodes(),te=0;te<oe.length;te++)oe[te].transform(j)}}},L.prototype.positionNodesRandomly=function(Q){if(null==Q)this.positionNodesRandomly(this.getGraphManager().getRoot()),this.getGraphManager().getRoot().updateBounds(!0);else for(var j,H,oe=Q.getNodes(),F=0;F<oe.length;F++)null==(H=(j=oe[F]).getChild())||0==H.getNodes().length?j.scatter():(this.positionNodesRandomly(H),j.updateBounds())},L.prototype.getFlatForest=function(){for(var Q=[],j=!0,H=this.graphManager.getRoot().getNodes(),oe=!0,F=0;F<H.length;F++)null!=H[F].getChild()&&(oe=!1);if(!oe)return Q;var te=new Set,k=[],ie=new Map,ee=[];for(ee=ee.concat(H);ee.length>0&&j;){for(k.push(ee[0]);k.length>0&&j;){var I=k[0];k.splice(0,1),te.add(I);var N=I.getEdges();for(F=0;F<N.length;F++){var z=N[F].getOtherEnd(I);if(ie.get(I)!=z){if(te.has(z)){j=!1;break}k.push(z),ie.set(z,I)}}}if(j){var re=[].concat($(te));for(Q.push(re),F=0;F<re.length;F++){var pe=ee.indexOf(re[F]);pe>-1&&ee.splice(pe,1)}te=new Set,ie=new Map}else Q=[]}return Q},L.prototype.createDummyNodesForBendpoints=function(Q){for(var j=[],H=Q.source,oe=this.graphManager.calcLowestCommonAncestor(Q.source,Q.target),F=0;F<Q.bendpoints.length;F++){var te=this.newNode(null);te.setRect(new Point(0,0),new Dimension(1,1)),oe.add(te);var k=this.newEdge(null);this.graphManager.add(k,H,te),j.add(te),H=te}return k=this.newEdge(null),this.graphManager.add(k,H,Q.target),this.edgeToDummyNodes.set(Q,j),Q.isInterGraph()?this.graphManager.remove(Q):oe.remove(Q),j},L.prototype.createBendpointsFromDummyNodes=function(){var Q=[];Q=Q.concat(this.graphManager.getAllEdges()),Q=[].concat($(this.edgeToDummyNodes.keys())).concat(Q);for(var j=0;j<Q.length;j++){var H=Q[j];if(H.bendpoints.length>0){for(var oe=this.edgeToDummyNodes.get(H),F=0;F<oe.length;F++){var te=oe[F],k=new A(te.getCenterX(),te.getCenterY()),ie=H.bendpoints.get(F);ie.x=k.x,ie.y=k.y,te.getOwner().remove(te)}this.graphManager.add(H,H.source,H.target)}}},L.transform=function(Q,j,H,oe){if(null!=H&&null!=oe){var F=j;return Q<=50?F-=(j-j/H)/50*(50-Q):F+=(j*oe-j)/50*(Q-50),F}var ie,ee;return Q<=50?(ie=9*j/500,ee=j/10):(ie=9*j/50,ee=-8*j),ie*Q+ee},L.findCenterOfTree=function(Q){var j=[];j=j.concat(Q);var H=[],oe=new Map,F=!1,te=null;(1==j.length||2==j.length)&&(F=!0,te=j[0]);for(var k=0;k<j.length;k++){var ee=(ie=j[k]).getNeighborsList().size;oe.set(ie,ie.getNeighborsList().size),1==ee&&H.push(ie)}var I=[];for(I=I.concat(H);!F;){var N=[];for(N=N.concat(I),I=[],k=0;k<j.length;k++){var ie,z=j.indexOf(ie=j[k]);z>=0&&j.splice(z,1),ie.getNeighborsList().forEach(function(se){if(H.indexOf(se)<0){var Pe=oe.get(se)-1;1==Pe&&I.push(se),oe.set(se,Pe)}})}H=H.concat(I),(1==j.length||2==j.length)&&(F=!0,te=j[0])}return te},L.prototype.setGraphManager=function(Q){this.graphManager=Q},Fe.exports=L},function(Fe,ne,ae){"use strict";function $(){}$.seed=1,$.x=0,$.nextDouble=function(){return($.x=1e4*Math.sin($.seed++))-Math.floor($.x)},Fe.exports=$},function(Fe,ne,ae){"use strict";var $=ae(4);function D(_,R){this.lworldOrgX=0,this.lworldOrgY=0,this.ldeviceOrgX=0,this.ldeviceOrgY=0,this.lworldExtX=1,this.lworldExtY=1,this.ldeviceExtX=1,this.ldeviceExtY=1}D.prototype.getWorldOrgX=function(){return this.lworldOrgX},D.prototype.setWorldOrgX=function(_){this.lworldOrgX=_},D.prototype.getWorldOrgY=function(){return this.lworldOrgY},D.prototype.setWorldOrgY=function(_){this.lworldOrgY=_},D.prototype.getWorldExtX=function(){return this.lworldExtX},D.prototype.setWorldExtX=function(_){this.lworldExtX=_},D.prototype.getWorldExtY=function(){return this.lworldExtY},D.prototype.setWorldExtY=function(_){this.lworldExtY=_},D.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX},D.prototype.setDeviceOrgX=function(_){this.ldeviceOrgX=_},D.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY},D.prototype.setDeviceOrgY=function(_){this.ldeviceOrgY=_},D.prototype.getDeviceExtX=function(){return this.ldeviceExtX},D.prototype.setDeviceExtX=function(_){this.ldeviceExtX=_},D.prototype.getDeviceExtY=function(){return this.ldeviceExtY},D.prototype.setDeviceExtY=function(_){this.ldeviceExtY=_},D.prototype.transformX=function(_){var R=0,E=this.lworldExtX;return 0!=E&&(R=this.ldeviceOrgX+(_-this.lworldOrgX)*this.ldeviceExtX/E),R},D.prototype.transformY=function(_){var R=0,E=this.lworldExtY;return 0!=E&&(R=this.ldeviceOrgY+(_-this.lworldOrgY)*this.ldeviceExtY/E),R},D.prototype.inverseTransformX=function(_){var R=0,E=this.ldeviceExtX;return 0!=E&&(R=this.lworldOrgX+(_-this.ldeviceOrgX)*this.lworldExtX/E),R},D.prototype.inverseTransformY=function(_){var R=0,E=this.ldeviceExtY;return 0!=E&&(R=this.lworldOrgY+(_-this.ldeviceOrgY)*this.lworldExtY/E),R},D.prototype.inverseTransformPoint=function(_){return new $(this.inverseTransformX(_.x),this.inverseTransformY(_.y))},Fe.exports=D},function(Fe,ne,ae){"use strict";var D=ae(15),_=ae(7),R=ae(0),E=ae(8),w=ae(9);function A(){D.call(this),this.useSmartIdealEdgeLengthCalculation=_.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION,this.idealEdgeLength=_.DEFAULT_EDGE_LENGTH,this.springConstant=_.DEFAULT_SPRING_STRENGTH,this.repulsionConstant=_.DEFAULT_REPULSION_STRENGTH,this.gravityConstant=_.DEFAULT_GRAVITY_STRENGTH,this.compoundGravityConstant=_.DEFAULT_COMPOUND_GRAVITY_STRENGTH,this.gravityRangeFactor=_.DEFAULT_GRAVITY_RANGE_FACTOR,this.compoundGravityRangeFactor=_.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR,this.displacementThresholdPerNode=3*_.DEFAULT_EDGE_LENGTH/100,this.coolingFactor=_.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.initialCoolingFactor=_.DEFAULT_COOLING_FACTOR_INCREMENTAL,this.totalDisplacement=0,this.oldTotalDisplacement=0,this.maxIterations=_.MAX_ITERATIONS}for(var B in A.prototype=Object.create(D.prototype),D)A[B]=D[B];A.prototype.initParameters=function(){D.prototype.initParameters.call(this,arguments),this.totalIterations=0,this.notAnimatedIterations=0,this.useFRGridVariant=_.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION,this.grid=[]},A.prototype.calcIdealEdgeLengths=function(){for(var x,L,Q,j,H,oe,F=this.getGraphManager().getAllEdges(),te=0;te<F.length;te++)(x=F[te]).idealLength=this.idealEdgeLength,x.isInterGraph&&(Q=x.getSource(),j=x.getTarget(),H=x.getSourceInLca().getEstimatedSize(),oe=x.getTargetInLca().getEstimatedSize(),this.useSmartIdealEdgeLengthCalculation&&(x.idealLength+=H+oe-2*R.SIMPLE_NODE_SIZE),L=x.getLca().getInclusionTreeDepth(),x.idealLength+=_.DEFAULT_EDGE_LENGTH*_.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR*(Q.getInclusionTreeDepth()+j.getInclusionTreeDepth()-2*L))},A.prototype.initSpringEmbedder=function(){var x=this.getAllNodes().length;this.incremental?(x>_.ADAPTATION_LOWER_NODE_LIMIT&&(this.coolingFactor=Math.max(this.coolingFactor*_.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(x-_.ADAPTATION_LOWER_NODE_LIMIT)/(_.ADAPTATION_UPPER_NODE_LIMIT-_.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-_.COOLING_ADAPTATION_FACTOR))),this.maxNodeDisplacement=_.MAX_NODE_DISPLACEMENT_INCREMENTAL):(this.coolingFactor=x>_.ADAPTATION_LOWER_NODE_LIMIT?Math.max(_.COOLING_ADAPTATION_FACTOR,1-(x-_.ADAPTATION_LOWER_NODE_LIMIT)/(_.ADAPTATION_UPPER_NODE_LIMIT-_.ADAPTATION_LOWER_NODE_LIMIT)*(1-_.COOLING_ADAPTATION_FACTOR)):1,this.initialCoolingFactor=this.coolingFactor,this.maxNodeDisplacement=_.MAX_NODE_DISPLACEMENT),this.maxIterations=Math.max(5*this.getAllNodes().length,this.maxIterations),this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length,this.repulsionRange=this.calcRepulsionRange()},A.prototype.calcSpringForces=function(){for(var L,x=this.getAllEdges(),Q=0;Q<x.length;Q++)this.calcSpringForce(L=x[Q],L.idealLength)},A.prototype.calcRepulsionForces=function(){var Q,j,H,oe,te,x=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],L=arguments.length>1&&void 0!==arguments[1]&&arguments[1],F=this.getAllNodes();if(this.useFRGridVariant)for(this.totalIterations%_.GRID_CALCULATION_CHECK_PERIOD==1&&x&&this.updateGrid(),te=new Set,Q=0;Q<F.length;Q++)this.calculateRepulsionForceOfANode(H=F[Q],te,x,L),te.add(H);else for(Q=0;Q<F.length;Q++)for(H=F[Q],j=Q+1;j<F.length;j++)oe=F[j],H.getOwner()==oe.getOwner()&&this.calcRepulsionForce(H,oe)},A.prototype.calcGravitationalForces=function(){for(var L=this.getAllNodesToApplyGravitation(),Q=0;Q<L.length;Q++)this.calcGravitationalForce(L[Q])},A.prototype.moveNodes=function(){for(var x=this.getAllNodes(),Q=0;Q<x.length;Q++)x[Q].move()},A.prototype.calcSpringForce=function(x,L){var H,oe,F,te,Q=x.getSource(),j=x.getTarget();if(this.uniformLeafNodeSizes&&null==Q.getChild()&&null==j.getChild())x.updateLengthSimple();else if(x.updateLength(),x.isOverlapingSourceAndTarget)return;0!=(H=x.getLength())&&(te=(oe=this.springConstant*(H-L))*(x.lengthY/H),Q.springForceX+=F=oe*(x.lengthX/H),Q.springForceY+=te,j.springForceX-=F,j.springForceY-=te)},A.prototype.calcRepulsionForce=function(x,L){var F,te,k,ie,ee,I,N,Q=x.getRect(),j=L.getRect(),H=new Array(2),oe=new Array(4);if(Q.intersects(j)){E.calcSeparationAmount(Q,j,H,_.DEFAULT_EDGE_LENGTH/2),N=2*H[1];var z=x.noOfChildren*L.noOfChildren/(x.noOfChildren+L.noOfChildren);x.repulsionForceX-=z*(I=2*H[0]),x.repulsionForceY-=z*N,L.repulsionForceX+=z*I,L.repulsionForceY+=z*N}else this.uniformLeafNodeSizes&&null==x.getChild()&&null==L.getChild()?(F=j.getCenterX()-Q.getCenterX(),te=j.getCenterY()-Q.getCenterY()):(E.getIntersection(Q,j,oe),F=oe[2]-oe[0],te=oe[3]-oe[1]),Math.abs(F)<_.MIN_REPULSION_DIST&&(F=w.sign(F)*_.MIN_REPULSION_DIST),Math.abs(te)<_.MIN_REPULSION_DIST&&(te=w.sign(te)*_.MIN_REPULSION_DIST),k=F*F+te*te,ie=Math.sqrt(k),N=(ee=this.repulsionConstant*x.noOfChildren*L.noOfChildren/k)*te/ie,x.repulsionForceX-=I=ee*F/ie,x.repulsionForceY-=N,L.repulsionForceX+=I,L.repulsionForceY+=N},A.prototype.calcGravitationalForce=function(x){var L,Q,j,H,oe,F,te,k;Q=((L=x.getOwner()).getRight()+L.getLeft())/2,j=(L.getTop()+L.getBottom())/2,H=x.getCenterX()-Q,oe=x.getCenterY()-j,F=Math.abs(H)+x.getWidth()/2,te=Math.abs(oe)+x.getHeight()/2,x.getOwner()==this.graphManager.getRoot()?(F>(k=L.getEstimatedSize()*this.gravityRangeFactor)||te>k)&&(x.gravitationForceX=-this.gravityConstant*H,x.gravitationForceY=-this.gravityConstant*oe):(F>(k=L.getEstimatedSize()*this.compoundGravityRangeFactor)||te>k)&&(x.gravitationForceX=-this.gravityConstant*H*this.compoundGravityConstant,x.gravitationForceY=-this.gravityConstant*oe*this.compoundGravityConstant)},A.prototype.isConverged=function(){var x,L=!1;return this.totalIterations>this.maxIterations/3&&(L=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2),x=this.totalDisplacement<this.totalDisplacementThreshold,this.oldTotalDisplacement=this.totalDisplacement,x||L},A.prototype.animate=function(){this.animationDuringLayout&&!this.isSubLayout&&(this.notAnimatedIterations==this.animationPeriod?(this.update(),this.notAnimatedIterations=0):this.notAnimatedIterations++)},A.prototype.calcNoOfChildrenForAllNodes=function(){for(var x,L=this.graphManager.getAllNodes(),Q=0;Q<L.length;Q++)(x=L[Q]).noOfChildren=x.getNoOfChildren()},A.prototype.calcGrid=function(x){var L,Q;L=parseInt(Math.ceil((x.getRight()-x.getLeft())/this.repulsionRange)),Q=parseInt(Math.ceil((x.getBottom()-x.getTop())/this.repulsionRange));for(var j=new Array(L),H=0;H<L;H++)j[H]=new Array(Q);for(H=0;H<L;H++)for(var oe=0;oe<Q;oe++)j[H][oe]=new Array;return j},A.prototype.addNodeToGrid=function(x,L,Q){var j,H,oe,F;j=parseInt(Math.floor((x.getRect().x-L)/this.repulsionRange)),H=parseInt(Math.floor((x.getRect().width+x.getRect().x-L)/this.repulsionRange)),oe=parseInt(Math.floor((x.getRect().y-Q)/this.repulsionRange)),F=parseInt(Math.floor((x.getRect().height+x.getRect().y-Q)/this.repulsionRange));for(var te=j;te<=H;te++)for(var k=oe;k<=F;k++)this.grid[te][k].push(x),x.setGridCoordinates(j,H,oe,F)},A.prototype.updateGrid=function(){var x,Q=this.getAllNodes();for(this.grid=this.calcGrid(this.graphManager.getRoot()),x=0;x<Q.length;x++)this.addNodeToGrid(Q[x],this.graphManager.getRoot().getLeft(),this.graphManager.getRoot().getTop())},A.prototype.calculateRepulsionForceOfANode=function(x,L,Q,j){if(this.totalIterations%_.GRID_CALCULATION_CHECK_PERIOD==1&&Q||j){var H=new Set;x.surrounding=new Array;for(var oe,F=this.grid,te=x.startX-1;te<x.finishX+2;te++)for(var k=x.startY-1;k<x.finishY+2;k++)if(!(te<0||k<0||te>=F.length||k>=F[0].length))for(var ie=0;ie<F[te][k].length;ie++)if(oe=F[te][k][ie],x.getOwner()==oe.getOwner()&&x!=oe&&!L.has(oe)&&!H.has(oe)){var ee=Math.abs(x.getCenterX()-oe.getCenterX())-(x.getWidth()/2+oe.getWidth()/2),I=Math.abs(x.getCenterY()-oe.getCenterY())-(x.getHeight()/2+oe.getHeight()/2);ee<=this.repulsionRange&&I<=this.repulsionRange&&H.add(oe)}x.surrounding=[].concat(function $(x){if(Array.isArray(x)){for(var L=0,Q=Array(x.length);L<x.length;L++)Q[L]=x[L];return Q}return Array.from(x)}(H))}for(te=0;te<x.surrounding.length;te++)this.calcRepulsionForce(x,x.surrounding[te])},A.prototype.calcRepulsionRange=function(){return 0},Fe.exports=A},function(Fe,ne,ae){"use strict";var $=ae(1),D=ae(7);function _(E,w,A){$.call(this,E,w,A),this.idealLength=D.DEFAULT_EDGE_LENGTH}for(var R in _.prototype=Object.create($.prototype),$)_[R]=$[R];Fe.exports=_},function(Fe,ne,ae){"use strict";var $=ae(3);function D(R,E,w,A){$.call(this,R,E,w,A),this.springForceX=0,this.springForceY=0,this.repulsionForceX=0,this.repulsionForceY=0,this.gravitationForceX=0,this.gravitationForceY=0,this.displacementX=0,this.displacementY=0,this.startX=0,this.finishX=0,this.startY=0,this.finishY=0,this.surrounding=[]}for(var _ in D.prototype=Object.create($.prototype),$)D[_]=$[_];D.prototype.setGridCoordinates=function(R,E,w,A){this.startX=R,this.finishX=E,this.startY=w,this.finishY=A},Fe.exports=D},function(Fe,ne,ae){"use strict";function $(D,_){this.width=0,this.height=0,null!==D&&null!==_&&(this.height=_,this.width=D)}$.prototype.getWidth=function(){return this.width},$.prototype.setWidth=function(D){this.width=D},$.prototype.getHeight=function(){return this.height},$.prototype.setHeight=function(D){this.height=D},Fe.exports=$},function(Fe,ne,ae){"use strict";var $=ae(14);function D(){this.map={},this.keys=[]}D.prototype.put=function(_,R){var E=$.createID(_);this.contains(E)||(this.map[E]=R,this.keys.push(_))},D.prototype.contains=function(_){return $.createID(_),null!=this.map[_]},D.prototype.get=function(_){var R=$.createID(_);return this.map[R]},D.prototype.keySet=function(){return this.keys},Fe.exports=D},function(Fe,ne,ae){"use strict";var $=ae(14);function D(){this.set={}}D.prototype.add=function(_){var R=$.createID(_);this.contains(R)||(this.set[R]=_)},D.prototype.remove=function(_){delete this.set[$.createID(_)]},D.prototype.clear=function(){this.set={}},D.prototype.contains=function(_){return this.set[$.createID(_)]==_},D.prototype.isEmpty=function(){return 0===this.size()},D.prototype.size=function(){return Object.keys(this.set).length},D.prototype.addAllTo=function(_){for(var R=Object.keys(this.set),E=R.length,w=0;w<E;w++)_.push(this.set[R[w]])},D.prototype.size=function(){return Object.keys(this.set).length},D.prototype.addAll=function(_){for(var R=_.length,E=0;E<R;E++)this.add(_[E])},Fe.exports=D},function(Fe,ne,ae){"use strict";var $=function(){function E(w,A){for(var B=0;B<A.length;B++){var x=A[B];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(w,x.key,x)}}return function(w,A,B){return A&&E(w.prototype,A),B&&E(w,B),w}}();var _=ae(11),R=function(){function E(w,A){(function D(E,w){if(!(E instanceof w))throw new TypeError("Cannot call a class as a function")})(this,E),(null!==A||void 0!==A)&&(this.compareFunction=this._defaultCompareFunction);var B;B=w instanceof _?w.size():w.length,this._quicksort(w,0,B-1)}return $(E,[{key:"_quicksort",value:function(A,B,x){if(B<x){var L=this._partition(A,B,x);this._quicksort(A,B,L),this._quicksort(A,L+1,x)}}},{key:"_partition",value:function(A,B,x){for(var L=this._get(A,B),Q=B,j=x;;){for(;this.compareFunction(L,this._get(A,j));)j--;for(;this.compareFunction(this._get(A,Q),L);)Q++;if(!(Q<j))return j;this._swap(A,Q,j),Q++,j--}}},{key:"_get",value:function(A,B){return A instanceof _?A.get_object_at(B):A[B]}},{key:"_set",value:function(A,B,x){A instanceof _?A.set_object_at(B,x):A[B]=x}},{key:"_swap",value:function(A,B,x){var L=this._get(A,B);this._set(A,B,this._get(A,x)),this._set(A,x,L)}},{key:"_defaultCompareFunction",value:function(A,B){return B>A}}]),E}();Fe.exports=R},function(Fe,ne,ae){"use strict";var $=function(){function R(E,w){for(var A=0;A<w.length;A++){var B=w[A];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(E,B.key,B)}}return function(E,w,A){return w&&R(E.prototype,w),A&&R(E,A),E}}();var _=function(){function R(E,w){var A=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,B=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,x=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1;(function D(R,E){if(!(R instanceof E))throw new TypeError("Cannot call a class as a function")})(this,R),this.sequence1=E,this.sequence2=w,this.match_score=A,this.mismatch_penalty=B,this.gap_penalty=x,this.iMax=E.length+1,this.jMax=w.length+1,this.grid=new Array(this.iMax);for(var L=0;L<this.iMax;L++){this.grid[L]=new Array(this.jMax);for(var Q=0;Q<this.jMax;Q++)this.grid[L][Q]=0}this.tracebackGrid=new Array(this.iMax);for(var j=0;j<this.iMax;j++){this.tracebackGrid[j]=new Array(this.jMax);for(var H=0;H<this.jMax;H++)this.tracebackGrid[j][H]=[null,null,null]}this.alignments=[],this.score=-1,this.computeGrids()}return $(R,[{key:"getScore",value:function(){return this.score}},{key:"getAlignments",value:function(){return this.alignments}},{key:"computeGrids",value:function(){for(var w=1;w<this.jMax;w++)this.grid[0][w]=this.grid[0][w-1]+this.gap_penalty,this.tracebackGrid[0][w]=[!1,!1,!0];for(var A=1;A<this.iMax;A++)this.grid[A][0]=this.grid[A-1][0]+this.gap_penalty,this.tracebackGrid[A][0]=[!1,!0,!1];for(var B=1;B<this.iMax;B++)for(var x=1;x<this.jMax;x++){var H=[this.sequence1[B-1]===this.sequence2[x-1]?this.grid[B-1][x-1]+this.match_score:this.grid[B-1][x-1]+this.mismatch_penalty,this.grid[B-1][x]+this.gap_penalty,this.grid[B][x-1]+this.gap_penalty],oe=this.arrayAllMaxIndexes(H);this.grid[B][x]=H[oe[0]],this.tracebackGrid[B][x]=[oe.includes(0),oe.includes(1),oe.includes(2)]}this.score=this.grid[this.iMax-1][this.jMax-1]}},{key:"alignmentTraceback",value:function(){var w=[];for(w.push({pos:[this.sequence1.length,this.sequence2.length],seq1:"",seq2:""});w[0];){var A=w[0],B=this.tracebackGrid[A.pos[0]][A.pos[1]];B[0]&&w.push({pos:[A.pos[0]-1,A.pos[1]-1],seq1:this.sequence1[A.pos[0]-1]+A.seq1,seq2:this.sequence2[A.pos[1]-1]+A.seq2}),B[1]&&w.push({pos:[A.pos[0]-1,A.pos[1]],seq1:this.sequence1[A.pos[0]-1]+A.seq1,seq2:"-"+A.seq2}),B[2]&&w.push({pos:[A.pos[0],A.pos[1]-1],seq1:"-"+A.seq1,seq2:this.sequence2[A.pos[1]-1]+A.seq2}),0===A.pos[0]&&0===A.pos[1]&&this.alignments.push({sequence1:A.seq1,sequence2:A.seq2}),w.shift()}return this.alignments}},{key:"getAllIndexes",value:function(w,A){for(var B=[],x=-1;-1!==(x=w.indexOf(A,x+1));)B.push(x);return B}},{key:"arrayAllMaxIndexes",value:function(w){return this.getAllIndexes(w,Math.max.apply(null,w))}}]),R}();Fe.exports=_},function(Fe,ne,ae){"use strict";var $=function(){};$.FDLayout=ae(18),$.FDLayoutConstants=ae(7),$.FDLayoutEdge=ae(19),$.FDLayoutNode=ae(20),$.DimensionD=ae(21),$.HashMap=ae(22),$.HashSet=ae(23),$.IGeometry=ae(8),$.IMath=ae(9),$.Integer=ae(10),$.Point=ae(12),$.PointD=ae(4),$.RandomSeed=ae(16),$.RectangleD=ae(13),$.Transform=ae(17),$.UniqueIDGeneretor=ae(14),$.Quicksort=ae(24),$.LinkedList=ae(11),$.LGraphObject=ae(2),$.LGraph=ae(5),$.LEdge=ae(1),$.LGraphManager=ae(6),$.LNode=ae(3),$.Layout=ae(15),$.LayoutConstants=ae(0),$.NeedlemanWunsch=ae(25),Fe.exports=$},function(Fe,ne,ae){"use strict";function $(){this.listeners=[]}var D=$.prototype;D.addListener=function(_,R){this.listeners.push({event:_,callback:R})},D.removeListener=function(_,R){for(var E=this.listeners.length;E>=0;E--){var w=this.listeners[E];w.event===_&&w.callback===R&&this.listeners.splice(E,1)}},D.emit=function(_,R){for(var E=0;E<this.listeners.length;E++){var w=this.listeners[E];_===w.event&&w.callback(R)}},Fe.exports=$}])},1224(at,Fe,ne){at.exports=ne(4548)},250(at){"use strict";at.exports=class X2{constructor(ne,ae=new Map,$=0){this.prefix=ne,this._existing=ae,this.counter=$}clone(){const{prefix:ne,_existing:ae,counter:$}=this;return new X2(ne,new Map(ae),$)}getId(ne){const ae=ne&&this._existing.get(ne);if(ae)return ae;const $=this.prefix+this.counter;return this.counter++,ne&&this._existing.set(ne,$),$}hasId(ne){return this._existing.has(ne)}getOldIds(){return[...this._existing.keys()]}}},1126(at,Fe,ne){"use strict";var ae=ne(9293).default;ne(7140);const $=self.crypto||self.msCrypto;at.exports=class{constructor(_){if(!$||!$.subtle)throw new Error("crypto.subtle not found.");if("sha256"===_)this.algorithm={name:"SHA-256"};else{if("sha1"!==_)throw new Error(`Unsupported algorithm "${_}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(_){this._content+=_}digest(){var _=this;return ae(function*(){const R=(new TextEncoder).encode(_._content),E=new Uint8Array(yield $.subtle.digest(_.algorithm,R));let w="";for(let A=0;A<E.length;++A)w+=E[A].toString(16).padStart(2,"0");return w})()}}},8276(at){"use strict";const ae="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",$="http://www.w3.org/2001/XMLSchema#string",D="NamedNode",_="BlankNode",R="Literal",E="DefaultGraph",w={};function A(j,H){return j.subject.termType===H.subject.termType&&j.object.termType===H.object.termType&&j.subject.value===H.subject.value&&j.predicate.value===H.predicate.value&&j.object.value===H.object.value&&(j.object.termType!==R||j.object.datatype.termType===H.object.datatype.termType&&j.object.language===H.object.language&&j.object.datatype.value===H.object.datatype.value)}(()=>{const j="(?:<([^:]+:[^>]*)>)",oe="A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd_",F=oe+"0-9-\xb7\u0300-\u036f\u203f-\u2040",k="(_:(?:["+oe+"0-9])(?:(?:["+F+".])*(?:["+F+"]))?)",z="[ \\t]+",re="[ \\t]*",de="(?:"+j+"|"+k+")"+z,pe=j+z,se="(?:"+j+"|"+k+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+j+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+re,fe="(?:\\.|(?:(?:"+j+"|"+k+")"+re+"\\.))";w.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,w.empty=new RegExp("^[ \\t]*$"),w.quad=new RegExp("^"+re+de+pe+se+fe+re+"$")})(),at.exports=class Om{static parse(H){const oe=[],F={},te=H.split(w.eoln);let k=0;for(const ie of te){if(k++,w.empty.test(ie))continue;const ee=ie.match(w.quad);if(null===ee)throw new Error("N-Quads parse error on line "+k+".");const I={subject:null,predicate:null,object:null,graph:null};if(I.subject=void 0!==ee[1]?{termType:D,value:ee[1]}:{termType:_,value:ee[2]},I.predicate={termType:D,value:ee[3]},void 0!==ee[4]?I.object={termType:D,value:ee[4]}:void 0!==ee[5]?I.object={termType:_,value:ee[5]}:(I.object={termType:R,value:void 0,datatype:{termType:D}},void 0!==ee[7]?I.object.datatype.value=ee[7]:void 0!==ee[8]?(I.object.datatype.value=ae,I.object.language=ee[8]):I.object.datatype.value=$,I.object.value=Q(ee[6])),I.graph=void 0!==ee[9]?{termType:D,value:ee[9]}:void 0!==ee[10]?{termType:_,value:ee[10]}:{termType:E,value:""},I.graph.value in F){let N=!0;const z=F[I.graph.value];for(const re of z)if(A(re,I)){N=!1;break}N&&(z.push(I),oe.push(I))}else F[I.graph.value]=[I],oe.push(I)}return oe}static serialize(H){Array.isArray(H)||(H=Om.legacyDatasetToQuads(H));const oe=[];for(const F of H)oe.push(Om.serializeQuad(F));return oe.sort().join("")}static serializeQuadComponents(H,oe,F,te){let k="";return k+=H.termType===D?`<${H.value}>`:`${H.value}`,k+=` <${oe.value}> `,F.termType===D?k+=`<${F.value}>`:F.termType===_?k+=F.value:(k+=`"${function x(j){return j.replace(B,function(H){switch(H){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}})}(F.value)}"`,F.datatype.value===ae?F.language&&(k+=`@${F.language}`):F.datatype.value!==$&&(k+=`^^<${F.datatype.value}>`)),te.termType===D?k+=` <${te.value}>`:te.termType===_&&(k+=` ${te.value}`),k+=" .\n",k}static serializeQuad(H){return Om.serializeQuadComponents(H.subject,H.predicate,H.object,H.graph)}static legacyDatasetToQuads(H){const oe=[],F={"blank node":_,IRI:D,literal:R};for(const te in H)H[te].forEach(ie=>{const ee={};for(const I in ie){const N=ie[I],z={termType:F[N.type],value:N.value};z.termType===R&&(z.datatype={termType:D},"datatype"in N&&(z.datatype.value=N.datatype),"language"in N?("datatype"in N||(z.datatype.value=ae),z.language=N.language):"datatype"in N||(z.datatype.value=$)),ee[I]=z}ee.graph="@default"===te?{termType:E,value:""}:{termType:te.startsWith("_:")?_:D,value:te},oe.push(ee)});return oe}};const B=/["\\\n\r]/g,L=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function Q(j){return j.replace(L,function(H,oe,F,te){if(oe)switch(oe){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(F)return String.fromCharCode(parseInt(F,16));if(te)throw new Error("Unsupported U escape")})}},7794(at){"use strict";at.exports=class{constructor(ne){this.current=ne.sort(),this.done=!1,this.dir=new Map;for(let ae=0;ae<ne.length;++ae)this.dir.set(ne[ae],!0)}hasNext(){return!this.done}next(){const{current:ne,dir:ae}=this,$=ne.slice();let D=null,_=0;const R=ne.length;for(let E=0;E<R;++E){const w=ne[E],A=ae.get(w);(null===D||w>D)&&(A&&E>0&&w>ne[E-1]||!A&&E<R-1&&w>ne[E+1])&&(D=w,_=E)}if(null===D)this.done=!0;else{const E=ae.get(D)?_-1:_+1;ne[_]=ne[E],ne[E]=D;for(const w of ne)w>D&&ae.set(w,!ae.get(w))}return $}}},624(at,Fe,ne){"use strict";var ae=ne(9293).default;const $=ne(250),D=ne(1126),_=ne(7794),R=ne(8276);function E(w,A){return w.hash<A.hash?-1:w.hash>A.hash?1:0}at.exports=class{constructor({createMessageDigest:A=()=>new D("sha256"),canonicalIdMap:B=new Map,maxDeepIterations:x=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new $("_:c14n",B),this.createMessageDigest=A,this.maxDeepIterations=x,this.quads=null,this.deepIterations=null}main(A){var B=this;return ae(function*(){B.deepIterations=new Map,B.quads=A;for(const F of A)B._addBlankNodeQuadInfo({quad:F,component:F.subject}),B._addBlankNodeQuadInfo({quad:F,component:F.object}),B._addBlankNodeQuadInfo({quad:F,component:F.graph});const x=new Map,L=[...B.blankNodeInfo.keys()];let Q=0;for(const F of L)++Q%100==0&&(yield B._yield()),yield B._hashAndTrackBlankNode({id:F,hashToBlankNodes:x});const j=[...x.keys()].sort(),H=[];for(const F of j){const te=x.get(F);te.length>1?H.push(te):B.canonicalIssuer.getId(te[0])}for(const F of H){const te=[];for(const k of F){if(B.canonicalIssuer.hasId(k))continue;const ie=new $("_:b");ie.getId(k);const ee=yield B.hashNDegreeQuads(k,ie);te.push(ee)}te.sort(E);for(const k of te){const ie=k.issuer.getOldIds();for(const ee of ie)B.canonicalIssuer.getId(ee)}}const oe=[];for(const F of B.quads){const te=R.serializeQuadComponents(B._componentWithCanonicalId(F.subject),F.predicate,B._componentWithCanonicalId(F.object),B._componentWithCanonicalId(F.graph));oe.push(te)}return oe.sort(),oe.join("")})()}hashFirstDegreeQuads(A){var B=this;return ae(function*(){const x=[],L=B.blankNodeInfo.get(A),Q=L.quads;for(const H of Q){const oe={subject:null,predicate:H.predicate,object:null,graph:null};oe.subject=B.modifyFirstDegreeComponent(A,H.subject,"subject"),oe.object=B.modifyFirstDegreeComponent(A,H.object,"object"),oe.graph=B.modifyFirstDegreeComponent(A,H.graph,"graph"),x.push(R.serializeQuad(oe))}x.sort();const j=B.createMessageDigest();for(const H of x)j.update(H);return L.hash=yield j.digest(),L.hash})()}hashRelatedBlankNode(A,B,x,L){var Q=this;return ae(function*(){let j;j=Q.canonicalIssuer.hasId(A)?Q.canonicalIssuer.getId(A):x.hasId(A)?x.getId(A):Q.blankNodeInfo.get(A).hash;const H=Q.createMessageDigest();return H.update(L),"g"!==L&&H.update(Q.getRelatedPredicate(B)),H.update(j),H.digest()})()}hashNDegreeQuads(A,B){var x=this;return ae(function*(){const L=x.deepIterations.get(A)||0;if(L>x.maxDeepIterations)throw new Error(`Maximum deep iterations (${x.maxDeepIterations}) exceeded.`);x.deepIterations.set(A,L+1);const Q=x.createMessageDigest(),j=yield x.createHashToRelated(A,B),H=[...j.keys()].sort();for(const oe of H){Q.update(oe);let te,F="";const k=new _(j.get(oe));let ie=0;for(;k.hasNext();){const ee=k.next();++ie%3==0&&(yield x._yield());let I=B.clone(),N="";const z=[];let re=!1;for(const de of ee)if(x.canonicalIssuer.hasId(de)?N+=x.canonicalIssuer.getId(de):(I.hasId(de)||z.push(de),N+=I.getId(de)),0!==F.length&&N>F){re=!0;break}if(!re){for(const de of z){const pe=yield x.hashNDegreeQuads(de,I);if(N+=I.getId(de),N+=`<${pe.hash}>`,I=pe.issuer,0!==F.length&&N>F){re=!0;break}}re||(0===F.length||N<F)&&(F=N,te=I)}}Q.update(F),B=te}return{hash:yield Q.digest(),issuer:B}})()}modifyFirstDegreeComponent(A,B){return"BlankNode"!==B.termType?B:{termType:"BlankNode",value:B.value===A?"_:a":"_:z"}}getRelatedPredicate(A){return`<${A.predicate.value}>`}createHashToRelated(A,B){var x=this;return ae(function*(){const L=new Map,Q=x.blankNodeInfo.get(A).quads;let j=0;for(const H of Q)++j%100==0&&(yield x._yield()),yield Promise.all([x._addRelatedBlankNodeHash({quad:H,component:H.subject,position:"s",id:A,issuer:B,hashToRelated:L}),x._addRelatedBlankNodeHash({quad:H,component:H.object,position:"o",id:A,issuer:B,hashToRelated:L}),x._addRelatedBlankNodeHash({quad:H,component:H.graph,position:"g",id:A,issuer:B,hashToRelated:L})]);return L})()}_hashAndTrackBlankNode(A){var B=this;return ae(function*({id:x,hashToBlankNodes:L}){const Q=yield B.hashFirstDegreeQuads(x),j=L.get(Q);j?j.push(x):L.set(Q,[x])}).apply(this,arguments)}_addBlankNodeQuadInfo({quad:A,component:B}){if("BlankNode"!==B.termType)return;const x=B.value,L=this.blankNodeInfo.get(x);L?L.quads.add(A):this.blankNodeInfo.set(x,{quads:new Set([A]),hash:null})}_addRelatedBlankNodeHash(A){var B=this;return ae(function*({quad:x,component:L,position:Q,id:j,issuer:H,hashToRelated:oe}){if("BlankNode"!==L.termType||L.value===j)return;const F=L.value,te=yield B.hashRelatedBlankNode(F,x,H,Q),k=oe.get(te);k?k.push(F):oe.set(te,[F])}).apply(this,arguments)}_componentWithCanonicalId(A){return"BlankNode"!==A.termType||A.value.startsWith(this.canonicalIssuer.prefix)?A:{termType:"BlankNode",value:this.canonicalIssuer.getId(A.value)}}_yield(){return ae(function*(){return new Promise(A=>setImmediate(A))})()}}},203(at,Fe,ne){"use strict";const ae=ne(250),$=ne(1126),D=ne(7794),_=ne(8276);function R(E,w){return E.hash<w.hash?-1:E.hash>w.hash?1:0}at.exports=class{constructor({createMessageDigest:w=()=>new $("sha256"),canonicalIdMap:A=new Map,maxDeepIterations:B=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new ae("_:c14n",A),this.createMessageDigest=w,this.maxDeepIterations=B,this.quads=null,this.deepIterations=null}main(w){this.deepIterations=new Map,this.quads=w;for(const j of w)this._addBlankNodeQuadInfo({quad:j,component:j.subject}),this._addBlankNodeQuadInfo({quad:j,component:j.object}),this._addBlankNodeQuadInfo({quad:j,component:j.graph});const A=new Map,B=[...this.blankNodeInfo.keys()];for(const j of B)this._hashAndTrackBlankNode({id:j,hashToBlankNodes:A});const x=[...A.keys()].sort(),L=[];for(const j of x){const H=A.get(j);H.length>1?L.push(H):this.canonicalIssuer.getId(H[0])}for(const j of L){const H=[];for(const oe of j){if(this.canonicalIssuer.hasId(oe))continue;const F=new ae("_:b");F.getId(oe);const te=this.hashNDegreeQuads(oe,F);H.push(te)}H.sort(R);for(const oe of H){const F=oe.issuer.getOldIds();for(const te of F)this.canonicalIssuer.getId(te)}}const Q=[];for(const j of this.quads){const H=_.serializeQuadComponents(this._componentWithCanonicalId({component:j.subject}),j.predicate,this._componentWithCanonicalId({component:j.object}),this._componentWithCanonicalId({component:j.graph}));Q.push(H)}return Q.sort(),Q.join("")}hashFirstDegreeQuads(w){const A=[],B=this.blankNodeInfo.get(w),x=B.quads;for(const Q of x){const j={subject:null,predicate:Q.predicate,object:null,graph:null};j.subject=this.modifyFirstDegreeComponent(w,Q.subject,"subject"),j.object=this.modifyFirstDegreeComponent(w,Q.object,"object"),j.graph=this.modifyFirstDegreeComponent(w,Q.graph,"graph"),A.push(_.serializeQuad(j))}A.sort();const L=this.createMessageDigest();for(const Q of A)L.update(Q);return B.hash=L.digest(),B.hash}hashRelatedBlankNode(w,A,B,x){let L;L=this.canonicalIssuer.hasId(w)?this.canonicalIssuer.getId(w):B.hasId(w)?B.getId(w):this.blankNodeInfo.get(w).hash;const Q=this.createMessageDigest();return Q.update(x),"g"!==x&&Q.update(this.getRelatedPredicate(A)),Q.update(L),Q.digest()}hashNDegreeQuads(w,A){const B=this.deepIterations.get(w)||0;if(B>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(w,B+1);const x=this.createMessageDigest(),L=this.createHashToRelated(w,A),Q=[...L.keys()].sort();for(const j of Q){x.update(j);let oe,H="";const F=new D(L.get(j));for(;F.hasNext();){const te=F.next();let k=A.clone(),ie="";const ee=[];let I=!1;for(const N of te)if(this.canonicalIssuer.hasId(N)?ie+=this.canonicalIssuer.getId(N):(k.hasId(N)||ee.push(N),ie+=k.getId(N)),0!==H.length&&ie>H){I=!0;break}if(!I){for(const N of ee){const z=this.hashNDegreeQuads(N,k);if(ie+=k.getId(N),ie+=`<${z.hash}>`,k=z.issuer,0!==H.length&&ie>H){I=!0;break}}I||(0===H.length||ie<H)&&(H=ie,oe=k)}}x.update(H),A=oe}return{hash:x.digest(),issuer:A}}modifyFirstDegreeComponent(w,A){return"BlankNode"!==A.termType?A:{termType:"BlankNode",value:A.value===w?"_:a":"_:z"}}getRelatedPredicate(w){return`<${w.predicate.value}>`}createHashToRelated(w,A){const B=new Map,x=this.blankNodeInfo.get(w).quads;for(const L of x)this._addRelatedBlankNodeHash({quad:L,component:L.subject,position:"s",id:w,issuer:A,hashToRelated:B}),this._addRelatedBlankNodeHash({quad:L,component:L.object,position:"o",id:w,issuer:A,hashToRelated:B}),this._addRelatedBlankNodeHash({quad:L,component:L.graph,position:"g",id:w,issuer:A,hashToRelated:B});return B}_hashAndTrackBlankNode({id:w,hashToBlankNodes:A}){const B=this.hashFirstDegreeQuads(w),x=A.get(B);x?x.push(w):A.set(B,[w])}_addBlankNodeQuadInfo({quad:w,component:A}){if("BlankNode"!==A.termType)return;const B=A.value,x=this.blankNodeInfo.get(B);x?x.quads.add(w):this.blankNodeInfo.set(B,{quads:new Set([w]),hash:null})}_addRelatedBlankNodeHash({quad:w,component:A,position:B,id:x,issuer:L,hashToRelated:Q}){if("BlankNode"!==A.termType||A.value===x)return;const j=A.value,H=this.hashRelatedBlankNode(j,w,L,B),oe=Q.get(H);oe?oe.push(j):Q.set(H,[j])}_componentWithCanonicalId({component:w}){return"BlankNode"!==w.termType||w.value.startsWith(this.canonicalIssuer.prefix)?w:{termType:"BlankNode",value:this.canonicalIssuer.getId(w.value)}}}},6268(at,Fe,ne){"use strict";var ae=ne(9293).default;const $=ne(1126),D=ne(624);at.exports=class extends D{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new $("sha1")}modifyFirstDegreeComponent(R,E,w){return"BlankNode"!==E.termType?E:"graph"===w?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:E.value===R?"_:a":"_:z"}}getRelatedPredicate(R){return R.predicate.value}createHashToRelated(R,E){var w=this;return ae(function*(){const A=new Map,B=w.blankNodeInfo.get(R).quads;let x=0;for(const L of B){let Q,j;if("BlankNode"===L.subject.termType&&L.subject.value!==R)j=L.subject.value,Q="p";else{if("BlankNode"!==L.object.termType||L.object.value===R)continue;j=L.object.value,Q="r"}++x%100==0&&(yield w._yield());const H=yield w.hashRelatedBlankNode(j,L,E,Q),oe=A.get(H);oe?oe.push(j):A.set(H,[j])}return A})()}}},8911(at,Fe,ne){"use strict";const ae=ne(1126),$=ne(203);at.exports=class extends ${constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new ae("sha1")}modifyFirstDegreeComponent(_,R,E){return"BlankNode"!==R.termType?R:"graph"===E?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:R.value===_?"_:a":"_:z"}}getRelatedPredicate(_){return _.predicate.value}createHashToRelated(_,R){const E=new Map,w=this.blankNodeInfo.get(_).quads;for(const A of w){let B,x;if("BlankNode"===A.subject.termType&&A.subject.value!==_)x=A.subject.value,B="p";else{if("BlankNode"!==A.object.termType||A.object.value===_)continue;x=A.object.value,B="r"}const L=this.hashRelatedBlankNode(x,A,R,B),Q=E.get(L);Q?Q.push(x):E.set(L,[x])}return E}}},4548(at,Fe,ne){"use strict";var ae=ne(9293).default;const $=ne(624),D=ne(6268),_=ne(203),R=ne(8911);let E;try{E=ne(7789)}catch{}function w(A){return Array.isArray(A)?A:Fe.NQuads.legacyDatasetToQuads(A)}Fe.NQuads=ne(8276),Fe.IdentifierIssuer=ne(250),Fe._rdfCanonizeNative=function(A){return A&&(E=A),E},Fe.canonize=function(){var A=ae(function*(B,x){const L=w(B);if(x.useNative){if(!E)throw new Error("rdf-canonize-native not available");if(x.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((Q,j)=>E.canonize(L,x,(H,oe)=>H?j(H):Q(oe)))}if("URDNA2015"===x.algorithm)return new $(x).main(L);if("URGNA2012"===x.algorithm){if(x.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new D(x).main(L)}throw"algorithm"in x?new Error("Invalid RDF Dataset Canonicalization algorithm: "+x.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")});return function(B,x){return A.apply(this,arguments)}}(),Fe._canonizeSync=function(A,B){const x=w(A);if(B.useNative){if(!E)throw new Error("rdf-canonize-native not available");if(B.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return E.canonizeSync(x,B)}if("URDNA2015"===B.algorithm)return new _(B).main(x);if("URGNA2012"===B.algorithm){if(B.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new R(B).main(x)}throw"algorithm"in B?new Error("Invalid RDF Dataset Canonicalization algorithm: "+B.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}},7140(){!function(at){"use strict";if(!at.setImmediate){var _,ne=1,ae={},$=!1,D=at.document,oe=Object.getPrototypeOf&&Object.getPrototypeOf(at);oe=oe&&oe.setTimeout?oe:at,"[object process]"==={}.toString.call(at.process)?function B(){_=function(F){process.nextTick(function(){A(F)})}}():function x(){if(at.postMessage&&!at.importScripts){var F=!0,te=at.onmessage;return at.onmessage=function(){F=!1},at.postMessage("","*"),at.onmessage=te,F}}()?function L(){var F="setImmediate$"+Math.random()+"$",te=function(k){k.source===at&&"string"==typeof k.data&&0===k.data.indexOf(F)&&A(+k.data.slice(F.length))};at.addEventListener?at.addEventListener("message",te,!1):at.attachEvent("onmessage",te),_=function(k){at.postMessage(F+k,"*")}}():at.MessageChannel?function Q(){var F=new MessageChannel;F.port1.onmessage=function(te){A(te.data)},_=function(te){F.port2.postMessage(te)}}():D&&"onreadystatechange"in D.createElement("script")?function j(){var F=D.documentElement;_=function(te){var k=D.createElement("script");k.onreadystatechange=function(){A(te),k.onreadystatechange=null,F.removeChild(k),k=null},F.appendChild(k)}}():function H(){_=function(F){setTimeout(A,0,F)}}(),oe.setImmediate=function R(F){"function"!=typeof F&&(F=new Function(""+F));for(var te=new Array(arguments.length-1),k=0;k<te.length;k++)te[k]=arguments[k+1];return ae[ne]={callback:F,args:te},_(ne),ne++},oe.clearImmediate=E}function E(F){delete ae[F]}function A(F){if($)setTimeout(A,0,F);else{var te=ae[F];if(te){$=!0;try{!function w(F){var te=F.callback,k=F.args;switch(k.length){case 0:te();break;case 1:te(k[0]);break;case 2:te(k[0],k[1]);break;case 3:te(k[0],k[1],k[2]);break;default:te.apply(void 0,k)}}(te)}finally{E(F),$=!1}}}}}(typeof self>"u"?typeof global>"u"?this:global:self)},6119(at){at.exports.RADIUS=6378137,at.exports.FLATTENING=1/298.257223563,at.exports.POLAR_RADIUS=6356752.3142},7789(){},9293(at){function Fe(ae,$,D,_,R,E,w){try{var A=ae[E](w),B=A.value}catch(x){return void D(x)}A.done?$(B):Promise.resolve(B).then(_,R)}at.exports=function ne(ae){return function(){var $=this,D=arguments;return new Promise(function(_,R){var E=ae.apply($,D);function w(B){Fe(E,_,R,w,A,"next",B)}function A(B){Fe(E,_,R,w,A,"throw",B)}w(void 0)})}},at.exports.__esModule=!0,at.exports.default=at.exports},3659(at,Fe,ne){"use strict";ne.d(Fe,{MF:()=>hs,j6:()=>Nn,xZ:()=>gu,om:()=>En,Sx:()=>fa,KO:()=>Yi});var ae=ne(467),$=ne(2040),D=ne(1919),_=ne(7814);let E,w;const x=new WeakMap,L=new WeakMap,Q=new WeakMap,j=new WeakMap,H=new WeakMap;let te={get(ke,Be,Ze){if(ke instanceof IDBTransaction){if("done"===Be)return L.get(ke);if("objectStoreNames"===Be)return ke.objectStoreNames||Q.get(ke);if("store"===Be)return Ze.objectStoreNames[1]?void 0:Ze.objectStore(Ze.objectStoreNames[0])}return I(ke[Be])},set:(ke,Be,Ze)=>(ke[Be]=Ze,!0),has:(ke,Be)=>ke instanceof IDBTransaction&&("done"===Be||"store"===Be)||Be in ke};function ee(ke){return"function"==typeof ke?function ie(ke){return ke!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?function B(){return w||(w=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}().includes(ke)?function(...Be){return ke.apply(N(this),Be),I(x.get(this))}:function(...Be){return I(ke.apply(N(this),Be))}:function(Be,...Ze){const Bt=ke.call(N(this),Be,...Ze);return Q.set(Bt,Be.sort?Be.sort():[Be]),I(Bt)}}(ke):(ke instanceof IDBTransaction&&function F(ke){if(L.has(ke))return;const Be=new Promise((Ze,Bt)=>{const ur=()=>{ke.removeEventListener("complete",Ir),ke.removeEventListener("error",Or),ke.removeEventListener("abort",Or)},Ir=()=>{Ze(),ur()},Or=()=>{Bt(ke.error||new DOMException("AbortError","AbortError")),ur()};ke.addEventListener("complete",Ir),ke.addEventListener("error",Or),ke.addEventListener("abort",Or)});L.set(ke,Be)}(ke),((ke,Be)=>Be.some(Ze=>ke instanceof Ze))(ke,function A(){return E||(E=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}())?new Proxy(ke,te):ke)}function I(ke){if(ke instanceof IDBRequest)return function oe(ke){const Be=new Promise((Ze,Bt)=>{const ur=()=>{ke.removeEventListener("success",Ir),ke.removeEventListener("error",Or)},Ir=()=>{Ze(I(ke.result)),ur()},Or=()=>{Bt(ke.error),ur()};ke.addEventListener("success",Ir),ke.addEventListener("error",Or)});return Be.then(Ze=>{Ze instanceof IDBCursor&&x.set(Ze,ke)}).catch(()=>{}),H.set(Be,ke),Be}(ke);if(j.has(ke))return j.get(ke);const Be=ee(ke);return Be!==ke&&(j.set(ke,Be),H.set(Be,ke)),Be}const N=ke=>H.get(ke),pe=["get","getKey","getAll","getAllKeys","count"],se=["put","add","delete","clear"],fe=new Map;function Pe(ke,Be){if(!(ke instanceof IDBDatabase)||Be in ke||"string"!=typeof Be)return;if(fe.get(Be))return fe.get(Be);const Ze=Be.replace(/FromIndex$/,""),Bt=Be!==Ze,ur=se.includes(Ze);if(!(Ze in(Bt?IDBIndex:IDBObjectStore).prototype)||!ur&&!pe.includes(Ze))return;const Ir=function(){var Or=(0,ae.A)(function*(qn,...Yr){const ko=this.transaction(qn,ur?"readwrite":"readonly");let Ho=ko.store;return Bt&&(Ho=Ho.index(Yr.shift())),(yield Promise.all([Ho[Ze](...Yr),ur&&ko.done]))[0]});return function(Yr){return Or.apply(this,arguments)}}();return fe.set(Be,Ir),Ir}!function k(ke){te=ke(te)}(ke=>({...ke,get:(Be,Ze,Bt)=>Pe(Be,Ze)||ke.get(Be,Ze,Bt),has:(Be,Ze)=>!!Pe(Be,Ze)||ke.has(Be,Ze)}));class Ke{constructor(Be){this.container=Be}getPlatformInfoString(){return this.container.getProviders().map(Ze=>{if(function Ve(ke){return"VERSION"===ke.getComponent()?.type}(Ze)){const Bt=Ze.getImmediate();return`${Bt.library}/${Bt.version}`}return null}).filter(Ze=>Ze).join(" ")}}const ge="@firebase/app",ct=new D.Vy("@firebase/app"),gt="@firebase/app-compat",Tt="@firebase/analytics-compat",Qe="@firebase/analytics",st="@firebase/app-check-compat",Le="@firebase/app-check",Ce="@firebase/auth",mt="@firebase/auth-compat",At="@firebase/database",dt="@firebase/data-connect",Mt="@firebase/database-compat",nr="@firebase/functions",mr="@firebase/functions-compat",Ct="@firebase/installations",pr="@firebase/installations-compat",Lr="@firebase/messaging",an="@firebase/messaging-compat",Ei="@firebase/performance",yo="@firebase/performance-compat",pn="@firebase/remote-config",_o="@firebase/remote-config-compat",Oi="@firebase/storage",dl="@firebase/storage-compat",qo="@firebase/firestore",us="@firebase/ai",cs="@firebase/firestore-compat",pu="firebase",jo="[DEFAULT]",ci={[ge]:"fire-core",[gt]:"fire-core-compat",[Qe]:"fire-analytics",[Tt]:"fire-analytics-compat",[Le]:"fire-app-check",[st]:"fire-app-check-compat",[Ce]:"fire-auth",[mt]:"fire-auth-compat",[At]:"fire-rtdb",[dt]:"fire-data-connect",[Mt]:"fire-rtdb-compat",[nr]:"fire-fn",[mr]:"fire-fn-compat",[Ct]:"fire-iid",[pr]:"fire-iid-compat",[Lr]:"fire-fcm",[an]:"fire-fcm-compat",[Ei]:"fire-perf",[yo]:"fire-perf-compat",[pn]:"fire-rc",[_o]:"fire-rc-compat",[Oi]:"fire-gcs",[dl]:"fire-gcs-compat",[qo]:"fire-fst",[cs]:"fire-fst-compat",[us]:"fire-vertex","fire-js":"fire-js",[pu]:"fire-js-all"},Ti=new Map,Kt=new Map,$o=new Map;function Na(ke,Be){try{ke.container.addComponent(Be)}catch(Ze){ct.debug(`Component ${Be.name} failed to register with FirebaseApp ${ke.name}`,Ze)}}function En(ke){const Be=ke.name;if($o.has(Be))return ct.debug(`There were multiple attempts to register component ${Be}.`),!1;$o.set(Be,ke);for(const Ze of Ti.values())Na(Ze,ke);for(const Ze of Kt.values())Na(Ze,ke);return!0}function Nn(ke,Be){const Ze=ke.container.getProvider("heartbeat").getImmediate({optional:!0});return Ze&&Ze.triggerHeartbeat(),ke.container.getProvider(Be)}function gu(ke){return null!=ke&&void 0!==ke.settings}const Ln=new _.FA("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."});class ha{constructor(Be,Ze,Bt){this._isDeleted=!1,this._options={...Be},this._config={...Ze},this._name=Ze.name,this._automaticDataCollectionEnabled=Ze.automaticDataCollectionEnabled,this._container=Bt,this.container.addComponent(new $.uA("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(Be){this.checkDestroyed(),this._automaticDataCollectionEnabled=Be}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(Be){this._isDeleted=Be}checkDestroyed(){if(this.isDeleted)throw Ln.create("app-deleted",{appName:this._name})}}const hs="12.8.0";function fa(ke=jo){const Be=Ti.get(ke);if(!Be&&ke===jo&&(0,_.T9)())return function Ot(ke,Be={}){let Ze=ke;"object"!=typeof Be&&(Be={name:Be});const Bt={name:jo,automaticDataCollectionEnabled:!0,...Be},ur=Bt.name;if("string"!=typeof ur||!ur)throw Ln.create("bad-app-name",{appName:String(ur)});if(Ze||(Ze=(0,_.T9)()),!Ze)throw Ln.create("no-options");const Ir=Ti.get(ur);if(Ir){if((0,_.bD)(Ze,Ir.options)&&(0,_.bD)(Bt,Ir.config))return Ir;throw Ln.create("duplicate-app",{appName:ur})}const Or=new $.h1(ur);for(const Yr of $o.values())Or.addComponent(Yr);const qn=new ha(Ze,Bt,Or);return Ti.set(ur,qn),qn}();if(!Be)throw Ln.create("no-app",{appName:ke});return Be}function Yi(ke,Be,Ze){let Bt=ci[ke]??ke;Ze&&(Bt+=`-${Ze}`);const ur=Bt.match(/\s|\//),Ir=Be.match(/\s|\//);if(ur||Ir){const Or=[`Unable to register library "${Bt}" with version "${Be}":`];return ur&&Or.push(`library name "${Bt}" contains illegal characters (whitespace or "/")`),ur&&Ir&&Or.push("and"),Ir&&Or.push(`version name "${Be}" contains illegal characters (whitespace or "/")`),void ct.warn(Or.join(" "))}En(new $.uA(`${Bt}-version`,()=>({library:Bt,version:Be}),"VERSION"))}const Me="firebase-heartbeat-store";let jt=null;function wr(){return jt||(jt=function re(ke,Be,{blocked:Ze,upgrade:Bt,blocking:ur,terminated:Ir}={}){const Or=indexedDB.open(ke,Be),qn=I(Or);return Bt&&Or.addEventListener("upgradeneeded",Yr=>{Bt(I(Or.result),Yr.oldVersion,Yr.newVersion,I(Or.transaction),Yr)}),Ze&&Or.addEventListener("blocked",Yr=>Ze(Yr.oldVersion,Yr.newVersion,Yr)),qn.then(Yr=>{Ir&&Yr.addEventListener("close",()=>Ir()),ur&&Yr.addEventListener("versionchange",ko=>ur(ko.oldVersion,ko.newVersion,ko))}).catch(()=>{}),qn}("firebase-heartbeat-database",1,{upgrade:(ke,Be)=>{if(0===Be)try{ke.createObjectStore(Me)}catch(Ze){console.warn(Ze)}}}).catch(ke=>{throw Ln.create("idb-open",{originalErrorMessage:ke.message})})),jt}function sn(){return(sn=(0,ae.A)(function*(ke){try{const Ze=(yield wr()).transaction(Me),Bt=yield Ze.objectStore(Me).get(ir(ke));return yield Ze.done,Bt}catch(Be){if(Be instanceof _.g)ct.warn(Be.message);else{const Ze=Ln.create("idb-get",{originalErrorMessage:Be?.message});ct.warn(Ze.message)}}})).apply(this,arguments)}function Sn(ke,Be){return ht.apply(this,arguments)}function ht(){return(ht=(0,ae.A)(function*(ke,Be){try{const Bt=(yield wr()).transaction(Me,"readwrite");yield Bt.objectStore(Me).put(Be,ir(ke)),yield Bt.done}catch(Ze){if(Ze instanceof _.g)ct.warn(Ze.message);else{const Bt=Ln.create("idb-set",{originalErrorMessage:Ze?.message});ct.warn(Bt.message)}}})).apply(this,arguments)}function ir(ke){return`${ke.name}!${ke.options.appId}`}class Ft{constructor(Be){this.container=Be,this._heartbeatsCache=null;const Ze=this.container.getProvider("app").getImmediate();this._storage=new Oa(Ze),this._heartbeatsCachePromise=this._storage.read().then(Bt=>(this._heartbeatsCache=Bt,Bt))}triggerHeartbeat(){var Be=this;return(0,ae.A)(function*(){try{const Bt=Be.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),ur=pa();if(null==Be._heartbeatsCache?.heartbeats&&(Be._heartbeatsCache=yield Be._heartbeatsCachePromise,null==Be._heartbeatsCache?.heartbeats)||Be._heartbeatsCache.lastSentHeartbeatDate===ur||Be._heartbeatsCache.heartbeats.some(Ir=>Ir.date===ur))return;if(Be._heartbeatsCache.heartbeats.push({date:ur,agent:Bt}),Be._heartbeatsCache.heartbeats.length>30){const Ir=function We(ke){if(0===ke.length)return-1;let Be=0,Ze=ke[0].date;for(let Bt=1;Bt<ke.length;Bt++)ke[Bt].date<Ze&&(Ze=ke[Bt].date,Be=Bt);return Be}(Be._heartbeatsCache.heartbeats);Be._heartbeatsCache.heartbeats.splice(Ir,1)}return Be._storage.overwrite(Be._heartbeatsCache)}catch(Ze){ct.warn(Ze)}})()}getHeartbeatsHeader(){var Be=this;return(0,ae.A)(function*(){try{if(null===Be._heartbeatsCache&&(yield Be._heartbeatsCachePromise),null==Be._heartbeatsCache?.heartbeats||0===Be._heartbeatsCache.heartbeats.length)return"";const Ze=pa(),{heartbeatsToSend:Bt,unsentEntries:ur}=function kt(ke,Be=1024){const Ze=[];let Bt=ke.slice();for(const ur of ke){const Ir=Ze.find(Or=>Or.agent===ur.agent);if(Ir){if(Ir.dates.push(ur.date),St(Ze)>Be){Ir.dates.pop();break}}else if(Ze.push({agent:ur.agent,dates:[ur.date]}),St(Ze)>Be){Ze.pop();break}Bt=Bt.slice(1)}return{heartbeatsToSend:Ze,unsentEntries:Bt}}(Be._heartbeatsCache.heartbeats),Ir=(0,_.Uj)(JSON.stringify({version:2,heartbeats:Bt}));return Be._heartbeatsCache.lastSentHeartbeatDate=Ze,ur.length>0?(Be._heartbeatsCache.heartbeats=ur,yield Be._storage.overwrite(Be._heartbeatsCache)):(Be._heartbeatsCache.heartbeats=[],Be._storage.overwrite(Be._heartbeatsCache)),Ir}catch(Ze){return ct.warn(Ze),""}})()}}function pa(){return(new Date).toISOString().substring(0,10)}class Oa{constructor(Be){this.app=Be,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return(0,ae.A)(function*(){return!!(0,_.zW)()&&(0,_.eX)().then(()=>!0).catch(()=>!1)})()}read(){var Be=this;return(0,ae.A)(function*(){if(yield Be._canUseIndexedDBPromise){const Bt=yield function Mr(ke){return sn.apply(this,arguments)}(Be.app);return Bt?.heartbeats?Bt:{heartbeats:[]}}return{heartbeats:[]}})()}overwrite(Be){var Ze=this;return(0,ae.A)(function*(){if(yield Ze._canUseIndexedDBPromise){const ur=yield Ze.read();return Sn(Ze.app,{lastSentHeartbeatDate:Be.lastSentHeartbeatDate??ur.lastSentHeartbeatDate,heartbeats:Be.heartbeats})}})()}add(Be){var Ze=this;return(0,ae.A)(function*(){if(yield Ze._canUseIndexedDBPromise){const ur=yield Ze.read();return Sn(Ze.app,{lastSentHeartbeatDate:Be.lastSentHeartbeatDate??ur.lastSentHeartbeatDate,heartbeats:[...ur.heartbeats,...Be.heartbeats]})}})()}}function St(ke){return(0,_.Uj)(JSON.stringify({version:2,heartbeats:ke})).length}!function wt(ke){En(new $.uA("platform-logger",Be=>new Ke(Be),"PRIVATE")),En(new $.uA("heartbeat",Be=>new Ft(Be),"PRIVATE")),Yi(ge,"0.14.7",ke),Yi(ge,"0.14.7","esm2020"),Yi("fire-js","")}("")},2040(at,Fe,ne){"use strict";ne.d(Fe,{h1:()=>A,uA:()=>D});var ae=ne(467),$=ne(7814);class D{constructor(x,L,Q){this.name=x,this.instanceFactory=L,this.type=Q,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(x){return this.instantiationMode=x,this}setMultipleInstances(x){return this.multipleInstances=x,this}setServiceProps(x){return this.serviceProps=x,this}setInstanceCreatedCallback(x){return this.onInstanceCreated=x,this}}const _="[DEFAULT]";class R{constructor(x,L){this.name=x,this.container=L,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(x){const L=this.normalizeInstanceIdentifier(x);if(!this.instancesDeferred.has(L)){const Q=new $.cY;if(this.instancesDeferred.set(L,Q),this.isInitialized(L)||this.shouldAutoInitialize())try{const j=this.getOrInitializeService({instanceIdentifier:L});j&&Q.resolve(j)}catch{}}return this.instancesDeferred.get(L).promise}getImmediate(x){const L=this.normalizeInstanceIdentifier(x?.identifier),Q=x?.optional??!1;if(!this.isInitialized(L)&&!this.shouldAutoInitialize()){if(Q)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:L})}catch(j){if(Q)return null;throw j}}getComponent(){return this.component}setComponent(x){if(x.name!==this.name)throw Error(`Mismatching Component ${x.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=x,this.shouldAutoInitialize()){if(function w(B){return"EAGER"===B.instantiationMode}(x))try{this.getOrInitializeService({instanceIdentifier:_})}catch{}for(const[L,Q]of this.instancesDeferred.entries()){const j=this.normalizeInstanceIdentifier(L);try{const H=this.getOrInitializeService({instanceIdentifier:j});Q.resolve(H)}catch{}}}}clearInstance(x=_){this.instancesDeferred.delete(x),this.instancesOptions.delete(x),this.instances.delete(x)}delete(){var x=this;return(0,ae.A)(function*(){const L=Array.from(x.instances.values());yield Promise.all([...L.filter(Q=>"INTERNAL"in Q).map(Q=>Q.INTERNAL.delete()),...L.filter(Q=>"_delete"in Q).map(Q=>Q._delete())])})()}isComponentSet(){return null!=this.component}isInitialized(x=_){return this.instances.has(x)}getOptions(x=_){return this.instancesOptions.get(x)||{}}initialize(x={}){const{options:L={}}=x,Q=this.normalizeInstanceIdentifier(x.instanceIdentifier);if(this.isInitialized(Q))throw Error(`${this.name}(${Q}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const j=this.getOrInitializeService({instanceIdentifier:Q,options:L});for(const[H,oe]of this.instancesDeferred.entries())Q===this.normalizeInstanceIdentifier(H)&&oe.resolve(j);return j}onInit(x,L){const Q=this.normalizeInstanceIdentifier(L),j=this.onInitCallbacks.get(Q)??new Set;j.add(x),this.onInitCallbacks.set(Q,j);const H=this.instances.get(Q);return H&&x(H,Q),()=>{j.delete(x)}}invokeOnInitCallbacks(x,L){const Q=this.onInitCallbacks.get(L);if(Q)for(const j of Q)try{j(x,L)}catch{}}getOrInitializeService({instanceIdentifier:x,options:L={}}){let Q=this.instances.get(x);if(!Q&&this.component&&(Q=this.component.instanceFactory(this.container,{instanceIdentifier:(B=x,B===_?void 0:B),options:L}),this.instances.set(x,Q),this.instancesOptions.set(x,L),this.invokeOnInitCallbacks(Q,x),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,x,Q)}catch{}var B;return Q||null}normalizeInstanceIdentifier(x=_){return this.component?this.component.multipleInstances?x:_:x}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class A{constructor(x){this.name=x,this.providers=new Map}addComponent(x){const L=this.getProvider(x.name);if(L.isComponentSet())throw new Error(`Component ${x.name} has already been registered with ${this.name}`);L.setComponent(x)}addOrOverwriteComponent(x){this.getProvider(x.name).isComponentSet()&&this.providers.delete(x.name),this.addComponent(x)}getProvider(x){if(this.providers.has(x))return this.providers.get(x);const L=new R(x,this);return this.providers.set(x,L),L}getProviders(){return Array.from(this.providers.values())}}},1919(at,Fe,ne){"use strict";ne.d(Fe,{$b:()=>$,Vy:()=>w});const ae=[];var $=function(x){return x[x.DEBUG=0]="DEBUG",x[x.VERBOSE=1]="VERBOSE",x[x.INFO=2]="INFO",x[x.WARN=3]="WARN",x[x.ERROR=4]="ERROR",x[x.SILENT=5]="SILENT",x}($||{});const D={debug:$.DEBUG,verbose:$.VERBOSE,info:$.INFO,warn:$.WARN,error:$.ERROR,silent:$.SILENT},_=$.INFO,R={[$.DEBUG]:"log",[$.VERBOSE]:"log",[$.INFO]:"info",[$.WARN]:"warn",[$.ERROR]:"error"},E=(x,L,...Q)=>{if(L<x.logLevel)return;const j=(new Date).toISOString(),H=R[L];if(!H)throw new Error(`Attempted to log a message with an invalid logType (value: ${L})`);console[H](`[${j}] ${x.name}:`,...Q)};class w{constructor(L){this.name=L,this._logLevel=_,this._logHandler=E,this._userLogHandler=null,ae.push(this)}get logLevel(){return this._logLevel}set logLevel(L){if(!(L in $))throw new TypeError(`Invalid value "${L}" assigned to \`logLevel\``);this._logLevel=L}setLogLevel(L){this._logLevel="string"==typeof L?D[L]:L}get logHandler(){return this._logHandler}set logHandler(L){if("function"!=typeof L)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=L}get userLogHandler(){return this._userLogHandler}set userLogHandler(L){this._userLogHandler=L}debug(...L){this._userLogHandler&&this._userLogHandler(this,$.DEBUG,...L),this._logHandler(this,$.DEBUG,...L)}log(...L){this._userLogHandler&&this._userLogHandler(this,$.VERBOSE,...L),this._logHandler(this,$.VERBOSE,...L)}info(...L){this._userLogHandler&&this._userLogHandler(this,$.INFO,...L),this._logHandler(this,$.INFO,...L)}warn(...L){this._userLogHandler&&this._userLogHandler(this,$.WARN,...L),this._logHandler(this,$.WARN,...L)}error(...L){this._userLogHandler&&this._userLogHandler(this,$.ERROR,...L),this._logHandler(this,$.ERROR,...L)}}},6702(at,Fe,ne){"use strict";ne.r(Fe),ne.d(Fe,{StorageError:()=>x,StorageErrorCode:()=>L,StringFormat:()=>pn,_FbsBlob:()=>ci,_Location:()=>Ie,_TaskEvent:()=>pa,_TaskState:()=>kt,_UploadTask:()=>qn,_dataFromString:()=>Oi,_getChild:()=>Vm,_invalidArgument:()=>fe,_invalidRootOperation:()=>xe,connectStorageEmulator:()=>bf,deleteObject:()=>Kc,getBlob:()=>yl,getBytes:()=>wI,getDownloadURL:()=>yu,getMetadata:()=>wf,getStorage:()=>_u,getStream:()=>Ef,list:()=>er,listAll:()=>ps,ref:()=>Fa,updateMetadata:()=>Xr,uploadBytes:()=>Fn,uploadBytesResumable:()=>_f,uploadString:()=>vl});var ae=ne(467),$=ne(3659),D=ne(7814),_=ne(2040);const R="firebasestorage.googleapis.com",E="storageBucket";class x extends D.g{constructor(Y,ve,Te=0){super(Q(Y),`Firebase Storage: ${ve} (${Q(Y)})`),this.status_=Te,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,x.prototype)}get status(){return this.status_}set status(Y){this.status_=Y}_codeEquals(Y){return Q(Y)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(Y){this.customData.serverResponse=Y,this.message=this.customData.serverResponse?`${this._baseMessage}\n${this.customData.serverResponse}`:this._baseMessage}}var L=function(J){return J.UNKNOWN="unknown",J.OBJECT_NOT_FOUND="object-not-found",J.BUCKET_NOT_FOUND="bucket-not-found",J.PROJECT_NOT_FOUND="project-not-found",J.QUOTA_EXCEEDED="quota-exceeded",J.UNAUTHENTICATED="unauthenticated",J.UNAUTHORIZED="unauthorized",J.UNAUTHORIZED_APP="unauthorized-app",J.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",J.INVALID_CHECKSUM="invalid-checksum",J.CANCELED="canceled",J.INVALID_EVENT_NAME="invalid-event-name",J.INVALID_URL="invalid-url",J.INVALID_DEFAULT_BUCKET="invalid-default-bucket",J.NO_DEFAULT_BUCKET="no-default-bucket",J.CANNOT_SLICE_BLOB="cannot-slice-blob",J.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",J.NO_DOWNLOAD_URL="no-download-url",J.INVALID_ARGUMENT="invalid-argument",J.INVALID_ARGUMENT_COUNT="invalid-argument-count",J.APP_DELETED="app-deleted",J.INVALID_ROOT_OPERATION="invalid-root-operation",J.INVALID_FORMAT="invalid-format",J.INTERNAL_ERROR="internal-error",J.UNSUPPORTED_ENVIRONMENT="unsupported-environment",J}(L||{});function Q(J){return"storage/"+J}function j(){return new x(L.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function ie(){return new x(L.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function ee(){return new x(L.CANCELED,"User canceled the upload/download.")}function re(){return new x(L.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function fe(J){return new x(L.INVALID_ARGUMENT,J)}function Pe(){return new x(L.APP_DELETED,"The Firebase app was deleted.")}function xe(J){return new x(L.INVALID_ROOT_OPERATION,"The operation '"+J+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function Ne(J,Y){return new x(L.INVALID_FORMAT,"String does not match format '"+J+"': "+Y)}function tt(J){throw new x(L.INTERNAL_ERROR,"Internal error: "+J)}class Ie{constructor(Y,ve){this.bucket=Y,this.path_=ve}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const Y=encodeURIComponent;return"/b/"+Y(this.bucket)+"/o/"+Y(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(Y,ve){let Te;try{Te=Ie.makeFromUrl(Y,ve)}catch{return new Ie(Y,"")}if(""===Te.path)return Te;throw function N(J){return new x(L.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+J+"'.")}(Y)}static makeFromUrl(Y,ve){let Te=null;const Oe="([A-Za-z0-9.\\-_]+)",Qt=new RegExp("^gs://"+Oe+"(/(.*))?$","i");function Dr(Kr){Kr.path_=decodeURIComponent(Kr.path)}const gn=ve.replace(/[.]/g,"\\."),di=[{regex:Qt,indices:{bucket:1,path:3},postModify:function ce(Kr){"/"===Kr.path.charAt(Kr.path.length-1)&&(Kr.path_=Kr.path_.slice(0,-1))}},{regex:new RegExp(`^https?://${gn}/v[A-Za-z0-9_]+/b/${Oe}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:Dr},{regex:new RegExp(`^https?://${ve===R?"(?:storage.googleapis.com|storage.cloud.google.com)":ve}/${Oe}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:Dr}];for(let Kr=0;Kr<di.length;Kr++){const Zi=di[Kr],No=Zi.regex.exec(Y);if(No){let wu=No[Zi.indices.path];wu||(wu=""),Te=new Ie(No[Zi.indices.bucket],wu),Zi.postModify(Te);break}}if(null==Te)throw function I(J){return new x(L.INVALID_URL,"Invalid URL '"+J+"'.")}(Y);return Te}}class he{constructor(Y){this.promise_=Promise.reject(Y)}getPromise(){return this.promise_}cancel(Y=!1){}}function ct(J){return"string"==typeof J||J instanceof String}function gt(J){return Tt()&&J instanceof Blob}function Tt(){return typeof Blob<"u"}function Qe(J,Y,ve,Te){if(Te<Y)throw fe(`Invalid value for '${J}'. Expected ${Y} or greater.`);if(Te>ve)throw fe(`Invalid value for '${J}'. Expected ${ve} or less.`)}function st(J,Y,ve){let Te=Y;return null==ve&&(Te=`https://${Y}`),`${ve}://${Te}/v0${J}`}function Le(J){const Y=encodeURIComponent;let ve="?";for(const Te in J)J.hasOwnProperty(Te)&&(ve=ve+(Y(Te)+"=")+Y(J[Te])+"&");return ve=ve.slice(0,-1),ve}var Ce=function(J){return J[J.NO_ERROR=0]="NO_ERROR",J[J.NETWORK_ERROR=1]="NETWORK_ERROR",J[J.ABORT=2]="ABORT",J}(Ce||{});function mt(J,Y){const ve=J>=500&&J<600,Oe=-1!==[408,429].indexOf(J),ce=-1!==Y.indexOf(J);return ve||Oe||ce}class At{constructor(Y,ve,Te,Oe,ce,It,Qt,qt,Dr,Sr,gn,nn=!0,Yn=!1){this.url_=Y,this.method_=ve,this.headers_=Te,this.body_=Oe,this.successCodes_=ce,this.additionalRetryCodes_=It,this.callback_=Qt,this.errorCallback_=qt,this.timeout_=Dr,this.progressCallback_=Sr,this.connectionFactory_=gn,this.retry=nn,this.isUsingEmulator=Yn,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((mn,Ii)=>{this.resolve_=mn,this.reject_=Ii,this.start_()})}start_(){const ve=(Te,Oe)=>{const ce=this.resolve_,It=this.reject_,Qt=Oe.connection;if(Oe.wasSuccessCode)try{const qt=this.callback_(Qt,Qt.getResponse());!function Ve(J){return void 0!==J}(qt)?ce():ce(qt)}catch(qt){It(qt)}else if(null!==Qt){const qt=j();qt.serverResponse=Qt.getErrorText(),It(this.errorCallback_?this.errorCallback_(Qt,qt):qt)}else It(Oe.canceled?this.appDelete_?Pe():ee():ie())};this.canceled_?ve(0,new dt(!1,null,!0)):this.backoffId_=function ye(J,Y,ve){let Te=1,Oe=null,ce=null,It=!1,Qt=0;function qt(){return 2===Qt}let Dr=!1;function Sr(...Cn){Dr||(Dr=!0,Y.apply(null,Cn))}function gn(Cn){Oe=setTimeout(()=>{Oe=null,J(Yn,qt())},Cn)}function nn(){ce&&clearTimeout(ce)}function Yn(Cn,...Ji){if(Dr)return void nn();if(Cn)return nn(),void Sr.call(null,Cn,...Ji);if(qt()||It)return nn(),void Sr.call(null,Cn,...Ji);let di;Te<64&&(Te*=2),1===Qt?(Qt=2,di=0):di=1e3*(Te+Math.random()),gn(di)}let mn=!1;function Ii(Cn){mn||(mn=!0,nn(),!Dr&&(null!==Oe?(Cn||(Qt=2),clearTimeout(Oe),gn(0)):Cn||(Qt=1)))}return gn(0),ce=setTimeout(()=>{It=!0,Ii(!0)},ve),Ii}((Te,Oe)=>{if(Oe)return void Te(!1,new dt(!1,null,!0));const ce=this.connectionFactory_();this.pendingConnection_=ce;const It=Qt=>{null!==this.progressCallback_&&this.progressCallback_(Qt.loaded,Qt.lengthComputable?Qt.total:-1)};null!==this.progressCallback_&&ce.addUploadProgressListener(It),ce.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&ce.removeUploadProgressListener(It),this.pendingConnection_=null;const Qt=ce.getErrorCode()===Ce.NO_ERROR,qt=ce.getStatus();if(!Qt||mt(qt,this.additionalRetryCodes_)&&this.retry){const Sr=ce.getErrorCode()===Ce.ABORT;return void Te(!1,new dt(!1,null,Sr))}const Dr=-1!==this.successCodes_.indexOf(qt);Te(!0,new dt(Dr,ce))})},ve,this.timeout_)}getPromise(){return this.promise_}cancel(Y){this.canceled_=!0,this.appDelete_=Y||!1,null!==this.backoffId_&&function Ke(J){J(!1)}(this.backoffId_),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class dt{constructor(Y,ve,Te){this.wasSuccessCode=Y,this.connection=ve,this.canceled=!!Te}}function an(...J){const Y=function Lr(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}();if(void 0!==Y){const ve=new Y;for(let Te=0;Te<J.length;Te++)ve.append(J[Te]);return ve.getBlob()}if(Tt())return new Blob(J);throw new x(L.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}const pn={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class _o{constructor(Y,ve){this.data=Y,this.contentType=ve||null}}function Oi(J,Y){switch(J){case pn.RAW:return new _o(dl(Y));case pn.BASE64:case pn.BASE64URL:return new _o(us(J,Y));case pn.DATA_URL:return new _o(function pu(J){const Y=new cs(J);return Y.base64?us(pn.BASE64,Y.rest):function qo(J){let Y;try{Y=decodeURIComponent(J)}catch{throw Ne(pn.DATA_URL,"Malformed data URL.")}return dl(Y)}(Y.rest)}(Y),function ca(J){return new cs(J).contentType}(Y))}throw j()}function dl(J){const Y=[];for(let ve=0;ve<J.length;ve++){let Te=J.charCodeAt(ve);Te<=127?Y.push(Te):Te<=2047?Y.push(192|Te>>6,128|63&Te):55296==(64512&Te)?ve<J.length-1&&56320==(64512&J.charCodeAt(ve+1))?(Te=65536|(1023&Te)<<10|1023&J.charCodeAt(++ve),Y.push(240|Te>>18,128|Te>>12&63,128|Te>>6&63,128|63&Te)):Y.push(239,191,189):56320==(64512&Te)?Y.push(239,191,189):Y.push(224|Te>>12,128|Te>>6&63,128|63&Te)}return new Uint8Array(Y)}function us(J,Y){switch(J){case pn.BASE64:{const Oe=-1!==Y.indexOf("-"),ce=-1!==Y.indexOf("_");if(Oe||ce)throw Ne(J,"Invalid character '"+(Oe?"-":"_")+"' found: is it base64url encoded?");break}case pn.BASE64URL:{const Oe=-1!==Y.indexOf("+"),ce=-1!==Y.indexOf("/");if(Oe||ce)throw Ne(J,"Invalid character '"+(Oe?"+":"/")+"' found: is it base64 encoded?");Y=Y.replace(/-/g,"+").replace(/_/g,"/");break}}let ve;try{ve=function yo(J){if(typeof atob>"u")throw function se(J){return new x(L.UNSUPPORTED_ENVIRONMENT,`${J} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}("base-64");return atob(J)}(Y)}catch(Oe){throw Oe.message.includes("polyfill")?Oe:Ne(J,"Invalid character found")}const Te=new Uint8Array(ve.length);for(let Oe=0;Oe<ve.length;Oe++)Te[Oe]=ve.charCodeAt(Oe);return Te}class cs{constructor(Y){this.base64=!1,this.contentType=null;const ve=Y.match(/^data:([^,]+)?,/);if(null===ve)throw Ne(pn.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const Te=ve[1]||null;null!=Te&&(this.base64=function jo(J,Y){return J.length>=Y.length&&J.substring(J.length-Y.length)===Y}(Te,";base64"),this.contentType=this.base64?Te.substring(0,Te.length-7):Te),this.rest=Y.substring(Y.indexOf(",")+1)}}class ci{constructor(Y,ve){let Te=0,Oe="";gt(Y)?(this.data_=Y,Te=Y.size,Oe=Y.type):Y instanceof ArrayBuffer?(ve?this.data_=new Uint8Array(Y):(this.data_=new Uint8Array(Y.byteLength),this.data_.set(new Uint8Array(Y))),Te=this.data_.length):Y instanceof Uint8Array&&(ve?this.data_=Y:(this.data_=new Uint8Array(Y.length),this.data_.set(Y)),Te=Y.length),this.size_=Te,this.type_=Oe}size(){return this.size_}type(){return this.type_}slice(Y,ve){if(gt(this.data_)){const Oe=function Ei(J,Y,ve){return J.webkitSlice?J.webkitSlice(Y,ve):J.mozSlice?J.mozSlice(Y,ve):J.slice?J.slice(Y,ve):null}(this.data_,Y,ve);return null===Oe?null:new ci(Oe)}{const Te=new Uint8Array(this.data_.buffer,Y,ve-Y);return new ci(Te,!0)}}static getBlob(...Y){if(Tt()){const ve=Y.map(Te=>Te instanceof ci?Te.data_:Te);return new ci(an.apply(null,ve))}{const ve=Y.map(It=>ct(It)?Oi(pn.RAW,It).data:It.data_);let Te=0;ve.forEach(It=>{Te+=It.byteLength});const Oe=new Uint8Array(Te);let ce=0;return ve.forEach(It=>{for(let Qt=0;Qt<It.length;Qt++)Oe[ce++]=It[Qt]}),new ci(Oe,!0)}}uploadData(){return this.data_}}function Ti(J){let Y;try{Y=JSON.parse(J)}catch{return null}return function et(J){return"object"==typeof J&&!Array.isArray(J)}(Y)?Y:null}function Na(J){const Y=J.lastIndexOf("/",J.length-2);return-1===Y?J:J.slice(Y+1)}function Po(J,Y){return Y}class En{constructor(Y,ve,Te,Oe){this.server=Y,this.local=ve||Y,this.writable=!!Te,this.xform=Oe||Po}}let Nn=null;function Xn(){if(Nn)return Nn;const J=[];J.push(new En("bucket")),J.push(new En("generation")),J.push(new En("metageneration")),J.push(new En("name","fullPath",!0));const ve=new En("name");ve.xform=function Y(ce,It){return function ds(J){return!ct(J)||J.length<2?J:Na(J)}(It)},J.push(ve);const Oe=new En("size");return Oe.xform=function Te(ce,It){return void 0!==It?Number(It):It},J.push(Oe),J.push(new En("timeCreated")),J.push(new En("updated")),J.push(new En("md5Hash",null,!0)),J.push(new En("cacheControl",null,!0)),J.push(new En("contentDisposition",null,!0)),J.push(new En("contentEncoding",null,!0)),J.push(new En("contentLanguage",null,!0)),J.push(new En("contentType",null,!0)),J.push(new En("metadata","customMetadata",!0)),Nn=J,Nn}function wo(J,Y,ve){const Te=Ti(Y);return null===Te?null:function gu(J,Y,ve){const Te={type:"file"},Oe=ve.length;for(let ce=0;ce<Oe;ce++){const It=ve[ce];Te[It.local]=It.xform(Te,Y[It.server])}return function da(J,Y){Object.defineProperty(J,"ref",{get:function ve(){const ce=new Ie(J.bucket,J.fullPath);return Y._makeStorageReference(ce)}})}(Te,J),Te}(J,Te,ve)}function Ln(J,Y){const ve={},Te=Y.length;for(let Oe=0;Oe<Te;Oe++){const ce=Y[Oe];ce.writable&&(ve[ce.server]=J[ce.local])}return JSON.stringify(ve)}const ha="prefixes";class Ot{constructor(Y,ve,Te,Oe){this.url=Y,this.method=ve,this.handler=Te,this.timeout=Oe,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function Mi(J){if(!J)throw j()}function fa(J,Y){return function ve(Te,Oe){const ce=wo(J,Oe,Y);return Mi(null!==ce),ce}}function Ki(J){return function Y(ve,Te){let Oe;return Oe=401===ve.getStatus()?ve.getErrorText().includes("Firebase App Check token is invalid")?function te(){return new x(L.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}():function F(){return new x(L.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again.")}():402===ve.getStatus()?function oe(J){return new x(L.QUOTA_EXCEEDED,"Quota for bucket '"+J+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}(J.bucket):403===ve.getStatus()?function k(J){return new x(L.UNAUTHORIZED,"User does not have permission to access '"+J+"'.")}(J.path):Te,Oe.status=ve.getStatus(),Oe.serverResponse=Te.serverResponse,Oe}}function Yi(J){const Y=Ki(J);return function ve(Te,Oe){let ce=Y(Te,Oe);return 404===Te.getStatus()&&(ce=function H(J){return new x(L.OBJECT_NOT_FOUND,"Object '"+J+"' does not exist.")}(J.path)),ce.serverResponse=Oe.serverResponse,ce}}function Ee(J,Y,ve){const Oe=st(Y.fullServerUrl(),J.host,J._protocol),It=J.maxOperationRetryTime,Qt=new Ot(Oe,"GET",fa(J,ve),It);return Qt.errorHandler=Yi(Y),Qt}function we(J,Y,ve,Te,Oe){const ce={};ce.prefix=Y.isRoot?"":Y.path+"/",ve&&ve.length>0&&(ce.delimiter=ve),Te&&(ce.pageToken=Te),Oe&&(ce.maxResults=Oe);const Qt=st(Y.bucketOnlyServerUrl(),J.host,J._protocol),Dr=J.maxOperationRetryTime,Sr=new Ot(Qt,"GET",function $c(J,Y){return function ve(Te,Oe){const ce=function hs(J,Y,ve){const Te=Ti(ve);return null===Te?null:function fl(J,Y,ve){const Te={prefixes:[],items:[],nextPageToken:ve.nextPageToken};if(ve[ha])for(const Oe of ve[ha]){const ce=Oe.replace(/\/$/,""),It=J._makeStorageReference(new Ie(Y,ce));Te.prefixes.push(It)}if(ve.items)for(const Oe of ve.items){const ce=J._makeStorageReference(new Ie(Y,Oe.name));Te.items.push(ce)}return Te}(J,Y,Te)}(J,Y,Oe);return Mi(null!==ce),ce}}(J,Y.bucket),Dr);return Sr.urlParams=ce,Sr.errorHandler=Ki(Y),Sr}function Re(J,Y,ve){const Oe=st(Y.fullServerUrl(),J.host,J._protocol)+"?alt=media",Qt=new Ot(Oe,"GET",(qt,Dr)=>Dr,J.maxOperationRetryTime);return Qt.errorHandler=Yi(Y),void 0!==ve&&(Qt.headers.Range=`bytes=0-${ve}`,Qt.successCodes=[200,206]),Qt}function Mr(J,Y,ve){const Te=Object.assign({},ve);return Te.fullPath=J.path,Te.size=Y.size(),Te.contentType||(Te.contentType=function wr(J,Y){return J&&J.contentType||Y&&Y.type()||"application/octet-stream"}(null,Y)),Te}function sn(J,Y,ve,Te,Oe){const ce=Y.bucketOnlyServerUrl(),It={"X-Goog-Upload-Protocol":"multipart"},qt=function Qt(){let di="";for(let Kr=0;Kr<2;Kr++)di+=Math.random().toString().slice(2);return di}();It["Content-Type"]="multipart/related; boundary="+qt;const Dr=Mr(Y,Te,Oe),Sr=Ln(Dr,ve),Yn=ci.getBlob("--"+qt+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+Sr+"\r\n--"+qt+"\r\nContent-Type: "+Dr.contentType+"\r\n\r\n",Te,"\r\n--"+qt+"--");if(null===Yn)throw re();const mn={name:Dr.fullPath},Ii=st(ce,J.host,J._protocol),Ji=J.maxUploadRetryTime,Wo=new Ot(Ii,"POST",fa(J,ve),Ji);return Wo.urlParams=mn,Wo.headers=It,Wo.body=Yn.uploadData(),Wo.errorHandler=Ki(Y),Wo}class Sn{constructor(Y,ve,Te,Oe){this.current=Y,this.total=ve,this.finalized=!!Te,this.metadata=Oe||null}}function ht(J,Y){let ve=null;try{ve=J.getResponseHeader("X-Goog-Upload-Status")}catch{Mi(!1)}return Mi(!!ve&&-1!==(Y||["active"]).indexOf(ve)),ve}const pa={STATE_CHANGED:"state_changed"},kt={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function Oa(J){switch(J){case"running":case"pausing":case"canceling":return kt.RUNNING;case"paused":return kt.PAUSED;case"success":return kt.SUCCESS;case"canceled":return kt.CANCELED;default:return kt.ERROR}}class St{constructor(Y,ve,Te){if(function ge(J){return"function"==typeof J}(Y)||null!=ve||null!=Te)this.next=Y,this.error=ve??void 0,this.complete=Te??void 0;else{const ce=Y;this.next=ce.next,this.error=ce.error,this.complete=ce.complete}}}function We(J){return(...Y)=>{Promise.resolve().then(()=>J(...Y))}}class ke{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=Ce.NO_ERROR,this.sendPromise_=new Promise(Y=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=Ce.ABORT,Y()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=Ce.NETWORK_ERROR,Y()}),this.xhr_.addEventListener("load",()=>{Y()})})}send(Y,ve,Te,Oe,ce){if(this.sent_)throw tt("cannot .send() more than once");if((0,D.zJ)(Y)&&Te&&(this.xhr_.withCredentials=!0),this.sent_=!0,this.xhr_.open(ve,Y,!0),void 0!==ce)for(const It in ce)ce.hasOwnProperty(It)&&this.xhr_.setRequestHeader(It,ce[It].toString());return void 0!==Oe?this.xhr_.send(Oe):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw tt("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw tt("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw tt("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw tt("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(Y){return this.xhr_.getResponseHeader(Y)}addUploadProgressListener(Y){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",Y)}removeUploadProgressListener(Y){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",Y)}}class Be extends ke{initXhr(){this.xhr_.responseType="text"}}function Ze(){return new Be}class Bt extends ke{initXhr(){this.xhr_.responseType="arraybuffer"}}function ur(){return new Bt}class Ir extends ke{initXhr(){this.xhr_.responseType="blob"}}function Or(){return new Ir}class qn{isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}constructor(Y,ve,Te=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=Y,this._blob=ve,this._metadata=Te,this._mappings=Xn(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=Oe=>{if(this._request=void 0,this._chunkMultiplier=1,Oe._codeEquals(L.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const ce=this.isExponentialBackoffExpired();if(mt(Oe.status,[])){if(!ce)return this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,void this.completeTransitions_();Oe=ie()}this._error=Oe,this._transition("error")}},this._metadataErrorHandler=Oe=>{this._request=void 0,Oe._codeEquals(L.CANCELED)?this.completeTransitions_():(this._error=Oe,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((Oe,ce)=>{this._resolve=Oe,this._reject=ce,this._start()}),this._promise.then(null,()=>{})}_makeProgressCallback(){const Y=this._transferred;return ve=>this._updateProgress(Y+ve)}_shouldDoResumable(Y){return Y.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(Y){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([ve,Te])=>{switch(this._state){case"running":Y(ve,Te);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((Y,ve)=>{const Te=function ir(J,Y,ve,Te,Oe){const ce=Y.bucketOnlyServerUrl(),It=Mr(Y,Te,Oe),Qt={name:It.fullPath},qt=st(ce,J.host,J._protocol),Sr={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${Te.size()}`,"X-Goog-Upload-Header-Content-Type":It.contentType,"Content-Type":"application/json; charset=utf-8"},gn=Ln(It,ve),mn=new Ot(qt,"POST",function Yn(Ii){let Cn;ht(Ii);try{Cn=Ii.getResponseHeader("X-Goog-Upload-URL")}catch{Mi(!1)}return Mi(ct(Cn)),Cn},J.maxUploadRetryTime);return mn.urlParams=Qt,mn.headers=Sr,mn.body=gn,mn.errorHandler=Ki(Y),mn}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),Oe=this._ref.storage._makeRequest(Te,Ze,Y,ve);this._request=Oe,Oe.getPromise().then(ce=>{this._request=void 0,this._uploadUrl=ce,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const Y=this._uploadUrl;this._resolveToken((ve,Te)=>{const Oe=function Zt(J,Y,ve,Te){const qt=new Ot(ve,"POST",function ce(Dr){const Sr=ht(Dr,["active","final"]);let gn=null;try{gn=Dr.getResponseHeader("X-Goog-Upload-Size-Received")}catch{Mi(!1)}gn||Mi(!1);const nn=Number(gn);return Mi(!isNaN(nn)),new Sn(nn,Te.size(),"final"===Sr)},J.maxUploadRetryTime);return qt.headers={"X-Goog-Upload-Command":"query"},qt.errorHandler=Ki(Y),qt}(this._ref.storage,this._ref._location,Y,this._blob),ce=this._ref.storage._makeRequest(Oe,Ze,ve,Te);this._request=ce,ce.getPromise().then(It=>{this._request=void 0,this._updateProgress(It.current),this._needToFetchStatus=!1,It.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const Y=262144*this._chunkMultiplier,ve=new Sn(this._transferred,this._blob.size()),Te=this._uploadUrl;this._resolveToken((Oe,ce)=>{let It;try{It=function Ft(J,Y,ve,Te,Oe,ce,It,Qt){const qt=new Sn(0,0);if(It?(qt.current=It.current,qt.total=It.total):(qt.current=0,qt.total=Te.size()),Te.size()!==qt.total)throw function de(){return new x(L.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.")}();const Dr=qt.total-qt.current;let Sr=Dr;Oe>0&&(Sr=Math.min(Sr,Oe));const gn=qt.current;let Yn="";Yn=0===Sr?"finalize":Dr===Sr?"upload, finalize":"upload";const mn={"X-Goog-Upload-Command":Yn,"X-Goog-Upload-Offset":`${qt.current}`},Ii=Te.slice(gn,gn+Sr);if(null===Ii)throw re();const di=new Ot(ve,"POST",function Cn(Kr,Zi){const No=ht(Kr,["active","final"]),Va=qt.current+Sr,wu=Te.size();let bu;return bu="final"===No?fa(Y,ce)(Kr,Zi):null,new Sn(Va,wu,"final"===No,bu)},Y.maxUploadRetryTime);return di.headers=mn,di.body=Ii.uploadData(),di.progressCallback=Qt||null,di.errorHandler=Ki(J),di}(this._ref._location,this._ref.storage,Te,this._blob,Y,this._mappings,ve,this._makeProgressCallback())}catch(qt){return this._error=qt,void this._transition("error")}const Qt=this._ref.storage._makeRequest(It,Ze,Oe,ce,!1);this._request=Qt,Qt.getPromise().then(qt=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(qt.current),qt.finalized?(this._metadata=qt.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){262144*this._chunkMultiplier*2<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((Y,ve)=>{const Te=Ee(this._ref.storage,this._ref._location,this._mappings),Oe=this._ref.storage._makeRequest(Te,Ze,Y,ve);this._request=Oe,Oe.getPromise().then(ce=>{this._request=void 0,this._metadata=ce,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((Y,ve)=>{const Te=sn(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),Oe=this._ref.storage._makeRequest(Te,Ze,Y,ve);this._request=Oe,Oe.getPromise().then(ce=>{this._request=void 0,this._metadata=ce,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(Y){const ve=this._transferred;this._transferred=Y,this._transferred!==ve&&this._notifyObservers()}_transition(Y){if(this._state!==Y)switch(Y){case"canceling":case"pausing":this._state=Y,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const ve="paused"===this._state;this._state=Y,ve&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=Y,this._notifyObservers();break;case"canceled":this._error=ee(),this._state=Y,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const Y=Oa(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:Y,metadata:this._metadata,task:this,ref:this._ref}}on(Y,ve,Te,Oe){const ce=new St(ve||void 0,Te||void 0,Oe||void 0);return this._addObserver(ce),()=>{this._removeObserver(ce)}}then(Y,ve){return this._promise.then(Y,ve)}catch(Y){return this.then(null,Y)}_addObserver(Y){this._observers.push(Y),this._notifyObserver(Y)}_removeObserver(Y){const ve=this._observers.indexOf(Y);-1!==ve&&this._observers.splice(ve,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(ve=>{this._notifyObserver(ve)})}_finishPromise(){if(void 0!==this._resolve){let Y=!0;switch(Oa(this._state)){case kt.SUCCESS:We(this._resolve.bind(null,this.snapshot))();break;case kt.CANCELED:case kt.ERROR:We(this._reject.bind(null,this._error))();break;default:Y=!1}Y&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(Y){switch(Oa(this._state)){case kt.RUNNING:case kt.PAUSED:Y.next&&We(Y.next.bind(Y,this.snapshot))();break;case kt.SUCCESS:Y.complete&&We(Y.complete.bind(Y))();break;default:Y.error&&We(Y.error.bind(Y,this._error))()}}resume(){const Y="paused"===this._state||"pausing"===this._state;return Y&&this._transition("running"),Y}pause(){const Y="running"===this._state;return Y&&this._transition("pausing"),Y}cancel(){const Y="running"===this._state||"pausing"===this._state;return Y&&this._transition("canceling"),Y}}class Yr{constructor(Y,ve){this._service=Y,this._location=ve instanceof Ie?ve:Ie.makeFromUrl(ve,Y.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(Y,ve){return new Yr(Y,ve)}get root(){const Y=new Ie(this._location.bucket,"");return this._newRef(this._service,Y)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return Na(this._location.path)}get storage(){return this._service}get parent(){const Y=function Kt(J){if(0===J.length)return null;const Y=J.lastIndexOf("/");return-1===Y?"":J.slice(0,Y)}(this._location.path);if(null===Y)return null;const ve=new Ie(this._location.bucket,Y);return new Yr(this._service,ve)}_throwIfRoot(Y){if(""===this._location.path)throw xe(Y)}}function fs(J,Y,ve){J._throwIfRoot("uploadBytes");const Te=sn(J.storage,J._location,Xn(),new ci(Y,!0),ve);return J.storage.makeRequestWithTokens(Te,Ze).then(Oe=>({metadata:Oe,ref:J}))}function gf(J,Y,ve){return gl.apply(this,arguments)}function gl(){return(gl=(0,ae.A)(function*(J,Y,ve){const Oe=yield Ma(J,{pageToken:ve});Y.prefixes.push(...Oe.prefixes),Y.items.push(...Oe.items),null!=Oe.nextPageToken&&(yield gf(J,Y,Oe.nextPageToken))})).apply(this,arguments)}function Ma(J,Y){null!=Y&&"number"==typeof Y.maxResults&&Qe("options.maxResults",1,1e3,Y.maxResults);const ve=Y||{},Te=we(J.storage,J._location,"/",ve.pageToken,ve.maxResults);return J.storage.makeRequestWithTokens(Te,Ze)}function Wc(J){J._throwIfRoot("getDownloadURL");const Y=function vt(J,Y,ve){const Oe=st(Y.fullServerUrl(),J.host,J._protocol),It=J.maxOperationRetryTime,Qt=new Ot(Oe,"GET",function pl(J,Y){return function ve(Te,Oe){const ce=wo(J,Oe,Y);return Mi(null!==ce),function hl(J,Y,ve,Te){const Oe=Ti(Y);if(null===Oe||!ct(Oe.downloadTokens))return null;const ce=Oe.downloadTokens;if(0===ce.length)return null;const It=encodeURIComponent;return ce.split(",").map(Dr=>{const gn=J.fullPath;return st("/b/"+It(J.bucket)+"/o/"+It(gn),ve,Te)+Le({alt:"media",token:Dr})})[0]}(ce,Oe,J.host,J._protocol)}}(J,ve),It);return Qt.errorHandler=Yi(Y),Qt}(J.storage,J._location,Xn());return J.storage.makeRequestWithTokens(Y,Ze).then(ve=>{if(null===ve)throw function pe(){return new x(L.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}();return ve})}function xr(J,Y){const ve=function $o(J,Y){const ve=Y.split("/").filter(Te=>Te.length>0).join("/");return 0===J.length?ve:J+"/"+ve}(J._location.path,Y),Te=new Ie(J._location.bucket,ve);return new Yr(J.storage,Te)}function Nt(J,Y){if(J instanceof mu){const ve=J;if(null==ve._bucket)throw function z(){return new x(L.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+E+"' property when initializing the app?")}();const Te=new Yr(ve,ve._bucket);return null!=Y?Nt(Te,Y):Te}return void 0!==Y?xr(J,Y):J}function Xc(J,Y){if(Y&&function Fm(J){return/^[A-Za-z]+:\/\//.test(J)}(Y)){if(J instanceof mu)return function rn(J,Y){return new Yr(J,Y)}(J,Y);throw fe("To use ref(service, url), the first argument must be a Storage instance.")}return Nt(J,Y)}function vf(J,Y){const ve=Y?.[E];return null==ve?null:Ie.makeFromBucketSpec(ve,J)}class mu{constructor(Y,ve,Te,Oe,ce,It=!1){this.app=Y,this._authProvider=ve,this._appCheckProvider=Te,this._url=Oe,this._firebaseVersion=ce,this._isUsingEmulator=It,this._bucket=null,this._host=R,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=Oe?Ie.makeFromBucketSpec(Oe,this._host):vf(this._host,this.app.options)}get host(){return this._host}set host(Y){this._host=Y,this._bucket=null!=this._url?Ie.makeFromBucketSpec(this._url,Y):vf(Y,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(Y){Qe("time",0,Number.POSITIVE_INFINITY,Y),this._maxUploadRetryTime=Y}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(Y){Qe("time",0,Number.POSITIVE_INFINITY,Y),this._maxOperationRetryTime=Y}_getAuthToken(){var Y=this;return(0,ae.A)(function*(){if(Y._overrideAuthToken)return Y._overrideAuthToken;const ve=Y._authProvider.getImmediate({optional:!0});if(ve){const Te=yield ve.getToken();if(null!==Te)return Te.accessToken}return null})()}_getAppCheckToken(){var Y=this;return(0,ae.A)(function*(){if((0,$.xZ)(Y.app)&&Y.app.settings.appCheckToken)return Y.app.settings.appCheckToken;const ve=Y._appCheckProvider.getImmediate({optional:!0});return ve?(yield ve.getToken()).token:null})()}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(Y=>Y.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(Y){return new Yr(this,Y)}_makeRequest(Y,ve,Te,Oe,ce=!0){if(this._deleted)return new he(Pe());{const It=function pr(J,Y,ve,Te,Oe,ce,It=!0,Qt=!1){const qt=Le(J.urlParams),Dr=J.url+qt,Sr=Object.assign({},J.headers);return function mr(J,Y){Y&&(J["X-Firebase-GMPID"]=Y)}(Sr,Y),function Mt(J,Y){null!==Y&&Y.length>0&&(J.Authorization="Firebase "+Y)}(Sr,ve),function nr(J,Y){J["X-Firebase-Storage-Version"]="webjs/"+(Y??"AppManager")}(Sr,ce),function Ct(J,Y){null!==Y&&(J["X-Firebase-AppCheck"]=Y)}(Sr,Te),new At(Dr,J.method,Sr,J.body,J.successCodes,J.additionalRetryCodes,J.handler,J.errorHandler,J.timeout,J.progressCallback,Oe,It,Qt)}(Y,this._appId,Te,Oe,ve,this._firebaseVersion,ce,this._isUsingEmulator);return this._requests.add(It),It.getPromise().then(()=>this._requests.delete(It),()=>this._requests.delete(It)),It}}makeRequestWithTokens(Y,ve){var Te=this;return(0,ae.A)(function*(){const[Oe,ce]=yield Promise.all([Te._getAuthToken(),Te._getAppCheckToken()]);return Te._makeRequest(Y,ve,Oe,ce).getPromise()})()}}const vu="@firebase/storage",io="storage";function wI(J,Y){return function ko(J,Y){J._throwIfRoot("getBytes");const ve=Re(J.storage,J._location,Y);return J.storage.makeRequestWithTokens(ve,ur).then(Te=>void 0!==Y?Te.slice(0,Y):Te)}(J=(0,D.Ku)(J),Y)}function Fn(J,Y,ve){return fs(J=(0,D.Ku)(J),Y,ve)}function vl(J,Y,ve,Te){return function Hc(J,Y,ve=pn.RAW,Te){J._throwIfRoot("uploadString");const Oe=Oi(ve,Y),ce={...Te};return null==ce.contentType&&null!=Oe.contentType&&(ce.contentType=Oe.contentType),fs(J,Oe.data,ce)}(J=(0,D.Ku)(J),Y,ve,Te)}function _f(J,Y,ve){return function fr(J,Y,ve){return J._throwIfRoot("uploadBytesResumable"),new qn(J,new ci(Y),ve)}(J=(0,D.Ku)(J),Y,ve)}function wf(J){return function _I(J){J._throwIfRoot("getMetadata");const Y=Ee(J.storage,J._location,Xn());return J.storage.makeRequestWithTokens(Y,Ze)}(J=(0,D.Ku)(J))}function Xr(J,Y){return function mf(J,Y){J._throwIfRoot("updateMetadata");const ve=function Me(J,Y,ve,Te){const ce=st(Y.fullServerUrl(),J.host,J._protocol),Qt=Ln(ve,Te),Dr=J.maxOperationRetryTime,Sr=new Ot(ce,"PATCH",fa(J,Te),Dr);return Sr.headers={"Content-Type":"application/json; charset=utf-8"},Sr.body=Qt,Sr.errorHandler=Yi(Y),Sr}(J.storage,J._location,Y,Xn());return J.storage.makeRequestWithTokens(ve,Ze)}(J=(0,D.Ku)(J),Y)}function er(J,Y){return Ma(J=(0,D.Ku)(J),Y)}function ps(J){return function Mm(J){const Y={prefixes:[],items:[]};return gf(J,Y).then(()=>Y)}(J=(0,D.Ku)(J))}function yu(J){return Wc(J=(0,D.Ku)(J))}function Kc(J){return function Do(J){J._throwIfRoot("deleteObject");const Y=function jt(J,Y){const Te=st(Y.fullServerUrl(),J.host,J._protocol),Qt=new Ot(Te,"DELETE",function It(qt,Dr){},J.maxOperationRetryTime);return Qt.successCodes=[200,204],Qt.errorHandler=Yi(Y),Qt}(J.storage,J._location);return J.storage.makeRequestWithTokens(Y,Ze)}(J=(0,D.Ku)(J))}function Fa(J,Y){return Xc(J=(0,D.Ku)(J),Y)}function Vm(J,Y){return xr(J,Y)}function _u(J=(0,$.Sx)(),Y){J=(0,D.Ku)(J);const Te=(0,$.j6)(J,io).getImmediate({identifier:Y}),Oe=(0,D.yU)("storage");return Oe&&bf(Te,...Oe),Te}function bf(J,Y,ve,Te={}){!function yf(J,Y,ve,Te={}){J.host=`${Y}:${ve}`;const Oe=(0,D.zJ)(Y);Oe&&((0,D.gE)(`https://${J.host}/b`),(0,D.P1)("Storage",!0)),J._isUsingEmulator=!0,J._protocol=Oe?"https":"http";const{mockUserToken:ce}=Te;ce&&(J._overrideAuthToken="string"==typeof ce?ce:(0,D.Fy)(ce,J.app.options.projectId))}(J,Y,ve,Te)}function yl(J,Y){return function Ho(J,Y){J._throwIfRoot("getBlob");const ve=Re(J.storage,J._location,Y);return J.storage.makeRequestWithTokens(ve,Or).then(Te=>void 0!==Y?Te.slice(0,Y):Te)}(J=(0,D.Ku)(J),Y)}function Ef(J,Y){throw new Error("getStream() is only supported by NodeJS builds")}function Tf(J,{instanceIdentifier:Y}){const ve=J.getProvider("app").getImmediate(),Te=J.getProvider("auth-internal"),Oe=J.getProvider("app-check-internal");return new mu(ve,Te,Oe,Y,$.MF)}!function Qi(){(0,$.om)(new _.uA(io,Tf,"PUBLIC").setMultipleInstances(!0)),(0,$.KO)(vu,"0.14.0",""),(0,$.KO)(vu,"0.14.0","esm2020")}()}}]);