efficient-shell 11.11.0 → 11.12.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.
- package/dist/{Browser-NRGJ53ST.js → Browser-LPGSKKLU.js} +14 -14
- package/dist/Calculator-XUV5JV3O.js +29 -0
- package/dist/{CurrencyConverter-CJQMDBQW.js → CurrencyConverter-N2HQT7IR.js} +9 -9
- package/dist/{Documents-FIGKS36O.js → Documents-IRPS3N5T.js} +23 -23
- package/dist/Files-VN2IOPHX.js +88 -0
- package/dist/{Notepad-2XW63REV.js → Notepad-JCWNOQET.js} +9 -9
- package/dist/{PomodoroTimer-Y5GQX37J.js → PomodoroTimer-356JUEM3.js} +21 -21
- package/dist/{Preview-K7KDM4XK.js → Preview-X7XNDI6X.js} +23 -23
- package/dist/Sidebar-OZMJNAXN.js +44 -0
- package/dist/{Spreadsheet-RQE4OCEK.js → Spreadsheet-YQOVGIU7.js} +33 -33
- package/dist/{Stock-IHAG62QV.js → Stock-2XOOZNRR.js} +3 -3
- package/dist/{Weather-EQDFEBIH.js → Weather-ZDU2722T.js} +16 -16
- package/dist/{WorldClock-VQG7G2Z2.js → WorldClock-PQGERFCH.js} +5 -5
- package/dist/ai/index.js +91 -91
- package/dist/apps/index.d.ts +21 -2
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ChartTooltip.js +1 -1
- package/dist/charts/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RadarChart.js +1 -1
- package/dist/charts/RadialBarChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/SunburstChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/{chunk-QOJ2UNS5.js → chunk-34AHNPW7.js} +1 -1
- package/dist/{chunk-WDQI3FV6.js → chunk-36VIGB6J.js} +6 -6
- package/dist/{chunk-PDXOGPWH.js → chunk-3N2MNOV5.js} +1 -1
- package/dist/{chunk-3JCOD5L2.js → chunk-4APQHXLI.js} +2 -2
- package/dist/{chunk-IEOCUEJK.js → chunk-4EVYK6DR.js} +7 -7
- package/dist/{chunk-7IVTGOGM.js → chunk-4JJ5WT4D.js} +1 -1
- package/dist/{chunk-3ZRYKZGI.js → chunk-4TB4CSLB.js} +4 -4
- package/dist/{chunk-KZEIQO3V.js → chunk-5IESW4PM.js} +5 -5
- package/dist/{chunk-EYPKBJYG.js → chunk-5PP435FL.js} +1 -1
- package/dist/chunk-5W3U3EVG.js +7 -0
- package/dist/chunk-64KZ74CS.js +8 -0
- package/dist/{chunk-QAIMZN7M.js → chunk-6ETRVCMH.js} +13 -13
- package/dist/{chunk-SGBR443F.js → chunk-6S6FJJKP.js} +6 -6
- package/dist/{chunk-M57KX3OM.js → chunk-6UJYRGWY.js} +1 -1
- package/dist/{chunk-K6D7OSKZ.js → chunk-6WPKLF6G.js} +14 -14
- package/dist/{chunk-UWJNQH2X.js → chunk-7A2Y3W55.js} +1 -1
- package/dist/{chunk-ZOQXFS3R.js → chunk-7FCIFHO7.js} +1 -1
- package/dist/chunk-7TVGP2SX.js +8 -0
- package/dist/{chunk-2HAJ33HM.js → chunk-AD27M3ZH.js} +2 -2
- package/dist/{chunk-AQGIK2CV.js → chunk-AO7XAAGG.js} +1 -1
- package/dist/chunk-AQ7CNPEE.js +15 -0
- package/dist/chunk-BOJEZKYS.js +14 -0
- package/dist/{chunk-3X2W7R5B.js → chunk-BPJ3CQH7.js} +9 -9
- package/dist/chunk-CGA6RTVI.js +9 -0
- package/dist/{chunk-CT7AU2TA.js → chunk-CR3YDABU.js} +1 -1
- package/dist/{chunk-TXKTITMF.js → chunk-CR42APAY.js} +5 -5
- package/dist/{chunk-MQE2FBJU.js → chunk-CXZ7PHHF.js} +5 -5
- package/dist/{chunk-V64CJHMY.js → chunk-D5MN3LXC.js} +19 -19
- package/dist/{chunk-6LK2BBCC.js → chunk-DMBA6KYQ.js} +5 -5
- package/dist/{chunk-ALJS3SYS.js → chunk-DXKXETTT.js} +1 -1
- package/dist/chunk-EBGOENC3.js +3 -0
- package/dist/{chunk-6DQANKTL.js → chunk-ELIWGIR7.js} +7 -7
- package/dist/chunk-EOVXFXVV.js +2 -0
- package/dist/{chunk-CSLMWGFS.js → chunk-EQ72AP5E.js} +1 -1
- package/dist/chunk-ES2LUEPN.js +22 -0
- package/dist/{chunk-62BDGAML.js → chunk-F33L4J3P.js} +6 -6
- package/dist/{chunk-QEDVXD3L.js → chunk-FD6XZRWA.js} +1 -1
- package/dist/{chunk-X2DUOIJP.js → chunk-FEUTN4GK.js} +1 -1
- package/dist/{chunk-JPNAEN53.js → chunk-FZM3ZPW3.js} +1 -1
- package/dist/chunk-FZWSP7KJ.js +28 -0
- package/dist/chunk-G3FHFWC2.js +4 -0
- package/dist/{chunk-42TLGG33.js → chunk-GJFTO7D4.js} +1 -1
- package/dist/{chunk-VEGZVUHE.js → chunk-GJVGGYQ2.js} +1 -1
- package/dist/{chunk-LGTYPLJM.js → chunk-GS74BABV.js} +3 -3
- package/dist/{chunk-LXOX5FGH.js → chunk-HGMQOHMK.js} +2 -2
- package/dist/{chunk-CG5X5ZLV.js → chunk-HJM4LSMM.js} +1 -1
- package/dist/{chunk-E3EHHR73.js → chunk-HOEEFFE3.js} +9 -9
- package/dist/{chunk-32EKHIAZ.js → chunk-HT7SOOMD.js} +12 -12
- package/dist/{chunk-R72ZKZDP.js → chunk-I5GDAQYL.js} +2 -2
- package/dist/{chunk-TA4JGC5C.js → chunk-IFWXC323.js} +1 -1
- package/dist/{chunk-5B4GRLAA.js → chunk-IJ6HZXZY.js} +1 -1
- package/dist/{chunk-UG42KUCT.js → chunk-IKKR2TYY.js} +4 -4
- package/dist/{chunk-OXCFRH33.js → chunk-JFCCI5L2.js} +1 -1
- package/dist/{chunk-CLAKVFOB.js → chunk-JGWUSJDD.js} +31 -31
- package/dist/{chunk-I5XNADZ3.js → chunk-JJLAI6GL.js} +8 -8
- package/dist/{chunk-F636NDAU.js → chunk-K3IUUZO5.js} +7 -7
- package/dist/{chunk-ZOQVYSTB.js → chunk-KV4QPU6U.js} +18 -18
- package/dist/{chunk-RNBC6V2D.js → chunk-L2IPWMLI.js} +3 -3
- package/dist/chunk-L74WV4RJ.js +6 -0
- package/dist/{chunk-VCMHBUKI.js → chunk-LE5LWALR.js} +1 -1
- package/dist/chunk-LJJ7FDAQ.js +6 -0
- package/dist/{chunk-3OHADZYV.js → chunk-LLSLY6BT.js} +1 -1
- package/dist/{chunk-CDQUOCXO.js → chunk-LP45EML2.js} +1 -1
- package/dist/{chunk-HRG4FYVU.js → chunk-LWFH5QTJ.js} +1 -1
- package/dist/{chunk-Q7DVGUML.js → chunk-LXBBJNBQ.js} +1 -1
- package/dist/{chunk-SWJXWDKX.js → chunk-M4AOQYSP.js} +1 -1
- package/dist/{chunk-RQBQETXQ.js → chunk-MD6EPKOR.js} +8 -8
- package/dist/{chunk-S43DAIIB.js → chunk-MFP5KOQW.js} +5 -5
- package/dist/{chunk-RQDVAUXD.js → chunk-N5KO2IHG.js} +4 -4
- package/dist/{chunk-IUMFOSFJ.js → chunk-N75MPMLD.js} +3 -3
- package/dist/{chunk-QQ2LDC6C.js → chunk-NJN5IKWO.js} +1 -1
- package/dist/{chunk-C3UY34DC.js → chunk-NPT6EXHK.js} +4 -4
- package/dist/{chunk-57WQVUBX.js → chunk-OCWWEHNR.js} +2 -2
- package/dist/{chunk-PVOTOUJG.js → chunk-OMROEVOP.js} +1 -1
- package/dist/{chunk-VPEH3THH.js → chunk-P75N466Z.js} +3 -3
- package/dist/{chunk-AHITTM6W.js → chunk-PTVTNCD6.js} +1 -1
- package/dist/chunk-Q7UTGO73.js +11 -0
- package/dist/{chunk-3VR5BOD4.js → chunk-QDL2FNP7.js} +2 -2
- package/dist/{chunk-ATKFIHDP.js → chunk-RBAC26J7.js} +4 -4
- package/dist/{chunk-SYZLS2JA.js → chunk-RDKIYORS.js} +1 -1
- package/dist/{chunk-63545Z3N.js → chunk-RXVFAFEB.js} +1 -1
- package/dist/{chunk-JQBVSPF5.js → chunk-S4FPYCUU.js} +3 -3
- package/dist/chunk-SI33IE7G.js +2 -0
- package/dist/{chunk-ESWR7YNY.js → chunk-SPMD7UZO.js} +3 -3
- package/dist/{chunk-A4YTWDKD.js → chunk-SSM6P43S.js} +1 -1
- package/dist/{chunk-XWFLIGDQ.js → chunk-TE6R53YD.js} +1 -1
- package/dist/{chunk-EV7VAXMO.js → chunk-TTQJQKCE.js} +9 -9
- package/dist/chunk-UBQUXUD2.js +7 -0
- package/dist/{chunk-YUAF3FDE.js → chunk-UCAMOW53.js} +4 -4
- package/dist/{chunk-JG26ICX6.js → chunk-UEWB6IOD.js} +2 -2
- package/dist/{chunk-KKJ55GUZ.js → chunk-UHGAT5MH.js} +1 -1
- package/dist/{chunk-PZHO4FEN.js → chunk-UOGF37Z4.js} +1 -1
- package/dist/chunk-UZTKBA7Z.js +13 -0
- package/dist/{chunk-6LITLCVV.js → chunk-VEATEVMV.js} +3 -3
- package/dist/{chunk-K6LW2QLI.js → chunk-VIDT4JLR.js} +1 -1
- package/dist/{chunk-CJH2BGXY.js → chunk-WGLHB6WE.js} +1 -1
- package/dist/chunk-WZJPASST.js +6 -0
- package/dist/{chunk-B2SLXCMY.js → chunk-XOH6QERF.js} +8 -8
- package/dist/chunk-YXSGMPNW.js +1 -0
- package/dist/{chunk-7R23EKON.js → chunk-ZA2RBNRA.js} +1 -1
- package/dist/{chunk-BDUXF7BT.js → chunk-ZHS2VQU7.js} +3 -3
- package/dist/{chunk-7HLBVMMQ.js → chunk-ZMC25LRC.js} +1 -1
- package/dist/{chunk-DANLBFBD.js → chunk-ZRLWE3JM.js} +1 -1
- package/dist/data/DataTable.js +1 -1
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/forms/AlignmentGrid.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Button.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconButton.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/NumericKeypad.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Segmented.js +1 -1
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/index.js +378 -378
- package/dist/map/index.js +3 -3
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EditableGrid.js +1 -1
- package/dist/shell/GlobalSearch.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/IconRail.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/ItemCount.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ResizeHandle.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StatusBadge.js +1 -1
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/Tooltip.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/TransferProgress.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/ErrorBoundary.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-YZEGVEQ7.js +0 -29
- package/dist/Files-FPNJ46XY.js +0 -88
- package/dist/Sidebar-QP5Y7RBV.js +0 -44
- package/dist/chunk-2EPAXWZZ.js +0 -14
- package/dist/chunk-6FIYG7IH.js +0 -28
- package/dist/chunk-6R32KKIS.js +0 -22
- package/dist/chunk-7DI3VQCF.js +0 -2
- package/dist/chunk-B2MD232O.js +0 -6
- package/dist/chunk-EC22ACQZ.js +0 -11
- package/dist/chunk-FJBJUFD7.js +0 -4
- package/dist/chunk-GO6HU2O3.js +0 -7
- package/dist/chunk-H56TNUV4.js +0 -1
- package/dist/chunk-IGQZANYE.js +0 -15
- package/dist/chunk-MQ445O4X.js +0 -6
- package/dist/chunk-NMTS2L2B.js +0 -8
- package/dist/chunk-ODQYWMDF.js +0 -3
- package/dist/chunk-OPZXVXX5.js +0 -7
- package/dist/chunk-OZM6DE7A.js +0 -8
- package/dist/chunk-PMA6DZ4Q.js +0 -6
- package/dist/chunk-SCZUDGRZ.js +0 -2
- package/dist/chunk-SUYQ7QYB.js +0 -13
- package/dist/chunk-VEZHFONL.js +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";var o=/[.+^$()|[\]\\]/g;function s(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(o,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function a(e){const n=e.map(s);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),g=new Set(["dist","coverage",".next",".turbo"]);function l(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function u(e,t){const i=a(t),o=[...new Set(t.map(l))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),u=new Set,d=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?c.has(e.name)||""===t&&g.has(e.name)||d(n):e.isFile()&&i(n)&&u.add(n)}};for(const e of s)d(e);return[...u].sort(h)}var h=(e,n)=>e<n?-1:e>n?1:0,d={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set((d.busy?.words??[]).map(e=>e.toLowerCase()));var f=class extends Error{},m=new Set(["$schema","schema","include","exclude","allow"]),p=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),w=e=>"string"==typeof e&&""!==e.trim();var y="d3as2htf4hwbtr.cloudfront.net",S={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},$=Object.values(S),R=Object.freeze([...new Set([...$.flatMap(e=>e.hosts),y,...$.map(e=>e.bucket)])].sort()),b=new RegExp([...R.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function k(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(b)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var v="media-host-check.config.json",x="efficient-shell-media-host-check",C=`${x}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${x} check this repository; exits 1 on a finding\n ${x} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${v} in the current directory.`;function A(e,t,r){const o=[],s=a(r.exclude);for(const e of r.include)0===u(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const c=u(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),g=[];for(const r of c)for(const o of k(e,r,i(n(t,r),"utf8")))g.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)g.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:c.length,findings:g.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(C),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${x}: unknown argument "${n}"\n\n${C}`),2;o=!0}const s=n(r.cwd,v);if(!t(s))return r.err(`${x}: no ${v} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!p(e))throw new f(`${n}: expected an object`);for(const n of Object.keys(e))m.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(w)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!(p(i)&&w(i.file)&&w(i.match)&&w(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new f(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),v);a=A(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${x}: ${e instanceof f||e instanceof SyntaxError?e.message:String(e)}`),2}const c=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!c,...a},null,2)),c?1:0;if(!c)return r.out(`${x}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${v}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${v}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>function(t){for(const i of[n(process.cwd(),"package.json"),t])try{return e(i)("typescript")}catch{}throw new Error("typescript is not installed")}(import.meta.url),version:"11.
|
|
2
|
+
import{createRequire as e}from"module";import{join as n}from"path";import{existsSync as t,readFileSync as i,readdirSync as r}from"fs";var o=/[.+^$()|[\]\\]/g;function s(e){let n="",t=0;for(let i=0;i<e.length;i++){const r=e[i];"*"===r?"*"===e[i+1]?"/"===e[i+2]?(n+="(?:[^/]+/)*",i+=2):(n+=".*",i+=1):n+="[^/]*":"?"===r?n+="[^/]":"{"===r?(n+="(?:",t+=1):"}"===r&&t>0?(n+=")",t-=1):n+=","===r&&t>0?"|":r.replace(o,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function a(e){const n=e.map(s);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),g=new Set(["dist","coverage",".next",".turbo"]);function l(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function u(e,t){const i=a(t),o=[...new Set(t.map(l))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),u=new Set,d=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?c.has(e.name)||""===t&&g.has(e.name)||d(n):e.isFile()&&i(n)&&u.add(n)}};for(const e of s)d(e);return[...u].sort(h)}var h=(e,n)=>e<n?-1:e>n?1:0,d={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"]}};new Set((d.busy?.words??[]).map(e=>e.toLowerCase()));var f=class extends Error{},m=new Set(["$schema","schema","include","exclude","allow"]),p=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),w=e=>"string"==typeof e&&""!==e.trim();var y="d3as2htf4hwbtr.cloudfront.net",S={dealer:{bucket:"inovit-dealer-portal-assets",hosts:["d201q0i87q901p.cloudfront.net"],key_pattern:"^marketing/"},media:{bucket:"regis-media-production",hosts:["media.regis.design","d21nnr9ivf9hcc.cloudfront.net"],key_pattern:"^[a-z0-9_]+/storefront/(?!uploads/thumbs/)"},site:{bucket:"inovit-ecommerce-media",hosts:["cdn.inovit.com","dhxlibd8r3td0.cloudfront.net"],key_pattern:"^images/"}},$=Object.values(S),R=Object.freeze([...new Set([...$.flatMap(e=>e.hosts),y,...$.map(e=>e.bucket)])].sort()),b=new RegExp([...R.map(e=>{return`(?<![\\w-])${n=e,n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?![\\w-])`;var n}),"(?<![\\w-])[a-z0-9]+\\.cloudfront\\.net(?![\\w-])","(?<![\\w-])(?:[a-z0-9-]+\\.)*s3(?:[.-][a-z0-9-]+)*\\.amazonaws\\.com(?![\\w-])","s3://"].join("|"),"gi");function k(e,n,t){const i=e.createSourceFile(n,t,e.ScriptTarget.Latest,!0,function(e,n){return n.endsWith(".tsx")?e.ScriptKind.TSX:n.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(n)?e.ScriptKind.JS:e.ScriptKind.TS}(e,n)),r=[],o=(e,n)=>{const t=i.getLineAndCharacterOfPosition(e.getStart(i)).line+1;for(const e of function(e){return[...e.matchAll(b)].map(e=>({match:e[0],index:e.index??0}))}(n)){const i=n.slice(0,e.index);r.push({line:t+(i.match(/\n/g)?.length??0),match:e.match})}},s=n=>{e.isStringLiteral(n)||e.isNoSubstitutionTemplateLiteral(n)||e.isTemplateHead(n)||e.isTemplateMiddle(n)||e.isTemplateTail(n)?o(n,n.text):e.isRegularExpressionLiteral(n)&&o(n,n.text.replace(/\\(.)/g,"$1")),e.forEachChild(n,s)};return s(i),r}var v="media-host-check.config.json",x="efficient-shell-media-host-check",C=`${x}: no code writes a media origin; files are reached through the storage backend, the API's URL, media() or imageCopyUrl() (harness API-15, SSOT-2).\n\n ${x} check this repository; exits 1 on a finding\n ${x} --json print the result as JSON\n\nRefused in any string, template or regular expression: every host and bucket in\nthe image-copies contract, any *.cloudfront.net host, any S3 endpoint, and s3://.\nReads ${v} in the current directory.`;function A(e,t,r){const o=[],s=a(r.exclude);for(const e of r.include)0===u(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const c=u(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),g=[];for(const r of c)for(const o of k(e,r,i(n(t,r),"utf8")))g.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)g.some(n=>n.file===e.file&&l(e.match,n.match))||o.push(`allow ${e.file} "${e.match}" matches nothing any more; delete it`);return{files:c.length,findings:g.filter(e=>!(e=>r.allow.some(n=>n.file===e.file&&l(n.match,e.match)))(e)),problems:o}}process.exitCode=function(e,r){let o=!1;for(const n of e){if("--help"===n||"-h"===n)return r.out(C),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${x}: unknown argument "${n}"\n\n${C}`),2;o=!0}const s=n(r.cwd,v);if(!t(s))return r.err(`${x}: no ${v} in ${r.cwd}. Run it from the repository root.`),2;let a;try{const e=function(e,n="media-host-check.config.json"){const t=[];if(!p(e))throw new f(`${n}: expected an object`);for(const n of Object.keys(e))m.has(n)||t.push(`unknown key "${n}"`);1!==e.schema&&t.push('"schema" must be 1');const i=(n,i)=>{const r=e[n];return void 0!==r||i?!Array.isArray(r)||!r.every(w)||i&&0===r.length?(t.push(`"${n}" must be ${i?"a non-empty":"an"} array of globs`),[]):r:[]},r=i("include",!0),o=i("exclude",!1),s=[];void 0===e.allow||Array.isArray(e.allow)||t.push('"allow" must be an array');for(const[n,i]of(Array.isArray(e.allow)?e.allow:[]).entries()){if(!(p(i)&&w(i.file)&&w(i.match)&&w(i.reason))){t.push(`allow[${n}] needs "file", "match" and "reason", each a non-empty string`);continue}const e=Object.keys(i).filter(e=>!["file","match","reason"].includes(e));e.length&&t.push(`allow[${n}] has unknown keys: ${e.join(", ")}`),s.push({file:i.file,match:i.match,reason:i.reason})}if(t.length)throw new f(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),v);a=A(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${x}: ${e instanceof f||e instanceof SyntaxError?e.message:String(e)}`),2}const c=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!c,...a},null,2)),c?1:0;if(!c)return r.out(`${x}: ${a.files} files, no media origin written in code (harness API-15, SSOT-2).`),0;for(const e of a.findings)r.err(`${e.file}:${e.line} "${e.match}" is a media origin written in code.`);for(const e of a.problems)r.err(`${v}: ${e}`);return a.findings.length&&r.err(`\nReach the file through the storage backend, the URL the API returns, media() or imageCopyUrl() (harness API-15, SSOT-2). An origin that must stay goes in "allow" in ${v}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>function(t){for(const i of[n(process.cwd(),"package.json"),t])try{return e(i)("typescript")}catch{}throw new Error("typescript is not installed")}(import.meta.url),version:"11.12.0"});
|
package/dist/bin/ui-check.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{execFileSync as e}from"child_process";import{createRequire as t}from"module";import{join as n}from"path";import{existsSync as i,readFileSync as o,writeFileSync as s,readdirSync as r}from"fs";var a=["button","input","range","textarea","select","dialog","title","portal","native","dark","hex","radius","spacing","font-size","z-index","shadow","kit","icon","svg","kit-dep","chart","chart-dep","ellipsis-label","colour"],l=e=>"string"==typeof e&&a.includes(e),c=["kit-dep","chart-dep"],d=e=>c.includes(e),u=a.filter(e=>!d(e)),h={button:{counts:"a raw <button>",instead:"Button or IconButton from efficient-shell/ui"},input:{counts:"a raw <input> (not hidden, not a range)",instead:"Input, InputNumber, Checkbox, Radio or Switch from efficient-shell/ui"},range:{counts:'a raw <input type="range">',instead:"Slider from efficient-shell/ui"},textarea:{counts:"a raw <textarea>",instead:"Textarea from efficient-shell/ui"},select:{counts:"a raw <select>",instead:"Select or SearchableSelect from efficient-shell/ui"},dialog:{counts:'a raw <dialog>, or role="dialog" / role="alertdialog" on a raw element',instead:"Dialog or Modal from efficient-shell"},title:{counts:"a title= on a raw element (the browser's own tooltip)",instead:"Tooltip from efficient-shell/ui (harness UI-17)"},portal:{counts:"a createPortal(…) call (a layer the file floats itself)",instead:"Popover, PopupMenu, DropdownMenu, Tooltip or Dialog from efficient-shell/ui"},native:{counts:"window.confirm / alert / prompt, or a bare call that resolves to one",instead:"confirm, confirmDestructive, prompt or toast from efficient-shell (harness UI-20)"},dark:{counts:"a dark: variant in a class string",instead:"the light Tailwind class alone; the shell remaps it in dark mode (harness UI-7)"},hex:{counts:"a hex colour literal in a .tsx string",instead:"a colour role from efficient-shell: its utility or var(--role), COLOUR_ROLES lists them (harness FT-1; the colour kind counts palette classes too)"},radius:{counts:"a literal corner radius (an arbitrary-value radius class, or an inline borderRadius)",instead:"a radius utility from the scale or a role token such as rounded-(--radius-control); the theme sets how round they are (harness UI-7)"},spacing:{counts:"a padding, margin or gap off the scale (6px, 10px, 14px …) or written as a literal length (an arbitrary-value class, an inline style)",instead:"a step of the scale 2/4/8/12/16/20/24/32/40/48 — a Tailwind step, or a role such as var(--space-control-x) (owner ruling 2026-10-12)"},"font-size":{counts:"a literal font size (an arbitrary-value text class, an inline fontSize)",instead:"a type step 9/11/12/14/16/18/20/24/30 — Tailwind's 3xs … 3xl text steps (owner ruling 2026-10-12)"},"z-index":{counts:"a stack order above 30 written as a number (a z utility, an arbitrary value, an inline zIndex)",instead:"a named layer: Z_LAYERS (efficient-shell/ui) in code, its --z-* custom property in markup"},shadow:{counts:"a literal shadow, or a shadow size that is not an elevation level (md, 2xl, xs)",instead:"an elevation: the sm / lg / xl utilities, or var(--elevation-panel) and its siblings (owner ruling 2026-10-12)"},kit:{counts:"an import of a second UI kit",instead:"the component from efficient-shell/ui, or fold it into the shell (harness FT-3)"},icon:{counts:"an import of an icon package",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24)"},svg:{counts:"an <svg> element written in JSX: an icon drawn in place",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24). A chart, an illustration or a mark a host supplies stays on the baseline"},"kit-dep":{counts:"a UI kit or icon package declared in package.json (not one the shell entries imported here need)",instead:"remove the dependency once nothing imports it (harness FT-3)"},chart:{counts:"an import of a second chart library",instead:"a chart from efficient-shell/ui (ChartFrame, TimeSeriesChart, ColumnChart, RankedBars, PieChart, FunnelChart, ScatterChart, …), or add the chart there: one chart system (harness FT-3)"},"chart-dep":{counts:"a chart library declared in package.json",instead:"remove the dependency once nothing imports it (harness FT-3)"},"ellipsis-label":{counts:'a button, link or menu label that ends in "…" or "..."',instead:'the label without the dots, saying what it does ("Extend trial"): "…" means only "the words are cut" (owner ruling 2026-10-14)'},colour:{counts:"a literal colour, in a script string or a stylesheet: a hex, an rgb() / hsl() / oklch() value, a Tailwind palette class (a hue and a step, or white / black), a --color-<hue>-<step> variable, or a named colour in a colour property — a var() fallback included",instead:"a colour role from efficient-shell: its utility (the text, background or border utility of ink, ink-faint, surface, line, accent-fill, accent-text, danger-text, status-danger-line …) or var(--role); COLOUR_ROLES lists them. A merchant site reads the site theme (owner ruling 2026-10-23)"}},p=["@headlessui/","@radix-ui/","@mui/","@chakra-ui/","@mantine/","@floating-ui/","antd","react-aria","react-aria-","react-bootstrap","react-select","react-colorful","react-tooltip","react-hot-toast","react-toastify","sonner"],f=["@heroicons/","@tabler/icons","@tabler/icons-","@phosphor-icons/","@fortawesome/","@iconify/","@radix-ui/react-icons","@mui/icons-material","lucide","lucide-react","simple-icons","react-icons","react-feather"],g=["recharts","chart.js","react-chartjs-2","d3","d3-","@nivo/","victory","victory-","echarts","echarts-for-react","apexcharts","react-apexcharts","@visx/","highcharts","highcharts-react-official","plotly.js","plotly.js-dist","react-plotly.js","lightweight-charts","@antv/g2","@antv/g2plot","chartist","billboard.js","c3","uplot"],m={"efficient-shell":["@headlessui/react"]};function w(e,t){return t.some(t=>t.endsWith("/")||t.endsWith("-")?e.startsWith(t):e===t||e.startsWith(`${t}/`))}function k(e){return w(e,f)?"icon":w(e,p)?"kit":w(e,g)?"chart":null}function x(e){const t=k(e);return"kit"===t||"icon"===t?"kit-dep":"chart"===t?"chart-dep":null}var b=/[.+^$()|[\]\\]/g;function $(e){let t="",n=0;for(let i=0;i<e.length;i++){const o=e[i];"*"===o?"*"===e[i+1]?"/"===e[i+2]?(t+="(?:[^/]+/)*",i+=2):(t+=".*",i+=1):t+="[^/]*":"?"===o?t+="[^/]":"{"===o?(t+="(?:",n+=1):"}"===o&&n>0?(t+=")",n-=1):t+=","===o&&n>0?"|":o.replace(b,"\\$&")}if(0!==n)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${t}$`)}function y(e){const t=e.map($);return e=>t.some(t=>t.test(e))}var v=new Set(["node_modules",".git"]),S=new Set(["dist","coverage",".next",".turbo"]);function j(e){const t=e.search(/[*?{]/),n=-1===t?e:e.slice(0,t),i=n.lastIndexOf("/");return-1===i?"":n.slice(0,i)}function I(e,t){const i=y(t),o=[...new Set(t.map(j))].sort(),s=o.filter(e=>!o.some(t=>t!==e&&(""===t||e.startsWith(`${t}/`)))),a=new Set,l=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?v.has(e.name)||""===t&&S.has(e.name)||l(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)l(e);return[...a].sort(L)}var L=(e,t)=>e<t?-1:e>t?1:0,R=class extends Error{},A=(e,t)=>`${e}:${t}`;function z(e){const t=e.lastIndexOf(":");return{file:e.slice(0,t),kind:e.slice(t+1)}}var E=e=>a.indexOf(e);function C(e,t){const n=z(e),i=z(t);return L(n.file,i.file)||E(n.kind)-E(i.kind)}function T(e,t="ui-kit.baseline.json"){let n;try{n=JSON.parse(e)}catch(e){throw new R(`${t} is not valid JSON: ${e.message}`)}const i=e=>{throw new R(`${t}: ${e}. The tool writes this file; do not edit it by hand.`)};if("object"!=typeof n||null===n||Array.isArray(n))return i("must be a JSON object");const o=n;if(1!==o.schema)return i("number"==typeof o.schema&&o.schema>1?`"schema": ${o.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');if(!Array.isArray(o.kinds)||o.kinds.some(e=>"string"!=typeof e))return i('"kinds" must be a list');const s=o.kinds.filter(l);if("object"!=typeof o.counts||null===o.counts||Array.isArray(o.counts))return i('"counts" must be an object');const r=new Map;for(const[e,t]of Object.entries(o.counts)){const{file:n,kind:o}=z(e);if(!n||!o)return i(`"${e}" is not "<file>:<kind>"`);if("number"!=typeof t||!Number.isInteger(t)||t<1)return i(`"${e}" must be a whole number, 1 or more (a line that reaches 0 is deleted)`);l(o)&&r.set(e,t)}return{kinds:s,counts:r}}function M(e){const t=a.filter(t=>e.kinds.includes(t)),n=[...e.counts.keys()].filter(t=>(e.counts.get(t)??0)>0).sort(C).map(t=>` ${JSON.stringify(t)}: ${e.counts.get(t)}`);return["{",' "schema": 1,',` "kinds": [${t.map(e=>JSON.stringify(e)).join(", ")}],`,n.length?` "counts": {\n${n.join(",\n")}\n }`:' "counts": {}',"}",""].join("\n")}function B(e){const t={};for(const[n,i]of e){const{kind:e}=z(n);l(e)&&(t[e]=(t[e]??0)+i)}return t}var P=class extends Error{},O=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),D=new Set(["$schema","schema","kinds","include","exclude","includeImporting","output","allow"]);var N="package.json",F=[2,4,8,12,16,20,24,32,40,48];function J(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&F.includes(4*t)}var U=new Set(["iframe","frame","object","embed"]),W=new Set(["href","xlinkHref","to","id","key","htmlFor"]),q=/(?<![&\w])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,_=/(?<![\w-])rounded(?:-(?:[trblse]|tl|tr|br|bl|ss|se|ee|es))?-\[([^\]]*)\]/g,G=/^border(?:(?:Top|Bottom)(?:Left|Right)|(?:Start|End)(?:Start|End))?Radius$/,K=/^(?:inherit|initial|unset|revert)$|var\(|^(?:50|100)%$|^(?:999|9999)(?:px)?$/,H=/(?<![\w-])-?(?:p|px|py|pt|pr|pb|pl|ps|pe|m|mx|my|mt|mr|mb|ml|ms|me|gap|gap-x|gap-y|space-x|space-y)-(\d+(?:\.\d+)?|px|\[[^\]]*\])(?![\w.[/-])/g,Q=/(?<![\w-])text-\[(?:length:)?(\d*\.?\d+(?:px|rem|em|%))\]/g,V=/(?<![\w-])z-(\d+|\[[^\]]*\])(?![\w.[/-])/g,X=/(?<![\w-])shadow-(xs|2xs|md|2xl|\[[^\]]*\])(?![\w.[/-])/g,Z=/var\(|^(?:inherit|initial|unset|revert|revert-layer|none|auto)$/,Y=/^(?:(?:padding|margin)(?:Top|Right|Bottom|Left|Inline|Block|InlineStart|InlineEnd|BlockStart|BlockEnd)?|gap|rowGap|columnGap)$/,ee=new Set([0,...F]),te=/(?<![\w-])dark:(?=[\w[\-!@*(])/g,ne="slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose",ie="(?:50|[1-9]00|950)",oe=new RegExp(`(?<![\\w-])(?:bg|text|border(?:-[xytrblse])?|ring(?:-offset)?|inset-ring|outline|divide|fill|stroke|from|via|to|shadow|inset-shadow|drop-shadow|accent|caret|decoration|placeholder)-(?:(?:${ne})-${ie}|white|black)(?:\\/[\\w.]+)?(?![\\w-])`,"g"),se=new RegExp(`--color-(?:(?:${ne})-${ie}|white|black)(?![\\w-])`,"g"),re=/(?<![\w-])(?:rgba?|hsla?|hwb|oklch|oklab|lab|lch)\(\s*[\d.]/g,ae=/(?<![\w-])(?:white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|silver|maroon|navy|teal|olive|lime|aqua|fuchsia|brown|gold|beige|ivory|tan|crimson|coral|salmon|indigo|violet)(?![\w-])/gi,le=/^(?:color|background(?:Color)?|border(?:Top|Right|Bottom|Left|Inline|Block)?(?:Color)?|outline(?:Color)?|fill|stroke|caretColor|accentColor|textDecorationColor|boxShadow|textShadow)$/,ce=/(?<![&a-zA-Z0-9])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,de=e=>[...e.matchAll(ce)].length+[...e.matchAll(re)].length+[...e.matchAll(oe)].length+[...e.matchAll(se)].length,ue=new Set(["button","a","option","Button","IconButton","SplitButton","Link","NavLink","PopupMenuItem","PopupMenuLabel","DropdownMenuItem","MenuItem","ContextMenuItem"]),he=/(?:…|\.\.\.|…)\s*$/,pe=new RegExp("\\p{L}","u"),fe=new RegExp("\\p{L}[\\p{L}-]*","u"),ge={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"],zhStarts:["正在"],zhEnds:["中"]},placeholder:{},prompt:{}},me=new Set((ge.busy?.words??[]).map(e=>e.toLowerCase())),we=new Set(["label","aria-label",...ge.placeholder?[]:["placeholder","searchPlaceholder","emptyOptionLabel","blankLabel"]]),ke=(e,t)=>{if(!he.test(t)||!pe.test(e))return!1;const n=e.match(fe)?.[0]?.toLowerCase();if(n&&me.has(n))return!1;const i=e.replace(he,"").trim(),o=ge.busy;return!(o&&(o.zhStarts.some(e=>i.startsWith(e))||o.zhEnds.some(e=>i.endsWith(e))))},xe=new Set(["confirm","alert","prompt"]),be=new Set(["window","globalThis","self"]);var $e=e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"),ye=e=>/\.(?:css|scss)$/.test(e),ve=/^(?:color|background(?:-color)?|border(?:-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?)?(?:-color)?|outline(?:-color)?|fill|stroke|caret-color|accent-color|text-decoration(?:-color)?|box-shadow|text-shadow|column-rule(?:-color)?)$/;function Se(e,t){if(!t.includes("colour"))return{};const n=e.replace(/\/\*[\s\S]*?\*\//g,e=>e.replace(/[^\n]/g," ")),i=[],o=e=>n.slice(0,e).split("\n").length;let s=0,r=0;for(let e=0;e<n.length;e++){const t=n[e];if("{"===t||"}"===t||";"===t){const a=n.slice(r,e);if("{"!==t&&s>0){const e=r+(a.length-a.trimStart().length),t=a.trim(),n=t.indexOf(":");if(t.startsWith("@apply"))for(let n=[...t.matchAll(oe)].length;n>0;n--)i.push(o(e));else if(n>0){const s=t.slice(0,n).trim().toLowerCase(),r=t.slice(n+1);if(!/^(?:-webkit-)?mask/.test(s)){const t=de(r)+(ve.test(s)?[...r.matchAll(ae)].length:0);for(let n=0;n<t;n++)i.push(o(e))}}}"{"===t?s++:"}"===t&&(s=Math.max(0,s-1)),r=e+1}}return i.length?{colour:i}:{}}function je(e,t,n,i,o){const s=new Set(i),r=e.createSourceFile(t,n,e.ScriptTarget.Latest,!0,function(e,t){return t.endsWith(".tsx")?e.ScriptKind.TSX:t.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(t)?e.ScriptKind.JS:e.ScriptKind.TS}(e,t)),a={},l=/\.[jt]sx$/.test(t),c=e=>r.getLineAndCharacterOfPosition(e).line+1,d=(e,t)=>{s.has(e)&&(a[e]??=[]).push(c(t.getStart(r)))},u=(t,n)=>t.attributes.properties.find(t=>e.isJsxAttribute(t)&&t.name.getText(r)===n),h=t=>{const n=t?.initializer;if(n)return e.isStringLiteral(n)?n.text:e.isJsxExpression(n)&&n.expression&&e.isStringLiteralLike(n.expression)?n.expression.text:void 0},p=new Set;if(s.has("native")){const t=n=>{if(n)if(e.isIdentifier(n))xe.has(n.text)&&p.add(n.text);else if(e.isObjectBindingPattern(n)||e.isArrayBindingPattern(n))for(const i of n.elements)e.isBindingElement(i)&&t(i.name)},n=i=>{(e.isImportClause(i)||e.isImportSpecifier(i)||e.isNamespaceImport(i)||e.isVariableDeclaration(i)||e.isParameter(i)||e.isFunctionDeclaration(i))&&t(i.name),e.forEachChild(i,n)};n(r)}const f=t=>t&&e.isStringLiteralLike(t)?t.text:void 0,g=(e,t)=>{e&&("efficient-shell"===e||e.startsWith("efficient-shell/"))&&o?.add(e);const n=e?k(e):null;n&&d(n,t)},m=(e,t,n)=>{if(s.has("dark"))for(const n of e.matchAll(te))d("dark",t);if(s.has("radius"))for(const n of e.matchAll(_))K.test(n[1].trim())||d("radius",t);if(n&&l&&s.has("hex"))for(const n of e.matchAll(q))d("hex",t);if(n&&s.has("colour"))for(let n=de(e);n>0;n--)d("colour",t);if(s.has("spacing"))for(const n of e.matchAll(H)){const e=n[1];(e.startsWith("[")?Z.test(e.slice(1,-1).trim()):J(e))||d("spacing",t)}if(s.has("font-size"))for(const n of e.matchAll(Q))d("font-size",t);if(s.has("z-index"))for(const n of e.matchAll(V)){const e=n[1].startsWith("[")?n[1].slice(1,-1).trim():n[1];/^\d+$/.test(e)&&Number(e)>30&&d("z-index",t)}if(s.has("shadow"))for(const n of e.matchAll(X))n[1].startsWith("[")&&Z.test(n[1].slice(1,-1).trim())||d("shadow",t)},w=(t,n,i)=>{const o=e.isStringLiteralLike(n)?n.text.trim():void 0;if(s.has("colour")&&void 0!==o&&le.test(t))for(const e of o.matchAll(ae))d("colour",i);if(s.has("spacing")&&Y.test(t))e.isNumericLiteral(n)?ee.has(Number(n.text))||d("spacing",i):void 0!==o&&!Z.test(o)&&(e=>[...e.matchAll(/(-?\d*\.?\d+)(px|rem|em)\b/g)].map(e=>Math.abs(Number(e[1]))*("px"===e[2]?1:16)))(o).some(e=>!ee.has(e))&&d("spacing",i);else if(s.has("font-size")&&"fontSize"===t)(e.isNumericLiteral(n)||void 0!==o&&!Z.test(o)&&!/^(?:smaller|larger)$/.test(o))&&d("font-size",i);else if(s.has("z-index")&&"zIndex"===t){const t=[],o=n=>{e.isNumericLiteral(n)||e.isStringLiteralLike(n)&&/^\d+$/.test(n.text.trim())?t.push(Number(n.text)):e.forEachChild(n,o)};o(n);for(const e of t)e>30&&d("z-index",i)}else s.has("shadow")&&"boxShadow"===t&&(void 0===o||""===o||Z.test(o)||d("shadow",i))},x=(t,n)=>{if(e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)){const e=t.tagName.getText(r);if(/^[a-z]/.test(e)){const n=h(u(t,"type"));"svg"===e&&d("svg",t),"button"===e?d("button",t):"select"===e?d("select",t):"textarea"===e?d("textarea",t):"input"===e&&("range"===n?d("range",t):"hidden"!==n&&d("input",t));const i=h(u(t,"role"));"dialog"!==e&&"dialog"!==i&&"alertdialog"!==i||d("dialog",t),!U.has(e)&&u(t,"title")&&d("title",t)}}else if(e.isCallExpression(t)){const n=t.expression;e.isIdentifier(n)?"createPortal"===n.text?d("portal",t):xe.has(n.text)&&!p.has(n.text)?d("native",t):"require"===n.text&&g(f(t.arguments[0]),t):e.isPropertyAccessExpression(n)?"createPortal"===n.name.text?d("portal",t):xe.has(n.name.text)&&e.isIdentifier(n.expression)&&be.has(n.expression.text)&&d("native",t):n.kind===e.SyntaxKind.ImportKeyword&&g(f(t.arguments[0]),t)}else{if(e.isImportDeclaration(t)||e.isExportDeclaration(t))return void g(f(t.moduleSpecifier),t);if(e.isPropertyAssignment(t)){const n=e.isIdentifier(t.name)||e.isStringLiteralLike(t.name)?t.name.text:"",i=t.initializer;w(n,i,t),s.has("radius")&&G.test(n)&&(e.isNumericLiteral(i)?K.test(i.text)||d("radius",t):e.isStringLiteralLike(i)&&!K.test(i.text.trim())&&d("radius",t))}else if(e.isStringLiteralLike(t))m(t.text,t,n);else if(e.isTemplateExpression(t)){m(t.head.text,t.head,n);for(const e of t.templateSpans)m(e.literal.text,e.literal,n)}}e.isJsxAttribute(t)&&W.has(t.name.getText(r))?e.forEachChild(t,e=>x(e,!1)):e.forEachChild(t,e=>x(e,n))};return x(r,!0),s.has("ellipsis-label")&&function(e,t,n){const i=new Set,o=(e,t)=>{i.has(e)||(i.add(e),n(t))},s=n=>{if(n)if(e.isStringLiteralLike(n))ke(n.text,n.text)&&o(n,n.getStart(t));else if(e.isTemplateExpression(n)){const e=[n.head.text,...n.templateSpans.map(e=>e.literal.text)];ke(e.join(" "),e[e.length-1])&&o(n,n.getStart(t))}else e.isConditionalExpression(n)?(s(n.whenTrue),s(n.whenFalse)):e.isBinaryExpression(n)?(s(n.left),s(n.right)):e.isParenthesizedExpression(n)||e.isAsExpression(n)||e.isJsxExpression(n)?s(n.expression):e.isCallExpression(n)&&Ie.has(Le(n.expression))&&n.arguments[0]&&s(n.arguments[0])},r=n=>{for(const i of n)if(e.isJsxText(i)){const e=i.getText(t);ke(e,e)&&o(i,i.getStart(t)+(e.length-e.trimStart().length))}else e.isJsxExpression(i)?s(i.expression):(e.isJsxElement(i)||e.isJsxFragment(i))&&r(i.children)},a=(n,i)=>{const o=n.attributes.properties.find(n=>e.isJsxAttribute(n)&&n.name.getText(t)===i),s=o?.initializer;return s&&e.isStringLiteral(s)?s.text:s&&e.isJsxExpression(s)&&s.expression&&e.isStringLiteralLike(s.expression)?s.expression.text:void 0},l=t=>t.properties.some(t=>e.isPropertyAssignment(t)&&(e.isIdentifier(t.name)||e.isStringLiteralLike(t.name))&&"value"===t.name.text&&e.isStringLiteralLike(t.initializer)&&""===t.initializer.text),c=n=>{if(e.isJsxElement(n)){const e=n.openingElement,i=e.tagName.getText(t),o="option"===i&&ge.prompt&&""===a(e,"value");ue.has(i)&&!o&&r(n.children)}else if(e.isJsxAttribute(n))we.has(n.name.getText(t))&&s(n.initializer);else if(e.isPropertyAssignment(n)){const t=e.isIdentifier(n.name)||e.isStringLiteralLike(n.name)?n.name.text:"",i=ge.prompt&&e.isObjectLiteralExpression(n.parent)&&l(n.parent);we.has(t)&&!i&&s(n.initializer)}e.forEachChild(n,c)};c(t)}(e,r,e=>(a["ellipsis-label"]??=[]).push(c(e))),a}var Ie=new Set(["say","t"]),Le=e=>{const t=e.getText();return t.slice(t.lastIndexOf(".")+1)};function Re(e){const t={};for(const[n,i]of Object.entries(e))i.length&&(t[n]=i.length);return t}function Ae(e,t,n){const i=e.createSourceFile(t,n,e.ScriptTarget.Latest,!1),o=[];for(const t of i.statements)(e.isImportDeclaration(t)||e.isExportDeclaration(t))&&t.moduleSpecifier&&e.isStringLiteralLike(t.moduleSpecifier)&&o.push(t.moduleSpecifier.text);return o}var ze=(e,t)=>e.some(e=>t.some(t=>t.endsWith("/*")?e.startsWith(t.slice(0,-1)):e===t));var Ee=e=>new Map(e.allow.map(e=>[A(e.file,e.kind),e.count]));function Ce(e,t){return e.kinds.filter(e=>t.kinds.includes(e))}var Te=(e,t,n)=>{if("kit-dep"===n)return` (${e.kitDeps.join(", ")})`;if("chart-dep"===n)return` (${e.chartDeps.join(", ")})`;const i=e.hits.get(t)?.[n]??[];if(0===i.length)return"";const o=i.slice(0,12).join(", ");return` (line${1===i.length?"":"s"} ${o}${i.length>12?", …":""})`};function Me(e,t,n){const i=Ee(e),o=new Map;for(const[e,s]of t.counts){const{kind:t}=z(e);if(!l(t)||!n.includes(t))continue;const r=s-(i.get(e)??0);r>0&&o.set(e,r)}return{kinds:a.filter(e=>n.includes(e)),counts:o}}function Be(e,t){let n=0;for(const i of new Set([...e.keys(),...t.keys()]))(e.get(i)??0)!==(t.get(i)??0)&&(n+=1);return n}var Pe="\n// <button> in a comment is not a button, and <svg> in one is not a drawing\n/* nor is <input title=\"x\"> in this one, or dark:bg-black, or #fff */\nimport { createPortal } from 'react-dom';\nimport { Dialog } from '@headlessui/react';\nimport { TrashIcon } from '@heroicons/react/24/outline';\nimport type { Icon } from 'lucide-react';\nimport { Button, confirm } from 'efficient-shell';\nexport { Slot } from '@radix-ui/react-slot';\nexport { CheckIcon } from '@radix-ui/react-icons';\nimport { LineChart } from 'recharts';\nimport 'd3-scale';\nexport { VictoryPie } from 'victory';\nimport { BarChart } from '@mui/x-charts';\nimport Tree from 'react-d3-tree';\nimport { TimeSeriesChart } from 'efficient-shell/ui';\n// import 'chart.js' in a comment is not an import, and 'echarts' in a string is not one either\nconst chartLabel = 'd3-array';\n\nconst a = <button title=\"Says what it does\">x</button>;\nconst b = <input type=\"range\" />;\nconst c = <input type=\"text\" />;\nconst c2 = <input type={\"hidden\"} name=\"csrf\" />;\nconst c3 = <input type=\"hidden\" />;\nconst c4 = <input type={kind} />;\nconst d = <select />;\nconst d2 = <textarea />;\nconst e = <div role=\"dialog\" />;\nconst e2 = <dialog open />;\nconst e3 = <section role={'alertdialog'} />;\nconst f = <iframe title=\"Preview\" />;\nconst f2 = <object title=\"Chart\" />;\nconst g = <Button title=\"a prop, not a tooltip\" role=\"dialog\" />;\nconst g2 = (\n <button\n type=\"button\"\n title={hint}\n >\n y\n </button>\n);\nconst h = ReactDOM.createPortal(a, document.body);\nconst i = createPortal(a, document.body);\n\nasync function leave() {\n if (window.confirm('Sure?')) return;\n globalThis.alert('No');\n alert('native: nothing binds the name');\n prompt('native too');\n await confirm('the shell: the import binds it');\n record.confirm('a method, not the popup');\n}\n\nconst j = <div className=\"bg-white dark:bg-black dark:hover:text-white is-dark:no\" />;\nconst k = clsx('text-gray-900', on && 'dark:text-gray-100');\nconst l = <span style={{ color: '#fff', background: \"#12ab34\" }} className={`border-[#0a0b0c80] ${x}`} />;\nconst m = <a href=\"#faded\" id=\"#bad\" key=\"#abc\" to=\"#face\">skip</a>;\nconst n = <label htmlFor={'#dead'}>skip</label>;\nconst o = <span>Ӓ and BG#00340 and #12345 and #added are not colours</span>;\nconst p = 'entity  ref BG#00340';\nconst q = <use xlinkHref=\"#abc\" fill=\"url(#fed)\" />;\nconst t = <div className=\"rounded-[4px] rounded-t-[0.5rem] hover:rounded-[2px] rounded-lg rounded-(--radius-card) rounded-[inherit] rounded-[var(--r)]\" />;\nconst u = <div style={{ borderRadius: 6, borderTopLeftRadius: '3px', borderBottomRightRadius: '50%', borderEndEndRadius: 'var(--radius-card)' }} />;\nconst v = <i style={{ borderRadius: 9999 }} />;\nconst w = <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 4h16\" /></svg>;\nconst w2 = <Svg viewBox=\"0 0 24 24\" />;\nconst w3 = '<svg viewBox=\"0 0 1 1\"></svg> in a string is not an element';\nconst r = lazy(() => import('@mui/material'));\nconst s = require('react-select');\nconst s2 = require('chart.js/auto');\nconst s3 = import('@nivo/line');\n",Oe={button:2,input:2,range:1,textarea:1,select:1,dialog:3,title:2,portal:2,native:4,dark:3,hex:3,radius:5,kit:5,icon:3,svg:1,chart:5,colour:8},De={kit:1,dark:1,portal:1,radius:2,chart:1,colour:2},Ne=(...e)=>e.join("-"),Fe=`\nconst s1 = <i className="${[Ne("px","2.5"),Ne("py","1.5"),"md:"+Ne("gap","1.5"),"-"+Ne("mt","1.5"),Ne("p","[10px]")].join(" ")}" />;\nconst s2 = <i className="${[Ne("p","0"),Ne("px","px"),Ne("p","0.5"),Ne("p","3"),Ne("gap-x","4"),Ne("p","12"),Ne("p","(--space-12)"),Ne("p","[var(--space-12)]"),Ne("space-x","reverse"),Ne("top","1.5")].join(" ")}" />;\nconst s3 = <i style={{ padding: 6, marginTop: '10px', gap: 8, margin: '0 auto', paddingInline: 'var(--space-12)' }} />;\nconst f1 = <i className="${[Ne("text","[11px]"),Ne("text","[0.8rem]"),Ne("text","xs"),Ne("text","[#fff]"),Ne("text","(--text-2xs)")].join(" ")}" />;\nconst f2 = <i style={{ fontSize: 12 }} />;\nconst f3 = { fontSize: 'var(--x)', font: 'inherit' };\nconst z1 = <i className="${[Ne("z","[9999]"),Ne("z","50"),Ne("z","10"),Ne("z","30"),"-"+Ne("z","10"),Ne("z","auto"),Ne("z","(--z-popup)"),Ne("z","[var(--z-popup)]")].join(" ")}" />;\nconst z2 = { zIndex: on ? 2020 : 2010 };\nconst z3 = { zIndex: Z_LAYERS.popup, top: 9999 };\nconst h1 = <i className="${[Ne("shadow","[0_1px_2px_#000]"),Ne("shadow","md"),"shadow",Ne("shadow","lg"),Ne("shadow","(--elevation-panel)"),Ne("shadow","black/20"),Ne("drop-shadow","md")].join(" ")}" />;\nconst h2 = { boxShadow: '0 1px 2px rgba(0,0,0,.1)' };\nconst h3 = { boxShadow: 'none', outline: 'var(--elevation-raised)' };\n`,Je={spacing:7,"font-size":3,"z-index":4,shadow:3,hex:1,colour:4},Ue={colour:4},We={"ellipsis-label":9},qe=e=>a.filter(t=>e[t]).map(t=>`${t} ${e[t]}`).join(", ")||"nothing";var _e="ui-kit.config.json",Ge="ui-kit.baseline.json",Ke="efficient-shell-ui-check",He=`${Ke}: every surface a person operates takes its UI from efficient-shell (harness UI-24).\n\n ${Ke} check this repository against ${Ge}\n ${Ke} --print print today's counts as a baseline, and change nothing\n ${Ke} --summary print totals per kind and per folder, as Markdown\n ${Ke} --json print the result as JSON\n ${Ke} --update lower the lines whose counts fell, and delete the ones at zero\n ${Ke} --update --allow-move also follow a renamed or split file (no total may rise)\n ${Ke} --init write the first ${Ge}\n ${Ke} --init --kind <kind> take the baseline for a kind just added to "kinds"\n ${Ke} --no-base do not compare with the pull request's base branch\n\nKinds: ${a.join(", ")}\nReads ${_e} in the current directory.`;var Qe=(e,t)=>`${e} ${t}${1===e?"":"s"}`,Ve=(e,t)=>{const n=B(e);return t.map(e=>`${e} ${n[e]??0}`).join(" · ")};process.exitCode=function(e,t){const r=function(e){const t={print:!1,summary:!1,json:!1,update:!1,allowMove:!1,init:!1,noBase:!1,help:!1,version:!1,kinds:[]};for(let n=0;n<e.length;n++){const i=e[n];if("--print"===i)t.print=!0;else if("--summary"===i)t.summary=!0;else if("--json"===i)t.json=!0;else if("--update"===i)t.update=!0;else if("--allow-move"===i)t.allowMove=!0;else if("--init"===i)t.init=!0;else if("--no-base"===i)t.noBase=!0;else if("--help"===i||"-h"===i)t.help=!0;else if("--version"===i||"-v"===i)t.version=!0;else if("--kind"===i){const i=e[++n];if(!i)return"--kind needs a kind after it";t.kinds.push(...i.split(","))}else{if(!i.startsWith("--kind="))return`unknown argument "${i}"`;t.kinds.push(...i.slice(7).split(","))}}return t.allowMove&&!t.update?"--allow-move goes with --update":t.kinds.length&&!t.init?"--kind goes with --init":[t.print,t.summary,t.update,t.init].filter(Boolean).length>1?"choose one of --print, --summary, --update and --init":t}(e);if("string"==typeof r)return t.err(`${Ke}: ${r}\n\n${He}`),2;if(r.help)return t.out(He),0;if(r.version)return t.out(t.version),0;const c=e=>(r.json?t.out(JSON.stringify({tool:Ke,version:t.version,ok:!1,failures:[e]},null,2)):t.err(`${Ke}: ${e}`),1),p=n(t.cwd,_e);if(!i(p))return c(`no ${_e} in ${t.cwd}. Run it from the repository root; the harness has the template.`);let f,g;try{f=function(e,t="ui-kit.config.json"){const n=[],i=e=>{n.push(e)},o=(e,t,{required:n=!1}={})=>{if(void 0===e&&!n)return[];if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||""===e))return i(`${t} must be a list of non-empty strings`),[];n&&0===e.length&&i(`${t} must name at least one entry`);for(const n of e)(n.startsWith("/")||n.startsWith("./")||n.includes("\\")||n.split("/").includes(".."))&&i(`${t}: "${n}" must be a path from the repository root, written with / (no ./, .. or \\)`);return e},s=(e,t)=>"string"!=typeof e||e.trim().length<10?(i(`${t} needs a "reason" a reviewer can read (a sentence, not a word)`),""):e,r=(e,t)=>void 0===e?[]:!Array.isArray(e)||e.some(e=>!O(e))?(i(`${t} must be a list of objects`),[]):e;if(!O(e))throw new P(`${t}: must be a JSON object`);for(const t of Object.keys(e))D.has(t)||i(`unknown key "${t}"`);1!==e.schema&&i("number"==typeof e.schema&&e.schema>1?`"schema": ${e.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');const c=[];if(Array.isArray(e.kinds)&&0!==e.kinds.length)for(const t of e.kinds)l(t)?c.includes(t)?i(`"kinds": "${t}" is listed twice`):c.push(t):i(`"kinds": unknown kind ${JSON.stringify(t)} (this efficient-shell knows: ${a.join(", ")})`);else i(`"kinds" must list the kinds this repository checks, from: ${a.join(", ")}`);const d=o(e.include,'"include"'),u=o(e.exclude,'"exclude"'),h=r(e.includeImporting,'"includeImporting"').map((e,t)=>({files:o(e.files,`"includeImporting"[${t}].files`,{required:!0}),modules:o(e.modules,`"includeImporting"[${t}].modules`,{required:!0}),reason:s(e.reason,`"includeImporting"[${t}]`)}));0===d.length&&0===h.length&&i('"include" must name the files that are operator UI (for example ["src/**/*.tsx"])');const p=r(e.output,'"output"').map((e,t)=>({files:o(e.files,`"output"[${t}].files`,{required:!0}),reason:s(e.reason,`"output"[${t}]`)})),f=[],g=new Set;if(r(e.allow,'"allow"').forEach((e,t)=>{const n=`"allow"[${t}]`,[r]=o([e.file],`${n}.file`),d=s(e.reason,n);if(!l(e.kind))return void i(`${n}.kind must be one of: ${a.join(", ")}`);if(c.includes(e.kind)||i(`${n}: kind "${e.kind}" is not in "kinds"`),"number"!=typeof e.count||!Number.isInteger(e.count)||e.count<1)return void i(`${n}.count must be a whole number, 1 or more`);if(!r)return;const u=`${r}:${e.kind}`;g.has(u)&&i(`${n}: ${r} already has an allow entry for "${e.kind}"`),g.add(u),f.push({file:r,kind:e.kind,count:e.count,reason:d})}),n.length)throw new P(`${t}:\n - ${n.join("\n - ")}`);return{schema:1,kinds:a.filter(e=>c.includes(e)),include:d,exclude:u,includeImporting:h,output:p,allow:f}}(JSON.parse(o(p,"utf8")),_e)}catch(e){return c(e instanceof P?e.message:`${_e} is not valid JSON: ${e.message}`)}try{g=t.loadTypeScript()}catch{return c('this check reads the TypeScript AST and found no "typescript" package here. Install it as a devDependency.')}const w=function(e){const t=[],n=u,i=[["fixture.tsx",Pe,Oe],["fixture.ts","\nimport { toast } from 'sonner';\nimport { extent } from 'd3-array';\nexport const tone = { warn: '#f59e0b' };\nexport const cls = 'ring-1 dark:ring-white rounded-[3px]';\nexport const box = { borderRadius: '0.25rem', radius: 4 };\nexport function ask(confirm: (message: string) => boolean) {\n return confirm('a parameter binds the name');\n}\nexport const mount = (node: unknown) => ReactDOM.createPortal(node, document.body);\n",De],["tokens.tsx",Fe,Je],["labels.tsx","\n// <Button>Save…</Button> in a comment is not a label\nconst l1 = <Button>Extend trial…</Button>;\nconst l2 = <PopupMenuItem onClick={go}><span>Read from a PDF...</span></PopupMenuItem>;\nconst l3 = <Button>{busy ? 'Saving…' : 'Duplicate site…'}</Button>;\nconst l4 = <Item label=\"Translate…\" aria-label={'More…'} />;\nconst l5 = [{ label: 'Reject…' }, { value: CUSTOM, label: 'Custom…' }];\nconst l6 = <option value={CUSTOM}>Different address…</option>;\nconst l7 = <PopupMenuLabel>{say(\"Duplicate to page…\")}</PopupMenuLabel>;\nconst n7 = <Button>{t('team:menu.remove')}</Button>;\nconst n1 = <Button>{`${name.slice(0, 9)}…`}</Button>;\nconst n2 = <p>Loading weather…</p>;\nconst n3 = <Input placeholder=\"Search…\" />;\nconst n4 = <option value=\"\">Pick a carrier…</option>;\nconst n5 = [{ value: '', label: 'Select…' }];\nconst n6 = <Button>Extend trial</Button>;\n",We]];for(const[o,s,r]of i){const i=Re(je(e,o,s,n));n.some(e=>(i[e]??0)!==(r[e]??0))&&t.push(`${o}: read ${qe(i)}; it holds ${qe(r)}`)}const o=Re(Se('\n/* #fff in a comment */\n.a:hover { color: #111; border: 1px solid white; }\n[data-x="#fff"] { mask-image: linear-gradient(#000, transparent); color: var(--ink); }\n.b { --mine: rgb(0 0 0 / .5); background: var(--surface, #fff); }\n',n));n.some(e=>(o[e]??0)!==(Ue[e]??0))&&t.push(`style.css: read ${qe(o)}; it holds ${qe(Ue)}`);const s=Re(je(e,"fixture.tsx",Pe,["button"]));return"button"!==Object.keys(s).join()&&t.push(`asked for button alone, the reader reported ${qe(s)}`),t}(g);if(w.length)return c(`the reader misread its own fixtures with typescript ${g.version}, so nothing it says about this repository can be trusted:\n - `+w.join("\n - "));const k=function(e,t,s){const r=[],a=y(s.exclude),l=y(s.output.flatMap(e=>e.files)),c=new Map,u=e=>{let i=c.get(e);return void 0===i&&c.set(e,i=o(n(t,e),"utf8")),i},h=(e,n)=>{for(const i of e)0===I(t,[i]).length&&r.push(`${n}: "${i}" matches no file. Delete the line, or fix the path.`)};h(s.include,'"include"'),s.output.forEach((e,t)=>h(e.files,`"output"[${t}]`)),s.includeImporting.forEach((e,t)=>h(e.files,`"includeImporting"[${t}]`));const p=new Set,f=s.kinds.includes("colour"),g=e=>($e(e)||f&&ye(e))&&!a(e)&&!l(e);for(const e of I(t,s.include))g(e)&&p.add(e);for(const n of s.includeImporting)for(const i of I(t,n.files))g(i)&&$e(i)&&!p.has(i)&&ze(Ae(e,i,u(i)),n.modules)&&p.add(i);const w=[...p].sort(),k=s.kinds.filter(e=>!d(e)),b=new Map,$=new Map,v=new Set;for(const t of w){const n=ye(t)?Se(u(t),k):je(e,t,u(t),k,v);let i=!1;for(const e of k){const o=n[e]?.length??0;o&&($.set(A(t,e),o),i=!0)}i&&b.set(t,n)}let S=[],j=[],L=[];const R=s.kinds.filter(d);if(R.length){const e=n(t,N);if(i(e)){const t=JSON.parse(o(e,"utf8")),n=["dependencies","peerDependencies","optionalDependencies"].flatMap(e=>Object.keys(t[e]??{})),i=new Set([...v].flatMap(e=>m[e]??[])),r=[...new Set(n)].sort();if(s.kinds.includes("kit-dep")){const e=r.filter(e=>"kit-dep"===x(e));S=e.filter(e=>!i.has(e)),j=e.filter(e=>i.has(e)),S.length&&$.set(A(N,"kit-dep"),S.length)}s.kinds.includes("chart-dep")&&(L=r.filter(e=>"chart-dep"===x(e)),L.length&&$.set(A(N,"chart-dep"),L.length))}else for(const e of R)r.push(`"kinds" includes "${e}", and there is no ${N} here to read.`)}for(const e of s.allow)(d(e.kind)?e.file===N:p.has(e.file))||r.push(`"allow": ${e.file} (${e.kind}) is not a file this check reads. Delete the entry, or fix the path.`);return{files:w,hits:b,counts:$,kitDeps:S,shellPeers:j,chartDeps:L,problems:r}}(g,t.cwd,f);if(0===k.files.length)return c(`read no files. "include" in ${_e} matches nothing, so a pass would mean nothing.`);const b=n(t.cwd,Ge),$=r.json,v=e=>{$||t.out(e)};if(r.print)return t.out(M(Me(f,k,f.kinds)).trimEnd()),0;if(r.summary){for(const e of function(e,t){const n=new Map,i=new Map;for(const[e,o]of t.counts){const{file:t,kind:s}=z(e);if(!l(s))continue;const r=n.get(s)??{count:0,files:new Set};r.count+=o,r.files.add(t),n.set(s,r);const a=t.split("/"),c=a.length>2?a.slice(0,2).join("/"):2===a.length?a[0]:".",d=i.get(c)??{};d[s]=(d[s]??0)+o,i.set(c,d)}const o=e.kinds.filter(e=>n.has(e)),s=[`**UI kit check (harness UI-24):** ${new Set([...t.counts.keys()].map(e=>z(e).file)).size} of ${Qe(t.files.length,"file")} still draw UI of their own.`,"","| Kind | Count | Files | The shell has |","|---|---:|---:|---|",...e.kinds.map(e=>{const t=n.get(e);return`| \`${e}\` | ${t?.count??0} | ${t?.files.size??0} | ${h[e].instead} |`})];if(o.length&&i.size){const e=e=>o.reduce((t,n)=>t+(e[n]??0),0),t=[...i].sort((t,n)=>e(n[1])-e(t[1])||(t[0]<n[0]?-1:1));s.push("",`| Folder | ${o.map(e=>`\`${e}\``).join(" | ")} | Total |`,`|---|${o.map(()=>"---:").join("|")}|---:|`,...t.map(([t,n])=>`| \`${t}\` | ${o.map(e=>n[e]??0).join(" | ")} | ${e(n)} |`))}return s}(f,k))t.out(e);return 0}let S=null;if(i(b))try{S=T(o(b,"utf8"),Ge)}catch(e){return c(e instanceof R?e.message:String(e))}if(r.init){const e=r.kinds.filter(e=>!l(e)||!f.kinds.includes(e));if(e.length)return c(`--kind ${e.join(", ")}: not in "kinds" in ${_e}. Add it there first.`);const t=r.kinds;if(S){if(0===t.length)return c(`${Ge} already exists, and --init would overwrite what it holds. It is for the adoption pull request only. To start checking a kind, add it to "kinds" and run --init --kind <kind>.`);const e=t.filter(e=>S.kinds.includes(e));if(e.length)return c(`the baseline was already taken for ${e.join(", ")}. Its lines only go down; use --update.`);const n=Me(f,k,t);S={kinds:[...S.kinds,...t],counts:new Map([...S.counts,...n.counts])}}else{if(t.length)return c(`there is no ${Ge} yet. Run --init on its own first.`);S=Me(f,k,f.kinds)}s(b,M(S)),v(`${Ke}: wrote ${Ge} (${Qe(S.counts.size,"line")}: ${Ve(S.counts,S.kinds)})`)}if(!S)return c(`no ${Ge}. This repository has not adopted the check yet: run ${Ke} --init, and commit the file.`);if(r.update){const e=function(e,t,n,{allowMove:i=!1}={}){const o=Ce(e,t),s=Me(e,n,o),r=new Map([...t.counts].filter(([e])=>o.includes(z(e).kind)));if(i){const e=B(r),n=B(s.counts),i=o.filter(t=>(n[t]??0)>(e[t]??0)).map(t=>`${t}: ${n[t]??0} across the repository, and the baseline holds ${e[t]??0}`);return i.length?{baseline:t,lowered:0,refused:i}:{baseline:s,lowered:Be(r,s.counts),refused:[]}}const a=new Map;for(const[e,t]of r){const n=Math.min(t,s.counts.get(e)??0);n>0&&a.set(e,n)}return{baseline:{kinds:o,counts:a},lowered:Be(r,a),refused:[]}}(f,S,k,{allowMove:r.allowMove});if(e.refused.length)return c(`--allow-move follows code that moved, and this is more of it than before:\n - ${e.refused.join("\n - ")}\nNothing was written.`);S=e.baseline,s(b,M(S)),v(`${Ke}: ${e.lowered?`changed ${Qe(e.lowered,"line")} in`:"nothing to change in"} ${Ge}`)}const j=function(e,t,n){const i=[],o=[],s=[...n.problems],r=Ee(e),a=new Set(Ce(e,t)),c=e.kinds.filter(e=>!t.kinds.includes(e));c.length&&s.push(`"kinds" names ${c.map(e=>`"${e}"`).join(", ")}, and the baseline was never taken for ${1===c.length?"it":"them"}. Run: efficient-shell-ui-check --init ${c.map(e=>`--kind ${e}`).join(" ")}`);const d=t.kinds.filter(t=>!e.kinds.includes(t));d.length&&o.push(`the baseline still carries ${d.map(e=>`"${e}"`).join(", ")}, which "kinds" no longer names`);const u=new Set([...n.counts.keys(),...t.counts.keys(),...r.keys()]);for(const e of[...u].sort(C)){const{file:c,kind:d}=z(e);if(!l(d)||!a.has(d))continue;const u=n.counts.get(e)??0,p=r.get(e)??0,f=t.counts.get(e)??0;u>p+f?i.push(`${c}: ${d} ${u}, and its line allows ${p+f}${Te(n,c,d)}. ${h[d].counts} is counted; use ${h[d].instead}.`):u<p?s.push(`${c}: ${d} ${u}, and "allow" in ui-kit.config.json says ${p}. ${0===u?"Delete the entry":`Lower its count to ${u}`}: an exception does not outlive what it excused.`):u<p+f&&o.push(`${c}: ${d} ${u}, and its line says ${p+f}`)}return{grown:i,shrunk:o,other:s,updateFixes:0===i.length&&0===s.length&&o.length>0}}(f,S,k),L=r.noBase?{problems:[],note:""}:function(e,t,n){const i=e.env.GITHUB_BASE_REF;if(!i)return{problems:[],note:""};const o=e.git(["rev-parse","--show-prefix"]);if(null===o)return{problems:[],note:"not a git checkout; the base branch was not compared"};const s=`origin/${i}`;if(null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])&&(e.git(["fetch","--no-tags","--depth=1","origin",`+refs/heads/${i}:refs/remotes/origin/${i}`]),null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])))return{problems:[],note:`${s} could not be fetched; the base branch was not compared`};const r=e.git(["show",`${s}:${o.trim()}${Ge}`]);if(null===r)return{problems:[],note:`${s} has no ${Ge} yet (adoption)`};let a;try{a=T(r,`${s}:${Ge}`)}catch{return{problems:[],note:`${s}'s ${Ge} could not be read; the base branch was not compared`}}const l=B(a.counts),c=B(t.counts);return{problems:n.filter(e=>a.kinds.includes(e)&&(c[e]??0)>(l[e]??0)).map(e=>`${Ge} holds ${c[e]??0} of "${e}", and ${s} holds ${l[e]??0}. The baseline only goes down: use ${h[e].instead}. A count that is meant to stay goes in "allow" in ${_e}, with its reason.`),note:`compared with ${s}`}}(t,S,f.kinds),E=f.kinds.filter(e=>S.kinds.includes(e)),F=`${Ke} --update`,J=[...j.other,...j.grown,...j.shrunk.map(e=>`${e}. Run: ${F}`),...L.problems],U=0===J.length;if(r.json){const e=new Map(f.allow.map(e=>[`${e.file}:${e.kind}`,e.count]));return t.out(JSON.stringify({tool:Ke,version:t.version,ok:U,schema:f.schema,kinds:f.kinds,files:k.files.length,counts:B(k.counts),baseline:B(S.counts),allowed:B(e),kitDeps:k.kitDeps,shellPeers:k.shellPeers,chartDeps:k.chartDeps,failures:J},null,2)),U?0:1}t.out(`UI kit check (harness UI-24), efficient-shell ${t.version}\n`);const W=(e,n,i="")=>{if(0===n.length)return t.out(` ok ${e}`);t.err(` FAIL ${e}`);for(const e of n)t.err(` ${e}`);i&&t.err(` ${i}`)};t.out(` ok the reader reads its own fixtures (typescript ${g.version})`),t.out(` ok read ${Qe(k.files.length,"file")}`),W(`${_e} and ${Ge} describe this repository`,j.other),W("no file draws more of its own UI than its line allows",j.grown),W("every line is exact: a count that fell is a line to lower",j.shrunk,`Run: ${F}${j.updateFixes?"":" (after the failures above are fixed)"}`),L.note&&W(`the baseline is no higher than the base branch (${L.note})`,L.problems);const q=new Set([...k.counts.keys()].map(e=>z(e).file));return t.out(` ok PROGRESS: ${q.size} of ${Qe(k.files.length,"file")} still draw UI of their own: `+Ve(k.counts,E)),t.out(""),U?t.out("UI kit check: ok"):t.err(`UI kit check: FAILED (${Qe(J.length,"problem")})`),U?0:1}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>function(e){for(const i of[n(process.cwd(),"package.json"),e])try{return t(i)("typescript")}catch{}throw new Error("typescript is not installed")}(import.meta.url),git:function(t){try{return e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:6e4,maxBuffer:67108864})}catch{return null}},version:"11.11.0"});
|
|
2
|
+
import{execFileSync as e}from"child_process";import{createRequire as t}from"module";import{join as n}from"path";import{existsSync as i,readFileSync as o,writeFileSync as s,readdirSync as r}from"fs";var a=["button","input","range","textarea","select","dialog","title","portal","native","dark","hex","radius","spacing","font-size","z-index","shadow","kit","icon","svg","kit-dep","chart","chart-dep","ellipsis-label","colour"],l=e=>"string"==typeof e&&a.includes(e),c=["kit-dep","chart-dep"],d=e=>c.includes(e),u=a.filter(e=>!d(e)),h={button:{counts:"a raw <button>",instead:"Button or IconButton from efficient-shell/ui"},input:{counts:"a raw <input> (not hidden, not a range)",instead:"Input, InputNumber, Checkbox, Radio or Switch from efficient-shell/ui"},range:{counts:'a raw <input type="range">',instead:"Slider from efficient-shell/ui"},textarea:{counts:"a raw <textarea>",instead:"Textarea from efficient-shell/ui"},select:{counts:"a raw <select>",instead:"Select or SearchableSelect from efficient-shell/ui"},dialog:{counts:'a raw <dialog>, or role="dialog" / role="alertdialog" on a raw element',instead:"Dialog or Modal from efficient-shell"},title:{counts:"a title= on a raw element (the browser's own tooltip)",instead:"Tooltip from efficient-shell/ui (harness UI-17)"},portal:{counts:"a createPortal(…) call (a layer the file floats itself)",instead:"Popover, PopupMenu, DropdownMenu, Tooltip or Dialog from efficient-shell/ui"},native:{counts:"window.confirm / alert / prompt, or a bare call that resolves to one",instead:"confirm, confirmDestructive, prompt or toast from efficient-shell (harness UI-20)"},dark:{counts:"a dark: variant in a class string",instead:"the light Tailwind class alone; the shell remaps it in dark mode (harness UI-7)"},hex:{counts:"a hex colour literal in a .tsx string",instead:"a colour role from efficient-shell: its utility or var(--role), COLOUR_ROLES lists them (harness FT-1; the colour kind counts palette classes too)"},radius:{counts:"a literal corner radius (an arbitrary-value radius class, or an inline borderRadius)",instead:"a radius utility from the scale or a role token such as rounded-(--radius-control); the theme sets how round they are (harness UI-7)"},spacing:{counts:"a padding, margin or gap off the scale (6px, 10px, 14px …) or written as a literal length (an arbitrary-value class, an inline style)",instead:"a step of the scale 2/4/8/12/16/20/24/32/40/48 — a Tailwind step, or a role such as var(--space-control-x) (owner ruling 2026-10-12)"},"font-size":{counts:"a literal font size (an arbitrary-value text class, an inline fontSize)",instead:"a type step 9/11/12/14/16/18/20/24/30 — Tailwind's 3xs … 3xl text steps (owner ruling 2026-10-12)"},"z-index":{counts:"a stack order above 30 written as a number (a z utility, an arbitrary value, an inline zIndex)",instead:"a named layer: Z_LAYERS (efficient-shell/ui) in code, its --z-* custom property in markup"},shadow:{counts:"a literal shadow, or a shadow size that is not an elevation level (md, 2xl, xs)",instead:"an elevation: the sm / lg / xl utilities, or var(--elevation-panel) and its siblings (owner ruling 2026-10-12)"},kit:{counts:"an import of a second UI kit",instead:"the component from efficient-shell/ui, or fold it into the shell (harness FT-3)"},icon:{counts:"an import of an icon package",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24)"},svg:{counts:"an <svg> element written in JSX: an icon drawn in place",instead:"<Icon name> from efficient-shell/icons, drawn by the one set (harness UI-24). A chart, an illustration or a mark a host supplies stays on the baseline"},"kit-dep":{counts:"a UI kit or icon package declared in package.json (not one the shell entries imported here need)",instead:"remove the dependency once nothing imports it (harness FT-3)"},chart:{counts:"an import of a second chart library",instead:"a chart from efficient-shell/ui (ChartFrame, TimeSeriesChart, ColumnChart, RankedBars, PieChart, FunnelChart, ScatterChart, …), or add the chart there: one chart system (harness FT-3)"},"chart-dep":{counts:"a chart library declared in package.json",instead:"remove the dependency once nothing imports it (harness FT-3)"},"ellipsis-label":{counts:'a button, link or menu label that ends in "…" or "..."',instead:'the label without the dots, saying what it does ("Extend trial"): "…" means only "the words are cut" (owner ruling 2026-10-14)'},colour:{counts:"a literal colour, in a script string or a stylesheet: a hex, an rgb() / hsl() / oklch() value, a Tailwind palette class (a hue and a step, or white / black), a --color-<hue>-<step> variable, or a named colour in a colour property — a var() fallback included",instead:"a colour role from efficient-shell: its utility (the text, background or border utility of ink, ink-faint, surface, line, accent-fill, accent-text, danger-text, status-danger-line …) or var(--role); COLOUR_ROLES lists them. A merchant site reads the site theme (owner ruling 2026-10-23)"}},p=["@headlessui/","@radix-ui/","@mui/","@chakra-ui/","@mantine/","@floating-ui/","antd","react-aria","react-aria-","react-bootstrap","react-select","react-colorful","react-tooltip","react-hot-toast","react-toastify","sonner"],f=["@heroicons/","@tabler/icons","@tabler/icons-","@phosphor-icons/","@fortawesome/","@iconify/","@radix-ui/react-icons","@mui/icons-material","lucide","lucide-react","simple-icons","react-icons","react-feather"],g=["recharts","chart.js","react-chartjs-2","d3","d3-","@nivo/","victory","victory-","echarts","echarts-for-react","apexcharts","react-apexcharts","@visx/","highcharts","highcharts-react-official","plotly.js","plotly.js-dist","react-plotly.js","lightweight-charts","@antv/g2","@antv/g2plot","chartist","billboard.js","c3","uplot"],m={"efficient-shell":["@headlessui/react"]};function w(e,t){return t.some(t=>t.endsWith("/")||t.endsWith("-")?e.startsWith(t):e===t||e.startsWith(`${t}/`))}function k(e){return w(e,f)?"icon":w(e,p)?"kit":w(e,g)?"chart":null}function x(e){const t=k(e);return"kit"===t||"icon"===t?"kit-dep":"chart"===t?"chart-dep":null}var b=/[.+^$()|[\]\\]/g;function $(e){let t="",n=0;for(let i=0;i<e.length;i++){const o=e[i];"*"===o?"*"===e[i+1]?"/"===e[i+2]?(t+="(?:[^/]+/)*",i+=2):(t+=".*",i+=1):t+="[^/]*":"?"===o?t+="[^/]":"{"===o?(t+="(?:",n+=1):"}"===o&&n>0?(t+=")",n-=1):t+=","===o&&n>0?"|":o.replace(b,"\\$&")}if(0!==n)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${t}$`)}function y(e){const t=e.map($);return e=>t.some(t=>t.test(e))}var v=new Set(["node_modules",".git"]),S=new Set(["dist","coverage",".next",".turbo"]);function j(e){const t=e.search(/[*?{]/),n=-1===t?e:e.slice(0,t),i=n.lastIndexOf("/");return-1===i?"":n.slice(0,i)}function I(e,t){const i=y(t),o=[...new Set(t.map(j))].sort(),s=o.filter(e=>!o.some(t=>t!==e&&(""===t||e.startsWith(`${t}/`)))),a=new Set,l=t=>{let o;try{o=r(n(e,t),{withFileTypes:!0})}catch{return}for(const e of o){const n=t?`${t}/${e.name}`:e.name;e.isDirectory()?v.has(e.name)||""===t&&S.has(e.name)||l(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)l(e);return[...a].sort(L)}var L=(e,t)=>e<t?-1:e>t?1:0,R=class extends Error{},A=(e,t)=>`${e}:${t}`;function z(e){const t=e.lastIndexOf(":");return{file:e.slice(0,t),kind:e.slice(t+1)}}var E=e=>a.indexOf(e);function C(e,t){const n=z(e),i=z(t);return L(n.file,i.file)||E(n.kind)-E(i.kind)}function T(e,t="ui-kit.baseline.json"){let n;try{n=JSON.parse(e)}catch(e){throw new R(`${t} is not valid JSON: ${e.message}`)}const i=e=>{throw new R(`${t}: ${e}. The tool writes this file; do not edit it by hand.`)};if("object"!=typeof n||null===n||Array.isArray(n))return i("must be a JSON object");const o=n;if(1!==o.schema)return i("number"==typeof o.schema&&o.schema>1?`"schema": ${o.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');if(!Array.isArray(o.kinds)||o.kinds.some(e=>"string"!=typeof e))return i('"kinds" must be a list');const s=o.kinds.filter(l);if("object"!=typeof o.counts||null===o.counts||Array.isArray(o.counts))return i('"counts" must be an object');const r=new Map;for(const[e,t]of Object.entries(o.counts)){const{file:n,kind:o}=z(e);if(!n||!o)return i(`"${e}" is not "<file>:<kind>"`);if("number"!=typeof t||!Number.isInteger(t)||t<1)return i(`"${e}" must be a whole number, 1 or more (a line that reaches 0 is deleted)`);l(o)&&r.set(e,t)}return{kinds:s,counts:r}}function M(e){const t=a.filter(t=>e.kinds.includes(t)),n=[...e.counts.keys()].filter(t=>(e.counts.get(t)??0)>0).sort(C).map(t=>` ${JSON.stringify(t)}: ${e.counts.get(t)}`);return["{",' "schema": 1,',` "kinds": [${t.map(e=>JSON.stringify(e)).join(", ")}],`,n.length?` "counts": {\n${n.join(",\n")}\n }`:' "counts": {}',"}",""].join("\n")}function B(e){const t={};for(const[n,i]of e){const{kind:e}=z(n);l(e)&&(t[e]=(t[e]??0)+i)}return t}var P=class extends Error{},O=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),D=new Set(["$schema","schema","kinds","include","exclude","includeImporting","output","allow"]);var N="package.json",F=[2,4,8,12,16,20,24,32,40,48];function J(e){if("0"===e||"px"===e)return!0;const t=Number(e);return!!Number.isFinite(t)&&F.includes(4*t)}var U=new Set(["iframe","frame","object","embed"]),W=new Set(["href","xlinkHref","to","id","key","htmlFor"]),q=/(?<![&\w])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,_=/(?<![\w-])rounded(?:-(?:[trblse]|tl|tr|br|bl|ss|se|ee|es))?-\[([^\]]*)\]/g,G=/^border(?:(?:Top|Bottom)(?:Left|Right)|(?:Start|End)(?:Start|End))?Radius$/,K=/^(?:inherit|initial|unset|revert)$|var\(|^(?:50|100)%$|^(?:999|9999)(?:px)?$/,H=/(?<![\w-])-?(?:p|px|py|pt|pr|pb|pl|ps|pe|m|mx|my|mt|mr|mb|ml|ms|me|gap|gap-x|gap-y|space-x|space-y)-(\d+(?:\.\d+)?|px|\[[^\]]*\])(?![\w.[/-])/g,Q=/(?<![\w-])text-\[(?:length:)?(\d*\.?\d+(?:px|rem|em|%))\]/g,V=/(?<![\w-])z-(\d+|\[[^\]]*\])(?![\w.[/-])/g,X=/(?<![\w-])shadow-(xs|2xs|md|2xl|\[[^\]]*\])(?![\w.[/-])/g,Z=/var\(|^(?:inherit|initial|unset|revert|revert-layer|none|auto)$/,Y=/^(?:(?:padding|margin)(?:Top|Right|Bottom|Left|Inline|Block|InlineStart|InlineEnd|BlockStart|BlockEnd)?|gap|rowGap|columnGap)$/,ee=new Set([0,...F]),te=/(?<![\w-])dark:(?=[\w[\-!@*(])/g,ne="slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose",ie="(?:50|[1-9]00|950)",oe=new RegExp(`(?<![\\w-])(?:bg|text|border(?:-[xytrblse])?|ring(?:-offset)?|inset-ring|outline|divide|fill|stroke|from|via|to|shadow|inset-shadow|drop-shadow|accent|caret|decoration|placeholder)-(?:(?:${ne})-${ie}|white|black)(?:\\/[\\w.]+)?(?![\\w-])`,"g"),se=new RegExp(`--color-(?:(?:${ne})-${ie}|white|black)(?![\\w-])`,"g"),re=/(?<![\w-])(?:rgba?|hsla?|hwb|oklch|oklab|lab|lch)\(\s*[\d.]/g,ae=/(?<![\w-])(?:white|black|red|green|blue|yellow|orange|purple|pink|gray|grey|silver|maroon|navy|teal|olive|lime|aqua|fuchsia|brown|gold|beige|ivory|tan|crimson|coral|salmon|indigo|violet)(?![\w-])/gi,le=/^(?:color|background(?:Color)?|border(?:Top|Right|Bottom|Left|Inline|Block)?(?:Color)?|outline(?:Color)?|fill|stroke|caretColor|accentColor|textDecorationColor|boxShadow|textShadow)$/,ce=/(?<![&a-zA-Z0-9])(?<!url\()#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{3,4})(?![\w-])/g,de=e=>[...e.matchAll(ce)].length+[...e.matchAll(re)].length+[...e.matchAll(oe)].length+[...e.matchAll(se)].length,ue=new Set(["button","a","option","Button","IconButton","SplitButton","Link","NavLink","PopupMenuItem","PopupMenuLabel","DropdownMenuItem","MenuItem","ContextMenuItem"]),he=/(?:…|\.\.\.|…)\s*$/,pe=new RegExp("\\p{L}","u"),fe=new RegExp("\\p{L}[\\p{L}-]*","u"),ge={busy:{words:["Accepting","Adding","Applying","Approving","Arranging","Asking","Assigning","Booking","Building","Calculating","Cancelling","Capturing","Changing","Checking","Choosing","Closing","Combining","Comparing","Completing","Confirming","Connecting","Converting","Copying","Correcting","Counting","Creating","Deleting","Detaching","Downloading","Drawing","Duplicating","Emailing","Ending","Exporting","Fetching","Filing","Finding","Flushing","Generating","Grouping","Importing","Linking","Loading","Locating","Looking","Making","Marking","Matching","Measuring","Merging","Moving","Opening","Ordering","Paying","Pending","Posting","Preparing","Previewing","Pricing","Processing","Provisioning","Publishing","Purging","Pushing","Queued","Queuing","Quoting","Re-booking","Re-importing","Re-opening","Reading","Rebooting","Rebuilding","Receiving","Reconciling","Reconnecting","Recording","Refreshing","Refunding","Regenerating","Registering","Reinstating","Rejecting","Removing","Reopening","Requesting","Resending","Resetting","Resolving","Restarting","Restoring","Resuming","Retrying","Reversing","Reverting","Running","Saving","Searching","Sending","Setting","Settling","Sharing","Signing","Splitting","Starting","Submitting","Suggesting","Switching","Syncing","Taking","Testing","Transferring","Typing","Updating","Uploading","Verifying","Waiting","Withdrawing","Working"],zhStarts:["正在"],zhEnds:["中"]},placeholder:{},prompt:{}},me=new Set((ge.busy?.words??[]).map(e=>e.toLowerCase())),we=new Set(["label","aria-label",...ge.placeholder?[]:["placeholder","searchPlaceholder","emptyOptionLabel","blankLabel"]]),ke=(e,t)=>{if(!he.test(t)||!pe.test(e))return!1;const n=e.match(fe)?.[0]?.toLowerCase();if(n&&me.has(n))return!1;const i=e.replace(he,"").trim(),o=ge.busy;return!(o&&(o.zhStarts.some(e=>i.startsWith(e))||o.zhEnds.some(e=>i.endsWith(e))))},xe=new Set(["confirm","alert","prompt"]),be=new Set(["window","globalThis","self"]);var $e=e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"),ye=e=>/\.(?:css|scss)$/.test(e),ve=/^(?:color|background(?:-color)?|border(?:-(?:top|right|bottom|left|inline|block)(?:-(?:start|end))?)?(?:-color)?|outline(?:-color)?|fill|stroke|caret-color|accent-color|text-decoration(?:-color)?|box-shadow|text-shadow|column-rule(?:-color)?)$/;function Se(e,t){if(!t.includes("colour"))return{};const n=e.replace(/\/\*[\s\S]*?\*\//g,e=>e.replace(/[^\n]/g," ")),i=[],o=e=>n.slice(0,e).split("\n").length;let s=0,r=0;for(let e=0;e<n.length;e++){const t=n[e];if("{"===t||"}"===t||";"===t){const a=n.slice(r,e);if("{"!==t&&s>0){const e=r+(a.length-a.trimStart().length),t=a.trim(),n=t.indexOf(":");if(t.startsWith("@apply"))for(let n=[...t.matchAll(oe)].length;n>0;n--)i.push(o(e));else if(n>0){const s=t.slice(0,n).trim().toLowerCase(),r=t.slice(n+1);if(!/^(?:-webkit-)?mask/.test(s)){const t=de(r)+(ve.test(s)?[...r.matchAll(ae)].length:0);for(let n=0;n<t;n++)i.push(o(e))}}}"{"===t?s++:"}"===t&&(s=Math.max(0,s-1)),r=e+1}}return i.length?{colour:i}:{}}function je(e,t,n,i,o){const s=new Set(i),r=e.createSourceFile(t,n,e.ScriptTarget.Latest,!0,function(e,t){return t.endsWith(".tsx")?e.ScriptKind.TSX:t.endsWith(".jsx")?e.ScriptKind.JSX:/\.[cm]?js$/.test(t)?e.ScriptKind.JS:e.ScriptKind.TS}(e,t)),a={},l=/\.[jt]sx$/.test(t),c=e=>r.getLineAndCharacterOfPosition(e).line+1,d=(e,t)=>{s.has(e)&&(a[e]??=[]).push(c(t.getStart(r)))},u=(t,n)=>t.attributes.properties.find(t=>e.isJsxAttribute(t)&&t.name.getText(r)===n),h=t=>{const n=t?.initializer;if(n)return e.isStringLiteral(n)?n.text:e.isJsxExpression(n)&&n.expression&&e.isStringLiteralLike(n.expression)?n.expression.text:void 0},p=new Set;if(s.has("native")){const t=n=>{if(n)if(e.isIdentifier(n))xe.has(n.text)&&p.add(n.text);else if(e.isObjectBindingPattern(n)||e.isArrayBindingPattern(n))for(const i of n.elements)e.isBindingElement(i)&&t(i.name)},n=i=>{(e.isImportClause(i)||e.isImportSpecifier(i)||e.isNamespaceImport(i)||e.isVariableDeclaration(i)||e.isParameter(i)||e.isFunctionDeclaration(i))&&t(i.name),e.forEachChild(i,n)};n(r)}const f=t=>t&&e.isStringLiteralLike(t)?t.text:void 0,g=(e,t)=>{e&&("efficient-shell"===e||e.startsWith("efficient-shell/"))&&o?.add(e);const n=e?k(e):null;n&&d(n,t)},m=(e,t,n)=>{if(s.has("dark"))for(const n of e.matchAll(te))d("dark",t);if(s.has("radius"))for(const n of e.matchAll(_))K.test(n[1].trim())||d("radius",t);if(n&&l&&s.has("hex"))for(const n of e.matchAll(q))d("hex",t);if(n&&s.has("colour"))for(let n=de(e);n>0;n--)d("colour",t);if(s.has("spacing"))for(const n of e.matchAll(H)){const e=n[1];(e.startsWith("[")?Z.test(e.slice(1,-1).trim()):J(e))||d("spacing",t)}if(s.has("font-size"))for(const n of e.matchAll(Q))d("font-size",t);if(s.has("z-index"))for(const n of e.matchAll(V)){const e=n[1].startsWith("[")?n[1].slice(1,-1).trim():n[1];/^\d+$/.test(e)&&Number(e)>30&&d("z-index",t)}if(s.has("shadow"))for(const n of e.matchAll(X))n[1].startsWith("[")&&Z.test(n[1].slice(1,-1).trim())||d("shadow",t)},w=(t,n,i)=>{const o=e.isStringLiteralLike(n)?n.text.trim():void 0;if(s.has("colour")&&void 0!==o&&le.test(t))for(const e of o.matchAll(ae))d("colour",i);if(s.has("spacing")&&Y.test(t))e.isNumericLiteral(n)?ee.has(Number(n.text))||d("spacing",i):void 0!==o&&!Z.test(o)&&(e=>[...e.matchAll(/(-?\d*\.?\d+)(px|rem|em)\b/g)].map(e=>Math.abs(Number(e[1]))*("px"===e[2]?1:16)))(o).some(e=>!ee.has(e))&&d("spacing",i);else if(s.has("font-size")&&"fontSize"===t)(e.isNumericLiteral(n)||void 0!==o&&!Z.test(o)&&!/^(?:smaller|larger)$/.test(o))&&d("font-size",i);else if(s.has("z-index")&&"zIndex"===t){const t=[],o=n=>{e.isNumericLiteral(n)||e.isStringLiteralLike(n)&&/^\d+$/.test(n.text.trim())?t.push(Number(n.text)):e.forEachChild(n,o)};o(n);for(const e of t)e>30&&d("z-index",i)}else s.has("shadow")&&"boxShadow"===t&&(void 0===o||""===o||Z.test(o)||d("shadow",i))},x=(t,n)=>{if(e.isJsxOpeningElement(t)||e.isJsxSelfClosingElement(t)){const e=t.tagName.getText(r);if(/^[a-z]/.test(e)){const n=h(u(t,"type"));"svg"===e&&d("svg",t),"button"===e?d("button",t):"select"===e?d("select",t):"textarea"===e?d("textarea",t):"input"===e&&("range"===n?d("range",t):"hidden"!==n&&d("input",t));const i=h(u(t,"role"));"dialog"!==e&&"dialog"!==i&&"alertdialog"!==i||d("dialog",t),!U.has(e)&&u(t,"title")&&d("title",t)}}else if(e.isCallExpression(t)){const n=t.expression;e.isIdentifier(n)?"createPortal"===n.text?d("portal",t):xe.has(n.text)&&!p.has(n.text)?d("native",t):"require"===n.text&&g(f(t.arguments[0]),t):e.isPropertyAccessExpression(n)?"createPortal"===n.name.text?d("portal",t):xe.has(n.name.text)&&e.isIdentifier(n.expression)&&be.has(n.expression.text)&&d("native",t):n.kind===e.SyntaxKind.ImportKeyword&&g(f(t.arguments[0]),t)}else{if(e.isImportDeclaration(t)||e.isExportDeclaration(t))return void g(f(t.moduleSpecifier),t);if(e.isPropertyAssignment(t)){const n=e.isIdentifier(t.name)||e.isStringLiteralLike(t.name)?t.name.text:"",i=t.initializer;w(n,i,t),s.has("radius")&&G.test(n)&&(e.isNumericLiteral(i)?K.test(i.text)||d("radius",t):e.isStringLiteralLike(i)&&!K.test(i.text.trim())&&d("radius",t))}else if(e.isStringLiteralLike(t))m(t.text,t,n);else if(e.isTemplateExpression(t)){m(t.head.text,t.head,n);for(const e of t.templateSpans)m(e.literal.text,e.literal,n)}}e.isJsxAttribute(t)&&W.has(t.name.getText(r))?e.forEachChild(t,e=>x(e,!1)):e.forEachChild(t,e=>x(e,n))};return x(r,!0),s.has("ellipsis-label")&&function(e,t,n){const i=new Set,o=(e,t)=>{i.has(e)||(i.add(e),n(t))},s=n=>{if(n)if(e.isStringLiteralLike(n))ke(n.text,n.text)&&o(n,n.getStart(t));else if(e.isTemplateExpression(n)){const e=[n.head.text,...n.templateSpans.map(e=>e.literal.text)];ke(e.join(" "),e[e.length-1])&&o(n,n.getStart(t))}else e.isConditionalExpression(n)?(s(n.whenTrue),s(n.whenFalse)):e.isBinaryExpression(n)?(s(n.left),s(n.right)):e.isParenthesizedExpression(n)||e.isAsExpression(n)||e.isJsxExpression(n)?s(n.expression):e.isCallExpression(n)&&Ie.has(Le(n.expression))&&n.arguments[0]&&s(n.arguments[0])},r=n=>{for(const i of n)if(e.isJsxText(i)){const e=i.getText(t);ke(e,e)&&o(i,i.getStart(t)+(e.length-e.trimStart().length))}else e.isJsxExpression(i)?s(i.expression):(e.isJsxElement(i)||e.isJsxFragment(i))&&r(i.children)},a=(n,i)=>{const o=n.attributes.properties.find(n=>e.isJsxAttribute(n)&&n.name.getText(t)===i),s=o?.initializer;return s&&e.isStringLiteral(s)?s.text:s&&e.isJsxExpression(s)&&s.expression&&e.isStringLiteralLike(s.expression)?s.expression.text:void 0},l=t=>t.properties.some(t=>e.isPropertyAssignment(t)&&(e.isIdentifier(t.name)||e.isStringLiteralLike(t.name))&&"value"===t.name.text&&e.isStringLiteralLike(t.initializer)&&""===t.initializer.text),c=n=>{if(e.isJsxElement(n)){const e=n.openingElement,i=e.tagName.getText(t),o="option"===i&&ge.prompt&&""===a(e,"value");ue.has(i)&&!o&&r(n.children)}else if(e.isJsxAttribute(n))we.has(n.name.getText(t))&&s(n.initializer);else if(e.isPropertyAssignment(n)){const t=e.isIdentifier(n.name)||e.isStringLiteralLike(n.name)?n.name.text:"",i=ge.prompt&&e.isObjectLiteralExpression(n.parent)&&l(n.parent);we.has(t)&&!i&&s(n.initializer)}e.forEachChild(n,c)};c(t)}(e,r,e=>(a["ellipsis-label"]??=[]).push(c(e))),a}var Ie=new Set(["say","t"]),Le=e=>{const t=e.getText();return t.slice(t.lastIndexOf(".")+1)};function Re(e){const t={};for(const[n,i]of Object.entries(e))i.length&&(t[n]=i.length);return t}function Ae(e,t,n){const i=e.createSourceFile(t,n,e.ScriptTarget.Latest,!1),o=[];for(const t of i.statements)(e.isImportDeclaration(t)||e.isExportDeclaration(t))&&t.moduleSpecifier&&e.isStringLiteralLike(t.moduleSpecifier)&&o.push(t.moduleSpecifier.text);return o}var ze=(e,t)=>e.some(e=>t.some(t=>t.endsWith("/*")?e.startsWith(t.slice(0,-1)):e===t));var Ee=e=>new Map(e.allow.map(e=>[A(e.file,e.kind),e.count]));function Ce(e,t){return e.kinds.filter(e=>t.kinds.includes(e))}var Te=(e,t,n)=>{if("kit-dep"===n)return` (${e.kitDeps.join(", ")})`;if("chart-dep"===n)return` (${e.chartDeps.join(", ")})`;const i=e.hits.get(t)?.[n]??[];if(0===i.length)return"";const o=i.slice(0,12).join(", ");return` (line${1===i.length?"":"s"} ${o}${i.length>12?", …":""})`};function Me(e,t,n){const i=Ee(e),o=new Map;for(const[e,s]of t.counts){const{kind:t}=z(e);if(!l(t)||!n.includes(t))continue;const r=s-(i.get(e)??0);r>0&&o.set(e,r)}return{kinds:a.filter(e=>n.includes(e)),counts:o}}function Be(e,t){let n=0;for(const i of new Set([...e.keys(),...t.keys()]))(e.get(i)??0)!==(t.get(i)??0)&&(n+=1);return n}var Pe="\n// <button> in a comment is not a button, and <svg> in one is not a drawing\n/* nor is <input title=\"x\"> in this one, or dark:bg-black, or #fff */\nimport { createPortal } from 'react-dom';\nimport { Dialog } from '@headlessui/react';\nimport { TrashIcon } from '@heroicons/react/24/outline';\nimport type { Icon } from 'lucide-react';\nimport { Button, confirm } from 'efficient-shell';\nexport { Slot } from '@radix-ui/react-slot';\nexport { CheckIcon } from '@radix-ui/react-icons';\nimport { LineChart } from 'recharts';\nimport 'd3-scale';\nexport { VictoryPie } from 'victory';\nimport { BarChart } from '@mui/x-charts';\nimport Tree from 'react-d3-tree';\nimport { TimeSeriesChart } from 'efficient-shell/ui';\n// import 'chart.js' in a comment is not an import, and 'echarts' in a string is not one either\nconst chartLabel = 'd3-array';\n\nconst a = <button title=\"Says what it does\">x</button>;\nconst b = <input type=\"range\" />;\nconst c = <input type=\"text\" />;\nconst c2 = <input type={\"hidden\"} name=\"csrf\" />;\nconst c3 = <input type=\"hidden\" />;\nconst c4 = <input type={kind} />;\nconst d = <select />;\nconst d2 = <textarea />;\nconst e = <div role=\"dialog\" />;\nconst e2 = <dialog open />;\nconst e3 = <section role={'alertdialog'} />;\nconst f = <iframe title=\"Preview\" />;\nconst f2 = <object title=\"Chart\" />;\nconst g = <Button title=\"a prop, not a tooltip\" role=\"dialog\" />;\nconst g2 = (\n <button\n type=\"button\"\n title={hint}\n >\n y\n </button>\n);\nconst h = ReactDOM.createPortal(a, document.body);\nconst i = createPortal(a, document.body);\n\nasync function leave() {\n if (window.confirm('Sure?')) return;\n globalThis.alert('No');\n alert('native: nothing binds the name');\n prompt('native too');\n await confirm('the shell: the import binds it');\n record.confirm('a method, not the popup');\n}\n\nconst j = <div className=\"bg-white dark:bg-black dark:hover:text-white is-dark:no\" />;\nconst k = clsx('text-gray-900', on && 'dark:text-gray-100');\nconst l = <span style={{ color: '#fff', background: \"#12ab34\" }} className={`border-[#0a0b0c80] ${x}`} />;\nconst m = <a href=\"#faded\" id=\"#bad\" key=\"#abc\" to=\"#face\">skip</a>;\nconst n = <label htmlFor={'#dead'}>skip</label>;\nconst o = <span>Ӓ and BG#00340 and #12345 and #added are not colours</span>;\nconst p = 'entity  ref BG#00340';\nconst q = <use xlinkHref=\"#abc\" fill=\"url(#fed)\" />;\nconst t = <div className=\"rounded-[4px] rounded-t-[0.5rem] hover:rounded-[2px] rounded-lg rounded-(--radius-card) rounded-[inherit] rounded-[var(--r)]\" />;\nconst u = <div style={{ borderRadius: 6, borderTopLeftRadius: '3px', borderBottomRightRadius: '50%', borderEndEndRadius: 'var(--radius-card)' }} />;\nconst v = <i style={{ borderRadius: 9999 }} />;\nconst w = <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 4h16\" /></svg>;\nconst w2 = <Svg viewBox=\"0 0 24 24\" />;\nconst w3 = '<svg viewBox=\"0 0 1 1\"></svg> in a string is not an element';\nconst r = lazy(() => import('@mui/material'));\nconst s = require('react-select');\nconst s2 = require('chart.js/auto');\nconst s3 = import('@nivo/line');\n",Oe={button:2,input:2,range:1,textarea:1,select:1,dialog:3,title:2,portal:2,native:4,dark:3,hex:3,radius:5,kit:5,icon:3,svg:1,chart:5,colour:8},De={kit:1,dark:1,portal:1,radius:2,chart:1,colour:2},Ne=(...e)=>e.join("-"),Fe=`\nconst s1 = <i className="${[Ne("px","2.5"),Ne("py","1.5"),"md:"+Ne("gap","1.5"),"-"+Ne("mt","1.5"),Ne("p","[10px]")].join(" ")}" />;\nconst s2 = <i className="${[Ne("p","0"),Ne("px","px"),Ne("p","0.5"),Ne("p","3"),Ne("gap-x","4"),Ne("p","12"),Ne("p","(--space-12)"),Ne("p","[var(--space-12)]"),Ne("space-x","reverse"),Ne("top","1.5")].join(" ")}" />;\nconst s3 = <i style={{ padding: 6, marginTop: '10px', gap: 8, margin: '0 auto', paddingInline: 'var(--space-12)' }} />;\nconst f1 = <i className="${[Ne("text","[11px]"),Ne("text","[0.8rem]"),Ne("text","xs"),Ne("text","[#fff]"),Ne("text","(--text-2xs)")].join(" ")}" />;\nconst f2 = <i style={{ fontSize: 12 }} />;\nconst f3 = { fontSize: 'var(--x)', font: 'inherit' };\nconst z1 = <i className="${[Ne("z","[9999]"),Ne("z","50"),Ne("z","10"),Ne("z","30"),"-"+Ne("z","10"),Ne("z","auto"),Ne("z","(--z-popup)"),Ne("z","[var(--z-popup)]")].join(" ")}" />;\nconst z2 = { zIndex: on ? 2020 : 2010 };\nconst z3 = { zIndex: Z_LAYERS.popup, top: 9999 };\nconst h1 = <i className="${[Ne("shadow","[0_1px_2px_#000]"),Ne("shadow","md"),"shadow",Ne("shadow","lg"),Ne("shadow","(--elevation-panel)"),Ne("shadow","black/20"),Ne("drop-shadow","md")].join(" ")}" />;\nconst h2 = { boxShadow: '0 1px 2px rgba(0,0,0,.1)' };\nconst h3 = { boxShadow: 'none', outline: 'var(--elevation-raised)' };\n`,Je={spacing:7,"font-size":3,"z-index":4,shadow:3,hex:1,colour:4},Ue={colour:4},We={"ellipsis-label":9},qe=e=>a.filter(t=>e[t]).map(t=>`${t} ${e[t]}`).join(", ")||"nothing";var _e="ui-kit.config.json",Ge="ui-kit.baseline.json",Ke="efficient-shell-ui-check",He=`${Ke}: every surface a person operates takes its UI from efficient-shell (harness UI-24).\n\n ${Ke} check this repository against ${Ge}\n ${Ke} --print print today's counts as a baseline, and change nothing\n ${Ke} --summary print totals per kind and per folder, as Markdown\n ${Ke} --json print the result as JSON\n ${Ke} --update lower the lines whose counts fell, and delete the ones at zero\n ${Ke} --update --allow-move also follow a renamed or split file (no total may rise)\n ${Ke} --init write the first ${Ge}\n ${Ke} --init --kind <kind> take the baseline for a kind just added to "kinds"\n ${Ke} --no-base do not compare with the pull request's base branch\n\nKinds: ${a.join(", ")}\nReads ${_e} in the current directory.`;var Qe=(e,t)=>`${e} ${t}${1===e?"":"s"}`,Ve=(e,t)=>{const n=B(e);return t.map(e=>`${e} ${n[e]??0}`).join(" · ")};process.exitCode=function(e,t){const r=function(e){const t={print:!1,summary:!1,json:!1,update:!1,allowMove:!1,init:!1,noBase:!1,help:!1,version:!1,kinds:[]};for(let n=0;n<e.length;n++){const i=e[n];if("--print"===i)t.print=!0;else if("--summary"===i)t.summary=!0;else if("--json"===i)t.json=!0;else if("--update"===i)t.update=!0;else if("--allow-move"===i)t.allowMove=!0;else if("--init"===i)t.init=!0;else if("--no-base"===i)t.noBase=!0;else if("--help"===i||"-h"===i)t.help=!0;else if("--version"===i||"-v"===i)t.version=!0;else if("--kind"===i){const i=e[++n];if(!i)return"--kind needs a kind after it";t.kinds.push(...i.split(","))}else{if(!i.startsWith("--kind="))return`unknown argument "${i}"`;t.kinds.push(...i.slice(7).split(","))}}return t.allowMove&&!t.update?"--allow-move goes with --update":t.kinds.length&&!t.init?"--kind goes with --init":[t.print,t.summary,t.update,t.init].filter(Boolean).length>1?"choose one of --print, --summary, --update and --init":t}(e);if("string"==typeof r)return t.err(`${Ke}: ${r}\n\n${He}`),2;if(r.help)return t.out(He),0;if(r.version)return t.out(t.version),0;const c=e=>(r.json?t.out(JSON.stringify({tool:Ke,version:t.version,ok:!1,failures:[e]},null,2)):t.err(`${Ke}: ${e}`),1),p=n(t.cwd,_e);if(!i(p))return c(`no ${_e} in ${t.cwd}. Run it from the repository root; the harness has the template.`);let f,g;try{f=function(e,t="ui-kit.config.json"){const n=[],i=e=>{n.push(e)},o=(e,t,{required:n=!1}={})=>{if(void 0===e&&!n)return[];if(!Array.isArray(e)||e.some(e=>"string"!=typeof e||""===e))return i(`${t} must be a list of non-empty strings`),[];n&&0===e.length&&i(`${t} must name at least one entry`);for(const n of e)(n.startsWith("/")||n.startsWith("./")||n.includes("\\")||n.split("/").includes(".."))&&i(`${t}: "${n}" must be a path from the repository root, written with / (no ./, .. or \\)`);return e},s=(e,t)=>"string"!=typeof e||e.trim().length<10?(i(`${t} needs a "reason" a reviewer can read (a sentence, not a word)`),""):e,r=(e,t)=>void 0===e?[]:!Array.isArray(e)||e.some(e=>!O(e))?(i(`${t} must be a list of objects`),[]):e;if(!O(e))throw new P(`${t}: must be a JSON object`);for(const t of Object.keys(e))D.has(t)||i(`unknown key "${t}"`);1!==e.schema&&i("number"==typeof e.schema&&e.schema>1?`"schema": ${e.schema} is newer than this efficient-shell reads (1); upgrade efficient-shell`:'"schema" must be 1');const c=[];if(Array.isArray(e.kinds)&&0!==e.kinds.length)for(const t of e.kinds)l(t)?c.includes(t)?i(`"kinds": "${t}" is listed twice`):c.push(t):i(`"kinds": unknown kind ${JSON.stringify(t)} (this efficient-shell knows: ${a.join(", ")})`);else i(`"kinds" must list the kinds this repository checks, from: ${a.join(", ")}`);const d=o(e.include,'"include"'),u=o(e.exclude,'"exclude"'),h=r(e.includeImporting,'"includeImporting"').map((e,t)=>({files:o(e.files,`"includeImporting"[${t}].files`,{required:!0}),modules:o(e.modules,`"includeImporting"[${t}].modules`,{required:!0}),reason:s(e.reason,`"includeImporting"[${t}]`)}));0===d.length&&0===h.length&&i('"include" must name the files that are operator UI (for example ["src/**/*.tsx"])');const p=r(e.output,'"output"').map((e,t)=>({files:o(e.files,`"output"[${t}].files`,{required:!0}),reason:s(e.reason,`"output"[${t}]`)})),f=[],g=new Set;if(r(e.allow,'"allow"').forEach((e,t)=>{const n=`"allow"[${t}]`,[r]=o([e.file],`${n}.file`),d=s(e.reason,n);if(!l(e.kind))return void i(`${n}.kind must be one of: ${a.join(", ")}`);if(c.includes(e.kind)||i(`${n}: kind "${e.kind}" is not in "kinds"`),"number"!=typeof e.count||!Number.isInteger(e.count)||e.count<1)return void i(`${n}.count must be a whole number, 1 or more`);if(!r)return;const u=`${r}:${e.kind}`;g.has(u)&&i(`${n}: ${r} already has an allow entry for "${e.kind}"`),g.add(u),f.push({file:r,kind:e.kind,count:e.count,reason:d})}),n.length)throw new P(`${t}:\n - ${n.join("\n - ")}`);return{schema:1,kinds:a.filter(e=>c.includes(e)),include:d,exclude:u,includeImporting:h,output:p,allow:f}}(JSON.parse(o(p,"utf8")),_e)}catch(e){return c(e instanceof P?e.message:`${_e} is not valid JSON: ${e.message}`)}try{g=t.loadTypeScript()}catch{return c('this check reads the TypeScript AST and found no "typescript" package here. Install it as a devDependency.')}const w=function(e){const t=[],n=u,i=[["fixture.tsx",Pe,Oe],["fixture.ts","\nimport { toast } from 'sonner';\nimport { extent } from 'd3-array';\nexport const tone = { warn: '#f59e0b' };\nexport const cls = 'ring-1 dark:ring-white rounded-[3px]';\nexport const box = { borderRadius: '0.25rem', radius: 4 };\nexport function ask(confirm: (message: string) => boolean) {\n return confirm('a parameter binds the name');\n}\nexport const mount = (node: unknown) => ReactDOM.createPortal(node, document.body);\n",De],["tokens.tsx",Fe,Je],["labels.tsx","\n// <Button>Save…</Button> in a comment is not a label\nconst l1 = <Button>Extend trial…</Button>;\nconst l2 = <PopupMenuItem onClick={go}><span>Read from a PDF...</span></PopupMenuItem>;\nconst l3 = <Button>{busy ? 'Saving…' : 'Duplicate site…'}</Button>;\nconst l4 = <Item label=\"Translate…\" aria-label={'More…'} />;\nconst l5 = [{ label: 'Reject…' }, { value: CUSTOM, label: 'Custom…' }];\nconst l6 = <option value={CUSTOM}>Different address…</option>;\nconst l7 = <PopupMenuLabel>{say(\"Duplicate to page…\")}</PopupMenuLabel>;\nconst n7 = <Button>{t('team:menu.remove')}</Button>;\nconst n1 = <Button>{`${name.slice(0, 9)}…`}</Button>;\nconst n2 = <p>Loading weather…</p>;\nconst n3 = <Input placeholder=\"Search…\" />;\nconst n4 = <option value=\"\">Pick a carrier…</option>;\nconst n5 = [{ value: '', label: 'Select…' }];\nconst n6 = <Button>Extend trial</Button>;\n",We]];for(const[o,s,r]of i){const i=Re(je(e,o,s,n));n.some(e=>(i[e]??0)!==(r[e]??0))&&t.push(`${o}: read ${qe(i)}; it holds ${qe(r)}`)}const o=Re(Se('\n/* #fff in a comment */\n.a:hover { color: #111; border: 1px solid white; }\n[data-x="#fff"] { mask-image: linear-gradient(#000, transparent); color: var(--ink); }\n.b { --mine: rgb(0 0 0 / .5); background: var(--surface, #fff); }\n',n));n.some(e=>(o[e]??0)!==(Ue[e]??0))&&t.push(`style.css: read ${qe(o)}; it holds ${qe(Ue)}`);const s=Re(je(e,"fixture.tsx",Pe,["button"]));return"button"!==Object.keys(s).join()&&t.push(`asked for button alone, the reader reported ${qe(s)}`),t}(g);if(w.length)return c(`the reader misread its own fixtures with typescript ${g.version}, so nothing it says about this repository can be trusted:\n - `+w.join("\n - "));const k=function(e,t,s){const r=[],a=y(s.exclude),l=y(s.output.flatMap(e=>e.files)),c=new Map,u=e=>{let i=c.get(e);return void 0===i&&c.set(e,i=o(n(t,e),"utf8")),i},h=(e,n)=>{for(const i of e)0===I(t,[i]).length&&r.push(`${n}: "${i}" matches no file. Delete the line, or fix the path.`)};h(s.include,'"include"'),s.output.forEach((e,t)=>h(e.files,`"output"[${t}]`)),s.includeImporting.forEach((e,t)=>h(e.files,`"includeImporting"[${t}]`));const p=new Set,f=s.kinds.includes("colour"),g=e=>($e(e)||f&&ye(e))&&!a(e)&&!l(e);for(const e of I(t,s.include))g(e)&&p.add(e);for(const n of s.includeImporting)for(const i of I(t,n.files))g(i)&&$e(i)&&!p.has(i)&&ze(Ae(e,i,u(i)),n.modules)&&p.add(i);const w=[...p].sort(),k=s.kinds.filter(e=>!d(e)),b=new Map,$=new Map,v=new Set;for(const t of w){const n=ye(t)?Se(u(t),k):je(e,t,u(t),k,v);let i=!1;for(const e of k){const o=n[e]?.length??0;o&&($.set(A(t,e),o),i=!0)}i&&b.set(t,n)}let S=[],j=[],L=[];const R=s.kinds.filter(d);if(R.length){const e=n(t,N);if(i(e)){const t=JSON.parse(o(e,"utf8")),n=["dependencies","peerDependencies","optionalDependencies"].flatMap(e=>Object.keys(t[e]??{})),i=new Set([...v].flatMap(e=>m[e]??[])),r=[...new Set(n)].sort();if(s.kinds.includes("kit-dep")){const e=r.filter(e=>"kit-dep"===x(e));S=e.filter(e=>!i.has(e)),j=e.filter(e=>i.has(e)),S.length&&$.set(A(N,"kit-dep"),S.length)}s.kinds.includes("chart-dep")&&(L=r.filter(e=>"chart-dep"===x(e)),L.length&&$.set(A(N,"chart-dep"),L.length))}else for(const e of R)r.push(`"kinds" includes "${e}", and there is no ${N} here to read.`)}for(const e of s.allow)(d(e.kind)?e.file===N:p.has(e.file))||r.push(`"allow": ${e.file} (${e.kind}) is not a file this check reads. Delete the entry, or fix the path.`);return{files:w,hits:b,counts:$,kitDeps:S,shellPeers:j,chartDeps:L,problems:r}}(g,t.cwd,f);if(0===k.files.length)return c(`read no files. "include" in ${_e} matches nothing, so a pass would mean nothing.`);const b=n(t.cwd,Ge),$=r.json,v=e=>{$||t.out(e)};if(r.print)return t.out(M(Me(f,k,f.kinds)).trimEnd()),0;if(r.summary){for(const e of function(e,t){const n=new Map,i=new Map;for(const[e,o]of t.counts){const{file:t,kind:s}=z(e);if(!l(s))continue;const r=n.get(s)??{count:0,files:new Set};r.count+=o,r.files.add(t),n.set(s,r);const a=t.split("/"),c=a.length>2?a.slice(0,2).join("/"):2===a.length?a[0]:".",d=i.get(c)??{};d[s]=(d[s]??0)+o,i.set(c,d)}const o=e.kinds.filter(e=>n.has(e)),s=[`**UI kit check (harness UI-24):** ${new Set([...t.counts.keys()].map(e=>z(e).file)).size} of ${Qe(t.files.length,"file")} still draw UI of their own.`,"","| Kind | Count | Files | The shell has |","|---|---:|---:|---|",...e.kinds.map(e=>{const t=n.get(e);return`| \`${e}\` | ${t?.count??0} | ${t?.files.size??0} | ${h[e].instead} |`})];if(o.length&&i.size){const e=e=>o.reduce((t,n)=>t+(e[n]??0),0),t=[...i].sort((t,n)=>e(n[1])-e(t[1])||(t[0]<n[0]?-1:1));s.push("",`| Folder | ${o.map(e=>`\`${e}\``).join(" | ")} | Total |`,`|---|${o.map(()=>"---:").join("|")}|---:|`,...t.map(([t,n])=>`| \`${t}\` | ${o.map(e=>n[e]??0).join(" | ")} | ${e(n)} |`))}return s}(f,k))t.out(e);return 0}let S=null;if(i(b))try{S=T(o(b,"utf8"),Ge)}catch(e){return c(e instanceof R?e.message:String(e))}if(r.init){const e=r.kinds.filter(e=>!l(e)||!f.kinds.includes(e));if(e.length)return c(`--kind ${e.join(", ")}: not in "kinds" in ${_e}. Add it there first.`);const t=r.kinds;if(S){if(0===t.length)return c(`${Ge} already exists, and --init would overwrite what it holds. It is for the adoption pull request only. To start checking a kind, add it to "kinds" and run --init --kind <kind>.`);const e=t.filter(e=>S.kinds.includes(e));if(e.length)return c(`the baseline was already taken for ${e.join(", ")}. Its lines only go down; use --update.`);const n=Me(f,k,t);S={kinds:[...S.kinds,...t],counts:new Map([...S.counts,...n.counts])}}else{if(t.length)return c(`there is no ${Ge} yet. Run --init on its own first.`);S=Me(f,k,f.kinds)}s(b,M(S)),v(`${Ke}: wrote ${Ge} (${Qe(S.counts.size,"line")}: ${Ve(S.counts,S.kinds)})`)}if(!S)return c(`no ${Ge}. This repository has not adopted the check yet: run ${Ke} --init, and commit the file.`);if(r.update){const e=function(e,t,n,{allowMove:i=!1}={}){const o=Ce(e,t),s=Me(e,n,o),r=new Map([...t.counts].filter(([e])=>o.includes(z(e).kind)));if(i){const e=B(r),n=B(s.counts),i=o.filter(t=>(n[t]??0)>(e[t]??0)).map(t=>`${t}: ${n[t]??0} across the repository, and the baseline holds ${e[t]??0}`);return i.length?{baseline:t,lowered:0,refused:i}:{baseline:s,lowered:Be(r,s.counts),refused:[]}}const a=new Map;for(const[e,t]of r){const n=Math.min(t,s.counts.get(e)??0);n>0&&a.set(e,n)}return{baseline:{kinds:o,counts:a},lowered:Be(r,a),refused:[]}}(f,S,k,{allowMove:r.allowMove});if(e.refused.length)return c(`--allow-move follows code that moved, and this is more of it than before:\n - ${e.refused.join("\n - ")}\nNothing was written.`);S=e.baseline,s(b,M(S)),v(`${Ke}: ${e.lowered?`changed ${Qe(e.lowered,"line")} in`:"nothing to change in"} ${Ge}`)}const j=function(e,t,n){const i=[],o=[],s=[...n.problems],r=Ee(e),a=new Set(Ce(e,t)),c=e.kinds.filter(e=>!t.kinds.includes(e));c.length&&s.push(`"kinds" names ${c.map(e=>`"${e}"`).join(", ")}, and the baseline was never taken for ${1===c.length?"it":"them"}. Run: efficient-shell-ui-check --init ${c.map(e=>`--kind ${e}`).join(" ")}`);const d=t.kinds.filter(t=>!e.kinds.includes(t));d.length&&o.push(`the baseline still carries ${d.map(e=>`"${e}"`).join(", ")}, which "kinds" no longer names`);const u=new Set([...n.counts.keys(),...t.counts.keys(),...r.keys()]);for(const e of[...u].sort(C)){const{file:c,kind:d}=z(e);if(!l(d)||!a.has(d))continue;const u=n.counts.get(e)??0,p=r.get(e)??0,f=t.counts.get(e)??0;u>p+f?i.push(`${c}: ${d} ${u}, and its line allows ${p+f}${Te(n,c,d)}. ${h[d].counts} is counted; use ${h[d].instead}.`):u<p?s.push(`${c}: ${d} ${u}, and "allow" in ui-kit.config.json says ${p}. ${0===u?"Delete the entry":`Lower its count to ${u}`}: an exception does not outlive what it excused.`):u<p+f&&o.push(`${c}: ${d} ${u}, and its line says ${p+f}`)}return{grown:i,shrunk:o,other:s,updateFixes:0===i.length&&0===s.length&&o.length>0}}(f,S,k),L=r.noBase?{problems:[],note:""}:function(e,t,n){const i=e.env.GITHUB_BASE_REF;if(!i)return{problems:[],note:""};const o=e.git(["rev-parse","--show-prefix"]);if(null===o)return{problems:[],note:"not a git checkout; the base branch was not compared"};const s=`origin/${i}`;if(null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])&&(e.git(["fetch","--no-tags","--depth=1","origin",`+refs/heads/${i}:refs/remotes/origin/${i}`]),null===e.git(["rev-parse","--verify","--quiet",`${s}^{commit}`])))return{problems:[],note:`${s} could not be fetched; the base branch was not compared`};const r=e.git(["show",`${s}:${o.trim()}${Ge}`]);if(null===r)return{problems:[],note:`${s} has no ${Ge} yet (adoption)`};let a;try{a=T(r,`${s}:${Ge}`)}catch{return{problems:[],note:`${s}'s ${Ge} could not be read; the base branch was not compared`}}const l=B(a.counts),c=B(t.counts);return{problems:n.filter(e=>a.kinds.includes(e)&&(c[e]??0)>(l[e]??0)).map(e=>`${Ge} holds ${c[e]??0} of "${e}", and ${s} holds ${l[e]??0}. The baseline only goes down: use ${h[e].instead}. A count that is meant to stay goes in "allow" in ${_e}, with its reason.`),note:`compared with ${s}`}}(t,S,f.kinds),E=f.kinds.filter(e=>S.kinds.includes(e)),F=`${Ke} --update`,J=[...j.other,...j.grown,...j.shrunk.map(e=>`${e}. Run: ${F}`),...L.problems],U=0===J.length;if(r.json){const e=new Map(f.allow.map(e=>[`${e.file}:${e.kind}`,e.count]));return t.out(JSON.stringify({tool:Ke,version:t.version,ok:U,schema:f.schema,kinds:f.kinds,files:k.files.length,counts:B(k.counts),baseline:B(S.counts),allowed:B(e),kitDeps:k.kitDeps,shellPeers:k.shellPeers,chartDeps:k.chartDeps,failures:J},null,2)),U?0:1}t.out(`UI kit check (harness UI-24), efficient-shell ${t.version}\n`);const W=(e,n,i="")=>{if(0===n.length)return t.out(` ok ${e}`);t.err(` FAIL ${e}`);for(const e of n)t.err(` ${e}`);i&&t.err(` ${i}`)};t.out(` ok the reader reads its own fixtures (typescript ${g.version})`),t.out(` ok read ${Qe(k.files.length,"file")}`),W(`${_e} and ${Ge} describe this repository`,j.other),W("no file draws more of its own UI than its line allows",j.grown),W("every line is exact: a count that fell is a line to lower",j.shrunk,`Run: ${F}${j.updateFixes?"":" (after the failures above are fixed)"}`),L.note&&W(`the baseline is no higher than the base branch (${L.note})`,L.problems);const q=new Set([...k.counts.keys()].map(e=>z(e).file));return t.out(` ok PROGRESS: ${q.size} of ${Qe(k.files.length,"file")} still draw UI of their own: `+Ve(k.counts,E)),t.out(""),U?t.out("UI kit check: ok"):t.err(`UI kit check: FAILED (${Qe(J.length,"problem")})`),U?0:1}(process.argv.slice(2),{cwd:process.cwd(),env:process.env,out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>function(e){for(const i of[n(process.cwd(),"package.json"),e])try{return t(i)("typescript")}catch{}throw new Error("typescript is not installed")}(import.meta.url),git:function(t){try{return e("git",t,{cwd:process.cwd(),encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:6e4,maxBuffer:67108864})}catch{return null}},version:"11.12.0"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{BoxPlotChart as default}from"../chunk-
|
|
1
|
+
export{BoxPlotChart as default}from"../chunk-VEATEVMV.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{CandlestickChart as default}from"../chunk-
|
|
1
|
+
export{CandlestickChart as default}from"../chunk-P75N466Z.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{CartesianPlot as default}from"../chunk-
|
|
2
|
+
export{CartesianPlot as default}from"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{ChartTooltip as default}from"../chunk-
|
|
1
|
+
export{ChartTooltip as default}from"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-TZFACUMR.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ChordChart as default,foldChord}from"../chunk-
|
|
2
|
+
export{ChordChart as default,foldChord}from"../chunk-7TVGP2SX.js";import"../chunk-5PP435FL.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-WGLHB6WE.js";import"../chunk-NJN5IKWO.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{ColumnChart as default}from"../chunk-
|
|
2
|
+
export{ColumnChart as default}from"../chunk-IKKR2TYY.js";import"../chunk-465RRWBY.js";import"../chunk-5KKJAYKT.js";import"../chunk-CNYAHYE6.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{FunnelChart as default}from"../chunk-
|
|
2
|
+
export{FunnelChart as default}from"../chunk-BOJEZKYS.js";import"../chunk-CNYAHYE6.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{HeatmapChart as default}from"../chunk-
|
|
2
|
+
export{HeatmapChart as default}from"../chunk-Q7UTGO73.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{HistogramChart as default}from"../chunk-
|
|
1
|
+
export{HistogramChart as default}from"../chunk-SI33IE7G.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
package/dist/charts/PieChart.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{PieChart as default}from"../chunk-
|
|
2
|
+
export{PieChart as default}from"../chunk-XOH6QERF.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-
|
|
2
|
+
export{RADAR_SERIES_CAP,RadarChart as default}from"../chunk-AQ7CNPEE.js";import"../chunk-5PP435FL.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-WGLHB6WE.js";import"../chunk-NJN5IKWO.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-2JWPNR2U.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{RadialBarChart as default}from"../chunk-
|
|
2
|
+
export{RadialBarChart as default}from"../chunk-K3IUUZO5.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-CNYAHYE6.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-2JWPNR2U.js";import"../chunk-TZFACUMR.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{RangeChart as default}from"../chunk-
|
|
1
|
+
export{RangeChart as default}from"../chunk-LJJ7FDAQ.js";import"../chunk-VFC6QUEN.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SankeyChart as default}from"../chunk-
|
|
2
|
+
export{SankeyChart as default}from"../chunk-CGA6RTVI.js";import"../chunk-5PP435FL.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-WGLHB6WE.js";import"../chunk-NJN5IKWO.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SCATTER_SERIES_CAP,ScatterChart as default}from"../chunk-
|
|
2
|
+
export{SCATTER_SERIES_CAP,ScatterChart as default}from"../chunk-64KZ74CS.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
package/dist/charts/SpecChart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SpecChart as default}from"../chunk-
|
|
1
|
+
export{SpecChart as default}from"../chunk-LWFH5QTJ.js";import"../chunk-GEYM4WN3.js";import"../chunk-Y3JW2GW5.js";import"../chunk-36BRD5J3.js";import"../chunk-LF27WIN2.js";import"../chunk-ES2LUEPN.js";import"../chunk-JRCFOZEU.js";import"../chunk-CK2YOGUS.js";import"../chunk-NTUZT37J.js";import"../chunk-VFC6QUEN.js";import"../chunk-IKKR2TYY.js";import"../chunk-465RRWBY.js";import"../chunk-5KKJAYKT.js";import"../chunk-CNYAHYE6.js";import"../chunk-WGLHB6WE.js";import"../chunk-NJN5IKWO.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{SunburstChart as default}from"../chunk-
|
|
2
|
+
export{SunburstChart as default}from"../chunk-G3FHFWC2.js";import"../chunk-5PP435FL.js";import"../chunk-VFC6QUEN.js";import"../chunk-CNYAHYE6.js";import"../chunk-WGLHB6WE.js";import"../chunk-NJN5IKWO.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{TimeSeriesChart as default}from"../chunk-
|
|
2
|
+
export{TimeSeriesChart as default}from"../chunk-ES2LUEPN.js";import"../chunk-JRCFOZEU.js";import"../chunk-CK2YOGUS.js";import"../chunk-VFC6QUEN.js";import"../chunk-465RRWBY.js";import"../chunk-5KKJAYKT.js";import"../chunk-CNYAHYE6.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
export{TreemapChart as default}from"../chunk-
|
|
2
|
+
export{TreemapChart as default}from"../chunk-5W3U3EVG.js";import"../chunk-46BYGPGD.js";import"../chunk-5PP435FL.js";import"../chunk-CNYAHYE6.js";import"../chunk-WGLHB6WE.js";import"../chunk-NJN5IKWO.js";import"../chunk-PGN5ME7B.js";import"../chunk-62LW225J.js";import"../chunk-GLUJS42B.js";import"../chunk-D65T4H6J.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{WaterfallChart as default}from"../chunk-
|
|
1
|
+
export{WaterfallChart as default}from"../chunk-N75MPMLD.js";import"../chunk-36VIGB6J.js";import"../chunk-5FYDNH4Y.js";import"../chunk-LNXBTK7Q.js";import"../chunk-QDL2FNP7.js";import"../chunk-Y4RHGLXB.js";import"../chunk-2JWPNR2U.js";import"../chunk-MAFUXCPZ.js";import"../chunk-TZFACUMR.js";import"../chunk-TWVUQUUD.js";import"../chunk-5YP7MFPK.js";import"../chunk-C3QOHMR6.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-
|
|
1
|
+
import{PopupMenuDivider as e,PopupMenuLabel as l,menuTextRowStyle as t,PopupSubmenu as i,itemLook as a,MenuCheckMark as r}from"./chunk-4TB4CSLB.js";import{jsx as n,jsxs as s}from"react/jsx-runtime";var d=e=>!!e&&"label"!==e.type&&"status"!==e.type&&"divider"!==e.type&&!e.disabled,c=(e,l)=>`${e}-status-${l}`;function o(e,l){return e.flatMap((e,t)=>"status"===e.type?[c(l,t)]:[]).join(" ")||void 0}function u(d,o){const{menuId:y,choose:b,toggle:h,followLink:p,rowProps:m=()=>({}),linkAs:k}=o,f=k??"a",v=(d,k)=>{if("divider"===d.type)/* @__PURE__ */
|
|
2
2
|
return n("div",{role:"separator",children:/* @__PURE__ */n(e,{})},d.key);if("label"===d.type)/* @__PURE__ */
|
|
3
3
|
return n("div",{id:`${y}-label-${k}`,children:/* @__PURE__ */n(l,{children:d.label})},d.key);if("status"===d.type)/* @__PURE__ */
|
|
4
4
|
return n("div",{id:c(y,k),className:"text-xs",style:t(),children:d.label},d.key);if("submenu"===d.type)/* @__PURE__ */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
2
|
-
return s("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${m?"":"bg-surface ring-1 ring-black/5"} ${c??""}`,style:m?
|
|
3
|
-
/* @__PURE__ */t("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(
|
|
4
|
-
/* @__PURE__ */t("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:
|
|
5
|
-
/* @__PURE__ */t("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:
|
|
6
|
-
/* @__PURE__ */t("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:
|
|
1
|
+
import{glassStyle as e}from"./chunk-5FYDNH4Y.js";import{CHART_INK as a}from"./chunk-TZFACUMR.js";import{jsxs as s,jsx as t}from"react/jsx-runtime";function l({variant:l="solid",title:n,rows:r,footnote:o,emphasisKey:i,className:c}){const m="glass"===l;/* @__PURE__ */
|
|
2
|
+
return s("div",{role:"status",className:`pointer-events-none min-w-44 rounded-xl p-3 text-xs ${m?"":"bg-surface ring-1 ring-black/5"} ${c??""}`,style:m?e():{boxShadow:"var(--elevation-popup)"},children:[n&&/* @__PURE__ */t("p",{className:"mb-2 text-sm font-medium text-gray-800",children:n}),
|
|
3
|
+
/* @__PURE__ */t("ul",{className:"m-0 flex list-none flex-col gap-2 p-0",children:r.map(e=>/* @__PURE__ */s("li",{className:"flex items-center gap-3",style:i&&e.key!==i?{opacity:.45}:void 0,children:[
|
|
4
|
+
/* @__PURE__ */t("span",{className:"h-3 w-3 shrink-0 rounded-[4px]",style:{backgroundColor:e.color??a.muted}}),
|
|
5
|
+
/* @__PURE__ */t("span",{className:"flex-1 whitespace-nowrap text-gray-600",children:e.label}),
|
|
6
|
+
/* @__PURE__ */t("span",{className:"pl-4 font-semibold tabular-nums text-gray-900",children:e.value??"—"})]},e.key))}),o&&/* @__PURE__ */t("p",{className:"mt-2 text-2xs text-ink-faint",children:o})]})}export{l as ChartTooltip};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Tooltip as n}from"./chunk-
|
|
1
|
+
import{Tooltip as n}from"./chunk-NJN5IKWO.js";import{useShellStrings as r,useShellLocale as e}from"./chunk-5YP7MFPK.js";import{formatPlain as t}from"./chunk-C3QOHMR6.js";import{jsx as i,jsxs as o}from"react/jsx-runtime";var a=["inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-md px-1","text-2xs font-medium normal-case leading-none tabular-nums tracking-normal","ring-1 ring-inset ring-[color:color-mix(in_srgb,currentColor_20%,transparent)]"].join(" ");function s({count:s,label:c,active:l=!1,showZero:m=!1,className:u=""}){const d=r().count,h=e();if(!(s>0||0===s&&m))return null;const f=c??d.items(s);/* @__PURE__ */
|
|
2
2
|
return i(n,{content:f,describe:!1,className:`relative inline-flex shrink-0 ${u}`.trim(),children:/* @__PURE__ */o("span",{"data-item-count":"",className:`${a} ${l?"bg-blue-100 text-blue-700":"bg-[color:color-mix(in_srgb,var(--ink-faint)_14%,transparent)] text-gray-600"}`,children:[
|
|
3
3
|
/* @__PURE__ */i("span",{"aria-hidden":"true",children:t(s,h)}),
|
|
4
4
|
/* @__PURE__ */i("span",{className:"sr-only",children:f})]})})}export{s as ItemCount};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{IconPicker as e}from"./chunk-
|
|
2
|
-
return a("div",{role:"group","aria-label":l,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(i,{children:[
|
|
1
|
+
import{IconPicker as e}from"./chunk-ZHS2VQU7.js";import{ColorPicker as t}from"./chunk-HT7SOOMD.js";import{InputNumber_default as r}from"./chunk-I5GDAQYL.js";import{BORDER_LINE_STYLES as o}from"./chunk-NOMWJTN2.js";import{Icon as l}from"./chunk-7V32O5NF.js";import{jsxs as a,Fragment as i,jsx as s}from"react/jsx-runtime";var n=["top","right","bottom","left"];function d(e){const t=e??{},r="number"==typeof t.width?t.width:0;return Object.fromEntries(n.map(e=>[e,"number"==typeof t[e]?t[e]:r]))}function m(e,t){const r=e??{},o=d(t),l=n.some(e=>"number"==typeof r[e]),a=n.map(e=>"number"==typeof r[e]?r[e]:"number"==typeof r.width?r.width:l?0:o[e]);return!a.every(e=>e===a[0])}var c="h-3.5 w-3.5",h={all:/* @__PURE__ */s(l,{name:"border-all","aria-hidden":"true",className:c}),top:/* @__PURE__ */s(l,{name:"border-top","aria-hidden":"true",className:c}),right:/* @__PURE__ */s(l,{name:"border-right","aria-hidden":"true",className:c}),bottom:/* @__PURE__ */s(l,{name:"border-bottom","aria-hidden":"true",className:c}),left:/* @__PURE__ */s(l,{name:"border-left","aria-hidden":"true",className:c})},p={solid:/* @__PURE__ */s(l,{name:"line-solid","aria-hidden":"true",className:c}),dashed:/* @__PURE__ */s(l,{name:"line-dashed","aria-hidden":"true",className:c}),dotted:/* @__PURE__ */s(l,{name:"line-dotted","aria-hidden":"true",className:c})};function u({label:l,value:d,onChange:m,each:c,placeholder:u,presets:f,words:b,widths:w=!0,styles:g=!0,min:y=0,max:N=20,step:v=1,readOnly:x}){const j=e=>"number"==typeof d[e]?d[e]:null,O=(e,t)=>{const r={...d};if("number"==typeof d.width)for(const e of n)null===j(e)&&(r[e]=d.width);r[e]=t,delete r.width,m(r)},S=(e,t,o,l,a,i)=>/* @__PURE__ */s("div",{"data-side":e,className:"all"===e?"col-span-2 min-w-0":"min-w-0",children:/* @__PURE__ */s(r,{value:l,onChange:i,min:y,max:N,step:v,precision:0,steppers:"compact",readOnly:x,placeholder:a,prefix:o,suffix:b.unit,"aria-label":t})}),k=n.map(j),C="number"==typeof d.width?d.width:k.every(e=>null!==e&&e===k[0])?k[0]:null,H=null===C&&k.some(e=>null!==e),D=n.every(e=>u.sides[e]===u.sides.top)?String(u.sides.top):"–",I=e=>j(e)??("number"==typeof d.width?d.width:null),M=d.style??u.style;/* @__PURE__ */
|
|
2
|
+
return a("div",{role:"group","aria-label":l,"data-border":c?"each":"all",className:"grid w-full min-w-0 grid-cols-2 gap-2",children:[w?c?/* @__PURE__ */a(i,{children:[S("left",b.sides.left,h.left,I("left"),String(u.sides.left),e=>O("left",e)),S("top",b.sides.top,h.top,I("top"),String(u.sides.top),e=>O("top",e)),S("right",b.sides.right,h.right,I("right"),String(u.sides.right),e=>O("right",e)),S("bottom",b.sides.bottom,h.bottom,I("bottom"),String(u.sides.bottom),e=>O("bottom",e))]}):S("all",b.width,h.all,C,H?"–":D,e=>{const t={...d,width:e};for(const e of n)delete t[e];m(t)}):null,g&&/* @__PURE__ */s("div",{"data-border-style":"",className:"col-span-2 min-w-0",children:/* @__PURE__ */s(e,{label:b.style,value:M,disabled:x,onChange:e=>{x||m({...d,style:e})},options:o.map(e=>({value:e,label:b.styles[e],icon:p[e]}))})}),
|
|
3
3
|
/* @__PURE__ */s("div",{"data-border-color":"",className:"col-span-2 flex min-w-0 items-center",children:/* @__PURE__ */s(t,{value:d.color??"",onChange:e=>{x||m({...d,color:e})},label:b.color,presets:f,fallback:u.color,showHexInput:!0,size:"md",disabled:x})})]})}export{u as BorderInput,d as borderSides,m as borderStartEach};
|