@getontime/cli
Version:
Time keeping for live events
2 lines • 3.27 kB
JavaScript
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./Button-legacy-DpgzgT04.js","./constants-legacy-CvecvM28.js","./useSettings-legacy-CmEM1qbK.js","./Input-legacy-CNt711cd.js","./assets-legacy-CsCyioqi.js","./index-legacy-NWDCUII5.js","./Info-legacy-6yM0-oGU.js","./Modal-legacy-CjFHV5U2.js"],function(e,t){var n,s,i,o,r,a,c,l,d,u,f,g,h,y,j,b,m,p,_,x,v;function k(e){const t={};return Object.keys(r).forEach(n=>{t[E(n)]=e[n]||""}),t}function E(e){return e.replace(".","_")}return e("default",function({isOpen:e,onClose:t}){const{userTranslation:n,postUserTranslation:s}=h(),i=(0,_.useMemo)(()=>k(n),[n]),{handleSubmit:p,register:w,reset:S,formState:{isSubmitting:C,isDirty:I,errors:O,isValid:T},setError:D}=j({defaultValues:i,mode:"onChange"});return(0,_.useEffect)(()=>{e&&S(i)},[i,e,S]),(0,v.jsx)(m,{title:"Edit custom translations",isOpen:e,onClose:t,showCloseButton:!0,showBackdrop:!0,bodyElements:(0,v.jsxs)(d,{as:"form",onSubmit:p(async e=>{try{const t={};Object.keys(e).forEach(n=>{t[function(e){return e.replace("_",".")}(n)]=e[n]}),await s(t),S(e)}catch(t){D("root",{message:o(t)})}}),id:"custom-translations-form",children:[(0,v.jsxs)(b,{children:["Provide custom translations for the public views of Ontime. ",(0,v.jsx)("br",{}),'You will need to activate this in the settings by selecting "Custom" as the views language.']}),(0,v.jsx)(y,{children:Object.entries(r).map(([e,t])=>(0,v.jsxs)(l,{children:[(0,v.jsx)(f,{title:t,description:"",error:O[E(e)]?.message}),(0,v.jsx)(c,{maxLength:150,...w(E(e),{required:"This field is required"}),placeholder:t})]},e))})]}),footerElements:(0,v.jsxs)("div",{className:x.footer,children:[O?.root&&(0,v.jsx)(g,{children:O.root.message}),(0,v.jsxs)(u,{align:"apart",children:[(0,v.jsx)(a,{variant:"ghosted",onClick:()=>{S(k(r),{keepDefaultValues:!0})},disabled:C,children:"Reset to English"}),(0,v.jsxs)(u,{children:[(0,v.jsx)(a,{onClick:t,children:"Cancel"}),(0,v.jsx)(a,{variant:"primary",type:"submit",form:"custom-translations-form",disabled:C||!I||!T,loading:C,children:"Save changes"})]})]})]})})}),{setters:[function(e){n=e.a,s=e.n,i=e.t},function(e){o=e.J,r=e.Ot},function(e){a=e.t},function(e){},function(e){},function(e){c=e.t},function(e){},function(e){l=e.S,d=e.T,u=e.b,f=e.g,g=e.h,h=e.t,y=e.x},function(e){j=e.i,b=e.t},function(e){m=e.t}],execute:function(){(p=document.createElement("style")).textContent="._blink_hgpju_1{animation:1s step-start infinite _blink_hgpju_1}@keyframes _blink_hgpju_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_hgpju_13{transform:rotate(45deg)}._footer_hgpju_17{width:100%}\n/*$vite$:1*/",document.head.appendChild(p),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="43d86832-9edd-4bdd-a9f4-125a1cc809b2",e._sentryDebugIdIdentifier="sentry-dbid-43d86832-9edd-4bdd-a9f4-125a1cc809b2")}catch(e){}}(),_=n(s(),1),x={blink:"_blink_hgpju_1",fourtyfive:"_fourtyfive_hgpju_13",footer:"_footer_hgpju_17"},v=i()}}});
//# sourceMappingURL=CustomTranslationModal-legacy-K5flwd7m.js.map