@rainbow-robotics/preview-host 1.3.6-dev.7 → 1.3.6-dev.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/assets/{AmrCapabilityControl.BrB4gWci.js → AmrCapabilityControl.DylvnUEO.js} +1 -1
  2. package/dist/assets/{index.gNqUQbXV.js → MapInfo.CrdLZcke.js} +11 -6
  3. package/dist/assets/RbLocalizationProvider.929YVAAi.js +301 -0
  4. package/dist/assets/__federation_expose_App.MoFBQejr.js +1288 -0
  5. package/dist/assets/__federation_fn_import.ByOnqCI5.js +24 -0
  6. package/dist/assets/__federation_shared_@emotion/{styled.ETfwMsQo.js → styled.CajkAQAy.js} +1 -1
  7. package/dist/assets/__federation_shared_@tanstack/{react-query.fVz8BOIk.js → react-query.DZtZx7JL.js} +1 -1
  8. package/dist/assets/{cssMode.Btmfrqbc.js → cssMode.Dtrsp9Hl.js} +1 -1
  9. package/dist/assets/{emotion-styled-base.browser.esm.BIcjgOzg.js → emotion-styled-base.browser.esm.BLoY4bbE.js} +1 -1
  10. package/dist/assets/{freemarker2.CRZyUqsG.js → freemarker2.CyJpVLMx.js} +1 -1
  11. package/dist/assets/{handlebars.DFN7fNiI.js → handlebars.CsnXKzpH.js} +1 -1
  12. package/dist/assets/{html.BGYss5EC.js → html.Cs-v4IId.js} +1 -1
  13. package/dist/assets/{htmlMode.CPP-P34n.js → htmlMode.BkLJ-g13.js} +1 -1
  14. package/dist/assets/{index.CRrzQahR.js → index.B34TfqNB.js} +1 -1
  15. package/dist/assets/index.BHxdk7pU.js +1 -0
  16. package/dist/assets/index.BkLy899B.js +1 -0
  17. package/dist/assets/{javascript.CFXIFuv3.js → javascript.CnXk03IN.js} +1 -1
  18. package/dist/assets/{jsonMode.B9wevgvA.js → jsonMode.DHUETSBC.js} +1 -1
  19. package/dist/assets/{liquid.IiaX0sHm.js → liquid.ycj1GnlX.js} +1 -1
  20. package/dist/assets/{lspLanguageFeatures.DcZhOnT_.js → lspLanguageFeatures.qBXuaIUh.js} +1 -1
  21. package/dist/assets/{mdx.CFCXRsE4.js → mdx.DQv9SiE_.js} +1 -1
  22. package/dist/assets/{python.CYzm4eOL.js → python.CGG4dQnL.js} +1 -1
  23. package/dist/assets/{razor.CBJICGVH.js → razor.BfFBX4H4.js} +1 -1
  24. package/dist/assets/remoteEntry.js +1 -1
  25. package/dist/assets/{tsMode.7l6_wggJ.js → tsMode.BRgsBy91.js} +1 -1
  26. package/dist/assets/{typescript.CYdYDutT.js → typescript.BTl_2OW3.js} +1 -1
  27. package/dist/assets/useJsonFileDownload.DzAbJDyG.js +4773 -0
  28. package/dist/assets/{xml.BBM1272P.js → xml.CCn6EavV.js} +1 -1
  29. package/dist/assets/{yaml.CoQMuaZZ.js → yaml.D2ikp_I-.js} +1 -1
  30. package/dist/imgs/nexus/forms/gripper/gripper_23.png +0 -0
  31. package/dist/index.html +8 -7
  32. package/dist/plugin-shared/plugin-ui_react.js +1 -1
  33. package/package.json +1 -1
  34. package/dist/assets/RbLocalizationProvider.CMEaJz_8.js +0 -311
  35. package/dist/assets/__federation_expose_App.cvuyH-ST.js +0 -1350
  36. package/dist/assets/__federation_fn_import.DdkEuT6t.js +0 -23
  37. package/dist/assets/index.BFyW4OKK.js +0 -1
  38. package/dist/assets/useFileDownload.u1IqR1tO.js +0 -4753
