1import{qf as y}from"./chunk-2A6J2EXV.js";import"./chunk-V2PUSZ6A.js";import"./chunk-V532WGDG.js";import{$a as r,Dc as n,Ec as D,Fc as x,Qb as b,Rb as v,Sb as g,Tb as o,Ub as e,Vb as t,Wb as m,mb as f,mc as p,wa as s}from"./chunk-TMX3J7QX.js";import"./chunk-FPEONYEH.js";function N(u,h){if(u&1&&(e(0,"div"),n(1),t()),u&2){let a=h.$implicit;r(),D(a)}}function P(u,h){u&1&&(e(0,"div",24),n(1,"No changes yet. Start the simulation or use nudge buttons."),t())}var $=(()=>{class u{price=s(12.345);price2=s(98.76);variation=s(.52);running=s(!1);interval=s(1500);flashDuration=s(600);log=s([]);timerId=null;toggleSimulation(){this.running()?this.stopSimulation():this.startSimulation()}nudgeUp(){this.applyDelta(Math.random()*.5+.01)}nudgeDown(){this.applyDelta(-(Math.random()*.5+.01))}onIntervalChange(a){let l=+a.target.value;l>=100&&(this.interval.set(l),this.running()&&(this.stopSimulation(),this.startSimulation()))}onFlashDurationChange(a){let l=+a.target.value;l>=100&&this.flashDuration.set(l)}startSimulation(){this.running.set(!0),this.timerId=setInterval(()=>{let a=(Math.random()-.5)*1;this.applyDelta(a)},this.interval())}stopSimulation(){this.running.set(!1),this.timerId&&(clearInterval(this.timerId),this.timerId=null)}applyDelta(a){let l=this.price(),i=Math.max(.01,+(l+a).toFixed(5));this.price.set(i);let d=this.price2(),c=(Math.random()-.5)*.8;this.price2.set(Math.max(.01,+(d+c).toFixed(5)));let S=this.variation(),_=(Math.random()-.5)*.3;this.variation.set(+(S+_).toFixed(5));let E=a>=0?"\u25B2":"\u25BC",w=new Date().toLocaleTimeString();this.log.update(C=>[`[${w}] ${E} ${l.toFixed(3)} \u2192 ${i.toFixed(3)} (${a>=0?"+":""}${a.toFixed(5)})`,...C].slice(0,20))}static \u0275fac=function(l){return new(l||u)};static \u0275cmp=f({type:u,selectors:[["app-label-price-demo"]],decls:73,vars:37,consts:[[1,"p-6","flex","flex-col","gap-6","max-w-4xl"],[1,"text-xl","font-bold"],[1,"text-muted","text-sm"],[1,"flex","flex-wrap","gap-4","items-end"],[1,"flex","flex-col","gap-1"],[1,"text-sm","font-semibold"],["type","number",1,"border","rounded","px-2","py-1","w-28",3,"input","value"],[1,"bg-primary","text-white","px-4","py-1.5","rounded","font-semibold",3,"click"],[1,"border","border-primary","text-primary","px-4","py-1.5","rounded","font-semibold",3,"click"],[1,"border","rounded-lg","overflow-hidden"],[1,"w-full","text-sm"],[1,"bg-surface-100"],[1,"text-left","px-4","py-2"],[1,"text-right","px-4","py-2"],[1,"border-t"],[1,"px-4","py-3","font-medium"],[1,"text-xs","bg-surface-100","px-1","rounded"],[1,"px-4","py-3","text-right"],["currency","EUR",3,"value","colored","tabularNums","flashDuration"],[3,"value","colored","addPlusSymbol","tabularNums","flashDuration","showCurrency"],[3,"value","colored","tabularNums","flashDuration","showCurrency"],[1,"px-4","py-3","text-right","flex","gap-6","justify-end"],["currency","USD",3,"value","colored","tabularNums","flashDuration"],[1,"border","rounded","p-3","bg-surface-100","text-xs","font-mono","max-h-48","overflow-y-auto"],[1,"text-muted"]],template:function(l,i){l&1&&(e(0,"div",0)(1,"h2",1),n(2,"Label Price \u2014 Flash Animation Demo"),t(),e(3,"p",2),n(4," Simulates real-time price changes. The text flashes green when the value goes up and red when it goes down. Flash is disabled when "),e(5,"code"),n(6,"colored"),t(),n(7," is "),e(8,"code"),n(9,"true"),t(),n(10," (static coloring takes priority). "),t(),e(11,"div",3)(12,"div",4)(13,"label",5),n(14,"Interval (ms)"),t(),e(15,"input",6),p("input",function(c){return i.onIntervalChange(c)}),t()(),e(16,"div",4)(17,"label",5),n(18,"Flash Duration (ms)"),t(),e(19,"input",6),p("input",function(c){return i.onFlashDurationChange(c)}),t()(),e(20,"button",7),p("click",function(){return i.toggleSimulation()}),n(21),t(),e(22,"button",8),p("click",function(){return i.nudgeUp()}),n(23," \u2191 Nudge Up "),t(),e(24,"button",8),p("click",function(){return i.nudgeDown()}),n(25," \u2193 Nudge Down "),t()(),e(26,"div",9)(27,"table",10)(28,"thead",11)(29,"tr")(30,"th",12),n(31,"Scenario"),t(),e(32,"th",13),n(33,"Price"),t()()(),e(34,"tbody")(35,"tr",14)(36,"td",15),n(37," Flash enabled "),e(38,"code",16),n(39,'[colored]="false"'),t()(),e(40,"td",17),m(41,"lib-label-price",18),t()(),e(42,"tr",14)(43,"td",15),n(44," No flash "),e(45,"code",16),n(46,'[colored]="true"'),t()(),e(47,"td",17),m(48,"lib-label-price",18),t()(),e(49,"tr",14)(50,"td",15),n(51,"Flash + plus symbol"),t(),e(52,"td",17),m(53,"lib-label-price",19),t()(),e(54,"tr",14)(55,"td",15),n(56,"Flash without currency"),t(),e(57,"td",17),m(58,"lib-label-price",20),t()(),e(59,"tr",14)(60,"td",15),n(61,"Multiple labels (watchlist row)"),t(),e(62,"td",21),m(63,"lib-label-price",18)(64,"lib-label-price",22)(65,"lib-label-price",19),t()()()()(),e(66,"div",4)(67,"h3",5),n(68,"Change Log (last 20)"),t(),e(69,"div",23),v(70,N,2,1,"div",null,b,!1,P,2,0,"div",24),t()()()),l&2&&(r(15),o("value",i.interval()),r(4),o("value",i.flashDuration()),r(2),x(" ",i.running()?"Stop":"Start"," Simulation "),r(20),o("value",i.price()
1)("colored",!1)("tabularNums",!0)("flashDuration",i.flashDuration()),r(7),o("value",i.price())("colored",!0)("tabularNums",!0)("flashDuration",i.flashDuration()),r(5),o("value",i.variation())("colored",!1)("addPlusSymbol",!0)("tabularNums",!0)("flashDuration",i.flashDuration())("showCurrency",!1),r(5),o("value",i.price())("colored",!1)("tabularNums",!0)("flashDuration",i.flashDuration())("showCurrency",!1),r(5),o("value",i.price())("colored",!1)("tabularNums",!0)("flashDuration",i.flashDuration()),r(),o("value",i.price2())("colored",!1)("tabularNums",!0)("flashDuration",i.flashDuration()),r(),o("value",i.variation())("colored",!1)("addPlusSymbol",!0)("tabularNums",!0)("flashDuration",i.flashDuration())("showCurrency",!1),r(5),g(i.log()))},dependencies:[y],encapsulation:2,changeDetection:0})}return u})();export{$ as LabelPriceDemoComponent}; 2/**i18n:19412ffe3d8d9f34a6b0cbb634f74d13b19775419406ffebe3236b0eba00a2e5*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.