HorizonWorldMetadataVariantExperimentCreateTestForm.react",["fbt","ix","CometImage.react","CometRelay","GeoBaseText.react","GeoButton.react","GeoCheckboxInput.react","GeoDatePicker.react","GeoDivider.react","GeoFileSelector.react","GeoFlexbox.react","GeoHStack.react","GeoHeading.react","GeoIcon.react","GeoLink.react","GeoModal.react","GeoModalFooter.react","GeoModalHeader.react","GeoNotice.react","GeoPill.react","GeoSection.react","GeoTab.react","GeoTabGroup.react","GeoText.react","GeoTextInput.react","GeoToast.react","GeoTooltip.react","GeoVStack.react","HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation.graphql","HorizonWorldMetadataVariantExperimentCreateTestFormUpdateExperimentMutation.graphql","HorizonWorldMetadataVariantExperimentCreateTestForm_experiment.graphql","HorizonWorldMetadataVariantExperimentCreateTestForm_world.graphql","HorizonWorldMetadataVariantExperimentNoImageUploadedPlaceholder.react","LocalDate","Surface.react","Timezone","fbicon","geoMargin","nullthrows","react","useGeoToaster"],(function(a,b,c,d,e,f,g,h,i){"use strict";var j,k,l,m,n,o=n||(n=d("react")),p=n.useState,q=j!==void 0?j:j=b("HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation.graphql"),r=k!==void 0?k:k=b("HorizonWorldMetadataVariantExperimentCreateTestFormUpdateExperimentMutation.graphql");function a(a){var e=a.experiment,f=a.isModalOpen,g=a.mode,j=a.onClose,k=a.onCompleted,n=a.unsetSelectedWorld,t=a.world,u=a.world_id,v=d("CometRelay").useFragment(l!==void 0?l:l=b("HorizonWorldMetadataVariantExperimentCreateTestForm_experiment.graphql"),e);a=d("CometRelay").useFragment(m!==void 0?m:m=b("HorizonWorldMetadataVariantExperimentCreateTestForm_world.graphql"),t);t=p((e=v==null?void 0:v.name)!=null?e:"");var w=t[0];e=t[1];t=p((t=v==null?void 0:v.should_auto_publish)!=null?t:!0);var x=t[0];t=t[1];var y=p([]),z=y[0],A=y[1];y=p(v==null?void 0:v.experiment_image_uri);var B=y[0],C=y[1],D=(v==null?void 0:v.start_time)!=null?c("LocalDate").fromInstant(v==null?void 0:v.start_time,d("Timezone").PST8PDT):c("LocalDate").today(d("Timezone").PST8PDT).addDays(2);y=p(D);var E=y[0];y=y[1];var F=d("CometRelay").useMutation(q),G=F[0];F=F[1];var H=d("CometRelay").useMutation(r),I=H[0];H=H[1];var J=c("useGeoToaster")(),K=J.add,L=function(a,b,d){d===void 0&&(d="success"),K(o.jsx(c("GeoToast.react"),{description:b,heading:a,status:d}))};J=function(){var a=z[0];a={attachment_1:a};a={onCompleted:function(){L(h._(/*BTDS*/"Successfully submitted new test"),h._(/*BTDS*/"Your test will start on the specified date once itu2019s approved.")),j()},onError:function(){L(h._(/*BTDS*/"Error"),h._(/*BTDS*/"There was an error submitting your test. Please try again later."),"error")},uploadables:a,variables:{input:{control_world:c("nullthrows")(u),image_file:"attachment_1",name:w,should_auto_publish:x,start_time:((a=E==null?void 0:E.toTimestampInMilliseconds(d("Timezone").getEnvironmentTimezoneID()||d("Timezone").UTC))!=null?a:0)/1e3,test_pass_rate:.5}}};G(a)};var M=function(){var a=z[0];a={attachment_1:a};a={onCompleted:function(){L(h._(/*BTDS*/"Successfully updated test"),h._(/*BTDS*/"Your test will start on the specified date once itu2019s approved.")),k(),j()},onError:function(){L(h._(/*BTDS*/"Error"),h._(/*BTDS*/"There was an error submitting your test. Please try again later."),"error")},uploadables:a,variables:{input:{image_file:"attachment_1",world_metadata_variant_experiment_id:c("nullthrows")(v==null?void 0:v.id)}}};I(a)},N=w==null||w.trim()===""||E==null||z.length===0,O=g==="edit"&&z.length===0,P=p("ratio16_9"),Q=P[0];P=P[1];return o.jsx(c("Surface.react"),{surface:"createForm",children:o.jsx(c("GeoModal.react"),{footer:o.jsx(c("GeoModalFooter.react"),{primaryButton:o.jsx(c("GeoButton.react"),{disabledMessage:h._(/*BTDS*/"Please fill in all the fields and upload a test image."),isDisabled:N,isLoading:F||H,label:h._(/*BTDS*/"Submit for review"),onClick:g==="create"?J:M,variant:"primary"}),secondaryButton:o.jsx(c("GeoButton.react"),{isDisabled:F||H,label:h._(/*BTDS*/"Cancel"),onClick:j,variant:"default"})}),header:o.jsx(c("GeoModalHeader.react"),{description:h._(/*BTDS*/"Test your thumbnail images"),heading:g==="create"?h._(/*BTDS*/"Create an A/B test"):h._(/*BTDS*/"Edit an A/B test"),size:"header2"}),height:1200,hideOnBlur:!1,hideOnEscape:!1,isShown:f,onHide:j,width:"100%",children:o.jsxs(c("GeoFlexbox.react"),{basis:"0",direction:"column",gap:6,xstyle:s.modal,children:[o.jsx(c("GeoDivider.react"),{}),o.jsxs(c("GeoFlexbox.react"),{children:[o.jsx(c("GeoFlexbox.react"),{xstyle:s.width440,children:o.jsxs(c("GeoVStack.react"),{children:[((N=a==null?void 0:a.has_multi_screenshots)!=null?N:!1)&&o.jsx(c("GeoNotice.react"),{status:"warning",children:h._(/*BTDS*/"During a thumbnail A/B test, the test image will replace all existing images for users in test groups. This world currently uses multiple thumbnail images. {=m1}If you publish the test image from this tool, it will only replace the original default image.",[h._implicitParam("=m1",o.jsx("p",{children:h._(/*BTDS*/"")}))])}),o.jsxs(c("GeoVStack.react"),{children:[o.jsx(c("GeoHeading.react"),{level:4,children:h._(/*BTDS*/"World")}),o.jsxs(c("GeoHStack.react"),{children:[o.jsx(c("GeoText.react"),{children:(J=a==null?void 0:a.localized_name)!=null?J:""}),g==="create"&&o.jsx(c("GeoLink.react"),{onClick:n,children:h._(/*BTDS*/"Change")})]})]}),o.jsx(c("GeoTextInput.react"),{description:h._(/*BTDS*/"Give your test a unique name. This name is not visible to the public."),isDisabled:g==="edit",label:h._(/*BTDS*/"Test Name"),maxLength:30,onChange:e,value:w}),o.jsx(c("GeoHeading.react"),{level:4,children:h._(/*BTDS*/"Traffic allocation to test image: 50u0025")}),o.jsx(c("GeoDatePicker.react"),{isDisabled:g==="edit",label:h._(/*BTDS*/"Start date"),onChange:y,restraint:function(a){return a.isAfterOrEqual(c("nullthrows")(D))},tooltip:h._(/*BTDS*/"The start date should be at least 48hrs from now to allow metadata to be reviewed."),value:E}),o.jsx(c("GeoCheckboxInput.react"),{isDisabled:g==="edit",label:h._(/*BTDS*/"Automatically publish test images if they perform better"),onChange:t,tooltip:o.jsx(c("GeoTooltip.react"),{content:h._(/*BTDS*/"By publishing the new artwork, you acknowledge that a small proportion of your users will not see the new artwork so we can better understand the effectiveness of the A/B testing tool for improvement purposes. You can always change your thumbnail image from the desktop editor."),position:"right"}),trailingContent:o.jsx(c("GeoIcon.react"),{color:"default",icon:d("fbicon")._(i("479175"),12)}),value:x}),o.jsx(c("GeoNotice.react"),{status:"info",children:h._(/*BTDS*/"If the test is negative and statistically significant after running for at least 7 days, it will automatically stop.")}),o.jsx(c("GeoFileSelector.react"),{allowMultiple:!1,description:h._(/*BTDS*/"Images should be in JPEG or PNG format. Recommended image size: 2560x1440 pixels."),fileTypes:["image/*"],image:o.jsx(c("CometImage.react"),{src:i("399268")}),isOptional:!1,label:h._(/*BTDS*/"Upload test image"),maxFileSize:5*1024,onChange:function(a){A(a),C(a.length>0?URL.createObjectURL(a[0]):null)},showSelectedFileNames:!0,value:z})]})}),o.jsx(c("GeoFlexbox.react"),{grow:1,xstyle:s.box,children:o.jsx(c("GeoSection.react"),{variant:"secondary",children:o.jsxs(c("GeoVStack.react"),{xstyle:s.imageSection,children:[o.jsxs(c("GeoHStack.react"),{justifyContent:"space-between",children:[o.jsx(c("GeoHeading.react"),{level:4,children:h._(/*BTDS*/"Preview")}),o.jsxs(c("GeoTabGroup.react"),{onChange:P,value:Q,children:[o.jsx(c("GeoTab.react"),{label:"16:9",value:"ratio16_9"}),o.jsx(c("GeoTab.react"),{label:"4:3",value:"ratio4_3"}),o.jsx(c("GeoTab.react"),{label:"1:1",value:"ratio1_1"})]})]}),o.jsxs(c("GeoHStack.react"),{alignItems:"center",alignSelf:"center",children:[o.jsxs(c("GeoVStack.react"),{alignItems:"center",children:[o.jsx(c("GeoPill.react"),{label:h._(/*BTDS*/"Original"),status:"success",value:"Original"}),o.jsx(c("CometImage.react"),{height:330,objectFit:"cover",src:(M=a==null?void 0:a.primary_screenshot_uri)!=null?M:"",width:Q==="ratio16_9"?586:Q==="ratio4_3"?440:300}),O&&o.jsx(c("GeoBaseText.react"),{color:"error",size:"value",children:h._(/*BTDS*/".")})]}),o.jsxs(c("GeoVStack.react"),{alignItems:"center",children:[o.jsx(c("GeoPill.react"),{label:h._(/*BTDS*/"Test"),status:"warning",value:"Test"}),o.jsx(c("HorizonWorldMetadataVariantExperimentNoImageUploadedPlaceholder.react"),{activeRatioTab:Q,uploadedImageURL:B}),O&&o.jsxs(c("GeoFlexbox.react"),{direction:"row",children:[o.jsx(c("GeoIcon.react"),{color:"error",icon:d("fbicon")._(i("502061"),16),xstyle:c("geoMargin").end4}),o.jsx(c("GeoBaseText.react"),{color:"error",size:"value",children:h._(/*BTDS*/"This image is not compliant with our policy. Please update.")})]})]})]})]})})})]})]})})})}a.displayName=a.name+" [from "+f.id+"]";var s={box:{paddingInlineEnd:"xv54qhq",paddingInlineStart:"xf7dkkf",$$css:!0},imageSection:{paddingTop:"xqy66fx",paddingInlineEnd:"xyri2b",paddingBottom:"xr1496l",paddingInlineStart:"x1c1uobl",rowGap:"xhplpxo",$$css:!0},modal:{paddingTop:"xexx8yu",paddingInlineEnd:"x1q3ajuy",paddingBottom:"x18d9i69",paddingInlineStart:"x1gx403c",$$css:!0},width440:{width:"x1peuizl",$$css:!0}};g["default"]=a}),226);
-----
HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"XOCCreateWorldMetadataVariantExperimentResponsePayload",kind:"LinkedField",name:"xoc_create_world_metadata_variant_experiment",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"client_mutation_id",storageKey:null},{alias:null,args:null,concreteType:"XOCWorldMetadataVariantExperiment",kind:"LinkedField",name:"world_metadata_variant_experiment",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation",selections:b},params:{id:"8906353459466315",metadata:{},name:"HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
-----
HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation.graphql",[],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],b=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"XOCCreateWorldMetadataVariantExperimentResponsePayload",kind:"LinkedField",name:"xoc_create_world_metadata_variant_experiment",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"client_mutation_id",storageKey:null},{alias:null,args:null,concreteType:"XOCWorldMetadataVariantExperiment",kind:"LinkedField",name:"world_metadata_variant_experiment",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"status",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation",selections:b,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation",selections:b},params:{id:"8906353459466315",metadata:{},name:"HorizonWorldMetadataVariantExperimentCreateTestFormSaveExperimentMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----