import{c as j,j as V,dH as me,f as M,h as B,R as i,J as ge,dF as pe,dI as F,dJ as ye,dK as he,cr as C,U as H,dL as ve,dM as _e,a as w,dN as be,dO as Se,dP as Ae,Y as we,dQ as Ee,N as ke,dB as De,dR as Le,r as N,dS as Te,dT as Oe,x as Ce,dA as Pe,dU as Ie,dV as Fe,dW as xe,cN as Me,dX as Ne,dY as Re,dZ as Ge,d_ as Ke,d$ as Ue}from"./index-CZbjPy2v.js";const qe=j(V.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"}),"DarkMode"),ze=j(V.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"}),"LightMode"),Qe=`import fiftyone as fo

# Name of an existing dataset
name = "quickstart"

dataset = fo.load_dataset(name)

# Launch a new App session
session = fo.launch_app(dataset)

# If you already have an active App session
# session.dataset = dataset`,We=`import fiftyone as fo

dataset = fo.load_dataset("$CURRENT_DATASET_NAME")

samples = []
for filepath, label in zip(filepaths, labels):
    sample = fo.Sample(filepath=filepath)
    sample["ground_truth"] = fo.Classification(label=label)
    samples.append(sample)

dataset.add_samples(samples)`,je=`import fiftyone as fo

# A name for the dataset
name = "my-dataset"

# The directory containing the data to import
dataset_dir = "/path/to/data"

# The type of data being imported
dataset_type = fo.types.COCODetectionDataset

dataset = fo.Dataset.from_dir(
    dataset_dir=dataset_dir,
    dataset_type=dataset_type,
    name=name,
)`,Ve={SELECT_DATASET:{title:"No dataset selected",code:Qe,subtitle:"Select a dataset with dataset selector above or",codeTitle:"Select a dataset with code",codeSubtitle:"Use Python or command line tools to set dataset for the current session",learnMoreLink:"https://docs.voxel51.com/user_guide/app.html",learnMoreLabel:"about using the Fiftyone App"},ADD_SAMPLE:{title:"No samples yet",code:We,subtitle:"Add samples to this dataset with code or",codeTitle:"Add samples with code",codeSubtitle:"Use Python or command line tools to add sample to this dataset",learnMoreLink:"https://docs.voxel51.com/user_guide/dataset_creation/index.html#custom-formats",learnMoreLabel:"about loading data into FiftyOne"},ADD_DATASET:{title:"No datasets yet",code:je,subtitle:"Add a dataset to FiftyOne with code or",codeTitle:"Create dataset with code",codeSubtitle:"Use Python or command line tools to add dataset to FiftyOne",learnMoreLink:"https://docs.voxel51.com/user_guide/dataset_creation/index.html",learnMoreLabel:"about loading data into FiftyOne"}},Q="@voxel51/utils/create_dataset",W="@voxel51/io/import_samples",Be="https://github.com/voxel51/fiftyone-plugins/tree/main/plugins/utils",He="https://github.com/voxel51/fiftyone-plugins/tree/main/plugins/io",$e="@voxel51/utils",Ye="@voxel51/io";function ut(o){const{mode:s}=o,d=me(!0),c=M(B);if(!s)return null;if(!d)return i.createElement(ge,null,"Pixelating...");const{code:p,codeTitle:y,learnMoreLabel:v,learnMoreLink:u,title:m}=Ve[s],f=p.replace("$CURRENT_DATASET_NAME",c),g=s==="SELECT_DATASET";return i.createElement(i.Fragment,null,i.createElement(pe,null),i.createElement(F,{spacing:6,divider:i.createElement(ye,{sx:{width:"100%"}}),sx:{fontWeight:"normal",alignItems:"center",width:"100%",py:8,overflow:"auto"},className:he},i.createElement(F,{alignItems:"center",spacing:1},i.createElement(C,{sx:{fontSize:16}},m),g&&i.createElement(C,{color:"text.secondary"},"You can use the selector above to open an existing dataset"),i.createElement(Ze,{...o}),!g&&i.createElement(C,{color:"text.secondary"},i.createElement(H,{href:u,target:"_blank",sx:{textDecoration:"underline",":hover":{textDecoration:"none"}}},"Learn more")," ",v)),i.createElement(F,{alignItems:"center"},i.createElement(C,{sx:{fontSize:16}},y),i.createElement(C,{sx:{pb:2},color:"text.secondary"},"You can use Python to ",s==="ADD_DATASET"&&i.createElement(i.Fragment,null,i.createElement(x,{href:u,target:"_blank"},"load data")," into FiftyOne"),g&&i.createElement(i.Fragment,null,"load a dataset in the App"),s==="ADD_SAMPLE"&&i.createElement(i.Fragment,null,i.createElement(x,{href:u,target:"_blank"},"add samples")," to this dataset")),i.createElement(ve,{tabs:[{id:"python",label:"Python",code:f}]}))))}function Ze(o){const{mode:s}=o,d=_e(),c=s==="ADD_SAMPLE",p=w.useCallback(L=>Array.isArray(d.choices)?d.choices.some(O=>(O==null?void 0:O.value)===L):!1,[d]),y=w.useMemo(()=>c?!1:p(Q),[c,p]),v=w.useMemo(()=>c?p(W):!1,[c,p]),u=c?v:y,m=c?He:Be,f=c?Ye:$e,g=c?"add samples to this dataset":"create a new dataset",T=c?"add samples to datasets":"create datasets",D=c?W:Q;return i.createElement(C,{color:"text.secondary"},u?i.createElement(i.Fragment,null,i.createElement(Je,{uri:D}),"to ",g):i.createElement(i.Fragment,null,"Did you know? You can ",T," in the App by installing the ",i.createElement(x,{href:m,target:"_blank"},f)," plugin"),", or ",i.createElement($,{onClick:d.toggle},"browse operations")," for other options")}function Je(o){const{uri:s,prompt:d=!0}=o,c=be(),{execute:p}=Se(s),y=w.useCallback(()=>{d?c(s):p({})},[d,c,s,p]);return i.createElement($,{onClick:y},"Click here")}function $(o){return i.createElement(Ae,{...o,sx:{p:0,textTransform:"none",fontSize:"inherit",lineHeight:"inherit",verticalAlign:"baseline",color:s=>s.palette.text.primary,textDecoration:"underline",...(o==null?void 0:o.sx)||{}}})}function x(o){return i.createElement(H,{...o,sx:{textDecoration:"underline",":hover":{textDecoration:"none"},...(o==null?void 0:o.sx)||{}}})}const Y={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"NavFragment",selections:[{args:null,kind:"FragmentSpread",name:"NavDatasets"},{args:null,kind:"FragmentSpread",name:"NavGA"}],type:"Query",abstractKey:null};Y.hash="f8b963593ae22123acdf5393b9a8a274";const Z={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"NavGA",selections:[{alias:null,args:null,kind:"ScalarField",name:"context",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"dev",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"doNotTrack",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"uid",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"version",storageKey:null}],type:"Query",abstractKey:null};Z.hash="a2d13e827ff06e46baffc9244d708b0a";const J=function(){var o=[{defaultValue:null,kind:"LocalArgument",name:"count"},{defaultValue:null,kind:"LocalArgument",name:"cursor"},{defaultValue:null,kind:"LocalArgument",name:"search"}],s=[{kind:"Variable",name:"after",variableName:"cursor"},{kind:"Variable",name:"first",variableName:"count"},{kind:"Variable",name:"search",variableName:"search"}];return{fragment:{argumentDefinitions:o,kind:"Fragment",metadata:null,name:"DatasetsPaginationQuery",selections:[{args:null,kind:"FragmentSpread",name:"NavDatasets"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:o,kind:"Operation",name:"DatasetsPaginationQuery",selections:[{alias:null,args:s,concreteType:"DatasetStrConnection",kind:"LinkedField",name:"datasets",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null},{alias:null,args:null,concreteType:"DatasetStrEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetStrPageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:s,filters:["search"],handle:"connection",key:"DatasetsList_query_datasets",kind:"LinkedHandle",name:"datasets"}]},params:{cacheID:"51829dc84906da9b415d984d01b4ef24",id:null,metadata:{},name:"DatasetsPaginationQuery",operationKind:"query",text:`query DatasetsPaginationQuery(
  $count: Int
  $cursor: String
  $search: String
) {
  ...NavDatasets
}

fragment NavDatasets on Query {
  datasets(search: $search, first: $count, after: $cursor) {
    total
    edges {
      cursor
      node {
        name
        id
        __typename
      }
    }
    pageInfo {
      endCursor
      hasNextPage
    }
  }
}
`}}}();J.hash="c3d4960b5532b1af0f3fe881adf27805";const X=function(){var o=["datasets"];return{argumentDefinitions:[{kind:"RootArgument",name:"count"},{kind:"RootArgument",name:"cursor"},{kind:"RootArgument",name:"search"}],kind:"Fragment",metadata:{connection:[{count:"count",cursor:"cursor",direction:"forward",path:o}],refetch:{connection:{forward:{count:"count",cursor:"cursor"},backward:null,path:o},fragmentPathInResult:[],operation:J}},name:"NavDatasets",selections:[{alias:"datasets",args:[{kind:"Variable",name:"search",variableName:"search"}],concreteType:"DatasetStrConnection",kind:"LinkedField",name:"__DatasetsList_query_datasets_connection",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"total",storageKey:null},{alias:null,args:null,concreteType:"DatasetStrEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,kind:"ScalarField",name:"cursor",storageKey:null},{alias:null,args:null,concreteType:"Dataset",kind:"LinkedField",name:"node",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"__typename",storageKey:null}],storageKey:null}],storageKey:null},{alias:null,args:null,concreteType:"DatasetStrPageInfo",kind:"LinkedField",name:"pageInfo",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"endCursor",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"hasNextPage",storageKey:null}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null}}();X.hash="c3d4960b5532b1af0f3fe881adf27805";var ee={},te={},ae={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var s=function(){for(var p=arguments.length,y=new Array(p),v=0;v<p;v++)y[v]=arguments[v];if(typeof window<"u"){var u;typeof window.gtag>"u"&&(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)}),(u=window).gtag.apply(u,y)}},d=s;o.default=d})(ae);var ne={};(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=v;var s=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function d(u){return u.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(m,f,g){return f>0&&f+m.length!==g.length&&m.search(s)>-1&&g.charAt(f-2)!==":"&&(g.charAt(f+m.length)!=="-"||g.charAt(f-1)==="-")&&g.charAt(f-1).search(/[^\s-]/)<0?m.toLowerCase():m.substr(1).search(/[A-Z]|\../)>-1?m:m.charAt(0).toUpperCase()+m.substr(1)})}function c(u){return typeof u=="string"&&u.indexOf("@")!==-1}var p="REDACTED (Potential Email Address)";function y(u){return c(u)?(console.warn("This arg looks like an email address, redacting."),p):u}function v(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,g=u||"";return m&&(g=d(u)),f&&(g=y(g)),g}})(ne);(function(o){Object.defineProperty(o,"__esModule",{value:!0}),o.default=o.GA4=void 0;var s=v(ae),d=v(ne),c=["eventCategory","eventAction","eventLabel","eventValue","hitType"],p=["title","location"],y=["page","hitType"];function v(n){return n&&n.__esModule?n:{default:n}}function u(n,e){if(n==null)return{};var t=m(n,e),a,r;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(r=0;r<l.length;r++)a=l[r],!(e.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(n,a)&&(t[a]=n[a])}return t}function m(n,e){if(n==null)return{};var t={},a=Object.keys(n),r,l;for(l=0;l<a.length;l++)r=a[l],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function f(n){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(n)}function g(n){return L(n)||D(n)||R(n)||T()}function T(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function L(n){if(Array.isArray(n))return I(n)}function O(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,a)}return t}function k(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?O(Object(t),!0).forEach(function(a){b(n,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach(function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(t,a))})}return n}function re(n,e){return ie(n)||le(n,e)||R(n,e)||oe()}function oe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function R(n,e){if(n){if(typeof n=="string")return I(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return I(n,e)}}function I(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,a=new Array(e);t<e;t++)a[t]=n[t];return a}function le(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var a,r,l,h,_=[],S=!0,A=!1;try{if(l=(t=t.call(n)).next,e!==0)for(;!(S=(a=l.call(t)).done)&&(_.push(a.value),_.length!==e);S=!0);}catch(E){A=!0,r=E}finally{try{if(!S&&t.return!=null&&(h=t.return(),Object(h)!==h))return}finally{if(A)throw r}}return _}}function ie(n){if(Array.isArray(n))return n}function se(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ue(n,e){for(var t=0;t<e.length;t++){var a=e[t];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(n,G(a.key),a)}}function ce(n,e,t){return e&&ue(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function b(n,e,t){return e=G(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function G(n){var e=de(n,"string");return f(e)==="symbol"?e:String(e)}function de(n,e){if(f(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var a=t.call(n,e||"default");if(f(a)!=="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var K=function(){function n(){var e=this;se(this,n),b(this,"reset",function(){e.isInitialized=!1,e._testMode=!1,e._currentMeasurementId,e._hasLoadedGA=!1,e._isQueuing=!1,e._queueGtag=[]}),b(this,"_gtag",function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];e._testMode||e._isQueuing?e._queueGtag.push(a):s.default.apply(void 0,a)}),b(this,"_loadGA",function(t,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"https://www.googletagmanager.com/gtag/js";if(!(typeof window>"u"||typeof document>"u")&&!e._hasLoadedGA){var l=document.createElement("script");l.async=!0,l.src="".concat(r,"?id=").concat(t),a&&l.setAttribute("nonce",a),document.body.appendChild(l),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},e._hasLoadedGA=!0}}),b(this,"_toGtagOptions",function(t){if(t){var a={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"},r=Object.entries(t).reduce(function(l,h){var _=re(h,2),S=_[0],A=_[1];return a[S]?l[a[S]]=A:l[S]=A,l},{});return r}}),b(this,"initialize",function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!t)throw new Error("Require GA_MEASUREMENT_ID");var r=typeof t=="string"?[{trackingId:t}]:t;e._currentMeasurementId=r[0].trackingId;var l=a.gaOptions,h=a.gtagOptions,_=a.nonce,S=a.testMode,A=S===void 0?!1:S,E=a.gtagUrl;if(e._testMode=A,A||e._loadGA(e._currentMeasurementId,_,E),e.isInitialized||(e._gtag("js",new Date),r.forEach(function(P){var z=k(k(k({},e._toGtagOptions(k(k({},l),P.gaOptions))),h),P.gtagOptions);Object.keys(z).length?e._gtag("config",P.trackingId,z):e._gtag("config",P.trackingId)})),e.isInitialized=!0,!A){var U=g(e._queueGtag);for(e._queueGtag=[],e._isQueuing=!1;U.length;){var q=U.shift();e._gtag.apply(e,g(q)),q[0]==="get"&&(e._isQueuing=!0)}}}),b(this,"set",function(t){if(!t){console.warn("`fieldsObject` is required in .set()");return}if(f(t)!=="object"){console.warn("Expected `fieldsObject` arg to be an Object");return}Object.keys(t).length===0&&console.warn("empty `fieldsObject` given to .set()"),e._gaCommand("set",t)}),b(this,"_gaCommandSendEvent",function(t,a,r,l,h){e._gtag("event",a,k(k({event_category:t,event_label:r,value:l},h&&{non_interaction:h.nonInteraction}),e._toGtagOptions(h)))}),b(this,"_gaCommandSendEventParameters",function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];if(typeof a[0]=="string")e._gaCommandSendEvent.apply(e,g(a.slice(1)));else{var l=a[0],h=l.eventCategory,_=l.eventAction,S=l.eventLabel,A=l.eventValue;l.hitType;var E=u(l,c);e._gaCommandSendEvent(h,_,S,A,E)}}),b(this,"_gaCommandSendTiming",function(t,a,r,l){e._gtag("event","timing_complete",{name:a,value:r,event_category:t,event_label:l})}),b(this,"_gaCommandSendPageview",function(t,a){if(a&&Object.keys(a).length){var r=e._toGtagOptions(a),l=r.title,h=r.location,_=u(r,p);e._gtag("event","page_view",k(k(k(k({},t&&{page_path:t}),l&&{page_title:l}),h&&{page_location:h}),_))}else t?e._gtag("event","page_view",{page_path:t}):e._gtag("event","page_view")}),b(this,"_gaCommandSendPageviewParameters",function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];if(typeof a[0]=="string")e._gaCommandSendPageview.apply(e,g(a.slice(1)));else{var l=a[0],h=l.page;l.hitType;var _=u(l,y);e._gaCommandSendPageview(h,_)}}),b(this,"_gaCommandSend",function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];var l=typeof a[0]=="string"?a[0]:a[0].hitType;switch(l){case"event":e._gaCommandSendEventParameters.apply(e,a);break;case"pageview":e._gaCommandSendPageviewParameters.apply(e,a);break;case"timing":e._gaCommandSendTiming.apply(e,g(a.slice(1)));break;case"screenview":case"transaction":case"item":case"social":case"exception":console.warn("Unsupported send command: ".concat(l));break;default:console.warn("Send command doesn't exist: ".concat(l))}}),b(this,"_gaCommandSet",function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];typeof a[0]=="string"&&(a[0]=b({},a[0],a[1])),e._gtag("set",e._toGtagOptions(a[0]))}),b(this,"_gaCommand",function(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),l=1;l<a;l++)r[l-1]=arguments[l];switch(t){case"send":e._gaCommandSend.apply(e,r);break;case"set":e._gaCommandSet.apply(e,r);break;default:console.warn("Command doesn't exist: ".concat(t))}}),b(this,"ga",function(){for(var t=arguments.length,a=new Array(t),r=0;r<t;r++)a[r]=arguments[r];if(typeof a[0]=="string")e._gaCommand.apply(e,a);else{var l=a[0];e._gtag("get",e._currentMeasurementId,"client_id",function(h){e._isQueuing=!1;var _=e._queueGtag;for(l({get:function(E){return E==="clientId"?h:E==="trackingId"?e._currentMeasurementId:E==="apiVersion"?"1":void 0}});_.length;){var S=_.shift();e._gtag.apply(e,g(S))}}),e._isQueuing=!0}return e.ga}),b(this,"event",function(t,a){if(typeof t=="string")e._gtag("event",t,e._toGtagOptions(a));else{var r=t.action,l=t.category,h=t.label,_=t.value,S=t.nonInteraction,A=t.transport;if(!l||!r){console.warn("args.category AND args.action are required in event()");return}var E={hitType:"event",eventCategory:(0,d.default)(l),eventAction:(0,d.default)(r)};h&&(E.eventLabel=(0,d.default)(h)),typeof _<"u"&&(typeof _!="number"?console.warn("Expected `args.value` arg to be a Number."):E.eventValue=_),typeof S<"u"&&(typeof S!="boolean"?console.warn("`args.nonInteraction` must be a boolean."):E.nonInteraction=S),typeof A<"u"&&(typeof A!="string"?console.warn("`args.transport` must be a string."):(["beacon","xhr","image"].indexOf(A)===-1&&console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),E.transport=A)),e._gaCommand("send",E)}}),b(this,"send",function(t){e._gaCommand("send",t)}),this.reset()}return ce(n,[{key:"gtag",value:function(){this._gtag.apply(this,arguments)}}]),n}();o.GA4=K;var fe=new K;o.default=fe})(te);(function(o){function s(u){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},s(u)}Object.defineProperty(o,"__esModule",{value:!0}),o.default=o.ReactGAImplementation=void 0;var d=p(te);function c(u){if(typeof WeakMap!="function")return null;var m=new WeakMap,f=new WeakMap;return(c=function(T){return T?f:m})(u)}function p(u,m){if(u&&u.__esModule)return u;if(u===null||s(u)!=="object"&&typeof u!="function")return{default:u};var f=c(m);if(f&&f.has(u))return f.get(u);var g={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var D in u)if(D!=="default"&&Object.prototype.hasOwnProperty.call(u,D)){var L=T?Object.getOwnPropertyDescriptor(u,D):null;L&&(L.get||L.set)?Object.defineProperty(g,D,L):g[D]=u[D]}return g.default=u,f&&f.set(u,g),g}var y=d.GA4;o.ReactGAImplementation=y;var v=d.default;o.default=v})(ee);const Xe=we(ee);function et(o,s){var d=w.useRef(!1),c=w.useRef(),p=w.useRef(o),y=w.useCallback(function(){return d.current},[]),v=w.useCallback(function(){d.current=!1,c.current&&clearTimeout(c.current),c.current=setTimeout(function(){d.current=!0,p.current()},s)},[s]),u=w.useCallback(function(){d.current=null,c.current&&clearTimeout(c.current)},[]);return w.useEffect(function(){p.current=o},[o]),w.useEffect(function(){return v(),u},[s]),[y,u,v]}function tt(o,s,d){d===void 0&&(d=[]);var c=et(o,s),p=c[0],y=c[1],v=c[2];return w.useEffect(v,d),[p,y]}const at={app_ids:{prod:"G-NT3FLN0QHF",dev:"G-7TMZEFFWB7"},dimensions:{dev:"dimension1",version:"dimension2",context:"dimension3"}},nt=({className:o,value:s})=>i.createElement("a",{className:o,title:s},s),rt=({useSearch:o})=>{const s=Ee(),d=M(B);return i.createElement(ke,{component:nt,placeholder:"Select dataset",inputStyle:{height:40,maxWidth:300},containerStyle:{position:"relative"},onSelect:async c=>(s(c),c),overflow:!0,useSearch:o,value:d})};function ot(){return i.createElement(De,{href:"https://voxel51.com/book-a-demo/?utm_source=FiftyOneApp"},i.createElement(Le,null,"Have a Team?"))}const lt=o=>s=>{const d=M(Ue),{data:c,refetch:p}=N.usePaginationFragment(X,o);return tt(()=>{p({search:s})},200,[s,d]),w.useMemo(()=>({total:c.datasets.total===null?void 0:c.datasets.total,values:c.datasets.edges.map(y=>y.node.name)}),[c])},it=o=>{const s=N.useFragment(Z,o);w.useEffect(()=>{if(s.doNotTrack)return;const c=s.dev?"dev":"prod";Xe.initialize(at.app_ids[c],{testMode:!1,gaOptions:{storage:"none",cookieDomain:"none",clientId:s.uid,page_location:"omitted",page_path:"omitted",kind:Ke()?"Desktop":"Web",version:s.version,context:s.context,checkProtocolTask:null}})},[])},ct=({fragment:o,hasDataset:s})=>{const d=N.useFragment(Y,o);it(d);const c=lt(d),p=Te(),{mode:y,setMode:v}=Oe(),[u,m]=Ce(Pe);return i.createElement(Ie,{title:"FiftyOne",onRefresh:p,navChildren:i.createElement(rt,{useSearch:c})},s&&i.createElement(w.Suspense,{fallback:i.createElement("div",{style:{flex:1}})},i.createElement(Fe,null)),!s&&i.createElement("div",{style:{flex:1}}),i.createElement("div",{className:xe},i.createElement(ot,null),i.createElement(Me,{title:y==="dark"?"Light mode":"Dark mode",onClick:()=>{const f=y==="dark"?"light":"dark";v(f),m(f)},sx:{color:f=>f.palette.text.secondary,pr:0}},y==="dark"?i.createElement(ze,{color:"inherit"}):i.createElement(qe,null)),i.createElement(Ne,null),i.createElement(Re,null),i.createElement(Ge,null)))};export{ct as N,ut as S};
