@protobase/ui 0.45.21 → 0.46.0

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.
@@ -1,2 +1,2 @@
1
- import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,n as r,t as i}from"./react-CR5VJ85Q.js";import{Q as a,t as o,yt as s}from"./app-BRrWBdcb.js";import{c}from"./preload-helper-C24C2MCK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=t(n(),1),u=r(),d=e({default:()=>f}),f={},p=`protobase-api-origin`,m=async e=>{e.getPlatform()===`ios`&&e.isPluginAvailable(`Keyboard`)&&await e.nativePromise(`Keyboard`,`setAccessoryBarVisible`,{isVisible:!0})},h=e=>[...e.split(`,`).map(e=>e.trim()).filter(e=>e&&!/^maximum-scale\s*=/.test(e)),`maximum-scale=1`].join(`, `),g=e=>{let t=e.querySelector(`meta[name="viewport"]`);t&&t.setAttribute(`content`,h(t.getAttribute(`content`)??``))},_=e=>{if(e.length===0)return;if(e.length>1)throw Error(`The page has ${e.length} ${p} meta tags; it may have one`);let t=e[0],n=URL.canParse(t)?new URL(t):void 0;if(!n||n.protocol!==`http:`&&n.protocol!==`https:`||n.origin!==t)throw Error(`The page's ${p} meta tag holds "${t}", which is not an http or https origin such as https://shop.example.com`);return t},v=()=>_([...document.querySelectorAll(`meta[name="${p}"]`)].map(e=>e.content)),y=t(i(),1),b=document.getElementById(`root`);if(!b)throw Error(`index.html needs an element with id "root"`);var x=s(window);x&&(g(document),m(x)),(0,u.createRoot)(b).render((0,y.jsx)(l.StrictMode,{children:(0,y.jsx)(o,{baseUrl:`${v()??``}/api/v1`,ui:a(d),locale:c(),nativeBridge:x})}));
2
- //# debugId=3dbce915-2328-4cd5-b0d2-5ab2cd21a301
1
+ import{n as e,r as t}from"./rolldown-runtime-hePW80VL.js";import{i as n,n as r,t as i}from"./react-CR5VJ85Q.js";import{Q as a,t as o,yt as s}from"./app-DTmxwLny.js";import{c}from"./preload-helper-C24C2MCK.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=t(n(),1),u=r(),d=e({default:()=>f}),f={},p=`protobase-api-origin`,m=async e=>{e.getPlatform()===`ios`&&e.isPluginAvailable(`Keyboard`)&&await e.nativePromise(`Keyboard`,`setAccessoryBarVisible`,{isVisible:!0})},h=e=>[...e.split(`,`).map(e=>e.trim()).filter(e=>e&&!/^maximum-scale\s*=/.test(e)),`maximum-scale=1`].join(`, `),g=e=>{let t=e.querySelector(`meta[name="viewport"]`);t&&t.setAttribute(`content`,h(t.getAttribute(`content`)??``))},_=e=>{if(e.length===0)return;if(e.length>1)throw Error(`The page has ${e.length} ${p} meta tags; it may have one`);let t=e[0],n=URL.canParse(t)?new URL(t):void 0;if(!n||n.protocol!==`http:`&&n.protocol!==`https:`||n.origin!==t)throw Error(`The page's ${p} meta tag holds "${t}", which is not an http or https origin such as https://shop.example.com`);return t},v=()=>_([...document.querySelectorAll(`meta[name="${p}"]`)].map(e=>e.content)),y=t(i(),1),b=document.getElementById(`root`);if(!b)throw Error(`index.html needs an element with id "root"`);var x=s(window);x&&(g(document),m(x)),(0,u.createRoot)(b).render((0,y.jsx)(l.StrictMode,{children:(0,y.jsx)(o,{baseUrl:`${v()??``}/api/v1`,ui:a(d),locale:c(),nativeBridge:x})}));
2
+ //# debugId=e5e0827e-a363-4a0b-951b-15b2eb1f1188
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{u as r,vt as i}from"./app-BRrWBdcb.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./maplibre-BlwO7zTh.js";import{t as p}from"./cn-Bi0ZEjD9.js";var m=e(t(),1),h=512,g=85.051129,_=16,v=Array.from({length:23},(e,t)=>t),y=e=>e.type===`LineString`?e.coordinates:e.type===`MultiPolygon`?e.coordinates.flat(2):e.coordinates.flat(),b=e=>{let t=Math.max(-85.051129,Math.min(g,e))*Math.PI/180;return .5-Math.log(Math.tan(Math.PI/4+t/2))/(2*Math.PI)},x=e=>{let t=y(e),n=t.map(([e])=>e),r=t.map(([,e])=>b(e)),i=(Math.max(...n)-Math.min(...n))/360*h,a=(Math.max(...r)-Math.min(...r))*h;return Math.max(i,a)},S=(e,t)=>{let n=e.flatMap(e=>{if(!e.area)return[];let n=e.area.type===`LineString`||e.area.type===`MultiLineString`?`line`:`polygon`;return[{type:`Feature`,geometry:e.area,properties:{key:e.key,kind:n,span:x(e.area),chosen:t?.includes(e.key)??!1}}]});return{type:`FeatureCollection`,features:[...n.filter(e=>!e.properties.chosen),...n.filter(e=>e.properties.chosen)]}},C=e=>[`interpolate`,[`linear`],[`zoom`],...v.flatMap(t=>[t,[`*`,e,[`min`,1,[`max`,0,[`/`,[`-`,[`*`,[`get`,`span`],2**t],_],32]]]]])],w=e(n(),1),T=`position-area-fills`,E=[`==`,[`get`,`kind`],`polygon`],D=[`==`,[`get`,`kind`],`line`],O=(e,t)=>[`case`,[`get`,`chosen`],e,t],k=({points:e,selected:t,colors:n})=>{let r=S(e,t);if(r.features.length===0)return null;let i=[`case`,[`get`,`chosen`],n.chosen,n.area];return(0,w.jsxs)(s,{id:`position-areas`,type:`geojson`,data:r,children:[(0,w.jsx)(u,{id:T,type:`fill`,filter:E,paint:{"fill-color":i,"fill-opacity":C(O(.15,.1))}}),(0,w.jsx)(u,{id:`position-area-outlines`,type:`line`,filter:E,paint:{"line-color":i,"line-width":1.5,"line-dasharray":[3,2],"line-opacity":C(.8)}}),(0,w.jsx)(u,{id:`position-area-lines`,type:`line`,filter:D,layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-color":i,"line-width":6,"line-opacity":C(O(.6,.35))}})]})},A=(e,t)=>{let n=document.createElement(`span`);n.style.color=`var(${t})`,e.append(n);let r=getComputedStyle(n).color;n.remove();let i=document.createElement(`canvas`);i.width=1,i.height=1;let a=i.getContext(`2d`,{willReadFrequently:!0});if(!a)return r;a.fillStyle=r,a.fillRect(0,0,1,1);let[o,s,c,l]=a.getImageData(0,0,1,1).data;return`rgba(${o}, ${s}, ${c}, ${l/255})`},j=28,M={padding:48,maxZoom:15,duration:0},N={padding:48,maxZoom:16,duration:300},P=32,F=()=>i(`compact`,e=>new Intl.NumberFormat(e,{notation:`compact`,maximumFractionDigits:1})),I=e=>[[e.west,e.south],[e.east,e.north]],L=({style:e,layers:t,initial:n,points:i,buckets:s,fit:u,onFitted:h,onMove:g,selected:_,covered:v,onSelect:y,onClear:b,markerLabel:x,bucketLabel:S})=>{let C=(0,m.useRef)(null),[E,D]=(0,m.useState)([]),[O,L]=(0,m.useState)(),R=new globalThis.Map(i.map(e=>[e.key,e])),z=i.map(e=>e.key).join(`,`),B=u&&JSON.stringify(u),V=()=>{let e=C.current?.getMap();e&&D(r(i.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),j))},H=()=>{let e=C.current?.getMap();if(!e)return;let t=e.getBounds(),n=e.getCenter();g({bounds:{south:t.getSouth(),west:t.getWest(),north:t.getNorth(),east:t.getEast()},zoom:e.getZoom()},{latitude:n.lat,longitude:n.lng,zoom:e.getZoom()})},U=()=>{let e=C.current?.getMap();e&&u&&(e.fitBounds(I(u),M),h(),H())};(0,m.useEffect)(V,[z]),(0,m.useEffect)(U,[B]);let W=E.find(e=>_!==void 0&&e.keys.some(e=>_.includes(e)))?.at;return(0,m.useEffect)(()=>{let e=C.current?.getMap(),t=W===void 0?void 0:R.get(W);if(!e||!t||v===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-v;n>P&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(P-v)/2],duration:300})},[W,v]),(0,w.jsxs)(d,{ref:C,mapLib:f,mapStyle:e,initialViewState:n??{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:()=>{let e=C.current.getMap().getContainer();L({area:A(e,`--primary`),chosen:A(e,`--foreground`)}),V(),u?U():H()},onZoomEnd:V,onMoveEnd:H,onClick:b,children:[(0,w.jsx)(a,{showCompass:!1}),(0,w.jsx)(c,{layers:t,below:T}),O&&(0,w.jsx)(k,{points:i,selected:_,colors:O}),s.map(e=>(0,w.jsx)(l,{latitude:e.latitude,longitude:e.longitude,anchor:`center`,children:(0,w.jsx)(`button`,{type:`button`,"aria-label":S(e.count),className:`flex size-10 cursor-pointer items-center justify-center rounded-full border-2 border-background bg-primary text-xs font-semibold text-primary-foreground tabular-nums shadow`,onClick:t=>{t.stopPropagation(),C.current?.getMap().fitBounds(I(e.bounds),N)},children:F().format(e.count)})},`${e.latitude},${e.longitude}`)),E.map(e=>{let t=R.get(e.at);if(!t)return null;let n=_!==void 0&&e.keys.some(e=>_.includes(e)),r=e.keys.every(e=>R.get(e)?.approximate);return(0,w.jsx)(l,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,style:{zIndex:+!!n},children:(0,w.jsxs)(`button`,{type:`button`,"aria-label":x(e.keys),"aria-pressed":n,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),y(e.keys)},children:[(0,w.jsx)(o,{"aria-hidden":!0,"data-approximate":r||void 0,className:p(`size-8 drop-shadow`,r?n?`fill-background text-foreground`:`fill-background text-primary`:n?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:r?2:1.5,strokeDasharray:r?`3 2`:void 0}),e.keys.length>1&&(0,w.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{L as RecordsMap};
2
- //# debugId=975e4ca8-48c8-4b71-84f2-7b0669041a08
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{u as r,vt as i}from"./app-DTmxwLny.js";import{a,c as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./maplibre-BlwO7zTh.js";import{t as p}from"./cn-Bi0ZEjD9.js";var m=e(t(),1),h=512,g=85.051129,_=16,v=Array.from({length:23},(e,t)=>t),y=e=>e.type===`LineString`?e.coordinates:e.type===`MultiPolygon`?e.coordinates.flat(2):e.coordinates.flat(),b=e=>{let t=Math.max(-85.051129,Math.min(g,e))*Math.PI/180;return .5-Math.log(Math.tan(Math.PI/4+t/2))/(2*Math.PI)},x=e=>{let t=y(e),n=t.map(([e])=>e),r=t.map(([,e])=>b(e)),i=(Math.max(...n)-Math.min(...n))/360*h,a=(Math.max(...r)-Math.min(...r))*h;return Math.max(i,a)},S=(e,t)=>{let n=e.flatMap(e=>{if(!e.area)return[];let n=e.area.type===`LineString`||e.area.type===`MultiLineString`?`line`:`polygon`;return[{type:`Feature`,geometry:e.area,properties:{key:e.key,kind:n,span:x(e.area),chosen:t?.includes(e.key)??!1}}]});return{type:`FeatureCollection`,features:[...n.filter(e=>!e.properties.chosen),...n.filter(e=>e.properties.chosen)]}},C=e=>[`interpolate`,[`linear`],[`zoom`],...v.flatMap(t=>[t,[`*`,e,[`min`,1,[`max`,0,[`/`,[`-`,[`*`,[`get`,`span`],2**t],_],32]]]]])],w=e(n(),1),T=`position-area-fills`,E=[`==`,[`get`,`kind`],`polygon`],D=[`==`,[`get`,`kind`],`line`],O=(e,t)=>[`case`,[`get`,`chosen`],e,t],k=({points:e,selected:t,colors:n})=>{let r=S(e,t);if(r.features.length===0)return null;let i=[`case`,[`get`,`chosen`],n.chosen,n.area];return(0,w.jsxs)(s,{id:`position-areas`,type:`geojson`,data:r,children:[(0,w.jsx)(u,{id:T,type:`fill`,filter:E,paint:{"fill-color":i,"fill-opacity":C(O(.15,.1))}}),(0,w.jsx)(u,{id:`position-area-outlines`,type:`line`,filter:E,paint:{"line-color":i,"line-width":1.5,"line-dasharray":[3,2],"line-opacity":C(.8)}}),(0,w.jsx)(u,{id:`position-area-lines`,type:`line`,filter:D,layout:{"line-cap":`round`,"line-join":`round`},paint:{"line-color":i,"line-width":6,"line-opacity":C(O(.6,.35))}})]})},A=(e,t)=>{let n=document.createElement(`span`);n.style.color=`var(${t})`,e.append(n);let r=getComputedStyle(n).color;n.remove();let i=document.createElement(`canvas`);i.width=1,i.height=1;let a=i.getContext(`2d`,{willReadFrequently:!0});if(!a)return r;a.fillStyle=r,a.fillRect(0,0,1,1);let[o,s,c,l]=a.getImageData(0,0,1,1).data;return`rgba(${o}, ${s}, ${c}, ${l/255})`},j=28,M={padding:48,maxZoom:15,duration:0},N={padding:48,maxZoom:16,duration:300},P=32,F=()=>i(`compact`,e=>new Intl.NumberFormat(e,{notation:`compact`,maximumFractionDigits:1})),I=e=>[[e.west,e.south],[e.east,e.north]],L=({style:e,layers:t,initial:n,points:i,buckets:s,fit:u,onFitted:h,onMove:g,selected:_,covered:v,onSelect:y,onClear:b,markerLabel:x,bucketLabel:S})=>{let C=(0,m.useRef)(null),[E,D]=(0,m.useState)([]),[O,L]=(0,m.useState)(),R=new globalThis.Map(i.map(e=>[e.key,e])),z=i.map(e=>e.key).join(`,`),B=u&&JSON.stringify(u),V=()=>{let e=C.current?.getMap();e&&D(r(i.map(t=>({key:t.key,...e.project([t.longitude,t.latitude])})),j))},H=()=>{let e=C.current?.getMap();if(!e)return;let t=e.getBounds(),n=e.getCenter();g({bounds:{south:t.getSouth(),west:t.getWest(),north:t.getNorth(),east:t.getEast()},zoom:e.getZoom()},{latitude:n.lat,longitude:n.lng,zoom:e.getZoom()})},U=()=>{let e=C.current?.getMap();e&&u&&(e.fitBounds(I(u),M),h(),H())};(0,m.useEffect)(V,[z]),(0,m.useEffect)(U,[B]);let W=E.find(e=>_!==void 0&&e.keys.some(e=>_.includes(e)))?.at;return(0,m.useEffect)(()=>{let e=C.current?.getMap(),t=W===void 0?void 0:R.get(W);if(!e||!t||v===0)return;let{y:n}=e.project([t.longitude,t.latitude]),r=e.getContainer().clientHeight-v;n>P&&n<r||e.easeTo({center:[t.longitude,t.latitude],offset:[0,(P-v)/2],duration:300})},[W,v]),(0,w.jsxs)(d,{ref:C,mapLib:f,mapStyle:e,initialViewState:n??{latitude:0,longitude:0,zoom:1},style:{width:`100%`,height:`100%`},onLoad:()=>{let e=C.current.getMap().getContainer();L({area:A(e,`--primary`),chosen:A(e,`--foreground`)}),V(),u?U():H()},onZoomEnd:V,onMoveEnd:H,onClick:b,children:[(0,w.jsx)(a,{showCompass:!1}),(0,w.jsx)(c,{layers:t,below:T}),O&&(0,w.jsx)(k,{points:i,selected:_,colors:O}),s.map(e=>(0,w.jsx)(l,{latitude:e.latitude,longitude:e.longitude,anchor:`center`,children:(0,w.jsx)(`button`,{type:`button`,"aria-label":S(e.count),className:`flex size-10 cursor-pointer items-center justify-center rounded-full border-2 border-background bg-primary text-xs font-semibold text-primary-foreground tabular-nums shadow`,onClick:t=>{t.stopPropagation(),C.current?.getMap().fitBounds(I(e.bounds),N)},children:F().format(e.count)})},`${e.latitude},${e.longitude}`)),E.map(e=>{let t=R.get(e.at);if(!t)return null;let n=_!==void 0&&e.keys.some(e=>_.includes(e)),r=e.keys.every(e=>R.get(e)?.approximate);return(0,w.jsx)(l,{latitude:t.latitude,longitude:t.longitude,anchor:`bottom`,style:{zIndex:+!!n},children:(0,w.jsxs)(`button`,{type:`button`,"aria-label":x(e.keys),"aria-pressed":n,className:`relative block cursor-pointer`,onClick:t=>{t.stopPropagation(),y(e.keys)},children:[(0,w.jsx)(o,{"aria-hidden":!0,"data-approximate":r||void 0,className:p(`size-8 drop-shadow`,r?n?`fill-background text-foreground`:`fill-background text-primary`:n?`fill-foreground text-background`:`fill-primary text-primary-foreground`),strokeWidth:r?2:1.5,strokeDasharray:r?`3 2`:void 0}),e.keys.length>1&&(0,w.jsx)(`span`,{className:`absolute -right-2 -top-1 min-w-5 rounded-full border border-background bg-foreground px-1 text-center text-[11px] font-medium leading-4 text-background tabular-nums`,children:e.keys.length})]})},e.at)})]})};export{L as RecordsMap};
2
+ //# debugId=fcb3f724-fb6e-4a61-b5d9-88c0e435d42a
@@ -1,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{B as r,K as i,W as a}from"./vendor-C4-Hop1T.js";import{$ as o,A as s,B as c,C as l,Ct as u,D as d,E as f,F as ee,G as te,H as p,I as ne,J as re,K as ie,L as ae,M as oe,N as m,O as h,P as g,Q as _,R as v,S as y,St as b,T as x,U as S,V as C,W as w,X as T,Y as E,Z as D,_ as O,_t as k,a as A,at as j,b as M,bt as N,c as P,ct as F,d as I,dt as L,et as R,f as z,ft as B,g as V,gt as H,h as U,ht as W,i as G,it as K,j as q,k as se,l as ce,lt as J,m as le,mt as ue,n as de,nt as fe,o as pe,ot as me,p as he,pt as ge,q as _e,r as ve,rt as ye,s as be,st as xe,t as Se,tt as Ce,ut as we,v as Y,w as Te,x as Ee,xt as De,y as Oe,z as X}from"./app-BRrWBdcb.js";import{r as ke}from"./preload-helper-C24C2MCK.js";import{t as Z}from"./cn-Bi0ZEjD9.js";var Q=e(n(),1),Ae=({row:e,resource:t,recordKey:n,...r})=>{let i=z(),a=Y(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,Q.jsx)(p,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},$=({name:e,label:t,options:n,value:r,onChange:i})=>(0,Q.jsx)(`div`,{role:`radiogroup`,"aria-label":t,className:`flex flex-col gap-2`,children:n.map(t=>(0,Q.jsxs)(`label`,{className:Z(`block rounded-lg border p-3 transition-colors has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-primary`,t.disabled?`cursor-default bg-background opacity-60`:t.value===r?`cursor-pointer border-primary bg-primary-soft`:`cursor-pointer bg-background hover:bg-surface`),children:[(0,Q.jsx)(`input`,{type:`radio`,name:e,value:t.value,checked:t.value===r,disabled:t.disabled,onChange:()=>i(t.value),className:`sr-only`}),(0,Q.jsx)(`span`,{className:Z(`block font-medium`,t.value===r&&`text-primary-text`),children:t.label}),t.description&&(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:t.description})]},t.value))}),je=(e,t,n)=>{let o=J(),s=i(),c=[...new Set(n)].sort();return r({queryKey:L.pickedLabels(e.name,c.join(`,`)),enabled:c.length>0,placeholderData:a,queryFn:()=>le(s,o,e,c,t)}).data??new Map},Me=e(t(),1),Ne=e=>{let{resources:t,views:n}=me(),r=t[e.resource];if(!r)throw Error(`RecordPicker: the app has no resource named "${e.resource}"`);if(r.primaryKey.length!==1)throw Error(`RecordPicker: "${e.resource}" has a composite key, which a picker cannot name`);let i=n[e.resource],a=e.multiple?e.value:e.value===void 0?[]:[e.value],[o,s]=(0,Me.useState)({}),c=je(r,i,a),l=e=>o[e]??c.get(e)??e,u=(e,t)=>s(n=>({...n,[e]:t}));if(!e.multiple){let{value:t,onChange:n}=e;return(0,Q.jsx)(X,{target:r,view:i,value:t??``,label:t===void 0?void 0:l(t),invalid:e.invalid,onChange:(e,t)=>{u(e,t),n(e)}})}let{value:d,onChange:f}=e;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(X,{target:r,view:i,value:``,chosen:d,several:!0,invalid:e.invalid,onChange:(e,t)=>{u(e,t),f(d.includes(e)?d.filter(t=>t!==e):[...d,e])}}),d.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:d.map(e=>(0,Q.jsx)(he,{label:l(e),onRemove:()=>f(d.filter(t=>t!==e))},e))})]})};export{q as ActionCard,Oe as ActionInputError,F as ApiProvider,Se as App,p as AppLink,y as AssistantDock,Ce as AuthLayout,H as Button,ee as ChatMessage,g as ChatThread,$ as Choices,o as CodeForm,se as CompactTable,m as Composer,W as Dialog,f as DiffView,te as Field,s as FieldList,P as Form,De as Input,u as LogoMark,ne as Markdown,ce as MenuSelect,ue as OtpInput,Te as PartView,Ae as RecordLink,Ne as RecordPicker,R as ResendCodeButton,ge as ResponsiveDialog,w as Section,ke as Segmented,oe as SidePanel,B as SignInPrompt,N as Spinner,x as StepList,C as Textarea,fe as allowDelayMs,k as buttonClass,ae as definePlugin,v as defineUi,d as diffStats,de as isConflict,ye as isFramed,D as mergeUi,h as parseDiff,re as pluginApi,E as protobaseVersion,_ as uiFromModule,_e as useApiToken,S as useAppAddress,K as useArmedAfterFocus,Ee as useAssistant,M as useAssistantClient,l as useBackendData,J as useClient,U as useFacets,b as useFieldControl,j as useGuardedPress,V as useHistogram,G as useInbox,Y as useLayoutRecord,c as useList,I as useListDisplay,A as useMarkNotificationsRead,xe as useMeta,T as usePlugin,be as usePushNotifications,ie as useRecord,we as useResourceClient,O as useSeries,pe as useUnreadNotifications,ve as useUpdateRecord};
2
- //# debugId=bf2a972e-3ae4-4b3b-9116-703f4130bef0
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,t as n}from"./react-CR5VJ85Q.js";import{B as r,K as i,W as a}from"./vendor-C4-Hop1T.js";import{$ as o,A as s,B as c,C as l,Ct as u,D as d,E as f,F as ee,G as te,H as p,I as ne,J as re,K as ie,L as ae,M as oe,N as m,O as h,P as g,Q as _,R as v,S as y,St as b,T as x,U as S,V as C,W as w,X as T,Y as E,Z as D,_ as O,_t as k,a as A,at as j,b as M,bt as N,c as P,ct as F,d as I,dt as L,et as R,f as z,ft as B,g as V,gt as H,h as U,ht as W,i as G,it as K,j as q,k as se,l as ce,lt as J,m as le,mt as ue,n as de,nt as fe,o as pe,ot as me,p as he,pt as ge,q as _e,r as ve,rt as ye,s as be,st as xe,t as Se,tt as Ce,ut as we,v as Y,w as Te,x as Ee,xt as De,y as Oe,z as X}from"./app-DTmxwLny.js";import{r as ke}from"./preload-helper-C24C2MCK.js";import{t as Z}from"./cn-Bi0ZEjD9.js";var Q=e(n(),1),Ae=({row:e,resource:t,recordKey:n,...r})=>{let i=z(),a=Y(),o=t??i?.resource??a?.model.name;if(o===void 0)throw Error(`RecordLink needs a resource outside a list display or a record`);return(0,Q.jsx)(p,{to:{kind:`record`,resource:o,key:e?e.key:n},...r})},$=({name:e,label:t,options:n,value:r,onChange:i})=>(0,Q.jsx)(`div`,{role:`radiogroup`,"aria-label":t,className:`flex flex-col gap-2`,children:n.map(t=>(0,Q.jsxs)(`label`,{className:Z(`block rounded-lg border p-3 transition-colors has-[:focus-visible]:outline-2 has-[:focus-visible]:outline-offset-2 has-[:focus-visible]:outline-primary`,t.disabled?`cursor-default bg-background opacity-60`:t.value===r?`cursor-pointer border-primary bg-primary-soft`:`cursor-pointer bg-background hover:bg-surface`),children:[(0,Q.jsx)(`input`,{type:`radio`,name:e,value:t.value,checked:t.value===r,disabled:t.disabled,onChange:()=>i(t.value),className:`sr-only`}),(0,Q.jsx)(`span`,{className:Z(`block font-medium`,t.value===r&&`text-primary-text`),children:t.label}),t.description&&(0,Q.jsx)(`span`,{className:`mt-0.5 block text-xs leading-snug text-muted-foreground`,children:t.description})]},t.value))}),je=(e,t,n)=>{let o=J(),s=i(),c=[...new Set(n)].sort();return r({queryKey:L.pickedLabels(e.name,c.join(`,`)),enabled:c.length>0,placeholderData:a,queryFn:()=>le(s,o,e,c,t)}).data??new Map},Me=e(t(),1),Ne=e=>{let{resources:t,views:n}=me(),r=t[e.resource];if(!r)throw Error(`RecordPicker: the app has no resource named "${e.resource}"`);if(r.primaryKey.length!==1)throw Error(`RecordPicker: "${e.resource}" has a composite key, which a picker cannot name`);let i=n[e.resource],a=e.multiple?e.value:e.value===void 0?[]:[e.value],[o,s]=(0,Me.useState)({}),c=je(r,i,a),l=e=>o[e]??c.get(e)??e,u=(e,t)=>s(n=>({...n,[e]:t}));if(!e.multiple){let{value:t,onChange:n}=e;return(0,Q.jsx)(X,{target:r,view:i,value:t??``,label:t===void 0?void 0:l(t),invalid:e.invalid,onChange:(e,t)=>{u(e,t),n(e)}})}let{value:d,onChange:f}=e;return(0,Q.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Q.jsx)(X,{target:r,view:i,value:``,chosen:d,several:!0,invalid:e.invalid,onChange:(e,t)=>{u(e,t),f(d.includes(e)?d.filter(t=>t!==e):[...d,e])}}),d.length>0&&(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:d.map(e=>(0,Q.jsx)(he,{label:l(e),onRemove:()=>f(d.filter(t=>t!==e))},e))})]})};export{q as ActionCard,Oe as ActionInputError,F as ApiProvider,Se as App,p as AppLink,y as AssistantDock,Ce as AuthLayout,H as Button,ee as ChatMessage,g as ChatThread,$ as Choices,o as CodeForm,se as CompactTable,m as Composer,W as Dialog,f as DiffView,te as Field,s as FieldList,P as Form,De as Input,u as LogoMark,ne as Markdown,ce as MenuSelect,ue as OtpInput,Te as PartView,Ae as RecordLink,Ne as RecordPicker,R as ResendCodeButton,ge as ResponsiveDialog,w as Section,ke as Segmented,oe as SidePanel,B as SignInPrompt,N as Spinner,x as StepList,C as Textarea,fe as allowDelayMs,k as buttonClass,ae as definePlugin,v as defineUi,d as diffStats,de as isConflict,ye as isFramed,D as mergeUi,h as parseDiff,re as pluginApi,E as protobaseVersion,_ as uiFromModule,_e as useApiToken,S as useAppAddress,K as useArmedAfterFocus,Ee as useAssistant,M as useAssistantClient,l as useBackendData,J as useClient,U as useFacets,b as useFieldControl,j as useGuardedPress,V as useHistogram,G as useInbox,Y as useLayoutRecord,c as useList,I as useListDisplay,A as useMarkNotificationsRead,xe as useMeta,T as usePlugin,be as usePushNotifications,ie as useRecord,we as useResourceClient,O as useSeries,pe as useUnreadNotifications,ve as useUpdateRecord};
2
+ //# debugId=5de2532a-8709-4152-b08a-0185ca79c793
@@ -18,14 +18,14 @@
18
18
  }
