1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9490],{4070:function(e,t,r){var i=r(72455),n=r(96603),s=r(38554),a=r(29705);function o(e,t,r){arguments.length<2?i.call(this,e):i.call(this,e,t,r);var n=s.getPointerArray(this.capacity);this.deleted=new n(this.capacity),this.deletedSize=0}for(var u in i.prototype)o.prototype[u]=i.prototype[u];"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),o.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},o.prototype.set=function(e,t){var r=this.items[e];if(void 0!==r){this.splayOnTop(r),this.V[r]=t;return}this.size<this.capacity?(r=this.deletedSize>0?this.deleted[--this.deletedSize]:this.size,this.size++):(r=this.tail,this.tail=this.backward[r],delete this.items[this.K[r]]),this.items[e]=r,this.K[r]=e,this.V[r]=t,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r},o.prototype.setpop=function(e,t){var r=null,i=null,n=this.items[e];return void 0!==n?(this.splayOnTop(n),r=this.V[n],this.V[n]=t,{evicted:!1,key:e,value:r}):(this.size<this.capacity?(n=this.deletedSize>0?this.deleted[--this.deletedSize]:this.size,this.size++):(n=this.tail,this.tail=this.backward[n],r=this.V[n],i=this.K[n],delete this.items[i]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n,i)?{evicted:!0,key:i,value:r}:null},o.prototype.delete=function(e){var t=this.items[e];if(void 0===t)return!1;if(delete this.items[e],1===this.size)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var r=this.backward[t],i=this.forward[t];return this.head===t&&(this.head=i),this.tail===t&&(this.tail=r),this.forward[r]=i,this.backward[i]=r,this.size--,this.deleted[this.deletedSize++]=t,!0},o.prototype.remove=function(e,t){var r=this.items[e];if(void 0===r)return t;var i=this.V[r];if(delete this.items[e],1===this.size)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,i;var n=this.backward[r],s=this.forward[r];return this.head===r&&(this.head=s),this.tail===r&&(this.tail=n),this.forward[n]=s,this.backward[s]=n,this.size--,this.deleted[this.deletedSize++]=r,i},o.from=function(e,t,r,i){if(arguments.length<2){if("number"!=typeof(i=a.guessLength(e)))throw Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2==arguments.length&&(i=t,t=null,r=null);var s=new o(t,r,i);return n(e,function(e,t){s.set(t,e)}),s},e.exports=o},72455:function(e,t,r){var i=r(60151),n=r(96603),s=r(38554),a=r(29705);function o(e,t,r){if(arguments.length<2&&(r=e,e=null,t=null),this.capacity=r,"number"!=typeof this.capacity||this.capacity<=0)throw Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var i=s.getPointerArray(r);this.forward=new i(r),this.backward=new i(r),this.K="function"==typeof e?new e(r):Array(r),this.V="function"==typeof t?new t(r):Array(r),this.size=0,this.head=0,this.tail=0,this.items={}}o.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},o.prototype.splayOnTop=function(e){var t=this.head;if(this.head===e)return this;var r=this.backward[e],i=this.forward[e];return this.tail===e?this.tail=r:this.backward[i]=r,this.forward[r]=i,this.backward[t]=e,this.head=e,this.forward[e]=t,this},o.prototype.set=function(e,t){var r=this.items[e];if(void 0!==r){this.splayOnTop(r),this.V[r]=t;return}this.size<this.capacity?r=this.size++:(r=this.tail,this.tail=this.backward[r],delete this.items[this.K[r]]),this.items[e]=r,this.K[r]=e,this.V[r]=t,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r},o.prototype.setpop=function(e,t){var r=null,i=null,n=this.items[e];return void 0!==n?(this.splayOnTop(n),r=this.V[n],this.V[n]=t,{evicted:!1,key:e,value:r}):(this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],r=this.V[n],i=this.K[n],delete this.items[i]),this.items[e]=n,this.K[n]=e,this.V[n]=t,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n,i)?{evicted:!0,key:i,value:r}:null},o.prototype.has=function(e){return e in this.items},o.prototype.get=function(e){var t=this.items[e];if(void 0!==t)return this.splayOnTop(t),this.V[t]},o.prototype.peek=function(e){var t=this.items[e];if(void 0!==t)return this.V[t]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var r=0,i=this.size,n=this.head,s=this.K,a=this.V,o=this.forward;r<i;)e.call(t,a[n],s[n],this),n=o[n],r++},o.prototype.keys=function(){var e=0,t=this.size,r=this.head,n=this.K,s=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=n[r];return++e<t&&(r=s[r]),{done:!1,value:i}})},o.prototype.values=function(){var e=0,t=this.size,r=this.head,n=this.V,s=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=n[r];return++e<t&&(r=s[r]),{done:!1,value:i}})},o.prototype.entries=function(){var e=0,t=this.size,r=this.head,n=this.K,s=this.V,a=this.forward;return new i(function(){if(e>=t)return{done:!0};var i=n[r],o=s[r];return++e<t&&(r=a[r]),{done:!1,value:[i,o]}})},"undefined"!=typeof Symbol&&(o.prototype[Symbol.iterator]=o.prototype.entries),o.prototype.inspect=function(){for(var e,t=new Map,r=this.entries();!(e=r.next()).done;)t.set(e.value[0],e.value[1]);return Object.defineProperty(t,"constructor",{value:o,enumerable:!1}),t},"undefined"!=typeof Symbol&&(o.prototype[Symbol.for("nodejs.util.inspect.custom")]=o.prototype.inspect),o.from=function(e,t,r,i){if(arguments.length<2){if("number"!=typeof(i=a.guessLength(e)))throw Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2==arguments.length&&(i=t,t=null,r=null);var s=new o(t,r,i);return n(e,function(e,t){s.set(t,e)}),s},e.exports=o},29705:function(e,t,r){var i=r(96603),n=r(38554);function s(e){return"number"==typeof e.length?e.length:"number"==typeof e.size?e.size:void 0}t.isArrayLike=function(e){return Array.isArray(e)||n.isTypedArray(e)},t.guessLength=s,t.toArray=function(e){var t=s(e),r="number"==typeof t?Array(t):[],n=0;return i(e,function(e){r[n++]=e}),r},t.toArrayWithIndices=function(e){var t=s(e),r="number"==typeof t?n.getPointerArray(t):Array,a="number"==typeof t?Array(t):[],o="number"==typeof t?new r(t):[],u=0;return i(e,function(e){a[u]=e,o[u]=u++}),[a,o]}},38554:function(e,t){t.getPointerArray=function(e){var t=e-1;if(t<=255)return Uint8Array;
1if(t<=65535)return Uint16Array;if(t<=4294967295)return Uint32Array;throw Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(e){var t=e-1;return t<=127?Int8Array:t<=32767?Int16Array:t<=2147483647?Int32Array:Float64Array},t.getNumberType=function(e){return e===(0|e)?-1===Math.sign(e)?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var r={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(e,i){var n,s,a,o,u,h=null,c=0;for(o=0,u=e.length;o<u;o++)a=i?i(e[o]):e[o],(n=r[(s=t.getNumberType(a)).name])>c&&(c=n,h=s);return h},t.isTypedArray=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(e)},t.concat=function(){var e,t,r,i=0;for(e=0,r=arguments.length;e<r;e++)i+=arguments[e].length;var n=new arguments[0].constructor(i);for(e=0,t=0;e<r;e++)n.set(arguments[e],t),t+=arguments[e].length;return n},t.indices=function(e){for(var r=new(t.getPointerArray(e))(e),i=0;i<e;i++)r[i]=i;return r}},96603:function(e,t,r){var i=r(50355),n=i.ARRAY_BUFFER_SUPPORT,s=i.SYMBOL_SUPPORT;e.exports=function(e,t){var r,i,a,o,u;if(!e)throw Error("obliterator/forEach: invalid iterable.");if("function"!=typeof t)throw Error("obliterator/forEach: expecting a callback.");if(Array.isArray(e)||n&&ArrayBuffer.isView(e)||"string"==typeof e||"[object Arguments]"===e.toString()){for(a=0,o=e.length;a<o;a++)t(e[a],a);return}if("function"==typeof e.forEach){e.forEach(t);return}if(s&&Symbol.iterator in e&&"function"!=typeof e.next&&(e=e[Symbol.iterator]()),"function"==typeof e.next){for(r=e,a=0;!0!==(u=r.next()).done;)t(u.value,a),a++;return}for(i in e)e.hasOwnProperty(i)&&t(e[i],i)}},60151:function(e){function t(e){if("function"!=typeof e)throw Error("obliterator/iterator: expecting a function!");this.next=e}"undefined"!=typeof Symbol&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,r=e.length,i=0;return new t(function(){return i>=r?{done:!0}:{done:!1,value:e[i++]}})},t.empty=function(){return new t(function(){return{done:!0}})},t.fromSequence=function(e){var r=0,i=e.length;return new t(function(){return r>=i?{done:!0}:{done:!1,value:e[r++]}})},t.is=function(e){return e instanceof t||"object"==typeof e&&null!==e&&"function"==typeof e.next},e.exports=t},50355:function(e,t){t.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,t.SYMBOL_SUPPORT="undefined"!=typeof Symbol},49490:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return d},turboChargeResultIfSourceMap:function(){return v}});var i=r(26705),n=r(20955),s=r(72367);let a=e=>e;var o=r(80096),u=r(4070),h=r(74819),c=r(60506);function l(e){return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)}function d(e){let{liveDocument:t,channel:r,perspective:s,liveQueries:a,documentsOnPage:o}=e,[l]=(0,n.useState)(()=>new u(c.L)),d=(0,h.m85)({apiVersion:"2023-10-16"}),p=(0,n.useMemo)(()=>d.config(),[d]),m=(0,n.useMemo)(()=>d.withConfig({resultSourceMap:"withKeyArraySelector"}),[d]);(0,n.useEffect)(()=>{if(r){let{projectId:e,dataset:t}=p;r.send("loaders","loader/perspective",{projectId:e,dataset:t,perspective:s})}},[r,p,s]);let v=(0,n.useMemo)(()=>{let e=[...new Set(o.map(({_id:e})=>e))],t=l.capacity;return e.length>=t&&(e.length=t),e},[l.capacity,o]),[w,g]=(0,n.useState)(0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f,{cache:l,client:m,turboIds:v,setDocumentsCacheLastUpdated:g}),Object.entries(a).map(([e,{query:n,params:a,perspective:o}])=>(0,i.jsx)(y,{cache:l,projectId:p.projectId,dataset:p.dataset,perspective:o,query:n,params:a,channel:r,client:m,refreshInterval:s?2e3:0,liveDocument:t,documentsCacheLastUpdated:w},`${e}${o}`))]})}let f=(0,n.memo)(function(e){let{cache:t,client:r,turboIds:s,setDocumentsCacheLastUpdated:a}=e,[u,h]=(0,n.useState)([]);return(0,n.useEffect)(()=>{let e=new Set(u.flat()),r=new Set;for(let i of s)e.has(i)||t.has(i)||r.add(i);let i=[...r].slice(0,c.e);0!==i.length&&h(e=>[...e.slice(-c.e),i])},[u,t,s]),(0,n.useEffect)(()=>{let e=r.listen("*",{},{events:["mutation"],effectFormat:"mendoza",includePreviousRevision:!1,includeResult:!1,tag:"presentation-loader"}).subscribe(e=>{if("mutation"===e.type&&"disappear"===e.transition&&t.delete(e.documentId)&&a(Date.now()),"mutation"!==e.type||!e.effects?.apply?.length)return;let r=t.peek(e.documentId);if(r){let i={...r};delete i._rev;let n=(0,o.a)(i,e.effects.apply);t.set(e.documentId,n),a(Date.now())}});return()=>e.unsubscribe()},[t,r,a]),(0,i.jsx)(i.Fragment,{children:u.map(e=>(0,i.jsx)(p,{cache:t,client:r,ids:e,setDocumentsCacheLastUpdated:a},JSON.stringify(e)))})}),p=(0,n.memo)(function(e){let{client:t,cache:r,ids:i,setDocumentsCacheLastUpdated:s}=e;return(0,n.useEffect)(()=>{let e=i.filter(e=>!r.has(e));0!==e.length&&t.getDocuments(e).then(e=>{for(let t of e)t&&t?._id&&(r.set(t._id,t),s(Date.now()))},console.error)},[r,t,i,s]),null});function y(e){let{cache:t,projectId:r,dataset:i,perspective:s,query:a,client:o,refreshInterval:u,liveDocument:h,channel:c,documentsCacheLastUpdated:d}=e,f=function(e){let t=(0,n.useMemo)(()=>JSON.stringify(e||{}),[e]);return(0,n.useMemo)(()=>JSON.parse(t),[t])}(e.params),p=function(e){let{cache:t,liveDocument:r,client:i,refreshInterval:s,query:a,params:o,perspective:u,documentsCacheLastUpdated:h}
1=e,[c,d]=(0,n.useState)(null),{projectId:f,dataset:p}=(0,n.useMemo)(()=>{let{projectId:e,dataset:t}=i.config();return{projectId:e,dataset:t}},[i]),[y,m]=(0,n.useState)(null);if(y)throw y;let[w,g]=function(e){let{refreshInterval:t}=e,r=function(){let[e,t]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t(navigator.onLine);let e=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",e),window.addEventListener("offline",r),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",r)}},[]);let r=(0,n.useSyncExternalStore)(l,()=>document.visibilityState,()=>"hidden");return!e||"hidden"===r}(),[i,s]=(0,n.useState)("hit"),a=(0,n.useCallback)(()=>(s("inflight"),()=>s("hit")),[]);return(0,n.useEffect)(()=>{if(!t||"hit"!==i)return;let e=setTimeout(()=>s("stale"),t);return()=>clearTimeout(e)},[t,i]),(0,n.useEffect)(()=>{if("hit"!==i)return;let e=()=>s("stale");return window.addEventListener("focus",e),()=>window.removeEventListener("focus",e)},[t,i]),(0,n.useEffect)(()=>{r&&"hit"===i&&s("stale"),r||"stale"!==i||s("refresh")},[r,i]),[i,a]}({refreshInterval:s}),b="refresh"===w||"inflight"===w;return(0,n.useEffect)(()=>{if(!b)return;let e=!1,t=!1,r=new AbortController;async function n(){let{signal:n}=r;t=!0;let{result:s,resultSourceMap:h}=await i.fetch(a,o,{tag:"presentation-loader",signal:n,perspective:u,filterResponse:!1});t=!1,n.aborted||(d({result:s,resultSourceMap:h}),e=!0)}let s=g();return n().catch(e=>{t=!1,"AbortError"!==e.name&&m(e)}).finally(s),()=>{e||t||r.abort()}},[i,p,r,o,u,f,a,b,g]),(0,n.useMemo)(()=>h&&c?.resultSourceMap?{result:v(t,r,c.result,u,c.resultSourceMap),resultSourceMap:c.resultSourceMap}:c,[t,h,r,u,c])}({cache:t,client:o,liveDocument:h,params:f,perspective:s,query:a,refreshInterval:u,documentsCacheLastUpdated:d}),y=p?.result,m=p?.resultSourceMap;return(0,n.useEffect)(()=>{m&&c.send("loaders","loader/query-change",{projectId:r,dataset:i,perspective:s,query:a,params:f,result:y,resultSourceMap:m})},[c,i,f,s,r,a,y,m]),null}p.displayName="GetDocuments";let m=!1;function v(e,t,r,i,n){if("raw"===i)throw Error("turboChargeResultIfSourceMap does not support raw perspective");return function(e,t,r,i=a,n="raw"){if(!t)return e;if("published"!==n&&"raw"!==n&&"previewDrafts"!==n)throw Error(`Unknown perspective "${n}"`);return(0,s.lV)(JSON.parse(JSON.stringify(e)),(e,a)=>{let o=(0,s.Mx)(a,t);if(!o)return e;let{mapping:u,pathSuffix:h}=o;if("value"!==u.type||"documentValue"!==u.source.type)return e;let c=t.documents[u.source.document],l=t.paths[u.source.path];if(c){let t;let a=(0,s.F5)(l+h),o=(0,s.BB)(a);if("_id"===o||("previewDrafts"===n?((t=r(c._id.startsWith(s.jR)?c:{...c,_id:`${s.jR}${c._id}}`}))||(t=r(c._id.startsWith(s.jR)?{...c,_id:(0,s.vs)(c._id)}:c)),t&&(t={...t,_id:(0,s.vs)(c._id),_originalId:c._id})):t=r(c),!t))return e;let u=t?(0,s.U2)(t,o,e):e;return e===u?e:i(u,{cachedDocument:t,previousValue:e,sourceDocument:c,sourcePath:a})}return e})}(r,n,r=>{if(!r._projectId)return t?._id&&(0,s.vs)(t._id)===(0,s.vs)(r._id)?t:e.get(r._id);m||(console.warn("Cross dataset references are not supported yet, ignoring source document",r),m=!0)},(e,{previousValue:t})=>"number"==typeof e&&"string"==typeof t?`${e}`:e,i)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.