efficient-shell 15.8.0 → 16.0.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.
Files changed (158) hide show
  1. package/README.md +5 -4
  2. package/dist/{Browser-5QLDJ74Z.js → Browser-WSLWUH3Q.js} +17 -17
  3. package/dist/{Calculator-6WNTZLWL.js → Calculator-MBHZSFJ6.js} +22 -22
  4. package/dist/{CurrencyConverter-C4KCZWUM.js → CurrencyConverter-7FPB7WJE.js} +10 -10
  5. package/dist/{Files-VFRXPQLV.js → Files-4GEECDQU.js} +60 -60
  6. package/dist/{Notepad-S5JMXH2O.js → Notepad-SYEZ5AN6.js} +9 -9
  7. package/dist/{PdfViewer-AIAVQYZ6.js → PdfViewer-KS2BCFSA.js} +1 -1
  8. package/dist/PomodoroTimer-TYSJOYDJ.js +91 -0
  9. package/dist/{Preview-HTFTEL7K.js → Preview-L5DOMSGD.js} +24 -24
  10. package/dist/Sidebar-IU4EG3D3.js +44 -0
  11. package/dist/{Stock-LIOPTQG5.js → Stock-Y74YC25V.js} +3 -3
  12. package/dist/{Weather-K3BVAFRV.js → Weather-EO4LYAPA.js} +22 -22
  13. package/dist/{WorldClock-RHAHXLW4.js → WorldClock-3E3KLHSD.js} +7 -7
  14. package/dist/ai/index.js +37 -37
  15. package/dist/apps/ImageAnnotator.js +1 -1
  16. package/dist/apps/index.js +1 -1
  17. package/dist/bin/browser-check.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/FlowChart.js +1 -1
  22. package/dist/{chunk-LFUXWZV7.js → chunk-2EBHJGMM.js} +1 -1
  23. package/dist/{chunk-EA423N2F.js → chunk-32EOC6E7.js} +3 -3
  24. package/dist/chunk-37FQVY2O.js +2 -0
  25. package/dist/{chunk-VHBRVW5O.js → chunk-3OK5VZOU.js} +3 -3
  26. package/dist/{chunk-UYM7562M.js → chunk-43YU7YWL.js} +2 -2
  27. package/dist/{chunk-XYVFJLAU.js → chunk-452LT77I.js} +1 -1
  28. package/dist/chunk-4YH7U7WL.js +1 -0
  29. package/dist/{chunk-KERCZSIA.js → chunk-54WCVNJJ.js} +1 -1
  30. package/dist/{chunk-OK2J6WSC.js → chunk-6ZQC6XFU.js} +1 -1
  31. package/dist/{chunk-A3RD7AQ2.js → chunk-7AF5JGRM.js} +1 -1
  32. package/dist/{chunk-RIA6KKIB.js → chunk-7EPCBDS5.js} +6 -6
  33. package/dist/{chunk-4NTAZLT3.js → chunk-7KUHILEA.js} +3 -3
  34. package/dist/chunk-ATTQTQJI.js +14 -0
  35. package/dist/chunk-AYTGYEOI.js +8 -0
  36. package/dist/{chunk-S6C7X6CR.js → chunk-AZANUXJT.js} +16 -16
  37. package/dist/{chunk-QSFQTMWV.js → chunk-BGLUOC7W.js} +1 -1
  38. package/dist/{chunk-D7MRZZVV.js → chunk-BYTQRQ5P.js} +1 -1
  39. package/dist/{chunk-DVKOVZJ2.js → chunk-DFI5EHSV.js} +12 -12
  40. package/dist/{chunk-GUUBFQ6L.js → chunk-DYJQIZX2.js} +2 -2
  41. package/dist/{chunk-YFVQKS5U.js → chunk-GH7RPWJO.js} +1 -1
  42. package/dist/{chunk-KTI4ZJVX.js → chunk-GNB6KUCT.js} +1 -1
  43. package/dist/chunk-GURLMAZM.js +3 -0
  44. package/dist/{chunk-GUOAPXUY.js → chunk-GZ57F6PN.js} +4 -4
  45. package/dist/chunk-IDH323EU.js +6 -0
  46. package/dist/{chunk-5OXQ5M5S.js → chunk-JKO4JZPO.js} +1 -1
  47. package/dist/{chunk-YEDAXZYO.js → chunk-JU6VBLTU.js} +1 -1
  48. package/dist/{chunk-ZVKUOJNS.js → chunk-JUGRSO5J.js} +1 -1
  49. package/dist/{chunk-PCNFY6EK.js → chunk-LH7ZKPHJ.js} +12 -12
  50. package/dist/{chunk-5QHNDAZ6.js → chunk-LLXI57MB.js} +1 -1
  51. package/dist/chunk-LRASKGEZ.js +4 -0
  52. package/dist/chunk-LYGIOJ3J.js +1 -0
  53. package/dist/{chunk-V62FEHS4.js → chunk-MDXZ7YAC.js} +1 -1
  54. package/dist/{chunk-62UNBUTU.js → chunk-NO5BMPT5.js} +1 -1
  55. package/dist/{chunk-3AVXNZY5.js → chunk-NPBRNEMR.js} +1 -1
  56. package/dist/chunk-NSSMK5JR.js +1 -0
  57. package/dist/{chunk-WGDVYCQX.js → chunk-OHRKENEP.js} +21 -21
  58. package/dist/{chunk-JRKD7SD3.js → chunk-OLXUMB2V.js} +16 -16
  59. package/dist/chunk-ONUNFTZD.js +11 -0
  60. package/dist/{chunk-KIIZNION.js → chunk-OX7Q5PPR.js} +5 -5
  61. package/dist/{chunk-ASNRA3ZL.js → chunk-P7X4PWJJ.js} +1 -1
  62. package/dist/{chunk-UMIRPFQJ.js → chunk-QD7IODP2.js} +1 -1
  63. package/dist/{chunk-NM7U42KL.js → chunk-QO2CN2ND.js} +8 -8
  64. package/dist/{chunk-QSOBETAI.js → chunk-QY2DGLCJ.js} +6 -6
  65. package/dist/chunk-R7OZ2AQD.js +6 -0
  66. package/dist/{chunk-U7PA4KNZ.js → chunk-RBOGLXMV.js} +8 -8
  67. package/dist/{chunk-OEWBWKKD.js → chunk-SWH3IEUT.js} +9 -9
  68. package/dist/{chunk-LGVVXYW7.js → chunk-SYASK4QG.js} +1 -1
  69. package/dist/{chunk-YXMXATYP.js → chunk-THVE54FN.js} +1 -1
  70. package/dist/{chunk-TEYG2W7A.js → chunk-TM5NQTFA.js} +2 -2
  71. package/dist/{chunk-FQ3SYDKI.js → chunk-US7F3NC3.js} +1 -1
  72. package/dist/{chunk-XZKVGJIB.js → chunk-V77UETV3.js} +1 -1
  73. package/dist/{chunk-I2NVBDKH.js → chunk-VLT4ZEHT.js} +1 -1
  74. package/dist/chunk-WUNZBM53.js +28 -0
  75. package/dist/{chunk-GD5NGS6D.js → chunk-XNPCOWOO.js} +45 -45
  76. package/dist/{chunk-EULBBS5L.js → chunk-XOEYCDWT.js} +1 -1
  77. package/dist/{chunk-QJ3X2PHY.js → chunk-YCA2XXAB.js} +1 -1
  78. package/dist/{chunk-AKEED2BC.js → chunk-YQKNRT7L.js} +1 -1
  79. package/dist/{chunk-QYOIS4BN.js → chunk-ZKWAWQ74.js} +3 -3
  80. package/dist/{chunk-RRWQBWLW.js → chunk-ZV2ZAHZV.js} +1 -1
  81. package/dist/data/EntityList.js +1 -1
  82. package/dist/data/ListLoadError.js +1 -1
  83. package/dist/forms/BorderInput.js +1 -1
  84. package/dist/forms/BrandAssetEditor.js +1 -1
  85. package/dist/forms/Button.d.ts +1 -0
  86. package/dist/forms/Button.js +1 -1
  87. package/dist/forms/ColorPicker.js +1 -1
  88. package/dist/forms/ComposerAttachments.js +1 -1
  89. package/dist/forms/CornersInput.js +1 -1
  90. package/dist/forms/DateRangePicker.js +1 -1
  91. package/dist/forms/IconButton.js +1 -1
  92. package/dist/forms/IconPicker.js +1 -1
  93. package/dist/forms/Input.js +1 -1
  94. package/dist/forms/InputNumber.js +1 -1
  95. package/dist/forms/LinkPicker.js +1 -1
  96. package/dist/forms/MediaLibrary.js +1 -1
  97. package/dist/forms/MediaUsedInList.js +1 -1
  98. package/dist/forms/NumericKeypad.js +1 -1
  99. package/dist/forms/PositionInput.js +1 -1
  100. package/dist/forms/RenameField.js +1 -1
  101. package/dist/forms/SearchInput.js +1 -1
  102. package/dist/forms/SidesInput.js +1 -1
  103. package/dist/forms/Slider.js +1 -1
  104. package/dist/forms/Snippet.js +1 -1
  105. package/dist/forms/SplitButton.js +1 -1
  106. package/dist/forms/TextToolbar.js +1 -1
  107. package/dist/forms/WidthsBar.js +1 -1
  108. package/dist/forms/buttonStyles.d.ts +8 -1
  109. package/dist/forms/buttonStyles.js +1 -1
  110. package/dist/icons/index.js +1 -1
  111. package/dist/index.d.ts +4 -23
  112. package/dist/index.js +175 -175
  113. package/dist/map/index.js +3 -3
  114. package/dist/page-tabs/index.js +5 -5
  115. package/dist/pdf/index.js +1 -1
  116. package/dist/routine-index.json +1 -1
  117. package/dist/shell/AppUpdateBanner.js +1 -1
  118. package/dist/shell/ConfirmDialog.js +1 -1
  119. package/dist/shell/Dialog.js +1 -1
  120. package/dist/shell/Drawer.js +1 -1
  121. package/dist/shell/HelpCenter.js +1 -1
  122. package/dist/shell/ImageLightbox.js +1 -1
  123. package/dist/shell/LanguageSelect.js +1 -1
  124. package/dist/shell/Markdown.js +1 -1
  125. package/dist/shell/Popover.js +1 -1
  126. package/dist/shell/SearchableSelect.js +1 -1
  127. package/dist/shell/discardGuard.js +1 -1
  128. package/dist/shell/strings.d.ts +5 -2
  129. package/dist/shell/toast.js +1 -1
  130. package/dist/telemetry/index.js +1 -1
  131. package/dist/templates/AuthScreen.js +1 -1
  132. package/dist/templates/ChatTemplate.js +1 -1
  133. package/dist/templates/CheckoutTemplate.js +1 -1
  134. package/dist/templates/DashboardTemplate.js +1 -1
  135. package/dist/templates/DataTablePage.js +1 -1
  136. package/dist/templates/EmailTemplate.js +1 -1
  137. package/dist/templates/ErrorBoundary.js +1 -1
  138. package/dist/templates/FormLayoutPage.js +1 -1
  139. package/dist/templates/GalleryTemplate.js +1 -1
  140. package/dist/ui/index.js +1 -1
  141. package/dist/value-index.json +1 -1
  142. package/dist/version.js +1 -1
  143. package/package.json +1 -1
  144. package/dist/PomodoroTimer-BGTCWT53.js +0 -91
  145. package/dist/Sidebar-KAALEIIX.js +0 -44
  146. package/dist/chunk-345FP3IX.js +0 -4
  147. package/dist/chunk-5RCKE4X2.js +0 -6
  148. package/dist/chunk-6FOLK4HD.js +0 -1
  149. package/dist/chunk-A4ROXNUF.js +0 -2
  150. package/dist/chunk-APFDZ2HG.js +0 -1
  151. package/dist/chunk-DEV3ZHPP.js +0 -8
  152. package/dist/chunk-E4WVF6AS.js +0 -28
  153. package/dist/chunk-MQNSKFZY.js +0 -11
  154. package/dist/chunk-OHPDB4UN.js +0 -14
  155. package/dist/chunk-QXEZBS3H.js +0 -6
  156. package/dist/chunk-R6YVKP6D.js +0 -3
  157. package/dist/chunk-UQYNPYF4.js +0 -1
  158. /package/dist/{chunk-TEQ5ZPAL.js → chunk-NQWORKZD.js} +0 -0