19
19
  document.documentElement.dataset.theme = stored === 'light' || stored === 'dark' ? stored : matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
20
20
  </script>
21
- <script type="importmap">{"imports":{"react":"/assets/shared-react-CuZpzdyh.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-Csr2Kx2w.js","react-dom":"/assets/shared-react-dom-BNlY7-7i.js","@protobase/ui":"/assets/shared-protobase-ui-C_KpcuOu.js"}}</script>
22
- <script type="module" crossorigin src="/assets/index-9vOkVIyi.js"></script>
21
+ <script type="importmap">{"imports":{"react":"/assets/shared-react-CuZpzdyh.js","react/jsx-runtime":"/assets/shared-react-jsx-runtime-Csr2Kx2w.js","react-dom":"/assets/shared-react-dom-BNlY7-7i.js","@protobase/ui":"/assets/shared-protobase-ui-Bd4lMqhw.js"}}</script>
22
+ <script type="module" crossorigin src="/assets/index-Dl4IJ-o2.js"></script>
23
23
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
24
24
  <link rel="modulepreload" crossorigin href="/assets/react-CR5VJ85Q.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/vendor-C4-Hop1T.js">
26
26
  <link rel="modulepreload" crossorigin href="/assets/cn-Bi0ZEjD9.js">
27
27
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-C24C2MCK.js">
28
- <link rel="modulepreload" crossorigin href="/assets/app-BRrWBdcb.js">
28
+ <link rel="modulepreload" crossorigin href="/assets/app-DTmxwLny.js">
29
29
  <link rel="stylesheet" crossorigin href="/assets/app-GUjJKojE.css">
