OCDevManageWorldsReportAddSessions.react",["fbt","AbstractSearchSource","CometRelay","GeoSpinner.react","GeoTokenizer.react","GeoTokenizerToken.react","OCDevManagePlaceholder.react","OCDevManageWorldsReportAddSessionsQuery.graphql","OCDevManageWorldsReportAddSessionsSessionQuery.graphql","SearchableEntry","asyncToGeneratorRuntime","formatDate","react"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k,l=k||(k=d("react"));e=k;var m=e.useEffect,n=e.useMemo,o=e.useState;function a(a){var b=a.editSessions;a=a.onUpdateSessions;return l.jsx(c("OCDevManagePlaceholder.react"),{fallback:l.jsx(c("GeoSpinner.react"),{}),children:l.jsx(p,{editSessions:b,onUpdateSessions:a})})}a.displayName=a.name+" [from "+f.id+"]";function p(a){var b=a.editSessions,e=a.onUpdateSessions,f=d("CometRelay").useRelayEnvironment();a=o([]);var g=a[0],i=a[1];m(function(){!b||b.length===0?i([]):i(b.map(function(a){return new(c("SearchableEntry"))({auxiliaryData:{traces:a.traces},title:c("formatDate")(a.start_time,"M j, Y g:i A")+" ("+a.session_id+")",uniqueID:a.session_id})}))},[b]);m(function(){e(g.map(function(a){return{session_id:a.getUniqueID(),start_time:a.getTitle(),traces:a.getAuxiliaryData().traces}}))},[e,g]);a=n(function(){return new q(f)},[f]);return l.jsx(c("GeoTokenizer.react"),{label:h._(/*BTDS*/"Sessions"),placeholder:h._(/*BTDS*/"Search for a session by ID or date"),searchSource:a,tokenRenderer:function(a){return l.jsx(c("GeoTokenizerToken.react"),{media:String(a.getPhoto()).length>0?a.getPhoto():null})},value:g,onChange:i})}p.displayName=p.name+" [from "+f.id+"]";var q=function(e){babelHelpers.inheritsLoose(a,e);function a(a){var b;b=e.call(this)||this;b.$SearchSource$p_1=a;void b.$SearchSource$p_3();return b}var f=a.prototype;f.searchImpl=function(a,b){void this.$SearchSource$p_4(a,b)};f.$SearchSource$p_4=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a,b){var d=a.trim().toLowerCase();this.$SearchSource$p_2==null&&(yield this.$SearchSource$p_3());if(s(d)){a=(yield this.$SearchSource$p_5(d));if(a==null){b([],d);return}b([new(c("SearchableEntry"))({auxiliaryData:{traces:a.traces},title:c("formatDate")(a.start_time,"M j, Y g:i A")+" ("+a.session_id+")",uniqueID:a.session_id})],d);return}a=(a=this.$SearchSource$p_2)!=null?a:[];b(a.map(function(a){return new(c("SearchableEntry"))({auxiliaryData:{traces:a.traces},title:a.start_time+" ("+a.session_id+")",uniqueID:a.session_id})}).filter(function(a){return d.length>0&&a.getTitle().toLowerCase().includes(d)}),d)});function d(b,c){return a.apply(this,arguments)}return d}();f.$SearchSource$p_5=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(a){var b;a=(yield d("CometRelay").fetchQuery(this.$SearchSource$p_1,t,{session_id:a}).toPromise());a=a==null?void 0:a.xfb_horizon_session_from_uuid;if(a==null)return null;b=(b=a.performance_traces)==null?void 0:b.nodes.map(function(a){var b;b={creation_time:a.creation_time,id:a.id,name:a.name,trace_artifact_url:(b=a.trace_artifact_url)!=null?b:"",trace_session_id:a.trace_session_id,trace_type:a.trace_type};return b});return{session_id:a.session_id,start_time:c("formatDate")(a.start_time,"M j, Y g:i A"),traces:b}});function e(b){return a.apply(this,arguments)}return e}();f.$SearchSource$p_3=function(){var a=b("asyncToGeneratorRuntime").asyncToGenerator(function*(){var a=(yield d("CometRelay").fetchQuery(this.$SearchSource$p_1,u,{}).toPromise());a=(a=a==null?void 0:(a=a.xfb_viewer)==null?void 0:(a=a.together_app_user)==null?void 0:a.sessions.edges)!=null?a:[];this.$SearchSource$p_2=a.filter(function(a){return a.node.performance_traces.nodes.some(function(a){return a.trace_type==="PLAYTEST"})}).map(function(a){a=a.node;var b=a.performance_traces.nodes.map(function(a){var b;return{creation_time:a.creation_time,id:a.id,name:a.name,trace_artifact_url:(b=a.trace_artifact_url)!=null?b:"",trace_session_id:a.trace_session_id,trace_type:a.trace_type}});return{session_id:a.session_id,start_time:c("formatDate")(a.start_time,"M j, Y g:i A"),traces:b}})});function e(){return a.apply(this,arguments)}return e}();return a}(c("AbstractSearchSource")),r=/^[A-Fd]{8}-[A-Fd]{4}-4[A-Fd]{3}-[89AB][A-Fd]{3}-[A-Fd]{12}$/i;function s(a){return a.match(r)}var t=i!==void 0?i:i=b("OCDevManageWorldsReportAddSessionsSessionQuery.graphql"),u=j!==void 0?j:j=b("OCDevManageWorldsReportAddSessionsQuery.graphql");g["default"]=a}),226);
-----
OCDevManageWorldsReportAddSessionsQuery.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{kind:"Literal",name:"first",value:25}],b={alias:null,args:null,kind:"ScalarField",name:"session_id",storageKey:null},c={alias:null,args:null,kind:"ScalarField",name:"start_time",storageKey:null},d={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},e={alias:null,args:null,kind:"ScalarField",name:"trace_session_id",storageKey:null},f={alias:null,args:null,kind:"ScalarField",name:"trace_artifact_url",storageKey:null},g={alias:null,args:null,kind:"ScalarField",name:"name",storageKey:null},h={alias:null,args:null,kind:"ScalarField",name:"trace_type",storageKey:null},i={alias:null,args:null,kind:"ScalarField",name:"creation_time",storageKey:null};return{fragment:{argumentDefinitions:[],kind:"Fragment",metadata:{throwOnFieldError:!0},name:"OCDevManageWorldsReportAddSessionsQuery",selections:[{alias:null,args:null,concreteType:"XFBViewer",kind:"LinkedField",name:"xfb_viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBTogetherAppUser",kind:"LinkedField",name:"together_app_user",plural:!1,selections:[{alias:null,args:a,concreteType:"XFBTogetherAppUserSessionsConnection",kind:"LinkedField",name:"sessions",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBTogetherAppUserSessionsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"XFBHorizonSession",kind:"LinkedField",name:"node",plural:!1,selections:[b,c,{alias:null,args:null,concreteType:"XFBHorizonSessionPerformanceTracesConnection",kind:"LinkedField",name:"performance_traces",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBHorizonPerformanceTrace",kind:"LinkedField",name:"nodes",plural:!0,selections:[{kind:"RequiredField",field:d,action:"THROW"},{kind:"RequiredField",field:e,action:"THROW"},f,g,h,i],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:"sessions(first:25)"}],storageKey:null}],storageKey:null}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[],kind:"Operation",name:"OCDevManageWorldsReportAddSessionsQuery",selections:[{alias:null,args:null,concreteType:"XFBViewer",kind:"LinkedField",name:"xfb_viewer",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBTogetherAppUser",kind:"LinkedField",name:"together_app_user",plural:!1,selections:[{alias:null,args:a,concreteType:"XFBTogetherAppUserSessionsConnection",kind:"LinkedField",name:"sessions",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBTogetherAppUserSessionsEdge",kind:"LinkedField",name:"edges",plural:!0,selections:[{alias:null,args:null,concreteType:"XFBHorizonSession",kind:"LinkedField",name:"node",plural:!1,selections:[b,c,{alias:null,args:null,concreteType:"XFBHorizonSessionPerformanceTracesConnection",kind:"LinkedField",name:"performance_traces",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBHorizonPerformanceTrace",kind:"LinkedField",name:"nodes",plural:!0,selections:[d,e,f,g,h,i],storageKey:null}],storageKey:null},d],storageKey:null}],storageKey:null}],storageKey:"sessions(first:25)"},d],storageKey:null}],storageKey:null}]},params:{id:"9990389051079916",metadata:{},name:"OCDevManageWorldsReportAddSessionsQuery",operationKind:"query",text:null}}}();e.exports=a}),null);
-----