@appsolutely-io/waypoint 0.0.0-stage → 0.1.1-next.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/LICENSE +21 -0
- package/README.md +260 -2
- package/dist/block-reply-DN4RiLL0.d.cts +169 -0
- package/dist/block-reply-Dtof9ild.d.ts +169 -0
- package/dist/blocks-25YOJ5SS.cjs +1 -0
- package/dist/blocks-UJ7GUJHD.js +1 -0
- package/dist/chunk-3KV7TDDR.cjs +3 -0
- package/dist/chunk-4BWV3SEL.cjs +1 -0
- package/dist/chunk-4ZGW4HM4.cjs +1 -0
- package/dist/chunk-5TBO732O.js +1 -0
- package/dist/chunk-6OZSKCPT.cjs +1 -0
- package/dist/chunk-C3VS33WJ.js +1 -0
- package/dist/chunk-D2EGPBCX.cjs +1 -0
- package/dist/chunk-FBADWFRR.cjs +1 -0
- package/dist/chunk-FQSWQLRW.js +1 -0
- package/dist/chunk-GT6PI4CT.cjs +1 -0
- package/dist/chunk-II26UWZM.cjs +1 -0
- package/dist/chunk-JFMVVGGB.js +1 -0
- package/dist/chunk-K73VV7KA.js +1 -0
- package/dist/chunk-L4PFFRDE.js +3 -0
- package/dist/chunk-LLPGVQUT.cjs +1 -0
- package/dist/chunk-M3UENQ6L.cjs +1 -0
- package/dist/chunk-M63QOANE.js +1 -0
- package/dist/chunk-MEKDQDSV.js +1 -0
- package/dist/chunk-OEPKPDLD.js +1 -0
- package/dist/chunk-OWT55N6J.js +3 -0
- package/dist/chunk-PFR2J5BV.js +1 -0
- package/dist/chunk-Q6BD2YL3.cjs +1 -0
- package/dist/chunk-Q7BULGQG.cjs +1 -0
- package/dist/chunk-QS3MKZOY.cjs +3 -0
- package/dist/chunk-RHBDQGD4.js +1 -0
- package/dist/chunk-RZZDQWC2.js +1 -0
- package/dist/chunk-S73WZWDP.js +1 -0
- package/dist/chunk-SD2KAIVE.js +1 -0
- package/dist/chunk-T5XF2R74.js +1 -0
- package/dist/chunk-TCFCSGQ3.js +1 -0
- package/dist/chunk-TGL3DR2K.js +1 -0
- package/dist/chunk-TODYQ3SG.cjs +1 -0
- package/dist/chunk-TVSQHTK2.cjs +1 -0
- package/dist/chunk-UYR3UEIW.cjs +1 -0
- package/dist/chunk-VGGJGRNK.cjs +1 -0
- package/dist/chunk-W6Y7H56X.js +1 -0
- package/dist/chunk-XSHOLIC7.cjs +1 -0
- package/dist/chunk-XWDB2LS3.cjs +1 -0
- package/dist/cli.js +3 -0
- package/dist/confirmation-view-CICNJJIO.js +1 -0
- package/dist/confirmation-view-OMWHUYVC.cjs +1 -0
- package/dist/conformance.cjs +1 -0
- package/dist/conformance.d.cts +10 -0
- package/dist/conformance.d.ts +10 -0
- package/dist/conformance.js +1 -0
- package/dist/flow-parser.cjs +1 -0
- package/dist/flow-parser.d.cts +3 -0
- package/dist/flow-parser.d.ts +3 -0
- package/dist/flow-parser.js +1 -0
- package/dist/flows-panel-AIULKYOS.cjs +1 -0
- package/dist/flows-panel-YEJ36RTY.js +1 -0
- package/dist/form-extras-QYE32TUY.cjs +1 -0
- package/dist/form-extras-SBBOMJS2.js +1 -0
- package/dist/form-fill-C32AHxSr.d.cts +653 -0
- package/dist/form-fill-Dp3ut1_Y.d.ts +653 -0
- package/dist/form-session.cjs +1 -0
- package/dist/form-session.d.cts +7 -0
- package/dist/form-session.d.ts +7 -0
- package/dist/form-session.js +1 -0
- package/dist/frame-decoder.cjs +3 -0
- package/dist/frame-decoder.d.cts +5 -0
- package/dist/frame-decoder.d.ts +5 -0
- package/dist/frame-decoder.js +3 -0
- package/dist/generated-C9tbjwK0.d.cts +797 -0
- package/dist/generated-C9tbjwK0.d.ts +797 -0
- package/dist/hooks/index.cjs +1 -0
- package/dist/hooks/index.d.cts +48 -0
- package/dist/hooks/index.d.ts +48 -0
- package/dist/hooks/index.js +1 -0
- package/dist/i18n-DPNfYTMG.d.cts +148 -0
- package/dist/i18n-DPNfYTMG.d.ts +148 -0
- package/dist/index-B5idIFTx.d.cts +34 -0
- package/dist/index-DPzoKXCK.d.ts +34 -0
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +38 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.js +3 -0
- package/dist/intent-BQPPows1.d.cts +154 -0
- package/dist/intent-BuvqEU3Q.d.ts +154 -0
- package/dist/intent.cjs +1 -0
- package/dist/intent.d.cts +2 -0
- package/dist/intent.d.ts +2 -0
- package/dist/intent.js +1 -0
- package/dist/markdown-BSRKJFFE.cjs +17 -0
- package/dist/markdown-ETLB66BK.js +17 -0
- package/dist/message-actions-3HGE6VTS.js +1 -0
- package/dist/message-actions-F6SPLTT7.cjs +1 -0
- package/dist/messages/en/index.cjs +1 -0
- package/dist/messages/en/index.d.cts +3 -0
- package/dist/messages/en/index.d.ts +3 -0
- package/dist/messages/en/index.js +1 -0
- package/dist/messages/index.cjs +1 -0
- package/dist/messages/index.d.cts +14 -0
- package/dist/messages/index.d.ts +14 -0
- package/dist/messages/index.js +1 -0
- package/dist/messages/zh-Hans/index.cjs +1 -0
- package/dist/messages/zh-Hans/index.d.cts +3 -0
- package/dist/messages/zh-Hans/index.d.ts +3 -0
- package/dist/messages/zh-Hans/index.js +1 -0
- package/dist/on-demand.cjs +1 -0
- package/dist/on-demand.d.cts +56 -0
- package/dist/on-demand.d.ts +56 -0
- package/dist/on-demand.js +1 -0
- package/dist/problem-messages-THONMXFZ.cjs +1 -0
- package/dist/problem-messages-Z5QGO6RE.js +1 -0
- package/dist/react/index.cjs +1 -0
- package/dist/react/index.d.cts +419 -0
- package/dist/react/index.d.ts +419 -0
- package/dist/react/index.js +1 -0
- package/dist/reads-Bk84x_rt.d.ts +38 -0
- package/dist/reads-DlpCt8dE.d.cts +38 -0
- package/dist/recovery-panel-OWY2CWOH.cjs +3 -0
- package/dist/recovery-panel-VOKVDDZD.js +3 -0
- package/dist/reply-controls-5CWIAKIG.js +1 -0
- package/dist/reply-controls-CPWB4VBK.cjs +1 -0
- package/dist/run-XBABOEXK.js +1 -0
- package/dist/schema.json +2900 -0
- package/dist/skin-antd/index.cjs +1 -0
- package/dist/skin-antd/index.d.cts +30 -0
- package/dist/skin-antd/index.d.ts +30 -0
- package/dist/skin-antd/index.js +1 -0
- package/dist/skin-default/index.cjs +1 -0
- package/dist/skin-default/index.d.cts +42 -0
- package/dist/skin-default/index.d.ts +42 -0
- package/dist/skin-default/index.js +1 -0
- package/dist/step-name-3hQ6CCGr.d.cts +19 -0
- package/dist/step-name-BdkYnb5g.d.ts +19 -0
- package/dist/storage-commit.cjs +1 -0
- package/dist/storage-commit.d.cts +17 -0
- package/dist/storage-commit.d.ts +17 -0
- package/dist/storage-commit.js +1 -0
- package/dist/stream-reads.cjs +1 -0
- package/dist/stream-reads.d.cts +22 -0
- package/dist/stream-reads.d.ts +22 -0
- package/dist/stream-reads.js +1 -0
- package/dist/styles.css +796 -0
- package/dist/testing/index.cjs +1 -0
- package/dist/testing/index.d.cts +57 -0
- package/dist/testing/index.d.ts +57 -0
- package/dist/testing/index.js +1 -0
- package/docs/examples/message-versions.tsx +74 -0
- package/docs/form-fill-protocol.md +83 -0
- package/docs/message-versions.md +64 -0
- package/docs/plan-protocol.md +83 -0
- package/docs/reply-protocol.md +75 -0
- package/etc/hooks.api.md +2385 -0
- package/etc/index.api.md +2159 -0
- package/etc/messages-en.api.md +13 -0
- package/etc/messages-zh-Hans.api.md +13 -0
- package/etc/messages.api.md +183 -0
- package/etc/react.api.md +2968 -0
- package/etc/skin-antd.api.md +2989 -0
- package/etc/skin-default.api.md +61 -0
- package/etc/testing.api.md +3034 -0
- package/package.json +168 -4
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var W=function(e,t){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},W(e,t)};function w(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");W(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var c=function(){return c=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},c.apply(this,arguments)};function ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function V(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function j(e,t){var n=t&&t.cache?t.cache:Ge,r=t&&t.serializer?t.serializer:Re,i=t&&t.strategy?t.strategy:Le;return i(e,{cache:n,serializer:r})}function Ie(e){return e==null||typeof e=="number"||typeof e=="boolean"}function se(e,t,n,r){var i=Ie(r)?r:n(r),o=t.get(i);return typeof o>"u"&&(o=e.call(this,r),t.set(i,o)),o}function he(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,r),t.set(i,o)),o}function z(e,t,n,r,i){return n.bind(t,e,r,i)}function Le(e,t){var n=e.length===1?se:he;return z(e,this,n,t.cache.create(),t.serializer)}function Oe(e,t){return z(e,this,he,t.cache.create(),t.serializer)}function Ce(e,t){return z(e,this,se,t.cache.create(),t.serializer)}var Re=function(){return JSON.stringify(arguments)},Me=(function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(t){return this.cache[t]},e.prototype.set=function(t,n){this.cache[t]=n},e})(),Ge={create:function(){return new Me}},X={variadic:Oe,monadic:Ce};var l;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(l||(l={}));var b;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(b||(b={}));var T;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(T||(T={}));function Z(e){return e.type===b.literal}function Y(e){return e.type===b.argument}function N(e){return e.type===b.number}function I(e){return e.type===b.date}function L(e){return e.type===b.time}function O(e){return e.type===b.select}function C(e){return e.type===b.plural}function ue(e){return e.type===b.pound}function R(e){return e.type===b.tag}function k(e){return!!(e&&typeof e=="object"&&e.type===T.number)}function M(e){return!!(e&&typeof e=="object"&&e.type===T.dateTime)}var J=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;var De=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function fe(e){var t={};return e.replace(De,function(n){var r=n.length;switch(n[0]){case"G":t.era=r===4?"long":r===5?"narrow":"short";break;case"y":t.year=r===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=r===4?"long":r===5?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var le=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function xe(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(le).filter(function(f){return f.length>0}),n=[],r=0,i=t;r<i.length;r++){var o=i[r],a=o.split("/");if(a.length===0)throw new Error("Invalid number skeleton");for(var h=a[0],x=a.slice(1),u=0,s=x;u<s.length;u++){var m=s[u];if(m.length===0)throw new Error("Invalid number skeleton")}n.push({stem:h,options:x})}return n}function Ue(e){return e.replace(/^(.*?)-/,"")}var ce=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,be=/^(@+)?(\+|#+)?[rs]?$/g,Fe=/(\*)(0+)|(#+)(0+)|(0+)/g,Ee=/^(0+)$/;function pe(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(be,function(n,r,i){return typeof i!="string"?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):i==="+"?t.minimumSignificantDigits=r.length:r[0]==="#"?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+(typeof i=="string"?i.length:0)),""}),t}function ye(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Ve(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Ee.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function me(e){var t={},n=ye(e);return n||t}function ve(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=Ue(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=c(c(c({},t),{notation:"scientific"}),i.options.reduce(function(x,u){return c(c({},x),me(u))},{}));continue;case"engineering":t=c(c(c({},t),{notation:"engineering"}),i.options.reduce(function(x,u){return c(c({},x),me(u))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Fe,function(x,u,s,m,f,E){if(u)t.minimumIntegerDigits=s.length;else{if(m&&f)throw new Error("We currently do not support maximum integer digits");if(E)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ee.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(ce.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(ce,function(x,u,s,m,f,E){return s==="*"?t.minimumFractionDigits=u.length:m&&m[0]==="#"?t.maximumFractionDigits=m.length:f&&E?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+E.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var o=i.options[0];o==="w"?t=c(c({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=c(c({},t),pe(o)));continue}if(be.test(i.stem)){t=c(c({},t),pe(i.stem));continue}var a=ye(i.stem);a&&(t=c(c({},t),a));var h=Ve(i.stem);h&&(t=c(c({},t),h))}return t}var G={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function ge(e,t){for(var n="",r=0;r<e.length;r++){var i=e.charAt(r);if(i==="j"){for(var o=0;r+1<e.length&&e.charAt(r+1)===i;)o++,r++;var a=1+(o&1),h=o<2?1:3+(o>>1),x="a",u=je(t);for((u=="H"||u=="k")&&(h=0);h-- >0;)n+=x;for(;a-- >0;)n=u+n}else i==="J"?n+="H":n+=i}return n}function je(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,r;n!=="root"&&(r=e.maximize().region);var i=G[r||""]||G[n||""]||G["".concat(n,"-001")]||G["001"];return i[0]}var Q,Xe=new RegExp("^".concat(J.source,"*")),ke=new RegExp("".concat(J.source,"*$"));function p(e,t){return{start:e,end:t}}var We=!!String.prototype.startsWith&&"_a".startsWith("a",1),ze=!!String.fromCodePoint,Ze=!!Object.fromEntries,Ye=!!String.prototype.codePointAt,Je=!!String.prototype.trimStart,Qe=!!String.prototype.trimEnd,qe=!!Number.isSafeInteger,$e=qe?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},$=!0;try{de=Se("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),$=((Q=de.exec("a"))===null||Q===void 0?void 0:Q[0])==="a"}catch{$=!1}var de,_e=We?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},K=ze?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r="",i=t.length,o=0,a;i>o;){if(a=t[o++],a>1114111)throw RangeError(a+" is not a valid code point");r+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return r},He=Ze?Object.fromEntries:function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=o[0],h=o[1];n[a]=h}return n},Te=Ye?function(t,n){return t.codePointAt(n)}:function(t,n){var r=t.length;if(!(n<0||n>=r)){var i=t.charCodeAt(n),o;return i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Ke=Je?function(t){return t.trimStart()}:function(t){return t.replace(Xe,"")},et=Qe?function(t){return t.trimEnd()}:function(t){return t.replace(ke,"")};function Se(e,t){return new RegExp(e,t)}var ee;$?(q=Se("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),ee=function(t,n){var r;q.lastIndex=n;var i=q.exec(t);return(r=i[1])!==null&&r!==void 0?r:""}):ee=function(t,n){for(var r=[];;){var i=Te(t,n);if(i===void 0||Ae(i)||nt(i))break;r.push(i),n+=i>=65536?2:1}return K.apply(void 0,r)};var q,Be=(function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,r){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var a=this.parseArgument(t,r);if(a.err)return a;i.push(a.val)}else{if(o===125&&t>0)break;if(o===35&&(n==="plural"||n==="selectordinal")){var h=this.clonePosition();this.bump(),i.push({type:b.pound,location:p(h,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(l.UNMATCHED_CLOSING_TAG,p(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&te(this.peek()||0)){var a=this.parseTag(t,n);if(a.err)return a;i.push(a.val)}else{var a=this.parseLiteral(t,n);if(a.err)return a;i.push(a.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:b.literal,value:"<".concat(i,"/>"),location:p(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,n,!0);if(o.err)return o;var a=o.val,h=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!te(this.char()))return this.error(l.INVALID_TAG,p(h,this.clonePosition()));var x=this.clonePosition(),u=this.parseTagName();return i!==u?this.error(l.UNMATCHED_CLOSING_TAG,p(x,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:b.tag,value:i,children:a,location:p(r,this.clonePosition())},err:null}:this.error(l.INVALID_TAG,p(h,this.clonePosition())))}else return this.error(l.UNCLOSED_TAG,p(r,this.clonePosition()))}else return this.error(l.INVALID_TAG,p(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&rt(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var o=this.tryParseQuote(n);if(o){i+=o;continue}var a=this.tryParseUnquoted(t,n);if(a){i+=a;continue}var h=this.tryParseLeftAngleBracket();if(h){i+=h;continue}break}var x=p(r,this.clonePosition());return{val:{type:b.literal,value:i,location:x},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!tt(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return K.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),K(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(l.EMPTY_ARGUMENT,p(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(l.MALFORMED_ARGUMENT,p(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:b.argument,value:i,location:p(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(l.MALFORMED_ARGUMENT,p(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=ee(this.message,n),i=n+r.length;this.bumpTo(i);var o=this.clonePosition(),a=p(t,o);return{value:r,location:a}},e.prototype.parseArgumentOptions=function(t,n,r,i){var o,a=this.clonePosition(),h=this.parseIdentifierIfPossible().value,x=this.clonePosition();switch(h){case"":return this.error(l.EXPECT_ARGUMENT_TYPE,p(a,x));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var s=this.clonePosition(),m=this.parseSimpleArgStyleIfPossible();if(m.err)return m;var f=et(m.val);if(f.length===0)return this.error(l.EXPECT_ARGUMENT_STYLE,p(this.clonePosition(),this.clonePosition()));var E=p(s,this.clonePosition());u={style:f,styleLocation:E}}var v=this.tryParseArgumentClose(i);if(v.err)return v;var g=p(i,this.clonePosition());if(u&&_e(u?.style,"::",0)){var _=Ke(u.style.slice(2));if(h==="number"){var m=this.parseNumberSkeletonFromString(_,u.styleLocation);return m.err?m:{val:{type:b.number,value:r,location:g,style:m.val},err:null}}else{if(_.length===0)return this.error(l.EXPECT_DATE_TIME_SKELETON,g);var A=_;this.locale&&(A=ge(_,this.locale));var f={type:T.dateTime,pattern:A,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?fe(A):{}},B=h==="date"?b.date:b.time;return{val:{type:B,value:r,location:g,style:f},err:null}}}return{val:{type:h==="number"?b.number:h==="date"?b.date:b.time,value:r,location:g,style:(o=u?.style)!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(l.EXPECT_SELECT_ARGUMENT_OPTIONS,p(d,c({},d)));this.bumpSpace();var P=this.parseIdentifierIfPossible(),H=0;if(h!=="select"&&P.value==="offset"){if(!this.bumpIf(":"))return this.error(l.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,p(this.clonePosition(),this.clonePosition()));this.bumpSpace();var m=this.tryParseDecimalInteger(l.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,l.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(m.err)return m;this.bumpSpace(),P=this.parseIdentifierIfPossible(),H=m.val}var F=this.tryParsePluralOrSelectOptions(t,h,n,P);if(F.err)return F;var v=this.tryParseArgumentClose(i);if(v.err)return v;var oe=p(i,this.clonePosition());return h==="select"?{val:{type:b.select,value:r,options:He(F.val),location:oe},err:null}:{val:{type:b.plural,value:r,options:He(F.val),offset:H,pluralType:h==="plural"?"cardinal":"ordinal",location:oe},err:null}}default:return this.error(l.INVALID_ARGUMENT_TYPE,p(a,x))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(l.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,p(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=xe(t)}catch{return this.error(l.INVALID_NUMBER_SKELETON,n)}return{val:{type:T.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?ve(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var o,a=!1,h=[],x=new Set,u=i.value,s=i.location;;){if(u.length===0){var m=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(l.EXPECT_PLURAL_ARGUMENT_SELECTOR,l.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;s=p(m,this.clonePosition()),u=this.message.slice(m.offset,this.offset())}else break}if(x.has(u))return this.error(n==="select"?l.DUPLICATE_SELECT_ARGUMENT_SELECTOR:l.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,s);u==="other"&&(a=!0),this.bumpSpace();var E=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?l.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:l.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,p(this.clonePosition(),this.clonePosition()));var v=this.parseMessage(t+1,n,r);if(v.err)return v;var g=this.tryParseArgumentClose(E);if(g.err)return g;h.push([u,{value:v.val,location:p(E,this.clonePosition())}]),x.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,s=o.location}return h.length===0?this.error(n==="select"?l.EXPECT_SELECT_ARGUMENT_SELECTOR:l.EXPECT_PLURAL_ARGUMENT_SELECTOR,p(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(l.MISSING_OTHER_CLAUSE,p(this.clonePosition(),this.clonePosition())):{val:h,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,a=0;!this.isEOF();){var h=this.char();if(h>=48&&h<=57)o=!0,a=a*10+(h-48),this.bump();else break}var x=p(i,this.clonePosition());return o?(a*=r,$e(a)?{val:a,err:null}:this.error(n,x)):this.error(t,x)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Te(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(_e(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),r=this.message.indexOf(t,n);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ae(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return r??null},e})();function te(e){return e>=97&&e<=122||e>=65&&e<=90}function tt(e){return te(e)||e===47}function rt(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Ae(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function nt(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function re(e){e.forEach(function(t){if(delete t.location,O(t)||C(t))for(var n in t.options)delete t.options[n].location,re(t.options[n].value);else N(t)&&k(t.style)||(I(t)||L(t))&&M(t.style)?delete t.style.location:R(t)&&re(t.children)})}function Pe(e,t){t===void 0&&(t={}),t=c({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Be(e,t).parse();if(n.err){var r=SyntaxError(l[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t?.captureLocation||re(n.val),n.val}var S;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(S||(S={}));var D=(function(e){w(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.code=r,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error);var ne=(function(e){w(t,e);function t(n,r,i,o){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(i).join('", "'),'"'),S.INVALID_VALUE,o)||this}return t})(D);var we=(function(e){w(t,e);function t(n,r,i){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),S.INVALID_VALUE,i)||this}return t})(D);var Ne=(function(e){w(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),S.MISSING_VALUE,r)||this}return t})(D);var y;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(y||(y={}));function it(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==y.literal||n.type!==y.literal?t.push(n):r.value+=n.value,t},[])}function ot(e){return typeof e=="function"}function U(e,t,n,r,i,o,a){if(e.length===1&&Z(e[0]))return[{type:y.literal,value:e[0].value}];for(var h=[],x=0,u=e;x<u.length;x++){var s=u[x];if(Z(s)){h.push({type:y.literal,value:s.value});continue}if(ue(s)){typeof o=="number"&&h.push({type:y.literal,value:n.getNumberFormat(t).format(o)});continue}var m=s.value;if(!(i&&m in i))throw new Ne(m,a);var f=i[m];if(Y(s)){(!f||typeof f=="string"||typeof f=="number")&&(f=typeof f=="string"||typeof f=="number"?String(f):""),h.push({type:typeof f=="string"?y.literal:y.object,value:f});continue}if(I(s)){var E=typeof s.style=="string"?r.date[s.style]:M(s.style)?s.style.parsedOptions:void 0;h.push({type:y.literal,value:n.getDateTimeFormat(t,E).format(f)});continue}if(L(s)){var E=typeof s.style=="string"?r.time[s.style]:M(s.style)?s.style.parsedOptions:r.time.medium;h.push({type:y.literal,value:n.getDateTimeFormat(t,E).format(f)});continue}if(N(s)){var E=typeof s.style=="string"?r.number[s.style]:k(s.style)?s.style.parsedOptions:void 0;E&&E.scale&&(f=f*(E.scale||1)),h.push({type:y.literal,value:n.getNumberFormat(t,E).format(f)});continue}if(R(s)){var v=s.children,g=s.value,_=i[g];if(!ot(_))throw new we(g,"function",a);var A=U(v,t,n,r,i,o),B=_(A.map(function(H){return H.value}));Array.isArray(B)||(B=[B]),h.push.apply(h,B.map(function(H){return{type:typeof H=="string"?y.literal:y.object,value:H}}))}if(O(s)){var d=s.options[f]||s.options.other;if(!d)throw new ne(s.value,f,Object.keys(s.options),a);h.push.apply(h,U(d.value,t,n,r,i));continue}if(C(s)){var d=s.options["=".concat(f)];if(!d){if(!Intl.PluralRules)throw new D(`Intl.PluralRules is not available in this environment.
|
|
2
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3
|
+
`,S.MISSING_INTL_API,a);var P=n.getPluralRules(t,{type:s.pluralType}).select(f-(s.offset||0));d=s.options[P]||s.options.other}if(!d)throw new ne(s.value,f,Object.keys(s.options),a);h.push.apply(h,U(d.value,t,n,r,i,f-(s.offset||0)));continue}}return it(h)}function at(e,t){return t?c(c(c({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=c(c({},e[r]),t[r]||{}),n},{})):e}function st(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=at(e[r],t[r]),n},c({},e)):e}function ie(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function ht(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:j(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,V([void 0],n,!1)))},{cache:ie(e.number),strategy:X.variadic}),getDateTimeFormat:j(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,V([void 0],n,!1)))},{cache:ie(e.dateTime),strategy:X.variadic}),getPluralRules:j(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,V([void 0],n,!1)))},{cache:ie(e.pluralRules),strategy:X.variadic})}}var ut=(function(){function e(t,n,r,i){n===void 0&&(n=e.defaultLocale);var o=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var s=o.formatToParts(u);if(s.length===1)return s[0].value;var m=s.reduce(function(f,E){return!f.length||E.type!==y.literal||typeof f[f.length-1]!="string"?f.push(E.value):f[f.length-1]+=E.value,f},[]);return m.length<=1?m[0]||"":m},this.formatToParts=function(u){return U(o.ast,o.locales,o.formatters,o.formats,u,void 0,o.message)},this.resolvedOptions=function(){var u;return{locale:((u=o.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(o.locales)[0]}},this.getAst=function(){return o.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var a=i||{},h=a.formatters,x=ae(a,["formatters"]);this.ast=e.__parse(t,c(c({},x),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=st(e.formats,r),this.formatters=i&&i.formatters||ht(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Pe,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})();function ir(e,t){try{return Intl.getCanonicalLocales(e)[0]}catch{return t?"zh-Hans":"en"}}export{ut as a,ir as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={"chat.block.required":"{label} (required)","chat.block.requiredMissing":"Fill in the required fields to submit.","chat.block.answerMissing":"Answer the question to submit.","chat.block.empty":"\u2014","chat.block.tierLow":"Low risk","chat.block.tierSensitive":"Sensitive","chat.block.undoCompareAndSet":"Undo restores the previous values","chat.block.undoArchiveCreated":"Undo archives what was created","chat.block.undoInverse":"Undo runs a reverse step","chat.block.status":"Status: {status}","chat.block.outcomeDone":"Done","chat.block.outcomeFailed":"Failed","chat.block.retryable":"It can be tried again","chat.block.notRetryable":"It cannot be tried again","chat.block.state.proposed":"Proposed","chat.block.state.awaiting-confirmation":"Waiting for confirmation","chat.block.state.running":"Running","chat.block.state.undoing":"Undoing","chat.block.state.completed":"Completed","chat.block.state.submitted":"Submitted","chat.block.state.undone":"Undone","chat.block.state.needs-attention":"Needs attention","chat.block.state.cancelled":"Cancelled","chat.block.run":"Run","chat.block.runMissing":"Fill in the required fields to run.","chat.block.favourite":"Favourite: {title}","chat.block.flowLoading":"Loading request\u2026","chat.block.flowsLoading":"Loading saved requests\u2026","chat.block.flowsEmpty":"No saved requests here yet.","chat.block.answered":"Answered","chat.block.answeredWith":"Answered: {answer}"},e={"chat.block.required":"{label}\uFF08\u5FC5\u586B\uFF09","chat.block.requiredMissing":"\u8BF7\u586B\u5199\u5FC5\u586B\u9879\u540E\u518D\u63D0\u4EA4\u3002","chat.block.answerMissing":"\u8BF7\u5148\u56DE\u7B54\u95EE\u9898\u518D\u63D0\u4EA4\u3002","chat.block.empty":"\u2014","chat.block.tierLow":"\u4F4E\u98CE\u9669","chat.block.tierSensitive":"\u654F\u611F","chat.block.undoCompareAndSet":"\u64A4\u9500\u4F1A\u6062\u590D\u539F\u6765\u7684\u503C","chat.block.undoArchiveCreated":"\u64A4\u9500\u4F1A\u5F52\u6863\u5DF2\u521B\u5EFA\u7684\u5185\u5BB9","chat.block.undoInverse":"\u64A4\u9500\u4F1A\u6267\u884C\u53CD\u5411\u6B65\u9AA4","chat.block.status":"\u72B6\u6001\uFF1A{status}","chat.block.outcomeDone":"\u5DF2\u5B8C\u6210","chat.block.outcomeFailed":"\u5931\u8D25","chat.block.retryable":"\u53EF\u4EE5\u91CD\u8BD5","chat.block.notRetryable":"\u65E0\u6CD5\u91CD\u8BD5","chat.block.state.proposed":"\u5DF2\u63D0\u8BAE","chat.block.state.awaiting-confirmation":"\u7B49\u5F85\u786E\u8BA4","chat.block.state.running":"\u8FD0\u884C\u4E2D","chat.block.state.undoing":"\u6B63\u5728\u64A4\u9500","chat.block.state.completed":"\u5DF2\u5B8C\u6210","chat.block.state.submitted":"\u5DF2\u63D0\u4EA4","chat.block.state.undone":"\u5DF2\u64A4\u9500","chat.block.state.needs-attention":"\u9700\u8981\u5904\u7406","chat.block.state.cancelled":"\u5DF2\u53D6\u6D88","chat.block.run":"\u8FD0\u884C","chat.block.runMissing":"\u8BF7\u5148\u586B\u5199\u5FC5\u586B\u5B57\u6BB5\u518D\u8FD0\u884C\u3002","chat.block.favourite":"\u6536\u85CF\uFF1A{title}","chat.block.flowLoading":"\u6B63\u5728\u52A0\u8F7D\u8BF7\u6C42\u2026\u2026","chat.block.flowsLoading":"\u6B63\u5728\u52A0\u8F7D\u5DF2\u4FDD\u5B58\u7684\u8BF7\u6C42\u2026\u2026","chat.block.flowsEmpty":"\u8FD9\u91CC\u8FD8\u6CA1\u6709\u5DF2\u4FDD\u5B58\u7684\u8BF7\u6C42\u3002","chat.block.answered":"\u5DF2\u56DE\u7B54","chat.block.answeredWith":"\u5DF2\u56DE\u7B54\uFF1A{answer}"};export{t as a,e as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkUYR3UEIWcjs = require('./chunk-UYR3UEIW.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');function U({children:e,label:u,onRegenerate:w,disabled:y,reason:d,slots:h,wrapper:c}){let r=_react.useId.call(void 0, ),S=_chunkUYR3UEIWcjs.x.call(void 0, ),[N,p]=_react.useState.call(void 0, !1),[f,P]=_react.useState.call(void 0, !1),x=_react.useRef.call(void 0, !1),l=_react.useRef.call(void 0, !1),m=_react.useRef.call(void 0, !1),F=_react.useRef.call(void 0, null),v=_react.useRef.call(void 0, void 0),i=()=>{clearTimeout(v.current),v.current=void 0};return _react.useEffect.call(void 0, ()=>i,[]),_jsxruntime.jsxs.call(void 0, "div",{ref:c,className:"wp-field-parent",style:{colorScheme:S},onClickCapture:b=>{let n=!!F.current&&_chunkUYR3UEIWcjs.b.call(void 0, F.current,b.target);n&&(m.current=!0),_chunkUYR3UEIWcjs.m.call(void 0, b,b.currentTarget,()=>{n&&(m.current=!1,!l.current&&!x.current&&(i(),p(!1)))})},onPointerEnter:()=>{x.current=!0,i(),p(!0)},onPointerLeave:()=>{x.current=!1,i(),v.current=setTimeout(()=>{!l.current&&!m.current&&p(!1)},400)},onFocus:()=>{l.current=!0,m.current=!1,i(),p(!0),P(!0)},onBlur:b=>{_chunkUYR3UEIWcjs.b.call(void 0, b.currentTarget,b.relatedTarget)||(l.current=!1,P(!1),!x.current&&!m.current&&(i(),p(!1)))},children:[e,_jsxruntime.jsxs.call(void 0, "span",{ref:F,className:"wp-field-adornment",hidden:!N,children:[_jsxruntime.jsx.call(void 0, _chunkUYR3UEIWcjs.J,{name:"fieldAdornment",slots:h,label:u,onPress:d?void 0:w,disabled:y,"aria-disabled":d?!0:void 0,describedBy:d?r:void 0,children:_jsxruntime.jsx.call(void 0, "button",{type:"button","aria-label":u,disabled:y,"aria-disabled":d?!0:void 0,"aria-describedby":d?r:void 0,onClick:()=>{d||w()},children:u})}),d?_jsxruntime.jsx.call(void 0, "span",{id:r,className:"wp-sr-only",children:d}):null]}),_jsxruntime.jsx.call(void 0, "span",{role:"status",className:"wp-sr-only",children:N&&f?u:""})]})}var W=_chunkUYR3UEIWcjs.u.call(void 0, ()=>Promise.resolve().then(() => _interopRequireWildcard(require("./form-extras-QYE32TUY.cjs"))));function _(){let e=_chunkUYR3UEIWcjs.v.call(void 0, W);return _react.useEffect.call(void 0, ()=>W.request(),[]),e}var oe=e=>{let u=e.trim()===""?NaN:Number(e);return Number.isFinite(u)?u:void 0};function se(e){return _react.useSyncExternalStore.call(void 0, e.subscribe,e.getSnapshot,e.getSnapshot)}function Fe({session:e,onRegenerate:u,slots:w,renderField:y}){let d=se(e),{fields:h,pending:c}=d,{format:r,primitives:S}=_chunkUYR3UEIWcjs.y.call(void 0, ),N=_react.useId.call(void 0, ),p=_(),f=p.status==="ready"?p.module:void 0,P=S.input,x=S.checkbox,l=Object.values(h).some(n=>n.localInvalid),[m,F]=_react.useState.call(void 0, ""),v=_react.useRef.call(void 0, new Map),i=_react.useRef.call(void 0, ""),b=_chunkUYR3UEIWcjs.e.call(void 0, ()=>[_optionalChain([v, 'access', _2 => _2.current, 'access', _3 => _3.get, 'call', _4 => _4(i.current), 'optionalAccess', _5 => _5.querySelector, 'call', _6 => _6("input,textarea,select,button,[tabindex]")])]);return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[Object.entries(h).map(([n,o],M)=>{let T=`${N}-${M}`,k=_optionalChain([o, 'access', _7 => _7.validation, 'optionalAccess', _8 => _8.status])==="invalid"||!!o.localInvalid,g=o.value,A={label:o.label,invalid:k,describedBy:T};return _jsxruntime.jsxs.call(void 0, U,{reason:f?l?r("form.fixFirst"):c?r("form.revertWait"):void 0:r(p.status==="failed"?"form.toolsFailed":"form.toolsLoading"),label:r("form.regenerate",{field:o.label}),slots:w,onRegenerate:()=>u(n),wrapper:a=>v.current.set(n,a),children:[y?y({name:n,label:o.label,value:g,onChange:a=>e.edit(n,a),invalid:k,describedBy:T}):typeof g=="string"?_jsxruntime.jsx.call(void 0, P,{...A,value:g,onChange:a=>e.edit(n,a)}):typeof g=="number"?_jsxruntime.jsx.call(void 0, P,{...A,type:"number",value:_nullishCoalesce(o.localText, () => (String(g))),onChange:a=>{let s=oe(a);s===void 0?e.markEdited(n,a):e.edit(n,s)}}):typeof g=="boolean"?_jsxruntime.jsx.call(void 0, x,{...A,checked:g,onChange:a=>e.edit(n,a)}):_jsxruntime.jsxs.call(void 0, "div",{children:[o.label,": ",f?_jsxruntime.jsx.call(void 0, f.Value,{value:g,t:r}):null," ",r("form.editInForm")]}),_jsxruntime.jsxs.call(void 0, "div",{id:T,className:k?"wp-invalid":void 0,children:[k?_jsxruntime.jsx.call(void 0, "strong",{children:r("form.invalid")}):null,o.localInvalid?_jsxruntime.jsx.call(void 0, "p",{children:r("form.number")}):null,_optionalChain([o, 'access', _9 => _9.validation, 'optionalAccess', _10 => _10.messages, 'access', _11 => _11.map, 'call', _12 => _12((a,s)=>_jsxruntime.jsx.call(void 0, "p",{children:a},s))]),_optionalChain([o, 'access', _13 => _13.validation, 'optionalAccess', _14 => _14.guidance])&&_jsxruntime.jsx.call(void 0, "p",{children:o.validation.guidance})]}),_jsxruntime.jsx.call(void 0, "div",{onFocus:a=>{i.current=n,b(a)},children:o.replacement&&f?_jsxruntime.jsx.call(void 0, f.Suggestion,{name:n,draft:o,session:e,t:r,primitives:S,onReplace:()=>F(f.attentionText(e.getSnapshot(),r))}):null})]},n)}),f?_jsxruntime.jsx.call(void 0, f.FieldsStatus,{text:m}):null]})}function ye({session:e,open:u,onClose:w,field:y,source:d,attachments:h}){let{format:c,primitives:r}=_chunkUYR3UEIWcjs.y.call(void 0, ),[S,N]=_react.useState.call(void 0, ""),[p,f]=_react.useState.call(void 0, ""),[P,x]=_react.useState.call(void 0, ""),l=_(),m=l.status==="ready"?l.module:void 0,F=_react.useRef.call(void 0, null),v=_react.useRef.call(void 0, 0),i=_react.useRef.call(void 0, void 0),b=r.button,n=r.drawer,o=r.textarea,M=_chunkUYR3UEIWcjs.n.call(void 0, ),T=_react.useId.call(void 0, );_react.useEffect.call(void 0, ()=>(v.current++,()=>{v.current++,e.cancel()}),[u,e,y]);let k=()=>{v.current++,e.cancel(),w()},g=s=>s.some(E=>E.type.startsWith("image/"))?(i.current?i.current([...s]):x(c(h?"form.imagesNow":"form.imagesHere")),!0):!1,A=_chunkUYR3UEIWcjs.e.call(void 0, ()=>[_optionalChain([F, 'access', _15 => _15.current, 'optionalAccess', _16 => _16.querySelector, 'call', _17 => _17("textarea")])]),a=_chunkUYR3UEIWcjs.x.call(void 0, );return _jsxruntime.jsxs.call(void 0, _chunkUYR3UEIWcjs.k,{as:n,open:u,label:c("form.title"),onClose:k,closeLabel:c("chat.close"),...M,children:[_jsxruntime.jsxs.call(void 0, "div",{ref:F,style:{colorScheme:a},onPasteCapture:s=>{g(Array.from(s.clipboardData.files))&&h&&i.current&&s.preventDefault()},onDragOver:s=>{s.dataTransfer.types.includes("Files")&&s.preventDefault()},onDrop:s=>{if(!s.dataTransfer.files.length)return;s.preventDefault();let E=Array.from(s.dataTransfer.files);g(E)||_optionalChain([i, 'access', _18 => _18.current, 'optionalCall', _19 => _19(E)])},children:[_jsxruntime.jsx.call(void 0, "p",{children:c("chat.message")}),_jsxruntime.jsx.call(void 0, o,{label:c("chat.message"),value:S,onChange:N}),_jsxruntime.jsx.call(void 0, "p",{children:c("form.references")}),_jsxruntime.jsx.call(void 0, o,{label:c("form.references"),value:p,onChange:f})]}),m?null:_jsxruntime.jsx.call(void 0, "p",{role:"status",children:P}),m?_jsxruntime.jsx.call(void 0, m.PopupBody,{session:e,open:u,field:y,source:d,attachments:h,text:S,references:p,scope:v,upload:i,messageField:()=>_nullishCoalesce(_optionalChain([F, 'access', _20 => _20.current, 'optionalAccess', _21 => _21.querySelector, 'call', _22 => _22("textarea")]), () => (null))}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[l.status==="failed"||l.status==="loading"&&l.retrying?_jsxruntime.jsx.call(void 0, _chunkUYR3UEIWcjs.H,{retrying:l.status==="loading",onRetry:()=>W.request(!0),onFocus:A}):null,_jsxruntime.jsx.call(void 0, b,{"aria-disabled":!0,"aria-describedby":T,children:c("form.generate")}),_jsxruntime.jsx.call(void 0, "span",{id:T,children:c(l.status==="failed"?"form.toolsFailed":"form.toolsLoading")})]})]})}exports.a = U; exports.b = se; exports.c = Fe; exports.d = ye;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var K=["1.1","1.0"],J= exports.b =["plans","flows","widgets","step-up","scheduled","form-fill","plan-recovery","plan-leave","plan-keep","reply-stop"];function W(e){return e.filter(a=>a!=="plan-leave"&&a!=="plan-keep"||e.includes("plan-recovery"))}function F(e,a=[],s){let o=K.find(c=>e.includes(c));if(!o)throw new Error("update-required");return{protocol:o,capabilities:W(J.filter(c=>a.includes(c)&&(!s||s.capabilities.includes(c))&&(c!=="form-fill"||o==="1.1")))}}function H(e){return{text:e.fallback,disabled:!0,update:!0}}var $={client:[],conversation:["client"],stream:["conversation"],connection:["stream"],recovery:["stream"],"plan-read":["conversation","connection"],"flow-load":["client"],"flow-run":["client"],binding:["client"],runner:["conversation","external"],invocation:["runner"]},U=new WeakMap;function q(e,a){if(a){let y=$[e],n=_nullishCoalesce(U.get(a), () => ("external"));if(!y.includes(n))throw new Error(`A ${e} scope cannot have this parent`)}else if(e!=="client"&&e!=="runner")throw new Error(`A ${e} scope needs a parent`);let s=globalThis,o=new s.AbortController,c=_optionalChain([s, 'access', _ => _.AbortSignal, 'optionalAccess', _2 => _2.any]),p=(y,n,f=()=>o.abort())=>(U.set(y,e),{signal:y,abort:f,end:n});if(!a)return p(o.signal,()=>{});if(c)return p(c.call(s.AbortSignal,[a,o.signal]),()=>{});let b=()=>o.abort();a.aborted?o.abort():a.addEventListener("abort",b,{once:!0});let m=()=>a.removeEventListener("abort",b);return p(o.signal,m,()=>{m(),o.abort()})}function A(e,a){return e.aborted?(a(),()=>{}):(e.addEventListener("abort",a,{once:!0}),()=>e.removeEventListener("abort",a))}var k=class extends Error{constructor(){super("plan-read-refused"),this.name="PlanReadRefused"}},L=e=>e instanceof k?"plan-changed":"connection-lost";function j(e,a){return{proposed:["awaiting-confirmation","cancelled"],"awaiting-confirmation":["running","submitted","cancelled"],running:["undoing","completed","needs-attention"],undoing:["undone","needs-attention"],completed:["undoing"],submitted:[],undone:[],"needs-attention":["running","undoing"],cancelled:[]}[e].includes(a)}var C=new Error("retired");function z(e){let a=null,s=new Set,o,c=q("runner",e.signal),p=!1,b,m=async(n,f)=>{if(f.signal.aborted)throw C;let t=await e.read(n);return f.signal.aborted||_optionalChain([e, 'access', _3 => _3.onRecord, 'optionalCall', _4 => _4(t)]),t},y=async(n,f,t)=>{let r;try{r=await m(n,t)}catch(i){throw i!==C&&!t.signal.aborted&&t.acceptance&&e.interrupted&&await e.interrupted(n,L(i)),i}if(t.signal.aborted)return;if(r.recovery&&(_optionalChain([t, 'access', _5 => _5.acceptance, 'optionalAccess', _6 => _6.planId])!==n||t.acceptance.executionId!==r.recovery.executionId))throw new Error("unauthorized-run");if(r.plan.kind!=="immediate"||r.plan.stage!=="final"||r.state!=="running")return;if(!f||r.plan.digest!==f)throw new Error("invalid-plan");let u={...r.plan,steps:r.plan.steps.map(i=>({...i,request:i.request?{...i.request,headers:{...i.request.headers}}:void 0}))},S=u.steps,O=S.filter(i=>i.undo==="none");if(O.length>1||O.length===1&&_optionalChain([S, 'access', _7 => _7.at, 'call', _8 => _8(-1), 'optionalAccess', _9 => _9.undo])!=="none"||S.some(i=>!i.request||!["POST","PUT","PATCH"].includes(i.request.method)))throw new Error("invalid-plan");let x,R=!1,E=()=>{R=!0,x!==void 0&&_optionalChain([e, 'access', _10 => _10.clock, 'optionalAccess', _11 => _11.clearTimeout, 'call', _12 => _12(x)]),x=void 0},N=A(t.signal,E),l=async i=>{E(),t.context&&delete t.context.stepUpCode,!t.signal.aborted&&(i&&e.interrupted&&await e.interrupted(n,i),t.signal.aborted||await m(n,t).catch(()=>{}))},v=async()=>{try{return await m(n,t)}catch(i){throw i!==C&&await l(L(i)),i}},T=async()=>{if(!(R||t.signal.aborted)){try{await e.heartbeat(n,t.acceptance)}catch (e2){t.signal.aborted||(p=!0)}!R&&!t.signal.aborted&&e.clock&&(x=e.clock.setTimeout(()=>{x=void 0,T()},_nullishCoalesce(e.heartbeatMs, () => (1e4))))}};await T();try{for(let[i,g]of S.entries()){if(t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();if(r=await v(),t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();if(r.state!=="running")return;if(r.outcomes.some(d=>d.stepId===g.id&&d.attributed&&d.status>=200&&d.status<300))continue;let P=r.plan;if(P.kind!=="immediate"||P.stage!=="final"||P.digest!==u.digest||JSON.stringify(_optionalChain([P, 'access', _13 => _13.steps, 'access', _14 => _14[i], 'optionalAccess', _15 => _15.request]))!==JSON.stringify(g.request))throw await l("plan-changed"),new Error("invalid-plan");let h=g.request,w={signal:t.signal,planId:n,stepId:g.id,headers:{...h.headers,"Waypoint-Step":`${n}.${i}`,...t.acceptance?{"Waypoint-Execution":t.acceptance.executionId,"Waypoint-Fence":String(t.acceptance.fence)}:{}}};if(g.stepUp){let d=await _optionalChain([e, 'access', _16 => _16.stepUp, 'optionalCall', _17 => _17(n,g.id)]);if(!d)return l("step-up-failed");if(t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();if(r=await v(),r.state!=="running")return;if(r.plan.kind!=="immediate"||r.plan.stage!=="final"||r.plan.digest!==u.digest||JSON.stringify(_optionalChain([r, 'access', _18 => _18.plan, 'access', _19 => _19.steps, 'access', _20 => _20[i], 'optionalAccess', _21 => _21.request]))!==JSON.stringify(h))throw await l("plan-changed"),new Error("invalid-plan");if(r.outcomes.some(I=>I.stepId===g.id&&I.attributed&&I.status>=200&&I.status<300))continue;w.stepUpCode=d}if(t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();try{t.context=w,await e.request({...h,headers:{...h.headers}},w)}catch (e3){return delete w.stepUpCode,t.context===w&&(t.context=void 0),l("step-failed")}finally{delete w.stepUpCode,t.context===w&&(t.context=void 0)}if(r=await v(),!r.outcomes.some(d=>d.stepId===g.id&&d.attributed&&d.status>=200&&d.status<300))return l("attribution-missing");if(s.has(n))return l()}}finally{E(),N()}};return{run(n,f,t){if(a)return o===n?a:Promise.reject(new Error("active-plan"));if(s.has(n)||c.signal.aborted)return Promise.resolve();o=n,p=!1;let r=q("invocation",c.signal),u={scope:r,signal:r.signal,...t?{acceptance:t}:{}};return A(u.signal,()=>{u.context&&delete u.context.stepUpCode}),b=u,a=y(n,f,u).catch(S=>{if(S!==C)throw S}).finally(()=>{r.end(),b===u&&(b=void 0),a=null,o=void 0}),a},stop(n=o){n&&s.add(n)},interrupt(){_optionalChain([b, 'optionalAccess', _22 => _22.scope, 'access', _23 => _23.abort, 'call', _24 => _24()])},dispose(){c.abort()}}}exports.a = K; exports.b = J; exports.c = W; exports.d = F; exports.e = H; exports.f = q; exports.g = A; exports.h = k; exports.i = j; exports.j = z;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var W=function(e,t){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},W(e,t)};function w(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");W(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var c=function(){return c=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},c.apply(this,arguments)};function ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function V(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}function j(e,t){var n=t&&t.cache?t.cache:Ge,r=t&&t.serializer?t.serializer:Re,i=t&&t.strategy?t.strategy:Le;return i(e,{cache:n,serializer:r})}function Ie(e){return e==null||typeof e=="number"||typeof e=="boolean"}function se(e,t,n,r){var i=Ie(r)?r:n(r),o=t.get(i);return typeof o>"u"&&(o=e.call(this,r),t.set(i,o)),o}function he(e,t,n){var r=Array.prototype.slice.call(arguments,3),i=n(r),o=t.get(i);return typeof o>"u"&&(o=e.apply(this,r),t.set(i,o)),o}function z(e,t,n,r,i){return n.bind(t,e,r,i)}function Le(e,t){var n=e.length===1?se:he;return z(e,this,n,t.cache.create(),t.serializer)}function Oe(e,t){return z(e,this,he,t.cache.create(),t.serializer)}function Ce(e,t){return z(e,this,se,t.cache.create(),t.serializer)}var Re=function(){return JSON.stringify(arguments)},Me=(function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(t){return this.cache[t]},e.prototype.set=function(t,n){this.cache[t]=n},e})(),Ge={create:function(){return new Me}},X={variadic:Oe,monadic:Ce};var l;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(l||(l={}));var b;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(b||(b={}));var T;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(T||(T={}));function Z(e){return e.type===b.literal}function Y(e){return e.type===b.argument}function N(e){return e.type===b.number}function I(e){return e.type===b.date}function L(e){return e.type===b.time}function O(e){return e.type===b.select}function C(e){return e.type===b.plural}function ue(e){return e.type===b.pound}function R(e){return e.type===b.tag}function k(e){return!!(e&&typeof e=="object"&&e.type===T.number)}function M(e){return!!(e&&typeof e=="object"&&e.type===T.dateTime)}var J=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;var De=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function fe(e){var t={};return e.replace(De,function(n){var r=n.length;switch(n[0]){case"G":t.era=r===4?"long":r===5?"narrow":"short";break;case"y":t.year=r===2?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=r===4?"long":r===5?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}var le=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function xe(e){if(e.length===0)throw new Error("Number skeleton cannot be empty");for(var t=e.split(le).filter(function(f){return f.length>0}),n=[],r=0,i=t;r<i.length;r++){var o=i[r],a=o.split("/");if(a.length===0)throw new Error("Invalid number skeleton");for(var h=a[0],x=a.slice(1),u=0,s=x;u<s.length;u++){var m=s[u];if(m.length===0)throw new Error("Invalid number skeleton")}n.push({stem:h,options:x})}return n}function Ue(e){return e.replace(/^(.*?)-/,"")}var ce=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,be=/^(@+)?(\+|#+)?[rs]?$/g,Fe=/(\*)(0+)|(#+)(0+)|(0+)/g,Ee=/^(0+)$/;function pe(e){var t={};return e[e.length-1]==="r"?t.roundingPriority="morePrecision":e[e.length-1]==="s"&&(t.roundingPriority="lessPrecision"),e.replace(be,function(n,r,i){return typeof i!="string"?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):i==="+"?t.minimumSignificantDigits=r.length:r[0]==="#"?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+(typeof i=="string"?i.length:0)),""}),t}function ye(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Ve(e){var t;if(e[0]==="E"&&e[1]==="E"?(t={notation:"engineering"},e=e.slice(2)):e[0]==="E"&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if(n==="+!"?(t.signDisplay="always",e=e.slice(2)):n==="+?"&&(t.signDisplay="exceptZero",e=e.slice(2)),!Ee.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function me(e){var t={},n=ye(e);return n||t}function ve(e){for(var t={},n=0,r=e;n<r.length;n++){var i=r[n];switch(i.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=i.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=Ue(i.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=c(c(c({},t),{notation:"scientific"}),i.options.reduce(function(x,u){return c(c({},x),me(u))},{}));continue;case"engineering":t=c(c(c({},t),{notation:"engineering"}),i.options.reduce(function(x,u){return c(c({},x),me(u))},{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(i.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(i.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(Fe,function(x,u,s,m,f,E){if(u)t.minimumIntegerDigits=s.length;else{if(m&&f)throw new Error("We currently do not support maximum integer digits");if(E)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Ee.test(i.stem)){t.minimumIntegerDigits=i.stem.length;continue}if(ce.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(ce,function(x,u,s,m,f,E){return s==="*"?t.minimumFractionDigits=u.length:m&&m[0]==="#"?t.maximumFractionDigits=m.length:f&&E?(t.minimumFractionDigits=f.length,t.maximumFractionDigits=f.length+E.length):(t.minimumFractionDigits=u.length,t.maximumFractionDigits=u.length),""});var o=i.options[0];o==="w"?t=c(c({},t),{trailingZeroDisplay:"stripIfInteger"}):o&&(t=c(c({},t),pe(o)));continue}if(be.test(i.stem)){t=c(c({},t),pe(i.stem));continue}var a=ye(i.stem);a&&(t=c(c({},t),a));var h=Ve(i.stem);h&&(t=c(c({},t),h))}return t}var G={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function ge(e,t){for(var n="",r=0;r<e.length;r++){var i=e.charAt(r);if(i==="j"){for(var o=0;r+1<e.length&&e.charAt(r+1)===i;)o++,r++;var a=1+(o&1),h=o<2?1:3+(o>>1),x="a",u=je(t);for((u=="H"||u=="k")&&(h=0);h-- >0;)n+=x;for(;a-- >0;)n=u+n}else i==="J"?n+="H":n+=i}return n}function je(e){var t=e.hourCycle;if(t===void 0&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=e.language,r;n!=="root"&&(r=e.maximize().region);var i=G[r||""]||G[n||""]||G["".concat(n,"-001")]||G["001"];return i[0]}var Q,Xe=new RegExp("^".concat(J.source,"*")),ke=new RegExp("".concat(J.source,"*$"));function p(e,t){return{start:e,end:t}}var We=!!String.prototype.startsWith&&"_a".startsWith("a",1),ze=!!String.fromCodePoint,Ze=!!Object.fromEntries,Ye=!!String.prototype.codePointAt,Je=!!String.prototype.trimStart,Qe=!!String.prototype.trimEnd,qe=!!Number.isSafeInteger,$e=qe?Number.isSafeInteger:function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},$=!0;try{de=Se("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),$=((Q=de.exec("a"))===null||Q===void 0?void 0:Q[0])==="a"}catch (e2){$=!1}var de,_e=We?function(t,n,r){return t.startsWith(n,r)}:function(t,n,r){return t.slice(r,r+n.length)===n},K=ze?String.fromCodePoint:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r="",i=t.length,o=0,a;i>o;){if(a=t[o++],a>1114111)throw RangeError(a+" is not a valid code point");r+=a<65536?String.fromCharCode(a):String.fromCharCode(((a-=65536)>>10)+55296,a%1024+56320)}return r},He=Ze?Object.fromEntries:function(t){for(var n={},r=0,i=t;r<i.length;r++){var o=i[r],a=o[0],h=o[1];n[a]=h}return n},Te=Ye?function(t,n){return t.codePointAt(n)}:function(t,n){var r=t.length;if(!(n<0||n>=r)){var i=t.charCodeAt(n),o;return i<55296||i>56319||n+1===r||(o=t.charCodeAt(n+1))<56320||o>57343?i:(i-55296<<10)+(o-56320)+65536}},Ke=Je?function(t){return t.trimStart()}:function(t){return t.replace(Xe,"")},et=Qe?function(t){return t.trimEnd()}:function(t){return t.replace(ke,"")};function Se(e,t){return new RegExp(e,t)}var ee;$?(q=Se("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu"),ee=function(t,n){var r;q.lastIndex=n;var i=q.exec(t);return(r=i[1])!==null&&r!==void 0?r:""}):ee=function(t,n){for(var r=[];;){var i=Te(t,n);if(i===void 0||Ae(i)||nt(i))break;r.push(i),n+=i>=65536?2:1}return K.apply(void 0,r)};var q,Be=(function(){function e(t,n){n===void 0&&(n={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return e.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(t,n,r){for(var i=[];!this.isEOF();){var o=this.char();if(o===123){var a=this.parseArgument(t,r);if(a.err)return a;i.push(a.val)}else{if(o===125&&t>0)break;if(o===35&&(n==="plural"||n==="selectordinal")){var h=this.clonePosition();this.bump(),i.push({type:b.pound,location:p(h,this.clonePosition())})}else if(o===60&&!this.ignoreTag&&this.peek()===47){if(r)break;return this.error(l.UNMATCHED_CLOSING_TAG,p(this.clonePosition(),this.clonePosition()))}else if(o===60&&!this.ignoreTag&&te(this.peek()||0)){var a=this.parseTag(t,n);if(a.err)return a;i.push(a.val)}else{var a=this.parseLiteral(t,n);if(a.err)return a;i.push(a.val)}}}return{val:i,err:null}},e.prototype.parseTag=function(t,n){var r=this.clonePosition();this.bump();var i=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:b.literal,value:"<".concat(i,"/>"),location:p(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(t+1,n,!0);if(o.err)return o;var a=o.val,h=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!te(this.char()))return this.error(l.INVALID_TAG,p(h,this.clonePosition()));var x=this.clonePosition(),u=this.parseTagName();return i!==u?this.error(l.UNMATCHED_CLOSING_TAG,p(x,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:b.tag,value:i,children:a,location:p(r,this.clonePosition())},err:null}:this.error(l.INVALID_TAG,p(h,this.clonePosition())))}else return this.error(l.UNCLOSED_TAG,p(r,this.clonePosition()))}else return this.error(l.INVALID_TAG,p(r,this.clonePosition()))},e.prototype.parseTagName=function(){var t=this.offset();for(this.bump();!this.isEOF()&&rt(this.char());)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(t,n){for(var r=this.clonePosition(),i="";;){var o=this.tryParseQuote(n);if(o){i+=o;continue}var a=this.tryParseUnquoted(t,n);if(a){i+=a;continue}var h=this.tryParseLeftAngleBracket();if(h){i+=h;continue}break}var x=p(r,this.clonePosition());return{val:{type:b.literal,value:i,location:x},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!tt(this.peek()||0))?(this.bump(),"<"):null},e.prototype.tryParseQuote=function(t){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(t==="plural"||t==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(r===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(r);this.bump()}return K.apply(void 0,n)},e.prototype.tryParseUnquoted=function(t,n){if(this.isEOF())return null;var r=this.char();return r===60||r===123||r===35&&(n==="plural"||n==="selectordinal")||r===125&&t>0?null:(this.bump(),K(r))},e.prototype.parseArgument=function(t,n){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(r,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(l.EMPTY_ARGUMENT,p(r,this.clonePosition()));var i=this.parseIdentifierIfPossible().value;if(!i)return this.error(l.MALFORMED_ARGUMENT,p(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:b.argument,value:i,location:p(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(r,this.clonePosition())):this.parseArgumentOptions(t,n,i,r);default:return this.error(l.MALFORMED_ARGUMENT,p(r,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),n=this.offset(),r=ee(this.message,n),i=n+r.length;this.bumpTo(i);var o=this.clonePosition(),a=p(t,o);return{value:r,location:a}},e.prototype.parseArgumentOptions=function(t,n,r,i){var o,a=this.clonePosition(),h=this.parseIdentifierIfPossible().value,x=this.clonePosition();switch(h){case"":return this.error(l.EXPECT_ARGUMENT_TYPE,p(a,x));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var s=this.clonePosition(),m=this.parseSimpleArgStyleIfPossible();if(m.err)return m;var f=et(m.val);if(f.length===0)return this.error(l.EXPECT_ARGUMENT_STYLE,p(this.clonePosition(),this.clonePosition()));var E=p(s,this.clonePosition());u={style:f,styleLocation:E}}var v=this.tryParseArgumentClose(i);if(v.err)return v;var g=p(i,this.clonePosition());if(u&&_e(_optionalChain([u, 'optionalAccess', _2 => _2.style]),"::",0)){var _=Ke(u.style.slice(2));if(h==="number"){var m=this.parseNumberSkeletonFromString(_,u.styleLocation);return m.err?m:{val:{type:b.number,value:r,location:g,style:m.val},err:null}}else{if(_.length===0)return this.error(l.EXPECT_DATE_TIME_SKELETON,g);var A=_;this.locale&&(A=ge(_,this.locale));var f={type:T.dateTime,pattern:A,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?fe(A):{}},B=h==="date"?b.date:b.time;return{val:{type:B,value:r,location:g,style:f},err:null}}}return{val:{type:h==="number"?b.number:h==="date"?b.date:b.time,value:r,location:g,style:(o=_optionalChain([u, 'optionalAccess', _3 => _3.style]))!==null&&o!==void 0?o:null},err:null}}case"plural":case"selectordinal":case"select":{var d=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(l.EXPECT_SELECT_ARGUMENT_OPTIONS,p(d,c({},d)));this.bumpSpace();var P=this.parseIdentifierIfPossible(),H=0;if(h!=="select"&&P.value==="offset"){if(!this.bumpIf(":"))return this.error(l.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,p(this.clonePosition(),this.clonePosition()));this.bumpSpace();var m=this.tryParseDecimalInteger(l.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,l.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(m.err)return m;this.bumpSpace(),P=this.parseIdentifierIfPossible(),H=m.val}var F=this.tryParsePluralOrSelectOptions(t,h,n,P);if(F.err)return F;var v=this.tryParseArgumentClose(i);if(v.err)return v;var oe=p(i,this.clonePosition());return h==="select"?{val:{type:b.select,value:r,options:He(F.val),location:oe},err:null}:{val:{type:b.plural,value:r,options:He(F.val),offset:H,pluralType:h==="plural"?"cardinal":"ordinal",location:oe},err:null}}default:return this.error(l.INVALID_ARGUMENT_TYPE,p(a,x))}},e.prototype.tryParseArgumentClose=function(t){return this.isEOF()||this.char()!==125?this.error(l.EXPECT_ARGUMENT_CLOSING_BRACE,p(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,n=this.clonePosition();!this.isEOF();){var r=this.char();switch(r){case 39:{this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(l.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,p(i,this.clonePosition()));this.bump();break}case 123:{t+=1,this.bump();break}case 125:{if(t>0)t-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(t,n){var r=[];try{r=xe(t)}catch (e3){return this.error(l.INVALID_NUMBER_SKELETON,n)}return{val:{type:T.number,tokens:r,location:n,parsedOptions:this.shouldParseSkeletons?ve(r):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(t,n,r,i){for(var o,a=!1,h=[],x=new Set,u=i.value,s=i.location;;){if(u.length===0){var m=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var f=this.tryParseDecimalInteger(l.EXPECT_PLURAL_ARGUMENT_SELECTOR,l.INVALID_PLURAL_ARGUMENT_SELECTOR);if(f.err)return f;s=p(m,this.clonePosition()),u=this.message.slice(m.offset,this.offset())}else break}if(x.has(u))return this.error(n==="select"?l.DUPLICATE_SELECT_ARGUMENT_SELECTOR:l.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,s);u==="other"&&(a=!0),this.bumpSpace();var E=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?l.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:l.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,p(this.clonePosition(),this.clonePosition()));var v=this.parseMessage(t+1,n,r);if(v.err)return v;var g=this.tryParseArgumentClose(E);if(g.err)return g;h.push([u,{value:v.val,location:p(E,this.clonePosition())}]),x.add(u),this.bumpSpace(),o=this.parseIdentifierIfPossible(),u=o.value,s=o.location}return h.length===0?this.error(n==="select"?l.EXPECT_SELECT_ARGUMENT_SELECTOR:l.EXPECT_PLURAL_ARGUMENT_SELECTOR,p(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(l.MISSING_OTHER_CLAUSE,p(this.clonePosition(),this.clonePosition())):{val:h,err:null}},e.prototype.tryParseDecimalInteger=function(t,n){var r=1,i=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);for(var o=!1,a=0;!this.isEOF();){var h=this.char();if(h>=48&&h<=57)o=!0,a=a*10+(h-48),this.bump();else break}var x=p(i,this.clonePosition());return o?(a*=r,$e(a)?{val:a,err:null}:this.error(n,x)):this.error(t,x)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var n=Te(this.message,t);if(n===void 0)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return n},e.prototype.error=function(t,n){return{val:null,err:{kind:t,message:this.message,location:n}}},e.prototype.bump=function(){if(!this.isEOF()){var t=this.char();t===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},e.prototype.bumpIf=function(t){if(_e(this.message,t,this.offset())){for(var n=0;n<t.length;n++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(t){var n=this.offset(),r=this.message.indexOf(t,n);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var n=this.offset();if(n===t)break;if(n>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&Ae(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),n=this.offset(),r=this.message.charCodeAt(n+(t>=65536?2:1));return _nullishCoalesce(r, () => (null))},e})();function te(e){return e>=97&&e<=122||e>=65&&e<=90}function tt(e){return te(e)||e===47}function rt(e){return e===45||e===46||e>=48&&e<=57||e===95||e>=97&&e<=122||e>=65&&e<=90||e==183||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Ae(e){return e>=9&&e<=13||e===32||e===133||e>=8206&&e<=8207||e===8232||e===8233}function nt(e){return e>=33&&e<=35||e===36||e>=37&&e<=39||e===40||e===41||e===42||e===43||e===44||e===45||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||e===91||e===92||e===93||e===94||e===96||e===123||e===124||e===125||e===126||e===161||e>=162&&e<=165||e===166||e===167||e===169||e===171||e===172||e===174||e===176||e===177||e===182||e===187||e===191||e===215||e===247||e>=8208&&e<=8213||e>=8214&&e<=8215||e===8216||e===8217||e===8218||e>=8219&&e<=8220||e===8221||e===8222||e===8223||e>=8224&&e<=8231||e>=8240&&e<=8248||e===8249||e===8250||e>=8251&&e<=8254||e>=8257&&e<=8259||e===8260||e===8261||e===8262||e>=8263&&e<=8273||e===8274||e===8275||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||e===8608||e>=8609&&e<=8610||e===8611||e>=8612&&e<=8613||e===8614||e>=8615&&e<=8621||e===8622||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||e===8658||e===8659||e===8660||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||e===8968||e===8969||e===8970||e===8971||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||e===9001||e===9002||e>=9003&&e<=9083||e===9084||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||e===9655||e>=9656&&e<=9664||e===9665||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||e===9839||e>=9840&&e<=10087||e===10088||e===10089||e===10090||e===10091||e===10092||e===10093||e===10094||e===10095||e===10096||e===10097||e===10098||e===10099||e===10100||e===10101||e>=10132&&e<=10175||e>=10176&&e<=10180||e===10181||e===10182||e>=10183&&e<=10213||e===10214||e===10215||e===10216||e===10217||e===10218||e===10219||e===10220||e===10221||e===10222||e===10223||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||e===10627||e===10628||e===10629||e===10630||e===10631||e===10632||e===10633||e===10634||e===10635||e===10636||e===10637||e===10638||e===10639||e===10640||e===10641||e===10642||e===10643||e===10644||e===10645||e===10646||e===10647||e===10648||e>=10649&&e<=10711||e===10712||e===10713||e===10714||e===10715||e>=10716&&e<=10747||e===10748||e===10749||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||e===11158||e>=11159&&e<=11263||e>=11776&&e<=11777||e===11778||e===11779||e===11780||e===11781||e>=11782&&e<=11784||e===11785||e===11786||e===11787||e===11788||e===11789||e>=11790&&e<=11798||e===11799||e>=11800&&e<=11801||e===11802||e===11803||e===11804||e===11805||e>=11806&&e<=11807||e===11808||e===11809||e===11810||e===11811||e===11812||e===11813||e===11814||e===11815||e===11816||e===11817||e>=11818&&e<=11822||e===11823||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||e===11840||e===11841||e===11842||e>=11843&&e<=11855||e>=11856&&e<=11857||e===11858||e>=11859&&e<=11903||e>=12289&&e<=12291||e===12296||e===12297||e===12298||e===12299||e===12300||e===12301||e===12302||e===12303||e===12304||e===12305||e>=12306&&e<=12307||e===12308||e===12309||e===12310||e===12311||e===12312||e===12313||e===12314||e===12315||e===12316||e===12317||e>=12318&&e<=12319||e===12320||e===12336||e===64830||e===64831||e>=65093&&e<=65094}function re(e){e.forEach(function(t){if(delete t.location,O(t)||C(t))for(var n in t.options)delete t.options[n].location,re(t.options[n].value);else N(t)&&k(t.style)||(I(t)||L(t))&&M(t.style)?delete t.style.location:R(t)&&re(t.children)})}function Pe(e,t){t===void 0&&(t={}),t=c({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Be(e,t).parse();if(n.err){var r=SyntaxError(l[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return _optionalChain([t, 'optionalAccess', _4 => _4.captureLocation])||re(n.val),n.val}var S;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(S||(S={}));var D=(function(e){w(t,e);function t(n,r,i){var o=e.call(this,n)||this;return o.code=r,o.originalMessage=i,o}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error);var ne=(function(e){w(t,e);function t(n,r,i,o){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(i).join('", "'),'"'),S.INVALID_VALUE,o)||this}return t})(D);var we=(function(e){w(t,e);function t(n,r,i){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),S.INVALID_VALUE,i)||this}return t})(D);var Ne=(function(e){w(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),S.MISSING_VALUE,r)||this}return t})(D);var y;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(y||(y={}));function it(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==y.literal||n.type!==y.literal?t.push(n):r.value+=n.value,t},[])}function ot(e){return typeof e=="function"}function U(e,t,n,r,i,o,a){if(e.length===1&&Z(e[0]))return[{type:y.literal,value:e[0].value}];for(var h=[],x=0,u=e;x<u.length;x++){var s=u[x];if(Z(s)){h.push({type:y.literal,value:s.value});continue}if(ue(s)){typeof o=="number"&&h.push({type:y.literal,value:n.getNumberFormat(t).format(o)});continue}var m=s.value;if(!(i&&m in i))throw new Ne(m,a);var f=i[m];if(Y(s)){(!f||typeof f=="string"||typeof f=="number")&&(f=typeof f=="string"||typeof f=="number"?String(f):""),h.push({type:typeof f=="string"?y.literal:y.object,value:f});continue}if(I(s)){var E=typeof s.style=="string"?r.date[s.style]:M(s.style)?s.style.parsedOptions:void 0;h.push({type:y.literal,value:n.getDateTimeFormat(t,E).format(f)});continue}if(L(s)){var E=typeof s.style=="string"?r.time[s.style]:M(s.style)?s.style.parsedOptions:r.time.medium;h.push({type:y.literal,value:n.getDateTimeFormat(t,E).format(f)});continue}if(N(s)){var E=typeof s.style=="string"?r.number[s.style]:k(s.style)?s.style.parsedOptions:void 0;E&&E.scale&&(f=f*(E.scale||1)),h.push({type:y.literal,value:n.getNumberFormat(t,E).format(f)});continue}if(R(s)){var v=s.children,g=s.value,_=i[g];if(!ot(_))throw new we(g,"function",a);var A=U(v,t,n,r,i,o),B=_(A.map(function(H){return H.value}));Array.isArray(B)||(B=[B]),h.push.apply(h,B.map(function(H){return{type:typeof H=="string"?y.literal:y.object,value:H}}))}if(O(s)){var d=s.options[f]||s.options.other;if(!d)throw new ne(s.value,f,Object.keys(s.options),a);h.push.apply(h,U(d.value,t,n,r,i));continue}if(C(s)){var d=s.options["=".concat(f)];if(!d){if(!Intl.PluralRules)throw new D(`Intl.PluralRules is not available in this environment.
|
|
2
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3
|
+
`,S.MISSING_INTL_API,a);var P=n.getPluralRules(t,{type:s.pluralType}).select(f-(s.offset||0));d=s.options[P]||s.options.other}if(!d)throw new ne(s.value,f,Object.keys(s.options),a);h.push.apply(h,U(d.value,t,n,r,i,f-(s.offset||0)));continue}}return it(h)}function at(e,t){return t?c(c(c({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=c(c({},e[r]),t[r]||{}),n},{})):e}function st(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=at(e[r],t[r]),n},c({},e)):e}function ie(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function ht(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:j(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,V([void 0],n,!1)))},{cache:ie(e.number),strategy:X.variadic}),getDateTimeFormat:j(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,V([void 0],n,!1)))},{cache:ie(e.dateTime),strategy:X.variadic}),getPluralRules:j(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,V([void 0],n,!1)))},{cache:ie(e.pluralRules),strategy:X.variadic})}}var ut=(function(){function e(t,n,r,i){n===void 0&&(n=e.defaultLocale);var o=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var s=o.formatToParts(u);if(s.length===1)return s[0].value;var m=s.reduce(function(f,E){return!f.length||E.type!==y.literal||typeof f[f.length-1]!="string"?f.push(E.value):f[f.length-1]+=E.value,f},[]);return m.length<=1?m[0]||"":m},this.formatToParts=function(u){return U(o.ast,o.locales,o.formatters,o.formats,u,void 0,o.message)},this.resolvedOptions=function(){var u;return{locale:((u=o.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(o.locales)[0]}},this.getAst=function(){return o.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var a=i||{},h=a.formatters,x=ae(a,["formatters"]);this.ast=e.__parse(t,c(c({},x),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=st(e.formats,r),this.formatters=i&&i.formatters||ht(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Pe,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})();function ir(e,t){try{return Intl.getCanonicalLocales(e)[0]}catch (e4){return t?"zh-Hans":"en"}}exports.a = ut; exports.b = ir;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as A}from"./chunk-L4PFFRDE.js";var o=e=>`chat.recovery.${e}`,H=["alreadyClosedByWinner","alreadyKept","alreadyStoppedNeedsDecision","cancelStarted","cancelledNoChanges","capabilityMissing","currentStopped","initialTargetSettled","initialTargetStopped","intentSuperseded","keepReasonChanged","keptForwardClosed","leaveCompletedByKeep","leaveCoveredByKeep","leaveNeedsReview","leaveSafetyNeedsReview","leftKnown","leftUnconfirmed","planClosedKept","reviewTargetSettled","reviewTargetStopped","stopped","stoppedNoChanges","acknowledgmentAhead","cancelCoveredByLeaveSafety","cancelCoveredByStopNoChanges","cancelDefeatedByStop","choiceReplacedByStop","initialTargetClosed","keepDefeatedByWinner","leaveDefeatedByWinner","leaveNoDecision","leaveSafetyAlreadyStopped","reopenedEvidence"],X={...Object.fromEntries(H.map(e=>[e,o(e)])),alreadyClosed:o("alreadyClosedByWinner"),acknowledgmentStale:o("keepReasonChanged"),intentConflict:o("intentTargetChanged"),invalidTarget:o("intentTargetChanged"),intentUnavailable:o("keepReasonUnavailable"),keepBlockedActive:o("keepReasonActive"),keepBlockedUnknown:o("keepReasonUnknown"),keepBlockedReview:o("keepReasonPreview"),keepNoDecision:o("keepReasonNoSource"),planSealed:o("alreadyKept"),keptElsewhere:o("keptAlready")},x={...Object.fromEntries(["stopNotSent","stopNotSentElsewhere","stopUnconfirmed","leaveNotSent","leaveUnconfirmed","keepNotSent","keepUnconfirmed"].map(e=>[e,o(e)])),cancelInitialNotSent:o("cancelNotSent"),cancelInitialUnconfirmed:o("cancelUnconfirmed"),cancelReviewNotSent:o("reviewCancelNotSent"),cancelReviewUnconfirmed:o("reviewCancelUnconfirmed"),stopRefused:o("requestRefused"),cancelInitialRefused:o("requestRefused"),cancelReviewRefused:o("requestRefused"),leaveRefused:o("requestRefused"),keepRefused:o("requestRefused")},G=new Set(["leftUnconfirmed"]),J={leaveCompletedByKeep:o("leaveCompletedByKeep"),leaveCoveredByKeep:o("leaveCoveredByKeep"),keptElsewhere:o("keptAlready")};function z(e){let n=[],t=(r,c)=>{r&&!n.some(f=>f.key===r)&&n.push(c?{key:r,values:c}:{key:r})};for(let r of e.keys??[])t(X[r],G.has(r)&&typeof e.count=="number"?{count:e.count}:void 0);e.requestKey&&t(o(e.requestKey));let a=r=>{r!==void 0&&t(o(r?"requestedIntentApplied":"requestedIntentNotApplied"))};a(e.requestedTargetApplied);let i=e.savedDisposition;i&&t(o(i.phase==="left-known"?"leftKnown":"leftUnconfirmed"),i.phase==="left-known"?void 0:{count:i.count});let l=e.finalHistory;return l&&(l.relation&&t(J[l.relation]),l.keptFact?.keepEffect==="forward-closed"&&t(o("keptForwardClosed")),a(l.requestedTargetApplied),l.contradictedAfterSeal?.length&&t(o("laterReportAfterKeep"))),n}var Q={user:"winnerStopUser","connection-lost":"winnerStopConnection","renewal-refused":"winnerStopRenewal","step-failed":"winnerStopStep","step-up-failed":"winnerStopStepUp","identity-lost":"winnerStopIdentity","attribution-missing":"winnerStopAttribution","plan-changed":"winnerStopChanged","adapter-configuration":"winnerStopAdapter"},V={stop:4,"cancel-initial":3,"cancel-review":3,keep:2,leave:1},U={stop:"stop",decline:"cancel-initial",leave:"leave",keep:"keep"},O={stop:o("checkIntentStatus"),"cancel-initial":o("checkIntentStatus"),"cancel-review":o("checkIntentStatus"),leave:o("checkSavedChoice"),keep:o("checkKeepStatus")},Z={capabilityMissing:null,keepNoDecision:null,sealed:null,keepBlockedActive:o("keepReasonActive"),keepBlockedUnknown:o("keepReasonUnknown"),loading:o("actionLoading"),intentUnavailable:o("keepReasonUnavailable")},ee=new Set(["proposal","initial-review","cancelled"]),ne=new Set(["forward-active","readback","left-reopened","left-unconfirmed","completed","left-known"]),te=new Set(["forward-active","readback","left-reopened"]),ae=new Set(["readback","left-reopened"]),m=(e,n,t)=>t?{id:e,labelKey:n,available:!1,reasonKey:t}:{id:e,labelKey:n,available:!0};function oe(e,n){let t=T(e,n),a=t?[t]:[];return n.state==="running"&&a.push(m("stop","chat.stop")),a}function T(e,n){let t=A(n,e.conversationId);if(n.state!=="awaiting-confirmation"||!t)return;let i={...m("confirm",t.schedule?"chat.confirmation.schedule":"chat.confirmation.apply",e.now>=Date.parse(t.expiresAt)?"chat.confirmation.expired":void 0),countedLabelKey:t.schedule?"chat.confirmation.scheduleCount":"chat.confirmation.applyCount",labelValues:{count:t.items.length}};return t.schedule?{...i,schedule:!0}:i}function re(e,n){let a=n.recovery.phase,i=[],l=a==="initial-review"&&T(e,n);if(l&&i.push(l),(a==="proposal"||a==="initial-review"||a==="forward-active")&&i.push(m("stop","chat.stop")),(a==="proposal"||a==="initial-review")&&i.push(m("decline","chat.cancel")),te.has(a)&&i.push(m("leave",o("leave"),e.capabilities.includes("plan-leave")?void 0:o("capabilityMissing"))),ne.has(a)){let r=e.keepReview;if(!("disabled"in r))i.push(m("keep",o("keepChanges")));else{let c=Z[r.disabled];c&&i.push(m("keep",o("keepChanges"),c))}}if(ae.has(a))for(let r of["undoSelected","continue"])i.push(m(r,o(r),o("notAvailableYet")));return i}function D(e,n){if(!(n?.retryAt===void 0||n.lastProblem?.cause!=="rate-limited"||e.now>=n.retryAt))return{seconds:Math.ceil((n.retryAt-e.now)/1e3)}}function N(e,n,t){let a=n,i=D(e,t);if(t){let r=i?{id:"status",labelKey:O[t.kind],available:!1,reasonKey:o("retryAfterSeconds"),reasonValues:i}:{id:"status",labelKey:O[t.kind],available:!0,busy:t.delivery==="sending"},c=!1;a=a.map(f=>U[f.id]===t.kind?(c=!0,r):f),c||(a=[...a,r])}let l=[...t?[t.kind]:[],...e.pending].map(r=>V[r]);if(l.length){let r=Math.max(...l);a=a.map(c=>{if(c.id==="status")return c;let f=U[c.id],s=c.id==="confirm"?0:f?V[f]:void 0;if(s===void 0||s>r)return c;let d=f&&e.pending.includes(f);return{...c,available:!1,reasonKey:o("intentPendingReason"),...d?{busy:!0}:{}}})}return e.conversationUnavailable&&(a=a.map(r=>({...r,available:!1,reasonKey:o("refreshConversation")}))),a}function B(e,n){let t=e.recovery,a=t.steps??[],i=r=>a.filter(c=>c.truth===r).length,l=(r,c)=>c?{key:o(r),values:c}:{key:o(r)};if(t.sealed)return{label:l("keptKnown"),tone:"neutral",attention:!1};switch(t.phase){case"proposal":return{label:l("statusProposal"),tone:"neutral",attention:!1};case"initial-review":return{label:l("heading"),tone:"neutral",attention:!1};case"forward-active":return{label:l(n?.kind==="stop"?"stopping":"currentRunning"),tone:"progress",attention:!1};case"readback":case"left-reopened":return{label:l("heading"),tone:"warning",attention:!0};case"completed":return{label:l("statusCompleted"),tone:"success",attention:!1};case"cancelled":return{label:l(i("done")?"currentStopped":"cancelledNoChanges"),tone:"neutral",attention:!1};case"left-known":return{label:l("leftKnown"),tone:"neutral",attention:!1};case"left-unconfirmed":return{label:l("leftUnconfirmed",{count:i("unknown")}),tone:"warning",attention:!1}}}function W(e){let n=e.plan;if(!n)return null;let t=!!n.recovery&&e.capabilities.includes("plan-recovery");if(n.recovery&&(e.readOnly||!t||n.recovery.profile!=="plan-recovery-v1"||!B(n,void 0)))return{planId:n.id,status:{dataStatus:n.recovery.phase,wireState:n.state,label:{key:o("heading")},tone:"neutral",attention:!1},intent:null,steps:[],lines:[{key:o("updateToControl")},{key:`chat.block.state.${n.state}`}],notice:[],alert:null,actions:[],pending:[],conversationUnavailable:e.conversationUnavailable,readOnly:!0};let a=e.overlay&&e.overlay.planId===n.id?e.overlay:void 0,i=e.notice&&(e.notice.planId??n.id)===n.id?z(e.notice):[],l=e.alert,r=D(e,a),c=a?.lastProblem?.key,f=l&&a?{serial:l.serial,..."restoreFocus"in l?{restoreFocus:!0}:{action:l.action},...c&&x[c]?{message:{key:x[c]}}:{},retryAvailable:!r&&!e.conversationUnavailable,...e.conversationUnavailable?{retryReasonKey:o("refreshConversation")}:r?{retryReasonKey:o("retryAfterSeconds"),retryValues:r}:{}}:l&&"restoreFocus"in l?{serial:l.serial,restoreFocus:!0,retryAvailable:!0}:null;if(!t)return{planId:n.id,status:null,intent:null,steps:[],lines:[],notice:[],alert:null,actions:N({...e,pending:[]},oe(e,n),void 0),pending:[],conversationUnavailable:e.conversationUnavailable};let s=n.recovery,d=new Map(n.plan.kind==="immediate"?n.plan.steps.map((p,S)=>[p.id,{index:S+1,resource:p.resource}]):[]),w=new Set(s.contradictedAfterSeal??[]),h=s.phase==="forward-active",k=(s.steps??[]).map((p,S)=>({stepId:p.stepId,index:d.get(p.stepId)?.index??S+1,...d.get(p.stepId)?.resource!==void 0&&{resource:d.get(p.stepId).resource},truth:p.truth,textKey:o(p.truth==="done"?"done":p.truth==="not-done"?"notDone":h?"stepNotKnownYet":"unknown"),...s.sealed&&w.has(p.stepId)?{lateReport:"contradicted"}:{}})),y=[],v=k.filter(p=>p.truth==="unknown").length,K=k.filter(p=>p.truth==="not-done").length;!s.steps?.length&&!ee.has(s.phase)&&y.push({key:o("stepsNotKnownYet")});let b=!1;!s.sealed&&!h&&v&&(y.push({key:o("stepsUnknown"),values:{count:v}}),b=!0),!s.sealed&&s.phase==="completed"&&K&&(y.push({key:o("stepsNotDone"),values:{count:K}}),b=!0),s.sealed&&w.size&&(y.push({key:o("laterReportAfterKeep")}),b=!0);let u=s.winner;u?.kind==="stop"?(y.push({key:o(Q[u.cause])}),s.phase==="readback"&&y.push({key:o("stopped")})):u&&y.push({key:o(u.kind==="leave"?"winnerLeave":u.kind==="keep"?"winnerKeep":"winnerCancel")});let g=B(n,a);return{planId:n.id,status:{dataStatus:s.phase,wireState:n.state,label:g.label,tone:g.tone,attention:g.attention||b,...s.sealed?{result:"kept"}:{}},intent:a?{kind:a.kind,status:a.delivery}:null,steps:k,lines:y,notice:i,alert:f,actions:N(e,re(e,n),a),pending:e.pending,conversationUnavailable:e.conversationUnavailable}}function L(e,n){let t=e.review==="forward-only"?[{key:o("confirmKeepForwardOnly")},{key:o("keepRemainingSteps"),values:{count:e.remaining}}]:[{key:o("confirmEndRetention")}],a=n.conversationUnavailable?o("refreshConversation"):n.status?.result==="kept"?o("alreadyKept"):n.intent||n.pending.length?o("intentPendingReason"):void 0;return{messages:t,proceed:a?{available:!1,reasonKey:a}:{available:!0}}}import{createContext as se,useContext as ie,useSyncExternalStore as le}from"react";var ce=se(null);function R(e){let n=ie(ce),t=e??n;if(!t)throw new Error("A client is required");return t}function I(e){let n=R(e);return le(n.subscribe,n.getSnapshot,n.getSnapshot)}import{useCallback as _,useEffect as M,useState as P}from"react";function Ie(e){let n=R(e),t=I(n),a=t.plan,[i,l]=P([]),[r,c]=P(()=>Date.now()),[f,s]=P(null),d=a?.id;M(()=>{l([]),s(null)},[d]);let w=d?t.intentOverlays[d]:void 0,h=w?.retryAt;M(()=>{if(h===void 0)return;let u=h-Date.now();if(u<=0)return;let g=setTimeout(()=>c(Date.now()),u);return()=>clearTimeout(g)},[h]);let k=A(a,t.conversationId)?.expiresAt;M(()=>{if(!k)return;let u=Date.parse(k)-Date.now();if(!(u>0))return;let g=setTimeout(()=>c(Date.now()),u+1);return()=>clearTimeout(g)},[k]);let y=W({plan:a,capabilities:t.capabilities,conversationUnavailable:t.conversationUnavailable,overlay:w,notice:t.intentNotice,alert:t.intentAlert,keepReview:a?n.keepChangesReview(a.id):{disabled:"keepNoDecision"},pending:i,now:Math.max(r,Date.now()),conversationId:t.conversationId,readOnly:t.planReadOnly}),v=_((u,g)=>{l(p=>[...p,u]),g.finally(()=>l(p=>p.filter(S=>S!==u)))},[]),K=_(u=>{if(d)switch(u){case"confirm":n.confirmPlan();return;case"stop":{n.stopPlan(d);let g=n.getSnapshot();!g.planReadOnly&&!g.intentOverlays[d]&&v("stop",n.checkIntentStatus(d));return}case"decline":v("cancel-initial",n.declinePlan());return;case"leave":v("leave",n.leavePlan(d));return;case"keep":{let g=n.keepChangesReview(d);"disabled"in g||s(g);return}case"status":case"retry":n.checkIntentStatus(d);return}},[d,n,v]),b=f&&y?{...L(f,y),onProceed:()=>{let u=f;s(null),v("keep",n.keepChanges(u))},onCancel:()=>s(null)}:null;return{view:y,press:K,sheet:b}}import{useCallback as C,useSyncExternalStore as de}from"react";var q=new WeakMap,pe=e=>{let n=q.get(e);return n||q.set(e,n={cards:new Map,listeners:new Set}),n},F=(e,n,t)=>JSON.stringify([e,n,t]),E=new WeakMap,Y=e=>{E.delete(e.cards);for(let n of e.listeners)n()},ue=128,$=(e,n)=>{let t=n;for(let a=0;a<e.length;a++)t^=e.charCodeAt(a),t=Math.imul(t,16777619)>>>0;return t.toString(16).padStart(8,"0")},j=e=>$(e,2166136261)+$(e,731459039),fe=e=>JSON.stringify(e,(n,t)=>t&&typeof t=="object"&&!Array.isArray(t)?Object.fromEntries(Object.entries(t).sort(([a],[i])=>a<i?-1:1)):t),ye=e=>e.replace(/[^\w.~-]/g,n=>`%${(n.charCodeAt(0)+65536).toString(16).slice(1)}`);function ge(e,n,t,a){let i=`card:${[e,n,t].map(ye).join(":")}:${j(fe(a))}`;return i.length<=ue?i:`card~${j(i)}`}function Ee(e){let n=R(e),{conversationId:t}=I(n),a=pe(n),i=C(s=>(a.listeners.add(s),()=>a.listeners.delete(s)),[a]),l=C(()=>{let s=E.get(a.cards);s||E.set(a.cards,s=new Map);let d=s.get(t);return d||(d=new Set([...a.cards.values()].filter(w=>w.conversationId===t).map(w=>w.blockId)),s.set(t,d)),d},[a,t]),r=de(i,l,l),c=C((s,d,w="")=>{let h=F(t,w,s.id);if(a.cards.has(h))return Promise.resolve();let k={...d,blockId:typeof d.blockId=="string"?d.blockId:s.id,clientReplyId:ge(t,w,s.id,d)};a.cards.set(h,{conversationId:t,blockId:s.id}),Y(a);let y=()=>{a.cards.delete(h),Y(a)};return n.replyOutcome(k).then(v=>(v.accepted||y(),v),y)},[n,a,t]),f=C((s,d="")=>!!s.answered||a.cards.has(F(t,d,s.id)),[a,t,r]);return{answered:r,isAnswered:f,reply:c}}var we={"sign-in":"chat.problem.signIn",retryable:"chat.problem.retryable","rate-limited":"chat.problem.rateLimited",refused:"chat.problem.refused",closed:"chat.problem.closed",full:"chat.problem.full",declined:"chat.problem.declined",unavailable:"chat.problem.unavailable","step-up-cancelled":"chat.problem.stepUp","invalid-read":"chat.problem.invalid","invalid-plan":"chat.problem.invalid","plan-changed":"chat.planChanged","update-required":"chat.update",mismatch:"chat.problem.mismatch","agreement-expired":"chat.problem.agreement","in-doubt":"chat.problem.inDoubt",replaced:"chat.problem.replaced","needs-attention":"chat.problem.needsAttention",stopped:"chat.stopped"},ve=e=>e.code==="replaced"?"refresh":["retryable","rate-limited","unavailable","agreement-expired"].includes(e.code)?"retry":void 0;function Ve(e,n={}){let t=e.id==="conversation-read"&&(e.code==="unavailable"||e.code==="retryable"),a=e.id==="conversation-unavailable"?"chat.conversationUnavailable":t?"chat.conversationReadFailed":n.answeredElsewhere?"chat.problem.answered":we[e.code]??"chat.failure",i=ve(e);return{key:a,...i&&{action:i},code:e.code,id:e.id}}function Ue(e,n={}){if(e==="none")return{actions:[]};let t={id:"retry",labelKey:"chat.retry"};return{key:`reply.${e}`,actions:e==="overdue"?[{id:"keepWaiting",labelKey:"chat.reply.keepWaiting"},t]:e==="writing"?n.canStop?[{id:"stop",labelKey:"chat.reply.stop"}]:[]:n.canRetry===!1?[]:[t]}}export{z as a,W as b,L as c,ce as d,I as e,Ie as f,ge as g,Ee as h,ve as i,Ve as j,Ue as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={background:"#ffffff",foreground:"#18212f",muted:"#526071",accent:"#245ad1",border:"#ccd4df",surface:"#f2f5f9",danger:"#b42318",space:"0.75rem",radius:"0.5rem",fontSize:"1rem",fontFamily:"system-ui, sans-serif",shadow:"0 0.25rem 1rem #0002",motion:"120ms",space1:"0.25rem",space2:"0.5rem",fontSizeSm:"0.875rem",fontSizeLg:"1.125rem",motionFast:"80ms",motionSlow:"200ms",easing:"cubic-bezier(0.2, 0, 0, 1)",focusRing:"#245ad1",controlBorder:"#6b7889",success:"#1a7f37",warning:"#8a5c00"},s={...t,background:"#141b25",foreground:"#eef2f7",muted:"#aebbc9",accent:"#8fb1ff",border:"#465363",surface:"#202b39",danger:"#ffaaa4",focusRing:"#8fb1ff",controlBorder:"#8593a5",success:"#6fdd8b",warning:"#f2cc60"};function f(r){return Object.fromEntries(Object.entries(r).filter(e=>e[1]!==void 0).map(([e,o])=>[`--wp-${e.replace(/[A-Z]/g,n=>"-"+n.toLowerCase())}`,o]))}export{t as a,s as b,f as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function f(t,s){let n=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)([\s\S]*)$/.exec(t);if(!n)throw new Error("Invalid flow frontmatter");let{loadFrontmatter:o}=await import("./flow-parser.js"),r=o(n[1]);return i(typeof r=="object"&&r!==null?{...r,body:n[2]??""}:r,s)}function i(t,s){if(typeof t!="object"||t===null||Array.isArray(t))throw new Error("Invalid flow");let n=t;if(n.format!=="1.0"||typeof n.id!="string"||!n.id||typeof n.title!="string"||!n.title||!["prompt","structured"].includes(n.kind)||!Array.isArray(n.parameters)||!Array.isArray(n.tags)||!n.tags.every(r=>typeof r=="string")||typeof n.body!="string")throw new Error("Invalid flow");let o=new Set;for(let r of n.parameters){if(!r||typeof r.name!="string"||!r.name||o.has(r.name)||!["string","number","boolean"].includes(r.type)||typeof r.required!="boolean"||typeof r.label!="string"||r.default!==void 0&&typeof r.default!==r.type)throw new Error("Invalid flow parameter");o.add(r.name)}if(n.kind==="structured"){if(!Array.isArray(n.steps)||!n.steps.length)throw new Error("Invalid flow steps");for(let r of n.steps){if(!r||!s.includes(r.operation)||typeof r.arguments!="object"||r.arguments===null||Array.isArray(r.arguments))throw new Error("Unknown operation");for(let e of JSON.stringify(r.arguments).matchAll(/\{\{([^}]+)\}\}/g))if(!o.has(e[1]))throw new Error("Unknown parameter")}}else if(n.steps!==void 0)throw new Error("Prompt cannot contain steps");return n}function p(t,s){let n=Object.create(null);for(let r of t.parameters){let e=s[r.name]??r.default;if(e===void 0&&r.required)throw new Error("Missing parameter");if(e!==void 0&&typeof e!==r.type)throw new Error("Invalid parameter type");n[r.name]=e}let o=r=>{if(typeof r=="string"){let e=/^\{\{([^}]+)\}\}$/.exec(r);return e?n[e[1]]:r}return Array.isArray(r)?r.map(o):r&&typeof r=="object"?Object.fromEntries(Object.entries(r).map(([e,a])=>[e,o(a)])):r};return(t.steps??[]).map(r=>({operation:r.operation,arguments:o(r.arguments)}))}export{f as a,i as b,p as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as s}from"./chunk-TGL3DR2K.js";import{useId as c}from"react";import{Fragment as m,jsx as t,jsxs as f}from"react/jsx-runtime";function h({disabled:o,blocked:e,reason:a,label:d,onPress:r}){let{format:b,primitives:u}=s(),l=u.button,i=c(),n=e&&!o;return f(m,{children:[t(l,{disabled:o,"aria-disabled":n||void 0,"aria-describedby":n?i:void 0,onPress:r,children:d??b("chat.submit")}),n?t("span",{id:i,"data-reason":"submit",children:a}):null]})}export{h as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var K=["1.1","1.0"],J=["plans","flows","widgets","step-up","scheduled","form-fill","plan-recovery","plan-leave","plan-keep","reply-stop"];function W(e){return e.filter(a=>a!=="plan-leave"&&a!=="plan-keep"||e.includes("plan-recovery"))}function F(e,a=[],s){let o=K.find(c=>e.includes(c));if(!o)throw new Error("update-required");return{protocol:o,capabilities:W(J.filter(c=>a.includes(c)&&(!s||s.capabilities.includes(c))&&(c!=="form-fill"||o==="1.1")))}}function H(e){return{text:e.fallback,disabled:!0,update:!0}}var $={client:[],conversation:["client"],stream:["conversation"],connection:["stream"],recovery:["stream"],"plan-read":["conversation","connection"],"flow-load":["client"],"flow-run":["client"],binding:["client"],runner:["conversation","external"],invocation:["runner"]},U=new WeakMap;function q(e,a){if(a){let y=$[e],n=U.get(a)??"external";if(!y.includes(n))throw new Error(`A ${e} scope cannot have this parent`)}else if(e!=="client"&&e!=="runner")throw new Error(`A ${e} scope needs a parent`);let s=globalThis,o=new s.AbortController,c=s.AbortSignal?.any,p=(y,n,f=()=>o.abort())=>(U.set(y,e),{signal:y,abort:f,end:n});if(!a)return p(o.signal,()=>{});if(c)return p(c.call(s.AbortSignal,[a,o.signal]),()=>{});let b=()=>o.abort();a.aborted?o.abort():a.addEventListener("abort",b,{once:!0});let m=()=>a.removeEventListener("abort",b);return p(o.signal,m,()=>{m(),o.abort()})}function A(e,a){return e.aborted?(a(),()=>{}):(e.addEventListener("abort",a,{once:!0}),()=>e.removeEventListener("abort",a))}var k=class extends Error{constructor(){super("plan-read-refused"),this.name="PlanReadRefused"}},L=e=>e instanceof k?"plan-changed":"connection-lost";function j(e,a){return{proposed:["awaiting-confirmation","cancelled"],"awaiting-confirmation":["running","submitted","cancelled"],running:["undoing","completed","needs-attention"],undoing:["undone","needs-attention"],completed:["undoing"],submitted:[],undone:[],"needs-attention":["running","undoing"],cancelled:[]}[e].includes(a)}var C=new Error("retired");function z(e){let a=null,s=new Set,o,c=q("runner",e.signal),p=!1,b,m=async(n,f)=>{if(f.signal.aborted)throw C;let t=await e.read(n);return f.signal.aborted||e.onRecord?.(t),t},y=async(n,f,t)=>{let r;try{r=await m(n,t)}catch(i){throw i!==C&&!t.signal.aborted&&t.acceptance&&e.interrupted&&await e.interrupted(n,L(i)),i}if(t.signal.aborted)return;if(r.recovery&&(t.acceptance?.planId!==n||t.acceptance.executionId!==r.recovery.executionId))throw new Error("unauthorized-run");if(r.plan.kind!=="immediate"||r.plan.stage!=="final"||r.state!=="running")return;if(!f||r.plan.digest!==f)throw new Error("invalid-plan");let u={...r.plan,steps:r.plan.steps.map(i=>({...i,request:i.request?{...i.request,headers:{...i.request.headers}}:void 0}))},S=u.steps,O=S.filter(i=>i.undo==="none");if(O.length>1||O.length===1&&S.at(-1)?.undo!=="none"||S.some(i=>!i.request||!["POST","PUT","PATCH"].includes(i.request.method)))throw new Error("invalid-plan");let x,R=!1,E=()=>{R=!0,x!==void 0&&e.clock?.clearTimeout(x),x=void 0},N=A(t.signal,E),l=async i=>{E(),t.context&&delete t.context.stepUpCode,!t.signal.aborted&&(i&&e.interrupted&&await e.interrupted(n,i),t.signal.aborted||await m(n,t).catch(()=>{}))},v=async()=>{try{return await m(n,t)}catch(i){throw i!==C&&await l(L(i)),i}},T=async()=>{if(!(R||t.signal.aborted)){try{await e.heartbeat(n,t.acceptance)}catch{t.signal.aborted||(p=!0)}!R&&!t.signal.aborted&&e.clock&&(x=e.clock.setTimeout(()=>{x=void 0,T()},e.heartbeatMs??1e4))}};await T();try{for(let[i,g]of S.entries()){if(t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();if(r=await v(),t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();if(r.state!=="running")return;if(r.outcomes.some(d=>d.stepId===g.id&&d.attributed&&d.status>=200&&d.status<300))continue;let P=r.plan;if(P.kind!=="immediate"||P.stage!=="final"||P.digest!==u.digest||JSON.stringify(P.steps[i]?.request)!==JSON.stringify(g.request))throw await l("plan-changed"),new Error("invalid-plan");let h=g.request,w={signal:t.signal,planId:n,stepId:g.id,headers:{...h.headers,"Waypoint-Step":`${n}.${i}`,...t.acceptance?{"Waypoint-Execution":t.acceptance.executionId,"Waypoint-Fence":String(t.acceptance.fence)}:{}}};if(g.stepUp){let d=await e.stepUp?.(n,g.id);if(!d)return l("step-up-failed");if(t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();if(r=await v(),r.state!=="running")return;if(r.plan.kind!=="immediate"||r.plan.stage!=="final"||r.plan.digest!==u.digest||JSON.stringify(r.plan.steps[i]?.request)!==JSON.stringify(h))throw await l("plan-changed"),new Error("invalid-plan");if(r.outcomes.some(I=>I.stepId===g.id&&I.attributed&&I.status>=200&&I.status<300))continue;w.stepUpCode=d}if(t.signal.aborted)return;if(p)return l("renewal-refused");if(s.has(n))return l();try{t.context=w,await e.request({...h,headers:{...h.headers}},w)}catch{return delete w.stepUpCode,t.context===w&&(t.context=void 0),l("step-failed")}finally{delete w.stepUpCode,t.context===w&&(t.context=void 0)}if(r=await v(),!r.outcomes.some(d=>d.stepId===g.id&&d.attributed&&d.status>=200&&d.status<300))return l("attribution-missing");if(s.has(n))return l()}}finally{E(),N()}};return{run(n,f,t){if(a)return o===n?a:Promise.reject(new Error("active-plan"));if(s.has(n)||c.signal.aborted)return Promise.resolve();o=n,p=!1;let r=q("invocation",c.signal),u={scope:r,signal:r.signal,...t?{acceptance:t}:{}};return A(u.signal,()=>{u.context&&delete u.context.stepUpCode}),b=u,a=y(n,f,u).catch(S=>{if(S!==C)throw S}).finally(()=>{r.end(),b===u&&(b=void 0),a=null,o=void 0}),a},stop(n=o){n&&s.add(n)},interrupt(){b?.scope.abort()},dispose(){c.abort()}}}export{K as a,J as b,W as c,F as d,H as e,q as f,A as g,k as h,j as i,z as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=u=>JSON.parse(JSON.stringify(u===void 0?null:u));function F(u){let f=!1,s={pending:!1,fields:Object.create(null)},v=new Set,l,g=Object.create(null);for(let e of u.fields){if(Object.hasOwn(g,e.name))throw new Error("Duplicate field");e.tier==="low"&&(g[e.name]={label:e.label,value:b(e.value),revision:0,edited:!1})}s={fields:g,pending:!1};let a=[],O=e=>Object.keys(e.fields).filter(i=>s.fields[i]?.revision===e.fields[i].revision),c=e=>{s={fields:e,pending:l!==void 0},s={...s,fills:a.map(i=>({id:i.id,fields:O(i)})).filter(i=>i.fields.length)};for(let i of v)i()},m=(e,i)=>c({...s.fields,[e]:i});return{getSnapshot:()=>s,subscribe(e){return v.add(e),()=>{v.delete(e)}},begin(e){if(f)throw new Error("Disposed form");let i=e.field?[e.field]:Object.keys(s.fields);if(!i.length||i.some(t=>!Object.hasOwn(s.fields,t)))throw new Error("Unknown field");let n=u.ids();return l={id:n,revisions:Object.fromEntries(i.map(t=>[t,s.fields[t].revision]))},c({...s.fields}),b({requestId:n,text:e.text,references:e.references??[],attachments:e.attachments??[],...e.field?{field:e.field}:{},fields:i.map(t=>({name:t,label:s.fields[t].label,tier:"low",value:s.fields[t].value}))})},receive(e){if(!e||typeof e!="object")return!1;let i=e;if(f||!l||i.requestId!==l.id||!i.values||typeof i.values!="object"||Array.isArray(i.values))return!1;let n=Object.keys(l.revisions);if(Object.keys(i.values).length!==n.length||n.some(o=>!Object.hasOwn(i.values,o)))return!1;for(let o of n){let r=i.values[o];if(!r||!Object.hasOwn(r,"value")||r.label!==void 0&&typeof r.label!="string"||!r.validation||!["valid","invalid"].includes(r.validation.status)||!Array.isArray(r.validation.messages)||r.validation.messages.some(p=>typeof p!="string")||r.validation.guidance!==void 0&&typeof r.validation.guidance!="string")return!1}let t={...s.fields},d={id:l.id,fields:{}};for(let o of n){let r=t[o],p=b(i.values[o]);r.edited||r.revision!==l.revisions[o]?t[o]={...r,replacement:{...p,revision:r.revision,fill:l.id}}:(t[o]={...r,...p,revision:r.revision+1,edited:!1,replacement:void 0},d.fields[o]={draft:r,revision:r.revision+1})}return Object.keys(d.fields).length&&(a=[...a,d].slice(-20)),l=void 0,c(t),!0},edit(e,i){if(!Object.hasOwn(s.fields,e))return;let n=s.fields[e];f||!n||m(e,{...n,value:b(i),revision:n.revision+1,edited:!0,validation:void 0,replacement:void 0,localInvalid:void 0,localText:void 0})},markEdited(e,i){if(!Object.hasOwn(s.fields,e))return;let n=s.fields[e];f||!n||m(e,{...n,revision:n.revision+1,edited:!0,validation:void 0,replacement:void 0,localInvalid:!0,localText:i})},revert(e){let i=a.find(t=>t.id===e);if(f||l||!i)return!1;let n={...s.fields};for(let t of O(i)){let{draft:d}=i.fields[t];n[t]={...n[t],value:d.value,validation:d.validation,label:d.label,revision:n[t].revision+1,edited:!1,localInvalid:void 0,localText:void 0}}for(let[t,d]of Object.entries(n))d.replacement?.fill===e&&(n[t]={...d,replacement:void 0});return a=a.filter(t=>t!==i),c(n),!0},failRequest(e){l?.id===e&&(l=void 0,c({...s.fields}))},replace(e,i){if(!Object.hasOwn(s.fields,e))return!1;let n=s.fields[e];return f||!n?.replacement||n.revision!==i||n.replacement.revision!==i?!1:(m(e,{...n,value:n.replacement.value,validation:n.replacement.validation,revision:i+1,edited:!1,replacement:void 0,localInvalid:void 0,localText:void 0}),!0)},cancelReplacement(e){if(!Object.hasOwn(s.fields,e))return;let i=s.fields[e];i&&!f&&m(e,{...i,replacement:void 0})},cancel(){l=void 0,c({...s.fields})},dispose(){f=!0,l=void 0,a=[],c({}),v.clear()}}}export{F as a};
|