30
30
  <link rel="stylesheet" crossorigin href="/assets/index-BZXw3deq.css">
31
31
  <link rel="stylesheet" href="/protobase.theme.css">
@@ -1,5 +1,5 @@
1
1
  {
2
- "protobase": "0.45.21",
2
+ "protobase": "0.46.0",
3
3
  "pluginApi": 1,
4
4
  "paths": [
5
5
  "/index.html",
@@ -1,5 +1,5 @@
1
- const cacheName = "protobase-shell-f9b7d002cc501075"
2
- const precache = ["/index.html","/assets/shared-react-CuZpzdyh.js","/assets/shared-react-jsx-runtime-Csr2Kx2w.js","/assets/shared-react-dom-BNlY7-7i.js","/assets/shared-protobase-ui-C_KpcuOu.js","/assets/index-9vOkVIyi.js","/assets/rolldown-runtime-hePW80VL.js","/assets/react-CR5VJ85Q.js","/assets/vendor-C4-Hop1T.js","/assets/cn-Bi0ZEjD9.js","/assets/preload-helper-C24C2MCK.js","/assets/app-BRrWBdcb.js","/assets/app-GUjJKojE.css","/assets/index-BZXw3deq.css","/protobase.theme.css","/protobase.favicon.svg"]
1
+ const cacheName = "protobase-shell-848253cbcb07c695"
2
+ const precache = ["/index.html","/assets/shared-react-CuZpzdyh.js","/assets/shared-react-jsx-runtime-Csr2Kx2w.js","/assets/shared-react-dom-BNlY7-7i.js","/assets/shared-protobase-ui-Bd4lMqhw.js","/assets/index-Dl4IJ-o2.js","/assets/rolldown-runtime-hePW80VL.js","/assets/react-CR5VJ85Q.js","/assets/vendor-C4-Hop1T.js","/assets/cn-Bi0ZEjD9.js","/assets/preload-helper-C24C2MCK.js","/assets/app-DTmxwLny.js","/assets/app-GUjJKojE.css","/assets/index-BZXw3deq.css","/protobase.theme.css","/protobase.favicon.svg"]
3
3
  const revalidated = ["/protobase.theme.css","/protobase.favicon.svg"]
4
4
 
5
5
  const fromCache = (request) =>