@@ -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";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(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(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function g(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function d(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=g(t),o=[...new Set(t.map(d))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=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&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(u)}var u=(e,n)=>e<n?-1:e>n?1:0;Object.keys({fast:120,base:160}).map(e=>`--motion-${e}`).join(", "),Object.keys({body:400,control:500,heading:600,figure:700}).map(e=>`--weight-${e}`).join(", "),Object.keys({hairline:1,strong:2,accent:4}).map(e=>`--border-${e}`).join(", "),[2,4,8,12,16,20,24,32,40,48].join("/");var p=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${p("top","left")}(?![\\w-])`,`(?<![\\w-])!?${p("\\[0_0\\]")}`].join("|"));var f=(...e)=>e.join(""),m="3xs|2xs|xs|sm|base|lg|xl|[2-9]xl";new RegExp(`(?<![\\w-])!?(?:${f("te","xt-")}(?:(?:${m})(?:\\/[\\w.()-]+)?|\\[(?:length:)?[\\d.]+(?:px|rem|em)\\])|${f("fo","nt-")}(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\\[\\d+\\]))(?![\\w-])`),new RegExp(`(?<![\\w-])${f("round","ed")}(?:-(?:full|sm|md|lg|xl|[23]xl|[trblse]|tl|tr|br|bl|\\([^)]*\\)|\\[[^\\]]*\\]))*(?![\\w-])`);new RegExp(`(?<![\\w-])${f("b","g-")}(?!(?:none|transparent|current|inherit|cover|contain|auto|fixed|local|scroll|center|top|bottom|left|right|repeat|no-repeat|clip|origin|blend|linear|radial|conic|gradient|position|size|image)(?![\\w]))[\\w\\[(#][^\\s'"\`]*`);var w=`${m}|left|center|right|justify|start|end|wrap|nowrap|balance|pretty|ellipsis|clip|transparent|current|inherit|shadow`;new RegExp(`(?<![\\w-])${f("te","xt-")}(?!(?:${w})(?![\\w]))(?!\\[[\\d.]+(?:px|rem|em)\\])(?!\\[length:)[\\w\\[(#][^\\s'"\`]*`),new RegExp(`(?<![\\w-])${f("p","[xs]?-")}(?:\\d|\\[|\\()`),new RegExp(`(?<![\\w-])${f("p","y-")}(?:0|px|0\\.5|\\[[0-3](?:\\.\\d+)?px\\])(?![\\w.-])`),new RegExp(`(?<![\\w-])${f("round","ed-full")}(?![\\w-])`),new RegExp(`(?<![\\w-])${f("te","xt-")}(?:xs|2xs|3xs|\\[(?:9|10|11|12)px\\])(?![\\w-])`),new RegExp(`(?<![\\w-])${f("p","y-")}`),new RegExp(`(?<![\\w-])!?(?:${f("dura","tion-")}|${f("del","ay-")})(?:\\d+|\\[[^\\]]+\\])(?![\\w-])|(?<![\\w-])!?${f("fo","nt-")}\\[\\d+\\](?![\\w-])|(?<![\\w-])!?${f("bor","der")}(?:-[xytrblse])?-\\[[\\d.]+px\\](?![\\w-])`,"g");var $={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(($.busy?.words??[]).map(e=>e.toLowerCase()));var x=(...e)=>e.join("-");x("p[xytrblse]?",""),x("max","[wh]",""),x("h",""),x("w",""),x("[wh]",""),x("min","h","");var y=class extends Error{},b=new Set(["$schema","schema","include","exclude","allow"]),R=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var v="d3as2htf4hwbtr.cloudfront.net",k={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/"}},j=Object.values(k),C=Object.freeze([...new Set([...j.flatMap(e=>e.hosts),v,...j.map(e=>e.bucket)])].sort()),A=new RegExp([...C.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 E(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(A)].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 O="media-host-check.config.json",T="efficient-shell-media-host-check",P=`${T}: 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 ${T} check this repository; exits 1 on a finding\n ${T} --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 ${O} in the current directory.`;function L(e,t,r){const o=[],s=g(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),c=[];for(const r of a)for(const o of E(e,r,i(n(t,r),"utf8")))c.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)c.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:a.length,findings:c.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(P),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${T}: unknown argument "${n}"\n\n${P}`),2;o=!0}const s=n(r.cwd,O);if(!t(s))return r.err(`${T}: no ${O} 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(!R(e))throw new y(`${n}: expected an object`);for(const n of Object.keys(e))b.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(S)||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(!(R(i)&&S(i.file)&&S(i.match)&&S(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 y(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),O);a=L(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${T}: ${e instanceof y||e instanceof SyntaxError?e.message:String(e)}`),2}const g=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!g,...a},null,2)),g?1:0;if(!g)return r.out(`${T}: ${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(`${O}: ${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 ${O}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"15.8.0"});
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";function o(t){return function(t,i){for(const r of[n(process.cwd(),"package.json"),i])try{return e(r)(t)}catch{}throw new Error(`${t} is not installed; add it to this repository's devDependencies`)}("typescript",t)}var s=/[.+^$()|[\]\\]/g;function a(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(s,"\\$&")}if(0!==t)throw new Error(`unbalanced { in glob "${e}"`);return new RegExp(`^${n}$`)}function g(e){const n=e.map(a);return e=>n.some(n=>n.test(e))}var c=new Set(["node_modules",".git"]),l=new Set(["dist","coverage",".next",".turbo"]);function d(e){const n=e.search(/[*?{]/),t=-1===n?e:e.slice(0,n),i=t.lastIndexOf("/");return-1===i?"":t.slice(0,i)}function h(e,t){const i=g(t),o=[...new Set(t.map(d))].sort(),s=o.filter(e=>!o.some(n=>n!==e&&(""===n||e.startsWith(`${n}/`)))),a=new Set,h=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&&l.has(e.name)||h(n):e.isFile()&&i(n)&&a.add(n)}};for(const e of s)h(e);return[...a].sort(u)}var u=(e,n)=>e<n?-1:e>n?1:0;Object.keys({fast:120,base:160}).map(e=>`--motion-${e}`).join(", "),Object.keys({body:400,control:500,heading:600,figure:700}).map(e=>`--weight-${e}`).join(", "),Object.keys({hairline:1,strong:2,accent:4}).map(e=>`--border-${e}`).join(", "),[2,4,8,12,16,20,24,32,40,48].join("/");var p=(...e)=>["origin",...e].join("-");new RegExp(["(?:transformOrigin|transform-origin)\\s*[:=]\\s*[\"'`]?\\s*(?:top left|left top|0 0|0% 0%|0px 0px)(?![\\w%-])",`(?<![\\w-])!?${p("top","left")}(?![\\w-])`,`(?<![\\w-])!?${p("\\[0_0\\]")}`].join("|"));var f=(...e)=>e.join(""),m="3xs|2xs|xs|sm|base|lg|xl|[2-9]xl";new RegExp(`(?<![\\w-])!?(?:${f("te","xt-")}(?:(?:${m})(?:\\/[\\w.()-]+)?|\\[(?:length:)?[\\d.]+(?:px|rem|em)\\])|${f("fo","nt-")}(?:thin|extralight|light|normal|medium|semibold|bold|extrabold|black|\\[\\d+\\]))(?![\\w-])`),new RegExp(`(?<![\\w-])${f("round","ed")}(?:-(?:full|sm|md|lg|xl|[23]xl|[trblse]|tl|tr|br|bl|\\([^)]*\\)|\\[[^\\]]*\\]))*(?![\\w-])`);new RegExp(`(?<![\\w-])${f("b","g-")}(?!(?:none|transparent|current|inherit|cover|contain|auto|fixed|local|scroll|center|top|bottom|left|right|repeat|no-repeat|clip|origin|blend|linear|radial|conic|gradient|position|size|image)(?![\\w]))[\\w\\[(#][^\\s'"\`]*`);var w=`${m}|left|center|right|justify|start|end|wrap|nowrap|balance|pretty|ellipsis|clip|transparent|current|inherit|shadow`;new RegExp(`(?<![\\w-])${f("te","xt-")}(?!(?:${w})(?![\\w]))(?!\\[[\\d.]+(?:px|rem|em)\\])(?!\\[length:)[\\w\\[(#][^\\s'"\`]*`),new RegExp(`(?<![\\w-])${f("p","[xs]?-")}(?:\\d|\\[|\\()`),new RegExp(`(?<![\\w-])${f("p","y-")}(?:0|px|0\\.5|\\[[0-3](?:\\.\\d+)?px\\])(?![\\w.-])`),new RegExp(`(?<![\\w-])${f("round","ed-full")}(?![\\w-])`),new RegExp(`(?<![\\w-])${f("te","xt-")}(?:xs|2xs|3xs|\\[(?:9|10|11|12)px\\])(?![\\w-])`),new RegExp(`(?<![\\w-])${f("p","y-")}`),new RegExp(`(?<![\\w-])!?(?:${f("dura","tion-")}|${f("del","ay-")})(?:\\d+|\\[[^\\]]+\\])(?![\\w-])|(?<![\\w-])!?${f("fo","nt-")}\\[\\d+\\](?![\\w-])|(?<![\\w-])!?${f("bor","der")}(?:-[xytrblse])?-\\[[\\d.]+px\\](?![\\w-])`,"g");var $={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(($.busy?.words??[]).map(e=>e.toLowerCase()));var x=(...e)=>e.join("-");x("p[xytrblse]?",""),x("max","[wh]",""),x("h",""),x("w",""),x("[wh]",""),x("min","h","");var y=class extends Error{},b=new Set(["$schema","schema","include","exclude","allow"]),R=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),S=e=>"string"==typeof e&&""!==e.trim();var v="d3as2htf4hwbtr.cloudfront.net",k={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/"}},j=Object.values(k),C=Object.freeze([...new Set([...j.flatMap(e=>e.hosts),v,...j.map(e=>e.bucket)])].sort()),A=new RegExp([...C.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 E(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(A)].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 O="media-host-check.config.json",T="efficient-shell-media-host-check",P=`${T}: 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 ${T} check this repository; exits 1 on a finding\n ${T} --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 ${O} in the current directory.`;function L(e,t,r){const o=[],s=g(r.exclude);for(const e of r.include)0===h(t,[e]).length&&o.push(`include "${e}" matches no file; delete it`);const a=h(t,r.include).filter(e=>(e=>/\.(?:[cm]?[jt]s|[jt]sx)$/.test(e)&&!e.endsWith(".d.ts"))(e)&&!s(e)),c=[];for(const r of a)for(const o of E(e,r,i(n(t,r),"utf8")))c.push({file:r,...o});const l=(e,n)=>e.toLowerCase()===n.toLowerCase();for(const e of r.allow)c.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:a.length,findings:c.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(P),0;if("--version"===n||"-v"===n)return r.out(r.version),0;if("--json"!==n)return r.err(`${T}: unknown argument "${n}"\n\n${P}`),2;o=!0}const s=n(r.cwd,O);if(!t(s))return r.err(`${T}: no ${O} 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(!R(e))throw new y(`${n}: expected an object`);for(const n of Object.keys(e))b.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(S)||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(!(R(i)&&S(i.file)&&S(i.match)&&S(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 y(`${n}:\n ${t.join("\n ")}`);return{schema:1,include:r,exclude:o,allow:s}}(JSON.parse(i(s,"utf8")),O);a=L(r.loadTypeScript(),r.cwd,e)}catch(e){return r.err(`${T}: ${e instanceof y||e instanceof SyntaxError?e.message:String(e)}`),2}const g=a.findings.length>0||a.problems.length>0;if(o)return r.out(JSON.stringify({ok:!g,...a},null,2)),g?1:0;if(!g)return r.out(`${T}: ${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(`${O}: ${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 ${O}, with its reason.`),1}(process.argv.slice(2),{cwd:process.cwd(),out:e=>console.log(e),err:e=>console.error(e),loadTypeScript:()=>o(import.meta.url),version:"16.0.0"});