@@ -1 +0,0 @@
1
- import{j as g,cx as z,U as F,a$ as K,x as _,bg as Q,cV as Y,eo as E,g7 as X,dg as P,el as U,cQ as Z,gI as u}from"./RbLocalizationProvider.CMEaJz_8.js";import{importShared as k}from"./__federation_fn_import.DdkEuT6t.js";const x=()=>!0,L=()=>typeof window<"u"&&window.__RB_ROBOT_HOST__||void 0||void 0,ke=()=>x()&&!!L(),J=()=>x()&&!L(),Le=(e,t)=>e?.find(s=>s.point===t),ye=(e,t)=>{if(typeof e=="string")return e;const s=String(t);return e?.[s]},_e=(e,t)=>{if(typeof e=="string")return e;const s=String(t);return e?.[s]||e?.en},Pe=e=>e.toLocaleLowerCase()==="rainbowrobotics";var y=(e=>(e[e.SUPERVISOR=0]="SUPERVISOR",e[e.ADMIN=1]="ADMIN",e[e.MANAGER=2]="MANAGER",e[e.OPERATOR=3]="OPERATOR",e[e.USER=4]="USER",e[e.GUEST=999999]="GUEST",e))(y||{});const Ue={SUPERVISOR:0,ADMIN:1,MANAGER:2,OPERATOR:3,USER:4,GUEST:999999};function v(e){try{const t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(atob(t))}catch{return null}}function w(e){if(!e)return null;const t=v(e);return t?t.exp*1e3:null}function O(){const e=c();return e?v(e)?.sid??"":""}const o={isAutoLogin:"isAutoLogin",accessToken:"access_token",refreshToken:"refresh_token"};function A(){localStorage.removeItem(o.accessToken),localStorage.removeItem(o.refreshToken),sessionStorage.removeItem(o.accessToken),sessionStorage.removeItem(o.refreshToken)}function h(){return localStorage.getItem(o.isAutoLogin)==="true"}function we(e){localStorage.setItem(o.isAutoLogin,e?"true":"false")}function c(){return h()?localStorage.getItem(o.accessToken):sessionStorage.getItem(o.accessToken)}function p(){return h()?localStorage.getItem(o.refreshToken):sessionStorage.getItem(o.refreshToken)}function ee(e,t,s){s?(localStorage.setItem(o.isAutoLogin,"true"),localStorage.setItem(o.accessToken,e),localStorage.setItem(o.refreshToken,t)):(localStorage.setItem(o.isAutoLogin,"false"),sessionStorage.setItem(o.accessToken,e),sessionStorage.setItem(o.refreshToken,t))}const{useQuery:te}=await k("@tanstack/react-query"),N="/auth/me",se=[N],ne=()=>V.get(N,{}),oe=({enabled:e})=>te({queryKey:se,queryFn:ne,enabled:e}),{createContext:re,useCallback:ae,useContext:ie,useEffect:C,useState:ce}=await k("react"),ue={id:"GUEST",username:"게스트",role:y.SUPERVISOR,sid:""},G=re({isLoggedIn:!1,setLoggedIn:()=>{}});let R=null;function $(e){R?.(e)}function be({children:e}){const[t,s]=ce(!!c()),n=ae(r=>{s(r)},[]);return C(()=>(R=n,()=>{R=null}),[n]),g(G.Provider,{value:{isLoggedIn:t,setLoggedIn:n},children:e})}function le(){const{isLoggedIn:e,setLoggedIn:t}=ie(G),s=c(),n=p(),r=h(),{data:a}=oe({enabled:e}),i=a?{id:a.user_id,username:a.username??a.user_id,role:a.role??y.GUEST,sid:O()}:ue;return C(()=>{const d=!!s&&!!n;e!==d&&t(d)},[e,s,n,t]),{isLoggedIn:e,setLoggedIn:t,user:i,accessToken:s,refreshToken:n,isAutoLogin:r,isAtLeast:d=>i.role<=d,hasRole:d=>i.role===d}}const fe=({className:e,open:t,onOpenChange:s,onConfirm:n})=>{const{t:r}=z(),a=()=>{s(!1),n()};return g(Q,{className:_(e,"w-100 max-w-full border-none p-0"),enableDimClose:!1,hideCloseButton:!0,open:t,onOpenChange:s,header:{title:r("login.modal.title.sessionExpired")},footer:g(F,{className:_("w-full gap-1","[&_button]:h-8 [&_button]:w-20"),justifyContent:"end",children:g(K,{variant:"brand",size:"sm",onClick:a,children:r("login.modal.button.sessionExpiredConfirm")})}),children:g("div",{className:"px-4 pt-3 pb-0",children:g("span",{className:"text-fg-default typo-compact-sm-normal",children:r("login.modal.desc.sessionExpired")})})})},Me="/muscat/app/log",T="/muscat/app/login",{useMutation:de}=await k("@tanstack/react-query"),ge="/logout",D=async e=>V.post(ge,{sid:e}),xe=()=>{const{setLoggedIn:e,user:t}=le(),s=Y();return de({mutationFn:async()=>{if(t?.sid)return D(t.sid)},onSettled:()=>{A(),e(!1),s(T)}})},me=`http://${window.location.hostname}:undefined`,he=1e4,pe=1e4,b=5e3;let j=null,H=null;function ve(e){j=e}function Oe(e){H=e}let I=!1,W=0;function Se(){return!!(I||Date.now()-W<he)}const M=()=>{if(window.location.pathname===T)return;const e=async()=>{const t=O();if(t)try{await D(t)}catch{}A(),$(!1),H?.(T)};X.openModal({component:fe,props:{onConfirm:e,onClose:e},options:{componentName:"SessionExpiredModal"}})};async function B(){if(Se())return null;const e=p();if(!e)return M(),null;I=!0;try{const t=await E.post(`${me}/common/refresh`,{refresh_token:e}),{access_token:s,refresh_token:n}=t.data;return ee(s,n,h()),$(!0),j?.("auth",{token:s,autoLogin:h()?"true":"false"}),W=Date.now(),S(),s}catch(t){console.log("Token refresh failed:",t);const s=E.isAxiosError(t)?t.response?.status:null;if(s===403||s===401||s===409)return A(),M(),null;throw t}finally{I=!1}}let m=null;function q(){m&&(clearTimeout(m),m=null)}function S(){q();const e=w(c());if(!e)return;const t=Math.max(e-Date.now(),0),s=Math.min(Math.max(e-Date.now()-pe,b),t);m=setTimeout(async()=>{try{if(!p())return;!await B()&&p()&&S()}catch{if(c()){const n=w(c());if(n&&n>Date.now()){const r=Math.min(b*2,n-Date.now());r>0&&(m=setTimeout(S,r))}}}},s)}window.addEventListener("storage",e=>{e.key!==o.accessToken&&e.key!==o.refreshToken||(c()&&p()?S():q())});const l={onRequest({config:e}){if(e.url?.endsWith("/login")||e.url?.endsWith("/logout")||e.url?.endsWith("/refresh")||/^https?:\/\//i.test(e.url??"")&&!e.url?.startsWith(e.baseURL??""))return e;const n=c();return n&&e.headers&&(e.headers.Authorization=`Bearer ${n}`),e},onResponse({response:e}){return e?.data},async onResponseError({error:e}){const t=e.config;if(!t)return Promise.reject(e);if(t.url?.endsWith("/login")||t.url?.endsWith("/logout")||t.url?.endsWith("/refresh"))return A(),Promise.reject(e);if(e.response?.status===401&&!t._retry){t._retry=!0;try{const i=await B();return i?(t.headers.Authorization=`Bearer ${i}`,E(t)):Promise.reject(e)}catch(i){return Promise.reject(i)}}const n=e?.response?.data;P("useSimulator")!=="false"&&P("useSimulator");const r=typeof n=="object"&&"message"in n&&typeof n.message=="string"?n.message:U("common.toast.apiError.content"),a=e.status??e.response?.status;return[502,504].includes(a)||e.code==="ERR_NETWORK"||J()||t.skipErrorToast||Z.openToast({title:e.config.url?`[API Error] ${e.config.url}`:U("common.toast.apiError.title"),content:r,type:"basic",variant:"warning"}),Promise.reject(e)}},Ae=3e3,f=`http://${L()||window.location.hostname}:${Ae}`,V=u({baseURL:`${f}/common`},l),Ne=u({baseURL:`${f}/manipulate`},l),Ce=u({baseURL:`${f}/log`},l),Ge=u({baseURL:`${f}/amr`},l),$e=u({baseURL:`${f}/rby1`},l);u({baseURL:`${f}/deploy`},l);const De=u({baseURL:`${f}/host`},l);export{De as A,be as B,c as C,y as J,Me as L,f as M,Ue as R,ye as a,Ge as b,V as c,_e as d,T as e,Le as f,L as g,xe as h,x as i,ve as j,B as k,Ce as l,Ne as m,q as n,Oe as o,se as p,ke as q,$e as r,Pe as s,ee as t,le as u,S as v,h as w,we as x,A as y,D as z};