@undefineds.co/xpod 0.4.19 → 0.4.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/container/common.js +2 -1
- package/dist/api/handlers/AiConfigHandler.js +10 -2
- package/dist/runtime/host/node/NodeRuntimeHost.js +7 -3
- package/dist/runtime/port-finder.d.ts +0 -5
- package/dist/runtime/port-finder.js +24 -12
- package/node_modules/@undefineds.co/extension-sdk/dist/react/solid-auth-boundary.d.ts +20 -2
- package/node_modules/@undefineds.co/extension-sdk/dist/react/solid-auth-boundary.js +142 -125
- package/node_modules/@undefineds.co/shared-ui/dist/focus.d.ts +1 -1
- package/node_modules/@undefineds.co/shared-ui/dist/focus.js +1 -1
- package/node_modules/@undefineds.co/shared-ui/dist/index.d.ts +1 -0
- package/node_modules/@undefineds.co/shared-ui/dist/index.js +1 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.d.ts +2 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginModal.js +2 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginView.d.ts +3 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login/LoginView.js +3 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login.d.ts +15 -0
- package/node_modules/@undefineds.co/shared-ui/dist/login.js +15 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/AccountSections.d.ts +141 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/AccountSections.js +67 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/ConsentView.d.ts +53 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/ConsentView.js +27 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/DeviceDialogs.d.ts +40 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/DeviceDialogs.js +33 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/IdpChrome.d.ts +15 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/IdpChrome.js +8 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/IdpViews.d.ts +93 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/IdpViews.js +88 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/NetworkPanel.d.ts +46 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/NetworkPanel.js +42 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/PodSignIn.d.ts +63 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/PodSignIn.js +65 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/PodSignInFrame.d.ts +31 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/PodSignInFrame.js +111 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/StorageBadge.d.ts +8 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/StorageBadge.js +7 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/XpodMark.d.ts +8 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/XpodMark.js +8 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/account-parts.d.ts +37 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/account-parts.js +33 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/copy.d.ts +156 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/copy.js +304 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/index.d.ts +20 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/index.js +18 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/parts.d.ts +69 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/parts.js +65 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/types.d.ts +14 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/types.js +1 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/webid-name.d.ts +5 -0
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/webid-name.js +14 -0
- package/node_modules/@undefineds.co/shared-ui/dist/storage-bootstrap.d.ts +3 -0
- package/node_modules/@undefineds.co/shared-ui/dist/storage-bootstrap.js +3 -0
- package/node_modules/@undefineds.co/shared-ui/dist/theme.css +168 -83
- package/node_modules/@undefineds.co/shared-ui/dist/webid-auth.d.ts +5 -0
- package/node_modules/@undefineds.co/shared-ui/dist/webid-auth.js +5 -0
- package/package.json +2 -2
- package/static/app/assets/main.css +1 -1
- package/static/app/assets/main.js +55 -15
- package/static/dashboard/assets/{AiConfigContext-B5QP7ow2.js → AiConfigContext-CZEW16so.js} +1 -1
- package/static/dashboard/assets/{AiConfigPage-C_TdlUjq.js → AiConfigPage-Cfp0fRX1.js} +1 -1
- package/static/dashboard/assets/{DocumentProcessingPanel-CormNOdI.js → DocumentProcessingPanel-DaaRCLp6.js} +1 -1
- package/static/dashboard/assets/{IndexLifecyclePanel-S9wNNyHO.js → IndexLifecyclePanel-BCz3jNM8.js} +1 -1
- package/static/dashboard/assets/{IndexSubjectPanel-CofZT1oE.js → IndexSubjectPanel-DVCVIt7V.js} +1 -1
- package/static/dashboard/assets/ModelAssignmentsPanel-DxauxtEY.js +1 -0
- package/static/dashboard/assets/{ModelsPage-DZ46VnUh.js → ModelsPage-B8F3AtZL.js} +3 -3
- package/static/dashboard/assets/{NetworkPage-TwbIWASf.js → NetworkPage-Cu7ty71x.js} +2 -2
- package/static/dashboard/assets/{PaneListHeader-BtVnyutC.js → PaneListHeader-BEAXSlD9.js} +1 -1
- package/static/dashboard/assets/{SearchIndexingPanel-BCq_YMOP.js → SearchIndexingPanel-DEr1EDDC.js} +1 -1
- package/static/dashboard/assets/{StatusSubjectPanel-DsUKTysU.js → StatusSubjectPanel-Cg92MGhO.js} +1 -1
- package/static/dashboard/assets/{StatusWorkspace-CaVJBRqI.js → StatusWorkspace-BmJSOF3z.js} +1 -1
- package/static/dashboard/assets/{SystemSettingsPage-DRWfPjtu.js → SystemSettingsPage-rziu4Q3U.js} +1 -1
- package/static/dashboard/assets/SystemSettingsSubjectPanel-D16DGDNW.js +33 -0
- package/static/dashboard/assets/{XpodAiConnectionsPodStore-C9tHqutw.js → XpodAiConnectionsPodStore-FlZ0LEn0.js} +1 -1
- package/static/dashboard/assets/{activity-tgjewO88.js → activity-D55X-5L5.js} +1 -1
- package/static/dashboard/assets/{badge-Czun47II.js → badge-CRf1ISRJ.js} +1 -1
- package/static/dashboard/assets/{collection-runtime-DnYlU23-.js → collection-runtime-CfXMuwNc.js} +1 -1
- package/static/dashboard/assets/dashboard-B3kGI946.css +1 -0
- package/static/dashboard/assets/{dashboard-CF8SbVSR.js → dashboard-D4DWPaAy.js} +122 -122
- package/static/dashboard/assets/{dialog-D-Yc_lg-.js → dialog-EVyIyybL.js} +1 -1
- package/static/dashboard/assets/{download-vFuOkjCi.js → download-Et4aRDT2.js} +1 -1
- package/static/dashboard/assets/{external-link-Cg_VIecD.js → external-link-DT746o7t.js} +1 -1
- package/static/dashboard/assets/{index-IXCNeEwi.js → index-D2agcVRx.js} +3 -3
- package/static/dashboard/assets/{index-0au0WwkE.js → index-_wC13YGI.js} +1 -1
- package/static/dashboard/assets/{index-YDcVky3o.js → index-z6TnJzW6.js} +1 -1
- package/static/dashboard/assets/{key-round-9n1xgLbG.js → key-round-CHnogQ1D.js} +1 -1
- package/static/dashboard/assets/{rotate-ccw-DJ6s86DW.js → rotate-ccw-BNVDC4Zr.js} +1 -1
- package/static/dashboard/assets/{skeleton-Dg9HePtI.js → skeleton-BzsZekVf.js} +1 -1
- package/static/dashboard/assets/{waypoints-uxc_qOzk.js → waypoints-CLZA22UN.js} +1 -1
- package/static/dashboard/assets/{workspace-layout-BNtAXhPW.js → workspace-layout-urYcwAhS.js} +1 -1
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/{AiConfigContext-y6ha7pGs.js → AiConfigContext-B2cVJFNu.js} +1 -1
- package/static/settings/assets/AiConfigPage-D_5jSPPF.js +1 -0
- package/static/settings/assets/{DocumentProcessingPanel-Oa_cxMcn.js → DocumentProcessingPanel-DodGlYIk.js} +1 -1
- package/static/settings/assets/{IndexLifecyclePanel-DlrnI0Kh.js → IndexLifecyclePanel-BtH-0GKv.js} +1 -1
- package/static/settings/assets/{IndexSubjectPanel-Dhsl0W32.js → IndexSubjectPanel-CqKhUcw2.js} +1 -1
- package/static/settings/assets/ModelAssignmentsPanel-Cam9V9BN.js +1 -0
- package/static/settings/assets/{ModelsPage-CuNW1hGX.js → ModelsPage-DWFic09l.js} +3 -3
- package/static/settings/assets/{NetworkPage-BBD2Lc_P.js → NetworkPage-CSwHoAWm.js} +2 -2
- package/static/settings/assets/{PaneListHeader-C81adSBX.js → PaneListHeader-270Z179Z.js} +1 -1
- package/static/settings/assets/{SearchIndexingPanel-Dc4QKWd0.js → SearchIndexingPanel-ATHKMDBQ.js} +1 -1
- package/static/settings/assets/{StatusSubjectPanel-DuxOvqzS.js → StatusSubjectPanel-DDWo3v3d.js} +1 -1
- package/static/settings/assets/StatusWorkspace-BYgqeCBM.js +1 -0
- package/static/settings/assets/SystemSettingsPage-BRaQAFWC.js +1 -0
- package/static/settings/assets/SystemSettingsSubjectPanel-Dc0roh9d.js +33 -0
- package/static/settings/assets/{XpodAiConnectionsPodStore-G0ClZksP.js → XpodAiConnectionsPodStore-OndzbigX.js} +2 -2
- package/static/settings/assets/{activity-DT8pzOea.js → activity-BAZEToJ3.js} +1 -1
- package/static/settings/assets/auth-callback-Bd3tvCOa.js +1 -0
- package/static/settings/assets/{badge-CvKRjSY2.js → badge-Cpol0LWF.js} +1 -1
- package/static/settings/assets/{collection-runtime-C6ZAp2cM.js → collection-runtime-B5vGx3gk.js} +1 -1
- package/static/settings/assets/{dialog-LFluK7Nx.js → dialog-_7AVvv5q.js} +1 -1
- package/static/settings/assets/{download-CZJeqUm1.js → download-DRAi-dnn.js} +1 -1
- package/static/settings/assets/{external-link-BsDft3Oe.js → external-link--Yq8inDb.js} +1 -1
- package/static/settings/assets/global-B3kGI946.css +1 -0
- package/static/settings/assets/{global-cmKEraT4.js → global-DMtP8ZF4.js} +111 -111
- package/static/settings/assets/{index-BiqSFOS1.js → index-C36H49PZ.js} +1 -1
- package/static/settings/assets/{index-XRgmPBKw.js → index-CQR3iePj.js} +1 -1
- package/static/settings/assets/{index-BMPlaRWG.js → index-DURnCfoQ.js} +1 -1
- package/static/settings/assets/{index-browser-B0slhJKc.js → index-browser-kAl2JmYB.js} +1 -1
- package/static/settings/assets/{key-round-D1XsWbN_.js → key-round-DzpWBVN9.js} +1 -1
- package/static/settings/assets/{rotate-ccw-CEe0P0fY.js → rotate-ccw-CtVsCcAx.js} +1 -1
- package/static/settings/assets/settings-DQtt6lql.js +1 -0
- package/static/settings/assets/{skeleton-DA404w6m.js → skeleton-R_ACks7d.js} +1 -1
- package/static/settings/assets/{waypoints-DJDWc4S9.js → waypoints-D-Qv_sME.js} +1 -1
- package/static/settings/assets/{workspace-layout-K38jT4OV.js → workspace-layout-BSMCQq35.js} +1 -1
- package/static/settings/auth-callback.html +3 -3
- package/static/settings/settings.html +3 -3
- package/static/dashboard/assets/ModelAssignmentsPanel-9tgOjj-y.js +0 -1
- package/static/dashboard/assets/SystemSettingsSubjectPanel-CgDP7Ii2.js +0 -33
- package/static/dashboard/assets/dashboard-DvuM3VTP.css +0 -1
- package/static/settings/assets/AiConfigPage-CIcIWdXA.js +0 -1
- package/static/settings/assets/ModelAssignmentsPanel-CHoiRZeL.js +0 -1
- package/static/settings/assets/StatusWorkspace-DeD3zi3G.js +0 -1
- package/static/settings/assets/SystemSettingsPage-8sHOaPb8.js +0 -1
- package/static/settings/assets/SystemSettingsSubjectPanel-B1JXut7S.js +0 -33
- package/static/settings/assets/auth-callback-1BlsOtMG.js +0 -1
- package/static/settings/assets/global-DvuM3VTP.css +0 -1
- package/static/settings/assets/settings-DfjkqEJ8.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b8 as Ie,b9 as $K,ba as Rs,bb as Oe,bc as Iu,bd as Ve,be as $e,bf as Nt,bg as Uy,bh as x_,aq as Sze}from"./global-cmKEraT4.js";function Aze(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const a in i)if(a!=="default"&&!(a in n)){const r=Object.getOwnPropertyDescriptor(i,a);r&&Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var U3,dee;function CK(){if(dee)return U3;dee=1;var{Buffer:n}=Ie(),e={},t=e.LEFT_BRACE=1,i=e.RIGHT_BRACE=2,a=e.LEFT_BRACKET=3,r=e.RIGHT_BRACKET=4,s=e.COLON=5,o=e.COMMA=6,p=e.TRUE=7,u=e.FALSE=8,f=e.NULL=9,y=e.STRING=10,E=e.NUMBER=11,A=e.START=17,R=e.STOP=18,T=e.TRUE1=33,d=e.TRUE2=34,N=e.TRUE3=35,w=e.FALSE1=49,_=e.FALSE2=50,C=e.FALSE3=51,q=e.FALSE4=52,te=e.NULL1=65,re=e.NULL2=66,V=e.NULL3=67,B=e.NUMBER1=81,v=e.NUMBER3=83,I=e.STRING1=97,x=e.STRING2=98,S=e.STRING3=99,G=e.STRING4=100,H=e.STRING5=101,Y=e.STRING6=102,se=e.VALUE=113,D=e.KEY=114,ne=e.OBJECT=129,h=e.ARRAY=130,F=92,Z=47,j=8,ie=12,oe=10,le=13,ue=9,P=64*1024;function $(ee){return n.alloc?n.alloc(ee):new n(ee)}function X(){this.tState=A,this.value=void 0,this.string=void 0,this.stringBuffer=$(P),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=se,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:$(2),3:$(3),4:$(4)},this.offset=-1}X.toknam=function(ee){for(var b=Object.keys(e),m=0,O=b.length;m<O;m++){var U=b[m];if(e[U]===ee)return U}return ee&&"0x"+ee.toString(16)};var J=X.prototype;return J.onError=function(ee){throw ee},J.charError=function(ee,b){this.tState=R,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(ee[b]))+" at position "+b+" in state "+X.toknam(this.tState)))},J.appendStringChar=function(ee){this.stringBufferOffset>=P&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=ee},J.appendStringBuf=function(ee,b,m){var O=ee.length;typeof b=="number"&&(typeof m=="number"?m<0?O=ee.length-b+m:O=m-b:O=ee.length-b),O<0&&(O=0),this.stringBufferOffset+O>P&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),ee.copy(this.stringBuffer,this.stringBufferOffset,b,m),this.stringBufferOffset+=O},J.write=function(ee){typeof ee=="string"&&(ee=new n(ee));for(var b,m=0,O=ee.length;m<O;m++)if(this.tState===A){if(b=ee[m],this.offset++,b===123)this.onToken(t,"{");else if(b===125)this.onToken(i,"}");else if(b===91)this.onToken(a,"[");else if(b===93)this.onToken(r,"]");else if(b===58)this.onToken(s,":");else if(b===44)this.onToken(o,",");else if(b===116)this.tState=T;else if(b===102)this.tState=w;else if(b===110)this.tState=te;else if(b===34)this.string="",this.stringBufferOffset=0,this.tState=I;else if(b===45)this.string="-",this.tState=B;else if(b>=48&&b<64)this.string=String.fromCharCode(b),this.tState=v;else if(!(b===32||b===9||b===10||b===13))return this.charError(ee,m)}else if(this.tState===I)if(b=ee[m],this.bytes_remaining>0){for(var U=0;U<this.bytes_remaining;U++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+U]=ee[U];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,m=m+U-1}else if(this.bytes_remaining===0&&b>=128){if(b<=193||b>244)return this.onError(new Error("Invalid UTF-8 character at position "+m+" in state "+X.toknam(this.tState)));if(b>=194&&b<=223&&(this.bytes_in_sequence=2),b>=224&&b<=239&&(this.bytes_in_sequence=3),b>=240&&b<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+m>ee.length){for(var k=0;k<=ee.length-1-m;k++)this.temp_buffs[this.bytes_in_sequence][k]=ee[m+k];this.bytes_remaining=m+this.bytes_in_sequence-ee.length,m=ee.length-1}else this.appendStringBuf(ee,m,m+this.bytes_in_sequence),m=m+this.bytes_in_sequence-1}else if(b===34)this.tState=A,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(y,this.string),this.offset+=n.byteLength(this.string,"utf8")+1,this.string=void 0;else if(b===92)this.tState=x;else if(b>=32)this.appendStringChar(b);else return this.charError(ee,m);else if(this.tState===x)if(b=ee[m],b===34)this.appendStringChar(b),this.tState=I;else if(b===92)this.appendStringChar(F),this.tState=I;else if(b===47)this.appendStringChar(Z),this.tState=I;else if(b===98)this.appendStringChar(j),this.tState=I;else if(b===102)this.appendStringChar(ie),this.tState=I;else if(b===110)this.appendStringChar(oe),this.tState=I;else if(b===114)this.appendStringChar(le),this.tState=I;else if(b===116)this.appendStringChar(ue),this.tState=I;else if(b===117)this.unicode="",this.tState=S;else return this.charError(ee,m);else if(this.tState===S||this.tState===G||this.tState===H||this.tState===Y)if(b=ee[m],b>=48&&b<64||b>64&&b<=70||b>96&&b<=102){if(this.unicode+=String.fromCharCode(b),this.tState++===Y){var W=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&W>=56320&&W<57344?(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate,W))),this.highSurrogate=void 0):this.highSurrogate===void 0&&W>=55296&&W<56320?this.highSurrogate=W:(this.highSurrogate!==void 0&&(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new n(String.fromCharCode(W)))),this.tState=I}}else return this.charError(ee,m);else if(this.tState===B||this.tState===v)switch(b=ee[m],b){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(b),this.tState=v;break;default:this.tState=A;var g=this.numberReviver(this.string,ee,m);if(g)return g;this.offset+=this.string.length-1,this.string=void 0,m--;break}else if(this.tState===T)if(ee[m]===114)this.tState=d;else return this.charError(ee,m);else if(this.tState===d)if(ee[m]===117)this.tState=N;else return this.charError(ee,m);else if(this.tState===N)if(ee[m]===101)this.tState=A,this.onToken(p,!0),this.offset+=3;else return this.charError(ee,m);else if(this.tState===w)if(ee[m]===97)this.tState=_;else return this.charError(ee,m);else if(this.tState===_)if(ee[m]===108)this.tState=C;else return this.charError(ee,m);else if(this.tState===C)if(ee[m]===115)this.tState=q;else return this.charError(ee,m);else if(this.tState===q)if(ee[m]===101)this.tState=A,this.onToken(u,!1),this.offset+=4;else return this.charError(ee,m);else if(this.tState===te)if(ee[m]===117)this.tState=re;else return this.charError(ee,m);else if(this.tState===re)if(ee[m]===108)this.tState=V;else return this.charError(ee,m);else if(this.tState===V)if(ee[m]===108)this.tState=A,this.onToken(f,null),this.offset+=3;else return this.charError(ee,m)},J.onToken=function(ee,b){},J.parseError=function(ee,b){this.tState=R,this.onError(new Error("Unexpected "+X.toknam(ee)+(b?"("+JSON.stringify(b)+")":"")+" in state "+X.toknam(this.state)))},J.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},J.pop=function(){var ee=this.value,b=this.stack.pop();this.value=b.value,this.key=b.key,this.mode=b.mode,this.emit(ee),this.mode||(this.state=se)},J.emit=function(ee){this.mode&&(this.state=o),this.onValue(ee)},J.onValue=function(ee){},J.onToken=function(ee,b){if(this.state===se)if(ee===y||ee===E||ee===p||ee===u||ee===f)this.value&&(this.value[this.key]=b),this.emit(b);else if(ee===t)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=D,this.mode=ne;else if(ee===a)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=h,this.state=se;else if(ee===i)if(this.mode===ne)this.pop();else return this.parseError(ee,b);else if(ee===r)if(this.mode===h)this.pop();else return this.parseError(ee,b);else return this.parseError(ee,b);else if(this.state===D)if(ee===y)this.key=b,this.state=s;else if(ee===i)this.pop();else return this.parseError(ee,b);else if(this.state===s)if(ee===s)this.state=se;else return this.parseError(ee,b);else if(this.state===o)if(ee===o)this.mode===h?(this.key++,this.state=se):this.mode===ne&&(this.state=D);else if(ee===r&&this.mode===h||ee===i&&this.mode===ne)this.pop();else return this.parseError(ee,b);else return this.parseError(ee,b)},J.numberReviver=function(ee,b,m){var O=Number(ee);if(isNaN(O))return this.charError(b,m);ee.match(/[0-9]+/)==ee&&O.toString()!=ee?this.onToken(y,ee):this.onToken(E,O)},X.C=e,U3=X,U3}var gl={},Bg={},wl={},Do={},hee;function Eze(){if(hee)return Do;hee=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.removeDotSegmentsOfPath=Do.removeDotSegments=Do.resolve=void 0;function n(a,r){r=r||"";const s=r.indexOf("#");if(s>0&&(r=r.substr(0,s)),!a.length){if(r.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${r}' for value '${a}'`);return r}if(a.startsWith("?")){const A=r.indexOf("?");return A>0&&(r=r.substr(0,A)),r+a}if(a.startsWith("#"))return r+a;if(!r.length){const A=a.indexOf(":");if(A<0)throw new Error(`Found invalid relative IRI '${a}' for a missing baseIRI`);return t(a,A)}const o=a.indexOf(":");if(o>=0){const A=a.indexOf("/");if(A<0||o<A)return t(a,o)}const p=r.indexOf(":");if(p<0)throw new Error(`Found invalid baseIRI '${r}' for value '${a}'`);const u=r.substr(0,p+1);if(a.indexOf("//")===0)return u+t(a,o);let f;if(r.indexOf("//",p)===p+1){if(f=r.indexOf("/",p+3),f<0)return r.length>p+3?r+"/"+t(a,o):u+t(a,o)}else if(f=r.indexOf("/",p+1),f<0)return u+t(a,o);if(a.indexOf("/")===0)return r.substr(0,f)+e(a);let y=r.substr(f);const E=y.lastIndexOf("/");return E>=0&&E<y.length-1&&(y=y.substr(0,E+1),a[0]==="."&&a[1]!=="."&&a[1]!=="/"&&a[2]&&(a=a.substr(1))),a=y+a,a=e(a),r.substr(0,f)+a}Do.resolve=n;function e(a){const r=[];let s=0;for(;s<a.length;)switch(a[s]){case"/":if(a[s+1]===".")if(a[s+2]==="."){if(!i(a[s+3])){r.push([]),s++;break}r.pop(),a[s+3]||r.push([]),s+=3}else{if(!i(a[s+2])){r.push([]),s++;break}a[s+2]||r.push([]),s+=2}else r.push([]),s++;break;case"#":case"?":r.length||r.push([]),r[r.length-1].push(a.substr(s)),s=a.length;break;default:r.length||r.push([]),r[r.length-1].push(a[s]),s++;break}return"/"+r.map(o=>o.join("")).join("/")}Do.removeDotSegments=e;function t(a,r){let s=r+1;r>=0?a[r+1]==="/"&&a[r+2]==="/"&&(s=r+3):a[0]==="/"&&a[1]==="/"&&(s=2);const o=a.indexOf("/",s);if(o<0)return a;const p=a.substr(0,o),u=a.substr(o);return p+e(u)}Do.removeDotSegmentsOfPath=t;function i(a){return!a||a==="#"||a==="?"||a==="/"}return Do}var pee;function ia(){return pee||(pee=1,(function(n){var e=wl&&wl.__createBinding||(Object.create?(function(i,a,r,s){s===void 0&&(s=r);var o=Object.getOwnPropertyDescriptor(a,r);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(i,s,o)}):(function(i,a,r,s){s===void 0&&(s=r),i[s]=a[r]})),t=wl&&wl.__exportStar||function(i,a){for(var r in i)r!=="default"&&!Object.prototype.hasOwnProperty.call(a,r)&&e(a,i,r)};Object.defineProperty(n,"__esModule",{value:!0}),t(Eze(),n)})(wl)),wl}var G3={},bee;function KP(){return bee||(bee=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ERROR_CODES=n.ErrorCoded=void 0;class e extends Error{constructor(i,a){super(i),this.code=a}}n.ErrorCoded=e,(function(t){t.COLLIDING_KEYWORDS="colliding keywords",t.CONFLICTING_INDEXES="conflicting indexes",t.CYCLIC_IRI_MAPPING="cyclic IRI mapping",t.INVALID_ID_VALUE="invalid @id value",t.INVALID_INDEX_VALUE="invalid @index value",t.INVALID_NEST_VALUE="invalid @nest value",t.INVALID_PREFIX_VALUE="invalid @prefix value",t.INVALID_PROPAGATE_VALUE="invalid @propagate value",t.INVALID_REVERSE_VALUE="invalid @reverse value",t.INVALID_IMPORT_VALUE="invalid @import value",t.INVALID_VERSION_VALUE="invalid @version value",t.INVALID_BASE_IRI="invalid base IRI",t.INVALID_CONTAINER_MAPPING="invalid container mapping",t.INVALID_CONTEXT_ENTRY="invalid context entry",t.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",t.INVALID_DEFAULT_LANGUAGE="invalid default language",t.INVALID_INCLUDED_VALUE="invalid @included value",t.INVALID_IRI_MAPPING="invalid IRI mapping",t.INVALID_JSON_LITERAL="invalid JSON literal",t.INVALID_KEYWORD_ALIAS="invalid keyword alias",t.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",t.INVALID_LANGUAGE_MAPPING="invalid language mapping",t.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",t.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",t.INVALID_LOCAL_CONTEXT="invalid local context",t.INVALID_REMOTE_CONTEXT="invalid remote context",t.INVALID_REVERSE_PROPERTY="invalid reverse property",t.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",t.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",t.INVALID_SCOPED_CONTEXT="invalid scoped context",t.INVALID_SCRIPT_ELEMENT="invalid script element",t.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",t.INVALID_TERM_DEFINITION="invalid term definition",t.INVALID_TYPE_MAPPING="invalid type mapping",t.INVALID_TYPE_VALUE="invalid type value",t.INVALID_TYPED_VALUE="invalid typed value",t.INVALID_VALUE_OBJECT="invalid value object",t.INVALID_VALUE_OBJECT_VALUE="invalid value object value",t.INVALID_VOCAB_MAPPING="invalid vocab mapping",t.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",t.KEYWORD_REDEFINITION="keyword redefinition",t.LOADING_DOCUMENT_FAILED="loading document failed",t.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",t.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",t.PROCESSING_MODE_CONFLICT="processing mode conflict",t.PROTECTED_TERM_REDEFINITION="protected term redefinition",t.CONTEXT_OVERFLOW="context overflow",t.INVALID_BASE_DIRECTION="invalid base direction",t.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",t.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",t.INVALID_EMBEDDED_NODE="invalid embedded node",t.INVALID_ANNOTATION="invalid annotation"})(n.ERROR_CODES||(n.ERROR_CODES={}))})(G3)),G3}var kg={},_ee;function LBe(){if(_ee)return kg;_ee=1,Object.defineProperty(kg,"__esModule",{value:!0}),kg.FetchDocumentLoader=void 0;const n=KP(),e=$K(),t=ia();class i{constructor(r){this.fetcher=r}async load(r){const s=await(this.fetcher||fetch)(r,{headers:new Headers({accept:"application/ld+json"})});if(s.ok&&s.headers){let o=s.headers.get("Content-Type");if(o){const p=o.indexOf(";");p>0&&(o=o.substr(0,p))}if(o==="application/ld+json")return await s.json();if(s.headers.has("Link")){let p;if(s.headers.forEach((u,f)=>{if(f==="link"){const y=(0,e.parse)(u);for(const E of y.get("type","application/ld+json"))if(E.rel==="alternate"){if(p)throw new Error("Multiple JSON-LD alternate links were found on "+r);p=(0,t.resolve)(E.uri,r)}}}),p)return this.load(p)}throw new n.ErrorCoded(`Unsupported JSON-LD media type ${o}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}else throw new Error(s.statusText||`Status code: ${s.status}`)}}return kg.FetchDocumentLoader=i,kg}var Q3={},Wg={},yee;function qK(){if(yee)return Wg;yee=1,Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.Util=void 0;class n{static isCompactIri(t){return t.indexOf(":")>0&&!(t&&t[0]==="#")}static getPrefix(t,i){if(t&&t[0]==="#")return null;const a=t.indexOf(":");if(a>=0){if(t.length>a+1&&t.charAt(a+1)==="/"&&t.charAt(a+2)==="/")return null;const r=t.substr(0,a);if(r==="_")return null;if(i[r])return r}return null}static getContextValueId(t){if(t===null||typeof t=="string")return t;const i=t["@id"];return i||null}static isSimpleTermDefinitionPrefix(t,i){return!n.isPotentialKeyword(t)&&(i.allowPrefixNonGenDelims||typeof t=="string"&&(t[0]==="_"||n.isPrefixIriEndingWithGenDelim(t)))}static isPotentialKeyword(t){return typeof t=="string"&&n.KEYWORD_REGEX.test(t)}static isPrefixIriEndingWithGenDelim(t){return n.ENDS_WITH_GEN_DELIM.test(t)}static isPrefixValue(t){return t&&(typeof t=="string"||t&&typeof t=="object")}static isValidIri(t){return!!(t&&n.IRI_REGEX.test(t))}static isValidIriWeak(t){return!!t&&t[0]!==":"&&n.IRI_REGEX_WEAK.test(t)}static isValidKeyword(t){return n.VALID_KEYWORDS[t]}static isTermProtected(t,i){const a=t[i];return typeof a!="string"&&a&&a["@protected"]}static hasProtectedTerms(t){for(const i of Object.keys(t))if(n.isTermProtected(t,i))return!0;return!1}static isReservedInternalKeyword(t){return t.startsWith("@__")}static deepEqual(t,i){const a=Object.keys(t),r=Object.keys(i);return a.length!==r.length?!1:a.every(s=>{const o=t[s],p=i[s];return o===p||o!==null&&p!==null&&typeof o=="object"&&typeof p=="object"&&this.deepEqual(o,p)})}}return n.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/,n.IRI_REGEX_WEAK=/(?::[^:])|\//,n.KEYWORD_REGEX=/^@[a-z]+$/i,n.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/,n.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/,n.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/,n.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0},n.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"],n.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"],n.ALIAS_RANGE_BLACKLIST=["@context","@preserve"],n.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"],n.CONTAINERS_1_0=["@list","@set","@index"],Wg.Util=n,Wg}var gee;function FBe(){return gee||(gee=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.defaultExpandOptions=n.JsonLdContextNormalized=void 0;const e=ia(),t=KP(),i=qK();class a{constructor(s){this.contextRaw=s}getContextRaw(){return this.contextRaw}expandTerm(s,o,p=n.defaultExpandOptions){const u=this.contextRaw[s];if(u===null||u&&u["@id"]===null)return null;let f=!0;if(u&&o){const d=i.Util.getContextValueId(u);if(d&&d!==s)if(typeof d!="string"||!i.Util.isValidIri(d)&&!i.Util.isValidKeyword(d))i.Util.isPotentialKeyword(d)||(f=!1);else return d}const y=i.Util.getPrefix(s,this.contextRaw),E=this.contextRaw["@vocab"],A=(!!E||E==="")&&E.indexOf(":")<0,R=this.contextRaw["@base"],T=i.Util.isPotentialKeyword(s);if(y){const d=this.contextRaw[y],N=i.Util.getContextValueId(d);if(N){if(typeof d=="string"||!p.allowPrefixForcing){if(!i.Util.isSimpleTermDefinitionPrefix(N,p))return s}else if(N[0]!=="_"&&!T&&!d["@prefix"]&&!(s in this.contextRaw))return s;return N+s.substr(y.length+1)}}else if(o&&(E||E===""||p.allowVocabRelativeToBase&&R&&A)&&!T&&!i.Util.isCompactIri(s))if(A){if(p.allowVocabRelativeToBase)return(E||R?(0,e.resolve)(E,R):"")+s;throw new t.ErrorCoded(`Relative vocab expansion for term '${s}' with vocab '${E}' is not allowed.`,t.ERROR_CODES.INVALID_VOCAB_MAPPING)}else return E+s;else if(!o&&R&&!T&&!i.Util.isCompactIri(s))return(0,e.resolve)(s,R);if(f)return s;throw new t.ErrorCoded(`Invalid IRI mapping found for context entry '${s}': '${JSON.stringify(u)}'`,t.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(s,o){if(o&&this.contextRaw["@vocab"]&&s.startsWith(this.contextRaw["@vocab"]))return s.substr(this.contextRaw["@vocab"].length);if(!o&&this.contextRaw["@base"]&&s.startsWith(this.contextRaw["@base"]))return s.substr(this.contextRaw["@base"].length);const p={prefix:"",suffix:s};for(const u in this.contextRaw){const f=this.contextRaw[u];if(f&&!i.Util.isPotentialKeyword(u)){const y=i.Util.getContextValueId(f);if(s.startsWith(y)){const E=s.substr(y.length);if(E)E.length<p.suffix.length&&(p.prefix=u,p.suffix=E);else if(o)return u}}}return p.prefix?p.prefix+":"+p.suffix:s}}n.JsonLdContextNormalized=a,n.defaultExpandOptions={allowPrefixForcing:!0,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!0}})(Q3)),Q3}var wee;function Tze(){if(wee)return Bg;wee=1,Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.ContextParser=void 0;const n=ia(),e=KP(),t=LBe(),i=FBe(),a=qK();class r{constructor(o){o=o||{},this.documentLoader=o.documentLoader||new t.FetchDocumentLoader,this.documentCache={},this.validateContext=!o.skipValidation,this.expandContentTypeToBase=!!o.expandContentTypeToBase,this.remoteContextsDepthLimit=o.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps="redirectSchemaOrgHttps"in o?!!o.redirectSchemaOrgHttps:!0}static validateLanguage(o,p,u){if(typeof o!="string")throw new e.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(o)}'`,u);if(!a.Util.REGEX_LANGUAGE_TAG.test(o)){if(p)throw new e.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(o)}'`,u);return!1}return!0}static validateDirection(o,p){if(typeof o!="string")throw new e.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(o)}'`,e.ERROR_CODES.INVALID_BASE_DIRECTION);if(!a.Util.REGEX_DIRECTION_TAG.test(o)){if(p)throw new e.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(o)}'`,e.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(o){for(const p of Object.keys(o)){let u=o[p];if(u&&typeof u=="object"&&u["@reverse"]&&!u["@id"]){if(typeof u["@reverse"]!="string"||a.Util.isValidKeyword(u["@reverse"]))throw new e.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${u["@reverse"]}'`,e.ERROR_CODES.INVALID_IRI_MAPPING);u=o[p]=Object.assign(Object.assign({},u),{"@id":u["@reverse"]}),u["@id"]=u["@reverse"],a.Util.isPotentialKeyword(u["@reverse"])?delete u["@reverse"]:u["@reverse"]=!0}}return o}expandPrefixedTerms(o,p,u){const f=o.getContextRaw();for(const y of u||Object.keys(f))if(a.Util.EXPAND_KEYS_BLACKLIST.indexOf(y)<0&&!a.Util.isReservedInternalKeyword(y)){const E=f[y];if(a.Util.isPotentialKeyword(y)&&a.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(y)>=0&&(y!=="@type"||typeof f[y]=="object"&&!(f[y]["@protected"]||f[y]["@container"]==="@set")))throw new e.ErrorCoded(`Keywords can not be aliased to something else.
|
|
1
|
+
import{b8 as Ie,b9 as $K,ba as Rs,bb as Oe,bc as Iu,bd as Ve,be as $e,bf as Nt,bg as Uy,bh as x_,ar as Sze}from"./global-DMtP8ZF4.js";function Aze(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const a in i)if(a!=="default"&&!(a in n)){const r=Object.getOwnPropertyDescriptor(i,a);r&&Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:()=>i[a]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var U3,dee;function CK(){if(dee)return U3;dee=1;var{Buffer:n}=Ie(),e={},t=e.LEFT_BRACE=1,i=e.RIGHT_BRACE=2,a=e.LEFT_BRACKET=3,r=e.RIGHT_BRACKET=4,s=e.COLON=5,o=e.COMMA=6,p=e.TRUE=7,u=e.FALSE=8,f=e.NULL=9,y=e.STRING=10,E=e.NUMBER=11,A=e.START=17,R=e.STOP=18,T=e.TRUE1=33,d=e.TRUE2=34,N=e.TRUE3=35,w=e.FALSE1=49,_=e.FALSE2=50,C=e.FALSE3=51,q=e.FALSE4=52,te=e.NULL1=65,re=e.NULL2=66,V=e.NULL3=67,B=e.NUMBER1=81,v=e.NUMBER3=83,I=e.STRING1=97,x=e.STRING2=98,S=e.STRING3=99,G=e.STRING4=100,H=e.STRING5=101,Y=e.STRING6=102,se=e.VALUE=113,D=e.KEY=114,ne=e.OBJECT=129,h=e.ARRAY=130,F=92,Z=47,j=8,ie=12,oe=10,le=13,ue=9,P=64*1024;function $(ee){return n.alloc?n.alloc(ee):new n(ee)}function X(){this.tState=A,this.value=void 0,this.string=void 0,this.stringBuffer=$(P),this.stringBufferOffset=0,this.unicode=void 0,this.highSurrogate=void 0,this.key=void 0,this.mode=void 0,this.stack=[],this.state=se,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:$(2),3:$(3),4:$(4)},this.offset=-1}X.toknam=function(ee){for(var b=Object.keys(e),m=0,O=b.length;m<O;m++){var U=b[m];if(e[U]===ee)return U}return ee&&"0x"+ee.toString(16)};var J=X.prototype;return J.onError=function(ee){throw ee},J.charError=function(ee,b){this.tState=R,this.onError(new Error("Unexpected "+JSON.stringify(String.fromCharCode(ee[b]))+" at position "+b+" in state "+X.toknam(this.tState)))},J.appendStringChar=function(ee){this.stringBufferOffset>=P&&(this.string+=this.stringBuffer.toString("utf8"),this.stringBufferOffset=0),this.stringBuffer[this.stringBufferOffset++]=ee},J.appendStringBuf=function(ee,b,m){var O=ee.length;typeof b=="number"&&(typeof m=="number"?m<0?O=ee.length-b+m:O=m-b:O=ee.length-b),O<0&&(O=0),this.stringBufferOffset+O>P&&(this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0),ee.copy(this.stringBuffer,this.stringBufferOffset,b,m),this.stringBufferOffset+=O},J.write=function(ee){typeof ee=="string"&&(ee=new n(ee));for(var b,m=0,O=ee.length;m<O;m++)if(this.tState===A){if(b=ee[m],this.offset++,b===123)this.onToken(t,"{");else if(b===125)this.onToken(i,"}");else if(b===91)this.onToken(a,"[");else if(b===93)this.onToken(r,"]");else if(b===58)this.onToken(s,":");else if(b===44)this.onToken(o,",");else if(b===116)this.tState=T;else if(b===102)this.tState=w;else if(b===110)this.tState=te;else if(b===34)this.string="",this.stringBufferOffset=0,this.tState=I;else if(b===45)this.string="-",this.tState=B;else if(b>=48&&b<64)this.string=String.fromCharCode(b),this.tState=v;else if(!(b===32||b===9||b===10||b===13))return this.charError(ee,m)}else if(this.tState===I)if(b=ee[m],this.bytes_remaining>0){for(var U=0;U<this.bytes_remaining;U++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+U]=ee[U];this.appendStringBuf(this.temp_buffs[this.bytes_in_sequence]),this.bytes_in_sequence=this.bytes_remaining=0,m=m+U-1}else if(this.bytes_remaining===0&&b>=128){if(b<=193||b>244)return this.onError(new Error("Invalid UTF-8 character at position "+m+" in state "+X.toknam(this.tState)));if(b>=194&&b<=223&&(this.bytes_in_sequence=2),b>=224&&b<=239&&(this.bytes_in_sequence=3),b>=240&&b<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+m>ee.length){for(var k=0;k<=ee.length-1-m;k++)this.temp_buffs[this.bytes_in_sequence][k]=ee[m+k];this.bytes_remaining=m+this.bytes_in_sequence-ee.length,m=ee.length-1}else this.appendStringBuf(ee,m,m+this.bytes_in_sequence),m=m+this.bytes_in_sequence-1}else if(b===34)this.tState=A,this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset),this.stringBufferOffset=0,this.onToken(y,this.string),this.offset+=n.byteLength(this.string,"utf8")+1,this.string=void 0;else if(b===92)this.tState=x;else if(b>=32)this.appendStringChar(b);else return this.charError(ee,m);else if(this.tState===x)if(b=ee[m],b===34)this.appendStringChar(b),this.tState=I;else if(b===92)this.appendStringChar(F),this.tState=I;else if(b===47)this.appendStringChar(Z),this.tState=I;else if(b===98)this.appendStringChar(j),this.tState=I;else if(b===102)this.appendStringChar(ie),this.tState=I;else if(b===110)this.appendStringChar(oe),this.tState=I;else if(b===114)this.appendStringChar(le),this.tState=I;else if(b===116)this.appendStringChar(ue),this.tState=I;else if(b===117)this.unicode="",this.tState=S;else return this.charError(ee,m);else if(this.tState===S||this.tState===G||this.tState===H||this.tState===Y)if(b=ee[m],b>=48&&b<64||b>64&&b<=70||b>96&&b<=102){if(this.unicode+=String.fromCharCode(b),this.tState++===Y){var W=parseInt(this.unicode,16);this.unicode=void 0,this.highSurrogate!==void 0&&W>=56320&&W<57344?(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate,W))),this.highSurrogate=void 0):this.highSurrogate===void 0&&W>=55296&&W<56320?this.highSurrogate=W:(this.highSurrogate!==void 0&&(this.appendStringBuf(new n(String.fromCharCode(this.highSurrogate))),this.highSurrogate=void 0),this.appendStringBuf(new n(String.fromCharCode(W)))),this.tState=I}}else return this.charError(ee,m);else if(this.tState===B||this.tState===v)switch(b=ee[m],b){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(b),this.tState=v;break;default:this.tState=A;var g=this.numberReviver(this.string,ee,m);if(g)return g;this.offset+=this.string.length-1,this.string=void 0,m--;break}else if(this.tState===T)if(ee[m]===114)this.tState=d;else return this.charError(ee,m);else if(this.tState===d)if(ee[m]===117)this.tState=N;else return this.charError(ee,m);else if(this.tState===N)if(ee[m]===101)this.tState=A,this.onToken(p,!0),this.offset+=3;else return this.charError(ee,m);else if(this.tState===w)if(ee[m]===97)this.tState=_;else return this.charError(ee,m);else if(this.tState===_)if(ee[m]===108)this.tState=C;else return this.charError(ee,m);else if(this.tState===C)if(ee[m]===115)this.tState=q;else return this.charError(ee,m);else if(this.tState===q)if(ee[m]===101)this.tState=A,this.onToken(u,!1),this.offset+=4;else return this.charError(ee,m);else if(this.tState===te)if(ee[m]===117)this.tState=re;else return this.charError(ee,m);else if(this.tState===re)if(ee[m]===108)this.tState=V;else return this.charError(ee,m);else if(this.tState===V)if(ee[m]===108)this.tState=A,this.onToken(f,null),this.offset+=3;else return this.charError(ee,m)},J.onToken=function(ee,b){},J.parseError=function(ee,b){this.tState=R,this.onError(new Error("Unexpected "+X.toknam(ee)+(b?"("+JSON.stringify(b)+")":"")+" in state "+X.toknam(this.state)))},J.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},J.pop=function(){var ee=this.value,b=this.stack.pop();this.value=b.value,this.key=b.key,this.mode=b.mode,this.emit(ee),this.mode||(this.state=se)},J.emit=function(ee){this.mode&&(this.state=o),this.onValue(ee)},J.onValue=function(ee){},J.onToken=function(ee,b){if(this.state===se)if(ee===y||ee===E||ee===p||ee===u||ee===f)this.value&&(this.value[this.key]=b),this.emit(b);else if(ee===t)this.push(),this.value?this.value=this.value[this.key]={}:this.value={},this.key=void 0,this.state=D,this.mode=ne;else if(ee===a)this.push(),this.value?this.value=this.value[this.key]=[]:this.value=[],this.key=0,this.mode=h,this.state=se;else if(ee===i)if(this.mode===ne)this.pop();else return this.parseError(ee,b);else if(ee===r)if(this.mode===h)this.pop();else return this.parseError(ee,b);else return this.parseError(ee,b);else if(this.state===D)if(ee===y)this.key=b,this.state=s;else if(ee===i)this.pop();else return this.parseError(ee,b);else if(this.state===s)if(ee===s)this.state=se;else return this.parseError(ee,b);else if(this.state===o)if(ee===o)this.mode===h?(this.key++,this.state=se):this.mode===ne&&(this.state=D);else if(ee===r&&this.mode===h||ee===i&&this.mode===ne)this.pop();else return this.parseError(ee,b);else return this.parseError(ee,b)},J.numberReviver=function(ee,b,m){var O=Number(ee);if(isNaN(O))return this.charError(b,m);ee.match(/[0-9]+/)==ee&&O.toString()!=ee?this.onToken(y,ee):this.onToken(E,O)},X.C=e,U3=X,U3}var gl={},Bg={},wl={},Do={},hee;function Eze(){if(hee)return Do;hee=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.removeDotSegmentsOfPath=Do.removeDotSegments=Do.resolve=void 0;function n(a,r){r=r||"";const s=r.indexOf("#");if(s>0&&(r=r.substr(0,s)),!a.length){if(r.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${r}' for value '${a}'`);return r}if(a.startsWith("?")){const A=r.indexOf("?");return A>0&&(r=r.substr(0,A)),r+a}if(a.startsWith("#"))return r+a;if(!r.length){const A=a.indexOf(":");if(A<0)throw new Error(`Found invalid relative IRI '${a}' for a missing baseIRI`);return t(a,A)}const o=a.indexOf(":");if(o>=0){const A=a.indexOf("/");if(A<0||o<A)return t(a,o)}const p=r.indexOf(":");if(p<0)throw new Error(`Found invalid baseIRI '${r}' for value '${a}'`);const u=r.substr(0,p+1);if(a.indexOf("//")===0)return u+t(a,o);let f;if(r.indexOf("//",p)===p+1){if(f=r.indexOf("/",p+3),f<0)return r.length>p+3?r+"/"+t(a,o):u+t(a,o)}else if(f=r.indexOf("/",p+1),f<0)return u+t(a,o);if(a.indexOf("/")===0)return r.substr(0,f)+e(a);let y=r.substr(f);const E=y.lastIndexOf("/");return E>=0&&E<y.length-1&&(y=y.substr(0,E+1),a[0]==="."&&a[1]!=="."&&a[1]!=="/"&&a[2]&&(a=a.substr(1))),a=y+a,a=e(a),r.substr(0,f)+a}Do.resolve=n;function e(a){const r=[];let s=0;for(;s<a.length;)switch(a[s]){case"/":if(a[s+1]===".")if(a[s+2]==="."){if(!i(a[s+3])){r.push([]),s++;break}r.pop(),a[s+3]||r.push([]),s+=3}else{if(!i(a[s+2])){r.push([]),s++;break}a[s+2]||r.push([]),s+=2}else r.push([]),s++;break;case"#":case"?":r.length||r.push([]),r[r.length-1].push(a.substr(s)),s=a.length;break;default:r.length||r.push([]),r[r.length-1].push(a[s]),s++;break}return"/"+r.map(o=>o.join("")).join("/")}Do.removeDotSegments=e;function t(a,r){let s=r+1;r>=0?a[r+1]==="/"&&a[r+2]==="/"&&(s=r+3):a[0]==="/"&&a[1]==="/"&&(s=2);const o=a.indexOf("/",s);if(o<0)return a;const p=a.substr(0,o),u=a.substr(o);return p+e(u)}Do.removeDotSegmentsOfPath=t;function i(a){return!a||a==="#"||a==="?"||a==="/"}return Do}var pee;function ia(){return pee||(pee=1,(function(n){var e=wl&&wl.__createBinding||(Object.create?(function(i,a,r,s){s===void 0&&(s=r);var o=Object.getOwnPropertyDescriptor(a,r);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(i,s,o)}):(function(i,a,r,s){s===void 0&&(s=r),i[s]=a[r]})),t=wl&&wl.__exportStar||function(i,a){for(var r in i)r!=="default"&&!Object.prototype.hasOwnProperty.call(a,r)&&e(a,i,r)};Object.defineProperty(n,"__esModule",{value:!0}),t(Eze(),n)})(wl)),wl}var G3={},bee;function KP(){return bee||(bee=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ERROR_CODES=n.ErrorCoded=void 0;class e extends Error{constructor(i,a){super(i),this.code=a}}n.ErrorCoded=e,(function(t){t.COLLIDING_KEYWORDS="colliding keywords",t.CONFLICTING_INDEXES="conflicting indexes",t.CYCLIC_IRI_MAPPING="cyclic IRI mapping",t.INVALID_ID_VALUE="invalid @id value",t.INVALID_INDEX_VALUE="invalid @index value",t.INVALID_NEST_VALUE="invalid @nest value",t.INVALID_PREFIX_VALUE="invalid @prefix value",t.INVALID_PROPAGATE_VALUE="invalid @propagate value",t.INVALID_REVERSE_VALUE="invalid @reverse value",t.INVALID_IMPORT_VALUE="invalid @import value",t.INVALID_VERSION_VALUE="invalid @version value",t.INVALID_BASE_IRI="invalid base IRI",t.INVALID_CONTAINER_MAPPING="invalid container mapping",t.INVALID_CONTEXT_ENTRY="invalid context entry",t.INVALID_CONTEXT_NULLIFICATION="invalid context nullification",t.INVALID_DEFAULT_LANGUAGE="invalid default language",t.INVALID_INCLUDED_VALUE="invalid @included value",t.INVALID_IRI_MAPPING="invalid IRI mapping",t.INVALID_JSON_LITERAL="invalid JSON literal",t.INVALID_KEYWORD_ALIAS="invalid keyword alias",t.INVALID_LANGUAGE_MAP_VALUE="invalid language map value",t.INVALID_LANGUAGE_MAPPING="invalid language mapping",t.INVALID_LANGUAGE_TAGGED_STRING="invalid language-tagged string",t.INVALID_LANGUAGE_TAGGED_VALUE="invalid language-tagged value",t.INVALID_LOCAL_CONTEXT="invalid local context",t.INVALID_REMOTE_CONTEXT="invalid remote context",t.INVALID_REVERSE_PROPERTY="invalid reverse property",t.INVALID_REVERSE_PROPERTY_MAP="invalid reverse property map",t.INVALID_REVERSE_PROPERTY_VALUE="invalid reverse property value",t.INVALID_SCOPED_CONTEXT="invalid scoped context",t.INVALID_SCRIPT_ELEMENT="invalid script element",t.INVALID_SET_OR_LIST_OBJECT="invalid set or list object",t.INVALID_TERM_DEFINITION="invalid term definition",t.INVALID_TYPE_MAPPING="invalid type mapping",t.INVALID_TYPE_VALUE="invalid type value",t.INVALID_TYPED_VALUE="invalid typed value",t.INVALID_VALUE_OBJECT="invalid value object",t.INVALID_VALUE_OBJECT_VALUE="invalid value object value",t.INVALID_VOCAB_MAPPING="invalid vocab mapping",t.IRI_CONFUSED_WITH_PREFIX="IRI confused with prefix",t.KEYWORD_REDEFINITION="keyword redefinition",t.LOADING_DOCUMENT_FAILED="loading document failed",t.LOADING_REMOTE_CONTEXT_FAILED="loading remote context failed",t.MULTIPLE_CONTEXT_LINK_HEADERS="multiple context link headers",t.PROCESSING_MODE_CONFLICT="processing mode conflict",t.PROTECTED_TERM_REDEFINITION="protected term redefinition",t.CONTEXT_OVERFLOW="context overflow",t.INVALID_BASE_DIRECTION="invalid base direction",t.RECURSIVE_CONTEXT_INCLUSION="recursive context inclusion",t.INVALID_STREAMING_KEY_ORDER="invalid streaming key order",t.INVALID_EMBEDDED_NODE="invalid embedded node",t.INVALID_ANNOTATION="invalid annotation"})(n.ERROR_CODES||(n.ERROR_CODES={}))})(G3)),G3}var kg={},_ee;function LBe(){if(_ee)return kg;_ee=1,Object.defineProperty(kg,"__esModule",{value:!0}),kg.FetchDocumentLoader=void 0;const n=KP(),e=$K(),t=ia();class i{constructor(r){this.fetcher=r}async load(r){const s=await(this.fetcher||fetch)(r,{headers:new Headers({accept:"application/ld+json"})});if(s.ok&&s.headers){let o=s.headers.get("Content-Type");if(o){const p=o.indexOf(";");p>0&&(o=o.substr(0,p))}if(o==="application/ld+json")return await s.json();if(s.headers.has("Link")){let p;if(s.headers.forEach((u,f)=>{if(f==="link"){const y=(0,e.parse)(u);for(const E of y.get("type","application/ld+json"))if(E.rel==="alternate"){if(p)throw new Error("Multiple JSON-LD alternate links were found on "+r);p=(0,t.resolve)(E.uri,r)}}}),p)return this.load(p)}throw new n.ErrorCoded(`Unsupported JSON-LD media type ${o}`,n.ERROR_CODES.LOADING_DOCUMENT_FAILED)}else throw new Error(s.statusText||`Status code: ${s.status}`)}}return kg.FetchDocumentLoader=i,kg}var Q3={},Wg={},yee;function qK(){if(yee)return Wg;yee=1,Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.Util=void 0;class n{static isCompactIri(t){return t.indexOf(":")>0&&!(t&&t[0]==="#")}static getPrefix(t,i){if(t&&t[0]==="#")return null;const a=t.indexOf(":");if(a>=0){if(t.length>a+1&&t.charAt(a+1)==="/"&&t.charAt(a+2)==="/")return null;const r=t.substr(0,a);if(r==="_")return null;if(i[r])return r}return null}static getContextValueId(t){if(t===null||typeof t=="string")return t;const i=t["@id"];return i||null}static isSimpleTermDefinitionPrefix(t,i){return!n.isPotentialKeyword(t)&&(i.allowPrefixNonGenDelims||typeof t=="string"&&(t[0]==="_"||n.isPrefixIriEndingWithGenDelim(t)))}static isPotentialKeyword(t){return typeof t=="string"&&n.KEYWORD_REGEX.test(t)}static isPrefixIriEndingWithGenDelim(t){return n.ENDS_WITH_GEN_DELIM.test(t)}static isPrefixValue(t){return t&&(typeof t=="string"||t&&typeof t=="object")}static isValidIri(t){return!!(t&&n.IRI_REGEX.test(t))}static isValidIriWeak(t){return!!t&&t[0]!==":"&&n.IRI_REGEX_WEAK.test(t)}static isValidKeyword(t){return n.VALID_KEYWORDS[t]}static isTermProtected(t,i){const a=t[i];return typeof a!="string"&&a&&a["@protected"]}static hasProtectedTerms(t){for(const i of Object.keys(t))if(n.isTermProtected(t,i))return!0;return!1}static isReservedInternalKeyword(t){return t.startsWith("@__")}static deepEqual(t,i){const a=Object.keys(t),r=Object.keys(i);return a.length!==r.length?!1:a.every(s=>{const o=t[s],p=i[s];return o===p||o!==null&&p!==null&&typeof o=="object"&&typeof p=="object"&&this.deepEqual(o,p)})}}return n.IRI_REGEX=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^ "<>{}|\\\[\]`#]*(#[^#]*)?$/,n.IRI_REGEX_WEAK=/(?::[^:])|\//,n.KEYWORD_REGEX=/^@[a-z]+$/i,n.ENDS_WITH_GEN_DELIM=/[:/?#\[\]@]$/,n.REGEX_LANGUAGE_TAG=/^[a-zA-Z]+(-[a-zA-Z0-9]+)*$/,n.REGEX_DIRECTION_TAG=/^(ltr)|(rtl)$/,n.VALID_KEYWORDS={"@annotation":!0,"@base":!0,"@container":!0,"@context":!0,"@direction":!0,"@graph":!0,"@id":!0,"@import":!0,"@included":!0,"@index":!0,"@json":!0,"@language":!0,"@list":!0,"@nest":!0,"@none":!0,"@prefix":!0,"@propagate":!0,"@protected":!0,"@reverse":!0,"@set":!0,"@type":!0,"@value":!0,"@version":!0,"@vocab":!0},n.EXPAND_KEYS_BLACKLIST=["@base","@vocab","@language","@version","@direction"],n.ALIAS_DOMAIN_BLACKLIST=["@container","@graph","@id","@index","@list","@nest","@none","@prefix","@reverse","@set","@type","@value","@version"],n.ALIAS_RANGE_BLACKLIST=["@context","@preserve"],n.CONTAINERS=["@list","@set","@index","@language","@graph","@id","@type"],n.CONTAINERS_1_0=["@list","@set","@index"],Wg.Util=n,Wg}var gee;function FBe(){return gee||(gee=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.defaultExpandOptions=n.JsonLdContextNormalized=void 0;const e=ia(),t=KP(),i=qK();class a{constructor(s){this.contextRaw=s}getContextRaw(){return this.contextRaw}expandTerm(s,o,p=n.defaultExpandOptions){const u=this.contextRaw[s];if(u===null||u&&u["@id"]===null)return null;let f=!0;if(u&&o){const d=i.Util.getContextValueId(u);if(d&&d!==s)if(typeof d!="string"||!i.Util.isValidIri(d)&&!i.Util.isValidKeyword(d))i.Util.isPotentialKeyword(d)||(f=!1);else return d}const y=i.Util.getPrefix(s,this.contextRaw),E=this.contextRaw["@vocab"],A=(!!E||E==="")&&E.indexOf(":")<0,R=this.contextRaw["@base"],T=i.Util.isPotentialKeyword(s);if(y){const d=this.contextRaw[y],N=i.Util.getContextValueId(d);if(N){if(typeof d=="string"||!p.allowPrefixForcing){if(!i.Util.isSimpleTermDefinitionPrefix(N,p))return s}else if(N[0]!=="_"&&!T&&!d["@prefix"]&&!(s in this.contextRaw))return s;return N+s.substr(y.length+1)}}else if(o&&(E||E===""||p.allowVocabRelativeToBase&&R&&A)&&!T&&!i.Util.isCompactIri(s))if(A){if(p.allowVocabRelativeToBase)return(E||R?(0,e.resolve)(E,R):"")+s;throw new t.ErrorCoded(`Relative vocab expansion for term '${s}' with vocab '${E}' is not allowed.`,t.ERROR_CODES.INVALID_VOCAB_MAPPING)}else return E+s;else if(!o&&R&&!T&&!i.Util.isCompactIri(s))return(0,e.resolve)(s,R);if(f)return s;throw new t.ErrorCoded(`Invalid IRI mapping found for context entry '${s}': '${JSON.stringify(u)}'`,t.ERROR_CODES.INVALID_IRI_MAPPING)}compactIri(s,o){if(o&&this.contextRaw["@vocab"]&&s.startsWith(this.contextRaw["@vocab"]))return s.substr(this.contextRaw["@vocab"].length);if(!o&&this.contextRaw["@base"]&&s.startsWith(this.contextRaw["@base"]))return s.substr(this.contextRaw["@base"].length);const p={prefix:"",suffix:s};for(const u in this.contextRaw){const f=this.contextRaw[u];if(f&&!i.Util.isPotentialKeyword(u)){const y=i.Util.getContextValueId(f);if(s.startsWith(y)){const E=s.substr(y.length);if(E)E.length<p.suffix.length&&(p.prefix=u,p.suffix=E);else if(o)return u}}}return p.prefix?p.prefix+":"+p.suffix:s}}n.JsonLdContextNormalized=a,n.defaultExpandOptions={allowPrefixForcing:!0,allowPrefixNonGenDelims:!1,allowVocabRelativeToBase:!0}})(Q3)),Q3}var wee;function Tze(){if(wee)return Bg;wee=1,Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.ContextParser=void 0;const n=ia(),e=KP(),t=LBe(),i=FBe(),a=qK();class r{constructor(o){o=o||{},this.documentLoader=o.documentLoader||new t.FetchDocumentLoader,this.documentCache={},this.validateContext=!o.skipValidation,this.expandContentTypeToBase=!!o.expandContentTypeToBase,this.remoteContextsDepthLimit=o.remoteContextsDepthLimit||32,this.redirectSchemaOrgHttps="redirectSchemaOrgHttps"in o?!!o.redirectSchemaOrgHttps:!0}static validateLanguage(o,p,u){if(typeof o!="string")throw new e.ErrorCoded(`The value of an '@language' must be a string, got '${JSON.stringify(o)}'`,u);if(!a.Util.REGEX_LANGUAGE_TAG.test(o)){if(p)throw new e.ErrorCoded(`The value of an '@language' must be a valid language tag, got '${JSON.stringify(o)}'`,u);return!1}return!0}static validateDirection(o,p){if(typeof o!="string")throw new e.ErrorCoded(`The value of an '@direction' must be a string, got '${JSON.stringify(o)}'`,e.ERROR_CODES.INVALID_BASE_DIRECTION);if(!a.Util.REGEX_DIRECTION_TAG.test(o)){if(p)throw new e.ErrorCoded(`The value of an '@direction' must be 'ltr' or 'rtl', got '${JSON.stringify(o)}'`,e.ERROR_CODES.INVALID_BASE_DIRECTION);return!1}return!0}idifyReverseTerms(o){for(const p of Object.keys(o)){let u=o[p];if(u&&typeof u=="object"&&u["@reverse"]&&!u["@id"]){if(typeof u["@reverse"]!="string"||a.Util.isValidKeyword(u["@reverse"]))throw new e.ErrorCoded(`Invalid @reverse value, must be absolute IRI or blank node: '${u["@reverse"]}'`,e.ERROR_CODES.INVALID_IRI_MAPPING);u=o[p]=Object.assign(Object.assign({},u),{"@id":u["@reverse"]}),u["@id"]=u["@reverse"],a.Util.isPotentialKeyword(u["@reverse"])?delete u["@reverse"]:u["@reverse"]=!0}}return o}expandPrefixedTerms(o,p,u){const f=o.getContextRaw();for(const y of u||Object.keys(f))if(a.Util.EXPAND_KEYS_BLACKLIST.indexOf(y)<0&&!a.Util.isReservedInternalKeyword(y)){const E=f[y];if(a.Util.isPotentialKeyword(y)&&a.Util.ALIAS_DOMAIN_BLACKLIST.indexOf(y)>=0&&(y!=="@type"||typeof f[y]=="object"&&!(f[y]["@protected"]||f[y]["@container"]==="@set")))throw new e.ErrorCoded(`Keywords can not be aliased to something else.
|
|
2
2
|
Tried mapping ${y} to ${JSON.stringify(E)}`,e.ERROR_CODES.KEYWORD_REDEFINITION);if(a.Util.ALIAS_RANGE_BLACKLIST.indexOf(a.Util.getContextValueId(E))>=0)throw new e.ErrorCoded(`Aliasing to certain keywords is not allowed.
|
|
3
3
|
Tried mapping ${y} to ${JSON.stringify(E)}`,e.ERROR_CODES.INVALID_KEYWORD_ALIAS);if(E&&a.Util.isPotentialKeyword(a.Util.getContextValueId(E))&&E["@prefix"]===!0)throw new e.ErrorCoded(`Tried to use keyword aliases as prefix: '${y}': '${JSON.stringify(E)}'`,e.ERROR_CODES.INVALID_TERM_DEFINITION);for(;a.Util.isPrefixValue(f[y]);){const A=f[y];let R=!1;if(typeof A=="string")f[y]=o.expandTerm(A,!0),R=R||A!==f[y];else{const T=A["@id"],d=A["@type"],N=!("@prefix"in A)||a.Util.isValidIri(y);if("@id"in A)T!=null&&typeof T=="string"&&(f[y]=Object.assign(Object.assign({},f[y]),{"@id":o.expandTerm(T,!0)}),R=R||T!==f[y]["@id"]);else if(!a.Util.isPotentialKeyword(y)&&N){const w=o.expandTerm(y,!0);w!==y&&(f[y]=Object.assign(Object.assign({},f[y]),{"@id":w}),R=!0)}if(d&&typeof d=="string"&&d!=="@vocab"&&(!A["@container"]||!A["@container"]["@type"])&&N){let w=o.expandTerm(d,!0);p&&d===w&&(w=o.expandTerm(d,!1)),w!==d&&(R=!0,f[y]=Object.assign(Object.assign({},f[y]),{"@type":w}))}}if(!R)break}}}normalize(o,{processingMode:p,normalizeLanguageTags:u}){if(u||p===1)for(const f of Object.keys(o))if(f==="@language"&&typeof o[f]=="string")o[f]=o[f].toLowerCase();else{const y=o[f];if(y&&typeof y=="object"&&typeof y["@language"]=="string"){const E=y["@language"].toLowerCase();E!==y["@language"]&&(o[f]=Object.assign(Object.assign({},y),{"@language":E}))}}}containersToHash(o){for(const p of Object.keys(o)){const u=o[p];if(u&&typeof u=="object"){if(typeof u["@container"]=="string")o[p]=Object.assign(Object.assign({},u),{"@container":{[u["@container"]]:!0}});else if(Array.isArray(u["@container"])){const f={};for(const y of u["@container"])f[y]=!0;o[p]=Object.assign(Object.assign({},u),{"@container":f})}}}}applyScopedProtected(o,{processingMode:p},u){if(p&&p>=1.1&&o["@protected"]){for(const f of Object.keys(o))if(!a.Util.isReservedInternalKeyword(f)&&!a.Util.isPotentialKeyword(f)&&!a.Util.isTermProtected(o,f)){const y=o[f];y&&typeof y=="object"?"@protected"in o[f]||(o[f]=Object.assign(Object.assign({},o[f]),{"@protected":!0})):(o[f]={"@id":y,"@protected":!0},a.Util.isSimpleTermDefinitionPrefix(y,u)&&(o[f]=Object.assign(Object.assign({},o[f]),{"@prefix":!0})))}delete o["@protected"]}}validateKeywordRedefinitions(o,p,u,f){for(const y of f??Object.keys(p))if(a.Util.isTermProtected(o,y)&&(typeof p[y]=="string"?p[y]={"@id":p[y],"@protected":!0}:p[y]=Object.assign(Object.assign({},p[y]),{"@protected":!0}),!a.Util.deepEqual(o[y],p[y])))throw new e.ErrorCoded(`Attempted to override the protected keyword ${y} from ${JSON.stringify(a.Util.getContextValueId(o[y]))} to ${JSON.stringify(a.Util.getContextValueId(p[y]))}`,e.ERROR_CODES.PROTECTED_TERM_REDEFINITION)}validate(o,{processingMode:p}){for(const u of Object.keys(o)){if(a.Util.isReservedInternalKeyword(u))continue;if(u==="")throw new e.ErrorCoded(`The empty term is not allowed, got: '${u}': '${JSON.stringify(o[u])}'`,e.ERROR_CODES.INVALID_TERM_DEFINITION);const f=o[u],y=typeof f;if(a.Util.isPotentialKeyword(u)){switch(u.substr(1)){case"vocab":if(f!==null&&y!=="string")throw new e.ErrorCoded(`Found an invalid @vocab IRI: ${f}`,e.ERROR_CODES.INVALID_VOCAB_MAPPING);break;case"base":if(f!==null&&y!=="string")throw new e.ErrorCoded(`Found an invalid @base IRI: ${o[u]}`,e.ERROR_CODES.INVALID_BASE_IRI);break;case"language":f!==null&&r.validateLanguage(f,!0,e.ERROR_CODES.INVALID_DEFAULT_LANGUAGE);break;case"version":if(f!==null&&y!=="number")throw new e.ErrorCoded(`Found an invalid @version number: ${f}`,e.ERROR_CODES.INVALID_VERSION_VALUE);break;case"direction":f!==null&&r.validateDirection(f,!0);break;case"propagate":if(p===1)throw new e.ErrorCoded(`Found an illegal @propagate keyword: ${f}`,e.ERROR_CODES.INVALID_CONTEXT_ENTRY);if(f!==null&&y!=="boolean")throw new e.ErrorCoded(`Found an invalid @propagate value: ${f}`,e.ERROR_CODES.INVALID_PROPAGATE_VALUE);break}if(a.Util.isValidKeyword(u)&&a.Util.isValidKeyword(a.Util.getContextValueId(f)))throw new e.ErrorCoded(`Illegal keyword alias in term value, found: '${u}': '${a.Util.getContextValueId(f)}'`,e.ERROR_CODES.KEYWORD_REDEFINITION);continue}if(f!==null)switch(y){case"string":if(a.Util.getPrefix(f,o)===u)throw new e.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.CYCLIC_IRI_MAPPING);if(a.Util.isValidIriWeak(u)){if(f==="@type")throw new e.ErrorCoded(`IRIs can not be mapped to @type, found: '${u}': '${f}'`,e.ERROR_CODES.INVALID_IRI_MAPPING);if(a.Util.isValidIri(f)&&f!==new i.JsonLdContextNormalized(o).expandTerm(u))throw new e.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${u}': '${f}'`,e.ERROR_CODES.INVALID_IRI_MAPPING)}break;case"object":if(!a.Util.isCompactIri(u)&&!("@id"in f)&&(f["@type"]==="@id"?!o["@base"]:!o["@vocab"]))throw new e.ErrorCoded(`Missing @id in context entry: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_IRI_MAPPING);for(const E of Object.keys(f)){const A=f[E];if(A)switch(E){case"@id":if(a.Util.isValidKeyword(A)&&A!=="@type"&&A!=="@id"&&A!=="@graph"&&A!=="@nest")throw new e.ErrorCoded(`Illegal keyword alias in term value, found: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_IRI_MAPPING);if(a.Util.isValidIriWeak(u)){if(A==="@type")throw new e.ErrorCoded(`IRIs can not be mapped to @type, found: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_IRI_MAPPING);if(a.Util.isValidIri(A)&&A!==new i.JsonLdContextNormalized(o).expandTerm(u))throw new e.ErrorCoded(`IRIs can not be mapped to other IRIs, found: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_IRI_MAPPING)}if(typeof A!="string")throw new e.ErrorCoded(`Detected non-string @id in context entry: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_IRI_MAPPING);if(a.Util.getPrefix(A,o)===u)throw new e.ErrorCoded(`Detected cyclical IRI mapping in context entry: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.CYCLIC_IRI_MAPPING);break;case"@type":if(f["@container"]==="@type"&&A!=="@id"&&A!=="@vocab")throw new e.ErrorCoded(`@container: @type only allows @type: @id or @vocab, but got: '${u}': '${A}'`,e.ERROR_CODES.INVALID_TYPE_MAPPING);if(typeof A!="string")throw new e.ErrorCoded(`The value of an '@type' must be a string, got '${JSON.stringify(y)}'`,e.ERROR_CODES.INVALID_TYPE_MAPPING);if(A!=="@id"&&A!=="@vocab"&&(p===1||A!=="@json")&&(p===1||A!=="@none")&&(A[0]==="_"||!a.Util.isValidIri(A)))throw new e.ErrorCoded(`A context @type must be an absolute IRI, found: '${u}': '${A}'`,e.ERROR_CODES.INVALID_TYPE_MAPPING);break;case"@reverse":if(typeof A=="string"&&f["@id"]&&f["@id"]!==A)throw new e.ErrorCoded(`Found non-matching @id and @reverse term values in '${u}':'${A}' and '${f["@id"]}'`,e.ERROR_CODES.INVALID_REVERSE_PROPERTY);if("@nest"in f)throw new e.ErrorCoded(`@nest is not allowed in the reverse property '${u}'`,e.ERROR_CODES.INVALID_REVERSE_PROPERTY);break;case"@container":if(p===1&&(Object.keys(A).length>1||a.Util.CONTAINERS_1_0.indexOf(Object.keys(A)[0])<0))throw new e.ErrorCoded(`Invalid term @container for '${u}' ('${Object.keys(A)}') in 1.0, must be only one of ${a.Util.CONTAINERS_1_0.join(", ")}`,e.ERROR_CODES.INVALID_CONTAINER_MAPPING);for(const R of Object.keys(A)){if(R==="@list"&&f["@reverse"])throw new e.ErrorCoded(`Term value can not be @container: @list and @reverse at the same time on '${u}'`,e.ERROR_CODES.INVALID_REVERSE_PROPERTY);if(a.Util.CONTAINERS.indexOf(R)<0)throw new e.ErrorCoded(`Invalid term @container for '${u}' ('${R}'), must be one of ${a.Util.CONTAINERS.join(", ")}`,e.ERROR_CODES.INVALID_CONTAINER_MAPPING)}break;case"@language":r.validateLanguage(A,!0,e.ERROR_CODES.INVALID_LANGUAGE_MAPPING);break;case"@direction":r.validateDirection(A,!0);break;case"@prefix":if(A!==null&&typeof A!="boolean")throw new e.ErrorCoded(`Found an invalid term @prefix boolean in: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_PREFIX_VALUE);if(!("@id"in f)&&!a.Util.isValidIri(u))throw new e.ErrorCoded(`Invalid @prefix definition for '${u}' ('${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@index":if(p===1||!f["@container"]||!f["@container"]["@index"])throw new e.ErrorCoded(`Attempt to add illegal key to value object: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_TERM_DEFINITION);break;case"@nest":if(a.Util.isPotentialKeyword(A)&&A!=="@nest")throw new e.ErrorCoded(`Found an invalid term @nest value in: '${u}': '${JSON.stringify(f)}'`,e.ERROR_CODES.INVALID_NEST_VALUE)}}break;default:throw new e.ErrorCoded(`Found an invalid term value: '${u}': '${f}'`,e.ERROR_CODES.INVALID_TERM_DEFINITION)}}}applyBaseEntry(o,p,u){return typeof o=="string"||(u&&!("@base"in o)&&p.parentContext&&typeof p.parentContext=="object"&&"@base"in p.parentContext&&(o["@base"]=p.parentContext["@base"],p.parentContext["@__baseDocument"]&&(o["@__baseDocument"]=!0)),p.baseIRI&&!p.external&&("@base"in o?o["@base"]!==null&&typeof o["@base"]=="string"&&!a.Util.isValidIri(o["@base"])&&(o["@base"]=(0,n.resolve)(o["@base"],p.parentContext&&p.parentContext["@base"]||p.baseIRI)):(o["@base"]=p.baseIRI,o["@__baseDocument"]=!0))),o}normalizeContextIri(o,p){if(!a.Util.isValidIri(o))try{o=(0,n.resolve)(o,p)}catch{throw new Error(`Invalid context IRI: ${o}`)}return this.redirectSchemaOrgHttps&&o.startsWith("http://schema.org")&&(o="https://schema.org/"),o}async parseInnerContexts(o,p,u){for(const f of u??Object.keys(o)){const y=o[f];if(y&&typeof y=="object"&&"@context"in y&&y["@context"]!==null&&!p.ignoreScopedContexts){if(this.validateContext)try{const E=Object.assign(Object.assign({},o),{[f]:Object.assign({},o[f])});delete E[f]["@context"],await this.parse(y["@context"],Object.assign(Object.assign({},p),{external:!1,parentContext:E,ignoreProtection:!0,ignoreRemoteScopedContexts:!0,ignoreScopedContexts:!0}))}catch(E){throw new e.ErrorCoded(E.message,e.ERROR_CODES.INVALID_SCOPED_CONTEXT)}o[f]=Object.assign(Object.assign({},y),{"@context":(await this.parse(y["@context"],Object.assign(Object.assign({},p),{external:!1,minimalProcessing:!0,ignoreRemoteScopedContexts:!0,parentContext:o}))).getContextRaw()})}}return o}async parse(o,p={},u={}){const{baseIRI:f,parentContext:y,external:E,processingMode:A=r.DEFAULT_PROCESSING_MODE,normalizeLanguageTags:R,ignoreProtection:T,minimalProcessing:d}=p,N=p.remoteContexts||{};if(Object.keys(N).length>=this.remoteContextsDepthLimit)throw new e.ErrorCoded("Detected an overflow in remote context inclusions: "+Object.keys(N),e.ERROR_CODES.CONTEXT_OVERFLOW);if(o==null){if(!T&&y&&a.Util.hasProtectedTerms(y))throw new e.ErrorCoded("Illegal context nullification when terms are protected",e.ERROR_CODES.INVALID_CONTEXT_NULLIFICATION);return new i.JsonLdContextNormalized(this.applyBaseEntry({},p,!1))}else if(typeof o=="string"){const w=this.normalizeContextIri(o,f),_=this.getOverriddenLoad(w,p);if(_)return new i.JsonLdContextNormalized(_);const C=await this.parse(await this.load(w),Object.assign(Object.assign({},p),{baseIRI:w,external:!0,remoteContexts:Object.assign(Object.assign({},N),{[w]:!0})}));return this.applyBaseEntry(C.getContextRaw(),p,!0),C}else if(Array.isArray(o)){const w=[],_=await Promise.all(o.map((q,te)=>{if(typeof q=="string"){const re=this.normalizeContextIri(q,f);w[te]=re;const V=this.getOverriddenLoad(re,p);return V||this.load(re)}else return q}));if(d)return new i.JsonLdContextNormalized(_);const C=await _.reduce((q,te,re)=>q.then(V=>this.parse(te,Object.assign(Object.assign({},p),{baseIRI:w[re]||p.baseIRI,external:!!w[re]||p.external,parentContext:V.getContextRaw(),remoteContexts:w[re]?Object.assign(Object.assign({},N),{[w[re]]:!0}):N}),{skipValidation:re<_.length-1})),Promise.resolve(new i.JsonLdContextNormalized(y||{})));return this.applyBaseEntry(C.getContextRaw(),p,!0),C}else if(typeof o=="object"){if("@context"in o){if(p?.disallowDirectlyNestedContext)throw new e.ErrorCoded(`Keywords can not be aliased to something else.
|
|
4
4
|
Tried mapping @context to ${JSON.stringify(o["@context"])}`,e.ERROR_CODES.KEYWORD_REDEFINITION);return await this.parse(o["@context"],p)}if(o=Object.assign({},o),E&&delete o["@base"],this.applyBaseEntry(o,p,!0),this.containersToHash(o),d)return new i.JsonLdContextNormalized(o);let w={};if("@import"in o)if(A>=1.1){if(typeof o["@import"]!="string")throw new e.ErrorCoded("An @import value must be a string, but got "+typeof o["@import"],e.ERROR_CODES.INVALID_IMPORT_VALUE);w=await this.loadImportContext(this.normalizeContextIri(o["@import"],f)),delete o["@import"]}else throw new e.ErrorCoded("Context importing is not supported in JSON-LD 1.0",e.ERROR_CODES.INVALID_CONTEXT_ENTRY);this.applyScopedProtected(w,{processingMode:A},i.defaultExpandOptions);const _=Object.assign(w,o);this.idifyReverseTerms(_),this.normalize(_,{processingMode:A,normalizeLanguageTags:R}),this.applyScopedProtected(_,{processingMode:A},i.defaultExpandOptions);const C=Object.keys(_),q=[];if(typeof y=="object")for(const re in y)re in _?q.push(re):_[re]=y[re];await this.parseInnerContexts(_,p,C);const te=new i.JsonLdContextNormalized(_);return(_&&_["@version"]||r.DEFAULT_PROCESSING_MODE)>=1.1&&(o["@vocab"]&&typeof o["@vocab"]=="string"||o["@vocab"]==="")&&(y&&"@vocab"in y&&o["@vocab"].indexOf(":")<0?_["@vocab"]=y["@vocab"]+o["@vocab"]:(a.Util.isCompactIri(o["@vocab"])||o["@vocab"]in _)&&(_["@vocab"]=te.expandTerm(o["@vocab"],!0))),this.expandPrefixedTerms(te,this.expandContentTypeToBase,C),!T&&y&&A>=1.1&&this.validateKeywordRedefinitions(y,_,i.defaultExpandOptions,q),this.validateContext&&!u.skipValidation&&this.validate(_,{processingMode:A}),te}else throw new e.ErrorCoded(`Tried parsing a context that is not a string, array or object, but got ${o}`,e.ERROR_CODES.INVALID_LOCAL_CONTEXT)}async load(o){const p=this.documentCache[o];if(p)return p;let u;try{u=await this.documentLoader.load(o)}catch(f){throw new e.ErrorCoded(`Failed to load remote context ${o}: ${f.message}`,e.ERROR_CODES.LOADING_REMOTE_CONTEXT_FAILED)}if(!("@context"in u))throw new e.ErrorCoded(`Missing @context in remote context at ${o}`,e.ERROR_CODES.INVALID_REMOTE_CONTEXT);return this.documentCache[o]=u["@context"]}getOverriddenLoad(o,p){if(o in(p.remoteContexts||{})){if(p.ignoreRemoteScopedContexts)return o;throw new e.ErrorCoded("Detected a cyclic context inclusion of "+o,e.ERROR_CODES.RECURSIVE_CONTEXT_INCLUSION)}return null}async loadImportContext(o){let p=await this.load(o);if(typeof p!="object"||Array.isArray(p))throw new e.ErrorCoded("An imported context must be a single object: "+o,e.ERROR_CODES.INVALID_REMOTE_CONTEXT);if("@import"in p)throw new e.ErrorCoded("An imported context can not import another context: "+o,e.ERROR_CODES.INVALID_CONTEXT_ENTRY);return p=Object.assign({},p),this.containersToHash(p),p}}return r.DEFAULT_PROCESSING_MODE=1.1,Bg.ContextParser=r,Bg}var V3={},mee;function Rze(){return mee||(mee=1,Object.defineProperty(V3,"__esModule",{value:!0})),V3}var H3={},See;function vze(){return See||(See=1,Object.defineProperty(H3,"__esModule",{value:!0})),H3}var Aee;function Rn(){return Aee||(Aee=1,(function(n){var e=gl&&gl.__createBinding||(Object.create?(function(i,a,r,s){s===void 0&&(s=r);var o=Object.getOwnPropertyDescriptor(a,r);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(i,s,o)}):(function(i,a,r,s){s===void 0&&(s=r),i[s]=a[r]})),t=gl&&gl.__exportStar||function(i,a){for(var r in i)r!=="default"&&!Object.prototype.hasOwnProperty.call(a,r)&&e(a,i,r)};Object.defineProperty(n,"__esModule",{value:!0}),t(Tze(),n),t(KP(),n),t(LBe(),n),t(Rze(),n),t(vze(),n),t(FBe(),n),t(qK(),n)})(gl)),gl}var ml={},Ug={},Eee;function $Be(){if(Eee)return Ug;Eee=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.BlankNode=void 0;class n{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}}return Ug.BlankNode=n,Ug}var Gg={},Qg={},Tee;function CBe(){if(Tee)return Qg;Tee=1,Object.defineProperty(Qg,"__esModule",{value:!0}),Qg.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&t.termType==="DefaultGraph"}}return Qg.DefaultGraph=n,n.INSTANCE=new n,Qg}var Vg={},Hg={},Ree;function BK(){if(Ree)return Hg;Ree=1,Object.defineProperty(Hg,"__esModule",{value:!0}),Hg.NamedNode=void 0;class n{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}}return Hg.NamedNode=n,Hg}var vee;function qBe(){if(vee)return Vg;vee=1,Object.defineProperty(Vg,"__esModule",{value:!0}),Vg.Literal=void 0;const n=BK();class e{constructor(i,a){this.termType="Literal",this.value=i,typeof a=="string"?(this.language=a,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=""):a?"termType"in a?(this.language="",this.datatype=a,this.direction=""):(this.language=a.language,this.datatype=a.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=a.direction||""):(this.language="",this.datatype=e.XSD_STRING,this.direction="")}equals(i){return!!i&&i.termType==="Literal"&&i.value===this.value&&i.language===this.language&&(i.direction===this.direction||!i.direction&&this.direction==="")&&this.datatype.equals(i.datatype)}}return Vg.Literal=e,e.RDF_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new n.NamedNode("http://www.w3.org/2001/XMLSchema#string"),Vg}var zg={},Nee;function BBe(){if(Nee)return zg;Nee=1,Object.defineProperty(zg,"__esModule",{value:!0}),zg.Quad=void 0;class n{constructor(t,i,a,r){this.termType="Quad",this.value="",this.subject=t,this.predicate=i,this.object=a,this.graph=r}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}return zg.Quad=n,zg}var Kg={},Iee;function kBe(){if(Iee)return Kg;Iee=1,Object.defineProperty(Kg,"__esModule",{value:!0}),Kg.Variable=void 0;class n{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}}return Kg.Variable=n,Kg}var Oee;function Nze(){if(Oee)return Gg;Oee=1,Object.defineProperty(Gg,"__esModule",{value:!0}),Gg.DataFactory=void 0;const n=$Be(),e=CBe(),t=qBe(),i=BK(),a=BBe(),r=kBe();let s=0;class o{constructor(u){this.blankNodeCounter=0,u=u||{},this.blankNodePrefix=u.blankNodePrefix||`df_${s++}_`}namedNode(u){return new i.NamedNode(u)}blankNode(u){return new n.BlankNode(u||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(u,f){return new t.Literal(u,f)}variable(u){return new r.Variable(u)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(u,f,y,E){return new a.Quad(u,f,y,E||this.defaultGraph())}fromTerm(u){switch(u.termType){case"NamedNode":return this.namedNode(u.value);case"BlankNode":return this.blankNode(u.value);case"Literal":return u.language?this.literal(u.value,u.language):u.datatype.equals(t.Literal.XSD_STRING)?this.literal(u.value):this.literal(u.value,this.fromTerm(u.datatype));case"Variable":return this.variable(u.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(u.subject),this.fromTerm(u.predicate),this.fromTerm(u.object),this.fromTerm(u.graph))}}fromQuad(u){return this.fromTerm(u)}resetBlankNodeCounter(){this.blankNodeCounter=0}}return Gg.DataFactory=o,Gg}var xee;function aa(){return xee||(xee=1,(function(n){var e=ml&&ml.__createBinding||(Object.create?(function(i,a,r,s){s===void 0&&(s=r);var o=Object.getOwnPropertyDescriptor(a,r);(!o||("get"in o?!a.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return a[r]}}),Object.defineProperty(i,s,o)}):(function(i,a,r,s){s===void 0&&(s=r),i[s]=a[r]})),t=ml&&ml.__exportStar||function(i,a){for(var r in i)r!=="default"&&!Object.prototype.hasOwnProperty.call(a,r)&&e(a,i,r)};Object.defineProperty(n,"__esModule",{value:!0}),t($Be(),n),t(Nze(),n),t(CBe(),n),t(qBe(),n),t(BK(),n),t(BBe(),n),t(kBe(),n)})(ml)),ml}var z3,Dee;function Ize(){return Dee||(Dee=1,z3=function n(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,i,a)=>{const r=a===0?"":",",s=i===void 0||typeof i=="symbol"?null:i;return t+r+n(s)},"")+"]":"{"+Object.keys(e).sort().reduce((t,i,a)=>{if(e[i]===void 0||typeof e[i]=="symbol")return t;const r=t.length===0?"":",";return t+r+n(i)+":"+n(e[i])},"")+"}"}),z3}var Sl={},Xg={},Al={},Jg={},El={},Yg={},Tl={},Rl={};var QF="@@__IMMUTABLE_INDEXED__@@";function ra(n){return!!(n&&n[QF])}var VF="@@__IMMUTABLE_KEYED__@@";function Lt(n){return!!(n&&n[VF])}function ZF(n){return Lt(n)||ra(n)}var WBe="@@__IMMUTABLE_ITERABLE__@@";function na(n){return!!(n&&n[WBe])}var Qr=function(e){return na(e)?e:On(e)},va=(function(n){function e(t){return Lt(t)?t:xu(t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e})(Qr),B_=(function(n){function e(t){return ra(t)?t:Ia(t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e})(Qr),Gy=(function(n){function e(t){return na(t)&&!ZF(t)?t:zy(t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e})(Qr);Qr.Keyed=va;Qr.Indexed=B_;Qr.Set=Gy;var Qy=0,fa=1,da=2,sK=typeof Symbol=="function"&&Symbol.iterator,UBe="@@iterator",e$=sK||UBe,vt=function(e){this.next=e};vt.prototype.toString=function(){return"[Iterator]"};vt.KEYS=Qy;vt.VALUES=fa;vt.ENTRIES=da;vt.prototype.inspect=vt.prototype.toSource=function(){return this.toString()};vt.prototype[e$]=function(){return this};function Ct(n,e,t,i){var a=n===Qy?e:n===fa?t:[e,t];return i?i.value=a:i={value:a,done:!1},i}function In(){return{value:void 0,done:!0}}function kK(n){return Array.isArray(n)?!0:!!t$(n)}function Pee(n){return!!(n&&typeof n.next=="function")}function uK(n){var e=t$(n);return e&&e.call(n)}function t$(n){var e=n&&(sK&&n[sK]||n[UBe]);if(typeof e=="function")return e}function Oze(n){var e=t$(n);return e&&e===n.entries}function xze(n){var e=t$(n);return e&&e===n.keys}var XP="delete",Mt=5,la=1<<Mt,$n=la-1,Rt={};function lK(){return{value:!1}}function Ta(n){n&&(n.value=!0)}function WK(){}function Ry(n){return n.size===void 0&&(n.size=n.__iterate(GBe)),n.size}function Tu(n,e){if(typeof e!="number"){var t=e>>>0;if(""+t!==e||t===4294967295)return NaN;e=t}return e<0?Ry(n)+e:e}function GBe(){return!0}function JP(n,e,t){return(n===0&&!VBe(n)||t!==void 0&&n<=-t)&&(e===void 0||t!==void 0&&e>=t)}function Vy(n,e){return QBe(n,e,0)}function YP(n,e){return QBe(n,e,e)}function QBe(n,e,t){return n===void 0?t:VBe(n)?e===1/0?e:Math.max(0,e+n)|0:e===void 0||e===n?n:Math.min(e,n)|0}function VBe(n){return n<0||n===0&&1/n===-1/0}var HBe="@@__IMMUTABLE_RECORD__@@";function Ou(n){return!!(n&&n[HBe])}function Na(n){return na(n)||Ou(n)}var Ru="@@__IMMUTABLE_ORDERED__@@";function Xa(n){return!!(n&&n[Ru])}var zBe="@@__IMMUTABLE_SEQ__@@";function r$(n){return!!(n&&n[zBe])}var Hy=Object.prototype.hasOwnProperty;function UK(n){return Array.isArray(n)||typeof n=="string"?!0:n&&typeof n=="object"&&Number.isInteger(n.length)&&n.length>=0&&(n.length===0?Object.keys(n).length===1:n.hasOwnProperty(n.length-1))}var On=(function(n){function e(t){return t==null?QK():Na(t)?t.toSeq():Pze(t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(i,a){var r=this._cache;if(r){for(var s=r.length,o=0;o!==s;){var p=r[a?s-++o:o++];if(i(p[1],p[0],this)===!1)break}return o}return this.__iterateUncached(i,a)},e.prototype.__iterator=function(i,a){var r=this._cache;if(r){var s=r.length,o=0;return new vt(function(){if(o===s)return In();var p=r[a?s-++o:o++];return Ct(i,p[0],p[1])})}return this.__iteratorUncached(i,a)},e})(Qr),xu=(function(n){function e(t){return t==null?QK().toKeyedSeq():na(t)?Lt(t)?t.toSeq():t.fromEntrySeq():Ou(t)?t.toSeq():VK(t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e})(On),Ia=(function(n){function e(t){return t==null?QK():na(t)?Lt(t)?t.entrySeq():t.toIndexedSeq():Ou(t)?t.toSeq().entrySeq():KBe(t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e})(On),zy=(function(n){function e(t){return(na(t)&&!ZF(t)?t:Ia(t)).toSetSeq()}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e})(On);On.isSeq=r$;On.Keyed=xu;On.Set=zy;On.Indexed=Ia;On.prototype[zBe]=!0;var vy=(function(n){function e(t){this._array=t,this.size=t.length}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(i,a){return this.has(i)?this._array[Tu(this,i)]:a},e.prototype.__iterate=function(i,a){for(var r=this._array,s=r.length,o=0;o!==s;){var p=a?s-++o:o++;if(i(r[p],p,this)===!1)break}return o},e.prototype.__iterator=function(i,a){var r=this._array,s=r.length,o=0;return new vt(function(){if(o===s)return In();var p=a?s-++o:o++;return Ct(i,p,r[p])})},e})(Ia),GK=(function(n){function e(t){var i=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=i,this.size=i.length}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(i,a){return a!==void 0&&!this.has(i)?a:this._object[i]},e.prototype.has=function(i){return Hy.call(this._object,i)},e.prototype.__iterate=function(i,a){for(var r=this._object,s=this._keys,o=s.length,p=0;p!==o;){var u=s[a?o-++p:p++];if(i(r[u],u,this)===!1)break}return p},e.prototype.__iterator=function(i,a){var r=this._object,s=this._keys,o=s.length,p=0;return new vt(function(){if(p===o)return In();var u=s[a?o-++p:p++];return Ct(i,u,r[u])})},e})(xu);GK.prototype[Ru]=!0;var Dze=(function(n){function e(t){this._collection=t,this.size=t.length||t.size}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(i,a){if(a)return this.cacheResult().__iterate(i,a);var r=this._collection,s=uK(r),o=0;if(Pee(s))for(var p;!(p=s.next()).done&&i(p.value,o++,this)!==!1;);return o},e.prototype.__iteratorUncached=function(i,a){if(a)return this.cacheResult().__iterator(i,a);var r=this._collection,s=uK(r);if(!Pee(s))return new vt(In);var o=0;return new vt(function(){var p=s.next();return p.done?p:Ct(i,o++,p.value)})},e})(Ia),jee;function QK(){return jee||(jee=new vy([]))}function VK(n){var e=HK(n);if(e)return e.fromEntrySeq();if(typeof n=="object")return new GK(n);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+n)}function KBe(n){var e=HK(n);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+n)}function Pze(n){var e=HK(n);if(e)return Oze(n)?e.fromEntrySeq():xze(n)?e.toSetSeq():e;if(typeof n=="object")return new GK(n);throw new TypeError("Expected Array or collection object of values, or keyed object: "+n)}function HK(n){return UK(n)?new vy(n):kK(n)?new Dze(n):void 0}function ZP(){return this.__ensureOwner()}function ej(){return this.__ownerID?this:this.__ensureOwner(new WK)}var Zg=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(e,t){e|=0,t|=0;var i=e&65535,a=t&65535;return i*a+((e>>>16)*a+i*(t>>>16)<<16>>>0)|0};function n$(n){return n>>>1&1073741824|n&3221225471}var jze=Object.prototype.valueOf;function Fn(n){if(n==null)return Mee(n);if(typeof n.hashCode=="function")return n$(n.hashCode(n));var e=Bze(n);if(e==null)return Mee(e);switch(typeof e){case"boolean":return e?1108378657:1108378656;case"number":return Mze(e);case"string":return e.length>kze?Lze(e):cK(e);case"object":case"function":return Cze(e);case"symbol":return $ze(e);default:if(typeof e.toString=="function")return cK(e.toString());throw new Error("Value type "+typeof e+" cannot be hashed.")}}function Mee(n){return n===null?1108378658:1108378659}function Mze(n){if(n!==n||n===1/0)return 0;var e=n|0;for(e!==n&&(e^=n*4294967295);n>4294967295;)n/=4294967295,e^=n;return n$(e)}function Lze(n){var e=J3[n];return e===void 0&&(e=cK(n),X3===Wze&&(X3=0,J3={}),X3++,J3[n]=e),e}function cK(n){for(var e=0,t=0;t<n.length;t++)e=31*e+n.charCodeAt(t)|0;return n$(e)}var Fze=(Math.random()*1048576|1)%1048576||40503;function zK(n){if(typeof n!="string")return Fn(n);for(var e=0,t=0;t<n.length;t++)e=Fze*e+n.charCodeAt(t)|0;return e}function $ze(n){var e=$ee[n];return e!==void 0||(e=XBe(),$ee[n]=e),e}function Cze(n){var e;if(fK&&(e=dK.get(n),e!==void 0)||(e=n[E_],e!==void 0)||!Fee&&(e=n.propertyIsEnumerable&&n.propertyIsEnumerable[E_],e!==void 0||(e=qze(n),e!==void 0)))return e;if(e=XBe(),fK)dK.set(n,e);else{if(Lee!==void 0&&Lee(n)===!1)throw new Error("Non-extensible objects are not allowed as keys.");if(Fee)Object.defineProperty(n,E_,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(n.propertyIsEnumerable!==void 0&&n.propertyIsEnumerable===n.constructor.prototype.propertyIsEnumerable)n.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},n.propertyIsEnumerable[E_]=e;else if(n.nodeType!==void 0)n[E_]=e;else throw new Error("Unable to set a non-enumerable property on object.")}return e}var Lee=Object.isExtensible,Fee=(function(){try{return Object.defineProperty({},"@",{}),!0}catch{return!1}})();function qze(n){if(n&&n.nodeType>0)switch(n.nodeType){case 1:return n.uniqueID;case 9:return n.documentElement&&n.documentElement.uniqueID}}function Bze(n){return n.valueOf!==jze&&typeof n.valueOf=="function"?n.valueOf(n):n}function XBe(){var n=++K3;return K3&1073741824&&(K3=0),n}var fK=typeof WeakMap=="function",dK;fK&&(dK=new WeakMap);var $ee=Object.create(null),K3=0,E_="__immutablehash__";typeof Symbol=="function"&&(E_=Symbol(E_));var kze=16,Wze=255,X3=0,J3={},i$=(function(n){function e(t,i){this._iter=t,this._useKeys=i,this.size=t.size}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.get=function(i,a){return this._iter.get(i,a)},e.prototype.has=function(i){return this._iter.has(i)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var i=this,a=KK(this,!0);return this._useKeys||(a.valueSeq=function(){return i._iter.toSeq().reverse()}),a},e.prototype.map=function(i,a){var r=this,s=tke(this,i,a);return this._useKeys||(s.valueSeq=function(){return r._iter.toSeq().map(i,a)}),s},e.prototype.__iterate=function(i,a){var r=this;return this._iter.__iterate(function(s,o){return i(s,o,r)},a)},e.prototype.__iterator=function(i,a){return this._iter.__iterator(i,a)},e})(xu);i$.prototype[Ru]=!0;var JBe=(function(n){function e(t){this._iter=t,this.size=t.size}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.includes=function(i){return this._iter.includes(i)},e.prototype.__iterate=function(i,a){var r=this,s=0;return a&&Ry(this),this._iter.__iterate(function(o){return i(o,a?r.size-++s:s++,r)},a)},e.prototype.__iterator=function(i,a){var r=this,s=this._iter.__iterator(fa,a),o=0;return a&&Ry(this),new vt(function(){var p=s.next();return p.done?p:Ct(i,a?r.size-++o:o++,p.value,p)})},e})(Ia),YBe=(function(n){function e(t){this._iter=t,this.size=t.size}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.has=function(i){return this._iter.includes(i)},e.prototype.__iterate=function(i,a){var r=this;return this._iter.__iterate(function(s){return i(s,s,r)},a)},e.prototype.__iterator=function(i,a){var r=this._iter.__iterator(fa,a);return new vt(function(){var s=r.next();return s.done?s:Ct(i,s.value,s.value,s)})},e})(zy),ZBe=(function(n){function e(t){this._iter=t,this.size=t.size}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(i,a){var r=this;return this._iter.__iterate(function(s){if(s){qee(s);var o=na(s);return i(o?s.get(1):s[1],o?s.get(0):s[0],r)}},a)},e.prototype.__iterator=function(i,a){var r=this._iter.__iterator(fa,a);return new vt(function(){for(;;){var s=r.next();if(s.done)return s;var o=s.value;if(o){qee(o);var p=na(o);return Ct(i,p?o.get(0):o[0],p?o.get(1):o[1],s)}}})},e})(xu);JBe.prototype.cacheResult=i$.prototype.cacheResult=YBe.prototype.cacheResult=ZBe.prototype.cacheResult=YK;function eke(n){var e=Ro(n);return e._iter=n,e.size=n.size,e.flip=function(){return n},e.reverse=function(){var t=n.reverse.apply(this);return t.flip=function(){return n.reverse()},t},e.has=function(t){return n.includes(t)},e.includes=function(t){return n.has(t)},e.cacheResult=YK,e.__iterateUncached=function(t,i){var a=this;return n.__iterate(function(r,s){return t(s,r,a)!==!1},i)},e.__iteratorUncached=function(t,i){if(t===da){var a=n.__iterator(t,i);return new vt(function(){var r=a.next();if(!r.done){var s=r.value[0];r.value[0]=r.value[1],r.value[1]=s}return r})}return n.__iterator(t===fa?Qy:fa,i)},e}function tke(n,e,t){var i=Ro(n);return i.size=n.size,i.has=function(a){return n.has(a)},i.get=function(a,r){var s=n.get(a,Rt);return s===Rt?r:e.call(t,s,a,n)},i.__iterateUncached=function(a,r){var s=this;return n.__iterate(function(o,p,u){return a(e.call(t,o,p,u),p,s)!==!1},r)},i.__iteratorUncached=function(a,r){var s=n.__iterator(da,r);return new vt(function(){var o=s.next();if(o.done)return o;var p=o.value,u=p[0];return Ct(a,u,e.call(t,p[1],u,n),o)})},i}function KK(n,e){var t=Ro(n);return t._iter=n,t.size=n.size,t.reverse=function(){return n},n.flip&&(t.flip=function(){var i=eke(n);return i.reverse=function(){return n.flip()},i}),t.get=function(i,a){return n.get(e?i:-1-i,a)},t.has=function(i){return n.has(e?i:-1-i)},t.includes=function(i){return n.includes(i)},t.cacheResult=YK,t.__iterate=function(i,a){var r=this,s=0;return a&&Ry(n),n.__iterate(function(o,p){return i(o,e?p:a?r.size-++s:s++,r)},!a)},t.__iterator=function(i,a){var r=0;a&&Ry(n);var s=n.__iterator(da,!a);return new vt(function(){var o=s.next();if(o.done)return o;var p=o.value;return Ct(i,e?p[0]:a?t.size-++r:r++,p[1],o)})},t}function rke(n,e,t,i){var a=Ro(n);return i&&(a.has=function(r){var s=n.get(r,Rt);return s!==Rt&&!!e.call(t,s,r,n)},a.get=function(r,s){var o=n.get(r,Rt);return o!==Rt&&e.call(t,o,r,n)?o:s}),a.__iterateUncached=function(r,s){var o=this,p=0;return n.__iterate(function(u,f,y){if(e.call(t,u,f,y))return p++,r(u,i?f:p-1,o)},s),p},a.__iteratorUncached=function(r,s){var o=n.__iterator(da,s),p=0;return new vt(function(){for(;;){var u=o.next();if(u.done)return u;var f=u.value,y=f[0],E=f[1];if(e.call(t,E,y,n))return Ct(r,i?y:p++,E,u)}})},a}function Uze(n,e,t){var i=k_().asMutable();return n.__iterate(function(a,r){i.update(e.call(t,a,r,n),0,function(s){return s+1})}),i.asImmutable()}function Gze(n,e,t){var i=Lt(n),a=(Xa(n)?To():k_()).asMutable();n.__iterate(function(s,o){a.update(e.call(t,s,o,n),function(p){return p=p||[],p.push(i?[o,s]:s),p})});var r=JK(n);return a.map(function(s){return jt(n,r(s))}).asImmutable()}function Qze(n,e,t){var i=Lt(n),a=[[],[]];n.__iterate(function(s,o){a[e.call(t,s,o,n)?1:0].push(i?[o,s]:s)});var r=JK(n);return a.map(function(s){return jt(n,r(s))})}function XK(n,e,t,i){var a=n.size;if(JP(e,t,a))return n;if(typeof a>"u"&&(e<0||t<0))return XK(n.toSeq().cacheResult(),e,t,i);var r=Vy(e,a),s=YP(t,a),o=s-r,p;o===o&&(p=o<0?0:o);var u=Ro(n);return u.size=p===0?p:n.size&&p||void 0,!i&&r$(n)&&p>=0&&(u.get=function(f,y){return f=Tu(this,f),f>=0&&f<p?n.get(f+r,y):y}),u.__iterateUncached=function(f,y){var E=this;if(p===0)return 0;if(y)return this.cacheResult().__iterate(f,y);var A=0,R=!0,T=0;return n.__iterate(function(d,N){if(!(R&&(R=A++<r)))return T++,f(d,i?N:T-1,E)!==!1&&T!==p}),T},u.__iteratorUncached=function(f,y){if(p!==0&&y)return this.cacheResult().__iterator(f,y);if(p===0)return new vt(In);var E=n.__iterator(f,y),A=0,R=0;return new vt(function(){for(;A++<r;)E.next();if(++R>p)return In();var T=E.next();return i||f===fa||T.done?T:f===Qy?Ct(f,R-1,void 0,T):Ct(f,R-1,T.value[1],T)})},u}function Vze(n,e,t){var i=Ro(n);return i.__iterateUncached=function(a,r){var s=this;if(r)return this.cacheResult().__iterate(a,r);var o=0;return n.__iterate(function(p,u,f){return e.call(t,p,u,f)&&++o&&a(p,u,s)}),o},i.__iteratorUncached=function(a,r){var s=this;if(r)return this.cacheResult().__iterator(a,r);var o=n.__iterator(da,r),p=!0;return new vt(function(){if(!p)return In();var u=o.next();if(u.done)return u;var f=u.value,y=f[0],E=f[1];return e.call(t,E,y,s)?a===da?u:Ct(a,y,E,u):(p=!1,In())})},i}function nke(n,e,t,i){var a=Ro(n);return a.__iterateUncached=function(r,s){var o=this;if(s)return this.cacheResult().__iterate(r,s);var p=!0,u=0;return n.__iterate(function(f,y,E){if(!(p&&(p=e.call(t,f,y,E))))return u++,r(f,i?y:u-1,o)}),u},a.__iteratorUncached=function(r,s){var o=this;if(s)return this.cacheResult().__iterator(r,s);var p=n.__iterator(da,s),u=!0,f=0;return new vt(function(){var y,E,A;do{if(y=p.next(),y.done)return i||r===fa?y:r===Qy?Ct(r,f++,void 0,y):Ct(r,f++,y.value[1],y);var R=y.value;E=R[0],A=R[1],u&&(u=e.call(t,A,E,o))}while(u);return r===da?y:Ct(r,E,A,y)})},a}var Hze=(function(n){function e(t){this._wrappedIterables=t.flatMap(function(i){return i._wrappedIterables?i._wrappedIterables:[i]}),this.size=this._wrappedIterables.reduce(function(i,a){if(i!==void 0){var r=a.size;if(r!==void 0)return i+r}},0),this[VF]=this._wrappedIterables[0][VF],this[QF]=this._wrappedIterables[0][QF],this[Ru]=this._wrappedIterables[0][Ru]}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(i,a){if(this._wrappedIterables.length!==0){if(a)return this.cacheResult().__iterate(i,a);for(var r=0,s=Lt(this),o=s?da:fa,p=this._wrappedIterables[r].__iterator(o,a),u=!0,f=0;u;){for(var y=p.next();y.done;){if(r++,r===this._wrappedIterables.length)return f;p=this._wrappedIterables[r].__iterator(o,a),y=p.next()}var E=s?i(y.value[1],y.value[0],this):i(y.value,f,this);u=E!==!1,f++}return f}},e.prototype.__iteratorUncached=function(i,a){var r=this;if(this._wrappedIterables.length===0)return new vt(In);if(a)return this.cacheResult().__iterator(i,a);var s=0,o=this._wrappedIterables[s].__iterator(i,a);return new vt(function(){for(var p=o.next();p.done;){if(s++,s===r._wrappedIterables.length)return p;o=r._wrappedIterables[s].__iterator(i,a),p=o.next()}return p})},e})(On);function zze(n,e){var t=Lt(n),i=[n].concat(e).map(function(r){return na(r)?t&&(r=va(r)):r=t?VK(r):KBe(Array.isArray(r)?r:[r]),r}).filter(function(r){return r.size!==0});if(i.length===0)return n;if(i.length===1){var a=i[0];if(a===n||t&&Lt(a)||ra(n)&&ra(a))return a}return new Hze(i)}function ike(n,e,t){var i=Ro(n);return i.__iterateUncached=function(a,r){if(r)return this.cacheResult().__iterate(a,r);var s=0,o=!1;function p(u,f){u.__iterate(function(y,E){return(!e||f<e)&&na(y)?p(y,f+1):(s++,a(y,t?E:s-1,i)===!1&&(o=!0)),!o},r)}return p(n,0),s},i.__iteratorUncached=function(a,r){if(r)return this.cacheResult().__iterator(a,r);var s=n.__iterator(a,r),o=[],p=0;return new vt(function(){for(;s;){var u=s.next();if(u.done!==!1){s=o.pop();continue}var f=u.value;if(a===da&&(f=f[1]),(!e||o.length<e)&&na(f))o.push(s),s=f.__iterator(a,r);else return t?u:Ct(a,p++,f,u)}return In()})},i}function Kze(n,e,t){var i=JK(n);return n.toSeq().map(function(a,r){return i(e.call(t,a,r,n))}).flatten(!0)}function Xze(n,e){var t=Ro(n);return t.size=n.size&&n.size*2-1,t.__iterateUncached=function(i,a){var r=this,s=0;return n.__iterate(function(o){return(!s||i(e,s++,r)!==!1)&&i(o,s++,r)!==!1},a),s},t.__iteratorUncached=function(i,a){var r=n.__iterator(fa,a),s=0,o;return new vt(function(){return(!o||s%2)&&(o=r.next(),o.done)?o:s%2?Ct(i,s++,e):Ct(i,s++,o.value,o)})},t}function Ny(n,e,t){e||(e=ake);var i=Lt(n),a=0,r=n.toSeq().map(function(s,o){return[o,s,a++,t?t(s,o,n):s]}).valueSeq().toArray();return r.sort(function(s,o){return e(s[3],o[3])||s[2]-o[2]}).forEach(i?function(s,o){r[o].length=2}:function(s,o){r[o]=s[1]}),i?xu(r):ra(n)?Ia(r):zy(r)}function sM(n,e,t){if(e||(e=ake),t){var i=n.toSeq().map(function(a,r){return[a,t(a,r,n)]}).reduce(function(a,r){return Cee(e,a[1],r[1])?r:a});return i&&i[0]}return n.reduce(function(a,r){return Cee(e,a,r)?r:a})}function Cee(n,e,t){var i=n(t,e);return i===0&&t!==e&&(t==null||t!==t)||i>0}function uM(n,e,t,i){var a=Ro(n),r=new vy(t).map(function(s){return s.size});return a.size=i?r.max():r.min(),a.__iterate=function(s,o){for(var p=this.__iterator(fa,o),u,f=0;!(u=p.next()).done&&s(u.value,f++,this)!==!1;);return f},a.__iteratorUncached=function(s,o){var p=t.map(function(y){return y=Qr(y),uK(o?y.reverse():y)}),u=0,f=!1;return new vt(function(){var y;return f||(y=p.map(function(E){return E.next()}),f=i?y.every(function(E){return E.done}):y.some(function(E){return E.done})),f?In():Ct(s,u++,e.apply(null,y.map(function(E){return E.value})))})},a}function jt(n,e){return n===e?n:r$(n)?e:n.constructor(e)}function qee(n){if(n!==Object(n))throw new TypeError("Expected [K, V] tuple: "+n)}function JK(n){return Lt(n)?va:ra(n)?B_:Gy}function Ro(n){return Object.create((Lt(n)?xu:ra(n)?Ia:zy).prototype)}function YK(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):On.prototype.cacheResult.call(this)}function ake(n,e){return n===void 0&&e===void 0?0:n===void 0?1:e===void 0?-1:n>e?1:n<e?-1:0}function hK(n){return!!(n&&typeof n.equals=="function"&&typeof n.hashCode=="function")}function Gr(n,e){if(n===e||n!==n&&e!==e)return!0;if(!n||!e)return!1;if(typeof n.valueOf=="function"&&typeof e.valueOf=="function"){if(n=n.valueOf(),e=e.valueOf(),n===e||n!==n&&e!==e)return!0;if(!n||!e)return!1}return!!(hK(n)&&hK(e)&&n.equals(e))}function ZK(n,e,t,i){return W_(n,[e],t,i)}function oke(){for(var n=[],e=arguments.length;e--;)n[e]=arguments[e];return uke(this,n)}function ske(n){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];if(typeof n!="function")throw new TypeError("Invalid merger function: "+n);return uke(this,e,n)}function uke(n,e,t){for(var i=[],a=0;a<e.length;a++){var r=va(e[a]);r.size!==0&&i.push(r)}return i.length===0?n:n.toSeq().size===0&&!n.__ownerID&&i.length===1?Ou(n)?n:n.constructor(i[0]):n.withMutations(function(s){for(var o=t?function(u,f){ZK(s,f,Rt,function(y){return y===Rt?u:t(y,u,f)})}:function(u,f){s.set(f,u)},p=0;p<i.length;p++)i[p].forEach(o)})}var Jze=Object.prototype.toString;function eX(n){if(!n||typeof n!="object"||Jze.call(n)!=="[object Object]")return!1;var e=Object.getPrototypeOf(n);if(e===null)return!0;for(var t=e,i=Object.getPrototypeOf(e);i!==null;)t=i,i=Object.getPrototypeOf(t);return t===e}function vu(n){return typeof n=="object"&&(Na(n)||Array.isArray(n)||eX(n))}function tj(n){return typeof n=="string"&&(n==="__proto__"||n==="constructor")}function Ao(n,e){e=e||0;for(var t=Math.max(0,n.length-e),i=new Array(t),a=0;a<t;a++)i[a]=n[a+e];return i}function HF(n){if(Array.isArray(n))return Ao(n);var e={};for(var t in n)tj(t)||Hy.call(n,t)&&(e[t]=n[t]);return e}function Yze(n){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return nj(n,e)}function Zze(n,e){for(var t=[],i=arguments.length-2;i-- >0;)t[i]=arguments[i+2];return nj(e,t,n)}function eKe(n){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return rj(n,e)}function tKe(n,e){for(var t=[],i=arguments.length-2;i-- >0;)t[i]=arguments[i+2];return rj(e,t,n)}function rj(n,e,t){return nj(n,e,rKe(t))}function nj(n,e,t){if(!vu(n))throw new TypeError("Cannot merge into non-data-structure value: "+n);if(Na(n))return typeof t=="function"&&n.mergeWith?n.mergeWith.apply(n,[t].concat(e)):n.merge?n.merge.apply(n,e):n.concat.apply(n,e);for(var i=Array.isArray(n),a=n,r=i?B_:va,s=i?function(p){a===n&&(a=HF(a)),a.push(p)}:function(p,u){if(!tj(u)){var f=Hy.call(a,u),y=f&&t?t(a[u],p,u):p;(!f||y!==a[u])&&(a===n&&(a=HF(a)),a[u]=y)}},o=0;o<e.length;o++)r(e[o]).forEach(s);return a}function rKe(n){function e(t,i,a){return vu(t)&&vu(i)&&nKe(t,i)?nj(t,[i],e):n?n(t,i,a):i}return e}function nKe(n,e){var t=On(n),i=On(e);return ra(t)===ra(i)&&Lt(t)===Lt(i)}function lke(){for(var n=[],e=arguments.length;e--;)n[e]=arguments[e];return rj(this,n)}function cke(n){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return rj(this,e,n)}function tX(n){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return W_(this,n,Eo(),function(i){return rj(i,e)})}function rX(n){for(var e=[],t=arguments.length-1;t-- >0;)e[t]=arguments[t+1];return W_(this,n,Eo(),function(i){return nj(i,e)})}function fke(n,e,t){return W_(n,e,Rt,function(){return t})}function nX(n,e){return fke(this,n,e)}function iX(n,e,t){return arguments.length===1?n(this):ZK(this,n,e,t)}function aX(n,e,t){return W_(this,n,e,t)}function oX(){return this.__altered}function ij(n){var e=this.asMutable();return n(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}var dke="@@__IMMUTABLE_MAP__@@";function a$(n){return!!(n&&n[dke])}function IP(n,e){if(!n)throw new Error(e)}function ua(n){IP(n!==1/0,"Cannot perform this action with an infinite size.")}var k_=(function(n){function e(t){return t==null?Eo():a$(t)&&!Xa(t)?t:Eo().withMutations(function(i){var a=n(t);ua(a.size),a.forEach(function(r,s){return i.set(s,r)})})}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(i,a){return this._root?this._root.get(0,void 0,i,a):a},e.prototype.set=function(i,a){return Wee(this,i,a)},e.prototype.remove=function(i){return Wee(this,i,Rt)},e.prototype.deleteAll=function(i){var a=Qr(i);return a.size===0?this:this.withMutations(function(r){a.forEach(function(s){return r.remove(s)})})},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Eo()},e.prototype.sort=function(i){return To(Ny(this,i))},e.prototype.sortBy=function(i,a){return To(Ny(this,a,i))},e.prototype.map=function(i,a){var r=this;return this.withMutations(function(s){s.forEach(function(o,p){s.set(p,i.call(a,o,p,r))})})},e.prototype.__iterator=function(i,a){return new iKe(this,i,a)},e.prototype.__iterate=function(i,a){var r=this,s=0;return this._root&&this._root.iterate(function(o){return s++,i(o[1],o[0],r)},a),s},e.prototype.__ensureOwner=function(i){return i===this.__ownerID?this:i?sX(this.size,this._root,i,this.__hash):this.size===0?Eo():(this.__ownerID=i,this.__altered=!1,this)},e})(va);k_.isMap=a$;var qt=k_.prototype;qt[dke]=!0;qt[XP]=qt.remove;qt.removeAll=qt.deleteAll;qt.setIn=nX;qt.removeIn=qt.deleteIn=fX;qt.update=iX;qt.updateIn=aX;qt.merge=qt.concat=oke;qt.mergeWith=ske;qt.mergeDeep=lke;qt.mergeDeepWith=cke;qt.mergeIn=rX;qt.mergeDeepIn=tX;qt.withMutations=ij;qt.wasAltered=oX;qt.asImmutable=ZP;qt["@@transducer/init"]=qt.asMutable=ej;qt["@@transducer/step"]=function(n,e){return n.set(e[0],e[1])};qt["@@transducer/result"]=function(n){return n.asImmutable()};var FP=function(e,t){this.ownerID=e,this.entries=t};FP.prototype.get=function(e,t,i,a){for(var r=this.entries,s=0,o=r.length;s<o;s++)if(Gr(i,r[s][0]))return r[s][1];return a};FP.prototype.update=function(e,t,i,a,r,s,o){for(var p=r===Rt,u=this.entries,f=0,y=u.length;f<y&&!Gr(a,u[f][0]);f++);var E=f<y;if(E?u[f][1]===r:p)return this;if(Ta(o),(p||!E)&&Ta(s),!(p&&u.length===1)){if(!E&&!p&&u.length>=cKe)return aKe(e,u,a,r);var A=e&&e===this.ownerID,R=A?u:Ao(u);return E?p?f===y-1?R.pop():R[f]=R.pop():R[f]=[a,r]:R.push([a,r]),A?(this.entries=R,this):new FP(e,R)}};var Iy=function(e,t,i){this.ownerID=e,this.bitmap=t,this.nodes=i};Iy.prototype.get=function(e,t,i,a){t===void 0&&(t=Fn(i));var r=1<<((e===0?t:t>>>e)&$n),s=this.bitmap;return(s&r)===0?a:this.nodes[hke(s&r-1)].get(e+Mt,t,i,a)};Iy.prototype.update=function(e,t,i,a,r,s,o){i===void 0&&(i=Fn(a));var p=(t===0?i:i>>>t)&$n,u=1<<p,f=this.bitmap,y=(f&u)!==0;if(!y&&r===Rt)return this;var E=hke(f&u-1),A=this.nodes,R=y?A[E]:void 0,T=uX(R,e,t+Mt,i,a,r,s,o);if(T===R)return this;if(!y&&T&&A.length>=fKe)return sKe(e,A,f,p,T);if(y&&!T&&A.length===2&&Uee(A[E^1]))return A[E^1];if(y&&T&&A.length===1&&Uee(T))return T;var d=e&&e===this.ownerID,N=y?T?f:f^u:f|u,w=y?T?pke(A,E,T,d):lKe(A,E,d):uKe(A,E,T,d);return d?(this.bitmap=N,this.nodes=w,this):new Iy(e,N,w)};var $P=function(e,t,i){this.ownerID=e,this.count=t,this.nodes=i};$P.prototype.get=function(e,t,i,a){t===void 0&&(t=Fn(i));var r=(e===0?t:t>>>e)&$n,s=this.nodes[r];return s?s.get(e+Mt,t,i,a):a};$P.prototype.update=function(e,t,i,a,r,s,o){i===void 0&&(i=Fn(a));var p=(t===0?i:i>>>t)&$n,u=r===Rt,f=this.nodes,y=f[p];if(u&&!y)return this;var E=uX(y,e,t+Mt,i,a,r,s,o);if(E===y)return this;var A=this.count;if(!y)A++;else if(!E&&(A--,A<dKe))return oKe(e,f,A,p);var R=e&&e===this.ownerID,T=pke(f,p,E,R);return R?(this.count=A,this.nodes=T,this):new $P(e,A,T)};var Nu=function(e,t,i){this.ownerID=e,this.keyHash=t,this.entries=i,this._index=void 0};Nu.prototype._positionOf=function(e,t){var i=this.entries,a=this._index;if(a===void 0&&t&&i.length>=hKe&&(a=this._buildIndex()),a!==void 0){var r=a[zK(e)];if(r!==void 0)for(var s=0;s<r.length;s++){var o=r[s];if(Gr(e,i[o][0]))return o}return-1}for(var p=0,u=i.length;p<u;p++)if(Gr(e,i[p][0]))return p;return-1};Nu.prototype._buildIndex=function(){for(var e=Object.create(null),t=this.entries,i=0,a=t.length;i<a;i++){var r=zK(t[i][0]),s=e[r];s!==void 0?s.push(i):e[r]=[i]}return this._index=e,e};Nu.prototype.get=function(e,t,i,a){var r=this._positionOf(i,!0);return r===-1?a:this.entries[r][1]};Nu.prototype.update=function(e,t,i,a,r,s,o){i===void 0&&(i=Fn(a));var p=r===Rt;if(i!==this.keyHash)return p?this:(Ta(o),Ta(s),lX(this,e,t,i,[a,r]));var u=this.entries,f=u.length,y=e&&e===this.ownerID,E=this._positionOf(a,y),A=E===-1?f:E,R=E!==-1;if(R?u[A][1]===r:p)return this;if(Ta(o),(p||!R)&&Ta(s),p&&f===2)return new Go(e,this.keyHash,u[A^1]);var T=y?u:Ao(u);if(R)p?(A===f-1?T.pop():T[A]=T.pop(),y&&(this._index=void 0)):T[A]=[a,r];else if(T.push([a,r]),y&&this._index!==void 0){var d=zK(a),N=this._index[d];N!==void 0?N.push(f):this._index[d]=[f]}return y?(this.entries=T,this):new Nu(e,this.keyHash,T)};var Go=function(e,t,i){this.ownerID=e,this.keyHash=t,this.entry=i};Go.prototype.get=function(e,t,i,a){return Gr(i,this.entry[0])?this.entry[1]:a};Go.prototype.update=function(e,t,i,a,r,s,o){var p=r===Rt,u=Gr(a,this.entry[0]);if(u?r===this.entry[1]:p)return this;if(Ta(o),p){Ta(s);return}return u?e&&e===this.ownerID?(this.entry[1]=r,this):new Go(e,this.keyHash,[a,r]):(Ta(s),lX(this,e,t,Fn(a),[a,r]))};FP.prototype.iterate=Nu.prototype.iterate=function(n,e){for(var t=this.entries,i=0,a=t.length-1;i<=a;i++)if(n(t[e?a-i:i])===!1)return!1};Iy.prototype.iterate=$P.prototype.iterate=function(n,e){for(var t=this.nodes,i=0,a=t.length-1;i<=a;i++){var r=t[e?a-i:i];if(r&&r.iterate(n,e)===!1)return!1}};Go.prototype.iterate=function(n,e){return n(this.entry)};var iKe=(function(n){function e(t,i,a){this._type=i,this._reverse=a,this._stack=t._root&&Bee(t._root)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.next=function(){for(var i=this._type,a=this._stack;a;){var r=a.node,s=a.index++,o=void 0;if(r.entry){if(s===0)return Y3(i,r.entry)}else if(r.entries){if(o=r.entries.length-1,s<=o)return Y3(i,r.entries[this._reverse?o-s:s])}else if(o=r.nodes.length-1,s<=o){var p=r.nodes[this._reverse?o-s:s];if(p){if(p.entry)return Y3(i,p.entry);a=this._stack=Bee(p,a)}continue}a=this._stack=this._stack.__prev}return In()},e})(vt);function Y3(n,e){return Ct(n,e[0],e[1])}function Bee(n,e){return{node:n,index:0,__prev:e}}function sX(n,e,t,i){var a=Object.create(qt);return a.size=n,a._root=e,a.__ownerID=t,a.__hash=i,a.__altered=!1,a}var kee;function Eo(){return kee||(kee=sX(0))}function Wee(n,e,t){var i,a;if(n._root){var r=lK(),s=lK();if(i=uX(n._root,n.__ownerID,0,void 0,e,t,r,s),!s.value)return n;a=n.size+(r.value?t===Rt?-1:1:0)}else{if(t===Rt)return n;a=1,i=new FP(n.__ownerID,[[e,t]])}return n.__ownerID?(n.size=a,n._root=i,n.__hash=void 0,n.__altered=!0,n):i?sX(a,i):Eo()}function uX(n,e,t,i,a,r,s,o){return n?n.update(e,t,i,a,r,s,o):r===Rt?n:(Ta(o),Ta(s),new Go(e,i,[a,r]))}function Uee(n){return n.constructor===Go||n.constructor===Nu}function lX(n,e,t,i,a){if(n.keyHash===i)return new Nu(e,i,[n.entry,a]);var r=(t===0?n.keyHash:n.keyHash>>>t)&$n,s=(t===0?i:i>>>t)&$n,o,p=r===s?[lX(n,e,t+Mt,i,a)]:(o=new Go(e,i,a),r<s?[n,o]:[o,n]);return new Iy(e,1<<r|1<<s,p)}function aKe(n,e,t,i){n||(n=new WK);for(var a=new Go(n,Fn(t),[t,i]),r=0;r<e.length;r++){var s=e[r];a=a.update(n,0,void 0,s[0],s[1])}return a}function oKe(n,e,t,i){for(var a=0,r=0,s=new Array(t),o=0,p=1,u=e.length;o<u;o++,p<<=1){var f=e[o];f!==void 0&&o!==i&&(a|=p,s[r++]=f)}return new Iy(n,a,s)}function sKe(n,e,t,i,a){for(var r=0,s=new Array(la),o=0;t!==0;o++,t>>>=1)s[o]=t&1?e[r++]:void 0;return s[i]=a,new $P(n,r+1,s)}function hke(n){return n-=n>>1&1431655765,n=(n&858993459)+(n>>2&858993459),n=n+(n>>4)&252645135,n+=n>>8,n+=n>>16,n&127}function pke(n,e,t,i){var a=i?n:Ao(n);return a[e]=t,a}function uKe(n,e,t,i){var a=n.length+1;if(i&&e+1===a)return n[e]=t,n;for(var r=new Array(a),s=0,o=0;o<a;o++)o===e?(r[o]=t,s=-1):r[o]=n[o+s];return r}function lKe(n,e,t){var i=n.length-1;if(t&&e===i)return n.pop(),n;for(var a=new Array(i),r=0,s=0;s<i;s++)s===e&&(r=1),a[s]=n[s+r];return a}var cKe=la/4,fKe=la/2,dKe=la/4,hKe=16;function bke(n){if(UK(n)&&typeof n!="string")return n;if(Xa(n))return n.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+n)}function CP(n){try{return typeof n=="string"?JSON.stringify(n):String(n)}catch{return JSON.stringify(n)}}function _ke(n,e){return Na(n)?n.has(e):vu(n)&&Hy.call(n,e)}function cX(n,e,t){return Na(n)?n.get(e,t):_ke(n,e)?typeof n.get=="function"?n.get(e):n[e]:t}function yke(n,e){if(!vu(n))throw new TypeError("Cannot update non-data-structure value: "+n);if(Na(n)){if(!n.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+n);return n.remove(e)}if(!Hy.call(n,e))return n;var t=HF(n);return Array.isArray(t)?t.splice(e,1):delete t[e],t}function gke(n,e,t){if(tj(e))return n;if(!vu(n))throw new TypeError("Cannot update non-data-structure value: "+n);if(Na(n)){if(!n.set)throw new TypeError("Cannot update immutable value without .set() method: "+n);return n.set(e,t)}if(Hy.call(n,e)&&t===n[e])return n;var i=HF(n);return i[e]=t,i}function W_(n,e,t,i){i||(i=t,t=void 0);var a=wke(Na(n),n,bke(e),0,t,i);return a===Rt?t:a}function wke(n,e,t,i,a,r){var s=e===Rt;if(i===t.length){var o=s?a:e,p=r(o);return p===o?e:p}if(!s&&!vu(e))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(t).slice(0,i).map(CP)+"]: "+e);var u=t[i],f=s?Rt:cX(e,u,Rt),y=wke(f===Rt?n:Na(f),f,t,i+1,a,r);return y===f?e:y===Rt?yke(e,u):gke(s?n?Eo():{}:e,u,y)}function mke(n,e){return W_(n,e,function(){return Rt})}function fX(n){return mke(this,n)}var Ske="@@__IMMUTABLE_LIST__@@";function dX(n){return!!(n&&n[Ske])}var aj=(function(n){function e(t){var i=vF();if(t==null)return i;if(dX(t))return t;var a=n(t),r=a.size;return r===0?i:(ua(r),r>0&&r<la?qP(0,r,Mt,void 0,new Eu(a.toArray())):i.withMutations(function(s){s.setSize(r),a.forEach(function(o,p){return s.set(p,o)})}))}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("List [","]")},e.prototype.get=function(i,a){if(i=Tu(this,i),i>=0&&i<this.size){i+=this._origin;var r=Ake(this,i);return r&&r.array[i&$n]}return a},e.prototype.set=function(i,a){return pKe(this,i,a)},e.prototype.remove=function(i){return this.has(i)?i===0?this.shift():i===this.size-1?this.pop():this.splice(i,1):this},e.prototype.insert=function(i,a){return this.splice(i,0,a)},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=Mt,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):vF()},e.prototype.push=function(){var i=arguments,a=this.size;return this.withMutations(function(r){bu(r,0,a+i.length);for(var s=0;s<i.length;s++)r.set(a+s,i[s])})},e.prototype.pop=function(){return bu(this,0,-1)},e.prototype.unshift=function(){var i=arguments;return this.withMutations(function(a){bu(a,-i.length);for(var r=0;r<i.length;r++)a.set(r,i[r])})},e.prototype.shift=function(){return bu(this,1)},e.prototype.shuffle=function(i){return i===void 0&&(i=Math.random),this.withMutations(function(a){for(var r=a.size,s,o;r;)s=Math.floor(i()*r--),o=a.get(s),a.set(s,a.get(r)),a.set(r,o)})},e.prototype.concat=function(){for(var i=arguments,a=[],r=0;r<arguments.length;r++){var s=i[r],o=n(typeof s!="string"&&kK(s)?s:[s]);o.size!==0&&a.push(o)}return a.length===0?this:this.size===0&&!this.__ownerID&&a.length===1?this.constructor(a[0]):this.withMutations(function(p){a.forEach(function(u){return u.forEach(function(f){return p.push(f)})})})},e.prototype.setSize=function(i){return bu(this,0,i)},e.prototype.map=function(i,a){var r=this;return this.withMutations(function(s){for(var o=0;o<r.size;o++)s.set(o,i.call(a,s.get(o),o,r))})},e.prototype.slice=function(i,a){var r=this.size;return JP(i,a,r)?this:bu(this,Vy(i,r),YP(a,r))},e.prototype.__iterator=function(i,a){var r=a?this.size:0,s=Gee(this,a);return new vt(function(){var o=s();return o===OP?In():Ct(i,a?--r:r++,o)})},e.prototype.__iterate=function(i,a){for(var r=a?this.size:0,s=Gee(this,a),o;(o=s())!==OP&&i(o,a?--r:r++,this)!==!1;);return r},e.prototype.__ensureOwner=function(i){return i===this.__ownerID?this:i?qP(this._origin,this._capacity,this._level,this._root,this._tail,i,this.__hash):this.size===0?vF():(this.__ownerID=i,this.__altered=!1,this)},e})(B_);aj.isList=dX;var Br=aj.prototype;Br[Ske]=!0;Br[XP]=Br.remove;Br.merge=Br.concat;Br.setIn=nX;Br.deleteIn=Br.removeIn=fX;Br.update=iX;Br.updateIn=aX;Br.mergeIn=rX;Br.mergeDeepIn=tX;Br.withMutations=ij;Br.wasAltered=oX;Br.asImmutable=ZP;Br["@@transducer/init"]=Br.asMutable=ej;Br["@@transducer/step"]=function(n,e){return n.push(e)};Br["@@transducer/result"]=function(n){return n.asImmutable()};var Eu=function(e,t){this.array=e,this.ownerID=t};Eu.prototype.removeBefore=function(e,t,i){if((i&(1<<t+Mt)-1)===0||this.array.length===0)return this;var a=i>>>t&$n;if(a>=this.array.length)return new Eu([],e);var r=a===0,s;if(t>0){var o=this.array[a];if(s=o&&o.removeBefore(e,t-Mt,i),s===o&&r)return this}if(r&&!s)return this;var p=Oy(this,e);if(!r)for(var u=0;u<a;u++)p.array[u]=void 0;return s&&(p.array[a]=s),p};Eu.prototype.removeAfter=function(e,t,i){if(i===(t?1<<t+Mt:la)||this.array.length===0)return this;var a=i-1>>>t&$n;if(a>=this.array.length)return this;var r;if(t>0){var s=this.array[a];if(r=s&&s.removeAfter(e,t-Mt,i),r===s&&a===this.array.length-1)return this}var o=Oy(this,e);return o.array.splice(a+1),r&&(o.array[a]=r),o};var OP={};function Gee(n,e){var t=n._origin,i=n._capacity,a=BP(i),r=n._tail;return s(n._root,n._level,0);function s(u,f,y){return f===0?o(u,y):p(u,f,y)}function o(u,f){var y=f===a?r&&r.array:u&&u.array,E=f>t?0:t-f,A=i-f;return A>la&&(A=la),function(){if(E===A)return OP;var R=e?--A:E++;return y&&y[R]}}function p(u,f,y){var E,A=u&&u.array,R=y>t?0:t-y>>f,T=(i-y>>f)+1;return T>la&&(T=la),function(){for(;;){if(E){var d=E();if(d!==OP)return d;E=null}if(R===T)return OP;var N=e?--T:R++;E=s(A&&A[N],f-Mt,y+(N<<f))}}}}function qP(n,e,t,i,a,r,s){var o=Object.create(Br);return o.size=e-n,o._origin=n,o._capacity=e,o._level=t,o._root=i,o._tail=a,o.__ownerID=r,o.__hash=s,o.__altered=!1,o}function vF(){return qP(0,0,Mt)}function pKe(n,e,t){if(e=Tu(n,e),e!==e)return n;if(e>=n.size||e<0)return n.withMutations(function(s){e<0?bu(s,e).set(0,t):bu(s,0,e+1).set(e,t)});e+=n._origin;var i=n._tail,a=n._root,r=lK();return e>=BP(n._capacity)?i=pK(i,n.__ownerID,0,e,t,r):a=pK(a,n.__ownerID,n._level,e,t,r),r.value?n.__ownerID?(n._root=a,n._tail=i,n.__hash=void 0,n.__altered=!0,n):qP(n._origin,n._capacity,n._level,a,i):n}function pK(n,e,t,i,a,r){var s=i>>>t&$n,o=n&&s<n.array.length;if(!o&&a===void 0)return n;var p;if(t>0){var u=n&&n.array[s],f=pK(u,e,t-Mt,i,a,r);return f===u?n:(p=Oy(n,e),p.array[s]=f,p)}return o&&n.array[s]===a?n:(r&&Ta(r),p=Oy(n,e),a===void 0&&s===p.array.length-1?p.array.pop():p.array[s]=a,p)}function Oy(n,e){return e&&n&&e===n.ownerID?n:new Eu(n?n.array.slice():[],e)}function Ake(n,e){if(e>=BP(n._capacity))return n._tail;if(e<1<<n._level+Mt){for(var t=n._root,i=n._level;t&&i>0;)t=t.array[e>>>i&$n],i-=Mt;return t}}function bKe(n,e,t){var i=n._origin+(e===void 0?0:e),a=t===void 0?n._capacity:t<0?n._capacity+t:n._origin+t;if(Number.isFinite(a)&&a>lM||Number.isFinite(i)&&i<-lM||Number.isFinite(a)&&Number.isFinite(i)&&a-i>lM)throw new RangeError("Invalid List size: a List cannot hold more than "+lM+" (2 ** 30) values.")}function bu(n,e,t){bKe(n,e,t),e!==void 0&&(e|=0),t!==void 0&&(t|=0);var i=n.__ownerID||new WK,a=n._origin,r=n._capacity,s=a+e,o=t===void 0?r:t<0?r+t:a+t;if(s===a&&o===r)return n;if(s>=o)return n.clear();for(var p=n._level,u=n._root,f=0;s+f<0;)u=new Eu(u&&u.array.length?[void 0,u]:[],i),p+=Mt,f+=Qee(p);f&&(s+=f,a+=f,o+=f,r+=f);for(var y=BP(r),E=BP(o);E>=Qee(p+Mt);)u=new Eu(u&&u.array.length?[u]:[],i),p+=Mt;var A=n._tail,R=E<y?Ake(n,o-1):E>y?new Eu([],i):A;if(A&&E>y&&s<r&&A.array.length){u=Oy(u,i);for(var T=u,d=p;d>Mt;d-=Mt){var N=y>>>d&$n;T=T.array[N]=Oy(T.array[N],i)}T.array[y>>>Mt&$n]=A}if(o<r&&(R=R&&R.removeAfter(i,0,o)),s>=E)s-=E,o-=E,p=Mt,u=void 0,R=R&&R.removeBefore(i,0,s);else if(s>a||E<y){for(f=0;u;){var w=s>>>p&$n;if(w!==E>>>p&$n)break;w&&(f+=(1<<p)*w),p-=Mt,u=u.array[w]}u&&s>a&&(u=u.removeBefore(i,p,s-f)),u&&E<y&&(u=u.removeAfter(i,p,E-f)),f&&(s-=f,o-=f)}return n.__ownerID?(n.size=o-s,n._origin=s,n._capacity=o,n._level=p,n._root=u,n._tail=R,n.__hash=void 0,n.__altered=!0,n):qP(s,o,p,u,R)}function BP(n){return n<la?0:n-1>>>Mt<<Mt}var lM=Math.pow(2,30);function Qee(n){return n<31?1<<n:Math.pow(2,n)}function hX(n){return a$(n)&&Xa(n)}var To=(function(n){function e(t){return t==null?lP():hX(t)?t:lP().withMutations(function(i){var a=va(t);ua(a.size),a.forEach(function(r,s){return i.set(s,r)})})}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(i,a){var r=this._map.get(i);return r!==void 0?this._list.get(r)[1]:a},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):lP()},e.prototype.set=function(i,a){return Hee(this,i,a)},e.prototype.remove=function(i){return Hee(this,i,Rt)},e.prototype.__iterate=function(i,a){var r=this;return this._list.__iterate(function(s){return s&&i(s[1],s[0],r)},a)},e.prototype.__iterator=function(i,a){return this._list.fromEntrySeq().__iterator(i,a)},e.prototype.__ensureOwner=function(i){if(i===this.__ownerID)return this;var a=this._map.__ensureOwner(i),r=this._list.__ensureOwner(i);return i?pX(a,r,i,this.__hash):this.size===0?lP():(this.__ownerID=i,this.__altered=!1,this._map=a,this._list=r,this)},e})(k_);To.isOrderedMap=hX;To.prototype[Ru]=!0;To.prototype[XP]=To.prototype.remove;function pX(n,e,t,i){var a=Object.create(To.prototype);return a.size=n?n.size:0,a._map=n,a._list=e,a.__ownerID=t,a.__hash=i,a.__altered=!1,a}var Vee;function lP(){return Vee||(Vee=pX(Eo(),vF()))}function Hee(n,e,t){var i=n._map,a=n._list,r=i.get(e),s=r!==void 0,o,p;if(t===Rt){if(!s)return n;a.size>=la&&a.size>=i.size*2?(p=a.filter(function(u,f){return u!==void 0&&r!==f}),o=p.toKeyedSeq().map(function(u){return u[0]}).flip().toMap(),n.__ownerID&&(o.__ownerID=p.__ownerID=n.__ownerID)):(o=i.remove(e),p=r===a.size-1?a.pop():a.set(r,void 0))}else if(s){if(t===a.get(r)[1])return n;o=i,p=a.set(r,[e,t])}else o=i.set(e,a.size),p=a.set(a.size,[e,t]);return n.__ownerID?(n.size=o.size,n._map=o,n._list=p,n.__hash=void 0,n.__altered=!0,n):pX(o,p)}var Eke="@@__IMMUTABLE_STACK__@@";function zF(n){return!!(n&&n[Eke])}var o$=(function(n){function e(t){return t==null?cM():zF(t)?t:cM().pushAll(t)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(i,a){var r=this._head;for(i=Tu(this,i);r&&i--;)r=r.next;return r?r.value:a},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var i=arguments;if(arguments.length===0)return this;for(var a=this.size+arguments.length,r=this._head,s=arguments.length-1;s>=0;s--)r={value:i[s],next:r};return this.__ownerID?(this.size=a,this._head=r,this.__hash=void 0,this.__altered=!0,this):cP(a,r)},e.prototype.pushAll=function(i){if(i=n(i),i.size===0)return this;if(this.size===0&&zF(i))return i;ua(i.size);var a=this.size,r=this._head;return i.__iterate(function(s){a++,r={value:s,next:r}},!0),this.__ownerID?(this.size=a,this._head=r,this.__hash=void 0,this.__altered=!0,this):cP(a,r)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):cM()},e.prototype.slice=function(i,a){if(JP(i,a,this.size))return this;var r=Vy(i,this.size),s=YP(a,this.size);if(s!==this.size)return n.prototype.slice.call(this,i,a);for(var o=this.size-r,p=this._head;r--;)p=p.next;return this.__ownerID?(this.size=o,this._head=p,this.__hash=void 0,this.__altered=!0,this):cP(o,p)},e.prototype.__ensureOwner=function(i){return i===this.__ownerID?this:i?cP(this.size,this._head,i,this.__hash):this.size===0?cM():(this.__ownerID=i,this.__altered=!1,this)},e.prototype.__iterate=function(i,a){var r=this;if(a)return new vy(this.toArray()).__iterate(function(p,u){return i(p,u,r)},a);for(var s=0,o=this._head;o&&i(o.value,s++,this)!==!1;)o=o.next;return s},e.prototype.__iterator=function(i,a){if(a)return new vy(this.toArray()).__iterator(i,a);var r=0,s=this._head;return new vt(function(){if(s){var o=s.value;return s=s.next,Ct(i,r++,o)}return In()})},e})(B_);o$.isStack=zF;var Cn=o$.prototype;Cn[Eke]=!0;Cn.shift=Cn.pop;Cn.unshift=Cn.push;Cn.unshiftAll=Cn.pushAll;Cn.withMutations=ij;Cn.wasAltered=oX;Cn.asImmutable=ZP;Cn["@@transducer/init"]=Cn.asMutable=ej;Cn["@@transducer/step"]=function(n,e){return n.unshift(e)};Cn["@@transducer/result"]=function(n){return n.asImmutable()};function cP(n,e,t,i){var a=Object.create(Cn);return a.size=n,a._head=e,a.__ownerID=t,a.__hash=i,a.__altered=!1,a}var zee;function cM(){return zee||(zee=cP(0))}function Kee(n,e,t,i,a,r){return ua(n.size),n.__iterate(function(s,o,p){a?(a=!1,t=s):t=e.call(i,t,s,o,p)},r),t}function _Ke(n,e){return e}function yKe(n,e){return[e,n]}function Z3(n){return function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return!n.apply(this,e)}}function Xee(n){return function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return-n.apply(this,e)}}function Jee(n,e){return n<e?1:n>e?-1:0}function bX(n,e){if(n===e)return!0;if(!na(e)||n.size!==void 0&&e.size!==void 0&&n.size!==e.size||n.__hash!==void 0&&e.__hash!==void 0&&n.__hash!==e.__hash||Lt(n)!==Lt(e)||ra(n)!==ra(e)||Xa(n)!==Xa(e))return!1;if(n.size===0&&e.size===0)return!0;var t=!ZF(n);if(Xa(n)){var i=n.entries();return e.every(function(p,u){var f=i.next().value;return f&&Gr(f[1],p)&&(t||Gr(f[0],u))})&&i.next().done}var a=!1;if(n.size===void 0)if(e.size===void 0)typeof n.cacheResult=="function"&&n.cacheResult();else{a=!0;var r=n;n=e,e=r}var s=!0,o=e.__iterate(function(p,u){if(t?!n.has(p):a?!Gr(p,n.get(u,Rt)):!Gr(n.get(u,Rt),p))return s=!1,!1});return s&&n.size===o}var Tke=(function(n){function e(t,i,a){if(a===void 0&&(a=1),!(this instanceof e))return new e(t,i,a);if(IP(a!==0,"Cannot step a Range by 0"),IP(t!==void 0,"You must define a start value when using Range"),IP(i!==void 0,"You must define an end value when using Range"),a=Math.abs(a),i<t&&(a=-a),this._start=t,this._end=i,this._step=a,this.size=Math.max(0,Math.ceil((i-t)/a-1)+1),this.size===0){if(eC)return eC;eC=this}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.size===0?"Range []":"Range [ "+this._start+"..."+this._end+(this._step!==1?" by "+this._step:"")+" ]"},e.prototype.get=function(i,a){return this.has(i)?this._start+Tu(this,i)*this._step:a},e.prototype.includes=function(i){var a=(i-this._start)/this._step;return a>=0&&a<this.size&&a===Math.floor(a)},e.prototype.slice=function(i,a){return JP(i,a,this.size)?this:(i=Vy(i,this.size),a=YP(a,this.size),a<=i?new e(0,0):new e(this.get(i,this._end),this.get(a,this._end),this._step))},e.prototype.indexOf=function(i){var a=i-this._start;if(a%this._step===0){var r=a/this._step;if(r>=0&&r<this.size)return r}return-1},e.prototype.lastIndexOf=function(i){return this.indexOf(i)},e.prototype.__iterate=function(i,a){for(var r=this.size,s=this._step,o=a?this._start+(r-1)*s:this._start,p=0;p!==r&&i(o,a?r-++p:p++,this)!==!1;)o+=a?-s:s;return p},e.prototype.__iterator=function(i,a){var r=this.size,s=this._step,o=a?this._start+(r-1)*s:this._start,p=0;return new vt(function(){if(p===r)return In();var u=o;return o+=a?-s:s,Ct(i,a?r-++p:p++,u)})},e.prototype.equals=function(i){return i instanceof e?this._start===i._start&&this._end===i._end&&this._step===i._step:bX(this,i)},e})(Ia),eC,Rke="@@__IMMUTABLE_SET__@@";function s$(n){return!!(n&&n[Rke])}var oj=(function(n){function e(t){return t==null?fP():s$(t)&&!Xa(t)?t:fP().withMutations(function(i){var a=n(t);ua(a.size),a.forEach(function(r){return i.add(r)})})}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(i){return this(va(i).keySeq())},e.intersect=function(i){return i=Qr(i).toArray(),i.length?Tn.intersect.apply(e(i.pop()),i):fP()},e.union=function(i){return i=Qr(i).toArray(),i.length?Tn.union.apply(e(i.pop()),i):fP()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(i){return this._map.has(i)},e.prototype.add=function(i){return fM(this,this._map.set(i,i))},e.prototype.remove=function(i){return fM(this,this._map.remove(i))},e.prototype.clear=function(){return fM(this,this._map.clear())},e.prototype.map=function(i,a){var r=this,s=!1,o=fM(this,this._map.mapEntries(function(p){var u=p[1],f=i.call(a,u,u,r);return f!==u&&(s=!0),[f,f]},a));return s?o:this},e.prototype.union=function(){for(var i=[],a=arguments.length;a--;)i[a]=arguments[a];return i=i.filter(function(r){return r.size!==0}),i.length===0?this:this.size===0&&!this.__ownerID&&i.length===1?this.constructor(i[0]):this.withMutations(function(r){for(var s=0;s<i.length;s++)typeof i[s]=="string"?r.add(i[s]):n(i[s]).forEach(function(o){return r.add(o)})})},e.prototype.intersect=function(){for(var i=[],a=arguments.length;a--;)i[a]=arguments[a];if(i.length===0)return this;i=i.map(function(s){return n(s)});var r=[];return this.forEach(function(s){i.every(function(o){return o.includes(s)})||r.push(s)}),this.withMutations(function(s){r.forEach(function(o){s.remove(o)})})},e.prototype.subtract=function(){for(var i=[],a=arguments.length;a--;)i[a]=arguments[a];if(i.length===0)return this;i=i.map(function(s){return n(s)});var r=[];return this.forEach(function(s){i.some(function(o){return o.includes(s)})&&r.push(s)}),this.withMutations(function(s){r.forEach(function(o){s.remove(o)})})},e.prototype.sort=function(i){return Dy(Ny(this,i))},e.prototype.sortBy=function(i,a){return Dy(Ny(this,a,i))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(i,a){var r=this;return this._map.__iterate(function(s){return i(s,s,r)},a)},e.prototype.__iterator=function(i,a){return this._map.__iterator(i,a)},e.prototype.__ensureOwner=function(i){if(i===this.__ownerID)return this;var a=this._map.__ensureOwner(i);return i?this.__make(a,i):this.size===0?this.__empty():(this.__ownerID=i,this._map=a,this)},e})(Gy);oj.isSet=s$;var Tn=oj.prototype;Tn[Rke]=!0;Tn[XP]=Tn.remove;Tn.merge=Tn.concat=Tn.union;Tn.withMutations=ij;Tn.asImmutable=ZP;Tn["@@transducer/init"]=Tn.asMutable=ej;Tn["@@transducer/step"]=function(n,e){return n.add(e)};Tn["@@transducer/result"]=function(n){return n.asImmutable()};Tn.__empty=fP;Tn.__make=vke;function fM(n,e){return n.__ownerID?(n.size=e.size,n._map=e,n):e===n._map?n:e.size===0?n.__empty():n.__make(e)}function vke(n,e){var t=Object.create(Tn);return t.size=n?n.size:0,t._map=n,t.__ownerID=e,t}var Yee;function fP(){return Yee||(Yee=vke(Eo()))}function _X(n,e,t){for(var i=bke(e),a=0;a!==i.length;)if(n=cX(n,i[a++],Rt),n===Rt)return t;return n}function Nke(n,e){return _X(this,n,e)}function Ike(n,e){return _X(n,e,Rt)!==Rt}function gKe(n){return Ike(this,n)}function Oke(){ua(this.size);var n={};return this.__iterate(function(e,t){tj(t)||(n[t]=e)}),n}function KF(n){if(!n||typeof n!="object")return n;if(!na(n)){if(!vu(n))return n;n=On(n)}if(Lt(n)){var e={};return n.__iterate(function(i,a){tj(a)||(e[a]=KF(i))}),e}var t=[];return n.__iterate(function(i){t.push(KF(i))}),t}function wKe(n){if(n.size===1/0)return 0;var e=Xa(n),t=Lt(n),i=e?1:0;return n.__iterate(t?e?function(a,r){i=31*i+Zee(Fn(a),Fn(r))|0}:function(a,r){i=i+Zee(Fn(a),Fn(r))|0}:e?function(a){i=31*i+Fn(a)|0}:function(a){i=i+Fn(a)|0}),mKe(n.size,i)}function mKe(n,e){return e=Zg(e,3432918353),e=Zg(e<<15|e>>>-15,461845907),e=Zg(e<<13|e>>>-13,5),e=(e+3864292196|0)^n,e=Zg(e^e>>>16,2246822507),e=Zg(e^e>>>13,3266489909),e=n$(e^e>>>16),e}function Zee(n,e){return n^e+2654435769+(n<<6)+(n>>2)|0}function U_(n,e){var t=function(i){n.prototype[i]=e[i]};return Object.keys(e).forEach(t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(t),n}Qr.Iterator=vt;U_(Qr,{toArray:function(){ua(this.size);var e=new Array(this.size||0),t=Lt(this),i=0;return this.__iterate(function(a,r){e[i++]=t?[r,a]:a}),e},toIndexedSeq:function(){return new JBe(this)},toJS:function(){return KF(this)},toKeyedSeq:function(){return new i$(this,!0)},toMap:function(){return k_(this.toKeyedSeq())},toObject:Oke,toOrderedMap:function(){return To(this.toKeyedSeq())},toOrderedSet:function(){return Dy(Lt(this)?this.valueSeq():this)},toSet:function(){return oj(Lt(this)?this.valueSeq():this)},toSetSeq:function(){return new YBe(this)},toSeq:function(){return ra(this)?this.toIndexedSeq():Lt(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return o$(Lt(this)?this.valueSeq():this)},toList:function(){return aj(Lt(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(e,t){return this.size===0?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return jt(this,zze(this,e))},includes:function(e){return this.some(function(t){return Gr(t,e)})},entries:function(){return this.__iterator(da)},every:function(e,t){ua(this.size);var i=!0;return this.__iterate(function(a,r,s){if(!e.call(t,a,r,s))return i=!1,!1}),i},filter:function(e,t){return jt(this,rke(this,e,t,!0))},partition:function(e,t){return Qze(this,e,t)},find:function(e,t,i){var a=this.findEntry(e,t);return a?a[1]:i},forEach:function(e,t){return ua(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ua(this.size),e=e!==void 0?""+e:",";var t="",i=!0;return this.__iterate(function(a){i?i=!1:t+=e,t+=a!=null?a.toString():""}),t},keys:function(){return this.__iterator(Qy)},map:function(e,t){return jt(this,tke(this,e,t))},reduce:function(e,t,i){return Kee(this,e,t,i,arguments.length<2,!1)},reduceRight:function(e,t,i){return Kee(this,e,t,i,arguments.length<2,!0)},reverse:function(){return jt(this,KK(this,!0))},slice:function(e,t){return jt(this,XK(this,e,t,!0))},some:function(e,t){ua(this.size);var i=!1;return this.__iterate(function(a,r,s){if(e.call(t,a,r,s))return i=!0,!1}),i},sort:function(e){return jt(this,Ny(this,e))},values:function(){return this.__iterator(fa)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return this.size!==void 0?this.size===0:!this.some(function(){return!0})},count:function(e,t){return Ry(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return Uze(this,e,t)},equals:function(e){return bX(this,e)},entrySeq:function(){var e=this;if(e._cache)return new vy(e._cache);var t=e.toSeq().map(yKe).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Z3(e),t)},findEntry:function(e,t,i){var a=i;return this.__iterate(function(r,s,o){if(e.call(t,r,s,o))return a=[s,r],!1}),a},findKey:function(e,t){var i=this.findEntry(e,t);return i&&i[0]},findLast:function(e,t,i){return this.toKeyedSeq().reverse().find(e,t,i)},findLastEntry:function(e,t,i){return this.toKeyedSeq().reverse().findEntry(e,t,i)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(e){return this.find(GBe,null,e)},flatMap:function(e,t){return jt(this,Kze(this,e,t))},flatten:function(e){return jt(this,ike(this,e,!0))},fromEntrySeq:function(){return new ZBe(this)},get:function(e,t){return this.find(function(i,a){return Gr(a,e)},void 0,t)},getIn:Nke,groupBy:function(e,t){return Gze(this,e,t)},has:function(e){return this.get(e,Rt)!==Rt},hasIn:gKe,isSubset:function(e){return e=typeof e.includes=="function"?e:Qr(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e=typeof e.isSubset=="function"?e:Qr(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return Gr(t,e)})},keySeq:function(){return this.toSeq().map(_Ke).toIndexedSeq()},last:function(e){return this.toSeq().reverse().first(e)},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return sM(this,e)},maxBy:function(e,t){return sM(this,t,e)},min:function(e){return sM(this,e?Xee(e):Jee)},minBy:function(e,t){return sM(this,t?Xee(t):Jee,e)},rest:function(){return this.slice(1)},skip:function(e){return e===0?this:this.slice(Math.max(0,e))},skipLast:function(e){return e===0?this:this.slice(0,-Math.max(0,e))},skipWhile:function(e,t){return jt(this,nke(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Z3(e),t)},sortBy:function(e,t){return jt(this,Ny(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return this.slice(-Math.max(0,e))},takeWhile:function(e,t){return jt(this,Vze(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Z3(e),t)},update:function(e){return e(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=wKe(this))}});var xn=Qr.prototype;xn[WBe]=!0;xn[e$]=xn.values;xn.toJSON=xn.toArray;xn.__toStringMapper=CP;xn.inspect=xn.toSource=function(){return this.toString()};xn.chain=xn.flatMap;xn.contains=xn.includes;U_(va,{flip:function(){return jt(this,eke(this))},mapEntries:function(e,t){var i=this,a=0;return jt(this,this.toSeq().map(function(r,s){return e.call(t,[s,r],a++,i)}).fromEntrySeq())},mapKeys:function(e,t){var i=this;return jt(this,this.toSeq().flip().map(function(a,r){return e.call(t,a,r,i)}).flip())}});var sj=va.prototype;sj[VF]=!0;sj[e$]=xn.entries;sj.toJSON=Oke;sj.__toStringMapper=function(n,e){return CP(e)+": "+CP(n)};U_(B_,{toKeyedSeq:function(){return new i$(this,!1)},filter:function(e,t){return jt(this,rke(this,e,t,!1))},findIndex:function(e,t){var i=this.findEntry(e,t);return i?i[0]:-1},indexOf:function(e){var t=this.keyOf(e);return t===void 0?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return t===void 0?-1:t},reverse:function(){return jt(this,KK(this,!1))},slice:function(e,t){return jt(this,XK(this,e,t,!1))},splice:function(e,t){var i=arguments.length;if(t=Math.max(t||0,0),i===0||i===2&&!t)return this;e=Vy(e,e<0?this.count():this.size);var a=this.slice(0,e);return jt(this,i===1?a:a.concat(Ao(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var i=this.findLastEntry(e,t);return i?i[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return jt(this,ike(this,e,!1))},get:function(e,t){return e=Tu(this,e),e<0||this.size===1/0||this.size!==void 0&&e>this.size?t:this.find(function(i,a){return a===e},void 0,t)},has:function(e){return e=Tu(this,e),e>=0&&(this.size!==void 0?this.size===1/0||e<this.size:this.find(function(t,i){return i===e},void 0,Rt)!==Rt)},interpose:function(e){return jt(this,Xze(this,e))},interleave:function(){var e=[this].concat(Ao(arguments)),t=uM(this.toSeq(),Ia.of,e),i=t.flatten(!0);return t.size&&(i.size=t.size*e.length),jt(this,i)},keySeq:function(){return Tke(0,this.size)},last:function(e){return this.get(-1,e)},skipWhile:function(e,t){return jt(this,nke(this,e,t,!1))},zip:function(){var e=[this].concat(Ao(arguments));return jt(this,uM(this,ete,e))},zipAll:function(){var e=[this].concat(Ao(arguments));return jt(this,uM(this,ete,e,!0))},zipWith:function(e){var t=Ao(arguments);return t[0]=this,jt(this,uM(this,e,t))}});var Ky=B_.prototype;Ky[QF]=!0;Ky[Ru]=!0;U_(Gy,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}});var xy=Gy.prototype;xy.has=xn.includes;xy.contains=xy.includes;xy.keys=xy.values;U_(xu,sj);U_(Ia,Ky);U_(zy,xy);function ete(){return Ao(arguments)}function yX(n){return s$(n)&&Xa(n)}var Dy=(function(n){function e(t){return t==null?bK():yX(t)?t:bK().withMutations(function(i){var a=Gy(t);ua(a.size),a.forEach(function(r){return i.add(r)})})}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(i){return this(va(i).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e})(oj);Dy.isOrderedSet=yX;var G_=Dy.prototype;G_[Ru]=!0;G_.zip=Ky.zip;G_.zipWith=Ky.zipWith;G_.zipAll=Ky.zipAll;G_.__empty=bK;G_.__make=xke;function xke(n,e){var t=Object.create(G_);return t.size=n?n.size:0,t._map=n,t.__ownerID=e,t}var tte;function bK(){return tte||(tte=xke(lP()))}var SKe={LeftThenRight:-1,RightThenLeft:1};function AKe(n){if(Ou(n))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Na(n))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(n===null||typeof n!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var Ur=function(e,t){var i;AKe(e);var a=function(o){var p=this;if(o instanceof a)return o;if(!(this instanceof a))return new a(o);if(!i){i=!0;var u=Object.keys(e),f=r._indices={};r._name=t,r._keys=u,r._defaultValues=e;for(var y=0;y<u.length;y++){var E=u[y];f[E]=y,r[E]?typeof console=="object"&&console.warn&&console.warn("Cannot define "+wX(this)+' with property "'+E+'" since that property name is part of the Record API.'):EKe(r,E)}}return this.__ownerID=void 0,this._values=aj().withMutations(function(A){A.setSize(p._keys.length),va(o).forEach(function(R,T){A.set(p._indices[T],R===p._defaultValues[T]?void 0:R)})}),this},r=a.prototype=Object.create(Ft);return r.constructor=a,t&&(a.displayName=t),a};Ur.prototype.toString=function(){for(var e=wX(this)+" { ",t=this._keys,i,a=0,r=t.length;a!==r;a++)i=t[a],e+=(a?", ":"")+i+": "+CP(this.get(i));return e+" }"};Ur.prototype.equals=function(e){return this===e||Ou(e)&&Py(this).equals(Py(e))};Ur.prototype.hashCode=function(){return Py(this).hashCode()};Ur.prototype.has=function(e){return this._indices.hasOwnProperty(e)};Ur.prototype.get=function(e,t){if(!this.has(e))return t;var i=this._indices[e],a=this._values.get(i);return a===void 0?this._defaultValues[e]:a};Ur.prototype.set=function(e,t){if(this.has(e)){var i=this._values.set(this._indices[e],t===this._defaultValues[e]?void 0:t);if(i!==this._values&&!this.__ownerID)return gX(this,i)}return this};Ur.prototype.remove=function(e){return this.set(e)};Ur.prototype.clear=function(){var e=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:gX(this,e)};Ur.prototype.wasAltered=function(){return this._values.wasAltered()};Ur.prototype.toSeq=function(){return Py(this)};Ur.prototype.toJS=function(){return KF(this)};Ur.prototype.entries=function(){return this.__iterator(da)};Ur.prototype.__iterator=function(e,t){return Py(this).__iterator(e,t)};Ur.prototype.__iterate=function(e,t){return Py(this).__iterate(e,t)};Ur.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._values.__ensureOwner(e);return e?gX(this,t,e):(this.__ownerID=e,this._values=t,this)};Ur.isRecord=Ou;Ur.getDescriptiveName=wX;var Ft=Ur.prototype;Ft[HBe]=!0;Ft[XP]=Ft.remove;Ft.deleteIn=Ft.removeIn=fX;Ft.getIn=Nke;Ft.hasIn=xn.hasIn;Ft.merge=oke;Ft.mergeWith=ske;Ft.mergeIn=rX;Ft.mergeDeep=lke;Ft.mergeDeepWith=cke;Ft.mergeDeepIn=tX;Ft.setIn=nX;Ft.update=iX;Ft.updateIn=aX;Ft.withMutations=ij;Ft.asMutable=ej;Ft.asImmutable=ZP;Ft[e$]=Ft.entries;Ft.toJSON=Ft.toObject=xn.toObject;Ft.inspect=Ft.toSource=function(){return this.toString()};function gX(n,e,t){var i=Object.create(Object.getPrototypeOf(n));return i._values=e,i.__ownerID=t,i}function wX(n){return n.constructor.displayName||n.constructor.name||"Record"}function Py(n){return VK(n._keys.map(function(e){return[e,n.get(e)]}))}function EKe(n,e){try{Object.defineProperty(n,e,{get:function(){return this.get(e)},set:function(t){IP(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch{}}var TKe=(function(n){function e(t,i){if(!(this instanceof e))return new e(t,i);if(this._value=t,this.size=i===void 0?1/0:Math.max(0,i),this.size===0){if(tC)return tC;tC=this}}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.size===0?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},e.prototype.get=function(i,a){return this.has(i)?this._value:a},e.prototype.includes=function(i){return Gr(this._value,i)},e.prototype.slice=function(i,a){var r=this.size;return JP(i,a,r)?this:new e(this._value,YP(a,r)-Vy(i,r))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(i){return this.size!==0&&Gr(this._value,i)?0:-1},e.prototype.lastIndexOf=function(i){return this.size!==0&&Gr(this._value,i)?this.size-1:-1},e.prototype.__iterate=function(i,a){for(var r=this.size,s=0;s!==r&&i(this._value,a?r-++s:s++,this)!==!1;);return s},e.prototype.__iterator=function(i,a){var r=this,s=this.size,o=0;return new vt(function(){return o===s?In():Ct(i,a?s-++o:o++,r._value)})},e.prototype.equals=function(i){return i instanceof e?Gr(this._value,i._value):bX(this,i)},e})(Ia),tC;function RKe(n,e){return Dke([],e||vKe,n,"",e&&e.length>2?[]:void 0,{"":n})}function Dke(n,e,t,i,a,r){if(typeof t!="string"&&!Na(t)&&(UK(t)||kK(t)||eX(t))){if(~n.indexOf(t))throw new TypeError("Cannot convert circular structure to Immutable");n.push(t),a&&i!==""&&a.push(i);var s=e.call(r,i,On(t).map(function(o,p){return Dke(n,e,o,p,a,t)}),a&&a.slice());return n.pop(),a&&a.pop(),s}return t}function vKe(n,e){return ra(e)?e.toList():Lt(e)?e.toMap():e.toSet()}var NKe="5.1.9",IKe=Qr;const OKe=Object.freeze(Object.defineProperty({__proto__:null,Collection:Qr,Iterable:IKe,List:aj,Map:k_,OrderedMap:To,OrderedSet:Dy,PairSorting:SKe,Range:Tke,Record:Ur,Repeat:TKe,Seq:On,Set:oj,Stack:o$,fromJS:RKe,get:cX,getIn:_X,has:_ke,hasIn:Ike,hash:Fn,is:Gr,isAssociative:ZF,isCollection:na,isImmutable:Na,isIndexed:ra,isKeyed:Lt,isList:dX,isMap:a$,isOrdered:Xa,isOrderedMap:hX,isOrderedSet:yX,isPlainObject:eX,isRecord:Ou,isSeq:r$,isSet:s$,isStack:zF,isValueObject:hK,merge:Yze,mergeDeep:eKe,mergeDeepWith:tKe,mergeWith:Zze,remove:yke,removeIn:mke,set:gke,setIn:fke,update:ZK,updateIn:W_,version:NKe},Symbol.toStringTag,{value:"Module"})),mX=Rs(OKe);var rte;function Pke(){if(rte)return Rl;rte=1,Object.defineProperty(Rl,"__esModule",{value:!0}),Rl.ActionContextKey=Rl.ActionContext=void 0;const n=mX;let e=class dP{constructor(a={}){this.map=(0,n.Map)(a)}setDefault(a,r){return this.has(a)?this:this.set(a,r)}set(a,r){return this.setRaw(a.name,r)}setRaw(a,r){return new dP(this.map.set(a,r))}delete(a){return new dP(this.map.delete(a.name))}get(a){return this.getRaw(a.name)}getRaw(a){return this.map.get(a)}getSafe(a){if(!this.has(a))throw new Error(`Context entry ${a.name} is required but not available`);return this.get(a)}has(a){return this.hasRaw(a.name)}hasRaw(a){return this.map.has(a)}merge(...a){let r=this;for(const s of a)for(const o of s.keys())r=r.set(o,s.get(o));return r}keys(){return[...this.map.keys()].map(a=>new t(a))}toJS(){return this.map.toJS()}toString(){return`ActionContext(${JSON.stringify(this.map.toJS())})`}[Symbol.for("nodejs.util.inspect.custom")](){return`ActionContext(${JSON.stringify(this.map.toJS(),null," ")})`}static ensureActionContext(a){return a instanceof dP?a:new dP((0,n.Map)(a??{}))}};Rl.ActionContext=e;class t{constructor(a){this.name=a}}return Rl.ActionContextKey=t,Rl}var e0={},nte;function jke(){if(nte)return e0;nte=1,Object.defineProperty(e0,"__esModule",{value:!0}),e0.Bus=void 0;let n=class{constructor(t){this.actors=[],this.observers=[],this.dependencyLinks=new Map,Object.assign(this,t),this.failMessage=`All actors over bus ${this.name} failed to handle an action`}subscribe(t){this.actors.push(t),this.reorderForDependencies()}subscribeObserver(t){this.observers.push(t)}unsubscribe(t){const i=this.actors.indexOf(t);return i>=0?(this.actors.splice(i,1),!0):!1}unsubscribeObserver(t){const i=this.observers.indexOf(t);return i>=0?(this.observers.splice(i,1),!0):!1}publish(t){return this.actors.map(i=>({actor:i,reply:i.test(t)}))}onRun(t,i,a){for(const r of this.observers)r.onRun(t,i,a)}addDependencies(t,i){for(const a of i){let r=this.dependencyLinks.get(a);r||(r=[],this.dependencyLinks.set(a,r)),r.push(t)}this.reorderForDependencies()}reorderForDependencies(){if(this.dependencyLinks.size>0){const t=[];for(const i of this.dependencyLinks.keys()){const a=this.actors.indexOf(i);a>=0&&(this.actors.splice(a,1),t.push(i))}for(;t.length>0;){let i=-1;for(let r=0;r<t.length;r++){let s=!0;for(const o of this.dependencyLinks.get(t[r]))if(!this.actors.includes(o)&&t.includes(o)){s=!1;break}if(s){i=r;break}}if(i<0)throw new Error(`Cyclic dependency links detected in bus ${this.name}`);const a=t.splice(i,1)[0];this.actors.push(a)}}}};return e0.Bus=n,e0}var t0={},ite;function xKe(){if(ite)return t0;ite=1,Object.defineProperty(t0,"__esModule",{value:!0}),t0.BusIndexed=void 0;const n=jke();let e=class extends n.Bus{constructor(i){super(i),this.actorsIndex={}}subscribe(i){const a=this.getActorIdentifiers(i)??["_undefined_"];for(const r of a){let s=this.actorsIndex[r];s||(s=this.actorsIndex[r]=[]),s.push(i),super.subscribe(i)}}unsubscribe(i){const a=this.getActorIdentifiers(i)??["_undefined_"];let r=!1;for(const s of a){const o=this.actorsIndex[s];if(o){const p=o.indexOf(i);p>=0&&o.splice(p,1),o.length===0&&delete this.actorsIndex[s]}r=r||super.unsubscribe(i)}return r}publish(i){const a=this.getActionIdentifier(i);return a?[...this.actorsIndex[a]||[],...this.actorsIndex._undefined_||[]].map(s=>({actor:s,reply:s.test(i)})):super.publish(i)}getActorIdentifiers(i){const a=this.actorIdentifierFields.reduce((r,s)=>r[s],i);if(a)return Array.isArray(a)?a:[a]}getActionIdentifier(i){return this.actionIdentifierFields.reduce((a,r)=>a[r],i)}};return t0.BusIndexed=e,t0}var r0={},ate;function Mke(){if(ate)return r0;ate=1,Object.defineProperty(r0,"__esModule",{value:!0}),r0.CONTEXT_KEY_LOGGER=void 0;const n=Pke();return r0.CONTEXT_KEY_LOGGER=new n.ActionContextKey("@comunica/core:log"),r0}var n0={},ote;function DKe(){if(ote)return n0;ote=1,Object.defineProperty(n0,"__esModule",{value:!0}),n0.ActionObserver=void 0;let n=class{constructor(t){Object.assign(this,t)}};return n0.ActionObserver=n,n0}var i0={},ste;function PKe(){if(ste)return i0;ste=1,Object.defineProperty(i0,"__esModule",{value:!0}),i0.Actor=void 0;const n=Mke();let e=class y_{constructor(i){this.beforeActors=[],Object.assign(this,i),this.bus.subscribe(this),this.beforeActors.length>0&&this.bus.addDependencies(this,this.beforeActors),i.busFailMessage&&(this.bus.failMessage=i.busFailMessage)}static getContextLogger(i){return i.get(n.CONTEXT_KEY_LOGGER)}runObservable(i,a){const r=this.run(i,a);return this.bus.onRun(this,i,r),r}getDefaultLogData(i,a){const r=a?a():{};return r.actor=this.name,r}logTrace(i,a,r){const s=y_.getContextLogger(i);s&&s.trace(a,this.getDefaultLogData(i,r))}logDebug(i,a,r){const s=y_.getContextLogger(i);s&&s.debug(a,this.getDefaultLogData(i,r))}logInfo(i,a,r){const s=y_.getContextLogger(i);s&&s.info(a,this.getDefaultLogData(i,r))}logWarn(i,a,r){const s=y_.getContextLogger(i);s&&s.warn(a,this.getDefaultLogData(i,r))}logError(i,a,r){const s=y_.getContextLogger(i);s&&s.error(a,this.getDefaultLogData(i,r))}logFatal(i,a,r){const s=y_.getContextLogger(i);s&&s.fatal(a,this.getDefaultLogData(i,r))}};return i0.Actor=e,i0}var a0={},ute;function jKe(){if(ute)return a0;ute=1,Object.defineProperty(a0,"__esModule",{value:!0}),a0.Mediator=void 0;let n=class _K{constructor(t){Object.assign(this,t)}publish(t){const i=this.bus.publish(t);if(i.length===0)throw new Error(`No actors are able to reply to a message in the bus ${this.bus.name}`);return i}async mediateActor(t){return await this.mediateWith(t,this.publish(t))}async mediateTestable(t){return(await this.mediateActor(t)).mapAsync((a,r)=>a.runObservable(t,r))}async mediate(t){return(await this.mediateTestable(t)).getOrThrow()}constructFailureMessage(t,i){const a=`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./global-
|
|
1
|
+
import{c}from"./global-DMtP8ZF4.js";const e=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],a=c("key-round",e);export{a as K};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t}from"./global-
|
|
1
|
+
import{c as t}from"./global-DMtP8ZF4.js";const c=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],o=t("rotate-ccw",c);export{o as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as r,m as t,j as e,r as o,X as s,n as i}from"./global-DMtP8ZF4.js";r();t.createRoot(document.getElementById("root")).render(e.jsx(o.StrictMode,{children:e.jsx(s,{children:e.jsx(i,{})})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,f as n}from"./global-
|
|
1
|
+
import{j as t,f as n}from"./global-DMtP8ZF4.js";function m({className:e,...s}){return t.jsx("div",{className:n("animate-pulse rounded-md bg-muted/50",e),...s})}export{m as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c}from"./global-
|
|
1
|
+
import{c}from"./global-DMtP8ZF4.js";const e=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],r=c("network",e);const t=[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]],h=c("waypoints",t);export{r as N,h as W};
|
package/static/settings/assets/{workspace-layout-K38jT4OV.js → workspace-layout-BSMCQq35.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as s,f as w}from"./global-
|
|
1
|
+
import{r as t,j as s,f as w}from"./global-DMtP8ZF4.js";const y=t.createContext(null);function P(){const e=t.useContext(y);if(!e)throw new Error("useWorkspaceLayout must be used inside TwoPaneLayout");return e}const g="(max-width: 767px)",v={gridTemplateColumns:"210px minmax(0, 1fr)"};function j(e){return e==="context"?"main":e}function C(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};const a=window.matchMedia(g);return a.addEventListener("change",e),()=>a.removeEventListener("change",e)}function R(){return typeof window>"u"||typeof window.matchMedia!="function"?"split":window.matchMedia(g).matches?"stack":"split"}function L(){return"split"}function M(e){const a=t.useSyncExternalStore(C,R,L);return e==="auto"?a:e}function N({resolvedMode:e,history:a,resolvePane:l}){const[f,m]=t.useState("list"),c=t.useRef(null),b=t.useRef(null),i=t.useRef(null),r=t.useRef(null),u=t.useMemo(()=>({list:b,main:i,context:r}),[]),o=t.useCallback((n,h={})=>{const d=l?.(n)??n;m(d),e==="stack"&&(c.current=d,h.fromHistory||a?.push(d))},[a,l,e]),p=t.useCallback(()=>o("list"),[o]),x=t.useCallback(()=>o("main"),[o]),k=t.useCallback(()=>o("context"),[o]);return t.useLayoutEffect(()=>{if(e!=="stack"){c.current=null;return}const n=c.current;n&&(c.current=null,u[n].current?.focus())},[f,u,e]),t.useLayoutEffect(()=>{if(!(e!=="stack"||!a))return a.subscribe(n=>{o(n,{fromHistory:!0})})},[a,o,e]),{activePane:f,paneRefs:u,openList:p,openMain:x,openContext:k}}function S({listHeader:e,list:a,mainHeader:l,main:f,mode:m="auto",history:c,className:b}){const i=M(m),{activePane:r,paneRefs:u,openList:o,openMain:p,openContext:x}=N({resolvedMode:i,history:c,resolvePane:j}),k=t.useMemo(()=>({mode:i,activePane:r,openList:o,openMain:p,openContext:x}),[r,x,o,p,i]),n=i==="stack",h=n&&r!=="list",d=n&&r!=="main";return s.jsx(y.Provider,{value:k,children:s.jsx("section",{className:w("flex min-h-0 flex-1 flex-col bg-background",b),"data-workspace-layout":"two-pane","data-workspace-mode":i,children:s.jsxs("div",{className:w("grid min-h-0 flex-1",n?"grid-cols-1":null),style:n?void 0:v,"data-workspace-layout-mode":m,"data-workspace-active-pane":r,children:[s.jsxs("aside",{ref:u.list,className:w("min-h-0 flex-col overflow-hidden bg-layout-list-item @container",h?"hidden":"flex",n?"border-r-0":"border-r border-border"),"data-testid":"workspace-list-pane","data-workspace-pane":"list",hidden:h,tabIndex:n?-1:void 0,children:[s.jsx("header",{className:"h-12 shrink-0 border-b border-border bg-layout-list-header","data-workspace-list-header":"true",children:e}),s.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:a})]}),s.jsxs("main",{ref:u.main,className:w("min-h-0 flex-col overflow-hidden bg-layout-content @container",d?"hidden":"flex"),"data-testid":"workspace-main-pane","data-workspace-pane":"main",hidden:d,tabIndex:n?-1:void 0,children:[s.jsx("header",{className:"h-12 shrink-0 border-b border-border bg-layout-content","data-workspace-main-header":"true",children:l}),s.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto",children:[n?s.jsx("button",{type:"button",className:"inline-flex items-center px-4 py-3 text-sm text-muted-foreground hover:text-foreground",onClick:o,children:"返回列表"}):null,f]})]})]})})})}export{S as T,y as W,P as u};
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<script src="/settings/theme-init.js"></script>
|
|
7
7
|
<title>正在完成 Xpod 登录</title>
|
|
8
|
-
<script type="module" crossorigin src="/settings/assets/auth-callback-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/settings/assets/global-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/settings/assets/global-
|
|
8
|
+
<script type="module" crossorigin src="/settings/assets/auth-callback-Bd3tvCOa.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/settings/assets/global-DMtP8ZF4.js">
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/settings/assets/global-B3kGI946.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body class="bg-background text-foreground">
|
|
13
13
|
<div id="root"></div>
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<script src="/settings/theme-init.js"></script>
|
|
7
7
|
<title>Xpod Settings</title>
|
|
8
|
-
<script type="module" crossorigin src="/settings/assets/settings-
|
|
9
|
-
<link rel="modulepreload" crossorigin href="/settings/assets/global-
|
|
10
|
-
<link rel="stylesheet" crossorigin href="/settings/assets/global-
|
|
8
|
+
<script type="module" crossorigin src="/settings/assets/settings-DQtt6lql.js"></script>
|
|
9
|
+
<link rel="modulepreload" crossorigin href="/settings/assets/global-DMtP8ZF4.js">
|
|
10
|
+
<link rel="stylesheet" crossorigin href="/settings/assets/global-B3kGI946.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body class="bg-background text-foreground">
|
|
13
13
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{o as P,r as u,j as r}from"./dashboard-CF8SbVSR.js";import{m as K,u as z,t as X}from"./AiConfigContext-B5QP7ow2.js";import{D as G,a as V,b as H,c as W,d as Q,e as Y}from"./dialog-D-Yc_lg-.js";function E(e,s){const t=s??(typeof window>"u"?void 0:window.location.origin);if(!t)throw new Error("task credential request needs a current browser origin");return new URL(e,t).toString()}async function M(e){const s=await e.text().catch(()=>"");if(s)try{const t=JSON.parse(s);return t&&typeof t=="object"&&!Array.isArray(t)?t:void 0}catch{return}}function R(e,s){const t=e?.error;return typeof t=="string"&&t?t:s}async function Z(e){const s=await e.fetch(E("/api/ai/task-credentials",e.origin),{method:"GET",credentials:"include",headers:{accept:"application/json"}}),t=await M(s);if(!s.ok)throw new Error(R(t,"Task credential request failed"));const n=t?.data;return Array.isArray(n)?n:[]}async function ee(e){const s=await e.fetch(E("/api/ai/task-credentials",e.origin),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({apiKey:e.apiKey,...e.name?{name:e.name}:{}})}),t=await M(s);if(!s.ok)throw new Error(R(t,"Task credential grant failed"));const n=t?.credential;if(!n||typeof n!="object")throw new Error("Task credential grant returned no grant");return n}async function te(e){const s=await e.fetch(E(`/api/ai/task-credentials/${encodeURIComponent(e.credentialRef)}`,e.origin),{method:"DELETE",credentials:"include",headers:{accept:"application/json"}});if(!s.ok)throw new Error(R(await M(s),"Task credential revocation failed"))}function se(e,s){return e.filter(t=>t.status==="active"&&(!s||t.issuer===s)).sort((t,n)=>n.version-t.version)[0]}function re(){const e=P(),[s,t]=u.useState(),[n,c]=u.useState(!0),[f,o]=u.useState(!1),[d,m]=u.useState(),g=u.useCallback(async()=>{if(!e.webId){t(void 0),c(!1);return}try{const i=await Z({fetch:e.fetch});t(se(i,e.issuer)),m(void 0)}catch(i){m(i instanceof Error?i.message:String(i))}finally{c(!1)}},[e.fetch,e.issuer,e.webId]);u.useEffect(()=>{g()},[g]);const w=u.useCallback(async()=>{o(!0),m(void 0);try{const i=await e.requestPodApiKey?.();if(!i)throw new Error("当前会话无法准备凭据");const y=await ee({fetch:e.fetch,apiKey:i,name:"Xpod 后台任务"});t(y)}catch(i){throw m(i instanceof Error?i.message:String(i)),i}finally{o(!1)}},[e.fetch,e.requestPodApiKey]),p=u.useCallback(async()=>{if(s){o(!0),m(void 0);try{await te({fetch:e.fetch,credentialRef:s.credentialRef}),t(void 0)}catch(i){throw m(i instanceof Error?i.message:String(i)),i}finally{o(!1)}}},[s,e.fetch]);return{...s?{credential:s}:{},loading:n,working:f,...d?{error:d}:{},grant:w,revoke:p,reload:g}}function ne(e){const s=[`已授权 · v${e.version}`];return e.lastUsedAt&&s.push(`最近使用 ${new Date(e.lastUsedAt).toLocaleString()}`),e.expiresAt&&s.push(`${new Date(e.expiresAt).toLocaleDateString()} 到期`),s.join(" · ")}function ae({onGranted:e,notice:s}){const t=re(),n=async()=>{try{await t.grant(),await e?.()}catch{}};return r.jsxs("section",{className:"rounded-xl border border-border p-4",children:[r.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-sm font-medium",children:"Background Pod access"}),r.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Lets index maintenance and embeddings read this Pod while you are not signed in."})]}),t.credential?r.jsx("button",{type:"button",disabled:t.working,onClick:()=>{t.revoke().catch(()=>{})},className:"h-9 rounded-md border border-input px-3 text-sm font-medium disabled:opacity-50",children:t.working?"正在撤销…":"撤销授权"}):r.jsx("button",{type:"button",disabled:t.working||t.loading,onClick:()=>{n()},className:"h-9 rounded-md border border-input px-3 text-sm font-medium disabled:opacity-50",children:t.working?"正在授权…":"授权后台任务访问"})]}),s?r.jsx("p",{className:"mt-3 text-sm text-destructive",children:s}):null,r.jsx("p",{className:"mt-3 text-sm",children:t.credential?ne(t.credential):"未授权:后台任务在你不在时无法读取这个 Pod。"}),t.error?r.jsx("p",{className:"mt-2 text-xs text-destructive",children:t.error}):null]})}function ie(e,s){return v(e)!==v(s)}function v(e){return Array.isArray(e)?`[${e.map(v).join(",")}]`:e&&typeof e=="object"?`{${Object.entries(e).filter(([,s])=>s!==void 0).sort(([s],[t])=>s.localeCompare(t)).map(([s,t])=>`${JSON.stringify(s)}:${v(t)}`).join(",")}}`:JSON.stringify(e)}const T=[{label:"General / Chat",name:"chatModel",description:"Used for assistant conversations and general text tasks."},{label:"OCR",name:"ocrModel",description:"Reads text from images and scanned pages."},{label:"Document Reader",name:"readerModel",description:"Extracts structure and content from documents."},{label:"Embedding",name:"embeddingModel",description:"Creates vectors for semantic search."},{label:"Indexer / Summarizer",name:"indexerModel",description:"Prepares and summarizes content for indexes."},{label:"Reranker",name:"rerankerModel",description:"Reorders search results by relevance."}];function oe(){const{config:e,capabilities:s,lifecycle:t,models:n,save:c,saveAndRebuild:f,saving:o,rebuilding:d}=z(),m=P(),[g,w]=u.useState({}),[p,i]=u.useState(),[y,k]=u.useState({}),[N,h]=u.useState(),[S,l]=u.useState();u.useEffect(()=>{let a=!1;return queueMicrotask(()=>{a||w(e?.models??{})}),()=>{a=!0}},[e]);const _=ie(g,e?.models??{}),C=A(g,e),j=O(t,d),D=()=>Object.fromEntries(T.map(({name:a})=>[a,g[a]||null])),q=async a=>{if(a.preventDefault(),C){if(j)return;h({models:D(),switch:C});return}await c({models:D()})},F=async()=>{const a=Object.fromEntries(T.map(({name:b})=>[b,null])),x=A(a,e);if(!x){await c({models:a});return}j||h({models:a,switch:x})},J=async()=>{const a=N;if(h(void 0),!a)return;const x=L(s);if(!x){await c({models:a.models}),l("模型已保存;此运行时不支持重建索引,请稍后手动重建。");return}await f({models:a.models},x),l(void 0)};return r.jsxs(r.Fragment,{children:[r.jsxs(I,{title:"Model Assignments",description:"Choose a connected model for each Xpod capability. Unassigned capabilities use the system default.",onSubmit:q,onRestore:()=>{F()},saving:o||d,dirty:_,children:[r.jsx("div",{className:"divide-y divide-border rounded-xl border border-border",children:T.map(a=>r.jsx(B,{...a,models:n,value:g[a.name],testing:p===a.name,testResult:y[a.name],disabled:a.name==="embeddingModel"&&j,notice:a.name!=="embeddingModel"?void 0:j?"索引重建进行中,完成后才能再次切换向量模型。":C?"切换向量模型会重建索引:保存前需要二次确认,确认后立即排队重建。":void 0,onChange:x=>w(b=>({...b,[a.name]:x})),onTest:async x=>{i(a.name);try{await X(m.fetch,x),k(b=>({...b,[a.name]:"ready"}))}catch{k(b=>({...b,[a.name]:"failed"}))}finally{i(void 0)}}},a.name))}),r.jsx(U,{lifecycle:t,fallbackNotice:S})]}),r.jsx(ae,{}),r.jsx(ce,{request:N?.switch,models:n,saving:o||d||j,onCancel:()=>h(void 0),onConfirm:()=>{J()}})]})}function A(e,s){const t=e.embeddingModel;if(t===void 0)return;const n=s?.models?.embeddingModel??"";return(t??"")===n?void 0:{from:n||void 0,to:t||void 0}}function O(e,s=!1){if(s)return!0;const t=$(e)?.phase;return t==="queued"||t==="running"}function L(e){const s=e?.rebuildTargets??[];if(s.includes("vector"))return"vector";if(s.includes("all"))return"all"}function $(e){if(!e)return;const s=e.recent[0];if(!s)return e.pending>0?{phase:"queued",pending:e.pending}:void 0;if(!(s.status==="queued"&&e.pending<=0))return{phase:s.status,pending:e.pending,target:s.target,...s.progress!==void 0?{progress:s.progress}:{},...s.error?{error:s.error}:{}}}const de={queued:"索引重建已排队",running:"索引重建进行中",succeeded:"索引重建完成",failed:"索引重建失败"};function U({lifecycle:e,fallbackNotice:s}){const t=$(e);if(!t)return s?r.jsx("p",{role:"status",className:"text-xs text-amber-600",children:s}):null;const n=[t.progress!==void 0?`${t.progress}%`:void 0,t.pending>0?`队列 ${t.pending}`:void 0,t.error].filter(Boolean).join(" · ");return r.jsxs("p",{role:"status",className:`text-xs ${t.phase==="failed"?"text-destructive":"text-muted-foreground"}`,children:[de[t.phase],n?` · ${n}`:""]})}function ce({request:e,models:s,saving:t,onCancel:n,onConfirm:c}){const f=o=>{if(!o)return"系统默认";const d=s.find(m=>m.ref===o);return d?`${d.displayName??d.id} · ${d.owner}`:o};return r.jsx(G,{open:!!e,onOpenChange:o=>{o||n()},children:r.jsxs(V,{"data-testid":"embedding-switch-dialog",children:[r.jsxs(H,{children:[r.jsx(W,{children:"切换向量模型并重建索引?"}),r.jsx(Q,{children:"已建立的向量由原模型生成,切换后需要用新模型重建索引才能参与检索。重建期间检索只会返回文本命中。"})]}),e&&r.jsxs("dl",{className:"grid gap-2 text-sm",children:[r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("dt",{className:"text-muted-foreground",children:"当前"}),r.jsx("dd",{className:"min-w-0 break-all text-right",children:f(e.from)})]}),r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsx("dt",{className:"text-muted-foreground",children:"切换为"}),r.jsx("dd",{className:"min-w-0 break-all text-right",children:f(e.to)})]})]}),r.jsxs(Y,{children:[r.jsx("button",{type:"button",onClick:n,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent",children:"取消"}),r.jsx("button",{type:"button",disabled:t,onClick:c,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground disabled:opacity-50",children:t?"提交中…":"确认切换并重建"})]})]})})}function B({label:e,name:s,description:t,models:n,value:c,testing:f,testResult:o,notice:d,disabled:m=!1,onChange:g,onTest:w}){const p=n.find(l=>l.ref===c),i=K(n,s),y=p?.capabilities.some(l=>["chat","embedding"].includes(l.toLowerCase()))===!0,h=[p?`Connected · credential ready · ${p.owner}`:c?"Selected model is no longer credential-ready":void 0,o==="ready"?"Probe succeeded":o==="failed"?"Probe failed; review AI Connection health":void 0].filter(Boolean).join(" · "),S=!!(c&&!p)||o==="failed";return r.jsxs("div",{"data-testid":"model-assignment-row",className:"grid gap-3 p-4 lg:grid-cols-[minmax(220px,1fr)_minmax(320px,440px)] lg:items-start",children:[r.jsxs("div",{className:"min-w-0 pt-1",children:[r.jsx("span",{className:"block text-sm font-medium text-foreground",children:e}),r.jsx("span",{className:"mt-0.5 block text-xs leading-5 text-muted-foreground",children:t})]}),r.jsxs("div",{"data-testid":"model-assignment-controls",className:"grid min-w-0 gap-2 sm:grid-cols-[minmax(0,1fr)_4.5rem] sm:items-start",children:[r.jsxs("label",{className:"min-w-0",children:[r.jsxs("span",{className:"sr-only",children:[e," model"]}),r.jsxs("select",{name:s,value:c??"",disabled:m,onChange:l=>g(l.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm text-foreground disabled:opacity-50",children:[r.jsx("option",{value:"",children:"System default"}),i.map(l=>r.jsxs("option",{value:l.ref,children:[l.displayName??l.id," · ",l.owner]},`${l.owner}:${l.id}`))]})]}),r.jsx("button",{type:"button","aria-label":`Test ${e} model`,disabled:m||!y||f,title:p?y?"Send a bounded readiness probe":"This model has no bounded probe endpoint":"Select a connected model first",onClick:()=>p&&void w(p),className:"h-10 w-full self-start rounded-md border border-input bg-background px-3 text-sm font-medium text-foreground hover:bg-accent disabled:opacity-50",children:f?"Testing…":"Test"}),h&&r.jsx("span",{role:"status",className:`text-xs sm:col-span-2 ${S?"text-destructive":"text-muted-foreground"}`,children:h}),d&&r.jsx("span",{"data-testid":"model-assignment-notice",className:"text-xs text-amber-600 sm:col-span-2",children:d})]})]})}function I({title:e,description:s,children:t,onSubmit:n,onRestore:c,footerActions:f,saving:o=!1,dirty:d=!0}){return r.jsxs("form",{onSubmit:n,className:"mx-auto flex w-full max-w-4xl flex-col gap-6 p-6",children:[r.jsxs("header",{children:[r.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground",children:e}),r.jsx("p",{className:"mt-2 max-w-2xl text-sm text-muted-foreground",children:s})]}),t,r.jsxs("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[r.jsx("span",{role:"status",className:"mr-auto self-center text-xs text-muted-foreground",children:d?"Unsaved changes":"Applied"}),f,r.jsx("button",{type:"button",onClick:c,disabled:o||!c,className:"h-9 rounded-md border border-input bg-background px-3 text-sm font-medium hover:bg-accent disabled:opacity-50",children:"Restore defaults"}),r.jsx("button",{type:"submit",disabled:o||!n||!d,className:"h-9 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground disabled:opacity-50",children:o?"Saving…":"Save configuration"})]})]})}const fe=Object.freeze(Object.defineProperty({__proto__:null,AiConfigForm:I,ModelAssignmentRow:B,ModelAssignmentsPanel:oe,RebuildStatusLine:U,embeddingModelSwitch:A,rebuildInFlight:O,rebuildStatusFrom:$,rebuildTargetForCapabilities:L},Symbol.toStringTag,{value:"Module"}));export{I as A,ae as B,fe as M,ie as i};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import{v as Z,w as ee,x as te,y as I,z as ie,A as T,E as ce,F as G,G as de,H as le,I as ue,J as he,o as pe,r as u,j as s,B as C,R as fe,C as ge,a as me,b as we,d as be,e as ve,K as xe,L as ye}from"./dashboard-CF8SbVSR.js";import{d as Ae,e as Se,b as Ce,c as Ie,h as Ne,i as _e,t as je,u as Ee}from"./admin-C6qCRFiY.js";import{a as Re}from"./settings-projection-CUkyprDQ.js";import{A as Ue,a as H}from"./ai-connections-Dr4-rSzX.js";import{R as Pe}from"./rotate-ccw-DJ6s86DW.js";import{S as X}from"./skeleton-Dg9HePtI.js";import{E as ke}from"./external-link-Cg_VIecD.js";class v extends Error{code;constructor(t,r){super(r),this.name="AccountStorageBindingsError",this.code=t}}async function Oe(e){const t=De(e.origin),r=e.controls?.account?.bindings;if(typeof r!="string"||r.trim()==="")throw new v("missing-control","Account storage bindings control is unavailable");const n=e.fetchImpl??fetch,a=Te(r,t),o=a.origin===t?a.href:await Z(a.href,n,e.trustedAccountIndex);if(!o)throw new v("cross-origin","Account storage bindings control is not hosted by this Xpod");const c=ee({Accept:"application/json",...e.headers});let i;try{i=await n(o,{headers:c,credentials:"include"})}catch(l){throw new v("request-failed",l instanceof Error?l.message:"Failed to load Account storage bindings")}if(i.status===401||i.status===403)throw new v("forbidden","Account storage bindings require an authenticated Account");if(!i.ok)throw new v("request-failed",`Account storage bindings request failed (${i.status})`);let d;try{d=await i.json()}catch{throw new v("invalid-response","Account storage bindings response is not valid JSON")}return Le(d,a.origin,We(a,e.trustedAccountIndex,t))}function Le(e,t,r=!1){if(!z(e)||!Array.isArray(e.bindings))throw new v("invalid-response","Account storage bindings response is malformed");const n=[],a=new Set;for(const o of e.bindings){if(!z(o)||typeof o.webId!="string"||typeof o.storageUrl!="string")throw new v("invalid-response","Account storage binding row is malformed");const c=Be(o.webId),i=Fe(o.storageUrl,r?void 0:t);if(!c||!i)throw new v("cross-origin","Account storage binding is outside the trusted storage scope");const d={webId:c,storageUrl:i,...typeof o.label=="string"?{label:o.label}:{}},l=`${d.webId}
|
|
2
|
-
${d.storageUrl}`;a.has(l)||(a.add(l),n.push(d))}return n}function De(e){try{return new URL(e??(typeof window>"u"?"http://localhost":window.location.origin)).origin}catch{throw new v("cross-origin","Current Xpod origin is invalid")}}function Te(e,t){try{const r=new URL(e,t);if(!["http:","https:"].includes(r.protocol)||r.username||r.password||r.hash)throw new Error("unsafe control URL");return r}catch{throw new v("cross-origin","Account storage bindings control is not a valid URL")}}function Be(e){if(!te(e))try{const t=new URL(e);return!["http:","https:"].includes(t.protocol)||t.username||t.password?void 0:e}catch{return}}function Fe(e,t){try{const r=new URL(e.trim());return t!==void 0&&r.origin!==t||!["http:","https:"].includes(r.protocol)||r.username||r.password||r.search||r.hash?void 0:(r.pathname=r.pathname.endsWith("/")?r.pathname:`${r.pathname}/`,r.href)}catch{return}}function We(e,t,r){if(!t)return!1;try{const n=new URL(t,r);return n.pathname.startsWith("/.account/")&&e.origin===n.origin&&e.pathname.startsWith("/.account/")}catch{return!1}}function z(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}const q="co.undefineds.ai-connections",Me={providerCredentials:"settings/credentials.ttl",providerDefinitions:"settings/providers/__service_access__.ttl",gatewayAccessKeys:".data/ai/gateway/access-keys.ttl",quotaSnapshots:".data/ai/gateway/quota.ttl"},$e=new Set(Ue);function V(e,t){if(!U(e))throw new Error("invalid_descriptor");if(e.appletId!==q)throw new Error("invalid_applet_id");const r=e.service;if(!U(r)||typeof r.webId!="string"||typeof r.label!="string"||!Je(r.webId))throw new Error("invalid_service");if(!Array.isArray(e.resources)||e.resources.length===0)throw new Error("invalid_empty_resources");const n=Ve(t),a=new Set,o=e.resources.map(c=>Ge(c,n,a));return{appletId:q,service:{webId:r.webId,label:r.label},resources:o}}function Ge(e,t,r){if(!U(e)||typeof e.id!="string"||typeof e.url!="string"||e.mediaType!=="text/turtle"||!U(e.access))throw new Error("invalid_resource");const n=He(e.id,t);if(!n||r.has(e.id))throw new Error("invalid_resource");Xe(e.url);let a;try{a=new URL(e.url)}catch{throw new Error("invalid_resource")}if(!Ke(a,t))throw new Error("invalid_resource");if(a.href!==n)throw new Error("invalid_resource");return r.add(e.id),{id:e.id,url:a.href,mediaType:"text/turtle",access:qe(e.access)}}function He(e,t){const r=Me[e];if(r)return new URL(r,t).href;const n=e.startsWith("providerDocument:")?e.slice(17):void 0;if(n&&$e.has(n))return new URL(`settings/providers/${n}.ttl`,t).href}function Xe(e){if(/%(?![0-9a-fA-F]{2})/.test(e)||/%(?:2f|5c)/i.test(e)||e.includes("\\"))throw new Error("invalid_resource");const t=ze(e);if(K(t))throw new Error("invalid_resource");try{const r=decodeURIComponent(t);if(r.includes("\\")||K(r))throw new Error("invalid_resource")}catch{throw new Error("invalid_resource")}}function ze(e){const t=e.split("#",1)[0]??e;return(t.split("?",1)[0]??t).replace(/^[a-z][a-z0-9+.-]*:\/\/[^/\\?#]*/i,"")}function K(e){return e.split("/").some(t=>t==="."||t==="..")}function qe(e){if(Object.keys(e).some(r=>r!=="read"&&r!=="append"&&r!=="write")||e.read!==!0||e.append!==!0||e.write!==!0)throw new Error("invalid_resource");return{read:!0,append:!0,write:!0}}function Ve(e){const t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error("invalid_current_pod");return t.pathname.endsWith("/")||(t.pathname=`${t.pathname}/`),t}function Ke(e,t){return(e.protocol==="http:"||e.protocol==="https:")&&e.origin===t.origin&&e.pathname.startsWith(t.pathname)}function Je(e){try{const t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}function U(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}const Qe=3,Ye=63,Ze=/^[a-z0-9-]+$/;function B(e){return e.trim().toLowerCase()}function re(e){const t=B(e);if(!t)return I.usernameRequired;if(t.length<Qe||t.length>Ye)return I.usernameLength;if(!Ze.test(t))return I.usernameCharset;if(t.startsWith("-")||t.endsWith("-"))return I.usernameHyphen}const et="已有 Pod 的身份绑定尚未确认。请重试读取绑定或返回账号,不需要重新创建 Pod。",tt="暂时无法确认已有 Pod,请重试读取或返回账号。";class x extends Error{code;constructor(t){super(t==="binding-missing"?et:t==="inventory-unavailable"?tt:"账号已切换,请返回当前账号重新操作。"),this.name="FirstPodReadinessError",this.code=t}}function rt(e){const t=G(),r=de(t,{...e.headers}),n=new Headers(r).get("Authorization"),a=()=>{try{e.assertCurrentAccount?.()}catch{throw new x("account-changed")}if(G()!==t||n?.startsWith("CSS-Account-Token ")&&n!==(t?`CSS-Account-Token ${t}`:void 0))throw new x("account-changed")},o=e.fetchImpl??fetch;return{headers:r,assertCurrentAccount:a,fetch:async(i,d)=>{a();const l=await o(i,d);try{a()}catch(b){throw l.body?.cancel().catch(()=>{}),b}const g=async b=>{a();const y=await b();return a(),y},m=l.json.bind(l),w=l.text.bind(l);return l.json=()=>g(m),l.text=()=>g(w),l}}}async function nt(e,t,r,n){n.assertCurrentAccount();let a;try{const i=await e(T(t),{headers:{...n.headers,Accept:"application/json"},credentials:"include"});if(!i.ok)throw new x("inventory-unavailable");a=await i.json()}catch{throw n.assertCurrentAccount(),new x("inventory-unavailable")}if(n.assertCurrentAccount(),!D(a)||!D(a.pods))throw new x("inventory-unavailable");const o=Object.entries(a.pods);if(o.some(([i,d])=>!ae(i)||typeof d!="string"||!d))throw new x("inventory-unavailable");const c=le(r);if(o.some(([i])=>!c||ue(i,c.storageRoot)))throw new x("binding-missing")}function st(e){for(const t of e){if(!t)continue;const r=ut(t);if(!r)continue;const n=B(r).replace(/[^a-z0-9-]/gu,"-").replace(/-+/gu,"-").replace(/^-+|-+$/gu,"");if(n&&!re(n))return n}return""}async function at(e){const t=rt(e),r=t.fetch,n=B(e.username),a=re(n);if(a)throw new Error(a);const o=await ie(e.provisionCode),c=await Z(e.createPodUrl,r,e.trustedAccountIndex);if(!c)throw new Error("Pod creation control is not hosted by this Xpod");await nt(r,c,o,t);const i=await dt(r,n,o);t.assertCurrentAccount();const d=await r(T(c),{method:"POST",headers:{...t.headers,Accept:"application/json","Content-Type":"application/json"},credentials:"include",body:JSON.stringify(ce(n,i?.provisionCode??o,i?.provisionReceipt))});if(t.assertCurrentAccount(),!d.ok){const w=await ct(d);throw d.status===409||ne(w)?new Error(I.podNameTaken):new Error(w||"Failed to create Pod")}const l=await d.json().catch(P);t.assertCurrentAccount();const g=lt(l);if(!e.pickWebIdUrl)return g;const m=await ot({fetchImpl:r,headers:t.headers,maxAttempts:e.maxAttempts,pickWebIdUrl:e.pickWebIdUrl,pollIntervalMs:e.pollIntervalMs});return t.assertCurrentAccount(),m.length>0?m:g}async function ot(e){const t=e.fetchImpl??fetch,r=Math.max(1,e.maxAttempts??30),n=Math.max(0,e.pollIntervalMs??500);for(let a=0;a<r;a+=1){const o=await it(t,e.pickWebIdUrl,e.headers);if(o.length>0)return o;a<r-1&&n>0&&await new Promise(c=>setTimeout(c,n))}return[]}function P(e){if(e instanceof x)throw e}async function it(e,t,r){const n=await e(T(t),{headers:r,credentials:"include"}).catch(P);if(!n?.ok)return[];const a=await n.json().catch(P);if(!Array.isArray(a?.entries))return[];const o=new Set,c=[];for(const i of a.entries){if(!D(i)||typeof i.webId!="string"||typeof i.storageUrl!="string")continue;const d=se(i.webId,i.storageUrl);if(!d)continue;const l=`${d.webId}
|
|
3
|
-
${d.storageUrl}`;o.has(l)||(o.add(l),c.push(d))}return c}async function ct(e){const t=await e.text?.().catch(P);if(t)try{const r=JSON.parse(t);return typeof r.message=="string"?r.message:typeof r.error=="string"?r.error:t}catch{return t}}function ne(e){return e?/already (?:is )?(?:a )?resource/iu.test(e)||/already taken/iu.test(e)||/already exists/iu.test(e):!1}async function dt(e,t,r){try{return await he(e,t,r)}catch(n){const a=n instanceof Error?n.message:String(n);throw ne(a)?new Error(I.podNameTaken):n}}function lt(e){if(typeof e?.podUrl!="string")return[];const t=ae(e.podUrl);if(!t)return[];const r=new Set;if(typeof e.webId=="string"&&e.webId.length>0&&r.add(e.webId),Array.isArray(e.webIds))for(const n of e.webIds)typeof n=="string"&&n.length>0&&r.add(n);return Array.from(r).map(n=>se(n,t)).filter(n=>!!n)}function ut(e){try{return new URL(e).pathname.split("/").filter(Boolean)[0]}catch{return e.includes("@")?e.split("@",1)[0]:e}}function se(e,t){if(!te(e))try{const r=new URL(e),n=new URL(t);return!["http:","https:"].includes(r.protocol)||!["http:","https:"].includes(n.protocol)?void 0:(n.pathname=n.pathname.endsWith("/")?n.pathname:`${n.pathname}/`,{webId:e,storageUrl:n.href})}catch{return}}function ae(e){try{const t=new URL(e);return!["http:","https:"].includes(t.protocol)||t.username||t.password||t.hash||t.search?void 0:(t.pathname=t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`,t.href)}catch{return}}function D(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ht(e,t){if(e)try{return new URL(new URL(e).pathname,t).toString()}catch{return}}const pt="http://www.w3.org/ns/solid/acp#",ft="http://www.w3.org/ns/auth/acl#";function J(e,{ownerWebId:t,serviceWebId:r},n=!0){const a=n?`
|
|
4
|
-
<#serviceAccess>
|
|
5
|
-
a acp:AccessControl;
|
|
6
|
-
acp:apply [
|
|
7
|
-
a acp:Policy;
|
|
8
|
-
acp:allow acl:Read, acl:Write;
|
|
9
|
-
acp:anyOf [
|
|
10
|
-
a acp:Matcher;
|
|
11
|
-
acp:agent <${r}>
|
|
12
|
-
]
|
|
13
|
-
].
|
|
14
|
-
`:"",o=n?"<#ownerAccess>, <#serviceAccess>":"<#ownerAccess>";return`@prefix acl: <${ft}>.
|
|
15
|
-
@prefix acp: <${pt}>.
|
|
16
|
-
|
|
17
|
-
<#managed>
|
|
18
|
-
a acp:AccessControlResource;
|
|
19
|
-
acp:resource <${e}>;
|
|
20
|
-
acp:accessControl ${o};
|
|
21
|
-
acp:memberAccessControl ${o}.
|
|
22
|
-
|
|
23
|
-
<#ownerAccess>
|
|
24
|
-
a acp:AccessControl;
|
|
25
|
-
acp:apply [
|
|
26
|
-
a acp:Policy;
|
|
27
|
-
acp:allow acl:Read, acl:Write, acl:Control;
|
|
28
|
-
acp:anyOf [
|
|
29
|
-
a acp:Matcher;
|
|
30
|
-
acp:agent <${t}>
|
|
31
|
-
]
|
|
32
|
-
].
|
|
33
|
-
${a}`}function gt(e){const t=new URL(e);return t.pathname.endsWith("/")||(t.pathname=t.pathname.slice(0,t.pathname.lastIndexOf("/")+1)),t.toString()}function O(e){return new URL(".acr",e).toString()}function L(e){return[...new Set(e.resources.map(t=>gt(t.url)))]}async function Q(e,t,r){const n=await e(t,{method:"PUT",headers:{"content-type":"text/turtle"},body:r});if(!n.ok)throw await n.arrayBuffer().catch(()=>{}),new Error(`service_acr_write_failed:${n.status}`)}function R(e,t,r){return{status:t?"granted":"missing",resources:e.resources}}function Y(e){const t=()=>{if(!e.ownerWebId)throw new Error("service_acr_owner_missing");return e.ownerWebId};return{async ensureAgentAccess(r){const n=t();for(const a of L(r))await Q(e.authenticatedFetch,O(a),J(a,{ownerWebId:n,serviceWebId:r.service.webId}));return{status:"granted",resources:r.resources}},async inspectAgentAccess(r){try{for(const n of L(r)){const a=await e.authenticatedFetch(O(n),{headers:{accept:"text/turtle"}});if(!a.ok)return await a.arrayBuffer().catch(()=>{}),R(r,!1);const o=await a.text();if(!o.includes(`<${r.service.webId}>`)||!o.includes("acp:AccessControlResource"))return R(r,!1)}return R(r,!0)}catch{return R(r,!1)}},async revokeAgentAccess(r){const n=t();for(const a of L(r))await Q(e.authenticatedFetch,O(a),J(a,{ownerWebId:n,serviceWebId:r.service.webId},!1));return{status:"missing",resources:r.resources}}}}function Pt({kind:e}){const t=pe(),[r,n]=u.useState(null),[a,o]=u.useState(null),[c,i]=u.useState(null),[d,l]=u.useState(null),[g,m]=u.useState(!0),[w,b]=u.useState(""),[y,A]=u.useState(""),S=u.useCallback(async()=>{m(!0),b("");try{const[h,p,k,f]=await Promise.all([Ae(),Se(),Ce(),Ie()]);if(!h||!p)throw new Error("unavailable");n(h),o(p),i(k),l(await Ne(_e(p.env,f,h.env.CSS_BASE_URL??"")))}catch{b("Settings evidence could not be loaded.")}finally{m(!1)}},[]);u.useEffect(()=>{let h=!1;return queueMicrotask(()=>{h||S()}),()=>{h=!0}},[S]);const _=async h=>{if(b(""),!await Ee(h)){b("Configuration could not be saved.");return}o(p=>p&&{...p,env:{...p.env,...h}}),A("Saved · restart required")},E=St[e];return s.jsxs("div",{className:"space-y-4 p-6",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(C,{type:"button",size:"sm",variant:"outline",onClick:S,disabled:g,children:[s.jsx(fe,{className:"mr-2 h-4 w-4"}),"Refresh"]})}),w?s.jsx("div",{role:"alert",className:"rounded-md border border-destructive/30 p-3 text-sm text-destructive",children:w}):null,y?s.jsxs("div",{role:"status",className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800 dark:bg-amber-950/20 dark:text-amber-200",children:[s.jsx("span",{children:y}),s.jsxs(C,{type:"button",size:"sm",variant:"outline",onClick:()=>{je()},children:[s.jsx(Pe,{className:"mr-2 h-4 w-4"}),"Restart Xpod"]})]}):null,s.jsxs(ge,{children:[s.jsxs(me,{children:[s.jsx(we,{children:E}),s.jsx(be,{children:Ct[e]})]}),s.jsx(ve,{className:"space-y-4",children:g&&!a?s.jsx("div",{role:"status","aria-label":"Loading settings",className:"grid gap-3 sm:grid-cols-2","aria-live":"polite",children:[0,1,2,3].map(h=>s.jsxs("div",{className:"rounded-lg border border-border p-3","aria-hidden":"true",children:[s.jsx(X,{className:"h-3 w-24"}),s.jsx(X,{className:"mt-2 h-5 w-36"})]},h))}):s.jsx(wt,{kind:e,runtime:t,admin:r,configuration:a,provision:c,publicRoute:d,save:_})})]})]})}function mt({runtime:e,publicRoute:t}){const r=xe(),[n,a]=u.useState(null),[o,c]=u.useState(""),[i,d]=u.useState(""),[l,g]=u.useState(!1),[m,w]=u.useState(""),[b,y]=u.useState(""),A=r.controls,S=r.idpIndex,_=u.useCallback(async()=>{c("");try{a(await Oe({controls:A,origin:window.location.origin,trustedAccountIndex:S}))}catch{a(null),c("暂时无法读取存储绑定,请重试。")}},[A,S]);u.useEffect(()=>{let f=!1;return queueMicrotask(()=>{f||_()}),()=>{f=!0}},[_]);const E=u.useMemo(()=>st([e.webId,r.identity?.username,A?.account?.username]),[e.webId,r.identity?.username,A?.account?.username]),h=async f=>{f.preventDefault();const W=A?.account?.pod,M=(i.trim()||E||"").trim();if(!l){if(!W){w("当前部署没有公布创建存储空间的入口。");return}if(!M){w("无法从当前账号推断 Pod 名称,请手动填写。");return}g(!0),w(""),y("");try{await at({assertCurrentAccount:r.bindAccountCapability?.(),createPodUrl:W,headers:ee(),provisionCode:await ye(),trustedAccountIndex:S,username:M}),d(""),y("存储空间已创建。"),await _()}catch($){w($ instanceof Error?$.message:"无法创建存储空间,请重试。")}finally{g(!1)}}},p=ht(e.podUrl,window.location.origin),k=[{label:"Pod name",value:oe(e.podUrl)},{label:"Pod URL",value:p??"Not discovered"},{label:"Public route",value:At(t),detail:t?.detail??"Not checked by this runtime"},{label:"Session",value:e.state.status}];return s.jsxs(s.Fragment,{children:[s.jsx(N,{rows:k}),s.jsxs(C,{type:"button",variant:"outline",disabled:!p,onClick:()=>p&&window.open(p,"_blank","noopener,noreferrer"),children:[s.jsx(ke,{className:"mr-2 h-4 w-4"}),"Open Pod"]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-sm font-medium",children:"属于当前账号的存储空间"}),o?s.jsx("div",{role:"alert",className:"rounded-md border border-destructive/30 p-3 text-sm text-destructive",children:o}):null,n===null&&!o?s.jsx("div",{role:"status",className:"text-sm text-muted-foreground",children:"正在读取…"}):null,n?.length===0?s.jsx("div",{role:"status",className:"rounded-lg border border-border p-3 text-sm text-muted-foreground",children:"这个账号还没有任何存储空间。创建后即可用它授权应用访问。"}):null,n&&n.length>0?s.jsx("ul",{className:"space-y-2",children:n.map(f=>s.jsxs("li",{className:"rounded-lg border border-border p-3 text-sm",children:[s.jsx("div",{className:"break-all font-medium",children:f.storageUrl}),s.jsx("div",{className:"mt-1 break-all text-xs text-muted-foreground",children:f.webId})]},`${f.webId}|${f.storageUrl}`))}):null]}),s.jsxs("form",{onSubmit:h,className:"space-y-2 rounded-lg border border-border p-3",children:[s.jsx("label",{className:"block text-sm font-medium",htmlFor:"pod-management-name",children:"创建存储空间"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"创建是一次显式操作:不会因为登录或授权而自动发生。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("input",{id:"pod-management-name",className:"h-10 min-w-48 flex-1 rounded-md border border-input bg-background px-3",value:i,placeholder:E||"my-pod",disabled:l,onChange:f=>d(f.currentTarget.value)}),s.jsx(C,{type:"submit",disabled:l,children:l?"正在创建…":"创建"})]}),m?s.jsx("div",{role:"alert",className:"text-sm text-destructive",children:m}):null,b?s.jsx("div",{role:"status",className:"text-sm text-muted-foreground",children:b}):null]})]})}function wt({kind:e,runtime:t,admin:r,configuration:n,provision:a,publicRoute:o,save:c}){const i=n?.env??{};return e==="pod"?s.jsx(mt,{runtime:t,publicRoute:o}):e==="identity-access"?s.jsx(bt,{runtime:t}):e==="storage"?s.jsxs(s.Fragment,{children:[s.jsx(N,{rows:Re(i,n?.secrets)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Measured storage and bandwidth are intentionally shown in Status → Usage, not here. Storage migration is unavailable because this runtime does not report a migration capability."})]}):e==="runtime"?s.jsx(vt,{env:i,admin:r,save:c}):e==="cloud"?s.jsx(xt,{env:i,provision:a,save:c}):s.jsx(yt,{env:i,save:c})}function bt({runtime:e}){const[t,r]=u.useState("checking"),[n,a]=u.useState(!1),o=u.useCallback(async()=>{if(!e.webId||!e.podUrl||e.state.status!=="authenticated"){r("unavailable");return}r("checking");try{const d=H({webId:e.webId,podUrl:e.podUrl,authenticatedFetch:e.fetch}),l=V(await d.getServiceAccess(),e.podUrl),m=await Y({authenticatedFetch:e.fetch,ownerWebId:e.webId}).inspectAgentAccess(l);r(m.status==="granted"?"granted":"missing")}catch{r("error")}},[e.fetch,e.podUrl,e.state.status,e.webId]);u.useEffect(()=>{let d=!1;return queueMicrotask(()=>{d||o()}),()=>{d=!0}},[o]);const c=async()=>{if(!(!e.webId||!e.podUrl||!window.confirm("Revoke AI Gateway service access to Xpod settings resources? Provider credentials remain stored but the service can no longer use them."))){a(!0);try{const d=H({webId:e.webId,podUrl:e.podUrl,authenticatedFetch:e.fetch}),l=V(await d.getServiceAccess(),e.podUrl);await Y({authenticatedFetch:e.fetch,ownerWebId:e.webId}).revokeAgentAccess(l),r("missing")}catch{r("error")}finally{a(!1)}}},i=t==="granted"?"Granted":t==="missing"?"Not granted":t==="checking"?"Checking…":t==="unavailable"?"Unavailable while signed out":"Could not inspect";return s.jsxs(s.Fragment,{children:[s.jsx(N,{rows:[{label:"WebID",value:e.webId??"Signed out"},{label:"OIDC issuer",value:e.issuer??"Not reported"},{label:"Current account",value:e.webId?oe(e.webId):"Signed out"},{label:"Session",value:e.state.status},{label:"ACP / ACR",value:t==="error"?"Capability unavailable or permission denied":"Managed ACR capability available"},{label:"AI Gateway service access",value:i,detail:"Inspected from the managed ACRs for declared settings resources"}]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(C,{type:"button",variant:"outline",onClick:()=>{o()},disabled:t==="checking",children:"Recheck access"}),s.jsx(C,{type:"button",variant:"destructive",onClick:()=>{c()},disabled:t!=="granted"||n,children:n?"Revoking…":"Revoke service access"})]})]})}function vt({env:e,admin:t,save:r}){const n=e.CSS_BASE_URL??t?.env.CSS_BASE_URL??"",[a,o]=u.useState(n),[c,i]=u.useState(e.CSS_ROOT_FILE_PATH??"");return u.useEffect(()=>{let d=!1;return queueMicrotask(()=>{d||(o(n),i(e.CSS_ROOT_FILE_PATH??""))}),()=>{d=!0}},[e,n]),s.jsxs("div",{className:"space-y-4",children:[s.jsx(N,{rows:[{label:"Edition",value:t?.env.XPOD_EDITION??e.XPOD_EDITION??"local"},{label:"Configuration source",value:".env.local / runtime bootstrap"},{label:"Service startup",value:"Gateway supervises Solid Server and API Server"},{label:"Automatic restart",value:"Enabled for managed child services"}]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsx(j,{label:"Base URL",value:a,onChange:o}),s.jsx(j,{label:"Data directory",value:c,onChange:i})]}),s.jsx(F,{onClick:()=>r({CSS_BASE_URL:a,CSS_ROOT_FILE_PATH:c})})]})}function xt({env:e,provision:t,save:r}){const[n,a]=u.useState(e.XPOD_CLOUD_API_ENDPOINT??""),[o,c]=u.useState(e.XPOD_NODE_ID??""),[i,d]=u.useState(e.XPOD_SP_DOMAIN??"");return u.useEffect(()=>{let l=!1;return queueMicrotask(()=>{l||(a(e.XPOD_CLOUD_API_ENDPOINT??""),c(e.XPOD_NODE_ID??""),d(e.XPOD_SP_DOMAIN??""))}),()=>{l=!0}},[e]),s.jsxs("div",{className:"space-y-4",children:[s.jsx(N,{rows:[{label:"Node registration",value:t?.registered?"Registered":"Not registered",detail:t?.nodeId??"Node ID not reported"},{label:"Cluster coordination",value:t?.cloudUrl??"Not configured",detail:t?.managed?"This node is cluster-managed":"Not cluster-managed"},{label:"Service-provider domain",value:t?.serviceProviderDomain??"Not allocated"}]}),s.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[s.jsx(j,{label:"Cloud endpoint",value:n,onChange:a}),s.jsx(j,{label:"Node ID",value:o,onChange:c}),s.jsx(j,{label:"Service-provider domain",value:i,onChange:d})]}),s.jsx(F,{onClick:()=>r({XPOD_CLOUD_API_ENDPOINT:n,XPOD_NODE_ID:o,XPOD_SP_DOMAIN:i})})]})}function yt({env:e,save:t}){const[r,n]=u.useState(e.CSS_LOGGING_LEVEL??"info"),[a,o]=u.useState(e.CSS_SHOW_STACK_TRACE==="true");return u.useEffect(()=>{let c=!1;return queueMicrotask(()=>{c||(n(e.CSS_LOGGING_LEVEL??"info"),o(e.CSS_SHOW_STACK_TRACE==="true"))}),()=>{c=!0}},[e]),s.jsxs("div",{className:"space-y-4",children:[s.jsx(N,{rows:[{label:"Log retention",value:"30 days",detail:"Runtime logging profile"},{label:"Configuration provenance",value:".env.local allowlist"},{label:"Restart requirement",value:"Required after save"}]}),s.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:["Logging level",s.jsxs("select",{value:r,onChange:c=>n(c.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3 sm:max-w-xs",children:[s.jsx("option",{children:"debug"}),s.jsx("option",{children:"info"}),s.jsx("option",{children:"warn"}),s.jsx("option",{children:"error"})]})]}),s.jsxs("label",{className:"flex items-center justify-between gap-3 rounded-md border border-border p-3 text-sm font-medium",children:["Show stack traces",s.jsx("input",{type:"checkbox",checked:a,onChange:c=>o(c.target.checked)})]}),s.jsx(F,{onClick:()=>t({CSS_LOGGING_LEVEL:r,CSS_SHOW_STACK_TRACE:String(a)})})]})}function N({rows:e}){return s.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:e.map(t=>s.jsxs("div",{className:"rounded-lg border border-border p-3",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:t.label}),s.jsx("div",{className:"mt-1 break-all text-sm font-medium",children:t.value}),t.detail?s.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:t.detail}):null]},t.label))})}function j({label:e,value:t,onChange:r}){return s.jsxs("label",{className:"block space-y-2 text-sm font-medium",children:[e,s.jsx("input",{value:t,onChange:n=>r(n.target.value),className:"block h-10 w-full rounded-md border border-input bg-background px-3"})]})}function F({onClick:e}){return s.jsx("div",{className:"flex justify-end",children:s.jsx(C,{type:"button",onClick:e,children:"Save configuration"})})}function oe(e){if(!e)return"Not discovered";try{return new URL(e).pathname.split("/").filter(Boolean).at(-1)||new URL(e).hostname}catch{return e}}function At(e){return e?e.status==="pass"?"Reachable":e.status==="fail"?"Not reachable":"Not verified":"Not checked"}const St={pod:"Pod","identity-access":"Identity & Access",storage:"Storage",runtime:"Runtime",cloud:"Cloud",advanced:"Advanced"},Ct={pod:"Current Pod identity and authority boundary.","identity-access":"Session, account, and app/service access.",storage:"Authority storage backends and health configuration.",runtime:"Edition, startup, paths, and restart behavior.",cloud:"Node registration and cluster coordination.",advanced:"Bounded logging and runtime compatibility controls."};export{Pt as PodSettingsSubjectPanel};
|